Changeset 279
- Timestamp:
- 05/12/06 11:14:19
- Files:
-
- trunk/libtinymail-gnome-desktop/Makefile.am (modified) (2 diffs)
- trunk/libtinymail-gnome-desktop/tny-account-store.c (modified) (3 diffs)
- trunk/libtinymail-gnome-desktop/tny-account-store.h (modified) (1 diff)
- trunk/libtinymail-gnome-desktop/tny-platform-factory.c (added)
- trunk/libtinymail-gnome-desktop/tny-platform-factory.h (added)
- trunk/libtinymail/tny-shared.h (modified) (1 diff)
- trunk/libtinymailui-gtk/tny-msg-window.c (modified) (2 diffs)
- trunk/libtinymailui-gtk/tny-msg-window.h (modified) (2 diffs)
- trunk/libtinymailui/Makefile.am (modified) (2 diffs)
- trunk/libtinymailui/tny-platform-factory-iface.c (added)
- trunk/libtinymailui/tny-platform-factory-iface.h (added)
- trunk/tinymail/tny-main.c (modified) (3 diffs)
- trunk/tinymail/tny-summary-window.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libtinymail-gnome-desktop/Makefile.am
r270 r279 12 12 tny-moz-embed-stream.h \ 13 13 tny-password-dialog.h \ 14 tny-device.h 14 tny-device.h \ 15 tny-platform-factory.h 15 16 16 17 libtinymail_gnome_desktop_1_0_la_SOURCES = \ … … 21 22 tny-moz-embed-msg-view.c \ 22 23 tny-moz-embed-stream.c \ 23 tny-password-dialog.c 24 tny-password-dialog.c \ 25 tny-platform-factory.c 24 26 25 27 libtinymail_gnome_desktop_1_0_la_LIBADD = \ trunk/libtinymail-gnome-desktop/tny-account-store.c
r263 r279 485 485 **/ 486 486 TnyAccountStore* 487 tny_account_store_ get_instance(void)487 tny_account_store_new (void) 488 488 { 489 489 TnyAccountStore *self = g_object_new (TNY_TYPE_ACCOUNT_STORE, NULL); 490 TnyAccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self); 491 492 priv->device = TNY_DEVICE_IFACE (tny_device_new ()); 493 priv->session = tny_session_camel_new (TNY_ACCOUNT_STORE_IFACE (self)); 490 494 491 495 return self; … … 547 551 } 548 552 549 static TnyAccountStore *the_singleton = NULL;550 551 552 static GObject*553 tny_account_store_constructor (GType type, guint n_construct_params,554 GObjectConstructParam *construct_params)555 {556 GObject *object;557 558 /* TODO: potential problem: singleton without lock */559 560 if (G_UNLIKELY (!the_singleton))561 {562 TnyAccountStorePriv *priv;563 564 object = G_OBJECT_CLASS (parent_class)->constructor (type,565 n_construct_params, construct_params);566 567 priv = TNY_ACCOUNT_STORE_GET_PRIVATE (object);568 priv->device = TNY_DEVICE_IFACE (tny_device_new ());569 priv->session = tny_session_camel_new570 (TNY_ACCOUNT_STORE_IFACE (object));571 572 the_singleton = TNY_ACCOUNT_STORE (object);573 }574 else575 {576 object = g_object_ref (G_OBJECT (the_singleton));577 g_object_freeze_notify (G_OBJECT(the_singleton));578 }579 580 return object;581 }582 583 584 553 static void 585 554 tny_account_store_class_init (TnyAccountStoreClass *class) … … 591 560 592 561 object_class->finalize = tny_account_store_finalize; 593 object_class->constructor = tny_account_store_constructor;594 562 595 563 g_type_class_add_private (object_class, sizeof (TnyAccountStorePriv)); trunk/libtinymail-gnome-desktop/tny-account-store.h
r251 r279 49 49 50 50 GType tny_account_store_get_type (void); 51 TnyAccountStore* tny_account_store_ get_instance(void);51 TnyAccountStore* tny_account_store_new (void); 52 52 TnySessionCamel* tny_account_store_get_session (TnyAccountStore *self); 53 53 trunk/libtinymail/tny-shared.h
r250 r279 45 45 typedef struct _TnyMsgHeaderProxy TnyMsgHeaderProxy; 46 46 typedef struct _TnyMsgHeaderProxyClass TnyMsgHeaderProxyClass; 47 typedef struct _TnyPlatformFactoryIface PlatformFactoryIface; 48 typedef struct _PlatformFactoryIfaceClass PlatformFactoryIfaceClass; 47 49 typedef gchar* (*TnyGetPassFunc) (TnyAccountIface *self, const gchar *prompt); 48 50 typedef void (*TnyForgetPassFunc) (TnyAccountIface *self); trunk/libtinymailui-gtk/tny-msg-window.c
r212 r279 55 55 **/ 56 56 TnyMsgWindow* 57 tny_msg_window_new ( void)57 tny_msg_window_new (TnyMsgViewIface *msgview) 58 58 { 59 59 TnyMsgWindow *self = g_object_new (TNY_TYPE_MSG_WINDOW, NULL); 60 TnyMsgWindowPriv *priv = TNY_MSG_WINDOW_GET_PRIVATE (self); 61 62 priv->msg_view = msgview; 63 64 /* TODO: Remove old msg_view first */ 65 66 gtk_container_add (GTK_CONTAINER (self), GTK_WIDGET (priv->msg_view)); 67 gtk_widget_show (GTK_WIDGET (priv->msg_view)); 60 68 61 69 return self; … … 70 78 gtk_window_set_default_size (GTK_WINDOW (self), 640, 480); 71 79 72 priv->msg_view = TNY_MSG_VIEW_IFACE (tny_msg_view_new ());73 80 74 gtk_container_add (GTK_CONTAINER (self), GTK_WIDGET (priv->msg_view));75 76 gtk_widget_show (GTK_WIDGET (priv->msg_view));77 81 78 82 return; trunk/libtinymailui-gtk/tny-msg-window.h
r139 r279 24 24 #include <tny-shared.h> 25 25 26 #include <tny-msg-view-iface.h> 26 27 #include <tny-msg-window-iface.h> 27 28 #include <tny-msg-header-iface.h> … … 54 55 55 56 GType tny_msg_window_get_type (void); 56 TnyMsgWindow* tny_msg_window_new ( void);57 TnyMsgWindow* tny_msg_window_new (TnyMsgViewIface *msgview); 57 58 58 59 G_END_DECLS trunk/libtinymailui/Makefile.am
r104 r279 8 8 tny-summary-window-iface.h \ 9 9 tny-msg-view-iface.h \ 10 tny-msg-window-iface.h 10 tny-msg-window-iface.h \ 11 tny-platform-factory-iface.h 11 12 12 13 libtinymailui_1_0_la_SOURCES = \ … … 14 15 tny-summary-window-iface.c \ 15 16 tny-msg-view-iface.c \ 16 tny-msg-window-iface.c 17 tny-msg-window-iface.c \ 18 tny-platform-factory-iface.c 17 19 18 20 libtinymailui_1_0_la_LIBADD = \ trunk/tinymail/tny-main.c
r274 r279 22 22 #include <tny-summary-window.h> 23 23 #include <tny-summary-window-iface.h> 24 #include <tny-account-store-iface.h> 25 #include <tny-account-store.h> 26 27 #include <tny-msg-header.h> 28 #include <tny-msg-header-iface.h> 24 #include <tny-platform-factory-iface.h> 25 #include <tny-platform-factory.h> 29 26 30 27 #include <libgnomevfs/gnome-vfs.h> 31 28 #include <libgnomevfs/gnome-vfs-utils.h> 32 29 33 #include <firefox/nspr/nspr.h>34 30 35 31 … … 47 43 { 48 44 GtkWindow *window = NULL; 45 TnyPlatformFactoryIface *platfact; 49 46 50 47 gtk_init (&argc, &argv); … … 53 50 gnome_vfs_init (); 54 51 52 platfact = TNY_PLATFORM_FACTORY_IFACE 53 (tny_platform_factory_get_instance ()); 54 55 55 window = GTK_WINDOW (tny_summary_window_new ()); 56 56 57 57 gtk_widget_show (GTK_WIDGET (window)); 58 58 59 tny_summary_window_iface_set_account_store (TNY_SUMMARY_WINDOW_IFACE (window), 60 TNY_ACCOUNT_STORE_IFACE (tny_account_store_get_instance ())); 59 tny_summary_window_iface_set_account_store ( 60 TNY_SUMMARY_WINDOW_IFACE (window), 61 tny_platform_factory_iface_new_account_store (platfact)); 61 62 62 63 g_signal_connect (window, "destroy", trunk/tinymail/tny-summary-window.c
r270 r279 23 23 #include <gtk/gtk.h> 24 24 25 #include <tny-platform-factory-iface.h> 26 #include <tny-platform-factory.h> 27 25 28 #include <tny-password-dialog.h> 26 29 #include <tny-account-store-iface.h> … … 364 367 const TnyMsgHeaderIface *nheader; 365 368 369 TnyPlatformFactoryIface *platfact; 370 371 platfact = TNY_PLATFORM_FACTORY_IFACE 372 (tny_platform_factory_get_instance ()); 373 366 374 folder = tny_msg_header_iface_get_folder (TNY_MSG_HEADER_IFACE (header)); 367 375 … … 378 386 nheader = tny_msg_iface_get_header (TNY_MSG_IFACE (msg)); 379 387 380 msgwin = TNY_MSG_WINDOW_IFACE (tny_msg_window_new ()); 388 389 msgwin = TNY_MSG_WINDOW_IFACE (tny_msg_window_new ( 390 tny_platform_factory_iface_new_msg_view (platfact))); 391 381 392 tny_msg_window_iface_set_msg (msgwin, TNY_MSG_IFACE (msg)); 382 393 … … 405 416 TnySummaryWindow *self = (TnySummaryWindow *)instance; 406 417 TnySummaryWindowPriv *priv = TNY_SUMMARY_WINDOW_GET_PRIVATE (self); 418 TnyPlatformFactoryIface *platfact; 419 407 420 GtkWindow *window = GTK_WINDOW (self); 408 421 GtkWidget *mailbox_sw; … … 416 429 GtkWidget *vpaned1; 417 430 GtkWidget *vbox; 418 431 419 432 420 433 /* TODO: Persist application UI status (of the panes) */ 434 435 platfact = TNY_PLATFORM_FACTORY_IFACE 436 (tny_platform_factory_get_instance ()); 421 437 422 438 hpaned1 = gtk_hpaned_new (); … … 438 454 gtk_widget_show (vpaned1); 439 455 440 441 #ifdef GTKMOZEMBED 442 priv->msg_view = TNY_MSG_VIEW_IFACE (tny_moz_embed_msg_view_new ()); 443 #else 444 priv->msg_view = TNY_MSG_VIEW_IFACE (tny_text_buffer_msg_view_new ()); 445 #endif 456 priv->msg_view = tny_platform_factory_iface_new_msg_view (platfact); 446 457 447 458 gtk_widget_show (GTK_WIDGET (priv->msg_view));
