X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=src%2Fmoonshot-identity-request.c;h=aab4a266dd9cbda347bb12f3ac619a21a5e61960;hb=7ab04d0154b489fd9496a34b00f26e189def2ccb;hp=9e8c57cff3d6fec5c9ce129ca2035d17536beb77;hpb=ff75eafeec837c9a81c1d7bcf936970c403d0825;p=moonshot-ui.git diff --git a/src/moonshot-identity-request.c b/src/moonshot-identity-request.c index 9e8c57c..aab4a26 100644 --- a/src/moonshot-identity-request.c +++ b/src/moonshot-identity-request.c @@ -30,18 +30,18 @@ typedef struct _IdentityRequestPrivate IdentityRequestPrivate; typedef struct _IdCard IdCard; typedef struct _IdCardClass IdCardClass; -#define TYPE_MAIN_WINDOW (main_window_get_type ()) -#define MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN_WINDOW, MainWindow)) -#define MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN_WINDOW, MainWindowClass)) -#define IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN_WINDOW)) -#define IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN_WINDOW)) -#define MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN_WINDOW, MainWindowClass)) - -typedef struct _MainWindow MainWindow; -typedef struct _MainWindowClass MainWindowClass; +#define TYPE_IDENTITY_MANAGER_VIEW (identity_manager_view_get_type ()) +#define IDENTITY_MANAGER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IDENTITY_MANAGER_VIEW, IdentityManagerView)) +#define IDENTITY_MANAGER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IDENTITY_MANAGER_VIEW, IdentityManagerViewClass)) +#define IS_IDENTITY_MANAGER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IDENTITY_MANAGER_VIEW)) +#define IS_IDENTITY_MANAGER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IDENTITY_MANAGER_VIEW)) +#define IDENTITY_MANAGER_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IDENTITY_MANAGER_VIEW, IdentityManagerViewClass)) + +typedef struct _IdentityManagerView IdentityManagerView; +typedef struct _IdentityManagerViewClass IdentityManagerViewClass; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define _g_free0(var) (var = (g_free (var), NULL)) -typedef struct _Block1Data Block1Data; +typedef struct _Block2Data Block2Data; typedef void (*ReturnIdentityCallback) (IdentityRequest* request, void* user_data); struct _IdentityRequest { @@ -60,13 +60,13 @@ struct _IdentityRequestClass { }; struct _IdentityRequestPrivate { - MainWindow* main_window; + IdentityManagerView* main_window; ReturnIdentityCallback callback; gpointer callback_target; GDestroyNotify callback_target_destroy_notify; }; -struct _Block1Data { +struct _Block2Data { int _ref_count_; IdentityRequest * self; ReturnIdentityCallback cb; @@ -79,22 +79,22 @@ static gpointer identity_request_parent_class = NULL; GType identity_request_get_type (void) G_GNUC_CONST; GType id_card_get_type (void) G_GNUC_CONST; -GType main_window_get_type (void) G_GNUC_CONST; +GType identity_manager_view_get_type (void) G_GNUC_CONST; #define IDENTITY_REQUEST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_IDENTITY_REQUEST, IdentityRequestPrivate)) enum { IDENTITY_REQUEST_DUMMY_PROPERTY }; -IdentityRequest* identity_request_new (MainWindow* main_window, const char* nai, const char* password, const char* service); -IdentityRequest* identity_request_construct (GType object_type, MainWindow* main_window, const char* nai, const char* password, const char* service); -IdentityRequest* identity_request_new_default (MainWindow* main_window); -IdentityRequest* identity_request_construct_default (GType object_type, MainWindow* main_window); +IdentityRequest* identity_request_new (IdentityManagerView* main_window, const char* nai, const char* password, const char* service); +IdentityRequest* identity_request_construct (GType object_type, IdentityManagerView* main_window, const char* nai, const char* password, const char* service); +IdentityRequest* identity_request_new_default (IdentityManagerView* main_window); +IdentityRequest* identity_request_construct_default (GType object_type, IdentityManagerView* main_window); void identity_request_set_callback (IdentityRequest* self, ReturnIdentityCallback cb, void* cb_target, GDestroyNotify cb_target_destroy_notify); -static void _lambda0_ (IdentityRequest* IdCard, Block1Data* _data1_); +static void _lambda0_ (IdentityRequest* IdCard, Block2Data* _data2_); static void __lambda0__return_identity_callback (IdentityRequest* request, gpointer self); -static Block1Data* block1_data_ref (Block1Data* _data1_); -static void block1_data_unref (Block1Data* _data1_); +static Block2Data* block2_data_ref (Block2Data* _data2_); +static void block2_data_unref (Block2Data* _data2_); gboolean identity_request_execute (IdentityRequest* self); -void main_window_select_identity (MainWindow* self, IdentityRequest* request); +void identity_manager_view_select_identity (IdentityManagerView* self, IdentityRequest* request); void identity_request_return_identity (IdentityRequest* self, IdCard* id_card); static void identity_request_finalize (GObject* obj); @@ -105,9 +105,9 @@ static gpointer _g_object_ref0 (gpointer self) { } -IdentityRequest* identity_request_construct (GType object_type, MainWindow* main_window, const char* nai, const char* password, const char* service) { +IdentityRequest* identity_request_construct (GType object_type, IdentityManagerView* main_window, const char* nai, const char* password, const char* service) { IdentityRequest * self = NULL; - MainWindow* _tmp0_; + IdentityManagerView* _tmp0_; char* _tmp1_; char* _tmp2_; char* _tmp3_; @@ -124,14 +124,14 @@ IdentityRequest* identity_request_construct (GType object_type, MainWindow* main } -IdentityRequest* identity_request_new (MainWindow* main_window, const char* nai, const char* password, const char* service) { +IdentityRequest* identity_request_new (IdentityManagerView* main_window, const char* nai, const char* password, const char* service) { return identity_request_construct (TYPE_IDENTITY_REQUEST, main_window, nai, password, service); } -IdentityRequest* identity_request_construct_default (GType object_type, MainWindow* main_window) { +IdentityRequest* identity_request_construct_default (GType object_type, IdentityManagerView* main_window) { IdentityRequest * self = NULL; - MainWindow* _tmp0_; + IdentityManagerView* _tmp0_; g_return_val_if_fail (main_window != NULL, NULL); self = (IdentityRequest*) g_object_new (object_type, NULL); self->priv->main_window = (_tmp0_ = _g_object_ref0 (main_window), _g_object_unref0 (self->priv->main_window), _tmp0_); @@ -140,16 +140,16 @@ IdentityRequest* identity_request_construct_default (GType object_type, MainWind } -IdentityRequest* identity_request_new_default (MainWindow* main_window) { +IdentityRequest* identity_request_new_default (IdentityManagerView* main_window) { return identity_request_construct_default (TYPE_IDENTITY_REQUEST, main_window); } -static void _lambda0_ (IdentityRequest* IdCard, Block1Data* _data1_) { +static void _lambda0_ (IdentityRequest* IdCard, Block2Data* _data2_) { IdentityRequest * self; - self = _data1_->self; + self = _data2_->self; g_return_if_fail (IdCard != NULL); - _data1_->cb (IdCard, _data1_->cb_target); + _data2_->cb (IdCard, _data2_->cb_target); } @@ -158,43 +158,43 @@ static void __lambda0__return_identity_callback (IdentityRequest* request, gpoin } -static Block1Data* block1_data_ref (Block1Data* _data1_) { - g_atomic_int_inc (&_data1_->_ref_count_); - return _data1_; +static Block2Data* block2_data_ref (Block2Data* _data2_) { + g_atomic_int_inc (&_data2_->_ref_count_); + return _data2_; } -static void block1_data_unref (Block1Data* _data1_) { - if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) { - _g_object_unref0 (_data1_->self); - (_data1_->cb_target_destroy_notify == NULL) ? NULL : (_data1_->cb_target_destroy_notify (_data1_->cb_target), NULL); - _data1_->cb = NULL; - _data1_->cb_target = NULL; - _data1_->cb_target_destroy_notify = NULL; - g_slice_free (Block1Data, _data1_); +static void block2_data_unref (Block2Data* _data2_) { + if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) { + _g_object_unref0 (_data2_->self); + (_data2_->cb_target_destroy_notify == NULL) ? NULL : (_data2_->cb_target_destroy_notify (_data2_->cb_target), NULL); + _data2_->cb = NULL; + _data2_->cb_target = NULL; + _data2_->cb_target_destroy_notify = NULL; + g_slice_free (Block2Data, _data2_); } } void identity_request_set_callback (IdentityRequest* self, ReturnIdentityCallback cb, void* cb_target, GDestroyNotify cb_target_destroy_notify) { - Block1Data* _data1_; + Block2Data* _data2_; ReturnIdentityCallback _tmp0_; g_return_if_fail (self != NULL); - _data1_ = g_slice_new0 (Block1Data); - _data1_->_ref_count_ = 1; - _data1_->self = g_object_ref (self); - _data1_->cb = cb; - _data1_->cb_target = cb_target; - _data1_->cb_target_destroy_notify = cb_target_destroy_notify; - self->priv->callback = (_tmp0_ = __lambda0__return_identity_callback, ((self->priv->callback_target_destroy_notify == NULL) ? NULL : (self->priv->callback_target_destroy_notify (self->priv->callback_target), NULL), self->priv->callback = NULL, self->priv->callback_target = NULL, self->priv->callback_target_destroy_notify = NULL), self->priv->callback_target = block1_data_ref (_data1_), self->priv->callback_target_destroy_notify = block1_data_unref, _tmp0_); - block1_data_unref (_data1_); + _data2_ = g_slice_new0 (Block2Data); + _data2_->_ref_count_ = 1; + _data2_->self = g_object_ref (self); + _data2_->cb = cb; + _data2_->cb_target = cb_target; + _data2_->cb_target_destroy_notify = cb_target_destroy_notify; + self->priv->callback = (_tmp0_ = __lambda0__return_identity_callback, ((self->priv->callback_target_destroy_notify == NULL) ? NULL : (self->priv->callback_target_destroy_notify (self->priv->callback_target), NULL), self->priv->callback = NULL, self->priv->callback_target = NULL, self->priv->callback_target_destroy_notify = NULL), self->priv->callback_target = block2_data_ref (_data2_), self->priv->callback_target_destroy_notify = block2_data_unref, _tmp0_); + block2_data_unref (_data2_); } gboolean identity_request_execute (IdentityRequest* self) { gboolean result = FALSE; g_return_val_if_fail (self != NULL, FALSE); - main_window_select_identity (self->priv->main_window, self); + identity_manager_view_select_identity (self->priv->main_window, self); result = FALSE; return result; }