aboutsummaryrefslogtreecommitdiffstats
path: root/composer/evolution-composer.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2002-11-08 14:49:14 +0800
committerMichael Zucci <zucchi@src.gnome.org>2002-11-08 14:49:14 +0800
commit234540a383de150f0a79df466aa76dae4096d09c (patch)
treece8697e153cefd8ce95644370392c874c443b33a /composer/evolution-composer.c
parentab44fe3e1d962e7876693929c940121e2954379d (diff)
downloadgsoc2013-evolution-234540a383de150f0a79df466aa76dae4096d09c.tar.gz
gsoc2013-evolution-234540a383de150f0a79df466aa76dae4096d09c.tar.zst
gsoc2013-evolution-234540a383de150f0a79df466aa76dae4096d09c.zip
Fix bonobo object setup.
2002-11-08 Not Zed <NotZed@Ximian.com> * listener.c: Fix bonobo object setup. * e-msg-composer-hdrs.c: Remove oaf stuff, fix destroy to be multi-call safe. * e-msg-composer-attachment.c (e_msg_composer_attachment_new): Remove utf8 from locale conversions, & glib api changes. (ok_cb): " * e-msg-composer-attachment-bar.c (add_from_file): gtk message dialog. (pixbuf_for_mime_type): glib,gnome-vfs api changes. (init): Estimate the icon_height based on the pango font description size, this is probably not correct. (properties_cb): (remove_cb): Changed signature for gnomeui callbacks. (popup_icon_context_menu): (popup_context_menu): popup_menu api change (destroy): Protect from multiple calls. (e_msg_composer_attachment_bar_new): Remove push/pop visual/colormap stuff. * composer-marshal.list: The list of marshallers used by the composer. * Makefile.am (composer-marshal.h): Added composer marshal builder. * evolution-composer.c (class_init): bonobo object epv setup change. (factory_fn): Fix changes to factory callback. * e-icon-list.c: (icon_get_height): Use bounding box to calc height. (icon_event): drop gtk_selection_extended. (e_icon_list_remove): " (select_icon): (unselect_icon): " * e-msg-composer.c (autosave_save_draft): Dup fd rather than poke camel_stream_fd's data. Also, use camel_stream_close() rather than flush. (autosave_manager_query_load_orphans): Port to gtk dialog. (autosave_query_cb): Removed, redundant. (save): Port to gtkdialog. (prepare_engine): Fix bonobo-object-client code. (get_file_content): gtk dialog (do_exit): gtk dialog. (setup_signatures_menu): dump gtkutf8 stuff. (marshal_NONE__NONE_INT): What WAS jeff thinking? Removed :) (class_init): g object setup. (e_msg_composer_get_type): " (create_composer): remove bonobo_window_construct, use create property instead. g_signal stuff. bonobo stuff. (is_special_header): Use ascii_strncasecmp (e_msg_composer_set_pending_body): gtk->g_object_get/set_data. (e_msg_composer_set_body): use ascii_strncasecmp (e_msg_composer_add_inline_image_from_mime_part): make cid const. (autosave_manager_register): (autosave_manager_unregister): Use g_path_get_basename() & account for differences. (composer_shutdown): rename to finalise/etc. (class_init): Use object:finalize instead of shutdown. (e_msg_composer_set_body): Use _() rather than U_(). (build_message): gtk dialog. 2002-11-06 Not Zed <NotZed@Ximian.com> * e-msg-composer-attachment-bar.c (pixbuf_for_mime_type): Add error return to gdk_pixbuf_new_from_file(). svn path=/trunk/; revision=18659
Diffstat (limited to 'composer/evolution-composer.c')
-rw-r--r--composer/evolution-composer.c50
1 files changed, 32 insertions, 18 deletions
diff --git a/composer/evolution-composer.c b/composer/evolution-composer.c
index a8d8f154a5..cf435665a6 100644
--- a/composer/evolution-composer.c
+++ b/composer/evolution-composer.c
@@ -172,7 +172,7 @@ impl_Composer_attach_MIME (PortableServer_Servant servant,
attachment = camel_mime_part_new ();
status = camel_data_wrapper_construct_from_stream (
CAMEL_DATA_WRAPPER (attachment), mem_stream);
- camel_object_unref (CAMEL_OBJECT (mem_stream));
+ camel_object_unref (mem_stream);
if (status == -1) {
CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
@@ -213,7 +213,7 @@ impl_Composer_attach_data (PortableServer_Servant servant,
"inline" : "attachment");
e_msg_composer_attach (composer->composer, attachment);
- camel_object_unref (CAMEL_OBJECT (attachment));
+ camel_object_unref (attachment);
}
static void
@@ -267,38 +267,49 @@ destroy (GtkObject *object)
{
EvolutionComposer *composer = EVOLUTION_COMPOSER (object);
- if (composer->composer)
- gtk_object_unref (GTK_OBJECT (composer->composer));
+ if (composer->composer) {
+ g_object_unref((composer->composer));
+ composer->composer = NULL;
+ }
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
static void
-class_init (EvolutionComposerClass *klass)
+evolution_composer_class_init (EvolutionComposerClass *klass)
{
GtkObjectClass *object_class;
+ POA_GNOME_Evolution_Composer__epv *epv;
object_class = GTK_OBJECT_CLASS (klass);
object_class->destroy = destroy;
- parent_class = gtk_type_class (bonobo_object_get_type ());
+ parent_class = g_type_class_ref(bonobo_object_get_type ());
+
+ epv = &klass->epv;
- Composer_vepv.Bonobo_Unknown_epv = bonobo_object_get_epv ();
- Composer_vepv.GNOME_Evolution_Composer_epv = evolution_composer_get_epv ();
+ epv->setHeaders = impl_Composer_set_headers;
+ epv->setMultipartType = impl_Composer_set_multipart_type;
+ epv->setBody = impl_Composer_set_body;
+ epv->attachMIME = impl_Composer_attach_MIME;
+ epv->attachData = impl_Composer_attach_data;
+ epv->show = impl_Composer_show;
+ epv->send = impl_Composer_send;
}
static void
-init (EvolutionComposer *composer)
+evolution_composer_init (EvolutionComposer *composer)
{
const MailConfigAccount *account;
+ BonoboObject *item_handler;
account = mail_config_get_default_account ();
composer->composer = e_msg_composer_new ();
- gtk_signal_connect (GTK_OBJECT (composer->composer), "send",
- GTK_SIGNAL_FUNC (send_cb), NULL);
- gtk_signal_connect (GTK_OBJECT (composer->composer), "save-draft",
- GTK_SIGNAL_FUNC (save_draft_cb), NULL);
+ g_signal_connect (composer->composer, "send",
+ G_CALLBACK (send_cb), NULL);
+ g_signal_connect (composer->composer, "save-draft",
+ G_CALLBACK (save_draft_cb), NULL);
}
#if 0
@@ -345,7 +356,7 @@ evolution_composer_construct (EvolutionComposer *composer,
g_return_if_fail (EVOLUTION_IS_COMPOSER (composer));
g_return_if_fail (corba_object != CORBA_OBJECT_NIL);
- bonobo_object_construct (BONOBO_OBJECT (composer), corba_object);
+ /*bonobo_object_construct (BONOBO_OBJECT (composer), corba_object);*/
item_handler = BONOBO_OBJECT (
bonobo_item_handler_new (NULL, get_object, composer));
@@ -356,10 +367,11 @@ EvolutionComposer *
evolution_composer_new (void)
{
EvolutionComposer *new;
+#if 0
POA_GNOME_Evolution_Composer *servant;
CORBA_Environment ev;
GNOME_Evolution_Composer corba_object;
-
+
servant = (POA_GNOME_Evolution_Composer *) g_new0 (BonoboObjectServant, 1);
servant->vepv = &Composer_vepv;
@@ -375,18 +387,20 @@ evolution_composer_new (void)
new = gtk_type_new (evolution_composer_get_type ());
corba_object = bonobo_object_activate_servant (BONOBO_OBJECT (new),
servant);
- evolution_composer_construct (new, corba_object);
+#endif
+ new = g_object_new(EVOLUTION_TYPE_COMPOSER, NULL);
+ evolution_composer_construct (new, NULL);
return new;
}
-E_MAKE_TYPE (evolution_composer, "EvolutionComposer", EvolutionComposer, class_init, init, PARENT_TYPE)
+BONOBO_TYPE_FUNC_FULL(EvolutionComposer, GNOME_Evolution_Composer, BONOBO_TYPE_OBJECT, evolution_composer)
#define GNOME_EVOLUTION_MAIL_COMPOSER_FACTORY_ID "OAFIID:GNOME_Evolution_Mail_ComposerFactory"
static BonoboObject *
-factory_fn (BonoboGenericFactory *factory, void *closure)
+factory_fn (BonoboGenericFactory *factory, const char *id, void *closure)
{
if (!mail_config_is_configured ()) {
e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,