diff options
author | Darin Adler <darin@src.gnome.org> | 2001-11-04 21:41:24 +0000 |
---|---|---|
committer | Darin Adler <darin@src.gnome.org> | 2001-11-04 21:41:24 +0000 |
commit | bdcd47873fc00c8f0013a2ecc85731622b961326 (patch) | |
tree | 55a16398d6ad6c5ec459a2be9ce8d812338295c8 /libnautilus | |
parent | 137cfdb8850ee9cdb2f5b340238de5eec0f60fb0 (diff) | |
download | nautilus-bdcd47873fc00c8f0013a2ecc85731622b961326.tar.gz |
Tons of files. More GtkObject -> GObject stuff.
* Tons of files.
More GtkObject -> GObject stuff.
Diffstat (limited to 'libnautilus')
-rw-r--r-- | libnautilus/Makefile.am | 2 | ||||
-rw-r--r-- | libnautilus/nautilus-clipboard.c | 6 | ||||
-rw-r--r-- | libnautilus/nautilus-undo-transaction.c | 74 | ||||
-rw-r--r-- | libnautilus/nautilus-undo.c | 2 | ||||
-rw-r--r-- | libnautilus/nautilus-view-standard-main.c | 4 | ||||
-rw-r--r-- | libnautilus/nautilus-view.c | 162 |
6 files changed, 107 insertions, 143 deletions
diff --git a/libnautilus/Makefile.am b/libnautilus/Makefile.am index d47757469..993310e4d 100644 --- a/libnautilus/Makefile.am +++ b/libnautilus/Makefile.am @@ -64,7 +64,7 @@ nautilus_distributed_undo_idl_stamp: nautilus-distributed-undo.idl $(libnautilus_la_OBJECTS): nautilus_view_component_idl_stamp nautilus_distributed_undo_idl_stamp -uidir = $(datadir)/gnome/ui +uidir = $(datadir)/gnome-2.0/ui ui_DATA = \ nautilus-clipboard-ui.xml \ $(NULL) diff --git a/libnautilus/nautilus-clipboard.c b/libnautilus/nautilus-clipboard.c index e9982c377..8b2b3eaf0 100644 --- a/libnautilus/nautilus-clipboard.c +++ b/libnautilus/nautilus-clipboard.c @@ -440,7 +440,7 @@ nautilus_clipboard_set_up_editable (GtkEditable *target, gtk_signal_connect_after (GTK_OBJECT (target), "focus_out_event", G_CALLBACK (focus_changed_callback), target_data); - gtk_signal_connect (GTK_OBJECT (target), "destroy", + g_signal_connect (G_OBJECT (target), "destroy", G_CALLBACK (target_destroy_callback), target_data); /* Call the focus changed callback once to merge if the window is @@ -510,11 +510,11 @@ nautilus_clipboard_set_up_editable_in_control (GtkEditable *target, gtk_object_set_data (GTK_OBJECT (target), "Nautilus:shares_selection_changes", GINT_TO_POINTER (shares_selection_changes)); - gtk_signal_connect (GTK_OBJECT (target), + g_signal_connect (G_OBJECT (target), "focus_in_event", G_CALLBACK (first_focus_callback), control); - gtk_signal_connect (GTK_OBJECT (target), + g_signal_connect (G_OBJECT (target), "destroy", G_CALLBACK (control_destroyed_callback), control); diff --git a/libnautilus/nautilus-undo-transaction.c b/libnautilus/nautilus-undo-transaction.c index 484a7154d..ecb4b2152 100644 --- a/libnautilus/nautilus-undo-transaction.c +++ b/libnautilus/nautilus-undo-transaction.c @@ -34,34 +34,18 @@ #define NAUTILUS_UNDO_TRANSACTION_LIST_DATA "Nautilus undo transaction list" -typedef struct { - POA_Nautilus_Undo_Transaction servant; - NautilusUndoTransaction *bonobo_object; -} impl_POA_Nautilus_Undo_Transaction; - -static void nautilus_undo_transaction_class_init (NautilusUndoTransactionClass *class); -static void nautilus_undo_transaction_init (NautilusUndoTransaction *item); -static void nautilus_undo_transaction_destroy (GtkObject *object); -static void nautilus_undo_transaction_undo (NautilusUndoTransaction *transaction); - -/* CORBA/Bonobo */ -static Nautilus_Undo_MenuItem *impl_Nautilus_Undo_Transaction__get_undo_menu_item (PortableServer_Servant servant, - CORBA_Environment *ev); -static Nautilus_Undo_MenuItem *impl_Nautilus_Undo_Transaction__get_redo_menu_item (PortableServer_Servant servant, - CORBA_Environment *ev); -static CORBA_char * impl_Nautilus_Undo_Transaction__get_operation_name (PortableServer_Servant servant, - CORBA_Environment *ev); -static void impl_Nautilus_Undo_Transaction__undo (PortableServer_Servant servant, - CORBA_Environment *ev); +static void nautilus_undo_transaction_class_init (NautilusUndoTransactionClass *class); +static void nautilus_undo_transaction_init (NautilusUndoTransaction *item); +static void nautilus_undo_transaction_undo (NautilusUndoTransaction *transaction); /* undo atoms */ -static void undo_atom_list_free (GList *list); -static void undo_atom_list_undo_and_free (GList *list); +static void undo_atom_list_free (GList *list); +static void undo_atom_list_undo_and_free (GList *list); EEL_BONOBO_BOILERPLATE_FULL (NautilusUndoTransaction, - Nautilus_Undo_Transaction, - nautilus_undo_transaction, - BONOBO_OBJECT_TYPE) + Nautilus_Undo_Transaction, + nautilus_undo_transaction, + BONOBO_OBJECT_TYPE) static Nautilus_Undo_MenuItem * impl_Nautilus_Undo_Transaction__get_undo_menu_item (PortableServer_Servant servant, @@ -70,7 +54,7 @@ impl_Nautilus_Undo_Transaction__get_undo_menu_item (PortableServer_Servant serva NautilusUndoTransaction *transaction; Nautilus_Undo_MenuItem *item; - transaction = ((impl_POA_Nautilus_Undo_Transaction *) servant)->bonobo_object; + transaction = NAUTILUS_UNDO_TRANSACTION (bonobo_object_from_servant (servant)); item = Nautilus_Undo_MenuItem__alloc (); item->label = CORBA_string_dup (transaction->undo_menu_item_label); @@ -86,7 +70,7 @@ impl_Nautilus_Undo_Transaction__get_redo_menu_item (PortableServer_Servant serva NautilusUndoTransaction *transaction; Nautilus_Undo_MenuItem *item; - transaction = ((impl_POA_Nautilus_Undo_Transaction *) servant)->bonobo_object; + transaction = NAUTILUS_UNDO_TRANSACTION (bonobo_object_from_servant (servant)); item = Nautilus_Undo_MenuItem__alloc (); item->label = CORBA_string_dup (transaction->redo_menu_item_label); @@ -101,7 +85,7 @@ impl_Nautilus_Undo_Transaction__get_operation_name (PortableServer_Servant serva { NautilusUndoTransaction *transaction; - transaction = ((impl_POA_Nautilus_Undo_Transaction *) servant)->bonobo_object; + transaction = NAUTILUS_UNDO_TRANSACTION (bonobo_object_from_servant (servant)); return CORBA_string_dup (transaction->operation_name); } @@ -111,7 +95,7 @@ impl_Nautilus_Undo_Transaction__undo (PortableServer_Servant servant, { NautilusUndoTransaction *transaction; - transaction = ((impl_POA_Nautilus_Undo_Transaction *) servant)->bonobo_object; + transaction = NAUTILUS_UNDO_TRANSACTION (bonobo_object_from_servant (servant)); nautilus_undo_transaction_undo (transaction); } @@ -124,9 +108,7 @@ nautilus_undo_transaction_new (const char *operation_name, { NautilusUndoTransaction *transaction; - transaction = NAUTILUS_UNDO_TRANSACTION (gtk_object_new (nautilus_undo_transaction_get_type (), NULL)); - gtk_object_ref (GTK_OBJECT (transaction)); - gtk_object_sink (GTK_OBJECT (transaction)); + transaction = NAUTILUS_UNDO_TRANSACTION (g_object_new (nautilus_undo_transaction_get_type (), NULL)); transaction->operation_name = g_strdup (operation_name); transaction->undo_menu_item_label = g_strdup (undo_menu_item_label); @@ -173,7 +155,7 @@ remove_transaction_from_atom_targets (NautilusUndoTransaction *transaction) } static void -nautilus_undo_transaction_destroy (GtkObject *object) +nautilus_undo_transaction_finalize (GObject *object) { NautilusUndoTransaction *transaction; CORBA_Environment ev; @@ -193,20 +175,7 @@ nautilus_undo_transaction_destroy (GtkObject *object) CORBA_Object_release (transaction->owner, &ev); CORBA_exception_free (&ev); - EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object)); -} - -static void -nautilus_undo_transaction_class_init (NautilusUndoTransactionClass *klass) -{ - POA_Nautilus_Undo_Transaction__epv *epv = &klass->epv; - - GTK_OBJECT_CLASS (klass)->destroy = nautilus_undo_transaction_destroy; - - epv->_get_undo_menu_item = &impl_Nautilus_Undo_Transaction__get_undo_menu_item; - epv->_get_redo_menu_item = &impl_Nautilus_Undo_Transaction__get_redo_menu_item; - epv->_get_operation_name = &impl_Nautilus_Undo_Transaction__get_operation_name; - epv->undo = &impl_Nautilus_Undo_Transaction__undo; + EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object)); } void @@ -387,3 +356,16 @@ undo_atom_list_undo_and_free (GList *list) g_list_foreach (list, undo_atom_undo_and_free_cover, NULL); g_list_free (list); } + +static void +nautilus_undo_transaction_class_init (NautilusUndoTransactionClass *klass) +{ + POA_Nautilus_Undo_Transaction__epv *epv = &klass->epv; + + G_OBJECT_CLASS (klass)->finalize = nautilus_undo_transaction_finalize; + + epv->_get_undo_menu_item = &impl_Nautilus_Undo_Transaction__get_undo_menu_item; + epv->_get_redo_menu_item = &impl_Nautilus_Undo_Transaction__get_redo_menu_item; + epv->_get_operation_name = &impl_Nautilus_Undo_Transaction__get_operation_name; + epv->undo = &impl_Nautilus_Undo_Transaction__undo; +} diff --git a/libnautilus/nautilus-undo.c b/libnautilus/nautilus-undo.c index 088fa0957..1590a0a9e 100644 --- a/libnautilus/nautilus-undo.c +++ b/libnautilus/nautilus-undo.c @@ -279,6 +279,6 @@ nautilus_undo_set_up_bonobo_control (BonoboControl *control) g_return_if_fail (BONOBO_IS_CONTROL (control)); set_up_bonobo_control (control); - gtk_signal_connect (GTK_OBJECT (control), "set_frame", + g_signal_connect (G_OBJECT (control), "set_frame", GTK_SIGNAL_FUNC (set_up_bonobo_control), NULL); } diff --git a/libnautilus/nautilus-view-standard-main.c b/libnautilus/nautilus-view-standard-main.c index 19ad0619a..47a20ba28 100644 --- a/libnautilus/nautilus-view-standard-main.c +++ b/libnautilus/nautilus-view-standard-main.c @@ -109,7 +109,7 @@ make_object (BonoboGenericFactory *factory, g_source_remove (callback_data->delayed_quit_timeout_id); callback_data->delayed_quit_timeout_id = 0; } - gtk_signal_connect (GTK_OBJECT (view), "destroy", + g_signal_connect (G_OBJECT (view), "destroy", G_CALLBACK (object_destroyed), callback_data); return BONOBO_OBJECT (view); @@ -318,6 +318,6 @@ typedef GtkType (* TypeFunc) (void); NautilusView * nautilus_view_create_from_get_type_function (const char *iid, void *user_data) { - return NAUTILUS_VIEW (gtk_object_new (((TypeFunc) (user_data)) (), NULL)); + return NAUTILUS_VIEW (g_object_new (((TypeFunc) (user_data)) (), NULL)); } diff --git a/libnautilus/nautilus-view.c b/libnautilus/nautilus-view.c index 061610a56..c64949f10 100644 --- a/libnautilus/nautilus-view.c +++ b/libnautilus/nautilus-view.c @@ -69,22 +69,7 @@ typedef struct { char *title; } LocationPlus; -static void impl_Nautilus_View_load_location (PortableServer_Servant servant, - const CORBA_char *location, - CORBA_Environment *ev); -static void impl_Nautilus_View_stop_loading (PortableServer_Servant servant, - CORBA_Environment *ev); -static void impl_Nautilus_View_selection_changed (PortableServer_Servant servant, - const Nautilus_URIList *selection, - CORBA_Environment *ev); -static void impl_Nautilus_View_title_changed (PortableServer_Servant servant, - const CORBA_char *title, - CORBA_Environment *ev); -static void impl_Nautilus_View_history_changed (PortableServer_Servant servant, - const Nautilus_History *history, - CORBA_Environment *ev); static void nautilus_view_init (NautilusView *view); -static void nautilus_view_destroy (GtkObject *object); static void nautilus_view_class_init (NautilusViewClass *klass); EEL_BONOBO_BOILERPLATE_FULL (NautilusView, @@ -166,44 +151,44 @@ static void call_load_location (NautilusView *view, gpointer callback_data) { - gtk_signal_emit (GTK_OBJECT (view), - signals[LOAD_LOCATION], - callback_data); + g_signal_emit (G_OBJECT (view), + signals[LOAD_LOCATION], 0, + callback_data); } static void call_stop_loading (NautilusView *view, gpointer callback_data) { - gtk_signal_emit (GTK_OBJECT (view), - signals[STOP_LOADING]); + g_signal_emit (G_OBJECT (view), + signals[STOP_LOADING], 0); } static void call_selection_changed (NautilusView *view, gpointer callback_data) { - gtk_signal_emit (GTK_OBJECT (view), - signals[SELECTION_CHANGED], - callback_data); + g_signal_emit (G_OBJECT (view), + signals[SELECTION_CHANGED], 0, + callback_data); } static void call_title_changed (NautilusView *view, gpointer callback_data) { - gtk_signal_emit (GTK_OBJECT (view), - signals[TITLE_CHANGED], - callback_data); + g_signal_emit (G_OBJECT (view), + signals[TITLE_CHANGED], 0, + callback_data); } static void call_history_changed (NautilusView *view, gpointer callback_data) { - gtk_signal_emit (GTK_OBJECT (view), - signals[HISTORY_CHANGED], - callback_data); + g_signal_emit (G_OBJECT (view), + signals[HISTORY_CHANGED], 0, + callback_data); } static void @@ -289,64 +274,6 @@ impl_Nautilus_View_history_changed (PortableServer_Servant servant, } static void -nautilus_view_class_init (NautilusViewClass *klass) -{ - GtkObjectClass *object_class; - POA_Nautilus_View__epv *epv = &klass->epv; - - object_class = (GtkObjectClass *) klass; - - object_class->destroy = nautilus_view_destroy; - - signals[LOAD_LOCATION] = - g_signal_new ("load_location", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NautilusViewClass, load_location), - NULL, NULL, - g_cclosure_marshal_VOID__STRING, - G_TYPE_NONE, 1, G_TYPE_STRING); - signals[STOP_LOADING] = - g_signal_new ("stop_loading", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NautilusViewClass, stop_loading), - NULL, NULL, - gtk_marshal_NONE__NONE, - G_TYPE_NONE, 0); - signals[SELECTION_CHANGED] = - g_signal_new ("selection_changed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NautilusViewClass, selection_changed), - NULL, NULL, - gtk_marshal_NONE__POINTER, - G_TYPE_NONE, 1, GTK_TYPE_POINTER); - signals[TITLE_CHANGED] = - g_signal_new ("title_changed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NautilusViewClass, title_changed), - NULL, NULL, - g_cclosure_marshal_VOID__STRING, - G_TYPE_NONE, 1, G_TYPE_STRING); - signals[HISTORY_CHANGED] = - g_signal_new ("history_changed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (NautilusViewClass, history_changed), - NULL, NULL, - gtk_marshal_NONE__POINTER, - G_TYPE_NONE, 1, GTK_TYPE_POINTER); - - epv->load_location = impl_Nautilus_View_load_location; - epv->stop_loading = impl_Nautilus_View_stop_loading; - epv->selection_changed = impl_Nautilus_View_selection_changed; - epv->title_changed = impl_Nautilus_View_title_changed; - epv->history_changed = impl_Nautilus_View_history_changed; -} - -static void nautilus_view_init (NautilusView *view) { view->details = g_new0 (NautilusViewDetails, 1); @@ -366,7 +293,7 @@ NautilusView * nautilus_view_new_from_bonobo_control (BonoboControl *control) { return nautilus_view_construct_from_bonobo_control - (NAUTILUS_VIEW (gtk_object_new (NAUTILUS_TYPE_VIEW, NULL)), + (NAUTILUS_VIEW (g_object_new (NAUTILUS_TYPE_VIEW, NULL)), control); } @@ -393,7 +320,7 @@ nautilus_view_construct_from_bonobo_control (NautilusView *view, } static void -nautilus_view_destroy (GtkObject *object) +nautilus_view_finalize (GObject *object) { NautilusView *view; @@ -404,7 +331,7 @@ nautilus_view_destroy (GtkObject *object) g_free (view->details); - EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object)); + EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object)); } static Nautilus_ViewFrame @@ -873,3 +800,58 @@ nautilus_view_set_up_ui (NautilusView *view, return ui_component; } + +static void +nautilus_view_class_init (NautilusViewClass *klass) +{ + POA_Nautilus_View__epv *epv = &klass->epv; + + G_OBJECT_CLASS (klass)->finalize = nautilus_view_finalize; + + signals[LOAD_LOCATION] = + g_signal_new ("load_location", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusViewClass, load_location), + NULL, NULL, + g_cclosure_marshal_VOID__STRING, + G_TYPE_NONE, 1, G_TYPE_STRING); + signals[STOP_LOADING] = + g_signal_new ("stop_loading", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusViewClass, stop_loading), + NULL, NULL, + gtk_marshal_NONE__NONE, + G_TYPE_NONE, 0); + signals[SELECTION_CHANGED] = + g_signal_new ("selection_changed", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusViewClass, selection_changed), + NULL, NULL, + gtk_marshal_NONE__POINTER, + G_TYPE_NONE, 1, GTK_TYPE_POINTER); + signals[TITLE_CHANGED] = + g_signal_new ("title_changed", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusViewClass, title_changed), + NULL, NULL, + g_cclosure_marshal_VOID__STRING, + G_TYPE_NONE, 1, G_TYPE_STRING); + signals[HISTORY_CHANGED] = + g_signal_new ("history_changed", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusViewClass, history_changed), + NULL, NULL, + gtk_marshal_NONE__POINTER, + G_TYPE_NONE, 1, GTK_TYPE_POINTER); + + epv->load_location = impl_Nautilus_View_load_location; + epv->stop_loading = impl_Nautilus_View_stop_loading; + epv->selection_changed = impl_Nautilus_View_selection_changed; + epv->title_changed = impl_Nautilus_View_title_changed; + epv->history_changed = impl_Nautilus_View_history_changed; +} |