diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2002-11-02 16:25:03 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2002-11-02 16:25:03 +0800 |
commit | 9c73777f2268b5bf2622f893e2a3ba7d0f720572 (patch) | |
tree | f81b79f19b87f84b4429d329b3fc0f9ff7946060 /shell | |
parent | 236c15d106b4e740d4e3996e0649334ca8e13876 (diff) | |
download | gsoc2013-evolution-9c73777f2268b5bf2622f893e2a3ba7d0f720572.tar.gz gsoc2013-evolution-9c73777f2268b5bf2622f893e2a3ba7d0f720572.tar.zst gsoc2013-evolution-9c73777f2268b5bf2622f893e2a3ba7d0f720572.zip |
First big sync of my GNOME 2 porting work (incomplete, and still
pretty broken).
Weeeeee!
svn path=/trunk/; revision=18503
Diffstat (limited to 'shell')
51 files changed, 751 insertions, 878 deletions
diff --git a/shell/.cvsignore b/shell/.cvsignore index f60b8850ac..4fc1a6f8fd 100644 --- a/shell/.cvsignore +++ b/shell/.cvsignore @@ -19,3 +19,4 @@ evolution-nognome evolution-test-component evolution.pure libeshell.la +e-shell-marshal.* diff --git a/shell/ChangeLog b/shell/ChangeLog index 19d008983d..ff25dda60f 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,231 @@ +2002-11-02 Ettore Perazzoli <ettore@ximian.com> + + * e-shell-config-autocompletion.c: No bonobo-conf; removed member + db in struct EvolutionAutocompletionConfig and replaced with a + config_listener arg. + (e_shell_config_autocompletion_create_widget): Init it here. + (config_control_destroy_callback): Unref it here. + (config_control_apply_callback): Updated to use the + config_listener. + + * e-shell-config.c (e_shell_config_factory_register): Use + bonobo_generic_factory_new() instead of + bonobo_generic_factory_new_multi(). + + * e-shell-about-box.c (impl_realize): Pass NULL as the error arg + to gdk_pixbuf_new_from_file(). + (timeout_callback): Use gtk_style_get_font() to retrieve the + style's font instead of style->font. + (impl_draw): Removed. + (impl_expose_event): Do the drawing of the pixmap here. + + * e-setup.c (e_setup_check_db): Removed. + (e_setup_check_config): New, version using EConfigListener instead + of bonobo-conf. + + * e-setup.h: #include "e-util/e-config-listener.h" instead of + <bonobo-conf/bonobo-config-database.h>. + + * e-local-storage.c (construct): Use _() instead of U_(). + (setup_stock_folders): Likewise. + + * e-icon-factory.c (load_icon): Pass NULL as the error arg to + gdk_pixbuf_new_from_file(). + + * e-folder-type-registry.c (folder_type_new): Pass NULL as the + error arg to gdk_pixbuf_new_from_file(). + + * e-folder-dnd-bridge.c (find_matching_target_for_drag_context): + GdkAtom is not an integer anymore; update accordingly. + + * e-corba-storage.c (async_folder_cb): Constified args + appropriately to match BonoboListenerCallbackFn. + (async_folder_discovery_cb): Likewise. + (cancel_discover_shared_folder): BONOBO_EX_ID() -> + BONOBO_EX_REPOID(). + (e_corba_storage_show_folder_properties): Likewise. + + * e-corba-storage-registry.h, e-corba-storage-registry.c: + BonoboXObjectified. + + * e-corba-config-page.c: Removed member listener_id in struct + ECorbaConfigPagePrivate. + (init): Don't init. + (setup_listener): Bonobo_EventSource_addListener doesn't return an + ID anymore. + (impl_destroy): Just pass the listener to + Bonobo_EventSource_removeListener. + (setup_listener): BONOBO_EX_REPOID() instead of BONOBO_EX_ID(). + (impl_apply): Likewise. + (listener_event_callback): Constified args appropriately to match + BonoboListenerCallbackFn. + (e_corba_config_page_construct): Likewise. + + * e-component-registry.c (wait_for_corba_object_to_die): Pass NULL + for the exception arg to bonobo_unknown_ping(). + + * e-shell-view.h: <bonobo/bonobo-window.h>, not + <bonobo/bonobo-win.h>. + + * e-shell.c: Replace member db in EShellPrivate with an + EConfigListener config_listener. + (destroy): Do not call e_shell_disconnect_db(). Unref + EConfigListener. Destroy settings_dialog if not NULL. Pass + config_listener to e_setup_check_db(). + (e_shell_get_config_db): Removed. + (e_shell_get_config_listener): New. + (e_shell_construct): Set up the config_listener, instead of the + Bonobo_ConfigDatabase. + + * e-shell.h: #include <bonobo-activation/bonobo-activation.h> + instead of <liboaf/oaf.h>. No + <bonobo-conf/bonobo-config-database.h>. + + * e-component-registry.c: #include + <bonobo-activation/bonobo-activation.h> instead of <liboaf/oaf.h>. + + * e-activity-handler.c (task_widget_button_press_event_callback): + Use BONOBO_EX() and BONOBO_EX_REPOID(). + (impl_operationStarted): Don't use GTK_OBJECT_DESTROYED() [needs + to be fixed later]. + (impl_operationProgressing): Likewise. + (impl_operationFinished): Likewise. + (impl_requestDialog): Likewise. + + * evolution-wizard.c (evolution_wizard_class_init): GLIB2-ified. + + * evolution-wizard.h: Remove BEGIN_GNOME_DECLS/END_GNOME_DECLS. + + * evolution-storage.c: Chagned to use generated marshallers + instead of custom ones or GAL's. + + * eshell-marshal.list: New. + * Makefile.am: Added rule to build eshell-marshal.[ch] and link + them in. + + * evolution-storage.h, evolution-storage.c: BonoboXObjectified. + + * evolution-storage-set-view-listener.c (class_init): GLIB2-ified. + + * evolution-storage-listener.c (class_init): GLIB2-ified. + + * evolution-shell-view.h, evolution-shell-view.c: + BonoboXObjectified. + + * evolution-shell-component-utils.c: #include + <bonobo-activation/bonobo-activation.h>. + (e_pixmaps_update): Pass NULL as the error arg to + gdk_pixbuf_new_from_file(). + (e_activation_failure_dialog): Bonobo_GeneralError instead of + OAF_GeneralError. + (e_get_activation_failure_msg): Likewise. + + * evolution-shell-component-dnd.h, evolution-shell-component-dnd.c: + BonoboXObjectified. + + * evolution-shell-component.c: #include <unistd.h>. + (owner_ping_callback): Pass NULL for the opt_ev arg to + bonobo_unknown_ping(). + (impl_populateFolderContextMenu): Pass NULL for the opt_ev arg to + bonobo_ui_component_set_container(). + (class_init): GLIB2-ified. + + * e-component-registry.c (component_free): Use g_object_unref() on + the EvolutionShellComponentClient instead of + bonobo_object_unref(). + (register_component): Likewise. + (component_new): Likewise, use g_object_ref() instead of + bonobo_object_ref(). + + * evolution-shell-component-client.c: New member corba_objref in + EvolutionShellComponentClientPrivate. + (init): Init to CORBA_OBJECT_NIL. + (impl_destroy): Unref. Also CORBA_OBJECT_NILify all the pointers + to unreffed objects. + (corba_exception_to_result): Use BONOBO_EX_REPOID(ev) instead of + ev->_repo_id. + (evolution_shell_component_client_construct): Set the corba_objref + pointer, do not call bonobo_object_client_construct(). + (evolution_shell_component_client_new): Use + bonobo_activation_activate_from_id() here instead of + oaf_activate_from_id(). + + * evolution-shell-component-client.h, + evolution-shell-component-client.c: Derive from GObject instead of + BonoboObjectClient. + + * evolution-shell-client.c + (evolution_shell_client_create_storage_set_view): Use + BONOBO_EX_REPOID() instead of BONOBO_EX_ID(). + + * evolution-folder-selector-button.c (destroy): g_object_unref the + EvolutionShellClient instead of bonobo_object_unref(). + (evolution_folder_selector_button_construct): Likewise. + + * e-folder-list.c (e_folder_list_destroy): g_object_unref the + EvolutionShellClient instead of bonobo_object_unref(). + (e_folder_list_construct): g_object_ref the EvolutionShellClient + instead of bonobo_object_ref(). + + * evolution-shell-client.c: New member corba_objref in + EvolutionShellClientPrivate. + (init): Init to CORBA_OBJECT_NIL. + (destroy): Unref/release. + (query_shell_interface): Use BONOBO_EX() and BONOBO_EX_REPOID() + instead of ._major and ._repo_id. + (destroy): Likewise. + (evolution_shell_client_get_local_storage): Likewise. + + * evolution-shell-client.h: Derive from GObject instead of + BonoboObjectClient. + + * evolution-session.c (corba_class_init): Get klass arg. + (class_init): Pass klass arg. GLIB2-ified. + (evolution_session_construct): Removed. + (evolution_session_new): Just return what gtk_type_new() returns. + + * evolution-session.h, evolution-session.c: Derive from + BonoboXObject. + + * evolution-folder-selector-button.c (init): Make icon a GtkImage + instead of a BonoboUIToolbarIcon. + (set_folder, class_init): GLIB2-ified. + + * evolution-config-control.c (class_init): GLIB2-ified. + + * evolution-activity-client.c (corba_update_progress): Use + BONOBO_EX_REPOID() instead of ._major and ._repo_id. + (evolution_activity_client_request_dialog): Likewise. + (impl_destroy): Likewise. + (class_init): GLIB2-ified. + + * e-folder-list.c: #include <gtk/gtframe.h> and #include + <string.h>. + (e_folder_list_destroy): bonobo_object_unref(), not + bonobo_object_client_unref(). + (e_folder_list_init): Pass NULL as the domain to glade_xml_new(). + + * e-folder-list.h: #include <gtk/gtkvbox.h>. + + * e-folder.c (impl_remove): Renamed from remove(). + (impl_get_physical_uri): Renamed from get_physical_uri(). + (impl_load_info): Renamed from load_info(). + (impl_save_info): Renamed from save_info(). + (class_init): GLIB2-ified. + + * Evolution-Session.idl: #include <Bonobo.idl>, not <Bonobo.h>. + * Evolution-Offline.idl: Likewise. + * Evolution-ShellComponent.idl: Likewise. + * Evolution-ShellComponentDnd.idl: Likewise. + * Evolution-Storage.idl: Likewise. + + * Makefile.am: Do not compile the importer directory for now. + + * evolution-wizard.c (evolution_wizard_set_buttons_sensitive): + ORBit2-ize type names. + (evolution_wizard_set_show_finish): Likewise. + (evolution_wizard_set_page): Likewise. + 2002-10-28 Ettore Perazzoli <ettore@ximian.com> * e-shell-settings-dialog.c (set_dialog_size): Increase the width diff --git a/shell/Evolution-Offline.idl b/shell/Evolution-Offline.idl index 46821d72bb..4c3f3f7392 100644 --- a/shell/Evolution-Offline.idl +++ b/shell/Evolution-Offline.idl @@ -8,7 +8,7 @@ * Copyright (C) 2001 Ximian, Inc. */ -#include <Bonobo.h> +#include <Bonobo.idl> module GNOME { module Evolution { diff --git a/shell/Evolution-Session.idl b/shell/Evolution-Session.idl index eeb6116740..35eb9ea427 100644 --- a/shell/Evolution-Session.idl +++ b/shell/Evolution-Session.idl @@ -8,7 +8,7 @@ * Copyright (C) 2000, 2001 Ximian, Inc. */ -#include <Bonobo.h> +#include <Bonobo.idl> module GNOME { module Evolution { diff --git a/shell/Evolution-ShellComponent.idl b/shell/Evolution-ShellComponent.idl index 9441b73b79..bb9b4ae682 100644 --- a/shell/Evolution-ShellComponent.idl +++ b/shell/Evolution-ShellComponent.idl @@ -8,7 +8,7 @@ * Copyright (C) 2000, 2001, 2002 Ximian, Inc. */ -#include <Bonobo.h> +#include <Bonobo.idl> module GNOME { module Evolution { diff --git a/shell/Evolution-ShellComponentDnd.idl b/shell/Evolution-ShellComponentDnd.idl index c0c4c5a469..064f233417 100644 --- a/shell/Evolution-ShellComponentDnd.idl +++ b/shell/Evolution-ShellComponentDnd.idl @@ -9,7 +9,7 @@ * Copyright (C) 2001 Ximian, Inc. */ -#include <Bonobo.h> +#include <Bonobo.idl> module GNOME { module Evolution { diff --git a/shell/Evolution-Storage.idl b/shell/Evolution-Storage.idl index 45aa3cb884..26313b6825 100644 --- a/shell/Evolution-Storage.idl +++ b/shell/Evolution-Storage.idl @@ -8,7 +8,7 @@ * Copyright (C) 2000, 2001 Ximian, Inc. */ -#include <Bonobo.h> +#include <Bonobo.idl> module GNOME { module Evolution { diff --git a/shell/Makefile.am b/shell/Makefile.am index 93fead1d0e..8d92499d89 100644 --- a/shell/Makefile.am +++ b/shell/Makefile.am @@ -1,6 +1,8 @@ -SUBDIRS = glade importer +SUBDIRS = glade -INCLUDES = -O \ +# FIXME importer + +INCLUDES = \ -I$(top_srcdir)/widgets \ -I$(top_srcdir)/widgets/misc \ -I$(top_srcdir)/libical/src/libical \ @@ -42,8 +44,7 @@ IDL_GENERATED = \ Evolution-impl.o: Evolution.h $(IDL_GENERATED): $(IDLS) - $(ORBIT_IDL) -I $(srcdir) -I $(datadir)/idl `$(GNOME_CONFIG) --cflags idl` \ - $(srcdir)/Evolution.idl + $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) $(srcdir)/Evolution.idl # SelectNames CORBA stuff @@ -57,8 +58,7 @@ SELECT_NAMES_IDL_GENERATED = \ Evolution-Addressbook-SelectNames-stubs.c $(SELECT_NAMES_IDL_GENERATED): $(SELECT_NAMES_IDL) - $(ORBIT_IDL) -I $(srcdir) -I $(datadir)/idl `$(GNOME_CONFIG) --cflags idl` \ - $(SELECT_NAMES_IDL) + $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) $(SELECT_NAMES_IDL) # IDL install @@ -114,6 +114,7 @@ libeshell_la_SOURCES = \ evolution-storage-set-view-listener.c \ evolution-storage.c \ evolution-wizard.c \ + e-shell-marshal.c \ $(eshellinclude_HEADERS) # Evolution executable @@ -265,6 +266,23 @@ icons = \ check-filled.xpm \ check-missing.xpm + +# GLib marshalling cruft + +e-shell-marshal.h: e-shell-marshal.list + ( @GLIB_GENMARSHAL@ --prefix=e_shell_marshal e-shell-marshal.list --header > e-shell-marshal.tmp \ + && mv e-shell-marshal.tmp e-shell-marshal.h ) \ + || ( rm -f e-shell-marshal.tmp && exit 1 ) + +e-shell-marshal.c: e-shell-marshal.h + ( @GLIB_GENMARSHAL@ --prefix=e_shell_marshal e-shell-marshal.list --body > e-shell-marshal.tmp \ + && mv e-shell-marshal.tmp e-shell-marshal.c ) \ + || ( rm -f e-shell-marshal.tmp && exit 1 ) + +MARSHAL_GENERATED = e-shell-marshal.c e-shell-marshal.h + +# Extra dist stuff + EXTRA_DIST = \ $(IDLS) \ $(oaf_in_files) \ @@ -289,7 +307,7 @@ evolution.pure: evolution endif CLEANFILES = $(IDL_GENERATED) $(SELECT_NAMES_IDL_GENERATED) -BUILT_SOURCES = $(IDL_GENERATED) $(SELECT_NAMES_IDL_GENERATED) +BUILT_SOURCES = $(IDL_GENERATED) $(SELECT_NAMES_IDL_GENERATED) $(MARSHAL_GENERATED) dist-hook: cd $(distdir); rm -f $(BUILT_SOURCES) diff --git a/shell/e-activity-handler.c b/shell/e-activity-handler.c index f7bc09919d..efddecdb3c 100644 --- a/shell/e-activity-handler.c +++ b/shell/e-activity-handler.c @@ -37,6 +37,8 @@ #include <gal/util/e-util.h> #include <gal/widgets/e-popup-menu.h> +#include <bonobo/bonobo-exception.h> + #define PARENT_TYPE bonobo_x_object_get_type () static BonoboXObjectClass *parent_class = NULL; @@ -207,9 +209,9 @@ task_widget_button_press_event_callback (GtkWidget *widget, null_value->_type = TC_null; Bonobo_Listener_event (activity_info->event_listener, "Clicked", null_value, &ev); - if (ev._major != CORBA_NO_EXCEPTION) + if (BONOBO_EX (&ev) != CORBA_NO_EXCEPTION) g_warning ("EActivityHandler: Cannot report `Clicked' event -- %s", - ev._repo_id); + BONOBO_EX_REPOID (&ev)); CORBA_free (null_value); @@ -369,7 +371,8 @@ impl_operationStarted (PortableServer_Servant servant, activity_handler = E_ACTIVITY_HANDLER (bonobo_object_from_servant (servant)); - if (GTK_OBJECT_DESTROYED (activity_handler) || activity_handler->priv == NULL) + /* FIXME */ + if (/* GTK_OBJECT_DESTROYED (activity_handler) || */ activity_handler->priv == NULL) return; priv = activity_handler->priv; @@ -419,7 +422,8 @@ impl_operationProgressing (PortableServer_Servant servant, activity_handler = E_ACTIVITY_HANDLER (bonobo_object_from_servant (servant)); - if (GTK_OBJECT_DESTROYED (activity_handler) || activity_handler->priv == NULL) + /* FIXME */ + if (/* GTK_OBJECT_DESTROYED (activity_handler) || */ activity_handler->priv == NULL) return; priv = activity_handler->priv; @@ -462,7 +466,8 @@ impl_operationFinished (PortableServer_Servant servant, activity_handler = E_ACTIVITY_HANDLER (bonobo_object_from_servant (servant)); - if (GTK_OBJECT_DESTROYED (activity_handler) || activity_handler->priv == NULL) + /* FIXME */ + if (/* GTK_OBJECT_DESTROYED (activity_handler) || */ activity_handler->priv == NULL) return; priv = activity_handler->priv; @@ -490,7 +495,8 @@ impl_requestDialog (PortableServer_Servant servant, activity_handler = E_ACTIVITY_HANDLER (bonobo_object_from_servant (servant)); - if (GTK_OBJECT_DESTROYED (activity_handler) || activity_handler->priv == NULL) + /* FIXME */ + if (/* GTK_OBJECT_DESTROYED (activity_handler) || */ activity_handler->priv == NULL) return GNOME_Evolution_Activity_DIALOG_ACTION_ERROR; /* FIXME implement. */ diff --git a/shell/e-component-registry.c b/shell/e-component-registry.c index a4da4af714..39f3f42cf6 100644 --- a/shell/e-component-registry.c +++ b/shell/e-component-registry.c @@ -31,6 +31,8 @@ #include <gal/util/e-util.h> +#include <bonobo-activation/bonobo-activation.h> + #include "Evolution.h" #include "e-shell-utils.h" @@ -93,7 +95,7 @@ wait_for_corba_object_to_die (Bonobo_Unknown corba_objref, count = 1; while (1) { - alive = bonobo_unknown_ping (corba_objref); + alive = bonobo_unknown_ping (corba_objref, NULL); if (! alive) break; @@ -112,7 +114,7 @@ component_new (const char *id, { Component *new; - bonobo_object_ref (BONOBO_OBJECT (client)); + g_object_ref (client); new = g_new (Component, 1); new->id = g_strdup (id); @@ -141,7 +143,7 @@ component_free (Component *component) retval = FALSE; CORBA_exception_free (&ev); - bonobo_object_unref (BONOBO_OBJECT (component->client)); + g_object_unref (component->client); wait_for_corba_object_to_die ((Bonobo_Unknown) corba_shell_component, component->id); CORBA_Object_release (corba_shell_component, &ev); @@ -236,7 +238,7 @@ register_component (EComponentRegistry *component_registry, supported_types = GNOME_Evolution_ShellComponent__get_supportedTypes (component_corba_interface, &my_ev); if (my_ev._major != CORBA_NO_EXCEPTION || supported_types->_length == 0) { - bonobo_object_unref (BONOBO_OBJECT (client)); + g_object_unref (client); CORBA_exception_free (&my_ev); return FALSE; } @@ -245,7 +247,7 @@ register_component (EComponentRegistry *component_registry, component = component_new (id, client); g_hash_table_insert (priv->component_id_to_component, component->id, component); - bonobo_object_unref (BONOBO_OBJECT (client)); + g_object_unref (client); for (i = 0; i < supported_types->_length; i++) { const GNOME_Evolution_FolderType *type; diff --git a/shell/e-corba-config-page.c b/shell/e-corba-config-page.c index f9b49bcdab..bf51097b4a 100644 --- a/shell/e-corba-config-page.c +++ b/shell/e-corba-config-page.c @@ -43,7 +43,6 @@ struct _ECorbaConfigPagePrivate { GNOME_Evolution_ConfigControl config_control_interface; BonoboListener *listener; - Bonobo_EventSource_ListenerId listener_id; Bonobo_EventSource event_source; }; @@ -53,8 +52,8 @@ struct _ECorbaConfigPagePrivate { static void listener_event_callback (BonoboListener *listener, - char *event_name, - CORBA_any *any, + const char *event_name, + const CORBA_any *any, CORBA_Environment *ev, void *data) { @@ -80,18 +79,18 @@ setup_listener (ECorbaConfigPage *corba_config_page, event_source = GNOME_Evolution_ConfigControl__get_eventSource (config_control_interface, &ev); if (BONOBO_EX (&ev)) { - g_warning ("Cannot get eventSource interface for ConfigPage -- %s", BONOBO_EX_ID (&ev)); + g_warning ("Cannot get eventSource interface for ConfigPage -- %s", BONOBO_EX_REPOID (&ev)); } else { priv->listener = bonobo_listener_new (listener_event_callback, corba_config_page); - priv->listener_id = Bonobo_EventSource_addListener (event_source, - bonobo_object_corba_objref (BONOBO_OBJECT (priv->listener)), - &ev); + Bonobo_EventSource_addListener (event_source, + bonobo_object_corba_objref (BONOBO_OBJECT (priv->listener)), + &ev); if (! BONOBO_EX (&ev)) { priv->config_control_interface = config_control_interface; priv->event_source = event_source; } else { - g_warning ("Cannot add listener for ConfigPage -- %s", BONOBO_EX_ID (&ev)); + g_warning ("Cannot add listener for ConfigPage -- %s", BONOBO_EX_REPOID (&ev)); bonobo_object_unref (BONOBO_OBJECT (priv->listener)); priv->listener = NULL; @@ -122,7 +121,9 @@ impl_destroy (GtkObject *object) bonobo_object_release_unref (priv->config_control_interface, &ev); if (priv->listener != NULL) { - Bonobo_EventSource_removeListener (priv->event_source, priv->listener_id, &ev); + Bonobo_EventSource_removeListener (priv->event_source, + bonobo_object_corba_objref (BONOBO_OBJECT (priv->listener)), + &ev); bonobo_object_unref (BONOBO_OBJECT (priv->listener)); bonobo_object_release_unref (priv->event_source, &ev); @@ -155,7 +156,7 @@ impl_apply (EConfigPage *config_page) GNOME_Evolution_ConfigControl_apply (priv->config_control_interface, &ev); if (BONOBO_EX (&ev)) - g_warning ("Cannot apply settings -- %s", BONOBO_EX_ID (&ev)); + g_warning ("Cannot apply settings -- %s", BONOBO_EX_REPOID (&ev)); CORBA_exception_free (&ev); } @@ -186,7 +187,6 @@ init (ECorbaConfigPage *corba_config_page) priv = g_new (ECorbaConfigPagePrivate, 1); priv->config_control_interface = CORBA_OBJECT_NIL; priv->listener = NULL; - priv->listener_id = (Bonobo_EventSource_ListenerId) 0; priv->event_source = CORBA_OBJECT_NIL; corba_config_page->priv = priv; @@ -208,7 +208,7 @@ e_corba_config_page_construct (ECorbaConfigPage *corba_config_page, control = GNOME_Evolution_ConfigControl__get_control (corba_object, &ev); if (BONOBO_EX (&ev)) { - g_warning ("Can't get control from ::ConfigControl -- %s", BONOBO_EX_ID (&ev)); + g_warning ("Can't get control from ::ConfigControl -- %s", BONOBO_EX_REPOID (&ev)); CORBA_exception_init (&ev); return FALSE; } diff --git a/shell/e-corba-storage-registry.c b/shell/e-corba-storage-registry.c index cfdfce65ae..d50dfa33ee 100644 --- a/shell/e-corba-storage-registry.c +++ b/shell/e-corba-storage-registry.c @@ -34,9 +34,11 @@ #include <bonobo/bonobo-exception.h> #include <gal/util/e-util.h> +#include <string.h> + -#define PARENT_TYPE BONOBO_OBJECT_TYPE -static BonoboObjectClass *parent_class = NULL; +#define PARENT_TYPE BONOBO_X_OBJECT_TYPE +static BonoboXObjectClass *parent_class = NULL; struct _ECorbaStorageRegistryPrivate { EStorageSet *storage_set; @@ -47,31 +49,6 @@ struct _ECorbaStorageRegistryPrivate { /* CORBA interface implementation. */ -static POA_GNOME_Evolution_StorageRegistry__vepv storage_registry_vepv; - -static POA_GNOME_Evolution_StorageRegistry * -create_servant (void) -{ - POA_GNOME_Evolution_StorageRegistry *servant; - CORBA_Environment ev; - - servant = (POA_GNOME_Evolution_StorageRegistry *) g_new0 (BonoboObjectServant, 1); - servant->vepv = &storage_registry_vepv; - - CORBA_exception_init (&ev); - - POA_GNOME_Evolution_StorageRegistry__init ((PortableServer_Servant) servant, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_free (servant); - CORBA_exception_free (&ev); - return NULL; - } - - CORBA_exception_free (&ev); - - return servant; -} - static void listener_notify (Bonobo_Listener listener, GNOME_Evolution_StorageRegistry_MessageType type, @@ -432,18 +409,15 @@ destroy (GtkObject *object) /* Initialization. */ static void -corba_class_init (void) +class_init (ECorbaStorageRegistryClass *klass) { - POA_GNOME_Evolution_StorageRegistry__vepv *vepv; + GtkObjectClass *object_class; POA_GNOME_Evolution_StorageRegistry__epv *epv; - PortableServer_ServantBase__epv *base_epv; - base_epv = g_new0 (PortableServer_ServantBase__epv, 1); - base_epv->_private = NULL; - base_epv->finalize = NULL; - base_epv->default_POA = NULL; + object_class = GTK_OBJECT_CLASS (klass); + object_class->destroy = destroy; - epv = g_new0 (POA_GNOME_Evolution_StorageRegistry__epv, 1); + epv = & klass->epv; epv->addStorage = impl_StorageRegistry_addStorage; epv->getStorageList = impl_StorageRegistry_getStorageList; epv->getStorageByName = impl_StorageRegistry_getStorageByName; @@ -452,23 +426,7 @@ corba_class_init (void) epv->removeListener = impl_StorageRegistry_removeListener; epv->getFolderByUri = impl_StorageRegistry_getFolderByUri; - vepv = &storage_registry_vepv; - vepv->_base_epv = base_epv; - vepv->Bonobo_Unknown_epv = bonobo_object_get_epv (); - vepv->GNOME_Evolution_StorageRegistry_epv = epv; -} - -static void -class_init (ECorbaStorageRegistryClass *klass) -{ - GtkObjectClass *object_class; - - object_class = GTK_OBJECT_CLASS (klass); - object_class->destroy = destroy; - parent_class = gtk_type_class (PARENT_TYPE); - - corba_class_init (); } static void @@ -486,16 +444,11 @@ init (ECorbaStorageRegistry *corba_storage_registry) void e_corba_storage_registry_construct (ECorbaStorageRegistry *corba_storage_registry, - GNOME_Evolution_StorageRegistry corba_object, EStorageSet *storage_set) { ECorbaStorageRegistryPrivate *priv; - g_return_if_fail (corba_storage_registry != NULL); g_return_if_fail (E_IS_CORBA_STORAGE_REGISTRY (corba_storage_registry)); - g_return_if_fail (corba_object != CORBA_OBJECT_NIL); - - bonobo_object_construct (BONOBO_OBJECT (corba_storage_registry), corba_object); priv = corba_storage_registry->priv; @@ -507,25 +460,19 @@ ECorbaStorageRegistry * e_corba_storage_registry_new (EStorageSet *storage_set) { ECorbaStorageRegistry *corba_storage_registry; - POA_GNOME_Evolution_StorageRegistry *servant; - GNOME_Evolution_StorageRegistry corba_object; g_return_val_if_fail (storage_set != NULL, NULL); g_return_val_if_fail (E_IS_STORAGE_SET (storage_set), NULL); - servant = create_servant (); - if (servant == NULL) - return NULL; - corba_storage_registry = gtk_type_new (e_corba_storage_registry_get_type ()); - corba_object = bonobo_object_activate_servant (BONOBO_OBJECT (corba_storage_registry), - servant); - - e_corba_storage_registry_construct (corba_storage_registry, corba_object, storage_set); + e_corba_storage_registry_construct (corba_storage_registry, storage_set); return corba_storage_registry; } -E_MAKE_TYPE (e_corba_storage_registry, "ECorbaStorageRegistry", ECorbaStorageRegistry, class_init, init, PARENT_TYPE) +E_MAKE_X_TYPE (e_corba_storage_registry, "ECorbaStorageRegistry", ECorbaStorageRegistry, + class_init, init, PARENT_TYPE, + POA_GNOME_Evolution_StorageRegistry__init, + GTK_STRUCT_OFFSET (ECorbaStorageRegistryClass, epv)) diff --git a/shell/e-corba-storage-registry.h b/shell/e-corba-storage-registry.h index fc6c4084a7..338ee92340 100644 --- a/shell/e-corba-storage-registry.h +++ b/shell/e-corba-storage-registry.h @@ -23,7 +23,7 @@ #ifndef __E_CORBA_STORAGE_REGISTRY_H__ #define __E_CORBA_STORAGE_REGISTRY_H__ -#include <bonobo/bonobo-object.h> +#include <bonobo/bonobo-xobject.h> #include "Evolution.h" #include "e-storage-set.h" @@ -45,19 +45,20 @@ typedef struct _ECorbaStorageRegistryPrivate ECorbaStorageRegistryPrivate; typedef struct _ECorbaStorageRegistryClass ECorbaStorageRegistryClass; struct _ECorbaStorageRegistry { - BonoboObject parent; + BonoboXObject parent; ECorbaStorageRegistryPrivate *priv; }; struct _ECorbaStorageRegistryClass { - BonoboObjectClass parent_class; + BonoboXObjectClass parent_class; + + POA_GNOME_Evolution_StorageRegistry__epv epv; }; GtkType e_corba_storage_registry_get_type (void); void e_corba_storage_registry_construct (ECorbaStorageRegistry *corba_storage_registry, - GNOME_Evolution_StorageRegistry corba_object, EStorageSet *storage_set); ECorbaStorageRegistry *e_corba_storage_registry_new (EStorageSet *storage_set); diff --git a/shell/e-corba-storage.c b/shell/e-corba-storage.c index 31e8c424f1..e90411b7d9 100644 --- a/shell/e-corba-storage.c +++ b/shell/e-corba-storage.c @@ -35,9 +35,12 @@ #include <bonobo/bonobo-main.h> #include <bonobo/bonobo-exception.h> +#include <bonobo/bonobo-listener.h> #include <gdk/gdkx.h> +#include <string.h> + #define PARENT_TYPE E_TYPE_STORAGE static EStorageClass *parent_class = NULL; @@ -285,8 +288,10 @@ struct async_folder_closure { }; static void -async_folder_cb (BonoboListener *listener, char *event_name, - CORBA_any *any, CORBA_Environment *ev, +async_folder_cb (BonoboListener *listener, + const char *event_name, + const CORBA_any *any, + CORBA_Environment *ev, gpointer user_data) { struct async_folder_closure *closure = user_data; @@ -506,8 +511,10 @@ supports_shared_folders (EStorage *storage) } static void -async_folder_discovery_cb (BonoboListener *listener, char *event_name, - CORBA_any *any, CORBA_Environment *ev, +async_folder_discovery_cb (BonoboListener *listener, + const char *event_name, + const CORBA_any *any, + CORBA_Environment *ev, gpointer user_data) { struct async_folder_closure *closure = user_data; @@ -582,7 +589,7 @@ cancel_discover_shared_folder (EStorage *storage, GNOME_Evolution_Storage_cancelDiscoverSharedFolder (priv->storage_interface, owner, folder_name, &ev); if (BONOBO_EX (&ev)) - g_warning ("Error invoking cancelDiscoverSharedFolder -- %s", BONOBO_EX_ID (&ev)); + g_warning ("Error invoking cancelDiscoverSharedFolder -- %s", BONOBO_EX_REPOID (&ev)); CORBA_exception_free (&ev); } @@ -829,7 +836,7 @@ e_corba_storage_show_folder_properties (ECorbaStorage *corba_storage, GDK_WINDOW_XWINDOW (parent_window), &ev); if (BONOBO_EX (&ev)) - g_warning ("Error in Storage::showFolderProperties -- %s", BONOBO_EX_ID (&ev)); + g_warning ("Error in Storage::showFolderProperties -- %s", BONOBO_EX_REPOID (&ev)); CORBA_exception_free (&ev); } diff --git a/shell/e-folder-dnd-bridge.c b/shell/e-folder-dnd-bridge.c index e17bf86146..fabddb1fb8 100644 --- a/shell/e-folder-dnd-bridge.c +++ b/shell/e-folder-dnd-bridge.c @@ -36,6 +36,8 @@ #include <libgnome/gnome-i18n.h> #include <libgnome/gnome-util.h> +#include <string.h> + /* Callbacks for folder operations. */ @@ -157,12 +159,12 @@ find_matching_target_for_drag_context (EStorageSet *storage_set, for (p = drag_context->targets; p != NULL; p = p->next) { char *possible_type; - possible_type = gdk_atom_name (GPOINTER_TO_INT (p->data)); + possible_type = gdk_atom_name (*((GdkAtom *) p->data)); if (strcmp (possible_type, E_FOLDER_DND_PATH_TARGET_TYPE) == 0) { g_free (possible_type); if (atom_return != NULL) - *atom_return = GPOINTER_TO_INT (p->data); + *atom_return = *((GdkAtom *) p->data); return E_FOLDER_DND_PATH_TARGET_TYPE; } @@ -175,7 +177,7 @@ find_matching_target_for_drag_context (EStorageSet *storage_set, g_free (possible_type); if (atom_return != NULL) - *atom_return = GPOINTER_TO_INT (p->data); + *atom_return = *((GdkAtom *) p->data); return accepted_type; } @@ -416,7 +418,7 @@ handle_data_received_non_path (GdkDragContext *context, corba_context.suggestedAction = convert_gdk_drag_action_to_corba (context->suggested_action); corba_data.format = selection_data->format; - corba_data.target = selection_data->target; + corba_data.target = 0; /* selection_data->target FIXME */ corba_data.bytes._release = FALSE; diff --git a/shell/e-folder-list.c b/shell/e-folder-list.c index a86461f303..7291d7fde6 100644 --- a/shell/e-folder-list.c +++ b/shell/e-folder-list.c @@ -22,17 +22,26 @@ */ #include <config.h> -#include <libgnomeui/gnome-canvas-rect-ellipse.h> -#include "e-folder-list.h" -#include <gal/e-table/e-table-memory-store.h> -#include <gal/widgets/e-unicode.h> -#include <gal/widgets/e-gui-utils.h> -#include <gal/widgets/e-option-menu.h> + +#include <string.h> + +#include <gtk/gtkframe.h> + #include <libgnome/gnome-i18n.h> + #include <gnome-xml/parser.h> #include <gnome-xml/xmlmemory.h> -#include <gal/util/e-xml-utils.h> + #include <glade/glade.h> + +#include <gal/e-table/e-table-memory-store.h> +#include <gal/util/e-xml-utils.h> +#include <gal/widgets/e-unicode.h> +#include <gal/widgets/e-gui-utils.h> +#include <gal/widgets/e-option-menu.h> + +#include "e-folder-list.h" + #include "Evolution.h" static GtkVBoxClass *parent_class = NULL; @@ -130,12 +139,14 @@ e_folder_list_changed (EFolderList *efl) static void e_folder_list_destroy (GtkObject *object) { - EFolderList *efl = E_FOLDER_LIST(object); + EFolderList *efl = E_FOLDER_LIST (object); if (efl->priv->gui) - gtk_object_unref(GTK_OBJECT(efl->priv->gui)); + gtk_object_unref (GTK_OBJECT (efl->priv->gui)); + if (efl->priv->client) - bonobo_object_client_unref(BONOBO_OBJECT_CLIENT(efl->priv->client), NULL); + g_object_unref (efl->priv->client); + g_free (efl->priv); efl->priv = NULL; @@ -400,7 +411,7 @@ e_folder_list_init (EFolderList *efl) efl->priv = g_new (EFolderListPrivate, 1); - gui = glade_xml_new (EVOLUTION_GLADEDIR "/e-folder-list.glade", NULL); + gui = glade_xml_new (EVOLUTION_GLADEDIR "/e-folder-list.glade", NULL, NULL); efl->priv->gui = gui; efl->priv->title = NULL; @@ -555,8 +566,9 @@ e_folder_list_new (EvolutionShellClient *client, char *xml) GtkWidget* e_folder_list_construct (EFolderList *efl, EvolutionShellClient *client, char *xml) { + g_object_ref (client); efl->priv->client = client; - bonobo_object_ref (BONOBO_OBJECT (efl->priv->client)); + efl->priv->corba_storage_registry = evolution_shell_client_get_storage_registry_interface (client); e_folder_list_set_xml (efl, xml); return GTK_WIDGET (efl); diff --git a/shell/e-folder-list.h b/shell/e-folder-list.h index d3890812ac..4259ea4a71 100644 --- a/shell/e-folder-list.h +++ b/shell/e-folder-list.h @@ -25,6 +25,9 @@ #define __E_FOLDER_LIST_H__ #include <gal/e-table/e-table-scrolled.h> + +#include <gtk/gtkvbox.h> + #include "evolution-shell-client.h" #ifdef __cplusplus diff --git a/shell/e-folder-type-registry.c b/shell/e-folder-type-registry.c index 04ab30824a..e0f0719a20 100644 --- a/shell/e-folder-type-registry.c +++ b/shell/e-folder-type-registry.c @@ -106,13 +106,13 @@ folder_type_new (const char *name, if (icon_path == NULL) new->icon_pixbuf = NULL; else - new->icon_pixbuf = gdk_pixbuf_new_from_file (icon_path); + new->icon_pixbuf = gdk_pixbuf_new_from_file (icon_path, NULL); g_free (icon_path); icon_path = e_shell_get_icon_path (icon_name, TRUE); if (icon_path != NULL) { - new->mini_icon_pixbuf = gdk_pixbuf_new_from_file (icon_path); + new->mini_icon_pixbuf = gdk_pixbuf_new_from_file (icon_path, NULL); } else { if (new->icon_pixbuf != NULL) new->mini_icon_pixbuf = gdk_pixbuf_ref (new->icon_pixbuf); @@ -317,10 +317,8 @@ e_folder_type_registry_set_handler_for_type (EFolderTypeRegistry *folder_type_r const char *type_name, EvolutionShellComponentClient *handler) { - g_return_val_if_fail (folder_type_registry != NULL, FALSE); g_return_val_if_fail (E_IS_FOLDER_TYPE_REGISTRY (folder_type_registry), FALSE); - g_return_val_if_fail (handler != NULL, FALSE); - g_return_val_if_fail (BONOBO_IS_OBJECT_CLIENT (handler), FALSE); + g_return_val_if_fail (EVOLUTION_IS_SHELL_COMPONENT_CLIENT (handler), FALSE); return set_handler (folder_type_registry, type_name, handler); } diff --git a/shell/e-folder.c b/shell/e-folder.c index 2910963deb..54587eac3a 100644 --- a/shell/e-folder.c +++ b/shell/e-folder.c @@ -78,7 +78,7 @@ static guint signals[LAST_SIGNAL] = { 0 }; /* EFolder methods. */ static gboolean -save_info (EFolder *folder) +impl_save_info (EFolder *folder) { g_warning ("`%s' does not implement `EFolder::save_info()'", gtk_type_name (GTK_OBJECT_TYPE (folder))); @@ -86,7 +86,7 @@ save_info (EFolder *folder) } static gboolean -load_info (EFolder *folder) +impl_load_info (EFolder *folder) { g_warning ("`%s' does not implement `EFolder::load_info()'", gtk_type_name (GTK_OBJECT_TYPE (folder))); @@ -94,7 +94,7 @@ load_info (EFolder *folder) } static gboolean -remove (EFolder *folder) +impl_remove (EFolder *folder) { g_warning ("`%s' does not implement `EFolder::remove()'", gtk_type_name (GTK_OBJECT_TYPE (folder))); @@ -102,7 +102,7 @@ remove (EFolder *folder) } static const char * -get_physical_uri (EFolder *folder) +impl_get_physical_uri (EFolder *folder) { return folder->priv->physical_uri; } @@ -144,24 +144,22 @@ class_init (EFolderClass *klass) signals[CHANGED] = gtk_signal_new ("changed", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EFolderClass, changed), gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0); signals[NAME_CHANGED] = gtk_signal_new ("name_changed", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EFolderClass, name_changed), gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0); - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); - - klass->save_info = save_info; - klass->load_info = load_info; - klass->remove = remove; - klass->get_physical_uri = get_physical_uri; + klass->save_info = impl_save_info; + klass->load_info = impl_load_info; + klass->remove = impl_remove; + klass->get_physical_uri = impl_get_physical_uri; } static void diff --git a/shell/e-icon-factory.c b/shell/e-icon-factory.c index 75ce7377bf..740aefdbf0 100644 --- a/shell/e-icon-factory.c +++ b/shell/e-icon-factory.c @@ -94,11 +94,11 @@ load_icon (const char *icon_name) char *path; path = g_strconcat (EVOLUTION_IMAGES, "/", icon_name, "-mini.png", NULL); - small_pixbuf = gdk_pixbuf_new_from_file (path); + small_pixbuf = gdk_pixbuf_new_from_file (path, NULL); g_free (path); path = g_strconcat (EVOLUTION_IMAGES, "/", icon_name, ".png", NULL); - large_pixbuf = gdk_pixbuf_new_from_file (path); + large_pixbuf = gdk_pixbuf_new_from_file (path, NULL); g_free (path); if (large_pixbuf == NULL || small_pixbuf == NULL) diff --git a/shell/e-local-folder.c b/shell/e-local-folder.c index 2e25bf0279..734246d28d 100644 --- a/shell/e-local-folder.c +++ b/shell/e-local-folder.c @@ -48,8 +48,8 @@ #include <gnome-xml/parser.h> #include <gnome-xml/xmlmemory.h> -#include <libgnome/gnome-defs.h> #include <libgnome/gnome-util.h> + #include <gal/util/e-util.h> #include <gal/util/e-xml-utils.h> diff --git a/shell/e-local-storage.c b/shell/e-local-storage.c index c5a19876c4..ebd534e4a6 100644 --- a/shell/e-local-storage.c +++ b/shell/e-local-storage.c @@ -38,15 +38,17 @@ #include <sys/param.h> #include <sys/types.h> #include <sys/stat.h> +#include <unistd.h> #include <dirent.h> #include <gtk/gtksignal.h> -#include <libgnome/gnome-defs.h> + #include <libgnome/gnome-i18n.h> #include <libgnome/gnome-util.h> + #include <gal/util/e-util.h> #include <gal/widgets/e-unicode.h> -#include <gal/util/e-unicode-i18n.h> + #include "e-util/e-path.h" #include "e-local-folder.h" #include "e-shell-constants.h" @@ -173,14 +175,14 @@ setup_folder_as_stock (ELocalStorage *local_storage, static void setup_stock_folders (ELocalStorage *local_storage) { - setup_folder_as_stock (local_storage, "/Calendar", U_("Calendar"), NULL); - setup_folder_as_stock (local_storage, "/Contacts", U_("Contacts"), NULL); - setup_folder_as_stock (local_storage, "/Drafts", U_("Drafts"), NULL); - setup_folder_as_stock (local_storage, "/Inbox", U_("Inbox"), "inbox"); - setup_folder_as_stock (local_storage, "/Outbox", U_("Outbox"), "outbox"); - setup_folder_as_stock (local_storage, "/Sent", U_("Sent"), NULL); - setup_folder_as_stock (local_storage, "/Tasks", U_("Tasks"), NULL); - setup_folder_as_stock (local_storage, "/Trash", U_("Trash"), NULL); + setup_folder_as_stock (local_storage, "/Calendar", _("Calendar"), NULL); + setup_folder_as_stock (local_storage, "/Contacts", _("Contacts"), NULL); + setup_folder_as_stock (local_storage, "/Drafts", _("Drafts"), NULL); + setup_folder_as_stock (local_storage, "/Inbox", _("Inbox"), "inbox"); + setup_folder_as_stock (local_storage, "/Outbox", _("Outbox"), "outbox"); + setup_folder_as_stock (local_storage, "/Sent", _("Sent"), NULL); + setup_folder_as_stock (local_storage, "/Tasks", _("Tasks"), NULL); + setup_folder_as_stock (local_storage, "/Trash", _("Trash"), NULL); } static gboolean @@ -1099,7 +1101,7 @@ construct (ELocalStorage *local_storage, EFolder *root_folder; int base_path_len; - root_folder = e_folder_new (U_("Local Folders"), "noselect", ""); + root_folder = e_folder_new (_("Local Folders"), "noselect", ""); e_storage_construct (E_STORAGE (local_storage), E_LOCAL_STORAGE_NAME, root_folder); diff --git a/shell/e-setup.c b/shell/e-setup.c index ee5227f789..220f68b4d5 100644 --- a/shell/e-setup.c +++ b/shell/e-setup.c @@ -34,10 +34,8 @@ #include <unistd.h> #include <gtk/gtklabel.h> -#include <libgnome/gnome-defs.h> #include <libgnome/gnome-i18n.h> #include <libgnome/gnome-util.h> -#include <libgnomeui/gnome-stock.h> #include <gal/widgets/e-gui-utils.h> #include "e-local-folder.h" @@ -418,41 +416,34 @@ e_setup (const char *evolution_directory) void -e_setup_check_db (Bonobo_ConfigDatabase db, const char *evolution_directory) +e_setup_check_config (EConfigListener *listener, + const char *evolution_directory) { char *uri; - if (bonobo_config_get_string_with_default (db, "/DefaultFolders/mail_path", NULL, NULL) == NULL) { - bonobo_config_set_string (db, "/DefaultFolders/mail_path", - E_LOCAL_INBOX_URI, NULL); + if (e_config_listener_get_string_with_default (listener, "/DefaultFolders/mail_path", NULL, NULL) == NULL) { + e_config_listener_set_string (listener, "/DefaultFolders/mail_path", E_LOCAL_INBOX_URI); uri = g_strconcat ("file://", evolution_directory, "/local", strrchr (E_LOCAL_INBOX_URI, '/'), NULL); - bonobo_config_set_string (db, "/DefaultFolders/mail_uri", - uri, NULL); + e_config_listener_set_string (listener, "/DefaultFolders/mail_uri", uri); g_free (uri); - bonobo_config_set_string (db, "/DefaultFolders/contacts_path", - E_LOCAL_CONTACTS_URI, NULL); + e_config_listener_set_string (listener, "/DefaultFolders/contacts_path", E_LOCAL_CONTACTS_URI); uri = g_strconcat ("file://", evolution_directory, "/local", strrchr (E_LOCAL_CONTACTS_URI, '/'), NULL); - bonobo_config_set_string (db, "/DefaultFolders/contacts_uri", - uri, NULL); + e_config_listener_set_string (listener, "/DefaultFolders/contacts_uri", uri); g_free (uri); - bonobo_config_set_string (db, "/DefaultFolders/calendar_path", - E_LOCAL_CALENDAR_URI, NULL); + e_config_listener_set_string (listener, "/DefaultFolders/calendar_path", E_LOCAL_CALENDAR_URI); uri = g_strconcat ("file://", evolution_directory, "/local", strrchr (E_LOCAL_CALENDAR_URI, '/'), NULL); - bonobo_config_set_string (db, "/DefaultFolders/calendar_uri", - uri, NULL); + e_config_listener_set_string (listener, "/DefaultFolders/calendar_uri", uri); g_free (uri); - bonobo_config_set_string (db, "/DefaultFolders/tasks_path", - E_LOCAL_TASKS_URI, NULL); + e_config_listener_set_string (listener, "/DefaultFolders/tasks_path", E_LOCAL_TASKS_URI); uri = g_strconcat ("file://", evolution_directory, "/local", strrchr (E_LOCAL_TASKS_URI, '/'), NULL); - bonobo_config_set_string (db, "/DefaultFolders/tasks_uri", - uri, NULL); + e_config_listener_set_string (listener, "/DefaultFolders/tasks_uri", uri); g_free (uri); } } diff --git a/shell/e-setup.h b/shell/e-setup.h index cf839044af..e9b228dc1c 100644 --- a/shell/e-setup.h +++ b/shell/e-setup.h @@ -23,12 +23,13 @@ #ifndef _E_SETUP_H #define _E_SETUP_H +#include "e-util/e-config-listener.h" + #include <glib.h> -#include <bonobo-conf/bonobo-config-database.h> -gboolean e_setup (const char *evolution_directory); +gboolean e_setup (const char *evolution_directory); -void e_setup_check_db (Bonobo_ConfigDatabase db, - const char *evolution_directory); +void e_setup_check_config (EConfigListener *config_listener, + const char *evolution_directory); #endif /* _E_SETUP_H */ diff --git a/shell/e-shell-about-box.c b/shell/e-shell-about-box.c index 1e102fa19f..22dd0a7829 100644 --- a/shell/e-shell-about-box.c +++ b/shell/e-shell-about-box.c @@ -145,6 +145,7 @@ timeout_callback (void *data) EShellAboutBoxPrivate *priv; GdkRectangle redraw_rect; GtkWidget *widget; + GdkFont *font; int line_height; int first_line; int y; @@ -155,7 +156,8 @@ timeout_callback (void *data) widget = GTK_WIDGET (about_box); - line_height = widget->style->font->ascent + widget->style->font->descent; + font = gtk_style_get_font (widget->style); + line_height = font->ascent + font->descent; if (priv->text_y_offset < TEXT_HEIGHT) { y = TEXT_Y_OFFSET + (TEXT_HEIGHT - priv->text_y_offset); @@ -181,9 +183,9 @@ timeout_callback (void *data) else line = _(priv->permuted_text[first_line + i]); - x = TEXT_X_OFFSET + (TEXT_WIDTH - gdk_string_width (widget->style->font, line)) / 2; + x = TEXT_X_OFFSET + (TEXT_WIDTH - gdk_string_width (font, line)) / 2; - gdk_draw_string (priv->pixmap, widget->style->font, priv->clipped_gc, x, y, line); + gdk_draw_string (priv->pixmap, font, priv->clipped_gc, x, y, line); y += line_height; } @@ -266,7 +268,7 @@ impl_realize (GtkWidget *widget) about_box = E_SHELL_ABOUT_BOX (widget); priv = about_box->priv; - background_pixbuf = gdk_pixbuf_new_from_file (IMAGE_PATH); + background_pixbuf = gdk_pixbuf_new_from_file (IMAGE_PATH, NULL); g_assert (background_pixbuf != NULL); g_assert (gdk_pixbuf_get_width (background_pixbuf) == WIDTH); g_assert (gdk_pixbuf_get_height (background_pixbuf) == HEIGHT); @@ -325,32 +327,22 @@ impl_unrealize (GtkWidget *widget) } } -static void -impl_draw (GtkWidget *widget, - GdkRectangle *area) -{ - EShellAboutBox *about_box; - EShellAboutBoxPrivate *priv; - - if (! GTK_WIDGET_DRAWABLE (widget)) - return; - - about_box = E_SHELL_ABOUT_BOX (widget); - priv = about_box->priv; - - gdk_draw_pixmap (widget->window, widget->style->black_gc, priv->pixmap, - area->x, area->y, - area->x, area->y, area->width, area->height); -} - static int impl_expose_event (GtkWidget *widget, GdkEventExpose *event) { + EShellAboutBoxPrivate *priv; + if (! GTK_WIDGET_DRAWABLE (widget)) return FALSE; - gtk_widget_draw (widget, &event->area); + priv = E_SHELL_ABOUT_BOX (widget)->priv; + + gdk_draw_pixmap (widget->window, widget->style->black_gc, + priv->pixmap, + event->area.x, event->area.y, + event->area.x, event->area.y, + event->area.width, event->area.height); return TRUE; } @@ -369,7 +361,6 @@ class_init (GtkObjectClass *object_class) widget_class->size_request = impl_size_request; widget_class->realize = impl_realize; widget_class->unrealize = impl_unrealize; - widget_class->draw = impl_draw; widget_class->expose_event = impl_expose_event; } diff --git a/shell/e-shell-config-autocompletion.c b/shell/e-shell-config-autocompletion.c index 4627061248..51c6728dc8 100644 --- a/shell/e-shell-config-autocompletion.c +++ b/shell/e-shell-config-autocompletion.c @@ -32,11 +32,11 @@ #include "Evolution.h" -#include <bonobo-conf/Bonobo_Config.h> #include <bonobo/bonobo-exception.h> #include <libgnome/gnome-i18n.h> #include <gtk/gtkwidget.h> +#include <gtk/gtksignal.h> typedef struct { @@ -44,7 +44,7 @@ typedef struct { GtkWidget *control_widget; - Bonobo_ConfigDatabase db; + EConfigListener *config_listener; EvolutionShellClient *shell_client; } EvolutionAutocompletionConfig; @@ -60,6 +60,9 @@ config_control_destroy_callback (EvolutionConfigControl *config_control, EvolutionAutocompletionConfig *ac) { bonobo_object_unref (BONOBO_OBJECT (ac->shell_client)); + + g_object_unref (ac->config_listener); + g_free (ac); } @@ -69,15 +72,10 @@ config_control_apply_callback (EvolutionConfigControl *config_control, EvolutionAutocompletionConfig *ac) { char *xml; - CORBA_Environment ev; - - CORBA_exception_init (&ev); xml = e_folder_list_get_xml (E_FOLDER_LIST (ac->control_widget)); - bonobo_config_set_string (ac->db, "/Addressbook/Completion/uris", xml, &ev); + e_config_listener_set_string (ac->config_listener, "/Addressbook/Completion/uris", xml); g_free (xml); - - CORBA_exception_free (&ev); } GtkWidget * @@ -90,14 +88,16 @@ e_shell_config_autocompletion_create_widget (EShell *shell, EvolutionConfigContr static const char *possible_types[] = { "contacts/*", NULL }; ac = g_new0 (EvolutionAutocompletionConfig, 1); - ac->db = e_shell_get_config_db (shell); + ac->config_listener = e_config_listener_new (); CORBA_exception_init (&ev); shell_dup = CORBA_Object_duplicate (bonobo_object_corba_objref (BONOBO_OBJECT (shell)), &ev); ac->shell_client = evolution_shell_client_new (shell_dup); - xml = bonobo_config_get_string (ac->db, "/Addressbook/Completion/uris", &ev); + xml = e_config_listener_get_string_with_default (ac->config_listener, + "/Addressbook/Completion/uris", + NULL, NULL); ac->control_widget = e_folder_list_new (ac->shell_client, xml); g_free (xml); diff --git a/shell/e-shell-config.c b/shell/e-shell-config.c index 94fadeb5e8..19928c1db6 100644 --- a/shell/e-shell-config.c +++ b/shell/e-shell-config.c @@ -56,10 +56,9 @@ e_shell_config_factory_register (EShell *shell) g_return_val_if_fail (E_IS_SHELL (shell), FALSE); - factory = bonobo_generic_factory_new_multi ( - E_SHELL_CONFIG_FACTORY_OAFIID, - config_control_factory_cb, - shell); + factory = bonobo_generic_factory_new (E_SHELL_CONFIG_FACTORY_OAFIID, + config_control_factory_cb, + shell); if (factory == NULL) { g_warning ("Cannot register factory %s", E_SHELL_CONFIG_FACTORY_OAFIID); diff --git a/shell/e-shell-view.h b/shell/e-shell-view.h index 1b6697d558..72c76fbd2c 100644 --- a/shell/e-shell-view.h +++ b/shell/e-shell-view.h @@ -25,7 +25,7 @@ #include "e-task-bar.h" -#include <bonobo/bonobo-win.h> +#include <bonobo/bonobo-window.h> #include <bonobo/bonobo-ui-component.h> #include <bonobo/bonobo-ui-container.h> diff --git a/shell/e-shell.c b/shell/e-shell.c index 203f3bbec4..b5d6cc5b97 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -125,7 +125,7 @@ struct _EShellPrivate { GtkWidget *settings_dialog; /* Configuration Database */ - Bonobo_ConfigDatabase db; + EConfigListener *config_listener; /* Whether the shell is succesfully initialized. This is needed during the start-up sequence, to avoid CORBA calls to do make wrong things @@ -1037,8 +1037,6 @@ destroy (GtkObject *object) priv->is_initialized = FALSE; - e_shell_disconnect_db (shell); - if (priv->iid != NULL) oaf_active_server_unregister (priv->iid, bonobo_object_corba_objref (BONOBO_OBJECT (shell))); @@ -1098,6 +1096,16 @@ destroy (GtkObject *object) e_free_string_list (priv->crash_type_names); + if (priv->settings_dialog != NULL) { + gtk_object_destroy (priv->settings_dialog); + priv->settings_dialog = NULL; + } + + if (priv->config_listener != NULL) { + g_object_unref (priv->config_listener); + priv->config_listener = NULL; + } + g_free (priv); (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); @@ -1254,25 +1262,9 @@ e_shell_construct (EShell *shell, cannot register their own storages. */ if (! setup_corba_storages (shell)) return FALSE; - - CORBA_exception_init (&ev); - - priv->db = bonobo_get_object ("wombat:", "Bonobo/ConfigDatabase", &ev); - if (BONOBO_EX (&ev) || priv->db == CORBA_OBJECT_NIL) { - g_warning ("Cannot access Bonobo/ConfigDatabase on wombat: (%s)", ev._repo_id); - - /* Make sure the DB object is NIL so we don't mess up - (`bonobo_get_object()' might return an undefined value in - the case of an exception). */ - priv->db = CORBA_OBJECT_NIL; - - CORBA_exception_free (&ev); - return E_SHELL_CONSTRUCT_RESULT_NOCONFIGDB; - } - e_setup_check_db (priv->db, local_directory); - - CORBA_exception_free (&ev); + e_setup_check_db (priv->config_listener, local_directory); + /* Now we can register into OAF. Notice that we shouldn't be registering into OAF until we are sure we can complete. */ @@ -2106,11 +2098,11 @@ e_shell_show_settings (EShell *shell, const char *type, EShellView *shell_view) Bonobo_ConfigDatabase -e_shell_get_config_db (EShell *shell) +e_shell_get_config_listener (EShell *shell) { g_return_val_if_fail (E_IS_SHELL (shell), CORBA_OBJECT_NIL); - return shell->priv->db; + return shell->priv->config_listener; } EComponentRegistry * diff --git a/shell/e-shell.h b/shell/e-shell.h index 5e1cb6590e..6f3edb93f6 100644 --- a/shell/e-shell.h +++ b/shell/e-shell.h @@ -23,9 +23,10 @@ #ifndef _E_SHELL_H_ #define _E_SHELL_H_ -#include <liboaf/liboaf.h> /* For the registration stuff. */ +#include "e-util/e-config-listener.h" + +#include <bonobo-activation/bonobo-activation.h> #include <bonobo/bonobo-xobject.h> -#include <bonobo-conf/bonobo-config-database.h> #ifdef __cplusplus extern "C" { @@ -135,7 +136,6 @@ gboolean e_shell_restore_from_settings (EShell *shell, void e_shell_destroy_all_views (EShell *shell); void e_shell_unregister_all (EShell *shell); -void e_shell_disconnect_db (EShell *shell); void e_shell_component_maybe_crashed (EShell *shell, const char *uri, @@ -156,7 +156,7 @@ void e_shell_show_settings (EShell *shell, const char *type, EShellView *shell_view); -Bonobo_ConfigDatabase e_shell_get_config_db (EShell *shell); +EConfigListener *e_shell_get_config_listener (EShell *shell); EComponentRegistry *e_shell_get_component_registry (EShell *shell); EShellUserCreatableItemsHandler *e_shell_get_user_creatable_items_handler (EShell *shell); diff --git a/shell/evolution-activity-client.c b/shell/evolution-activity-client.c index 6ecea011d7..b5babd2780 100644 --- a/shell/evolution-activity-client.c +++ b/shell/evolution-activity-client.c @@ -37,6 +37,7 @@ #include <gtk/gtkmain.h> #include <bonobo/bonobo-listener.h> +#include <bonobo/bonobo-exception.h> #include <gal/util/e-util.h> @@ -99,11 +100,11 @@ corba_update_progress (EvolutionActivityClient *activity_client, progress, &ev); - if (ev._major == CORBA_NO_EXCEPTION) { + if (! BONOBO_EX (&ev)) { retval = TRUE; } else { g_warning ("EvolutionActivityClient: Error updating progress -- %s", - ev._repo_id); + BONOBO_EX_REPOID (&ev)); retval = FALSE; } @@ -136,8 +137,8 @@ update_timeout_callback (void *data) static void listener_callback (BonoboListener *listener, - char *event_name, - CORBA_any *any, + const char *event_name, + const CORBA_any *any, CORBA_Environment *ev, void *data) { @@ -175,9 +176,9 @@ impl_destroy (GtkObject *object) GNOME_Evolution_Activity_operationFinished (priv->activity_interface, priv->activity_id, &ev); - if (ev._major != CORBA_NO_EXCEPTION) + if (BONOBO_EX (&ev)) g_warning ("EvolutionActivityClient: Error reporting completion of operation -- %s", - ev._repo_id); + BONOBO_EX_REPOID (&ev)); CORBA_Object_release (priv->activity_interface, &ev); } @@ -208,7 +209,7 @@ class_init (EvolutionActivityClientClass *klass) signals[SHOW_DETAILS] = gtk_signal_new ("show_details", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionActivityClientClass, show_details), gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0); @@ -216,12 +217,10 @@ class_init (EvolutionActivityClientClass *klass) signals[CANCEL] = gtk_signal_new ("cancel", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionActivityClientClass, cancel), gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0); - - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); } @@ -411,8 +410,8 @@ evolution_activity_client_request_dialog (EvolutionActivityClient *activity_clie priv->activity_id, dialog_type, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("EvolutionActivityClient: Error requesting a dialog -- %s", ev._repo_id); + if (BONOBO_EX (&ev) != CORBA_NO_EXCEPTION) { + g_warning ("EvolutionActivityClient: Error requesting a dialog -- %s", BONOBO_EX_REPOID (&ev)); retval = GNOME_Evolution_Activity_DIALOG_ACTION_ERROR; } diff --git a/shell/evolution-config-control.c b/shell/evolution-config-control.c index c5c4bba09a..37845bcb80 100644 --- a/shell/evolution-config-control.c +++ b/shell/evolution-config-control.c @@ -136,13 +136,11 @@ class_init (EvolutionConfigControlClass *class) epv->_get_eventSource = impl__get_eventSource; signals[APPLY] = gtk_signal_new ("apply", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionConfigControlClass, apply), gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0); - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); - parent_class = gtk_type_class (PARENT_TYPE); } diff --git a/shell/evolution-folder-selector-button.c b/shell/evolution-folder-selector-button.c index 19fd5a69ae..b4fc4493b4 100644 --- a/shell/evolution-folder-selector-button.c +++ b/shell/evolution-folder-selector-button.c @@ -23,13 +23,18 @@ #endif #include "evolution-folder-selector-button.h" -#include <bonobo/bonobo-ui-toolbar-icon.h> + #include <gal/util/e-util.h> #include <gal/widgets/e-unicode.h> + #include <gtk/gtkhbox.h> +#include <gtk/gtkimage.h> #include <gtk/gtklabel.h> + #include <libgnome/gnome-i18n.h> +#include <string.h> + struct _EvolutionFolderSelectorButtonPrivate { EvolutionShellClient *shell_client; @@ -89,14 +94,15 @@ set_folder (EvolutionFolderSelectorButton *folder_selector_button, priv->selected_folder = folder; if (!folder) { - bonobo_ui_toolbar_icon_clear (BONOBO_UI_TOOLBAR_ICON (priv->icon)); + /* FIXME: Will this work? */ + gtk_image_set_from_pixbuf (GTK_IMAGE (priv->icon), NULL); gtk_label_set_text (GTK_LABEL (priv->label), _("<click here to select a folder>")); return; } pixbuf = evolution_shell_client_get_pixbuf_for_type (priv->shell_client, folder->type, TRUE); - bonobo_ui_toolbar_icon_set_pixbuf (BONOBO_UI_TOOLBAR_ICON (priv->icon), pixbuf); + gtk_image_set_from_pixbuf (GTK_IMAGE (priv->icon), pixbuf); gdk_pixbuf_unref (pixbuf); folder_lname = e_utf8_to_gtk_string (w, folder->displayName); @@ -163,6 +169,7 @@ clicked (GtkButton *button) (const char **)priv->possible_types, &return_folder); +#if 0 /* FIXME */ /* If the parent gets destroyed despite our best efforts (eg, * because its own parent got destroyed), then the folder * selector button will have been destroyed too and we need @@ -172,6 +179,7 @@ clicked (GtkButton *button) gtk_object_unref (GTK_OBJECT (parent_window)); return; } +#endif gtk_widget_set_sensitive (GTK_WIDGET (parent_window), TRUE); gtk_object_unref (GTK_OBJECT (parent_window)); @@ -201,7 +209,7 @@ destroy (GtkObject *object) folder_selector_button = EVOLUTION_FOLDER_SELECTOR_BUTTON (object); priv = folder_selector_button->priv; - bonobo_object_unref (BONOBO_OBJECT (priv->shell_client)); + g_object_unref (priv->shell_client); g_free (priv->title); for (i = 0; priv->possible_types[i]; i++) g_free (priv->possible_types[i]); @@ -232,24 +240,23 @@ class_init (EvolutionFolderSelectorButtonClass *klass) signals[POPPED_UP] = gtk_signal_new ("popped_up", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionFolderSelectorButtonClass, popped_up), gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0); signals[SELECTED] = gtk_signal_new ("selected", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionFolderSelectorButtonClass, selected), gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); signals[CANCELED] = gtk_signal_new ("canceled", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionFolderSelectorButtonClass, canceled), gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0); - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); } static void @@ -260,7 +267,7 @@ init (EvolutionFolderSelectorButton *folder_selector_button) priv = g_new0 (EvolutionFolderSelectorButtonPrivate, 1); - priv->icon = bonobo_ui_toolbar_icon_new (); + priv->icon = gtk_image_new (); priv->label = gtk_label_new (""); gtk_label_set_justify (GTK_LABEL (priv->label), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment (GTK_MISC (priv->label), 0.0, 0.0); @@ -304,7 +311,7 @@ evolution_folder_selector_button_construct (EvolutionFolderSelectorButton *folde priv = folder_selector_button->priv; priv->shell_client = shell_client; - bonobo_object_ref (BONOBO_OBJECT (shell_client)); + g_object_ref (shell_client); priv->corba_storage_registry = evolution_shell_client_get_storage_registry_interface (shell_client); priv->title = g_strdup (title); diff --git a/shell/evolution-session.c b/shell/evolution-session.c index 3c9647981f..01603f993a 100644 --- a/shell/evolution-session.c +++ b/shell/evolution-session.c @@ -32,8 +32,8 @@ #include "evolution-session.h" -#define PARENT_TYPE bonobo_object_get_type () -static BonoboObjectClass *parent_class = NULL; +#define PARENT_TYPE bonobo_x_object_get_type () +static BonoboXObjectClass *parent_class = NULL; struct _EvolutionSessionPrivate { int dummy; @@ -92,28 +92,14 @@ impl_GNOME_Evolution_Session_loadConfiguration (PortableServer_Servant servant, /* Initialization. */ -static POA_GNOME_Evolution_Session__vepv GNOME_Evolution_Session_vepv; - static void -corba_class_init (void) +corba_class_init (EvolutionSessionClass *klass) { - POA_GNOME_Evolution_Session__vepv *vepv; - POA_GNOME_Evolution_Session__epv *epv; - PortableServer_ServantBase__epv *base_epv; - - base_epv = g_new0 (PortableServer_ServantBase__epv, 1); - base_epv->_private = NULL; - base_epv->finalize = NULL; - base_epv->default_POA = NULL; + POA_GNOME_Evolution_Session__epv *epv = & (EVOLUTION_SESSION_CLASS (klass)->epv); epv = g_new0 (POA_GNOME_Evolution_Session__epv, 1); epv->saveConfiguration = impl_GNOME_Evolution_Session_saveConfiguration; epv->loadConfiguration = impl_GNOME_Evolution_Session_loadConfiguration; - - vepv = &GNOME_Evolution_Session_vepv; - vepv->_base_epv = base_epv; - vepv->Bonobo_Unknown_epv = bonobo_object_get_epv (); - vepv->GNOME_Evolution_Session_epv = epv; } static void @@ -122,14 +108,14 @@ class_init (EvolutionSessionClass *klass) GtkObjectClass *object_class; object_class = GTK_OBJECT_CLASS (klass); - parent_class = gtk_type_class (bonobo_object_get_type ()); + parent_class = gtk_type_class (PARENT_TYPE); object_class->destroy = impl_destroy; signals[LOAD_CONFIGURATION] = gtk_signal_new ("load_configuration", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionSessionClass, load_configuration), gtk_marshal_NONE__STRING, GTK_TYPE_NONE, 1, @@ -137,15 +123,13 @@ class_init (EvolutionSessionClass *klass) signals[SAVE_CONFIGURATION] = gtk_signal_new ("save_configuration", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionSessionClass, save_configuration), gtk_marshal_NONE__STRING, GTK_TYPE_NONE, 1, GTK_TYPE_STRING); - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); - - corba_class_init (); + corba_class_init (klass); } static void @@ -159,55 +143,14 @@ init (EvolutionSession *session) } -static GNOME_Evolution_Session -create_corba_session (BonoboObject *object) -{ - POA_GNOME_Evolution_Session *servant; - CORBA_Environment ev; - - servant = (POA_GNOME_Evolution_Session *) g_new0 (BonoboObjectServant, 1); - servant->vepv = &GNOME_Evolution_Session_vepv; - - CORBA_exception_init (&ev); - - POA_GNOME_Evolution_Session__init ((PortableServer_Servant) servant, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_free (servant); - CORBA_exception_free (&ev); - return CORBA_OBJECT_NIL; - } - - CORBA_exception_free (&ev); - return (GNOME_Evolution_Session) bonobo_object_activate_servant (object, servant); -} - -void -evolution_session_construct (EvolutionSession *session, - CORBA_Object corba_session) -{ - g_return_if_fail (session != NULL); - g_return_if_fail (corba_session != CORBA_OBJECT_NIL); - - bonobo_object_construct (BONOBO_OBJECT (session), corba_session); -} - EvolutionSession * evolution_session_new (void) { - EvolutionSession *session; - GNOME_Evolution_Session corba_session; - - session = gtk_type_new (evolution_session_get_type ()); - - corba_session = create_corba_session (BONOBO_OBJECT (session)); - if (corba_session == CORBA_OBJECT_NIL) { - bonobo_object_unref (BONOBO_OBJECT (session)); - return NULL; - } - - evolution_session_construct (session, corba_session); - return session; + return gtk_type_new (evolution_session_get_type ()); } -E_MAKE_TYPE (evolution_session, "EvolutionSession", EvolutionSession, class_init, init, PARENT_TYPE) +E_MAKE_X_TYPE (evolution_session, "EvolutionSession", EvolutionSession, + class_init, init, PARENT_TYPE, + POA_GNOME_Evolution_Session__init, + GTK_STRUCT_OFFSET (EvolutionSessionClass, epv)) diff --git a/shell/evolution-session.h b/shell/evolution-session.h index a0a36fa810..1310ad9256 100644 --- a/shell/evolution-session.h +++ b/shell/evolution-session.h @@ -23,7 +23,7 @@ #ifndef __EVOLUTION_SESSION_H__ #define __EVOLUTION_SESSION_H__ -#include <bonobo/bonobo-object.h> +#include <bonobo/bonobo-xobject.h> #ifdef __cplusplus extern "C" { @@ -42,13 +42,15 @@ typedef struct _EvolutionSessionPrivate EvolutionSessionPrivate; typedef struct _EvolutionSessionClass EvolutionSessionClass; struct _EvolutionSession { - BonoboObject parent; + BonoboXObject parent; EvolutionSessionPrivate *priv; }; struct _EvolutionSessionClass { - BonoboObjectClass parent_class; + BonoboXObjectClass parent_class; + + POA_GNOME_Evolution_Session__epv epv; void (* save_configuration) (EvolutionSession *session, const char *prefix); void (* load_configuration) (EvolutionSession *session, const char *prefix); @@ -56,8 +58,6 @@ struct _EvolutionSessionClass { GtkType evolution_session_get_type (void); -void evolution_session_construct (EvolutionSession *session, - CORBA_Object corba_session); EvolutionSession *evolution_session_new (void); #ifdef __cplusplus diff --git a/shell/evolution-shell-client.c b/shell/evolution-shell-client.c index f7fb368399..1d2db19203 100644 --- a/shell/evolution-shell-client.c +++ b/shell/evolution-shell-client.c @@ -39,14 +39,16 @@ struct _EvolutionShellClientPrivate { + GNOME_Evolution_Shell corba_objref; + GNOME_Evolution_Activity activity_interface; GNOME_Evolution_Shortcuts shortcuts_interface; GNOME_Evolution_StorageRegistry storage_registry_interface; GHashTable *icons; }; -#define PARENT_TYPE bonobo_object_client_get_type () -static BonoboObjectClientClass *parent_class = NULL; +#define PARENT_TYPE G_TYPE_OBJECT +static GObjectClass *parent_class = NULL; /* Easy-to-use wrapper for Evolution::user_select_folder. */ @@ -80,9 +82,9 @@ query_shell_interface (EvolutionShellClient *shell_client, interface_object = Bonobo_Unknown_queryInterface (bonobo_object_corba_objref (BONOBO_OBJECT (shell_client)), interface_name, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { + if (BONOBO_EX (&ev)) { g_warning ("EvolutionShellClient: Error querying interface %s on %p -- %s", - interface_name, shell_client, ev._repo_id); + interface_name, shell_client, BONOBO_EX_REPOID (&ev)); interface_object = CORBA_OBJECT_NIL; } else if (CORBA_Object_is_nil (interface_object, &ev)) { g_warning ("No interface %s for ShellClient %p", interface_name, shell_client); @@ -278,12 +280,21 @@ destroy (GtkObject *object) CORBA_exception_init (&ev); + if (priv->corba_objref != CORBA_OBJECT_NIL) { + Bonobo_Unknown_unref (priv->corba_objref, &ev); + if (ev._major != CORBA_NO_EXCEPTION) + g_warning ("EvolutionShellClient::destroy: " + "Error unreffing the ::Shell interface -- %s\n", + BONOBO_EX_REPOID (&ev)); + CORBA_Object_release (priv->corba_objref, &ev); + } + if (priv->activity_interface != CORBA_OBJECT_NIL) { Bonobo_Unknown_unref (priv->activity_interface, &ev); if (ev._major != CORBA_NO_EXCEPTION) g_warning ("EvolutionShellClient::destroy: " "Error unreffing the ::Activity interface -- %s\n", - ev._repo_id); + BONOBO_EX_REPOID (&ev)); CORBA_Object_release (priv->activity_interface, &ev); } @@ -292,7 +303,7 @@ destroy (GtkObject *object) if (ev._major != CORBA_NO_EXCEPTION) g_warning ("EvolutionShellClient::destroy: " "Error unreffing the ::Shortcuts interface -- %s\n", - ev._repo_id); + BONOBO_EX_REPOID (&ev)); CORBA_Object_release (priv->shortcuts_interface, &ev); } @@ -301,7 +312,7 @@ destroy (GtkObject *object) if (ev._major != CORBA_NO_EXCEPTION) g_warning ("EvolutionShellClient::destroy: " "Error unreffing the ::StorageRegistry interface -- %s\n", - ev._repo_id); + BONOBO_EX_REPOID (&ev)); CORBA_Object_release (priv->storage_registry_interface, &ev); } @@ -334,6 +345,7 @@ init (EvolutionShellClient *shell_client) EvolutionShellClientPrivate *priv; priv = g_new (EvolutionShellClientPrivate, 1); + priv->corba_objref = CORBA_OBJECT_NIL; priv->activity_interface = CORBA_OBJECT_NIL; priv->shortcuts_interface = CORBA_OBJECT_NIL; priv->storage_registry_interface = CORBA_OBJECT_NIL; @@ -360,11 +372,13 @@ evolution_shell_client_construct (EvolutionShellClient *shell_client, g_return_if_fail (EVOLUTION_IS_SHELL_CLIENT (shell_client)); g_return_if_fail (corba_shell != CORBA_OBJECT_NIL); - bonobo_object_construct (BONOBO_OBJECT (shell_client), (CORBA_Object) corba_shell); - priv = shell_client->priv; g_return_if_fail (priv->activity_interface == CORBA_OBJECT_NIL); + /* (Notice that we don't ref or duplicate, since this is what the old + BonoboObject did.) */ + priv->corba_objref = corba_shell; + priv->activity_interface = query_shell_interface (shell_client, "IDL:GNOME/Evolution/Activity:1.0"); priv->shortcuts_interface = query_shell_interface (shell_client, "IDL:GNOME/Evolution/Shortcuts:1.0"); priv->storage_registry_interface = query_shell_interface (shell_client, "IDL:GNOME/Evolution/StorageRegistry:1.0"); @@ -396,6 +410,20 @@ evolution_shell_client_new (GNOME_Evolution_Shell corba_shell) return shell_client; } +/** + * evolution_shell_client_corba_objref: + * @shell_client: + * + * Return value: Return the CORBA objref associated with this shell client. + **/ +GNOME_Evolution_Shell +evolution_shell_client_corba_objref (EvolutionShellClient *shell_client) +{ + g_return_val_if_fail (EVOLUTION_IS_SHELL_CLIENT (shell_client), CORBA_OBJECT_NIL); + + return shell_client->priv->corba_objref; +} + /** * evolution_shell_client_user_select_folder: @@ -525,7 +553,8 @@ evolution_shell_client_get_local_storage (EvolutionShellClient *shell_client) corba_local_storage = GNOME_Evolution_Shell_getLocalStorage (corba_shell, &ev); if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("evolution_shell_client_get_local_storage() failing -- %s ???", ev._repo_id); + g_warning ("evolution_shell_client_get_local_storage() failing -- %s ???", + BONOBO_EX_REPOID (&ev)); CORBA_exception_free (&ev); return CORBA_OBJECT_NIL; } @@ -623,7 +652,7 @@ evolution_shell_client_create_storage_set_view (EvolutionShellClient *shell_clie control = GNOME_Evolution_Shell_createStorageSetView (corba_shell, ev); if (BONOBO_EX (ev)) { - g_warning ("Cannot create StorageSetView -- %s", BONOBO_EX_ID (ev)); + g_warning ("Cannot create StorageSetView -- %s", BONOBO_EX_REPOID (ev)); CORBA_exception_free (&my_ev); return NULL; } diff --git a/shell/evolution-shell-client.h b/shell/evolution-shell-client.h index 3122c4312c..18fe144929 100644 --- a/shell/evolution-shell-client.h +++ b/shell/evolution-shell-client.h @@ -23,10 +23,11 @@ #ifndef __EVOLUTION_SHELL_CLIENT_H__ #define __EVOLUTION_SHELL_CLIENT_H__ -#include <bonobo/bonobo-object-client.h> #include <gtk/gtkwindow.h> #include <gdk-pixbuf/gdk-pixbuf.h> +#include <glib-object.h> + #include "Evolution.h" #ifdef __cplusplus @@ -46,13 +47,13 @@ typedef struct _EvolutionShellClientPrivate EvolutionShellClientPrivate; typedef struct _EvolutionShellClientClass EvolutionShellClientClass; struct _EvolutionShellClient { - BonoboObjectClient parent; + GObject base; EvolutionShellClientPrivate *priv; }; struct _EvolutionShellClientClass { - BonoboObjectClientClass parent_class; + GObjectClass parent_class; }; @@ -61,6 +62,8 @@ void evolution_shell_client_construct (EvolutionShe GNOME_Evolution_Shell corba_shell); EvolutionShellClient *evolution_shell_client_new (GNOME_Evolution_Shell shell); +GNOME_Evolution_Shell evolution_shell_client_corba_objref (EvolutionShellClient *shell_client); + void evolution_shell_client_user_select_folder (EvolutionShellClient *shell_client, GtkWindow *parent, const char *title, diff --git a/shell/evolution-shell-component-client.c b/shell/evolution-shell-component-client.c index 9276c6fa0f..3ea637410b 100644 --- a/shell/evolution-shell-component-client.c +++ b/shell/evolution-shell-component-client.c @@ -28,8 +28,9 @@ #include <gtk/gtksignal.h> #include <gtk/gtktypeutils.h> -#include <liboaf/liboaf.h> +#include <bonobo-activation/bonobo-activation.h> +#include <bonobo/bonobo-exception.h> #include <bonobo/bonobo-main.h> #include <bonobo/bonobo-widget.h> @@ -40,10 +41,12 @@ char *evolution_debug_log; -#define PARENT_TYPE BONOBO_OBJECT_CLIENT_TYPE -static BonoboObjectClass *parent_class = NULL; +#define PARENT_TYPE G_TYPE_OBJECT +static GObjectClass *parent_class = NULL; struct _EvolutionShellComponentClientPrivate { + GNOME_Evolution_ShellComponent corba_objref; + char *id; EvolutionShellComponentClientCallback callback; @@ -71,21 +74,21 @@ corba_exception_to_result (const CORBA_Environment *ev) return EVOLUTION_SHELL_COMPONENT_OK; if (ev->_major == CORBA_USER_EXCEPTION) { - if (strcmp (ev->_repo_id, ex_GNOME_Evolution_ShellComponent_AlreadyOwned) == 0) + if (strcmp (BONOBO_EX_REPOID (ev), ex_GNOME_Evolution_ShellComponent_AlreadyOwned) == 0) return EVOLUTION_SHELL_COMPONENT_ALREADYOWNED; - if (strcmp (ev->_repo_id, ex_GNOME_Evolution_ShellComponent_OldOwnerHasDied) == 0) + if (strcmp (BONOBO_EX_REPOID (ev), ex_GNOME_Evolution_ShellComponent_OldOwnerHasDied) == 0) return EVOLUTION_SHELL_COMPONENT_OLDOWNERHASDIED; - if (strcmp (ev->_repo_id, ex_GNOME_Evolution_ShellComponent_NotOwned) == 0) + if (strcmp (BONOBO_EX_REPOID (ev), ex_GNOME_Evolution_ShellComponent_NotOwned) == 0) return EVOLUTION_SHELL_COMPONENT_NOTOWNED; - if (strcmp (ev->_repo_id, ex_GNOME_Evolution_ShellComponent_NotFound) == 0) + if (strcmp (BONOBO_EX_REPOID (ev), ex_GNOME_Evolution_ShellComponent_NotFound) == 0) return EVOLUTION_SHELL_COMPONENT_NOTFOUND; - if (strcmp (ev->_repo_id, ex_GNOME_Evolution_ShellComponent_UnsupportedType) == 0) + if (strcmp (BONOBO_EX_REPOID (ev), ex_GNOME_Evolution_ShellComponent_UnsupportedType) == 0) return EVOLUTION_SHELL_COMPONENT_UNSUPPORTEDTYPE; - if (strcmp (ev->_repo_id, ex_GNOME_Evolution_ShellComponent_InternalError) == 0) + if (strcmp (BONOBO_EX_REPOID (ev), ex_GNOME_Evolution_ShellComponent_InternalError) == 0) return EVOLUTION_SHELL_COMPONENT_INTERNALERROR; - if (strcmp (ev->_repo_id, ex_GNOME_Evolution_ShellComponent_Busy) == 0) + if (strcmp (BONOBO_EX_REPOID (ev), ex_GNOME_Evolution_ShellComponent_Busy) == 0) return EVOLUTION_SHELL_COMPONENT_BUSY; - if (strcmp (ev->_repo_id, ex_GNOME_Evolution_ShellComponent_UnsupportedSchema) == 0) + if (strcmp (BONOBO_EX_REPOID (ev), ex_GNOME_Evolution_ShellComponent_UnsupportedSchema) == 0) return EVOLUTION_SHELL_COMPONENT_UNSUPPORTEDSCHEMA; return EVOLUTION_SHELL_COMPONENT_UNKNOWNERROR; @@ -302,34 +305,52 @@ impl_destroy (GtkObject *object) shell_component_client = EVOLUTION_SHELL_COMPONENT_CLIENT (object); priv = shell_component_client->priv; + if (priv == NULL) + return; + g_free (priv->id); + priv->id = NULL; - if (priv->callback != NULL) + if (priv->callback != NULL) { dispatch_callback (shell_component_client, EVOLUTION_SHELL_COMPONENT_INTERRUPTED); + priv->callback = NULL; + } CORBA_exception_init (&ev); + if (priv->corba_objref != CORBA_OBJECT_NIL) { + Bonobo_Unknown_unref (priv->corba_objref, &ev); + CORBA_Object_release (priv->corba_objref, &ev); + priv->corba_objref = CORBA_OBJECT_NIL; + } + if (priv->dnd_source_folder_interface != CORBA_OBJECT_NIL) { Bonobo_Unknown_unref (priv->dnd_source_folder_interface, &ev); CORBA_Object_release (priv->dnd_source_folder_interface, &ev); + priv->dnd_source_folder_interface = CORBA_OBJECT_NIL; } if (priv->dnd_destination_folder_interface != CORBA_OBJECT_NIL) { Bonobo_Unknown_unref (priv->dnd_destination_folder_interface, &ev); CORBA_Object_release (priv->dnd_destination_folder_interface, &ev); + priv->dnd_destination_folder_interface = CORBA_OBJECT_NIL; } if (priv->offline_interface != CORBA_OBJECT_NIL) { Bonobo_Unknown_unref (priv->offline_interface, &ev); CORBA_Object_release (priv->offline_interface, &ev); + priv->offline_interface = CORBA_OBJECT_NIL; } - if (priv->listener_interface != CORBA_OBJECT_NIL) + if (priv->listener_interface != CORBA_OBJECT_NIL) { destroy_listener_interface (shell_component_client); + priv->listener_interface = CORBA_OBJECT_NIL; + } CORBA_exception_free (&ev); g_free (priv); + shell_component_client->priv = NULL; (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); } @@ -353,6 +374,8 @@ init (EvolutionShellComponentClient *shell_component_client) priv = g_new (EvolutionShellComponentClientPrivate, 1); + priv->corba_objref = CORBA_OBJECT_NIL; + priv->id = NULL; priv->listener_interface = CORBA_OBJECT_NIL; @@ -383,10 +406,8 @@ evolution_shell_component_client_construct (EvolutionShellComponentClient *shell g_return_if_fail (corba_object != CORBA_OBJECT_NIL); priv = shell_component_client->priv; + priv->corba_objref = corba_object; priv->id = g_strdup (id); - - bonobo_object_client_construct (BONOBO_OBJECT_CLIENT (shell_component_client), - corba_object); } EvolutionShellComponentClient * @@ -407,7 +428,7 @@ evolution_shell_component_client_new (const char *id, else local_ev = ev; - corba_object = oaf_activate_from_id ((char *) id, 0, NULL, ev); + corba_object = bonobo_activation_activate_from_id ((char *) id, 0, NULL, ev); if (ev->_major != CORBA_NO_EXCEPTION || corba_object == NULL) { CORBA_exception_free (&static_ev); return NULL; diff --git a/shell/evolution-shell-component-client.h b/shell/evolution-shell-component-client.h index 0c302b38e5..584d04703c 100644 --- a/shell/evolution-shell-component-client.h +++ b/shell/evolution-shell-component-client.h @@ -23,7 +23,8 @@ #ifndef EVOLUTION_SHELL_COMPONENT_CLIENT_H #define EVOLUTION_SHELL_COMPONENT_CLIENT_H -#include <bonobo/bonobo-object-client.h> +#include <glib-object.h> + #include <bonobo/bonobo-ui-container.h> #include <bonobo/bonobo-ui-component.h> @@ -46,13 +47,13 @@ typedef struct _EvolutionShellComponentClientPrivate EvolutionShellComponentClie typedef struct _EvolutionShellComponentClientClass EvolutionShellComponentClientClass; struct _EvolutionShellComponentClient { - BonoboObjectClient parent; + GObject parent; EvolutionShellComponentClientPrivate *priv; }; struct _EvolutionShellComponentClientClass { - BonoboObjectClientClass parent_class; + GObjectClass parent_class; }; typedef void (* EvolutionShellComponentClientCallback) (EvolutionShellComponentClient *shell_component_client, diff --git a/shell/evolution-shell-component-dnd.c b/shell/evolution-shell-component-dnd.c index c2d2d247a8..7648d98677 100644 --- a/shell/evolution-shell-component-dnd.c +++ b/shell/evolution-shell-component-dnd.c @@ -20,15 +20,16 @@ * Author: Chris Toshok */ -#include <gal/util/e-util.h> - #include "Evolution.h" #include "evolution-shell-component-dnd.h" +#include <gal/util/e-util.h> + +#include <gtk/gtkobject.h> -#define PARENT_TYPE (bonobo_object_get_type ()) +#define PARENT_TYPE (bonobo_x_object_get_type ()) -static BonoboObjectClass *parent_class; +static BonoboXObjectClass *parent_class; /* Source Folder stuff */ @@ -54,7 +55,7 @@ dnd_source_destroy (GtkObject *object) g_free (priv); - GTK_OBJECT_CLASS (parent_class)->destroy (object); + (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); } static void @@ -122,54 +123,6 @@ impl_GNOME_Evolution_ShellComponentDnd_SourceFolder_endDrag (PortableServer_Serv priv->end_drag (folder, source_context, priv->user_data); } -static POA_GNOME_Evolution_ShellComponentDnd_SourceFolder__vepv SourceFolder_vepv; - -static POA_GNOME_Evolution_ShellComponentDnd_SourceFolder * -create_dnd_source_servant (void) -{ - POA_GNOME_Evolution_ShellComponentDnd_SourceFolder *servant; - CORBA_Environment ev; - - servant = (POA_GNOME_Evolution_ShellComponentDnd_SourceFolder *)g_new0 (BonoboObjectServant, 1); - servant->vepv = &SourceFolder_vepv; - - CORBA_exception_init (&ev); - POA_GNOME_Evolution_ShellComponentDnd_SourceFolder__init ((PortableServer_Servant) servant, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_free (servant); - CORBA_exception_free (&ev); - return NULL; - } - - CORBA_exception_free (&ev); - - return servant; -} - -static void -source_corba_class_init (void) -{ - POA_GNOME_Evolution_ShellComponentDnd_SourceFolder__vepv *vepv; - POA_GNOME_Evolution_ShellComponentDnd_SourceFolder__epv *epv; - PortableServer_ServantBase__epv *base_epv; - - base_epv = g_new0 (PortableServer_ServantBase__epv, 1); - base_epv->_private = NULL; - base_epv->finalize = NULL; - base_epv->default_POA = NULL; - - epv = g_new0 (POA_GNOME_Evolution_ShellComponentDnd_SourceFolder__epv, 1); - epv->beginDrag = impl_GNOME_Evolution_ShellComponentDnd_SourceFolder_beginDrag; - epv->getData = impl_GNOME_Evolution_ShellComponentDnd_SourceFolder_getData; - epv->deleteData = impl_GNOME_Evolution_ShellComponentDnd_SourceFolder_deleteData; - epv->endDrag = impl_GNOME_Evolution_ShellComponentDnd_SourceFolder_endDrag; - - vepv = &SourceFolder_vepv; - vepv->_base_epv = base_epv; - vepv->Bonobo_Unknown_epv = bonobo_object_get_epv (); - vepv->GNOME_Evolution_ShellComponentDnd_SourceFolder_epv = epv; -} - static void evolution_shell_component_dnd_source_folder_class_init (EvolutionShellComponentDndSourceFolderClass *klass) { @@ -178,9 +131,12 @@ evolution_shell_component_dnd_source_folder_class_init (EvolutionShellComponentD object_class = GTK_OBJECT_CLASS (klass); object_class->destroy = dnd_source_destroy; - parent_class = gtk_type_class (PARENT_TYPE); + klass->epv.beginDrag = impl_GNOME_Evolution_ShellComponentDnd_SourceFolder_beginDrag; + klass->epv.getData = impl_GNOME_Evolution_ShellComponentDnd_SourceFolder_getData; + klass->epv.deleteData = impl_GNOME_Evolution_ShellComponentDnd_SourceFolder_deleteData; + klass->epv.endDrag = impl_GNOME_Evolution_ShellComponentDnd_SourceFolder_endDrag; - source_corba_class_init (); + parent_class = gtk_type_class (PARENT_TYPE); } static void @@ -193,36 +149,14 @@ evolution_shell_component_dnd_source_folder_init (EvolutionShellComponentDndSour folder->priv = priv; } - -E_MAKE_TYPE (evolution_shell_component_dnd_source_folder, "EvolutionShellComponentDndSourceFolder", - EvolutionShellComponentDndSourceFolder, evolution_shell_component_dnd_source_folder_class_init, - evolution_shell_component_dnd_source_folder_init, PARENT_TYPE); - -static void -evolution_shell_component_dnd_source_folder_construct (EvolutionShellComponentDndSourceFolder *dnd_source, - DndSourceFolderBeginDragFn begin_drag, - DndSourceFolderGetDataFn get_data, - DndSourceFolderDeleteDataFn delete_data, - DndSourceFolderEndDragFn end_drag, - gpointer user_data, - GNOME_Evolution_ShellComponentDnd_SourceFolder corba_object) -{ - DndSourceFolderPrivate *priv; - - g_return_if_fail (dnd_source != NULL); - g_return_if_fail (IS_EVOLUTION_SHELL_COMPONENT_DND_SOURCE_FOLDER (dnd_source)); - g_return_if_fail (corba_object != CORBA_OBJECT_NIL); - - priv = dnd_source->priv; - - priv->begin_drag = begin_drag; - priv->get_data = get_data; - priv->delete_data = delete_data; - priv->end_drag = end_drag; - priv->user_data = user_data; - - bonobo_object_construct (BONOBO_OBJECT (dnd_source), corba_object); -} +E_MAKE_X_TYPE (evolution_shell_component_dnd_source_folder, + "EvolutionShellComponentDndSourceFolder", + EvolutionShellComponentDndSourceFolder, + evolution_shell_component_dnd_source_folder_class_init, + evolution_shell_component_dnd_source_folder_init, + PARENT_TYPE, + POA_GNOME_Evolution_ShellComponentDnd_SourceFolder__init, + GTK_STRUCT_OFFSET (EvolutionShellComponentDndSourceFolderClass, epv)) EvolutionShellComponentDndSourceFolder* evolution_shell_component_dnd_source_folder_new (DndSourceFolderBeginDragFn begin_drag, @@ -232,27 +166,20 @@ evolution_shell_component_dnd_source_folder_new (DndSourceFolderBeginDragFn begi gpointer user_data) { EvolutionShellComponentDndSourceFolder *dnd_source; - POA_GNOME_Evolution_ShellComponentDnd_SourceFolder *servant; - GNOME_Evolution_ShellComponentDnd_SourceFolder corba_object; g_return_val_if_fail (begin_drag != NULL, NULL); g_return_val_if_fail (get_data != NULL, NULL); g_return_val_if_fail (delete_data != NULL, NULL); g_return_val_if_fail (end_drag != NULL, NULL); - servant = create_dnd_source_servant(); - if (servant == NULL) - return NULL; - dnd_source = gtk_type_new (evolution_shell_component_dnd_source_folder_get_type ()); - corba_object = bonobo_object_activate_servant (BONOBO_OBJECT (dnd_source), - servant); - - evolution_shell_component_dnd_source_folder_construct (dnd_source, - begin_drag, get_data, - delete_data, end_drag, - user_data, - corba_object); + + dnd_source->priv->begin_drag = begin_drag; + dnd_source->priv->get_data = get_data; + dnd_source->priv->delete_data = delete_data; + dnd_source->priv->end_drag = end_drag; + dnd_source->priv->user_data = user_data; + return dnd_source; } @@ -321,52 +248,6 @@ impl_GNOME_Evolution_ShellComponentDnd_DestinationFolder_handleDrop (PortableSer return priv->handle_drop (folder, physical_uri, folder_type, destination_context, action, data, priv->user_data); } -static POA_GNOME_Evolution_ShellComponentDnd_DestinationFolder__vepv DestinationFolder_vepv; - -static POA_GNOME_Evolution_ShellComponentDnd_DestinationFolder * -create_dnd_destination_servant (void) -{ - POA_GNOME_Evolution_ShellComponentDnd_DestinationFolder *servant; - CORBA_Environment ev; - - servant = (POA_GNOME_Evolution_ShellComponentDnd_DestinationFolder *)g_new0 (BonoboObjectServant, 1); - servant->vepv = &DestinationFolder_vepv; - - CORBA_exception_init (&ev); - POA_GNOME_Evolution_ShellComponentDnd_DestinationFolder__init ((PortableServer_Servant) servant, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_free (servant); - CORBA_exception_free (&ev); - return NULL; - } - - CORBA_exception_free (&ev); - - return servant; -} - -static void -destination_corba_class_init (void) -{ - POA_GNOME_Evolution_ShellComponentDnd_DestinationFolder__vepv *vepv; - POA_GNOME_Evolution_ShellComponentDnd_DestinationFolder__epv *epv; - PortableServer_ServantBase__epv *base_epv; - - base_epv = g_new0 (PortableServer_ServantBase__epv, 1); - base_epv->_private = NULL; - base_epv->finalize = NULL; - base_epv->default_POA = NULL; - - epv = g_new0 (POA_GNOME_Evolution_ShellComponentDnd_DestinationFolder__epv, 1); - epv->handleMotion = impl_GNOME_Evolution_ShellComponentDnd_DestinationFolder_handleMotion; - epv->handleDrop = impl_GNOME_Evolution_ShellComponentDnd_DestinationFolder_handleDrop; - - vepv = &DestinationFolder_vepv; - vepv->_base_epv = base_epv; - vepv->Bonobo_Unknown_epv = bonobo_object_get_epv (); - vepv->GNOME_Evolution_ShellComponentDnd_DestinationFolder_epv = epv; -} - static void evolution_shell_component_dnd_destination_folder_class_init (EvolutionShellComponentDndDestinationFolderClass *klass) { @@ -375,9 +256,10 @@ evolution_shell_component_dnd_destination_folder_class_init (EvolutionShellCompo object_class = GTK_OBJECT_CLASS (klass); object_class->destroy = dnd_destination_destroy; - parent_class = gtk_type_class (PARENT_TYPE); + klass->epv.handleMotion = impl_GNOME_Evolution_ShellComponentDnd_DestinationFolder_handleMotion; + klass->epv.handleDrop = impl_GNOME_Evolution_ShellComponentDnd_DestinationFolder_handleDrop; - destination_corba_class_init (); + parent_class = gtk_type_class (PARENT_TYPE); } static void @@ -391,56 +273,31 @@ evolution_shell_component_dnd_destination_folder_init (EvolutionShellComponentDn } -E_MAKE_TYPE (evolution_shell_component_dnd_destination_folder, "EvolutionShellComponentDndDestinationFolder", - EvolutionShellComponentDndDestinationFolder, evolution_shell_component_dnd_destination_folder_class_init, - evolution_shell_component_dnd_destination_folder_init, PARENT_TYPE); - -static void -evolution_shell_component_dnd_destination_folder_construct (EvolutionShellComponentDndDestinationFolder *dnd_destination, - DndDestinationFolderHandleMotionFn handle_motion, - DndDestinationFolderHandleDropFn handle_drop, - gpointer user_data, - GNOME_Evolution_ShellComponentDnd_DestinationFolder corba_object) -{ - DndDestinationFolderPrivate *priv; - - g_return_if_fail (dnd_destination != NULL); - g_return_if_fail (IS_EVOLUTION_SHELL_COMPONENT_DND_DESTINATION_FOLDER (dnd_destination)); - g_return_if_fail (corba_object != CORBA_OBJECT_NIL); - - priv = dnd_destination->priv; +E_MAKE_X_TYPE (evolution_shell_component_dnd_destination_folder, + "EvolutionShellComponentDndDestinationFolder", + EvolutionShellComponentDndDestinationFolder, + evolution_shell_component_dnd_destination_folder_class_init, + evolution_shell_component_dnd_destination_folder_init, + PARENT_TYPE, + POA_GNOME_Evolution_ShellComponentDnd_DestinationFolder__init, + GTK_STRUCT_OFFSET (EvolutionShellComponentDndDestinationFolderClass, epv)) - priv->handle_motion = handle_motion; - priv->handle_drop = handle_drop; - priv->user_data = user_data; - - bonobo_object_construct (BONOBO_OBJECT (dnd_destination), corba_object); -} - -EvolutionShellComponentDndDestinationFolder* +EvolutionShellComponentDndDestinationFolder * evolution_shell_component_dnd_destination_folder_new (DndDestinationFolderHandleMotionFn handle_motion, DndDestinationFolderHandleDropFn handle_drop, gpointer user_data) { EvolutionShellComponentDndDestinationFolder *dnd_destination; - POA_GNOME_Evolution_ShellComponentDnd_DestinationFolder *servant; - GNOME_Evolution_ShellComponentDnd_DestinationFolder corba_object; g_return_val_if_fail (handle_motion != NULL, NULL); g_return_val_if_fail (handle_drop != NULL, NULL); - servant = create_dnd_destination_servant(); - if (servant == NULL) - return NULL; - dnd_destination = gtk_type_new (evolution_shell_component_dnd_destination_folder_get_type ()); - corba_object = bonobo_object_activate_servant (BONOBO_OBJECT (dnd_destination), - servant); - evolution_shell_component_dnd_destination_folder_construct (dnd_destination, - handle_motion, handle_drop, - user_data, - corba_object); + dnd_destination->priv->handle_motion = handle_motion; + dnd_destination->priv->handle_drop = handle_drop; + dnd_destination->priv->user_data = user_data; + return dnd_destination; } diff --git a/shell/evolution-shell-component-dnd.h b/shell/evolution-shell-component-dnd.h index 78df2b6ee2..c97c625d3c 100644 --- a/shell/evolution-shell-component-dnd.h +++ b/shell/evolution-shell-component-dnd.h @@ -23,7 +23,9 @@ #ifndef EVOLUTION_SHELL_COMPONENT_DND_H #define EVOLUTION_SHELL_COMPONENT_DND_H -#include <bonobo/bonobo-object.h> +#include <bonobo/bonobo-xobject.h> +#include <gtk/gtktypeutils.h> + #include "Evolution.h" #ifdef cplusplus @@ -63,12 +65,14 @@ typedef void (*DndSourceFolderEndDragFn)(EvolutionShellComponentDndSourceFolder gpointer closure); struct _EvolutionShellComponentDndSourceFolder { - BonoboObject object; + BonoboXObject object; DndSourceFolderPrivate *priv; }; struct _EvolutionShellComponentDndSourceFolderClass { - BonoboObjectClass parent_class; + BonoboXObjectClass parent_class; + + POA_GNOME_Evolution_ShellComponentDnd_SourceFolder__epv epv; }; GtkType evolution_shell_component_dnd_source_folder_get_type (void); @@ -108,12 +112,14 @@ typedef CORBA_boolean (*DndDestinationFolderHandleDropFn)(EvolutionShellComponen gpointer closure); struct _EvolutionShellComponentDndDestinationFolder { - BonoboObject object; + BonoboXObject object; DndDestinationFolderPrivate *priv; }; struct _EvolutionShellComponentDndDestinationFolderClass { - BonoboObjectClass parent_class; + BonoboXObjectClass parent_class; + + POA_GNOME_Evolution_ShellComponentDnd_DestinationFolder__epv epv; }; GtkType evolution_shell_component_dnd_destination_folder_get_type (void); diff --git a/shell/evolution-shell-component-utils.c b/shell/evolution-shell-component-utils.c index b9e5215e69..17434f6dea 100644 --- a/shell/evolution-shell-component-utils.c +++ b/shell/evolution-shell-component-utils.c @@ -25,13 +25,12 @@ #include "evolution-shell-component-utils.h" -#include <libgnome/gnome-defs.h> #include <libgnome/gnome-i18n.h> #include <libgnome/gnome-util.h> #include <bonobo/bonobo-ui-util.h> #include <bonobo/bonobo-moniker-util.h> #include <bonobo/bonobo-exception.h> -#include <liboaf/oaf.h> +#include <bonobo-activation/bonobo-activation.h> #include <gal/widgets/e-gui-utils.h> static void free_pixmaps (void); @@ -58,7 +57,7 @@ void e_pixmaps_update (BonoboUIComponent *uic, EPixmap *pixcache) path = g_concat_dir_and_file (EVOLUTION_IMAGES, pixcache [i].fname); - pixbuf = gdk_pixbuf_new_from_file (path); + pixbuf = gdk_pixbuf_new_from_file (path, NULL); if (pixbuf == NULL) { g_warning ("Cannot load image -- %s", path); } else { @@ -122,14 +121,14 @@ e_activation_failure_dialog (GtkWindow *parent, const char *msg, CORBA_Object_release (object, &ev); } errmsg = g_strdup_printf (_("%s\n\nUnknown error."), msg); - } else if (strcmp (CORBA_exception_id (&ev), ex_OAF_GeneralError) != 0) { + } else if (strcmp (CORBA_exception_id (&ev), ex_Bonobo_GeneralError) != 0) { char *bonobo_err = bonobo_exception_get_text (&ev); errmsg = g_strdup_printf (_("%s\n\nThe error from the " "component system is:\n%s"), msg, bonobo_err); g_free (bonobo_err); } else { - OAF_GeneralError *errval = CORBA_exception_value (&ev); + Bonobo_GeneralError *errval = CORBA_exception_value (&ev); errmsg = g_strdup_printf (_("%s\n\nThe error from the " "activation system is:\n%s"), @@ -158,10 +157,10 @@ e_get_activation_failure_msg (CORBA_Environment *ev) if (CORBA_exception_id (ev) == NULL) return NULL; - if (strcmp (CORBA_exception_id (ev), ex_OAF_GeneralError) != 0) { + if (strcmp (CORBA_exception_id (ev), ex_Bonobo_GeneralError) != 0) { return bonobo_exception_get_text (ev); } else { - const OAF_GeneralError *oaf_general_error; + const Bonobo_GeneralError *oaf_general_error; oaf_general_error = CORBA_exception_value (ev); return g_strdup (oaf_general_error->description); diff --git a/shell/evolution-shell-component.c b/shell/evolution-shell-component.c index 44f7e42c3d..6c286d19c1 100644 --- a/shell/evolution-shell-component.c +++ b/shell/evolution-shell-component.c @@ -29,6 +29,7 @@ #include "e-shell-corba-icon-utils.h" #include <fcntl.h> +#include <unistd.h> #include <glib.h> #include <gtk/gtksignal.h> @@ -224,7 +225,7 @@ owner_ping_callback (void *data) CORBA_exception_init (&ev); owner_objref = CORBA_Object_duplicate (owner_objref, &ev); - alive = bonobo_unknown_ping (owner_objref); + alive = bonobo_unknown_ping (owner_objref, NULL); CORBA_Object_release (owner_objref, &ev); CORBA_exception_free (&ev); @@ -658,7 +659,7 @@ impl_populateFolderContextMenu (PortableServer_Servant servant, } priv->uic = bonobo_ui_component_new_default (); - bonobo_ui_component_set_container (priv->uic, corba_uih); + bonobo_ui_component_set_container (priv->uic, corba_uih, NULL); bonobo_object_release_unref (corba_uih, NULL); (* priv->populate_folder_context_menu_fn) (shell_component, priv->uic, physical_uri, type, priv->closure); @@ -868,7 +869,7 @@ class_init (EvolutionShellComponentClass *klass) signals[OWNER_SET] = gtk_signal_new ("owner_set", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionShellComponentClass, owner_set), gtk_marshal_NONE__POINTER_POINTER, GTK_TYPE_NONE, 2, @@ -877,7 +878,7 @@ class_init (EvolutionShellComponentClass *klass) signals[OWNER_DIED] = gtk_signal_new ("owner_died", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionShellComponentClass, owner_died), gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0); @@ -885,7 +886,7 @@ class_init (EvolutionShellComponentClass *klass) signals[OWNER_UNSET] = gtk_signal_new ("owner_unset", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionShellComponentClass, owner_unset), gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0); @@ -893,7 +894,7 @@ class_init (EvolutionShellComponentClass *klass) signals[DEBUG] = gtk_signal_new ("debug", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionShellComponentClass, debug), gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0); @@ -901,7 +902,7 @@ class_init (EvolutionShellComponentClass *klass) signals[INTERACTIVE] = gtk_signal_new ("interactive", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionShellComponentClass, interactive), gtk_marshal_NONE__BOOL, GTK_TYPE_NONE, 1, @@ -910,7 +911,7 @@ class_init (EvolutionShellComponentClass *klass) signals[HANDLE_EXTERNAL_URI] = gtk_signal_new ("handle_external_uri", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionShellComponentClass, handle_external_uri), gtk_marshal_NONE__STRING, GTK_TYPE_NONE, 1, @@ -919,7 +920,7 @@ class_init (EvolutionShellComponentClass *klass) signals[USER_CREATE_NEW_ITEM] = gtk_signal_new ("user_create_new_item", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionShellComponentClass, user_create_new_item), gtk_marshal_NONE__POINTER_POINTER_POINTER, GTK_TYPE_NONE, 3, @@ -930,14 +931,12 @@ class_init (EvolutionShellComponentClass *klass) signals[SEND_RECEIVE] = gtk_signal_new ("send_receive", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionShellComponentClass, send_receive), gtk_marshal_NONE__BOOL, GTK_TYPE_NONE, 1, GTK_TYPE_BOOL); - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); - parent_class = gtk_type_class (PARENT_TYPE); epv->_get_supportedTypes = impl__get_supportedTypes; diff --git a/shell/evolution-shell-view.c b/shell/evolution-shell-view.c index 8925438b5a..fc700876e4 100644 --- a/shell/evolution-shell-view.c +++ b/shell/evolution-shell-view.c @@ -31,8 +31,8 @@ #include "evolution-shell-view.h" -#define PARENT_TYPE bonobo_object_get_type () -static BonoboObjectClass *parent_class = NULL; +#define PARENT_TYPE bonobo_x_object_get_type () +static BonoboXObjectClass *parent_class = NULL; struct _EvolutionShellViewPrivate { int dummy; @@ -52,30 +52,6 @@ static int signals[LAST_SIGNAL] = { 0 }; /* CORBA interface implementation. */ -static POA_GNOME_Evolution_ShellView__vepv ShellView_vepv; - -static POA_GNOME_Evolution_ShellView * -create_servant (void) -{ - POA_GNOME_Evolution_ShellView *servant; - CORBA_Environment ev; - - servant = (POA_GNOME_Evolution_ShellView *) g_new0 (BonoboObjectServant, 1); - servant->vepv = &ShellView_vepv; - CORBA_exception_init (&ev); - - POA_GNOME_Evolution_ShellView__init ((PortableServer_Servant) servant, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_free (servant); - CORBA_exception_free (&ev); - return NULL; - } - - CORBA_exception_free (&ev); - - return servant; -} - static void impl_ShellView_set_message (PortableServer_Servant servant, const CORBA_char *message, @@ -162,18 +138,15 @@ destroy (GtkObject *object) static void -corba_class_init (void) +class_init (EvolutionShellViewClass *klass) { - POA_GNOME_Evolution_ShellView__vepv *vepv; POA_GNOME_Evolution_ShellView__epv *epv; - PortableServer_ServantBase__epv *base_epv; + GtkObjectClass *object_class; - base_epv = g_new0 (PortableServer_ServantBase__epv, 1); - base_epv->_private = NULL; - base_epv->finalize = NULL; - base_epv->default_POA = NULL; + object_class = GTK_OBJECT_CLASS (klass); + object_class->destroy = destroy; - epv = g_new0 (POA_GNOME_Evolution_ShellView__epv, 1); + epv = &klass->epv; epv->setMessage = impl_ShellView_set_message; epv->unsetMessage = impl_ShellView_unset_message; epv->changeCurrentView = impl_ShellView_change_current_view; @@ -181,24 +154,10 @@ corba_class_init (void) epv->setFolderBarLabel = impl_ShellView_set_folder_bar_label; epv->showSettings = impl_ShellView_show_settings; - vepv = &ShellView_vepv; - vepv->_base_epv = base_epv; - vepv->Bonobo_Unknown_epv = bonobo_object_get_epv (); - vepv->GNOME_Evolution_ShellView_epv = epv; -} - -static void -class_init (EvolutionShellViewClass *klass) -{ - GtkObjectClass *object_class; - - object_class = GTK_OBJECT_CLASS (klass); - object_class->destroy = destroy; - signals[SET_MESSAGE] = gtk_signal_new ("set_message", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionShellViewClass, set_message), gtk_marshal_NONE__POINTER_INT, GTK_TYPE_NONE, 2, @@ -208,7 +167,7 @@ class_init (EvolutionShellViewClass *klass) signals[UNSET_MESSAGE] = gtk_signal_new ("unset_message", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionShellViewClass, unset_message), gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0); @@ -216,7 +175,7 @@ class_init (EvolutionShellViewClass *klass) signals[CHANGE_VIEW] = gtk_signal_new ("change_current_view", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionShellViewClass, change_current_view), gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1, @@ -225,7 +184,7 @@ class_init (EvolutionShellViewClass *klass) signals[SET_TITLE] = gtk_signal_new ("set_title", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionShellViewClass, set_title), gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1, @@ -234,7 +193,7 @@ class_init (EvolutionShellViewClass *klass) signals[SET_FOLDER_BAR_LABEL] = gtk_signal_new ("set_folder_bar_label", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionShellViewClass, set_folder_bar_label), gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1, @@ -243,16 +202,12 @@ class_init (EvolutionShellViewClass *klass) signals[SHOW_SETTINGS] = gtk_signal_new ("show_settings", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionShellViewClass, show_settings), gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0); - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); - - parent_class = gtk_type_class (bonobo_object_get_type ()); - - corba_class_init (); + parent_class = gtk_type_class (bonobo_x_object_get_type ()); } static void @@ -267,22 +222,6 @@ init (EvolutionShellView *shell_view) } -/** - * evolution_shell_view_construct: - * @shell_view: - * @corba_object: - * - * Construct @shell_view with the specified @corba_object. - **/ -void -evolution_shell_view_construct (EvolutionShellView *shell_view, - GNOME_Evolution_ShellView corba_object) -{ - g_return_if_fail (shell_view != NULL); - g_return_if_fail (EVOLUTION_IS_SHELL_VIEW (shell_view)); - - bonobo_object_construct (BONOBO_OBJECT (shell_view), corba_object); -} /** * evolution_shell_view_new: @@ -294,22 +233,11 @@ evolution_shell_view_construct (EvolutionShellView *shell_view, EvolutionShellView * evolution_shell_view_new (void) { - POA_GNOME_Evolution_ShellView *servant; - GNOME_Evolution_ShellView corba_object; - EvolutionShellView *new; - - servant = create_servant (); - if (servant == NULL) - return NULL; - - new = gtk_type_new (evolution_shell_view_get_type ()); - - corba_object = bonobo_object_activate_servant (BONOBO_OBJECT (new), servant); - - evolution_shell_view_construct (new, corba_object); - - return new; + return gtk_type_new (evolution_shell_view_get_type ()); } -E_MAKE_TYPE (evolution_shell_view, "EvolutionShellView", EvolutionShellView, class_init, init, PARENT_TYPE) +E_MAKE_X_TYPE (evolution_shell_view, "EvolutionShellView", EvolutionShellView, + class_init, init, PARENT_TYPE, + POA_GNOME_Evolution_ShellView__init, + GTK_STRUCT_OFFSET (EvolutionShellViewClass, epv)) diff --git a/shell/evolution-shell-view.h b/shell/evolution-shell-view.h index bcf38fd417..38dddd00a5 100644 --- a/shell/evolution-shell-view.h +++ b/shell/evolution-shell-view.h @@ -24,7 +24,8 @@ #define __EVOLUTION_SHELL_VIEW_H__ #include <glib.h> -#include <bonobo/bonobo-object.h> +#include <bonobo/bonobo-xobject.h> + #include "Evolution.h" #ifdef __cplusplus @@ -44,13 +45,13 @@ typedef struct _EvolutionShellViewPrivate EvolutionShellViewPrivate; typedef struct _EvolutionShellViewClass EvolutionShellViewClass; struct _EvolutionShellView { - BonoboObject parent; + BonoboXObject parent; EvolutionShellViewPrivate *priv; }; struct _EvolutionShellViewClass { - BonoboObjectClass parent_class; + BonoboXObjectClass parent_class; /* Signals. */ @@ -60,12 +61,12 @@ struct _EvolutionShellViewClass { void (* set_title) (EvolutionShellView *shell_view, const char *message); void (* set_folder_bar_label) (EvolutionShellView *shell_view, const char *text); void (* show_settings) (EvolutionShellView *shell_view); + + POA_GNOME_Evolution_ShellView__epv epv; }; GtkType evolution_shell_view_get_type (void); -void evolution_shell_view_construct (EvolutionShellView *shell_view, - GNOME_Evolution_ShellView corba_object); EvolutionShellView *evolution_shell_view_new (void); #ifdef __cplusplus diff --git a/shell/evolution-storage-listener.c b/shell/evolution-storage-listener.c index 1f08f5fff8..9d1c225f02 100644 --- a/shell/evolution-storage-listener.c +++ b/shell/evolution-storage-listener.c @@ -259,14 +259,14 @@ class_init (EvolutionStorageListenerClass *klass) signals[DESTROYED] = gtk_signal_new ("destroyed", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionStorageListenerClass, destroyed), gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0); signals[NEW_FOLDER] = gtk_signal_new ("new_folder", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionStorageListenerClass, new_folder), gtk_marshal_NONE__POINTER_POINTER, GTK_TYPE_NONE, 2, @@ -275,7 +275,7 @@ class_init (EvolutionStorageListenerClass *klass) signals[UPDATE_FOLDER] = gtk_signal_new ("update_folder", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionStorageListenerClass, update_folder), gtk_marshal_NONE__POINTER_INT, GTK_TYPE_NONE, 2, @@ -284,7 +284,7 @@ class_init (EvolutionStorageListenerClass *klass) signals[REMOVED_FOLDER] = gtk_signal_new ("removed_folder", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionStorageListenerClass, removed_folder), gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1, @@ -292,15 +292,13 @@ class_init (EvolutionStorageListenerClass *klass) signals[HAS_SUBFOLDERS] = gtk_signal_new ("has_subfolders", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionStorageListenerClass, has_subfolders), gtk_marshal_NONE__POINTER_POINTER, GTK_TYPE_NONE, 2, GTK_TYPE_STRING, GTK_TYPE_STRING); - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); - corba_class_init (); } diff --git a/shell/evolution-storage-set-view-listener.c b/shell/evolution-storage-set-view-listener.c index 310a2f2844..e5e52fe797 100644 --- a/shell/evolution-storage-set-view-listener.c +++ b/shell/evolution-storage-set-view-listener.c @@ -201,20 +201,18 @@ class_init (EvolutionStorageSetViewListenerClass *klass) signals[FOLDER_SELECTED] = gtk_signal_new ("folder_selected", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionStorageSetViewListenerClass, folder_selected), gtk_marshal_NONE__STRING, GTK_TYPE_NONE, 1, GTK_TYPE_STRING); signals[FOLDER_TOGGLED] = gtk_signal_new ("folder_toggled", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionStorageSetViewListenerClass, folder_toggled), gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0); - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); - corba_class_init (); } diff --git a/shell/evolution-storage.c b/shell/evolution-storage.c index 15be4e761e..3f01e23c7c 100644 --- a/shell/evolution-storage.c +++ b/shell/evolution-storage.c @@ -33,6 +33,8 @@ #include "e-shell-constants.h" #include "e-shell-corba-icon-utils.h" +#include "e-shell-marshal.h" + #include <gal/util/e-util.h> #include <gtk/gtksignal.h> @@ -43,7 +45,7 @@ #define PARENT_TYPE BONOBO_OBJECT_TYPE -static BonoboObjectClass *parent_class = NULL; +static BonoboXObjectClass *parent_class = NULL; struct _FolderPropertyItem { char *label; @@ -231,31 +233,6 @@ folder_destroy_notify (EFolderTree *tree, /* CORBA interface implementation. */ -static POA_GNOME_Evolution_Storage__vepv Storage_vepv; - -static POA_GNOME_Evolution_Storage * -create_servant (void) -{ - POA_GNOME_Evolution_Storage *servant; - CORBA_Environment ev; - - servant = (POA_GNOME_Evolution_Storage *) g_new0 (BonoboObjectServant, 1); - servant->vepv = &Storage_vepv; - - CORBA_exception_init (&ev); - - POA_GNOME_Evolution_Storage__init ((PortableServer_Servant) servant, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_free (servant); - CORBA_exception_free (&ev); - return NULL; - } - - CORBA_exception_free (&ev); - - return servant; -} - static CORBA_char * impl_Storage__get_name (PortableServer_Servant servant, CORBA_Environment *ev) @@ -686,82 +663,40 @@ destroy (GtkObject *object) static void -corba_class_init (void) -{ - POA_GNOME_Evolution_Storage__vepv *vepv; - - PortableServer_ServantBase__epv *base_epv; - - base_epv = g_new0 (PortableServer_ServantBase__epv, 1); - base_epv->_private = NULL; - base_epv->finalize = NULL; - base_epv->default_POA = NULL; - - vepv = &Storage_vepv; - vepv->_base_epv = base_epv; - vepv->Bonobo_Unknown_epv = bonobo_object_get_epv (); - vepv->GNOME_Evolution_Storage_epv = evolution_storage_get_epv (); -} - -/* The worst signal marshaller in Scotland */ -typedef void (*GtkSignal_NONE__POINTER_POINTER_POINTER_POINTER_POINTER) (GtkObject *, - gpointer, gpointer, gpointer, gpointer, gpointer, - gpointer user_data); - -static void -e_marshal_NONE__POINTER_POINTER_POINTER_POINTER_POINTER (GtkObject *object, - GtkSignalFunc func, - gpointer func_data, - GtkArg *args) -{ - GtkSignal_NONE__POINTER_POINTER_POINTER_POINTER_POINTER rfunc; - - rfunc = (GtkSignal_NONE__POINTER_POINTER_POINTER_POINTER_POINTER) func; - (*rfunc) (object, - GTK_VALUE_POINTER (args[0]), - GTK_VALUE_POINTER (args[1]), - GTK_VALUE_POINTER (args[2]), - GTK_VALUE_POINTER (args[3]), - GTK_VALUE_POINTER (args[4]), - func_data); -} - -typedef void (*GtkSignal_NONE__POINTER_POINTER_POINTER) (GtkObject *, - gpointer, gpointer, gpointer, - gpointer user_data); - -static void -e_marshal_NONE__POINTER_POINTER_POINTER (GtkObject *object, - GtkSignalFunc func, - gpointer func_data, - GtkArg *args) -{ - GtkSignal_NONE__POINTER_POINTER_POINTER rfunc; - - rfunc = (GtkSignal_NONE__POINTER_POINTER_POINTER) func; - (*rfunc) (object, - GTK_VALUE_POINTER (args[0]), - GTK_VALUE_POINTER (args[1]), - GTK_VALUE_POINTER (args[2]), - func_data); -} - -static void class_init (EvolutionStorageClass *klass) { + POA_GNOME_Evolution_Storage__epv *epv; GtkObjectClass *object_class; object_class = GTK_OBJECT_CLASS (klass); object_class->destroy = destroy; - parent_class = gtk_type_class (bonobo_object_get_type ()); + epv = & klass->epv; + epv->_get_name = impl_Storage__get_name; + epv->_get_hasSharedFolders = impl_Storage__get_hasSharedFolders; + epv->getFolderAtPath = impl_Storage_getFolderAtPath; + epv->_get_folderList = impl_Storage__get_folderList; + epv->asyncCreateFolder = impl_Storage_asyncCreateFolder; + epv->asyncRemoveFolder = impl_Storage_asyncRemoveFolder; + epv->asyncXferFolder = impl_Storage_asyncXferFolder; + epv->asyncOpenFolder = impl_Storage_asyncOpenFolder; + epv->updateFolder = impl_Storage_updateFolder; + epv->asyncDiscoverSharedFolder = impl_Storage_asyncDiscoverSharedFolder; + epv->cancelDiscoverSharedFolder = impl_Storage_cancelDiscoverSharedFolder; + epv->asyncRemoveSharedFolder = impl_Storage_asyncRemoveSharedFolder; + epv->addListener = impl_Storage_addListener; + epv->removeListener = impl_Storage_removeListener; + epv->showFolderProperties = impl_Storage_showFolderProperties; + epv->_get_folderPropertyItems = impl_Storage__get_folderPropertyItems; + + parent_class = gtk_type_class (PARENT_TYPE); signals[CREATE_FOLDER] = gtk_signal_new ("create_folder", GTK_RUN_LAST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionStorageClass, create_folder), - e_marshal_NONE__POINTER_POINTER_POINTER_POINTER_POINTER, + e_shell_marshal_NONE__POINTER_POINTER_POINTER_POINTER_POINTER, GTK_TYPE_NONE, 5, GTK_TYPE_POINTER, GTK_TYPE_STRING, @@ -771,10 +706,10 @@ class_init (EvolutionStorageClass *klass) signals[REMOVE_FOLDER] = gtk_signal_new ("remove_folder", GTK_RUN_LAST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionStorageClass, remove_folder), - e_marshal_NONE__POINTER_POINTER_POINTER, + e_shell_marshal_NONE__POINTER_POINTER_POINTER, GTK_TYPE_NONE, 3, GTK_TYPE_POINTER, GTK_TYPE_STRING, @@ -782,10 +717,10 @@ class_init (EvolutionStorageClass *klass) signals[XFER_FOLDER] = gtk_signal_new ("xfer_folder", GTK_RUN_LAST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionStorageClass, xfer_folder), - e_marshal_NONE__POINTER_POINTER_POINTER_BOOL, + e_shell_marshal_NONE__POINTER_POINTER_POINTER_BOOL, GTK_TYPE_NONE, 4, GTK_TYPE_POINTER, GTK_TYPE_STRING, @@ -794,29 +729,29 @@ class_init (EvolutionStorageClass *klass) signals[UPDATE_FOLDER] = gtk_signal_new ("update_folder", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionStorageClass, update_folder), - gtk_marshal_NONE__POINTER_INT, + e_shell_marshal_NONE__POINTER_INT, GTK_TYPE_NONE, 2, GTK_TYPE_STRING, GTK_TYPE_INT); signals[OPEN_FOLDER] = gtk_signal_new ("open_folder", GTK_RUN_LAST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionStorageClass, open_folder), - gtk_marshal_NONE__POINTER, + e_shell_marshal_NONE__POINTER, GTK_TYPE_NONE, 1, GTK_TYPE_STRING); signals[DISCOVER_SHARED_FOLDER] = gtk_signal_new ("discover_shared_folder", GTK_RUN_LAST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionStorageClass, discover_shared_folder), - e_marshal_NONE__POINTER_POINTER_POINTER, + e_shell_marshal_NONE__POINTER_POINTER_POINTER, GTK_TYPE_NONE, 3, GTK_TYPE_POINTER, GTK_TYPE_STRING, @@ -824,38 +759,34 @@ class_init (EvolutionStorageClass *klass) signals[CANCEL_DISCOVER_SHARED_FOLDER] = gtk_signal_new ("cancel_discover_shared_folder", GTK_RUN_LAST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionStorageClass, cancel_discover_shared_folder), - gtk_marshal_NONE__POINTER_POINTER, + e_shell_marshal_NONE__POINTER_POINTER, GTK_TYPE_NONE, 2, GTK_TYPE_STRING, GTK_TYPE_STRING); signals[REMOVE_SHARED_FOLDER] = gtk_signal_new ("remove_shared_folder", GTK_RUN_LAST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionStorageClass, remove_shared_folder), - gtk_marshal_NONE__POINTER_POINTER, + e_shell_marshal_NONE__POINTER_POINTER, GTK_TYPE_NONE, 2, GTK_TYPE_STRING, GTK_TYPE_POINTER); signals[SHOW_FOLDER_PROPERTIES] = gtk_signal_new ("show_folder_properties", GTK_RUN_LAST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionStorageClass, show_folder_properties), - gtk_marshal_NONE__POINTER_INT_INT, + e_shell_marshal_NONE__POINTER_INT_INT, GTK_TYPE_NONE, 3, GTK_TYPE_STRING, GTK_TYPE_INT, GTK_TYPE_INT); - - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); - - corba_class_init (); } static void @@ -875,56 +806,20 @@ init (EvolutionStorage *storage) } -POA_GNOME_Evolution_Storage__epv * -evolution_storage_get_epv (void) -{ - POA_GNOME_Evolution_Storage__epv *epv; - - epv = g_new0 (POA_GNOME_Evolution_Storage__epv, 1); - epv->_get_name = impl_Storage__get_name; - epv->_get_hasSharedFolders = impl_Storage__get_hasSharedFolders; - epv->getFolderAtPath = impl_Storage_getFolderAtPath; - epv->_get_folderList = impl_Storage__get_folderList; - epv->asyncCreateFolder = impl_Storage_asyncCreateFolder; - epv->asyncRemoveFolder = impl_Storage_asyncRemoveFolder; - epv->asyncXferFolder = impl_Storage_asyncXferFolder; - epv->asyncOpenFolder = impl_Storage_asyncOpenFolder; - epv->updateFolder = impl_Storage_updateFolder; - epv->asyncDiscoverSharedFolder = impl_Storage_asyncDiscoverSharedFolder; - epv->cancelDiscoverSharedFolder = impl_Storage_cancelDiscoverSharedFolder; - epv->asyncRemoveSharedFolder = impl_Storage_asyncRemoveSharedFolder; - epv->addListener = impl_Storage_addListener; - epv->removeListener = impl_Storage_removeListener; - epv->showFolderProperties = impl_Storage_showFolderProperties; - epv->_get_folderPropertyItems = impl_Storage__get_folderPropertyItems; - - return epv; -} - void evolution_storage_construct (EvolutionStorage *storage, - GNOME_Evolution_Storage corba_object, const char *name, gboolean has_shared_folders) { EvolutionStoragePrivate *priv; - CORBA_Environment ev; - g_return_if_fail (storage != NULL); g_return_if_fail (EVOLUTION_IS_STORAGE (storage)); - g_return_if_fail (corba_object != CORBA_OBJECT_NIL); g_return_if_fail (name != NULL); g_return_if_fail (name[0] != '\0'); - CORBA_exception_init (&ev); - - bonobo_object_construct (BONOBO_OBJECT (storage), corba_object); - priv = storage->priv; priv->name = g_strdup (name); priv->has_shared_folders = !! has_shared_folders; - - CORBA_exception_free (&ev); } EvolutionStorage * @@ -932,20 +827,13 @@ evolution_storage_new (const char *name, gboolean has_shared_folders) { EvolutionStorage *new; - POA_GNOME_Evolution_Storage *servant; - GNOME_Evolution_Storage corba_object; g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (name[0] != '\0', NULL); - servant = create_servant (); - if (servant == NULL) - return NULL; - new = gtk_type_new (evolution_storage_get_type ()); - corba_object = bonobo_object_activate_servant (BONOBO_OBJECT (new), servant); - evolution_storage_construct (new, corba_object, name, has_shared_folders); + evolution_storage_construct (new, name, has_shared_folders); return new; } @@ -1428,4 +1316,7 @@ evolution_storage_add_property_item (EvolutionStorage *evolution_storage, } -E_MAKE_TYPE (evolution_storage, "EvolutionStorage", EvolutionStorage, class_init, init, PARENT_TYPE) +E_MAKE_X_TYPE (evolution_storage, "EvolutionStorage", EvolutionStorage, + class_init, init, PARENT_TYPE, + POA_GNOME_Evolution_Storage__init, + GTK_STRUCT_OFFSET (EvolutionStorageClass, epv)) diff --git a/shell/evolution-storage.h b/shell/evolution-storage.h index 439c883246..027b85b7ae 100644 --- a/shell/evolution-storage.h +++ b/shell/evolution-storage.h @@ -23,12 +23,14 @@ #ifndef __EVOLUTION_STORAGE_H__ #define __EVOLUTION_STORAGE_H__ -#include <glib.h> -#include <bonobo/bonobo-object.h> - #include "Evolution.h" +#include <glib.h> + #include <gdk-pixbuf/gdk-pixbuf.h> +#include <gtk/gtktypeutils.h> + +#include <bonobo/bonobo-xobject.h> #ifdef __cplusplus extern "C" { @@ -74,13 +76,13 @@ enum _EvolutionStorageResult { typedef enum _EvolutionStorageResult EvolutionStorageResult; struct _EvolutionStorage { - BonoboObject parent; + BonoboXObject parent; EvolutionStoragePrivate *priv; }; struct _EvolutionStorageClass { - BonoboObjectClass parent_class; + BonoboXObjectClass parent_class; /* signals */ void (*create_folder) (EvolutionStorage *storage, @@ -125,14 +127,13 @@ struct _EvolutionStorageClass { const char *path, unsigned int itemNumber, unsigned long parentWindowId); + + POA_GNOME_Evolution_Storage__epv epv; }; -POA_GNOME_Evolution_Storage__epv *evolution_storage_get_epv (void); - GtkType evolution_storage_get_type (void); void evolution_storage_construct (EvolutionStorage *storage, - GNOME_Evolution_Storage corba_object, const char *name, gboolean has_shared_folders); EvolutionStorage *evolution_storage_new (const char *name, diff --git a/shell/evolution-wizard.c b/shell/evolution-wizard.c index 07ad4fe0b0..9b036e517a 100644 --- a/shell/evolution-wizard.c +++ b/shell/evolution-wizard.c @@ -171,38 +171,36 @@ evolution_wizard_class_init (EvolutionWizardClass *klass) object_class->destroy = evolution_wizard_destroy; signals[NEXT] = gtk_signal_new ("next", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionWizardClass, next), gtk_marshal_NONE__INT, GTK_TYPE_NONE, 1, GTK_TYPE_INT); signals[PREPARE] = gtk_signal_new ("prepare", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionWizardClass, prepare), gtk_marshal_NONE__INT, GTK_TYPE_NONE, 1, GTK_TYPE_INT); signals[BACK] = gtk_signal_new ("back", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionWizardClass, back), gtk_marshal_NONE__INT, GTK_TYPE_NONE, 1, GTK_TYPE_INT); signals[FINISH] = gtk_signal_new ("finish", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionWizardClass, finish), gtk_marshal_NONE__INT, GTK_TYPE_NONE, 1, GTK_TYPE_INT); signals[CANCEL] = gtk_signal_new ("cancel", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionWizardClass, cancel), gtk_marshal_NONE__INT, GTK_TYPE_NONE, 1, GTK_TYPE_INT); signals[HELP] = gtk_signal_new ("help", GTK_RUN_FIRST, - object_class->type, + GTK_CLASS_TYPE (object_class), GTK_SIGNAL_OFFSET (EvolutionWizardClass, help), gtk_marshal_NONE__INT, GTK_TYPE_NONE, 1, GTK_TYPE_INT); - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); - parent_class = gtk_type_class (PARENT_TYPE); epv->_get_pageCount = impl_GNOME_Evolution_Wizard__get_pageCount; @@ -296,7 +294,7 @@ evolution_wizard_set_buttons_sensitive (EvolutionWizard *wizard, } s = back_sensitive << 2 | next_sensitive << 1 | cancel_sensitive; - any._type = (CORBA_TypeCode) TC_short; + any._type = (CORBA_TypeCode) TC_CORBA_short; any._value = &s; bonobo_event_source_notify_listeners (priv->event_source, @@ -331,7 +329,7 @@ evolution_wizard_set_show_finish (EvolutionWizard *wizard, } b = show_finish; - any._type = (CORBA_TypeCode) TC_boolean; + any._type = (CORBA_TypeCode) TC_CORBA_boolean; any._value = &b; bonobo_event_source_notify_listeners (priv->event_source, @@ -369,7 +367,7 @@ evolution_wizard_set_page (EvolutionWizard *wizard, } s = page_number; - any._type = (CORBA_TypeCode) TC_short; + any._type = (CORBA_TypeCode) TC_CORBA_short; any._value = &s; bonobo_event_source_notify_listeners (priv->event_source, diff --git a/shell/evolution-wizard.h b/shell/evolution-wizard.h index 617d7bb3a5..fe51ab13d7 100644 --- a/shell/evolution-wizard.h +++ b/shell/evolution-wizard.h @@ -9,12 +9,11 @@ #ifndef __EVOLUTION_WIZARD_H__ #define __EVOLUTION_WIZARD_H__ +#include <bonobo/bonobo-xobject.h> #include <bonobo/bonobo-control.h> #include <bonobo/bonobo-event-source.h> -#include <Evolution.h> - -BEGIN_GNOME_DECLS +#include "Evolution.h" typedef struct _EvolutionWizard EvolutionWizard; typedef struct _EvolutionWizardPrivate EvolutionWizardPrivate; @@ -81,6 +80,4 @@ void evolution_wizard_set_page (EvolutionWizard *wizard, BonoboEventSource * evolution_wizard_get_event_source (EvolutionWizard *wizard); -END_GNOME_DECLS - #endif /* __EVOLUTION_WIZARD_H__ */ |