aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2002-11-06 16:08:16 +0800
committerChris Toshok <toshok@src.gnome.org>2002-11-06 16:08:16 +0800
commit4e57b96f83fb8d0f79b10d1b219062973a095e56 (patch)
tree441afb3b747fc0b1afa99690b9d097af6e13c48c
parent1b1d829e5e32c744565679b9733f1aeaf07d96af (diff)
downloadgsoc2013-evolution-4e57b96f83fb8d0f79b10d1b219062973a095e56.tar.gz
gsoc2013-evolution-4e57b96f83fb8d0f79b10d1b219062973a095e56.tar.zst
gsoc2013-evolution-4e57b96f83fb8d0f79b10d1b219062973a095e56.zip
Port to GObject/gnome2.
2002-11-05 Chris Toshok <toshok@ximian.com> * gui/component/select-names/e-simple-card-bonobo.[ch]: Port to GObject/gnome2. * gui/component/select-names/e-select-names.[ch]: Port to GObject/gnome2. * gui/component/select-names/e-select-names-text-model.c: Port to GObject/gnome2. * gui/component/select-names/e-select-names-table-model.c: Port to GObject/gnome2. * gui/component/select-names/e-select-names-popup.[ch]: Port to GObject/gnome2. * gui/component/select-names/e-select-names-model.c: Port to GObject/gnome2. * gui/component/select-names/e-select-names-manager.[ch]: Port to GObject/gnome2. * gui/component/select-names/e-select-names-factory.c: Port to GObject/gnome2. * gui/component/select-names/e-select-names-completion.[ch]: Port to GObject/gnome2. * gui/component/select-names/e-select-names-bonobo.[ch]: Port to GObject/gnome2. * gui/component/select-names/Makefile.am: typical port stuff. add marshaller generation foo, dist it, and switch the .oaf to .server * gui/component/select-names/.cvsignore: ignore the marshaller stuff. svn path=/trunk/; revision=18587
-rw-r--r--addressbook/ChangeLog38
-rw-r--r--addressbook/gui/component/select-names/.cvsignore4
-rw-r--r--addressbook/gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.server.in (renamed from addressbook/gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.oaf.in)0
-rw-r--r--addressbook/gui/component/select-names/Makefile.am35
-rw-r--r--addressbook/gui/component/select-names/e-select-names-bonobo.c133
-rw-r--r--addressbook/gui/component/select-names/e-select-names-bonobo.h6
-rw-r--r--addressbook/gui/component/select-names/e-select-names-completion.c82
-rw-r--r--addressbook/gui/component/select-names/e-select-names-completion.h5
-rw-r--r--addressbook/gui/component/select-names/e-select-names-factory.c1
-rw-r--r--addressbook/gui/component/select-names/e-select-names-manager.c154
-rw-r--r--addressbook/gui/component/select-names/e-select-names-manager.h2
-rw-r--r--addressbook/gui/component/select-names/e-select-names-marshal.list3
-rw-r--r--addressbook/gui/component/select-names/e-select-names-model.c136
-rw-r--r--addressbook/gui/component/select-names/e-select-names-popup.c44
-rw-r--r--addressbook/gui/component/select-names/e-select-names-popup.h2
-rw-r--r--addressbook/gui/component/select-names/e-select-names-table-model.c10
-rw-r--r--addressbook/gui/component/select-names/e-select-names-text-model.c20
-rw-r--r--addressbook/gui/component/select-names/e-select-names.c136
-rw-r--r--addressbook/gui/component/select-names/e-select-names.h1
-rw-r--r--addressbook/gui/component/select-names/e-simple-card-bonobo.c105
-rw-r--r--addressbook/gui/component/select-names/e-simple-card-bonobo.h17
21 files changed, 410 insertions, 524 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index f3982b0e6f..e4ab346549 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,5 +1,43 @@
2002-11-05 Chris Toshok <toshok@ximian.com>
+ * gui/component/select-names/e-simple-card-bonobo.[ch]: Port to
+ GObject/gnome2.
+
+ * gui/component/select-names/e-select-names.[ch]: Port to
+ GObject/gnome2.
+
+ * gui/component/select-names/e-select-names-text-model.c: Port to
+ GObject/gnome2.
+
+ * gui/component/select-names/e-select-names-table-model.c: Port to
+ GObject/gnome2.
+
+ * gui/component/select-names/e-select-names-popup.[ch]: Port to
+ GObject/gnome2.
+
+ * gui/component/select-names/e-select-names-model.c: Port to
+ GObject/gnome2.
+
+ * gui/component/select-names/e-select-names-manager.[ch]: Port to
+ GObject/gnome2.
+
+ * gui/component/select-names/e-select-names-factory.c: Port to
+ GObject/gnome2.
+
+ * gui/component/select-names/e-select-names-completion.[ch]: Port
+ to GObject/gnome2.
+
+ * gui/component/select-names/e-select-names-bonobo.[ch]: Port to
+ GObject/gnome2.
+
+ * gui/component/select-names/Makefile.am: typical port stuff. add
+ marshaller generation foo, dist it, and switch the .oaf to .server
+
+ * gui/component/select-names/.cvsignore: ignore the marshaller
+ stuff.
+<
+2002-11-05 Chris Toshok <toshok@ximian.com>
+
* backend/ebook/.cvsignore: ignore the generated marshaller files.
* backend/ebook/e-destination.c (e_destination_dispose): rename
diff --git a/addressbook/gui/component/select-names/.cvsignore b/addressbook/gui/component/select-names/.cvsignore
index cd669499fa..7f77efd75a 100644
--- a/addressbook/gui/component/select-names/.cvsignore
+++ b/addressbook/gui/component/select-names/.cvsignore
@@ -9,4 +9,6 @@ Evolution-Addressbook-SelectNames-stubs.c
Evolution-Addressbook-SelectNames-skels.c
Evolution-Addressbook-SelectNames-common.c
Evolution-Addressbook-SelectNames.h
-GNOME_Evolution_Addressbook_SelectNames.oaf
+GNOME_Evolution_Addressbook_SelectNames.server
+e-select-names-marshal.c
+e-select-names-marshal.h
diff --git a/addressbook/gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.oaf.in b/addressbook/gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.server.in
index 7f26e2aaed..7f26e2aaed 100644
--- a/addressbook/gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.oaf.in
+++ b/addressbook/gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.server.in
diff --git a/addressbook/gui/component/select-names/Makefile.am b/addressbook/gui/component/select-names/Makefile.am
index b417f18678..863ff377dd 100644
--- a/addressbook/gui/component/select-names/Makefile.am
+++ b/addressbook/gui/component/select-names/Makefile.am
@@ -14,16 +14,15 @@ IDL_GENERATED = \
Evolution-Addressbook-SelectNames-impl.o: Evolution-Addressbook-SelectNames.h
$(IDL_GENERATED): $(idl_DATA)
- $(ORBIT_IDL) -I $(srcdir) -I $(datadir)/idl `$(GNOME_CONFIG) --cflags idl` \
+ $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) \
$(srcdir)/Evolution-Addressbook-SelectNames.idl
-oafdir = $(datadir)/oaf
+serversdir = $(libdir)/bonobo/servers
-oaf_in_files = GNOME_Evolution_Addressbook_SelectNames.oaf.in
-oaf_DATA = $(oaf_in_files:.oaf.in=.oaf)
-
-@XML_I18N_MERGE_OAF_RULE@
+server_in_files = GNOME_Evolution_Addressbook_SelectNames.server.in
+servers_DATA = $(server_in_files:.oaf.in=.oaf)
+@INTLTOOL_SERVER_RULE@
INCLUDES = \
-DG_LOG_DOMAIN=\"evolution-addressbook\" \
@@ -57,6 +56,7 @@ libeselectnames_la_SOURCES = \
e-select-names-factory.h \
e-select-names-manager.c \
e-select-names-manager.h \
+ e-select-names-marshal.c \
e-select-names-model.c \
e-select-names-model.h \
e-select-names-popup.c \
@@ -70,6 +70,20 @@ libeselectnames_la_SOURCES = \
e-simple-card-bonobo.c \
e-simple-card-bonobo.h
+# GLib marshalling cruft
+
+e-select-names-marshal.h: e-select-names-marshal.list
+ ( @GLIB_GENMARSHAL@ --prefix=e_select_names_marshal e-select-names-marshal.list --header > e-select-names-marshal.tmp \
+ && mv e-select-names-marshal.tmp e-select-names-marshal.h ) \
+ || ( rm -f e-select-names-marshal.tmp && exit 1 )
+
+e-select-names-marshal.c: e-select-names-marshal.h
+ ( @GLIB_GENMARSHAL@ --prefix=e_select_names_marshal e-select-names-marshal.list --body > e-select-names-marshal.tmp \
+ && mv e-select-names-marshal.tmp e-select-names-marshal.c ) \
+ || ( rm -f e-select-names-marshal.tmp && exit 1 )
+
+MARSHAL_GENERATED = e-select-names-marshal.c e-select-names-marshal.h
+
gladedir = $(datadir)/evolution/glade
glade_DATA = select-names.glade
@@ -78,12 +92,13 @@ etspec_DATA = e-select-names.etspec
EXTRA_DIST = \
$(glade_DATA) \
- $(oaf_in_files) \
- $(oaf_DATA) \
+ $(server_in_files) \
+ $(servers_DATA) \
$(idl_DATA) \
- $(etspec_DATA)
+ $(etspec_DATA) \
+ e-select-names-marshal.list
-BUILT_SOURCES = $(IDL_GENERATED)
+BUILT_SOURCES = $(IDL_GENERATED) $(MARSHAL_GENERATED)
CLEANFILES = $(BUILT_SOURCES)
dist-hook:
diff --git a/addressbook/gui/component/select-names/e-select-names-bonobo.c b/addressbook/gui/component/select-names/e-select-names-bonobo.c
index 4a32790cd4..200f1c77f4 100644
--- a/addressbook/gui/component/select-names/e-select-names-bonobo.c
+++ b/addressbook/gui/component/select-names/e-select-names-bonobo.c
@@ -43,7 +43,7 @@
-#define PARENT_TYPE bonobo_object_get_type ()
+#define PARENT_TYPE BONOBO_TYPE_OBJECT
static BonoboObjectClass *parent_class = NULL;
struct _ESelectNamesBonoboPrivate {
@@ -136,7 +136,7 @@ entry_get_property_fn (BonoboPropertyBag *bag,
const ECard *card = e_destination_get_card (destination);
ECardSimple *simple = e_card_simple_new ((ECard *) card);
ESimpleCardBonobo *simple_card = e_simple_card_bonobo_new (simple);
- gtk_object_unref (GTK_OBJECT (simple));
+ g_object_unref (simple);
card_list->_buffer[i] = bonobo_object_corba_objref (BONOBO_OBJECT (simple_card));
}
@@ -221,46 +221,16 @@ entry_set_property_fn (BonoboPropertyBag *bag,
}
}
-
-/* CORBA interface implementation. */
-
-static POA_GNOME_Evolution_Addressbook_SelectNames__vepv SelectNames_vepv;
-
-static POA_GNOME_Evolution_Addressbook_SelectNames *
-create_servant (void)
-{
- POA_GNOME_Evolution_Addressbook_SelectNames *servant;
- CORBA_Environment ev;
-
- servant = (POA_GNOME_Evolution_Addressbook_SelectNames *) g_new0 (BonoboObjectServant, 1);
- servant->vepv = &SelectNames_vepv;
-
- CORBA_exception_init (&ev);
-
- POA_GNOME_Evolution_Addressbook_SelectNames__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_SelectNames_add_section (PortableServer_Servant servant,
const CORBA_char *id,
const CORBA_char *title,
CORBA_Environment *ev)
{
- BonoboObject *bonobo_object;
ESelectNamesBonobo *select_names;
ESelectNamesBonoboPrivate *priv;
- bonobo_object = bonobo_object_from_servant (servant);
- select_names = E_SELECT_NAMES_BONOBO (bonobo_object);
+ select_names = E_SELECT_NAMES_BONOBO (bonobo_object (servant));
priv = select_names->priv;
e_select_names_manager_add_section (priv->manager, id, title);
@@ -273,12 +243,10 @@ impl_SelectNames_add_section_with_limit (PortableServer_Servant servant,
CORBA_short limit,
CORBA_Environment *ev)
{
- BonoboObject *bonobo_object;
ESelectNamesBonobo *select_names;
ESelectNamesBonoboPrivate *priv;
- bonobo_object = bonobo_object_from_servant (servant);
- select_names = E_SELECT_NAMES_BONOBO (bonobo_object);
+ select_names = E_SELECT_NAMES_BONOBO (bonobo_object (servant));
priv = select_names->priv;
e_select_names_manager_add_section_with_limit (priv->manager, id, title, limit);
@@ -290,7 +258,7 @@ entry_changed (GtkWidget *widget, BonoboControl *control)
gboolean changed = GPOINTER_TO_UINT (gtk_object_get_data (GTK_OBJECT (widget), "entry_property_id_changed"));
if (!changed)
- bonobo_control_set_property (control, "entry_changed", TRUE, NULL);
+ bonobo_control_set_property (control, NULL, "entry_changed", TRUE);
}
static void
@@ -334,15 +302,13 @@ impl_SelectNames_get_entry_for_section (PortableServer_Servant servant,
const CORBA_char *section_id,
CORBA_Environment *ev)
{
- BonoboObject *bonobo_object;
ESelectNamesBonobo *select_names;
ESelectNamesBonoboPrivate *priv;
GtkWidget *entry_widget;
BonoboControl *control;
BonoboPropertyBag *property_bag;
- bonobo_object = bonobo_object_from_servant (servant);
- select_names = E_SELECT_NAMES_BONOBO (bonobo_object);
+ select_names = E_SELECT_NAMES_BONOBO (bonobo_object (servant));
priv = select_names->priv;
entry_widget = e_select_names_manager_create_entry (priv->manager, section_id);
@@ -378,9 +344,10 @@ impl_SelectNames_get_entry_for_section (PortableServer_Servant servant,
BONOBO_ARG_BOOLEAN, NULL, NULL,
BONOBO_PROPERTY_WRITEABLE);
- bonobo_control_set_properties (control, property_bag);
+ bonobo_control_set_properties (control, bonobo_object_corba_objref (BONOBO_OBJECT (property_bag)), NULL);
+ bonobo_object_unref (BONOBO_OBJECT (property_bag));
- gtk_signal_connect (GTK_OBJECT (entry_widget), "changed", GTK_SIGNAL_FUNC (entry_changed), control);
+ g_signal_connect (entry_widget, "changed", G_CALLBACK (entry_changed), control);
return CORBA_Object_duplicate (bonobo_object_corba_objref (BONOBO_OBJECT (control)), ev);
}
@@ -390,12 +357,10 @@ impl_SelectNames_activate_dialog (PortableServer_Servant servant,
const CORBA_char *section_id,
CORBA_Environment *ev)
{
- BonoboObject *bonobo_object;
ESelectNamesBonobo *select_names;
ESelectNamesBonoboPrivate *priv;
- bonobo_object = bonobo_object_from_servant (servant);
- select_names = E_SELECT_NAMES_BONOBO (bonobo_object);
+ select_names = E_SELECT_NAMES_BONOBO (bonobo_object (servant));
priv = select_names->priv;
e_select_names_manager_activate_dialog (priv->manager, section_id);
@@ -418,50 +383,32 @@ impl_destroy (GtkObject *object)
priv->manager->names = NULL;
}
- gtk_object_unref (GTK_OBJECT (priv->manager));
+ g_object_unref (priv->manager);
g_free (priv);
}
static void
-corba_class_init ()
-{
- POA_GNOME_Evolution_Addressbook_SelectNames__vepv *vepv;
- POA_GNOME_Evolution_Addressbook_SelectNames__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_Addressbook_SelectNames__epv, 1);
- epv->addSection = impl_SelectNames_add_section;
- epv->addSectionWithLimit = impl_SelectNames_add_section_with_limit;
- epv->getEntryBySection = impl_SelectNames_get_entry_for_section;
- epv->activateDialog = impl_SelectNames_activate_dialog;
-
- vepv = &SelectNames_vepv;
- vepv->Bonobo_Unknown_epv = bonobo_object_get_epv ();
- vepv->GNOME_Evolution_Addressbook_SelectNames_epv = epv;
-}
-
-static void
-class_init (ESelectNamesBonoboClass *klass)
+e_select_names_bonobo_class_init (ESelectNamesBonoboClass *klass)
{
GtkObjectClass *object_class;
+ POA_GNOME_Evolution_Addressbook_SelectNames__epv *epv;
object_class = GTK_OBJECT_CLASS (klass);
parent_class = gtk_type_class (bonobo_object_get_type ());
object_class->destroy = impl_destroy;
- corba_class_init ();
+ epv = &klass->epv;
+ epv->addSection = impl_SelectNames_add_section;
+ epv->addSectionWithLimit = impl_SelectNames_add_section_with_limit;
+ epv->getEntryBySection = impl_SelectNames_get_entry_for_section;
+ epv->activateDialog = impl_SelectNames_activate_dialog;
}
static void
-init (ESelectNamesBonobo *select_names)
+e_select_names_bonobo_init (ESelectNamesBonobo *select_names)
{
ESelectNamesBonoboPrivate *priv;
@@ -470,29 +417,26 @@ init (ESelectNamesBonobo *select_names)
priv->manager = e_select_names_manager_new ();
priv->event_source = NULL;
- gtk_signal_connect (GTK_OBJECT (priv->manager),
- "changed",
- GTK_SIGNAL_FUNC (manager_changed_cb),
- select_names);
-
- gtk_signal_connect (GTK_OBJECT (priv->manager),
- "ok",
- GTK_SIGNAL_FUNC (manager_ok_cb),
- select_names);
+ g_signal_connect (priv->manager,
+ "changed",
+ G_CALLBACK (manager_changed_cb),
+ select_names);
+ g_signal_connect (priv->manager,
+ "ok",
+ G_CALLBACK (manager_ok_cb),
+ select_names);
+
select_names->priv = priv;
}
-void
-e_select_names_bonobo_construct (ESelectNamesBonobo *select_names,
- GNOME_Evolution_Addressbook_SelectNames corba_object)
+static void
+e_select_names_bonobo_construct (ESelectNamesBonobo *select_names)
{
g_return_if_fail (select_names != NULL);
g_return_if_fail (E_IS_SELECT_NAMES_BONOBO (select_names));
- bonobo_object_construct (BONOBO_OBJECT (select_names), corba_object);
-
g_assert (select_names->priv->event_source == NULL);
select_names->priv->event_source = bonobo_event_source_new ();
bonobo_object_add_interface (BONOBO_OBJECT (select_names), BONOBO_OBJECT (select_names->priv->event_source));
@@ -501,21 +445,16 @@ e_select_names_bonobo_construct (ESelectNamesBonobo *select_names,
ESelectNamesBonobo *
e_select_names_bonobo_new (void)
{
- POA_GNOME_Evolution_Addressbook_SelectNames *servant;
- GNOME_Evolution_Addressbook_SelectNames corba_object;
ESelectNamesBonobo *select_names;
- servant = create_servant ();
- if (servant == NULL)
- return NULL;
-
- select_names = gtk_type_new (e_select_names_bonobo_get_type ());
-
- corba_object = bonobo_object_activate_servant (BONOBO_OBJECT (select_names), servant);
- e_select_names_bonobo_construct (select_names, corba_object);
+ select_names = g_object_new (E_TYPE_SELECT_NAMES_BONOBO, NULL);
return select_names;
}
-E_MAKE_TYPE (e_select_names_bonobo, "ESelectNamesBonobo", ESelectNamesBonobo, class_init, init, PARENT_TYPE)
+BONOBO_TYPE_FUNC_FULL (
+ ESelectNamesBonobo,
+ GNOME_Evolution_Addressbook_SelectNames,
+ PARENT_TYPE,
+ e_select_names_bonobo);
diff --git a/addressbook/gui/component/select-names/e-select-names-bonobo.h b/addressbook/gui/component/select-names/e-select-names-bonobo.h
index f254dd6e94..4d716380b1 100644
--- a/addressbook/gui/component/select-names/e-select-names-bonobo.h
+++ b/addressbook/gui/component/select-names/e-select-names-bonobo.h
@@ -51,12 +51,12 @@ struct _ESelectNamesBonobo {
struct _ESelectNamesBonoboClass {
BonoboObjectClass parent_class;
+
+ POA_GNOME_Evolution_Addressbook_SelectNames__epv epv;
};
-GtkType e_select_names_bonobo_get_type (void);
-void e_select_names_bonobo_construct (ESelectNamesBonobo *select_names,
- GNOME_Evolution_Addressbook_SelectNames corba_object);
+GType e_select_names_bonobo_get_type (void);
ESelectNamesBonobo *e_select_names_bonobo_new (void);
#ifdef __cplusplus
diff --git a/addressbook/gui/component/select-names/e-select-names-completion.c b/addressbook/gui/component/select-names/e-select-names-completion.c
index f905cf872c..13a458f788 100644
--- a/addressbook/gui/component/select-names/e-select-names-completion.c
+++ b/addressbook/gui/component/select-names/e-select-names-completion.c
@@ -33,11 +33,8 @@
#include <math.h>
#include <gtk/gtksignal.h>
-#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-util.h>
-#include <gal/unicode/gunicode.h>
-
#include <addressbook/backend/ebook/e-book-util.h>
#include <addressbook/backend/ebook/e-destination.h>
#include <addressbook/backend/ebook/e-card-simple.h>
@@ -103,10 +100,31 @@ static FILE *out;
typedef gchar *(*BookQuerySExp) (ESelectNamesCompletion *);
typedef ECompletionMatch *(*BookQueryMatchTester) (ESelectNamesCompletion *, EDestination *);
+static int
+utf8_casefold_collate_len (const gchar *str1, const gchar *str2, int len)
+{
+ gchar *s1 = g_utf8_casefold(str1, len);
+ gchar *s2 = g_utf8_casefold(str2, len);
+ int rv;
+
+ rv = g_utf8_collate (s1, s2);
+
+ g_free (s1);
+ g_free (s2);
+
+ return rv;
+}
+
+static int
+utf8_casefold_collate (const gchar *str1, const gchar *str2)
+{
+ return utf8_casefold_collate_len (str1, str2, -1);
+}
+
static void
our_match_destroy (ECompletionMatch *match)
{
- gtk_object_unref (GTK_OBJECT (match->user_data));
+ g_object_unref (match->user_data);
}
static ECompletionMatch *
@@ -121,7 +139,7 @@ make_match (EDestination *dest, const gchar *menu_form, double score)
/* Reject any match that has null text fields. */
if (! (e_completion_match_get_match_text (match) && e_completion_match_get_menu_text (match))) {
- gtk_object_unref (GTK_OBJECT (match));
+ g_object_unref (match);
return NULL;
}
@@ -131,7 +149,7 @@ make_match (EDestination *dest, const gchar *menu_form, double score)
match->sort_minor = e_destination_get_email_num (dest);
match->user_data = dest;
- gtk_object_ref (GTK_OBJECT (dest));
+ g_object_ref (dest);
match->destroy = our_match_destroy;
@@ -162,7 +180,7 @@ match_nickname (ESelectNamesCompletion *comp, EDestination *dest)
return NULL;
len = g_utf8_strlen (comp->priv->query_text, -1);
- if (card->nickname && !g_utf8_strncasecmp (comp->priv->query_text, card->nickname, len)) {
+ if (card->nickname && !utf8_casefold_collate_len (comp->priv->query_text, card->nickname, len)) {
const gchar *name;
gchar *str;
@@ -204,7 +222,7 @@ match_email (ESelectNamesCompletion *comp, EDestination *dest)
double score;
if (email
- && !g_utf8_strncasecmp (comp->priv->query_text, email, len)
+ && !utf8_casefold_collate_len (comp->priv->query_text, email, len)
&& !e_destination_is_evolution_list (dest)) {
gchar *str;
@@ -311,9 +329,9 @@ match_name (ESelectNamesCompletion *comp, EDestination *dest)
/* We massively boost the score if the nickname exists and is the same as one of the "real" names. This keeps the
nickname from matching ahead of the real name for this card. */
len = strlen (card->nickname);
- if ((card->name->given && !g_utf8_strncasecmp (card->name->given, card->nickname, MIN (strlen (card->name->given), len)))
- || (card->name->family && !g_utf8_strncasecmp (card->name->family, card->nickname, MIN (strlen (card->name->family), len)))
- || (card->name->additional && !g_utf8_strncasecmp (card->name->additional, card->nickname, MIN (strlen (card->name->additional), len))))
+ if ((card->name->given && !utf8_casefold_collate_len (card->name->given, card->nickname, MIN (strlen (card->name->given), len)))
+ || (card->name->family && !utf8_casefold_collate_len (card->name->family, card->nickname, MIN (strlen (card->name->family), len)))
+ || (card->name->additional && !utf8_casefold_collate_len (card->name->additional, card->nickname, MIN (strlen (card->name->additional), len))))
score *= 100;
}
#endif
@@ -410,7 +428,7 @@ match_file_as (ESelectNamesCompletion *comp, EDestination *dest)
for (i=0; strv[i] && score > 0; ++i) {
len = g_utf8_strlen (strv[i], -1);
- if (!g_utf8_strncasecmp (name, strv[i], len))
+ if (!utf8_casefold_collate_len (name, strv[i], len))
score += len; /* one point per character of the match */
else
score = 0;
@@ -568,7 +586,7 @@ book_query_process_card_list (ESelectNamesCompletion *comp, const GList *cards)
} else {
e_completion_match_unref (match);
}
- gtk_object_unref (GTK_OBJECT (dest));
+ g_object_unref (dest);
}
@@ -592,7 +610,7 @@ book_query_process_card_list (ESelectNamesCompletion *comp, const GList *cards)
}
}
- gtk_object_unref (GTK_OBJECT (dest));
+ g_object_unref (dest);
}
}
@@ -753,11 +771,11 @@ e_select_names_completion_clear_book_data (ESelectNamesCompletion *comp)
book_data->seq_complete_tag = 0;
}
- gtk_object_unref (GTK_OBJECT (book_data->book));
+ g_object_unref (book_data->book);
if (book_data->book_view) {
e_book_view_stop (book_data->book_view);
- gtk_object_unref (GTK_OBJECT (book_data->book_view));
+ g_object_unref (book_data->book_view);
}
g_free (book_data);
@@ -772,7 +790,7 @@ e_select_names_completion_destroy (GtkObject *object)
ESelectNamesCompletion *comp = E_SELECT_NAMES_COMPLETION (object);
if (comp->priv->text_model)
- gtk_object_unref (GTK_OBJECT (comp->priv->text_model));
+ g_object_unref (comp->priv->text_model);
e_select_names_completion_clear_book_data (comp);
@@ -780,7 +798,7 @@ e_select_names_completion_destroy (GtkObject *object)
g_free (comp->priv->query_text);
g_free (comp->priv->cached_query_text);
- g_list_foreach (comp->priv->cached_cards, (GFunc)gtk_object_unref, NULL);
+ g_list_foreach (comp->priv->cached_cards, (GFunc)g_object_unref, NULL);
g_list_free (comp->priv->cached_cards);
g_free (comp->priv);
@@ -822,7 +840,7 @@ e_select_names_completion_clear_cache (ESelectNamesCompletion *comp)
g_free (comp->priv->cached_query_text);
comp->priv->cached_query_text = NULL;
- g_list_foreach (comp->priv->cached_cards, (GFunc)gtk_object_unref, NULL);
+ g_list_foreach (comp->priv->cached_cards, (GFunc)g_object_unref, NULL);
g_list_free (comp->priv->cached_cards);
comp->priv->cached_cards = NULL;
}
@@ -850,23 +868,23 @@ e_select_names_completion_got_book_view_cb (EBook *book, EBookStatus status, EBo
book_data->seq_complete_tag = 0;
}
- gtk_object_ref (GTK_OBJECT (view));
+ g_object_ref (view);
if (book_data->book_view) {
e_book_view_stop (book_data->book_view);
- gtk_object_unref (GTK_OBJECT (book_data->book_view));
+ g_object_unref (book_data->book_view);
}
book_data->book_view = view;
book_data->card_added_tag =
- gtk_signal_connect (GTK_OBJECT (view),
+ g_signal_connect (view,
"card_added",
- GTK_SIGNAL_FUNC (e_select_names_completion_card_added_cb),
+ G_CALLBACK (e_select_names_completion_card_added_cb),
book_data);
book_data->seq_complete_tag =
- gtk_signal_connect (GTK_OBJECT (view),
+ g_signal_connect (view,
"sequence_complete",
- GTK_SIGNAL_FUNC (e_select_names_completion_seq_complete_cb),
+ G_CALLBACK (e_select_names_completion_seq_complete_cb),
book_data);
book_data->sequence_complete_received = FALSE;
comp->priv->pending_completion_seq++;
@@ -884,7 +902,7 @@ e_select_names_completion_card_added_cb (EBookView *book_view, const GList *card
/* Save the list of matching cards. */
while (cards) {
comp->priv->cached_cards = g_list_prepend (comp->priv->cached_cards, cards->data);
- gtk_object_ref (GTK_OBJECT (cards->data));
+ g_object_ref (cards->data);
cards = g_list_next (cards);
}
}
@@ -979,7 +997,7 @@ e_select_names_completion_stop_query (ESelectNamesCompletion *comp)
fprintf (out, "unrefed book view\n");
e_book_view_stop (book_data->book_view);
- gtk_object_unref (GTK_OBJECT (book_data->book_view));
+ g_object_unref (book_data->book_view);
book_data->book_view = NULL;
}
}
@@ -1077,7 +1095,7 @@ e_select_names_completion_do_query (ESelectNamesCompletion *comp, const gchar *q
&& comp->priv->cache_complete
&& (!comp->priv->can_fail_due_to_too_many_hits || comp->priv->cached_cards != NULL)
&& (strlen (comp->priv->cached_query_text) <= strlen (clean))
- && !g_utf8_strncasecmp (comp->priv->cached_query_text, clean, strlen (comp->priv->cached_query_text)));
+ && !utf8_casefold_collate_len (comp->priv->cached_query_text, clean, strlen (comp->priv->cached_query_text)));
if (can_reuse_cached_cards) {
@@ -1137,7 +1155,7 @@ search_override_check (SearchOverride *over, const gchar *text)
if (over == NULL || text == NULL || !g_utf8_validate (text, -1, NULL))
return FALSE;
- return !g_utf8_strcasecmp (over->trigger, text);
+ return !utf8_casefold_collate (over->trigger, text);
}
@@ -1238,7 +1256,7 @@ e_select_names_completion_book_ready (EBook *book, EBookStatus status, ESelectNa
comp->priv->waiting_query = NULL;
}
- gtk_object_unref (GTK_OBJECT (comp)); /* post-async unref */
+ g_object_unref (comp); /* post-async unref */
}
#endif
@@ -1259,7 +1277,7 @@ e_select_names_completion_new (ESelectNamesTextModel *text_model)
comp = (ESelectNamesCompletion *) gtk_type_new (e_select_names_completion_get_type ());
comp->priv->text_model = text_model;
- gtk_object_ref (GTK_OBJECT (text_model));
+ g_object_ref (text_model);
return E_COMPLETION (comp);
}
@@ -1275,7 +1293,7 @@ e_select_names_completion_add_book (ESelectNamesCompletion *comp, EBook *book)
book_data->book = book;
book_data->comp = comp;
check_capabilities (comp, book);
- gtk_object_ref (GTK_OBJECT (book_data->book));
+ g_object_ref (book_data->book);
comp->priv->book_data = g_list_append (comp->priv->book_data, book_data);
/* if the user is typing as we're adding books, restart the
diff --git a/addressbook/gui/component/select-names/e-select-names-completion.h b/addressbook/gui/component/select-names/e-select-names-completion.h
index ae5a8db471..957a7fd465 100644
--- a/addressbook/gui/component/select-names/e-select-names-completion.h
+++ b/addressbook/gui/component/select-names/e-select-names-completion.h
@@ -31,7 +31,7 @@
#include <addressbook/backend/ebook/e-book.h>
#include "e-select-names-text-model.h"
-BEGIN_GNOME_DECLS
+G_BEGIN_DECLS
#define E_SELECT_NAMES_COMPLETION_TYPE (e_select_names_completion_get_type ())
#define E_SELECT_NAMES_COMPLETION(o) (GTK_CHECK_CAST ((o), E_SELECT_NAMES_COMPLETION_TYPE, ESelectNamesCompletion))
@@ -62,7 +62,6 @@ void e_select_names_completion_clear_books (ESelectNamesComp
gboolean e_select_names_completion_get_match_contact_lists (ESelectNamesCompletion *);
void e_select_names_completion_set_match_contact_lists (ESelectNamesCompletion *, gboolean);
-END_GNOME_DECLS
+G_END_DECLS
#endif /* E_SELECT_NAMES_COMPLETION_H */
-
diff --git a/addressbook/gui/component/select-names/e-select-names-factory.c b/addressbook/gui/component/select-names/e-select-names-factory.c
index d6560d6366..2416e42750 100644
--- a/addressbook/gui/component/select-names/e-select-names-factory.c
+++ b/addressbook/gui/component/select-names/e-select-names-factory.c
@@ -37,6 +37,7 @@ static BonoboGenericFactory *factory = NULL;
static BonoboObject *
factory_fn (BonoboGenericFactory *factory,
+ const char *component_id,
void *closure)
{
return BONOBO_OBJECT (e_select_names_bonobo_new ());
diff --git a/addressbook/gui/component/select-names/e-select-names-manager.c b/addressbook/gui/component/select-names/e-select-names-manager.c
index 9bc06b52d9..1871ccf1ca 100644
--- a/addressbook/gui/component/select-names/e-select-names-manager.c
+++ b/addressbook/gui/component/select-names/e-select-names-manager.c
@@ -17,6 +17,7 @@
#include <libgnome/gnome-i18n.h>
#include "e-select-names-manager.h"
+#include "e-select-names-marshal.h"
#include "e-select-names-model.h"
#include "e-select-names-text-model.h"
#include "e-select-names.h"
@@ -25,10 +26,8 @@
#include "e-folder-list.h"
#include <addressbook/backend/ebook/e-book-util.h>
#include <addressbook/backend/ebook/e-destination.h>
-#include <addressbook/gui/component/addressbook.h>
-#include <bonobo-conf/bonobo-config-database.h>
+#include "addressbook/gui/component/addressbook.h"
#include <bonobo/bonobo-object.h>
-#include <bonobo/bonobo-moniker-util.h>
enum {
CHANGED,
@@ -96,11 +95,11 @@ e_select_names_manager_section_new (ESelectNamesManager *manager,
section->manager = manager;
section->model = model;
- gtk_object_ref (GTK_OBJECT (section->model));
+ g_object_ref (section->model);
section->changed_tag =
- gtk_signal_connect (GTK_OBJECT (section->model),
+ g_signal_connect (section->model,
"changed",
- GTK_SIGNAL_FUNC (section_model_changed_cb),
+ G_CALLBACK (section_model_changed_cb),
section);
return section;
@@ -117,11 +116,11 @@ e_select_names_manager_section_free (ESelectNamesManagerSection *section)
if (section->model) {
gtk_signal_disconnect (GTK_OBJECT (section->model), section->changed_tag);
- gtk_object_unref (GTK_OBJECT (section->model));
+ g_object_unref (section->model);
}
if (section->original_model) {
- gtk_object_unref (GTK_OBJECT (section->original_model));
+ g_object_unref (section->original_model);
}
g_free (section);
@@ -148,7 +147,7 @@ popup_cb (EEntry *eentry, GdkEventButton *ev, gint pos, gpointer user_data)
NULL);
g_assert (E_IS_SELECT_NAMES_TEXT_MODEL (text_model));
- e_select_names_popup (text_model, ev, pos);
+ e_select_names_popup (text_model, ev, pos, GTK_WIDGET (eentry));
}
#if 0
@@ -224,7 +223,7 @@ completion_handler (EEntry *entry, ECompletionMatch *match)
/* Sometimes I really long for garbage collection. Reference
counting makes you feel 31337, but sometimes it is just a
bitch. */
- gtk_object_ref (GTK_OBJECT (dest));
+ g_object_ref (dest);
gtk_object_get (GTK_OBJECT (entry),
"model", &text_model,
@@ -261,7 +260,7 @@ e_select_names_manager_entry_new (ESelectNamesManager *manager, ESelectNamesMode
"allow_newlines", FALSE,
NULL);
- gtk_object_ref (GTK_OBJECT (entry->entry));
+ g_object_ref (entry->entry);
entry->comp = e_select_names_completion_new (E_SELECT_NAMES_TEXT_MODEL (text_model));
@@ -275,26 +274,26 @@ e_select_names_manager_entry_new (ESelectNamesManager *manager, ESelectNamesMode
entry->manager = manager;
entry->model = model;
- gtk_object_ref (GTK_OBJECT (model));
+ g_object_ref (model);
- gtk_signal_connect (GTK_OBJECT (entry->entry),
+ g_signal_connect (entry->entry,
"popup",
- GTK_SIGNAL_FUNC (popup_cb),
+ G_CALLBACK (popup_cb),
entry);
- gtk_signal_connect (GTK_OBJECT (entry->entry->canvas),
+ g_signal_connect (entry->entry->canvas,
"focus_in_event",
- GTK_SIGNAL_FUNC (focus_in_cb),
+ G_CALLBACK (focus_in_cb),
entry);
- gtk_signal_connect (GTK_OBJECT (entry->entry->canvas),
+ g_signal_connect (entry->entry->canvas,
"focus_out_event",
- GTK_SIGNAL_FUNC (focus_out_cb),
+ G_CALLBACK (focus_out_cb),
entry);
- gtk_signal_connect (GTK_OBJECT (entry->entry),
+ g_signal_connect (entry->entry,
"completion_popup",
- GTK_SIGNAL_FUNC (completion_popup_cb),
+ G_CALLBACK (completion_popup_cb),
entry);
gtk_object_set_data (GTK_OBJECT (entry->entry), "entry_info", entry);
@@ -312,8 +311,8 @@ e_select_names_manager_entry_free (ESelectNamesManagerEntry *entry)
return;
g_free (entry->id);
- gtk_object_unref (GTK_OBJECT (entry->model));
- gtk_object_unref (GTK_OBJECT (entry->entry));
+ g_object_unref (entry->model);
+ g_object_unref (entry->entry);
if (entry->cleaning_tag)
gtk_timeout_remove (entry->cleaning_tag);
@@ -346,7 +345,7 @@ e_select_names_manager_revert_to_saved_models (ESelectNamesManager *manager)
ESelectNamesManagerSection *section = iter->data;
if (section->model && section->original_model) {
e_select_names_model_overwrite_copy (section->model, section->original_model);
- gtk_object_unref (GTK_OBJECT (section->original_model));
+ g_object_unref (section->original_model);
section->original_model = NULL;
}
}
@@ -360,7 +359,7 @@ e_select_names_manager_discard_saved_models (ESelectNamesManager *manager)
for (iter = manager->sections; iter != NULL; iter = g_list_next (iter)) {
ESelectNamesManagerSection *section = iter->data;
if (section->original_model) {
- gtk_object_unref (GTK_OBJECT (section->original_model));
+ g_object_unref (section->original_model);
section->original_model = NULL;
}
}
@@ -380,10 +379,10 @@ open_book_cb (EBook *book, EBookStatus status, ESelectNamesManager *manager)
}
manager->completion_books = g_list_append (manager->completion_books, book);
- gtk_object_ref (GTK_OBJECT (book));
+ g_object_ref (book);
}
- gtk_object_unref (GTK_OBJECT (manager)); /* unref ourself (matches ref before the load_uri call below) */
+ g_object_unref (manager); /* unref ourself (matches ref before the load_uri call below) */
}
static void
@@ -395,7 +394,7 @@ load_completion_books (ESelectNamesManager *manager)
for (f = folders; f && f->physical_uri; f++) {
char *uri;
EBook *book = e_book_new ();
- gtk_object_ref (GTK_OBJECT (manager)); /* ref ourself before our async call */
+ g_object_ref (manager); /* ref ourself before our async call */
uri = e_book_expand_uri (f->physical_uri);
@@ -407,19 +406,11 @@ load_completion_books (ESelectNamesManager *manager)
}
static void
-read_completion_books_from_db (ESelectNamesManager *manager)
+read_completion_books_from_db (ESelectNamesManager *manager, EConfigListener *db)
{
- Bonobo_ConfigDatabase db;
- CORBA_Environment ev;
char *val;
- CORBA_exception_init (&ev);
-
- db = addressbook_config_database (&ev);
-
- val = bonobo_config_get_string (db, "/Addressbook/Completion/uris", &ev);
-
- CORBA_exception_free (&ev);
+ val = e_config_listener_get_string (db, "/Addressbook/Completion/uris");
if (val) {
g_free (manager->cached_folder_list);
@@ -429,18 +420,17 @@ read_completion_books_from_db (ESelectNamesManager *manager)
}
static void
-uris_listener (BonoboListener *listener, char *event_name,
- CORBA_any *any, CORBA_Environment *ev,
- gpointer user_data)
+uris_listener (EConfigListener *db, const char *key,
+ ESelectNamesManager *manager)
{
- ESelectNamesManager *manager = E_SELECT_NAMES_MANAGER (user_data);
GList *l;
- Bonobo_ConfigDatabase db;
char *val;
- db = addressbook_config_database (NULL);
-
- val = bonobo_config_get_string (db, "/Addressbook/Completion/uris", NULL);
+ /* return if it's not the key we're interested in */
+ if (!strcmp (key, "/Addressbook/Completion/uris"))
+ return;
+
+ val = e_config_listener_get_string (db, "/Addressbook/Completion/uris");
if (val) {
if (!manager->cached_folder_list || strcmp (val, manager->cached_folder_list)) {
@@ -449,7 +439,7 @@ uris_listener (BonoboListener *listener, char *event_name,
e_select_names_completion_clear_books (E_SELECT_NAMES_COMPLETION (entry->comp));
}
- g_list_foreach (manager->completion_books, (GFunc)gtk_object_unref, NULL);
+ g_list_foreach (manager->completion_books, (GFunc)g_object_unref, NULL);
g_list_free (manager->completion_books);
manager->completion_books = NULL;
@@ -470,16 +460,15 @@ ESelectNamesManager *
e_select_names_manager_new (void)
{
ESelectNamesManager *manager = E_SELECT_NAMES_MANAGER(gtk_type_new(e_select_names_manager_get_type()));
- Bonobo_ConfigDatabase db;
+ EConfigListener *db;
- db = addressbook_config_database (NULL);
+ db = e_book_get_config_database();
- manager->listener_id = bonobo_event_source_client_add_listener (db, uris_listener,
- "Bonobo/ConfigDatabase:change/Addressbook/Completion:",
- NULL,
- manager);
+ manager->listener_id = g_signal_connect (db,
+ "key_changed",
+ G_CALLBACK (uris_listener), manager);
- read_completion_books_from_db (manager);
+ read_completion_books_from_db (manager, db);
return manager;
}
@@ -522,7 +511,7 @@ e_select_names_manager_add_section_with_limit (ESelectNamesManager *manager,
manager->sections = g_list_append (manager->sections, section);
- gtk_object_unref (GTK_OBJECT (model));
+ g_object_unref (model);
}
ESelectNamesModel *
@@ -610,14 +599,14 @@ e_select_names_manager_activate_dialog (ESelectNamesManager *manager,
e_select_names_set_default (manager->names, id);
- gtk_signal_connect(GTK_OBJECT(manager->names),
+ g_signal_connect(manager->names,
"clicked",
- GTK_SIGNAL_FUNC(e_select_names_clicked),
+ G_CALLBACK(e_select_names_clicked),
manager);
- gtk_signal_connect(GTK_OBJECT(manager->names),
+ g_signal_connect(manager->names,
"destroy",
- GTK_SIGNAL_FUNC(gtk_widget_destroyed),
+ G_CALLBACK(gtk_widget_destroyed),
&manager->names);
gtk_widget_show(GTK_WIDGET(manager->names));
@@ -657,11 +646,11 @@ e_select_names_manager_destroy (GtkObject *object)
g_list_free (manager->entries);
manager->entries = NULL;
- g_list_foreach (manager->completion_books, (GFunc) gtk_object_unref, NULL);
+ g_list_foreach (manager->completion_books, (GFunc) g_object_unref, NULL);
g_list_free (manager->completion_books);
manager->completion_books = NULL;
- bonobo_event_source_client_remove_listener (addressbook_config_database (NULL), manager->listener_id, NULL);
+ g_signal_handler_disconnect (e_book_get_config_database(), manager->listener_id);
g_free (manager->cached_folder_list);
}
@@ -676,32 +665,33 @@ e_select_names_manager_class_init (ESelectNamesManagerClass *klass)
object_class->destroy = e_select_names_manager_destroy;
e_select_names_manager_signals[CHANGED] =
- gtk_signal_new ("changed",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (ESelectNamesManagerClass, changed),
- gtk_marshal_NONE__POINTER_INT,
- GTK_TYPE_NONE, 2,
- GTK_TYPE_POINTER,
- GTK_TYPE_INT);
+ g_signal_new ("changed",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ESelectNamesManagerClass, changed),
+ NULL, NULL,
+ e_select_names_marshal_NONE__POINTER_INT,
+ G_TYPE_NONE, 2,
+ G_TYPE_POINTER,
+ G_TYPE_INT);
e_select_names_manager_signals[OK] =
- gtk_signal_new ("ok",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (ESelectNamesManagerClass, ok),
- gtk_marshal_NONE__NONE,
- GTK_TYPE_NONE, 0);
+ g_signal_new ("ok",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ESelectNamesManagerClass, ok),
+ NULL, NULL,
+ e_select_names_marshal_NONE__NONE,
+ G_TYPE_NONE, 0);
e_select_names_manager_signals[CANCEL] =
- gtk_signal_new ("cancel",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (ESelectNamesManagerClass, cancel),
- gtk_marshal_NONE__NONE,
- GTK_TYPE_NONE, 0);
-
- gtk_object_class_add_signals (object_class, e_select_names_manager_signals, LAST_SIGNAL);
+ g_signal_new ("cancel",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ESelectNamesManagerClass, cancel),
+ NULL, NULL,
+ e_select_names_marshal_NONE__NONE,
+ G_TYPE_NONE, 0);
}
/**
diff --git a/addressbook/gui/component/select-names/e-select-names-manager.h b/addressbook/gui/component/select-names/e-select-names-manager.h
index af57bd3a61..dd1a418396 100644
--- a/addressbook/gui/component/select-names/e-select-names-manager.h
+++ b/addressbook/gui/component/select-names/e-select-names-manager.h
@@ -34,7 +34,7 @@ struct _ESelectNamesManager {
GList *completion_books;
- Bonobo_EventSource_ListenerId listener_id;
+ gulong listener_id;
char *cached_folder_list;
};
diff --git a/addressbook/gui/component/select-names/e-select-names-marshal.list b/addressbook/gui/component/select-names/e-select-names-marshal.list
new file mode 100644
index 0000000000..8e751dc27d
--- /dev/null
+++ b/addressbook/gui/component/select-names/e-select-names-marshal.list
@@ -0,0 +1,3 @@
+NONE:POINTER,INT
+NONE:NONE
+NONE:INT,INT,INT
diff --git a/addressbook/gui/component/select-names/e-select-names-model.c b/addressbook/gui/component/select-names/e-select-names-model.c
index fadb8c21a0..253245d4d3 100644
--- a/addressbook/gui/component/select-names/e-select-names-model.c
+++ b/addressbook/gui/component/select-names/e-select-names-model.c
@@ -18,6 +18,7 @@
#include <gal/util/e-util.h>
#include "e-select-names-model.h"
+#include "e-select-names-marshal.h"
#include "addressbook/backend/ebook/e-card-simple.h"
#define MAX_LENGTH 2047
@@ -65,8 +66,6 @@ static void e_select_names_model_init (ESelectNamesModel *model);
static void e_select_names_model_class_init (ESelectNamesModelClass *klass);
static void e_select_names_model_destroy (GtkObject *object);
-static void e_select_names_model_set_arg (GtkObject *object, GtkArg *arg, guint arg_id);
-static void e_select_names_model_get_arg (GtkObject *object, GtkArg *arg, guint arg_id);
GtkType
e_select_names_model_get_type (void)
@@ -91,23 +90,6 @@ e_select_names_model_get_type (void)
return model_type;
}
-typedef void (*GtkSignal_NONE__INT_INT_INT) (GtkObject *object, gint arg1, gint arg2, gint arg3, gpointer user_data);
-static void
-local_gtk_marshal_NONE__INT_INT_INT (GtkObject *object,
- GtkSignalFunc func,
- gpointer func_data,
- GtkArg *args)
-{
- GtkSignal_NONE__INT_INT_INT rfunc;
- rfunc = (GtkSignal_NONE__INT_INT_INT) func;
- (* rfunc) (object,
- GTK_VALUE_INT(args[0]),
- GTK_VALUE_INT(args[1]),
- GTK_VALUE_INT(args[2]),
- func_data);
-}
-
-
static void
e_select_names_model_class_init (ESelectNamesModelClass *klass)
{
@@ -116,31 +98,29 @@ e_select_names_model_class_init (ESelectNamesModelClass *klass)
object_class = GTK_OBJECT_CLASS(klass);
e_select_names_model_signals[E_SELECT_NAMES_MODEL_CHANGED] =
- gtk_signal_new ("changed",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (ESelectNamesModelClass, changed),
- gtk_marshal_NONE__NONE,
- GTK_TYPE_NONE, 0);
+ g_signal_new ("changed",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ESelectNamesModelClass, changed),
+ NULL, NULL,
+ e_select_names_marshal_NONE__NONE,
+ G_TYPE_NONE, 0);
e_select_names_model_signals[E_SELECT_NAMES_MODEL_RESIZED] =
- gtk_signal_new ("resized",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (ESelectNamesModelClass, resized),
- local_gtk_marshal_NONE__INT_INT_INT,
- GTK_TYPE_NONE, 3, GTK_TYPE_INT, GTK_TYPE_INT, GTK_TYPE_INT);
-
- gtk_object_class_add_signals (object_class, e_select_names_model_signals, E_SELECT_NAMES_MODEL_LAST_SIGNAL);
-
- gtk_object_add_arg_type ("ESelectNamesModel::card",
- GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_CARD);
+ g_signal_new ("resized",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ESelectNamesModelClass, resized),
+ NULL, NULL,
+ e_select_names_marshal_NONE__INT_INT_INT,
+ G_TYPE_NONE, 3,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ G_TYPE_INT);
klass->changed = NULL;
object_class->destroy = e_select_names_model_destroy;
- object_class->get_arg = e_select_names_model_get_arg;
- object_class->set_arg = e_select_names_model_set_arg;
}
/**
@@ -162,7 +142,7 @@ e_select_names_model_destroy (GtkObject *object)
g_free (model->priv->title);
g_free (model->priv->id);
- g_list_foreach (model->priv->data, (GFunc) gtk_object_unref, NULL);
+ g_list_foreach (model->priv->data, (GFunc) g_object_unref, NULL);
g_list_free (model->priv->data);
g_free (model->priv);
@@ -170,47 +150,13 @@ e_select_names_model_destroy (GtkObject *object)
}
-/* Set_arg handler for the model */
-static void
-e_select_names_model_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
-{
- ESelectNamesModel *model;
-
- model = E_SELECT_NAMES_MODEL (object);
-
- switch (arg_id) {
- case ARG_CARD:
- break;
- default:
- return;
- }
-}
-
-/* Get_arg handler for the model */
-static void
-e_select_names_model_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
-{
- ESelectNamesModel *model;
-
- model = E_SELECT_NAMES_MODEL (object);
-
- switch (arg_id) {
- case ARG_CARD:
- break;
- default:
- arg->type = GTK_TYPE_INVALID;
- break;
- }
-}
-
-
static void
e_select_names_model_changed (ESelectNamesModel *model)
{
if (model->priv->freeze_count > 0) {
model->priv->pending_changed = TRUE;
} else {
- gtk_signal_emit (GTK_OBJECT(model), e_select_names_model_signals[E_SELECT_NAMES_MODEL_CHANGED]);
+ g_signal_emit (model, e_select_names_model_signals[E_SELECT_NAMES_MODEL_CHANGED], 0);
model->priv->pending_changed = FALSE;
}
}
@@ -227,14 +173,14 @@ ESelectNamesModel *
e_select_names_model_new (void)
{
ESelectNamesModel *model;
- model = E_SELECT_NAMES_MODEL (gtk_type_new (e_select_names_model_get_type ()));
+ model = g_object_new (E_TYPE_SELECT_NAMES_MODEL, NULL);
return model;
}
ESelectNamesModel *
e_select_names_model_duplicate (ESelectNamesModel *old)
{
- ESelectNamesModel *model = E_SELECT_NAMES_MODEL(gtk_type_new(e_select_names_model_get_type()));
+ ESelectNamesModel *model = e_select_names_model_new ();
GList *iter;
model->priv->id = g_strdup (old->priv->id);
@@ -456,16 +402,16 @@ e_select_names_model_get_string (ESelectNamesModel *model, gint index)
static void
connect_destination (ESelectNamesModel *model, EDestination *dest)
{
- gtk_signal_connect (GTK_OBJECT (dest),
- "changed",
- destination_changed_proxy,
- model);
+ g_signal_connect (dest,
+ "changed",
+ G_CALLBACK (destination_changed_proxy),
+ model);
}
static void
disconnect_destination (ESelectNamesModel *model, EDestination *dest)
{
- gtk_signal_disconnect_by_func (GTK_OBJECT (dest), destination_changed_proxy, model);
+ g_signal_handlers_disconnect_by_func (dest, destination_changed_proxy, model);
}
gboolean
@@ -494,7 +440,7 @@ e_select_names_model_insert (ESelectNamesModel *model, gint index, EDestination
if (e_select_names_model_at_limit (model)) {
/* FIXME: This is bad. */
- gtk_object_unref (GTK_OBJECT (dest));
+ g_object_unref (dest);
return;
}
@@ -502,8 +448,7 @@ e_select_names_model_insert (ESelectNamesModel *model, gint index, EDestination
model->priv->data = g_list_insert (model->priv->data, dest, index);
- gtk_object_ref (GTK_OBJECT (dest));
- gtk_object_sink (GTK_OBJECT (dest));
+ g_object_ref (dest);
e_select_names_model_changed (model);
}
@@ -516,7 +461,7 @@ e_select_names_model_append (ESelectNamesModel *model, EDestination *dest)
if (e_select_names_model_at_limit (model)) {
/* FIXME: This is bad. */
- gtk_object_unref (GTK_OBJECT (dest));
+ g_object_unref (dest);
return;
}
@@ -524,8 +469,7 @@ e_select_names_model_append (ESelectNamesModel *model, EDestination *dest)
model->priv->data = g_list_append (model->priv->data, dest);
- gtk_object_ref (GTK_OBJECT (dest));
- gtk_object_sink (GTK_OBJECT (dest));
+ g_object_ref (dest);
e_select_names_model_changed (model);
}
@@ -550,8 +494,7 @@ e_select_names_model_replace (ESelectNamesModel *model, gint index, EDestination
connect_destination (model, dest);
model->priv->data = g_list_append (model->priv->data, dest);
- gtk_object_ref (GTK_OBJECT (dest));
- gtk_object_sink (GTK_OBJECT (dest));
+ g_object_ref (dest);
} else {
@@ -565,18 +508,17 @@ e_select_names_model_replace (ESelectNamesModel *model, gint index, EDestination
old_str = e_destination_get_textrep (E_DESTINATION (node->data));
old_strlen = old_str ? strlen (old_str) : 0;
- gtk_object_unref (GTK_OBJECT (node->data));
+ g_object_unref (node->data);
node->data = dest;
- gtk_object_ref (GTK_OBJECT (dest));
- gtk_object_sink (GTK_OBJECT (dest));
+ g_object_ref (dest);
}
}
e_select_names_model_changed (model);
- gtk_signal_emit (GTK_OBJECT (model), e_select_names_model_signals[E_SELECT_NAMES_MODEL_RESIZED],
- index, old_strlen, new_strlen);
+ g_signal_emit (model, e_select_names_model_signals[E_SELECT_NAMES_MODEL_RESIZED], 0,
+ index, old_strlen, new_strlen);
}
void
@@ -593,7 +535,7 @@ e_select_names_model_delete (ESelectNamesModel *model, gint index)
dest = E_DESTINATION (node->data);
disconnect_destination (model, dest);
- gtk_object_unref (GTK_OBJECT (dest));
+ g_object_unref (dest);
model->priv->data = g_list_remove_link (model->priv->data, node);
g_list_free_1 (node);
@@ -624,7 +566,7 @@ e_select_names_model_clean (ESelectNamesModel *model, gboolean clean_last_entry)
if (dest == NULL || e_destination_is_empty (dest)) {
if (dest) {
disconnect_destination (model, dest);
- gtk_object_unref (GTK_OBJECT (dest));
+ g_object_unref (dest);
}
model->priv->data = g_list_remove_link (model->priv->data, iter);
g_list_free_1 (iter);
@@ -642,7 +584,7 @@ static void
delete_all_iter (gpointer data, gpointer closure)
{
disconnect_destination (E_SELECT_NAMES_MODEL (closure), E_DESTINATION (data));
- gtk_object_unref (GTK_OBJECT (data));
+ g_object_unref (data);
}
void
diff --git a/addressbook/gui/component/select-names/e-select-names-popup.c b/addressbook/gui/component/select-names/e-select-names-popup.c
index 927bdff769..50b779a3e0 100644
--- a/addressbook/gui/component/select-names/e-select-names-popup.c
+++ b/addressbook/gui/component/select-names/e-select-names-popup.c
@@ -31,7 +31,6 @@
#include <glib.h>
#include <gtk/gtkcheckmenuitem.h>
-#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnomeui/gnome-app.h>
#include <libgnomeui/gnome-app-helper.h>
@@ -47,13 +46,13 @@
typedef struct _PopupInfo PopupInfo;
struct _PopupInfo {
ESelectNamesTextModel *text_model;
- const EDestination *dest;
+ EDestination *dest;
gint pos;
gint index;
};
static PopupInfo *
-popup_info_new (ESelectNamesTextModel *text_model, const EDestination *dest, gint pos, gint index)
+popup_info_new (ESelectNamesTextModel *text_model, EDestination *dest, gint pos, gint index)
{
PopupInfo *info = g_new0 (PopupInfo, 1);
info->text_model = text_model;
@@ -62,10 +61,10 @@ popup_info_new (ESelectNamesTextModel *text_model, const EDestination *dest, gin
info->index = index;
if (text_model)
- gtk_object_ref (GTK_OBJECT (text_model));
+ g_object_ref (text_model);
if (dest)
- gtk_object_ref (GTK_OBJECT (dest));
+ g_object_ref (dest);
return info;
}
@@ -76,10 +75,10 @@ popup_info_free (PopupInfo *info)
if (info) {
if (info->text_model)
- gtk_object_unref (GTK_OBJECT (info->text_model));
+ g_object_unref (info->text_model);
if (info->dest)
- gtk_object_unref (GTK_OBJECT (info->dest));
+ g_object_unref (info->dest);
g_free (info);
}
@@ -111,7 +110,7 @@ make_contact_editor_cb (EBook *book, gpointer user_data)
ce = e_addressbook_show_contact_editor (book, card, FALSE, TRUE);
e_contact_editor_raise (ce);
}
- gtk_object_unref (GTK_OBJECT (dest));
+ g_object_unref (dest);
}
}
@@ -122,7 +121,7 @@ edit_contact_info_cb (GtkWidget *w, gpointer user_data)
if (info == NULL)
return;
- gtk_object_ref (GTK_OBJECT (info->dest));
+ g_object_ref (info->dest);
e_book_use_default_book (make_contact_editor_cb, (gpointer) info->dest);
}
@@ -278,7 +277,7 @@ popup_menu_card (PopupInfo *info)
++j;
}
}
- gtk_object_unref (GTK_OBJECT (iterator));
+ g_object_unref (iterator);
radioinfo[j].type = GNOME_APP_UI_ENDOFINFO;
@@ -349,7 +348,7 @@ popup_menu_card (PopupInfo *info)
++j;
}
}
- gtk_object_unref (GTK_OBJECT (iterator));
+ g_object_unref (iterator);
}
return pop;
@@ -398,7 +397,7 @@ popup_menu_list (PopupInfo *info)
uiinfo[i].type = GNOME_APP_UI_SEPARATOR;
++i;
- gtk_object_unref (GTK_OBJECT (iterator));
+ g_object_unref (iterator);
}
uiinfo[i].type = GNOME_APP_UI_ITEM;
@@ -433,7 +432,7 @@ popup_menu_list (PopupInfo *info)
EDestination *subdest = e_destination_import (label);
set_uiinfo_label (&(uiinfo[i]), e_destination_get_address (subdest));
++i;
- gtk_object_unref (GTK_OBJECT (subdest));
+ g_object_unref (subdest);
}
}
if (e_iterator_is_valid (iterator)) {
@@ -442,7 +441,7 @@ popup_menu_list (PopupInfo *info)
g_free (gs);
}
- gtk_object_unref (GTK_OBJECT (iterator));
+ g_object_unref (iterator);
}
@@ -511,12 +510,12 @@ popup_menu_nocard (PopupInfo *info)
}
void
-e_select_names_popup (ESelectNamesTextModel *text_model, GdkEventButton *ev, gint pos)
+e_select_names_popup (ESelectNamesTextModel *text_model, GdkEventButton *ev, gint pos, GtkWidget *for_widget)
{
ESelectNamesModel *model;
GtkWidget *popup;
PopupInfo *info;
- const EDestination *dest;
+ EDestination *dest;
ECard *card;
gint index;
@@ -530,7 +529,8 @@ e_select_names_popup (ESelectNamesTextModel *text_model, GdkEventButton *ev, gin
if (index < 0 || index >= e_select_names_model_count (model))
return;
- dest = e_select_names_model_get_destination (model, index);
+ /* XXX yuck, why does this return a const? */
+ dest = (EDestination *)e_select_names_model_get_destination (model, index);
if (e_destination_is_empty (dest))
return;
@@ -549,12 +549,12 @@ e_select_names_popup (ESelectNamesTextModel *text_model, GdkEventButton *ev, gin
if (popup) {
/* Clean up our info item after we've made our selection. */
- gtk_signal_connect (GTK_OBJECT (popup),
- "selection-done",
- GTK_SIGNAL_FUNC (popup_info_cleanup),
- info);
+ g_signal_connect (popup,
+ "selection-done",
+ G_CALLBACK (popup_info_cleanup),
+ info);
- gnome_popup_menu_do_popup (popup, NULL, NULL, ev, info);
+ gnome_popup_menu_do_popup (popup, NULL, NULL, ev, info, for_widget);
} else {
diff --git a/addressbook/gui/component/select-names/e-select-names-popup.h b/addressbook/gui/component/select-names/e-select-names-popup.h
index 09cd29da18..b88a480397 100644
--- a/addressbook/gui/component/select-names/e-select-names-popup.h
+++ b/addressbook/gui/component/select-names/e-select-names-popup.h
@@ -29,7 +29,7 @@
#include "e-select-names-text-model.h"
-void e_select_names_popup (ESelectNamesTextModel *text_model, GdkEventButton *ev, gint pos);
+void e_select_names_popup (ESelectNamesTextModel *text_model, GdkEventButton *ev, gint pos, GtkWidget *for_widget);
#endif /* __E_SELECT_NAMES_POPUP_H__ */
diff --git a/addressbook/gui/component/select-names/e-select-names-table-model.c b/addressbook/gui/component/select-names/e-select-names-table-model.c
index a4faf69503..18a19bb171 100644
--- a/addressbook/gui/component/select-names/e-select-names-table-model.c
+++ b/addressbook/gui/component/select-names/e-select-names-table-model.c
@@ -40,9 +40,9 @@ e_select_names_table_model_add_source (ESelectNamesTableModel *model,
{
model->source = source;
if (model->source)
- gtk_object_ref(GTK_OBJECT(model->source));
- model->source_changed_id = gtk_signal_connect(GTK_OBJECT(model->source), "changed",
- GTK_SIGNAL_FUNC(e_select_names_table_model_model_changed),
+ g_object_ref(model->source);
+ model->source_changed_id = g_signal_connect(GTK_OBJECT(model->source), "changed",
+ G_CALLBACK(e_select_names_table_model_model_changed),
model);
}
@@ -52,7 +52,7 @@ e_select_names_table_model_drop_source (ESelectNamesTableModel *model)
if (model->source_changed_id)
gtk_signal_disconnect(GTK_OBJECT(model->source), model->source_changed_id);
if (model->source)
- gtk_object_unref(GTK_OBJECT(model->source));
+ g_object_unref(model->source);
model->source = NULL;
model->source_changed_id = 0;
}
@@ -127,7 +127,7 @@ fill_in_info (ESelectNamesTableModel *model)
model->data[i].email = e_card_simple_get(simple, E_CARD_SIMPLE_FIELD_EMAIL);
if (model->data[i].email == 0)
model->data[i].email = g_strdup("");
- gtk_object_unref(GTK_OBJECT(simple));
+ g_object_unref(simple);
} else {
const gchar *name = e_destination_get_name (dest);
const gchar *email = e_destination_get_email (dest);
diff --git a/addressbook/gui/component/select-names/e-select-names-text-model.c b/addressbook/gui/component/select-names/e-select-names-text-model.c
index 9c108868b9..8f04e440b5 100644
--- a/addressbook/gui/component/select-names/e-select-names-text-model.c
+++ b/addressbook/gui/component/select-names/e-select-names-text-model.c
@@ -248,21 +248,21 @@ e_select_names_text_model_set_source (ESelectNamesTextModel *model,
if (model->source) {
gtk_signal_disconnect (GTK_OBJECT (model->source), model->source_changed_id);
gtk_signal_disconnect (GTK_OBJECT (model->source), model->source_resize_id);
- gtk_object_unref (GTK_OBJECT (model->source));
+ g_object_unref (model->source);
}
model->source = source;
if (model->source) {
- gtk_object_ref (GTK_OBJECT (model->source));
- model->source_changed_id = gtk_signal_connect_object (GTK_OBJECT(model->source),
- "changed",
- GTK_SIGNAL_FUNC (changed_cb),
- GTK_OBJECT (model));
- model->source_resize_id = gtk_signal_connect (GTK_OBJECT(model->source),
- "resized",
- GTK_SIGNAL_FUNC (resize_cb),
- model);
+ g_object_ref (model->source);
+ model->source_changed_id = g_signal_connect (GTK_OBJECT(model->source),
+ "changed",
+ GTK_SIGNAL_FUNC (changed_cb),
+ model);
+ model->source_resize_id = g_signal_connect (GTK_OBJECT(model->source),
+ "resized",
+ GTK_SIGNAL_FUNC (resize_cb),
+ model);
}
}
diff --git a/addressbook/gui/component/select-names/e-select-names.c b/addressbook/gui/component/select-names/e-select-names.c
index e592999ef1..33359ac90f 100644
--- a/addressbook/gui/component/select-names/e-select-names.c
+++ b/addressbook/gui/component/select-names/e-select-names.c
@@ -20,9 +20,7 @@
#include <config.h>
#include <glib.h>
-#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-stock.h>
#include <libgnomeui/gnome-dialog.h>
#include <libgnomeui/gnome-dialog-util.h>
@@ -124,9 +122,9 @@ set_book(EBook *book, EBookStatus status, ESelectNames *esn)
"book", book,
NULL);
update_query (NULL, esn);
- gtk_object_unref(GTK_OBJECT(book));
- gtk_object_unref(GTK_OBJECT(esn->model));
- gtk_object_unref(GTK_OBJECT(esn));
+ g_object_unref(book);
+ g_object_unref(esn->model);
+ g_object_unref(esn);
}
static void
@@ -149,8 +147,8 @@ addressbook_model_set_uri(ESelectNames *e_select_names, EAddressbookModel *model
book = e_book_new();
- gtk_object_ref(GTK_OBJECT(e_select_names));
- gtk_object_ref(GTK_OBJECT(model));
+ g_object_ref(e_select_names);
+ g_object_ref(model);
addressbook_load_uri(book, book_uri, (EBookCallback) set_book, e_select_names);
g_free (book_uri);
@@ -219,7 +217,7 @@ real_add_address_cb (int model_row, gpointer closure)
e_select_names_model_append (child->source, dest);
e_select_names_model_clean (child->source, FALSE);
- gtk_object_unref(GTK_OBJECT(card));
+ g_object_unref(card);
}
}
@@ -268,7 +266,7 @@ esn_get_key_fn (ETableModel *source, int row, void *closure)
EAddressbookModel *model = E_ADDRESSBOOK_MODEL (closure);
ECard *card = e_addressbook_model_get_card (model, row);
void *key = card_key (card);
- gtk_object_unref (GTK_OBJECT (card));
+ g_object_unref (card);
return key;
}
@@ -338,19 +336,17 @@ static void
folder_selected (EvolutionFolderSelectorButton *button, GNOME_Evolution_Folder *folder,
ESelectNames *e_select_names)
{
- Bonobo_ConfigDatabase db;
-
addressbook_model_set_uri(e_select_names, e_select_names->model, folder->physicalUri);
- db = addressbook_config_database (NULL);
- bonobo_config_set_string (db, "/Addressbook/select_names_uri", folder->physicalUri, NULL);
+ e_config_listener_set_string (e_book_get_config_database(),
+ "/Addressbook/select_names_uri", folder->physicalUri);
}
static void
update_query (GtkWidget *widget, ESelectNames *e_select_names)
{
char *category = "";
- char *search = "";
+ const char *search = "";
char *query;
char *q_array[4];
int i;
@@ -406,7 +402,7 @@ static void
select_entry_changed (GtkWidget *widget, ESelectNames *e_select_names)
{
if (e_select_names->select_entry) {
- char *select_string = gtk_entry_get_text (GTK_ENTRY (e_select_names->select_entry));
+ const char *select_string = gtk_entry_get_text (GTK_ENTRY (e_select_names->select_entry));
char *select_strcoll_string = g_utf8_collate_key (select_string, -1);
int count;
ETable *table;
@@ -449,14 +445,18 @@ e_select_names_create_categories (gchar *name,
gchar *string1, gchar *string2,
gint int1, gint int2)
{
+#ifdef PENDING_PORT_WORK
ECategoriesMasterList *ecml;
GtkWidget *option_menu;
ecml = e_categories_master_list_wombat_new ();
option_menu = e_categories_master_list_option_menu_new (ecml);
- gtk_object_unref (GTK_OBJECT (ecml));
+ g_object_unref (ecml);
return option_menu;
+#else
+ return gtk_label_new ("e_select_names_create_categories\nneeds work");
+#endif
}
static void
@@ -474,11 +474,11 @@ e_select_names_init (ESelectNames *e_select_names)
const char *selector_types[] = { "contacts/*", NULL };
char *filename;
char *contacts_uri;
- Bonobo_ConfigDatabase db;
+ EConfigListener *db;
- db = addressbook_config_database (NULL);
+ db = e_book_get_config_database();
- gui = glade_xml_new (EVOLUTION_GLADEDIR "/select-names.glade", NULL);
+ gui = glade_xml_new (EVOLUTION_GLADEDIR "/select-names.glade", NULL, NULL);
e_select_names->gui = gui;
e_select_names->children = g_hash_table_new(g_str_hash, g_str_equal);
@@ -512,45 +512,43 @@ e_select_names_init (ESelectNames *e_select_names)
if (e_select_names->status_message && !GTK_IS_LABEL (e_select_names->status_message))
e_select_names->status_message = NULL;
if (e_select_names->status_message) {
- gtk_signal_connect (GTK_OBJECT (e_select_names->model), "status_message",
- GTK_SIGNAL_FUNC (status_message), e_select_names);
- gtk_signal_connect(GTK_OBJECT(e_select_names->status_message), "destroy",
- GTK_SIGNAL_FUNC(clear_widget), &e_select_names->status_message);
+ g_signal_connect (e_select_names->model, "status_message",
+ G_CALLBACK (status_message), e_select_names);
+ g_signal_connect(e_select_names->status_message, "destroy",
+ G_CALLBACK(clear_widget), &e_select_names->status_message);
}
e_select_names->categories = glade_xml_get_widget (gui, "custom-categories");
if (e_select_names->categories && !E_IS_CATEGORIES_MASTER_LIST_OPTION_MENU (e_select_names->categories))
e_select_names->categories = NULL;
if (e_select_names->categories) {
- gtk_signal_connect(GTK_OBJECT(e_select_names->categories), "changed",
- GTK_SIGNAL_FUNC(categories_changed), e_select_names);
- gtk_signal_connect(GTK_OBJECT(e_select_names->categories), "destroy",
- GTK_SIGNAL_FUNC(clear_widget), &e_select_names->categories);
+ g_signal_connect(e_select_names->categories, "changed",
+ G_CALLBACK(categories_changed), e_select_names);
+ g_signal_connect(e_select_names->categories, "destroy",
+ G_CALLBACK(clear_widget), &e_select_names->categories);
}
e_select_names->select_entry = glade_xml_get_widget (gui, "entry-select");
if (e_select_names->select_entry && !GTK_IS_ENTRY (e_select_names->select_entry))
e_select_names->select_entry = NULL;
if (e_select_names->select_entry) {
- gtk_signal_connect(GTK_OBJECT(e_select_names->select_entry), "changed",
- GTK_SIGNAL_FUNC(select_entry_changed), e_select_names);
- gtk_signal_connect(GTK_OBJECT(e_select_names->select_entry), "activate",
- GTK_SIGNAL_FUNC(update_query), e_select_names);
- gtk_signal_connect(GTK_OBJECT(e_select_names->select_entry), "destroy",
- GTK_SIGNAL_FUNC(clear_widget), &e_select_names->select_entry);
+ g_signal_connect(e_select_names->select_entry, "changed",
+ G_CALLBACK(select_entry_changed), e_select_names);
+ g_signal_connect(e_select_names->select_entry, "activate",
+ G_CALLBACK(update_query), e_select_names);
+ g_signal_connect(e_select_names->select_entry, "destroy",
+ G_CALLBACK(clear_widget), &e_select_names->select_entry);
}
button = glade_xml_get_widget (gui, "button-find");
if (button && GTK_IS_BUTTON (button))
- gtk_signal_connect(GTK_OBJECT(button), "clicked",
- GTK_SIGNAL_FUNC(update_query), e_select_names);
+ g_signal_connect(button, "clicked",
+ G_CALLBACK(update_query), e_select_names);
- contacts_uri = bonobo_config_get_string_with_default (db, "/Addressbook/select_names_uri",
- NULL, NULL);
+ contacts_uri = e_config_listener_get_string_with_default (db, "/Addressbook/select_names_uri", NULL, NULL);
if (!contacts_uri) {
- contacts_uri = bonobo_config_get_string_with_default (db, "/DefaultFolders/contacts_uri",
- NULL,
- NULL);
+ contacts_uri = e_config_listener_get_string_with_default (db, "/DefaultFolders/contacts_uri",
+ NULL, NULL);
}
if (!contacts_uri) {
filename = gnome_util_prepend_user_home("evolution/local/Contacts");
@@ -565,13 +563,13 @@ e_select_names_init (ESelectNames *e_select_names)
contacts_uri,
selector_types);
if (button && EVOLUTION_IS_FOLDER_SELECTOR_BUTTON (button))
- gtk_signal_connect(GTK_OBJECT(button), "selected",
- GTK_SIGNAL_FUNC(folder_selected), e_select_names);
+ g_signal_connect(button, "selected",
+ G_CALLBACK(folder_selected), e_select_names);
- gtk_signal_connect (GTK_OBJECT (e_table_scrolled_get_table (e_select_names->table)), "double_click",
- GTK_SIGNAL_FUNC (add_address), e_select_names);
- gtk_signal_connect (GTK_OBJECT (e_table_scrolled_get_table (e_select_names->table)), "selection_change",
- GTK_SIGNAL_FUNC (selection_change), e_select_names);
+ g_signal_connect (e_table_scrolled_get_table (e_select_names->table), "double_click",
+ G_CALLBACK (add_address), e_select_names);
+ g_signal_connect (e_table_scrolled_get_table (e_select_names->table), "selection_change",
+ G_CALLBACK (selection_change), e_select_names);
selection_change (e_table_scrolled_get_table (e_select_names->table), e_select_names);
addressbook_model_set_uri(e_select_names, e_select_names->model, contacts_uri);
@@ -581,10 +579,10 @@ e_select_names_init (ESelectNames *e_select_names)
static void e_select_names_child_free(char *key, ESelectNamesChild *child, ESelectNames *e_select_names)
{
- gtk_signal_disconnect_by_func (GTK_OBJECT (child->source), GTK_SIGNAL_FUNC (sync_table_and_models), e_select_names);
+ gtk_signal_disconnect_by_func (GTK_OBJECT (child->source), G_CALLBACK (sync_table_and_models), e_select_names);
g_free(child->title);
- gtk_object_unref(GTK_OBJECT(child->text_model));
- gtk_object_unref(GTK_OBJECT(child->source));
+ g_object_unref(child->text_model);
+ g_object_unref(child->source);
g_free(key);
g_free(child);
}
@@ -594,12 +592,12 @@ e_select_names_destroy (GtkObject *object)
{
ESelectNames *e_select_names = E_SELECT_NAMES(object);
- gtk_object_unref(GTK_OBJECT(e_select_names->gui));
+ g_object_unref(e_select_names->gui);
g_hash_table_foreach(e_select_names->children, (GHFunc) e_select_names_child_free, e_select_names);
g_hash_table_destroy(e_select_names->children);
- gtk_object_unref(GTK_OBJECT(e_select_names->without));
- gtk_object_unref(GTK_OBJECT(e_select_names->adapter));
- gtk_object_unref(GTK_OBJECT(e_select_names->model));
+ g_object_unref(e_select_names->without);
+ g_object_unref(e_select_names->adapter);
+ g_object_unref(e_select_names->model);
g_free(e_select_names->def);
@@ -696,7 +694,7 @@ static void
section_right_click_cb (EText *text, GdkEventButton *ev, gint pos, ESelectNamesChild *child)
{
EPopupMenu right_click_menu[] = {
- E_POPUP_ITEM (N_("Remove"), GTK_SIGNAL_FUNC (remove_cb), 0),
+ E_POPUP_ITEM (N_("Remove"), G_CALLBACK (remove_cb), 0),
E_POPUP_TERMINATOR
};
gint index;
@@ -741,7 +739,7 @@ e_select_names_add_section(ESelectNames *e_select_names, char *name, char *id, E
e_select_names_text_model_set_separator (child->text_model, "\n");
child->source = source;
- gtk_object_ref(GTK_OBJECT(child->source));
+ g_object_ref(child->source);
e_select_names->child_count++;
@@ -772,8 +770,8 @@ e_select_names_add_section(ESelectNames *e_select_names, char *name, char *id, E
gtk_container_add(GTK_CONTAINER(alignment), button);
gtk_widget_show_all(alignment);
- gtk_signal_connect(GTK_OBJECT(button), "clicked",
- GTK_SIGNAL_FUNC(button_clicked), child);
+ g_signal_connect(button, "clicked",
+ G_CALLBACK(button_clicked), child);
gtk_table_attach(table, alignment,
0, 1,
e_select_names->child_count,
@@ -792,24 +790,24 @@ e_select_names_add_section(ESelectNames *e_select_names, char *name, char *id, E
"allow_newlines", TRUE,
NULL);
- gtk_signal_connect (GTK_OBJECT (recipient_table),
+ g_signal_connect (recipient_table,
"popup",
- GTK_SIGNAL_FUNC (section_right_click_cb),
+ G_CALLBACK (section_right_click_cb),
child);
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw), recipient_table);
#if 0
- gtk_signal_connect(GTK_OBJECT(e_table_scrolled_get_table(E_TABLE_SCROLLED(etable))), "right_click",
- GTK_SIGNAL_FUNC(section_right_click_cb), child);
- gtk_signal_connect(GTK_OBJECT(e_table_scrolled_get_table(E_TABLE_SCROLLED(etable))), "double_click",
- GTK_SIGNAL_FUNC(remove_address), child);
+ g_signal_connect(e_table_scrolled_get_table(E_TABLE_SCROLLED(etable)), "right_click",
+ G_CALLBACK(section_right_click_cb), child);
+ g_signal_connect(e_table_scrolled_get_table(E_TABLE_SCROLLED(etable)), "double_click",
+ G_CALLBACK(remove_address), child);
#endif
- gtk_signal_connect (GTK_OBJECT (child->source),
+ g_signal_connect (child->source,
"changed",
- GTK_SIGNAL_FUNC (sync_table_and_models),
+ G_CALLBACK (sync_table_and_models),
e_select_names);
gtk_widget_show_all (sw);
@@ -829,14 +827,14 @@ e_select_names_add_section(ESelectNames *e_select_names, char *name, char *id, E
static void *
card_copy(const void *value, void *closure)
{
- gtk_object_ref(GTK_OBJECT(value));
+ g_object_ref((gpointer)value);
return (void *)value;
}
static void
card_free(void *value, void *closure)
{
- gtk_object_unref(GTK_OBJECT(value));
+ g_object_unref((gpointer)value);
}
EList *
@@ -856,7 +854,7 @@ e_select_names_get_section(ESelectNames *e_select_names, char *id)
for (i = 0; i < rows; i++) {
ECard *card = e_select_names_model_get_card (child->source, i);
e_list_append(list, card);
- gtk_object_unref(GTK_OBJECT(card));
+ g_object_unref(card);
}
return list;
}
@@ -868,7 +866,7 @@ e_select_names_get_source(ESelectNames *e_select_names,
ESelectNamesChild *child = g_hash_table_lookup(e_select_names->children, id);
if (child) {
if (child->source)
- gtk_object_ref(GTK_OBJECT(child->source));
+ g_object_ref(child->source);
return child->source;
} else
return NULL;
diff --git a/addressbook/gui/component/select-names/e-select-names.h b/addressbook/gui/component/select-names/e-select-names.h
index ed9da9e115..154dfb67c3 100644
--- a/addressbook/gui/component/select-names/e-select-names.h
+++ b/addressbook/gui/component/select-names/e-select-names.h
@@ -22,7 +22,6 @@
#include <glib.h>
#include <gtk/gtkwidget.h>
-#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-util.h>
#include <libgnomeui/gnome-dialog.h>
#include <glade/glade.h>
diff --git a/addressbook/gui/component/select-names/e-simple-card-bonobo.c b/addressbook/gui/component/select-names/e-simple-card-bonobo.c
index 9834eddd83..f61c6d1866 100644
--- a/addressbook/gui/component/select-names/e-simple-card-bonobo.c
+++ b/addressbook/gui/component/select-names/e-simple-card-bonobo.c
@@ -33,7 +33,7 @@
#include "Evolution-Addressbook-SelectNames.h"
-#define PARENT_TYPE bonobo_object_get_type ()
+#define PARENT_TYPE BONOBO_TYPE_OBJECT
static BonoboObjectClass *parent_class = NULL;
struct _ESimpleCardBonoboPrivate {
@@ -41,45 +41,17 @@ struct _ESimpleCardBonoboPrivate {
};
-/* CORBA interface implementation. */
-
-static POA_GNOME_Evolution_Addressbook_SimpleCard__vepv SimpleCard_vepv;
-
-static POA_GNOME_Evolution_Addressbook_SimpleCard *
-create_servant (void)
-{
- POA_GNOME_Evolution_Addressbook_SimpleCard *servant;
- CORBA_Environment ev;
-
- servant = (POA_GNOME_Evolution_Addressbook_SimpleCard *) g_new0 (BonoboObjectServant, 1);
- servant->vepv = &SimpleCard_vepv;
-
- CORBA_exception_init (&ev);
-
- POA_GNOME_Evolution_Addressbook_SimpleCard__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 GNOME_Evolution_Addressbook_SimpleCard_Arbitrary *
impl_SimpleCard_get_arbitrary (PortableServer_Servant servant,
const CORBA_char *key,
CORBA_Environment *ev)
{
- BonoboObject *bonobo_object;
ESimpleCardBonobo *simple_card;
ESimpleCardBonoboPrivate *priv;
GNOME_Evolution_Addressbook_SimpleCard_Arbitrary *ret_val = GNOME_Evolution_Addressbook_SimpleCard_Arbitrary__alloc ();
- bonobo_object = bonobo_object_from_servant (servant);
- simple_card = E_SIMPLE_CARD_BONOBO (bonobo_object);
+ simple_card = E_SIMPLE_CARD_BONOBO (bonobo_object (servant));
priv = simple_card->priv;
if (priv->card_simple) {
@@ -103,12 +75,10 @@ impl_SimpleCard_set_arbitrary (PortableServer_Servant servant,
const CORBA_char *value,
CORBA_Environment *ev)
{
- BonoboObject *bonobo_object;
ESimpleCardBonobo *simple_card;
ESimpleCardBonoboPrivate *priv;
- bonobo_object = bonobo_object_from_servant (servant);
- simple_card = E_SIMPLE_CARD_BONOBO (bonobo_object);
+ simple_card = E_SIMPLE_CARD_BONOBO (bonobo_object (servant));
priv = simple_card->priv;
if (priv->card_simple) {
@@ -121,12 +91,10 @@ impl_SimpleCard_get (PortableServer_Servant servant,
GNOME_Evolution_Addressbook_SimpleCard_Field field,
CORBA_Environment *ev)
{
- BonoboObject *bonobo_object;
ESimpleCardBonobo *simple_card;
ESimpleCardBonoboPrivate *priv;
- bonobo_object = bonobo_object_from_servant (servant);
- simple_card = E_SIMPLE_CARD_BONOBO (bonobo_object);
+ simple_card = E_SIMPLE_CARD_BONOBO (bonobo_object (servant));
priv = simple_card->priv;
if (priv->card_simple) {
@@ -146,12 +114,11 @@ impl_SimpleCard_set (PortableServer_Servant servant,
const CORBA_char *value,
CORBA_Environment *ev)
{
- BonoboObject *bonobo_object;
+
ESimpleCardBonobo *simple_card;
ESimpleCardBonoboPrivate *priv;
- bonobo_object = bonobo_object_from_servant (servant);
- simple_card = E_SIMPLE_CARD_BONOBO (bonobo_object);
+ simple_card = E_SIMPLE_CARD_BONOBO (bonobo_object (servant));
priv = simple_card->priv;
if (priv->card_simple) {
@@ -165,7 +132,7 @@ impl_SimpleCard_set (PortableServer_Servant servant,
/* GtkObject methods. */
static void
-impl_destroy (GtkObject *object)
+impl_dispose (GObject *object)
{
ESimpleCardBonobo *simple_card;
ESimpleCardBonoboPrivate *priv;
@@ -174,7 +141,7 @@ impl_destroy (GtkObject *object)
priv = simple_card->priv;
if (priv->card_simple) {
- gtk_object_unref (GTK_OBJECT (priv->card_simple));
+ g_object_unref (priv->card_simple);
}
g_free (priv);
@@ -184,43 +151,25 @@ impl_destroy (GtkObject *object)
static void
-corba_class_init ()
+e_simple_card_bonobo_class_init (ESimpleCardBonoboClass *klass)
{
- POA_GNOME_Evolution_Addressbook_SimpleCard__vepv *vepv;
+ GObjectClass *object_class;
POA_GNOME_Evolution_Addressbook_SimpleCard__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 = G_OBJECT_CLASS (klass);
+ parent_class = g_type_class_ref (BONOBO_TYPE_OBJECT);
- epv = g_new0 (POA_GNOME_Evolution_Addressbook_SimpleCard__epv, 1);
+ object_class->dispose = impl_dispose;
+
+ epv = &klass->epv;
epv->getArbitrary = impl_SimpleCard_get_arbitrary;
epv->setArbitrary = impl_SimpleCard_set_arbitrary;
epv->get = impl_SimpleCard_get;
epv->set = impl_SimpleCard_set;
-
- vepv = &SimpleCard_vepv;
- vepv->Bonobo_Unknown_epv = bonobo_object_get_epv ();
- vepv->GNOME_Evolution_Addressbook_SimpleCard_epv = epv;
-}
-
-static void
-class_init (ESimpleCardBonoboClass *klass)
-{
- GtkObjectClass *object_class;
-
- object_class = GTK_OBJECT_CLASS (klass);
- parent_class = gtk_type_class (bonobo_object_get_type ());
-
- object_class->destroy = impl_destroy;
-
- corba_class_init ();
}
static void
-init (ESimpleCardBonobo *simple_card)
+e_simple_card_bonobo_init (ESimpleCardBonobo *simple_card)
{
ESimpleCardBonoboPrivate *priv;
@@ -234,36 +183,30 @@ init (ESimpleCardBonobo *simple_card)
void
e_simple_card_bonobo_construct (ESimpleCardBonobo *simple_card,
- GNOME_Evolution_Addressbook_SimpleCard corba_object,
ECardSimple *card_simple)
{
g_return_if_fail (simple_card != NULL);
g_return_if_fail (E_IS_SIMPLE_CARD_BONOBO (simple_card));
- bonobo_object_construct (BONOBO_OBJECT (simple_card), corba_object);
-
simple_card->priv->card_simple = card_simple;
- gtk_object_ref (GTK_OBJECT (card_simple));
+ g_object_ref (card_simple);
}
ESimpleCardBonobo *
e_simple_card_bonobo_new (ECardSimple *card_simple)
{
- POA_GNOME_Evolution_Addressbook_SimpleCard *servant;
- GNOME_Evolution_Addressbook_SimpleCard corba_object;
ESimpleCardBonobo *simple_card;
- servant = create_servant ();
- if (servant == NULL)
- return NULL;
-
- simple_card = gtk_type_new (e_simple_card_bonobo_get_type ());
+ simple_card = g_object_new (E_TYPE_SIMPLE_CARD_BONOBO, NULL);
- corba_object = bonobo_object_activate_servant (BONOBO_OBJECT (simple_card), servant);
- e_simple_card_bonobo_construct (simple_card, corba_object, card_simple);
+ e_simple_card_bonobo_construct (simple_card, card_simple);
return simple_card;
}
-E_MAKE_TYPE (e_simple_card_bonobo, "ESimpleCardBonobo", ESimpleCardBonobo, class_init, init, PARENT_TYPE)
+BONOBO_TYPE_FUNC_FULL (
+ ESimpleCardBonobo,
+ GNOME_Evolution_Addressbook_SimpleCard,
+ PARENT_TYPE,
+ e_simple_card_bonobo);
diff --git a/addressbook/gui/component/select-names/e-simple-card-bonobo.h b/addressbook/gui/component/select-names/e-simple-card-bonobo.h
index 763c54085b..93429f02f8 100644
--- a/addressbook/gui/component/select-names/e-simple-card-bonobo.h
+++ b/addressbook/gui/component/select-names/e-simple-card-bonobo.h
@@ -35,11 +35,11 @@ extern "C" {
#pragma }
#endif /* __cplusplus */
-#define E_TYPE_SIMPLE_CARD_BONOBO (e_simple_card_bonobo_get_type ())
-#define E_SIMPLE_CARD_BONOBO(obj) (GTK_CHECK_CAST ((obj), E_TYPE_SIMPLE_CARD_BONOBO, ESimpleCardBonobo))
-#define E_SIMPLE_CARD_BONOBO_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_SIMPLE_CARD_BONOBO, ESimpleCardBonoboClass))
-#define E_IS_SIMPLE_CARD_BONOBO(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_SIMPLE_CARD_BONOBO))
-#define E_IS_SIMPLE_CARD_BONOBO_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_SIMPLE_CARD_BONOBO))
+#define E_TYPE_SIMPLE_CARD_BONOBO (e_simple_card_bonobo_get_type ())
+#define E_SIMPLE_CARD_BONOBO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SIMPLE_CARD_BONOBO, ESimpleCardBonobo))
+#define E_SIMPLE_CARD_BONOBO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SIMPLE_CARD_BONOBO, ESimpleCardBonoboClass))
+#define E_IS_SIMPLE_CARD_BONOBO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SIMPLE_CARD_BONOBO))
+#define E_IS_SIMPLE_CARD_BONOBO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_SIMPLE_CARD_BONOBO))
typedef struct _ESimpleCardBonobo ESimpleCardBonobo;
@@ -54,13 +54,12 @@ struct _ESimpleCardBonobo {
struct _ESimpleCardBonoboClass {
BonoboObjectClass parent_class;
+
+ POA_GNOME_Evolution_Addressbook_SimpleCard__epv epv;
};
-GtkType e_simple_card_bonobo_get_type (void);
-void e_simple_card_bonobo_construct (ESimpleCardBonobo *simple_card,
- GNOME_Evolution_Addressbook_SimpleCard corba_object,
- ECardSimple *card_simple);
+GType e_simple_card_bonobo_get_type (void);
ESimpleCardBonobo *e_simple_card_bonobo_new (ECardSimple *card_simple);
#ifdef __cplusplus