...
 
Commits (4)
......@@ -38,58 +38,50 @@
#include <gio/gio.h>
#include <glib.h>
G_DEFINE_TYPE (SignonAuthService, signon_auth_service, G_TYPE_OBJECT);
/**
* SignonAuthServiceClass:
*
* Opaque struct. Use the accessor functions below.
*/
struct _SignonAuthServicePrivate
/**
* SignonAuthService:
*
* Opaque struct. Use the accessor functions below.
*/
struct _SignonAuthService
{
SsoAuthService *proxy;
GObject parent_instance;
SsoAuthService *proxy;
};
G_DEFINE_TYPE (SignonAuthService, signon_auth_service, G_TYPE_OBJECT);
#define SIGNON_AUTH_SERVICE_PRIV(obj) (SIGNON_AUTH_SERVICE(obj)->priv)
static void
signon_auth_service_init (SignonAuthService *auth_service)
{
SignonAuthServicePrivate *priv;
priv = G_TYPE_INSTANCE_GET_PRIVATE (auth_service, SIGNON_TYPE_AUTH_SERVICE,
SignonAuthServicePrivate);
auth_service->priv = priv;
/* Create the proxy */
priv->proxy = sso_auth_service_get_instance ();
auth_service->proxy = sso_auth_service_get_instance ();
}
static void
signon_auth_service_dispose (GObject *object)
{
SignonAuthService *auth_service = SIGNON_AUTH_SERVICE (object);
SignonAuthServicePrivate *priv = auth_service->priv;
if (priv->proxy)
{
g_object_unref (priv->proxy);
priv->proxy = NULL;
}
g_clear_object (&auth_service->proxy);
G_OBJECT_CLASS (signon_auth_service_parent_class)->dispose (object);
}
static void
signon_auth_service_finalize (GObject *object)
{
G_OBJECT_CLASS (signon_auth_service_parent_class)->finalize (object);
}
static void
signon_auth_service_class_init (SignonAuthServiceClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (object_class, sizeof (SignonAuthServicePrivate));
object_class->dispose = signon_auth_service_dispose;
object_class->finalize = signon_auth_service_finalize;
}
static void
......@@ -167,14 +159,12 @@ void signon_auth_service_get_methods (SignonAuthService *auth_service,
GAsyncReadyCallback callback,
gpointer user_data)
{
SignonAuthServicePrivate *priv = NULL;
GTask *task = NULL;
g_return_if_fail (SIGNON_IS_AUTH_SERVICE (auth_service));
priv = SIGNON_AUTH_SERVICE_PRIV (auth_service);
task = g_task_new (auth_service, cancellable, callback, user_data);
sso_auth_service_call_query_methods (priv->proxy, cancellable, _signon_auth_service_finish_query_methods, task);
sso_auth_service_call_query_methods (auth_service->proxy, cancellable, _signon_auth_service_finish_query_methods, task);
}
/**
......@@ -217,13 +207,11 @@ signon_auth_service_get_methods_sync (SignonAuthService *auth_service,
GCancellable *cancellable,
GError **error)
{
SignonAuthServicePrivate *priv;
gchar **methods_array = NULL;
g_return_val_if_fail (SIGNON_IS_AUTH_SERVICE (auth_service), NULL);
priv = SIGNON_AUTH_SERVICE_PRIV (auth_service);
sso_auth_service_call_query_methods_sync (priv->proxy, &methods_array, cancellable, error);
sso_auth_service_call_query_methods_sync (auth_service->proxy, &methods_array, cancellable, error);
return methods_array;
}
......@@ -247,14 +235,12 @@ signon_auth_service_get_mechanisms (SignonAuthService *auth_service,
GAsyncReadyCallback callback,
gpointer user_data)
{
SignonAuthServicePrivate *priv = NULL;
GTask *task = NULL;
g_return_if_fail (SIGNON_IS_AUTH_SERVICE (auth_service));
priv = SIGNON_AUTH_SERVICE_PRIV (auth_service);
task = g_task_new (auth_service, cancellable, callback, user_data);
sso_auth_service_call_query_mechanisms (priv->proxy, method, cancellable, _signon_auth_service_finish_query_mechanisms, task);
sso_auth_service_call_query_mechanisms (auth_service->proxy, method, cancellable, _signon_auth_service_finish_query_mechanisms, task);
}
/**
......@@ -299,13 +285,11 @@ signon_auth_service_get_mechanisms_sync (SignonAuthService *auth_service,
GCancellable *cancellable,
GError **error)
{
SignonAuthServicePrivate *priv;
gchar **mechanisms_array = NULL;
g_return_val_if_fail (SIGNON_IS_AUTH_SERVICE (auth_service), NULL);
priv = SIGNON_AUTH_SERVICE_PRIV (auth_service);
sso_auth_service_call_query_mechanisms_sync (priv->proxy, method, &mechanisms_array, cancellable, error);
sso_auth_service_call_query_mechanisms_sync (auth_service->proxy, method, &mechanisms_array, cancellable, error);
return mechanisms_array;
}
......@@ -31,39 +31,8 @@
G_BEGIN_DECLS
#define SIGNON_TYPE_AUTH_SERVICE (signon_auth_service_get_type ())
#define SIGNON_AUTH_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SIGNON_TYPE_AUTH_SERVICE, SignonAuthService))
#define SIGNON_AUTH_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SIGNON_TYPE_AUTH_SERVICE, SignonAuthServiceClass))
#define SIGNON_IS_AUTH_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SIGNON_TYPE_AUTH_SERVICE))
#define SIGNON_IS_AUTH_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SIGNON_TYPE_AUTH_SERVICE))
#define SIGNON_AUTH_SERVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SIGNON_TYPE_AUTH_SERVICE, SignonAuthServiceClass))
typedef struct _SignonAuthServiceClass SignonAuthServiceClass;
typedef struct _SignonAuthServicePrivate SignonAuthServicePrivate;
typedef struct _SignonAuthService SignonAuthService;
/**
* SignonAuthServiceClass:
*
* Opaque struct. Use the accessor functions below.
*/
struct _SignonAuthServiceClass
{
GObjectClass parent_class;
};
/**
* SignonAuthService:
*
* Opaque struct. Use the accessor functions below.
*/
struct _SignonAuthService
{
GObject parent_instance;
SignonAuthServicePrivate *priv;
};
GType signon_auth_service_get_type (void) G_GNUC_CONST;
#define SIGNON_TYPE_AUTH_SERVICE signon_auth_service_get_type ()
G_DECLARE_FINAL_TYPE (SignonAuthService, signon_auth_service, SIGNON, AUTH_SERVICE, GObject)
SignonAuthService *signon_auth_service_new ();
......
This diff is collapsed.
......@@ -109,38 +109,8 @@ typedef enum {
#define SIGNON_SESSION_DATA_RENEW_TOKEN "RenewToken"
#define SIGNON_TYPE_AUTH_SESSION (signon_auth_session_get_type ())
#define SIGNON_AUTH_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SIGNON_TYPE_AUTH_SESSION, SignonAuthSession))
#define SIGNON_AUTH_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SIGNON_TYPE_AUTH_SESSION, SignonAuthSessionClass))
#define SIGNON_IS_AUTH_SESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SIGNON_TYPE_AUTH_SESSION))
#define SIGNON_IS_AUTH_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SIGNON_TYPE_AUTH_SESSION))
#define SIGNON_AUTH_SESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SIGNON_TYPE_AUTH_SESSION, SignonAuthSessionClass))
typedef struct _SignonAuthSession SignonAuthSession;
typedef struct _SignonAuthSessionPrivate SignonAuthSessionPrivate;
typedef struct _SignonAuthSessionClass SignonAuthSessionClass;
/**
* SignonAuthSession:
*
* Opaque struct. Use the accessor functions below.
*/
struct _SignonAuthSession {
GObject parent;
SignonAuthSessionPrivate *priv;
};
/**
* SignonAuthSessionClass:
*
* Opaque struct. Use the accessor functions below.
*/
struct _SignonAuthSessionClass {
GObjectClass parent;
};
GType signon_auth_session_get_type (void) G_GNUC_CONST;
#define SIGNON_TYPE_AUTH_SESSION signon_auth_session_get_type ()
G_DECLARE_FINAL_TYPE (SignonAuthSession, signon_auth_session, SIGNON, AUTH_SESSION, GObject)
SignonAuthSession *signon_auth_session_new(gint id,
const gchar *method_name,
......
......@@ -87,6 +87,8 @@ void signon_identity_info_add_access_control (SignonIdentityInfo *info,
void signon_identity_info_set_identity_type (SignonIdentityInfo *info,
SignonIdentityType type);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SignonIdentityInfo, signon_identity_info_free);
G_END_DECLS
#endif /* _SIGNON_IDENTITY_INFO_H_ */
This diff is collapsed.
......@@ -32,39 +32,8 @@
G_BEGIN_DECLS
#define SIGNON_TYPE_IDENTITY (signon_identity_get_type ())
#define SIGNON_IDENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SIGNON_TYPE_IDENTITY, SignonIdentity))
#define SIGNON_IDENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SIGNON_TYPE_IDENTITY, SignonIdentityClass))
#define SIGNON_IS_IDENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SIGNON_TYPE_IDENTITY))
#define SIGNON_IS_IDENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SIGNON_TYPE_IDENTITY))
#define SIGNON_IDENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SIGNON_TYPE_IDENTITY, SignonIdentityClass))
typedef struct _SignonIdentityClass SignonIdentityClass;
typedef struct _SignonIdentityPrivate SignonIdentityPrivate;
typedef struct _SignonIdentity SignonIdentity;
/**
* SignonIdentityClass:
*
* Opaque struct. Use the accessor functions below.
*/
struct _SignonIdentityClass
{
GObjectClass parent_class;
};
/**
* SignonIdentity:
*
* Opaque struct. Use the accessor functions below.
*/
struct _SignonIdentity
{
GObject parent_instance;
SignonIdentityPrivate *priv;
};
GType signon_identity_get_type (void) G_GNUC_CONST;
#define SIGNON_TYPE_IDENTITY signon_identity_get_type ()
G_DECLARE_FINAL_TYPE (SignonIdentity, signon_identity, SIGNON, IDENTITY, GObject)
SignonIdentity *signon_identity_new_from_db (guint32 id);
SignonIdentity *signon_identity_new ();
......
......@@ -50,6 +50,8 @@ const gchar *signon_security_context_get_system_context (const SignonSecurityCon
void signon_security_context_set_application_context (SignonSecurityContext *ctx, const gchar *application_context);
void signon_security_context_set_system_context (SignonSecurityContext *ctx, const gchar *system_context);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SignonSecurityContext, signon_security_context_free);
G_END_DECLS
#endif /* _SIGNON_SECURITY_CONTEXT_H_ */