Changeset 876
- Timestamp:
- 09/04/06 21:36:10
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/Makefile.am (modified) (1 diff)
- trunk/configure.ac (modified) (4 diffs)
- trunk/libtinymail-camel/tny-camel-account.c (modified) (1 diff)
- trunk/libtinymail-gnome-desktop/tny-platform-factory.c (modified) (1 diff)
- trunk/libtinymail-gpe/Makefile.am (modified) (2 diffs)
- trunk/libtinymail-gpe/tny-gpe-account-store.c (moved) (moved from trunk/libtinymail-gpe/tny-account-store.c) (25 diffs)
- trunk/libtinymail-gpe/tny-gpe-account-store.h (moved) (moved from trunk/libtinymail-gpe/tny-account-store.h) (2 diffs)
- trunk/libtinymail-gpe/tny-gpe-device-priv.h (moved) (moved from trunk/libtinymail-gpe/tny-device-priv.h) (2 diffs)
- trunk/libtinymail-gpe/tny-gpe-device.c (moved) (moved from trunk/libtinymail-gpe/tny-device.c) (15 diffs)
- trunk/libtinymail-gpe/tny-gpe-device.h (moved) (moved from trunk/libtinymail-gpe/tny-device.h) (2 diffs)
- trunk/libtinymail-gpe/tny-gpe-password-dialog.c (moved) (moved from trunk/libtinymail-gpe/tny-password-dialog.c) (9 diffs)
- trunk/libtinymail-gpe/tny-gpe-password-dialog.h (moved) (moved from trunk/libtinymail-gpe/tny-password-dialog.h) (2 diffs)
- trunk/libtinymail-gpe/tny-gpe-platform-factory.c (moved) (moved from trunk/libtinymail-gpe/tny-platform-factory.c) (11 diffs)
- trunk/libtinymail-gpe/tny-gpe-platform-factory.h (moved) (moved from trunk/libtinymail-gpe/tny-platform-factory.h) (2 diffs)
- trunk/libtinymail-maemo/tny-platform-factory.c (modified) (1 diff)
- trunk/libtinymail-olpc/tny-platform-factory.c (modified) (1 diff)
- trunk/libtinymail-test/tny-account-store-iface-test.c (modified) (2 diffs)
- trunk/libtinymail-test/tny-device-iface-test.c (modified) (1 diff)
- trunk/tests/shared/account-store.c (modified) (1 diff)
- trunk/tinymail/Makefile.am (modified) (1 diff)
- trunk/tinymail/tny-main.c (modified) (2 diffs)
- trunk/tinymail/tny-summary-view.c (modified) (4 diffs)
- trunk/tinymail/tny-summary-view.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r875 r876 1 2006-09004 Philip Van Hoof <pvanhoof@gnome.org> 1 2006-09-04 Philip Van Hoof <pvanhoof@gnome.org> 2 3 * Renamed the GPE types in libtinymail-gpe 4 * Made compilation of the demo-ui optional 5 * Added some ifdefs to the demo-ui 6 7 * This was a major API change in libtinymail-gpe 8 9 2006-09-04 Philip Van Hoof <pvanhoof@gnome.org> 2 10 3 11 * Renamed TnyDevice of libtestshared to TnyTestDevice trunk/Makefile.am
r802 r876 14 14 endif 15 15 16 SUBDIRS += $(PLATFORMDIR) libtinymail-camel tinymail docs bindings po tests 16 SUBDIRS += $(PLATFORMDIR) libtinymail-camel 17 18 if BUILD_DEMOUI 19 SUBDIRS += tinymail 20 endif 21 22 SUBDIRS += docs bindings po tests 17 23 18 24 if BUILD_UNITTESTS trunk/configure.ac
r820 r876 53 53 dnl ### default values (will get overwritten) 54 54 build_gnome=true 55 build_demoui=true 55 56 build_mozembed=true 56 57 build_gtkhtml=false … … 62 63 [ --with-platform=gnome-desktop platform to compile [gnome-desktop]], 63 64 [case "${with_platform}" in 64 gnome-desktop) PLATFORMDIR=libtinymail-gnome-desktop ;; 65 gnome-desktop) 66 PLATFORMDIR=libtinymail-gnome-desktop 67 build_demoui=true 68 PLATFORM="gnome" 69 ;; 65 70 olpc) 66 71 PLATFORMDIR=libtinymail-olpc … … 69 74 build_gnome=false 70 75 with_html_component=none 76 build_demoui=true 77 PLATFORM="olpc" 71 78 ;; 72 79 maemo) … … 76 83 build_gnome=false 77 84 with_html_component=none 85 build_demoui=true 86 PLATFORM="maemo" 78 87 ;; 79 gpe) PLATFORMDIR=libtinymail-gpe ;; 80 *) PLATFORMDIR=${with_platform} 88 gpe) 89 PLATFORMDIR=libtinymail-gpe 90 build_demoui=true 91 PLATFORM="gpe" 92 ;; 93 *) 94 PLATFORMDIR=${with_platform} 95 build_demoui=false 96 PLATFORM="unknown" 81 97 esac], [PLATFORMDIR=libtinymail-gnome-desktop 82 98 with_platform=gnome-desktop]) 99 83 100 AC_SUBST(PLATFORMDIR) 84 101 AC_SUBST(PLATFORM) 102 103 dnl ### Enable demoui ## 104 AC_ARG_ENABLE(demoui, 105 [ --enable-demoui build the demo user interface [default=$build_demoui]], 106 [case "${enableval}" in 107 yes) build_demoui=true ;; 108 no) build_demoui=false ;; 109 *) AC_MSG_ERROR(bad value ${enableval} for --enable-demoui) ;; 110 esac],[build_demoui=$build_demoui]) 111 AM_CONDITIONAL(BUILD_DEMOUI, test x$build_demoui = xtrue) 85 112 86 113 dnl ### Enable gnome features ## trunk/libtinymail-camel/tny-camel-account.c
r843 r876 27 27 #include <tny-session-camel.h> 28 28 #include <tny-account-store-iface.h> 29 #include <tny-account-store.h>30 29 #include <tny-folder-iface.h> 31 30 #include <tny-camel-folder.h> trunk/libtinymail-gnome-desktop/tny-platform-factory.c
r865 r876 63 63 { 64 64 TnySaveStrategyIface *save_strategy = tny_gtk_save_strategy_new (); 65 TnyMsgViewIface *retval; 66 67 #ifdef MOZEMBED 68 retval = tny_moz_embed_msg_view_new (save_strategy); 69 #else 70 retval = tny_gtk_msg_view_new (save_strategy); 71 #endif 65 72 66 #ifdef MOZEMBED 67 return tny_moz_embed_msg_view_new (save_strategy); 68 #else 69 return tny_gtk_msg_view_new (save_strategy); 70 #endif 73 g_object_unref (G_OBJECT (save_strategy)); 74 75 return retval; 71 76 } 72 77 trunk/libtinymail-gpe/Makefile.am
r848 r876 11 11 lib_LTLIBRARIES = libtinymail-gpe-1.0.la 12 12 13 libtinymail_gpe_1_0_headers = \14 tny- account-store.h\15 tny- password-dialog.h\16 tny- device.h\17 tny- platform-factory.h13 libtinymail_gpe_1_0_headers = \ 14 tny-gpe-account-store.h \ 15 tny-gpe-password-dialog.h \ 16 tny-gpe-device.h \ 17 tny-gpe-platform-factory.h 18 18 19 libtinymail_gpe_1_0_la_SOURCES = \20 $(libtinymail_gpe_1_0_headers) \21 tny- account-store.c\22 tny- device-priv.h\23 tny- device.c\24 tny- password-dialog.c\25 tny- platform-factory.c19 libtinymail_gpe_1_0_la_SOURCES = \ 20 $(libtinymail_gpe_1_0_headers) \ 21 tny-gpe-account-store.c \ 22 tny-gpe-device-priv.h \ 23 tny-gpe-device.c \ 24 tny-gpe-password-dialog.c \ 25 tny-gpe-platform-factory.c 26 26 27 libtinymail_gpe_1_0_la_LIBADD = \27 libtinymail_gpe_1_0_la_LIBADD = \ 28 28 $(LIBTINYMAIL_GPE_LIBS) \ 29 $(top_builddir)/libtinymail/libtinymail-$(API_VERSION).la \29 $(top_builddir)/libtinymail/libtinymail-$(API_VERSION).la \ 30 30 $(top_builddir)/libtinymailui/libtinymailui-$(API_VERSION).la \ 31 31 $(top_builddir)/libtinymailui-gtk/libtinymailui-gtk-$(API_VERSION).la … … 45 45 46 46 DISTCLEANFILES = $(pkgconfig_DATA) 47 trunk/libtinymail-gpe/tny-gpe-account-store.c
r858 r876 29 29 30 30 #include <tny-platform-factory-iface.h> 31 #include <tny- platform-factory.h>31 #include <tny-gpe-platform-factory.h> 32 32 #include <tny-account-store-iface.h> 33 #include <tny- account-store.h>34 #include <tny- password-dialog.h>33 #include <tny-gpe-account-store.h> 34 #include <tny-gpe-password-dialog.h> 35 35 36 36 #include <tny-account-iface.h> … … 43 43 #include <tny-camel-transport-account.h> 44 44 #include <tny-session-camel.h> 45 #include <tny- device.h>45 #include <tny-gpe-device.h> 46 46 47 47 … … 50 50 static GObjectClass *parent_class = NULL; 51 51 52 typedef struct _Tny AccountStorePriv TnyAccountStorePriv;53 54 struct _Tny AccountStorePriv52 typedef struct _TnyGpeAccountStorePriv TnyGpeAccountStorePriv; 53 54 struct _TnyGpeAccountStorePriv 55 55 { 56 56 GConfClient *client; … … 61 61 }; 62 62 63 #define TNY_ ACCOUNT_STORE_GET_PRIVATE(o) \64 (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_ ACCOUNT_STORE, TnyAccountStorePriv))63 #define TNY_GPE_ACCOUNT_STORE_GET_PRIVATE(o) \ 64 (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_GPE_ACCOUNT_STORE, TnyGpeAccountStorePriv)) 65 65 66 66 … … 80 80 if (G_UNLIKELY (!retval)) 81 81 { 82 GtkDialog *dialog = GTK_DIALOG (tny_password_dialog_new ());82 GtkDialog *dialog = tny_gpe_password_dialog_new (); 83 83 84 tny_ password_dialog_set_prompt (TNY_PASSWORD_DIALOG (dialog), prompt);84 tny_gpe_password_dialog_set_prompt (TNY_GPE_PASSWORD_DIALOG (dialog), prompt); 85 85 86 86 if (G_LIKELY (gtk_dialog_run (dialog) == GTK_RESPONSE_OK)) 87 87 { 88 const gchar *pwd = tny_ password_dialog_get_password89 (TNY_ PASSWORD_DIALOG (dialog));88 const gchar *pwd = tny_gpe_password_dialog_get_password 89 (TNY_GPE_PASSWORD_DIALOG (dialog)); 90 90 91 91 retval = g_strdup (pwd); … … 138 138 139 139 static gboolean 140 tny_ account_store_alert (TnyAccountStoreIface *self, TnyAlertType type, const gchar *prompt)140 tny_gpe_account_store_alert (TnyAccountStoreIface *self, TnyAlertType type, const gchar *prompt) 141 141 { 142 142 GtkMessageType gtktype; … … 174 174 { 175 175 TnyAccountStoreIface *self = user_data; 176 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);176 TnyGpeAccountStorePriv *priv = TNY_GPE_ACCOUNT_STORE_GET_PRIVATE (self); 177 177 178 178 … … 194 194 195 195 static const gchar* 196 tny_ account_store_get_cache_dir (TnyAccountStoreIface *self)197 { 198 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);196 tny_gpe_account_store_get_cache_dir (TnyAccountStoreIface *self) 197 { 198 TnyGpeAccountStorePriv *priv = TNY_GPE_ACCOUNT_STORE_GET_PRIVATE (self); 199 199 200 200 if (G_UNLIKELY (!priv->cache_dir)) … … 225 225 226 226 static void 227 tny_ account_store_get_accounts (TnyAccountStoreIface *self, TnyListIface *list, TnyGetAccountsRequestType types)228 { 229 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);227 tny_gpe_account_store_get_accounts (TnyAccountStoreIface *self, TnyListIface *list, TnyGetAccountsRequestType types) 228 { 229 TnyGpeAccountStorePriv *priv = TNY_GPE_ACCOUNT_STORE_GET_PRIVATE (self); 230 230 gint i=0, count; 231 231 … … 377 377 378 378 static void 379 tny_ account_store_notify_add (TnyAccountStoreIface *self)380 { 381 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);379 tny_gpe_account_store_notify_add (TnyAccountStoreIface *self) 380 { 381 TnyGpeAccountStorePriv *priv = TNY_GPE_ACCOUNT_STORE_GET_PRIVATE (self); 382 382 priv->notify = gconf_client_notify_add (priv->client, 383 383 "/apps/tinymail/accounts", gconf_listener_account_changed, … … 387 387 388 388 static void 389 tny_ account_store_notify_remove (TnyAccountStoreIface *self)390 { 391 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);389 tny_gpe_account_store_notify_remove (TnyAccountStoreIface *self) 390 { 391 TnyGpeAccountStorePriv *priv = TNY_GPE_ACCOUNT_STORE_GET_PRIVATE (self); 392 392 gconf_client_notify_remove (priv->client, priv->notify); 393 393 return; … … 409 409 410 410 static void 411 tny_ account_store_add_account (TnyAccountStoreIface *self, TnyAccountIface *account, const gchar *type)412 { 413 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);411 tny_gpe_account_store_add_account (TnyAccountStoreIface *self, TnyAccountIface *account, const gchar *type) 412 { 413 TnyGpeAccountStorePriv *priv = TNY_GPE_ACCOUNT_STORE_GET_PRIVATE (self); 414 414 gchar *key = NULL; 415 415 gint count = gconf_client_get_int (priv->client, "/apps/tinymail/accounts/count", NULL); … … 445 445 446 446 static void 447 tny_ account_store_add_store_account (TnyAccountStoreIface *self, TnyStoreAccountIface *account)448 { 449 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);450 451 tny_ account_store_notify_remove (self);452 tny_ account_store_add_account (self, TNY_ACCOUNT_IFACE (account), "store");453 tny_ account_store_notify_add (self);447 tny_gpe_account_store_add_store_account (TnyAccountStoreIface *self, TnyStoreAccountIface *account) 448 { 449 TnyGpeAccountStorePriv *priv = TNY_GPE_ACCOUNT_STORE_GET_PRIVATE (self); 450 451 tny_gpe_account_store_notify_remove (self); 452 tny_gpe_account_store_add_account (self, TNY_ACCOUNT_IFACE (account), "store"); 453 tny_gpe_account_store_notify_add (self); 454 454 455 455 g_signal_emit (self, tny_account_store_iface_signals [TNY_ACCOUNT_STORE_IFACE_ACCOUNT_INSERTED], 0, account); … … 459 459 460 460 static void 461 tny_ account_store_add_transport_account (TnyAccountStoreIface *self, TnyTransportAccountIface *account)462 { 463 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);464 465 tny_ account_store_notify_remove (self);466 tny_ account_store_add_account (self, TNY_ACCOUNT_IFACE (account), "transport");467 tny_ account_store_notify_add (self);461 tny_gpe_account_store_add_transport_account (TnyAccountStoreIface *self, TnyTransportAccountIface *account) 462 { 463 TnyGpeAccountStorePriv *priv = TNY_GPE_ACCOUNT_STORE_GET_PRIVATE (self); 464 465 tny_gpe_account_store_notify_remove (self); 466 tny_gpe_account_store_add_account (self, TNY_ACCOUNT_IFACE (account), "transport"); 467 tny_gpe_account_store_notify_add (self); 468 468 469 469 g_signal_emit (self, tny_account_store_iface_signals [TNY_ACCOUNT_STORE_IFACE_ACCOUNT_INSERTED], 0, account); … … 473 473 474 474 static TnyDeviceIface* 475 tny_ account_store_get_device (TnyAccountStoreIface *self)476 { 477 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);475 tny_gpe_account_store_get_device (TnyAccountStoreIface *self) 476 { 477 TnyGpeAccountStorePriv *priv = TNY_GPE_ACCOUNT_STORE_GET_PRIVATE (self); 478 478 479 479 return priv->device; … … 481 481 482 482 /** 483 * tny_ account_store_new:483 * tny_gpe_account_store_new: 484 484 * 485 485 * 486 * Return value: A new #TnyAccountStoreIface instance 486 * Return value: A new #TnyAccountStoreIface instance implemented for GPE 487 487 **/ 488 TnyAccountStore *489 tny_ account_store_new (void)490 { 491 Tny AccountStore *self = g_object_new (TNY_TYPE_ACCOUNT_STORE, NULL);492 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);488 TnyAccountStoreIface* 489 tny_gpe_account_store_new (void) 490 { 491 TnyGpeAccountStore *self = g_object_new (TNY_TYPE_GPE_ACCOUNT_STORE, NULL); 492 TnyGpeAccountStorePriv *priv = TNY_GPE_ACCOUNT_STORE_GET_PRIVATE (self); 493 493 priv->session = tny_session_camel_new (TNY_ACCOUNT_STORE_IFACE (self)); 494 494 495 return self;496 } 497 498 499 static void 500 tny_ account_store_instance_init (GTypeInstance *instance, gpointer g_class)501 { 502 Tny AccountStore *self = (TnyAccountStore *)instance;503 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);495 return TNY_ACCOUNT_STORE_IFACE (self); 496 } 497 498 499 static void 500 tny_gpe_account_store_instance_init (GTypeInstance *instance, gpointer g_class) 501 { 502 TnyGpeAccountStore *self = (TnyGpeAccountStore *)instance; 503 TnyGpeAccountStorePriv *priv = TNY_GPE_ACCOUNT_STORE_GET_PRIVATE (self); 504 504 TnyPlatformFactoryIface *platfact; 505 505 … … 509 509 GCONF_CLIENT_PRELOAD_RECURSIVE, NULL); 510 510 511 tny_account_store_notify_add (TNY_ACCOUNT_STORE_IFACE (self)); 512 513 platfact = TNY_PLATFORM_FACTORY_IFACE ( 514 tny_platform_factory_get_instance ()); 511 tny_gpe_account_store_notify_add (TNY_ACCOUNT_STORE_IFACE (self)); 512 513 platfact = tny_gpe_platform_factory_get_instance (); 515 514 516 515 priv->device = tny_platform_factory_iface_new_device (platfact); … … 522 521 523 522 static void 524 tny_ account_store_finalize (GObject *object)525 { 526 Tny AccountStore *self = (TnyAccountStore *)object;527 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);528 529 tny_ account_store_notify_remove (TNY_ACCOUNT_STORE_IFACE (self));523 tny_gpe_account_store_finalize (GObject *object) 524 { 525 TnyGpeAccountStore *self = (TnyGpeAccountStore *)object; 526 TnyGpeAccountStorePriv *priv = TNY_GPE_ACCOUNT_STORE_GET_PRIVATE (self); 527 528 tny_gpe_account_store_notify_remove (TNY_ACCOUNT_STORE_IFACE (self)); 530 529 g_object_unref (G_OBJECT (priv->client)); 531 530 … … 540 539 541 540 /** 542 * tny_ account_store_get_session:543 * @self: The #Tny AccountStore instance541 * tny_gpe_account_store_get_session: 542 * @self: The #TnyGpeAccountStore instance 544 543 * 545 544 * Return value: A #TnySessionCamel instance 546 545 **/ 547 546 TnySessionCamel* 548 tny_ account_store_get_session (TnyAccountStore *self)549 { 550 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);547 tny_gpe_account_store_get_session (TnyGpeAccountStore *self) 548 { 549 TnyGpeAccountStorePriv *priv = TNY_GPE_ACCOUNT_STORE_GET_PRIVATE (self); 551 550 552 551 return priv->session; … … 554 553 555 554 static void 556 tny_ account_store_class_init (TnyAccountStoreClass *class)555 tny_gpe_account_store_class_init (TnyGpeAccountStoreClass *class) 557 556 { 558 557 GObjectClass *object_class; … … 561 560 object_class = (GObjectClass*) class; 562 561 563 object_class->finalize = tny_ account_store_finalize;564 565 g_type_class_add_private (object_class, sizeof (Tny AccountStorePriv));562 object_class->finalize = tny_gpe_account_store_finalize; 563 564 g_type_class_add_private (object_class, sizeof (TnyGpeAccountStorePriv)); 566 565 567 566 return; … … 573 572 TnyAccountStoreIfaceClass *klass = (TnyAccountStoreIfaceClass *)g_iface; 574 573 575 klass->get_accounts_func = tny_ account_store_get_accounts;576 klass->add_store_account_func = tny_ account_store_add_store_account;577 klass->add_transport_account_func = tny_ account_store_add_transport_account;578 klass->get_cache_dir_func = tny_ account_store_get_cache_dir;579 klass->get_device_func = tny_ account_store_get_device;580 klass->alert_func = tny_ account_store_alert;574 klass->get_accounts_func = tny_gpe_account_store_get_accounts; 575 klass->add_store_account_func = tny_gpe_account_store_add_store_account; 576 klass->add_transport_account_func = tny_gpe_account_store_add_transport_account; 577 klass->get_cache_dir_func = tny_gpe_account_store_get_cache_dir; 578 klass->get_device_func = tny_gpe_account_store_get_device; 579 klass->alert_func = tny_gpe_account_store_alert; 581 580 582 581 return; … … 585 584 586 585 GType 587 tny_ account_store_get_type (void)586 tny_gpe_account_store_get_type (void) 588 587 { 589 588 static GType type = 0; … … 593 592 static const GTypeInfo info = 594 593 { 595 sizeof (Tny AccountStoreClass),594 sizeof (TnyGpeAccountStoreClass), 596 595 NULL, /* base_init */ 597 596 NULL, /* base_finalize */ 598 (GClassInitFunc) tny_ account_store_class_init, /* class_init */597 (GClassInitFunc) tny_gpe_account_store_class_init, /* class_init */ 599 598 NULL, /* class_finalize */ 600 599 NULL, /* class_data */ 601 sizeof (Tny AccountStore),600 sizeof (TnyGpeAccountStore), 602 601 0, /* n_preallocs */ 603 tny_ account_store_instance_init /* instance_init */602 tny_gpe_account_store_instance_init /* instance_init */ 604 603 }; 605 604 … … 612 611 613 612 type = g_type_register_static (G_TYPE_OBJECT, 614 "Tny AccountStore",613 "TnyGpeAccountStore", 615 614 &info, 0); 616 615 trunk/libtinymail-gpe/tny-gpe-account-store.h
r858 r876 1 #ifndef TNY_ ACCOUNT_STORE_H2 #define TNY_ ACCOUNT_STORE_H1 #ifndef TNY_GPE_ACCOUNT_STORE_H 2 #define TNY_GPE_ACCOUNT_STORE_H 3 3 4 4 /* tinymail - Tiny Mail … … 28 28 G_BEGIN_DECLS 29 29 30 #define TNY_TYPE_ ACCOUNT_STORE (tny_account_store_get_type ())31 #define TNY_ ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TNY_TYPE_ACCOUNT_STORE, TnyAccountStore))32 #define TNY_ ACCOUNT_STORE_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), TNY_TYPE_ACCOUNT_STORE, TnyAccountStoreClass))33 #define TNY_IS_ ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TNY_TYPE_ACCOUNT_STORE))34 #define TNY_IS_ ACCOUNT_STORE_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), TNY_TYPE_ACCOUNT_STORE))35 #define TNY_ ACCOUNT_STORE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), TNY_TYPE_ACCOUNT_STORE, TnyAccountStoreClass))30 #define TNY_TYPE_GPE_ACCOUNT_STORE (tny_gpe_account_store_get_type ()) 31 #define TNY_GPE_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TNY_TYPE_GPE_ACCOUNT_STORE, TnyGpeAccountStore)) 32 #define TNY_GPE_ACCOUNT_STORE_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), TNY_TYPE_GPE_ACCOUNT_STORE, TnyGpeAccountStoreClass)) 33 #define TNY_IS_GPE_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TNY_TYPE_GPE_ACCOUNT_STORE)) 34 #define TNY_IS_GPE_ACCOUNT_STORE_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), TNY_TYPE_GPE_ACCOUNT_STORE)) 35 #define TNY_GPE_ACCOUNT_STORE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), TNY_TYPE_GPE_ACCOUNT_STORE, TnyGpeAccountStoreClass)) 36 36 37 typedef struct _Tny AccountStore TnyAccountStore;38 typedef struct _Tny AccountStoreClass TnyAccountStoreClass;37 typedef struct _TnyGpeAccountStore TnyGpeAccountStore; 38 typedef struct _TnyGpeAccountStoreClass TnyGpeAccountStoreClass; 39 39 40 struct _Tny AccountStore40 struct _TnyGpeAccountStore 41 41 { 42 42 GObject parent; 43 43 }; 44 44 45 struct _Tny AccountStoreClass45 struct _TnyGpeAccountStoreClass 46 46 { 47 47 GObjectClass parent; 48 48 }; 49 49 50 GType tny_account_store_get_type(void);51 TnyAccountStore * tny_account_store_new(void);52 TnySessionCamel* tny_account_store_get_session (TnyAccountStore *self);50 GType tny_gpe_account_store_get_type (void); 51 TnyAccountStoreIface* tny_gpe_account_store_new (void); 52 TnySessionCamel* tny_gpe_account_store_get_session (TnyGpeAccountStore *self); 53 53 54 54 G_END_DECLS trunk/libtinymail-gpe/tny-gpe-device-priv.h
r858 r876 1 #ifndef TNY_ DEVICE_PRIV_H2 #define TNY_ DEVICE_PRIV_H1 #ifndef TNY_GPE_DEVICE_PRIV_H 2 #define TNY_GPE_DEVICE_PRIV_H 3 3 4 4 /* libtinymail-camel - The Tiny Mail base library for Camel … … 21 21 */ 22 22 23 typedef struct _Tny DevicePriv TnyDevicePriv;23 typedef struct _TnyGpeDevicePriv TnyGpeDevicePriv; 24 24 25 struct _Tny DevicePriv25 struct _TnyGpeDevicePriv 26 26 { 27 gboolean forced, fset; 27 gboolean forced; 28 gboolean fset; 28 29 }; 29 30 30 31 31 #define TNY_ DEVICE_GET_PRIVATE(o) \32 (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_ DEVICE, TnyDevicePriv))32 #define TNY_GPE_DEVICE_GET_PRIVATE(o) \ 33 (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_GPE_DEVICE, TnyGpeDevicePriv)) 33 34 34 35 #endif trunk/libtinymail-gpe/tny-gpe-device.c
r858 r876 22 22 #include <glib/gi18n-lib.h> 23 23 24 #include <tny- device.h>24 #include <tny-gpe-device.h> 25 25 26 26 static GObjectClass *parent_class = NULL; 27 27 28 #include "tny- device-priv.h"28 #include "tny-gpe-device-priv.h" 29 29 30 static void tny_ device_on_online (TnyDeviceIface *self);31 static void tny_ device_on_offline (TnyDeviceIface *self);32 static gboolean tny_ device_is_online (TnyDeviceIface *self);30 static void tny_gpe_device_on_online (TnyDeviceIface *self); 31 static void tny_gpe_device_on_offline (TnyDeviceIface *self); 32 static gboolean tny_gpe_device_is_online (TnyDeviceIface *self); 33 33 34 34 35 35 static void 36 tny_ device_reset (TnyDeviceIface *self)36 tny_gpe_device_reset (TnyDeviceIface *self) 37 37 { 38 Tny DevicePriv *priv = TNY_DEVICE_GET_PRIVATE (self);38 TnyGpeDevicePriv *priv = TNY_GPE_DEVICE_GET_PRIVATE (self); 39 39 40 40 priv->fset = FALSE; … … 44 44 45 45 static void 46 tny_ device_force_online (TnyDeviceIface *self)46 tny_gpe_device_force_online (TnyDeviceIface *self) 47 47 { 48 Tny DevicePriv *priv = TNY_DEVICE_GET_PRIVATE (self);48 TnyGpeDevicePriv *priv = TNY_GPE_DEVICE_GET_PRIVATE (self); 49 49 50 50 priv->fset = TRUE; 51 51 priv->forced = TRUE; 52 52 53 tny_ device_on_online (self);53 tny_gpe_device_on_online (self); 54 54 55 55 return; … … 58 58 59 59 static void 60 tny_ device_force_offline (TnyDeviceIface *self)60 tny_gpe_device_force_offline (TnyDeviceIface *self) 61 61 { 62 Tny DevicePriv *priv = TNY_DEVICE_GET_PRIVATE (self);62 TnyGpeDevicePriv *priv = TNY_GPE_DEVICE_GET_PRIVATE (self); 63 63 64 64 priv->fset = TRUE; … … 66 66 67 67 68 tny_ device_on_offline (self);68 tny_gpe_device_on_offline (self); 69 69 70 70 return; … … 72 72 73 73 static void 74 tny_ device_on_online (TnyDeviceIface *self)74 tny_gpe_device_on_online (TnyDeviceIface *self) 75 75 { 76 76 g_signal_emit (self, tny_device_iface_signals [TNY_DEVICE_IFACE_CONNECTION_CHANGED], 0, TRUE); … … 80 80 81 81 static void 82 tny_ device_on_offline (TnyDeviceIface *self)82 tny_gpe_device_on_offline (TnyDeviceIface *self) 83 83 { 84 84 g_signal_emit (self, tny_device_iface_signals [TNY_DEVICE_IFACE_CONNECTION_CHANGED], 0, FALSE); … … 88 88 89 89 static gboolean 90 tny_ device_is_online (TnyDeviceIface *self)90 tny_gpe_device_is_online (TnyDeviceIface *self) 91 91 { 92 Tny DevicePriv *priv = TNY_DEVICE_GET_PRIVATE (self);92 TnyGpeDevicePriv *priv = TNY_GPE_DEVICE_GET_PRIVATE (self); 93 93 gboolean retval = TRUE; 94 94 return retval; … … 96 96 97 97 static void 98 tny_ device_instance_init (GTypeInstance *instance, gpointer g_class)98 tny_gpe_device_instance_init (GTypeInstance *instance, gpointer g_class) 99 99 { 100 Tny Device *self = (TnyDevice *)instance;101 Tny DevicePriv *priv = TNY_DEVICE_GET_PRIVATE (self);100 TnyGpeDevice *self = (TnyGpeDevice *)instance; 101 TnyGpeDevicePriv *priv = TNY_GPE_DEVICE_GET_PRIVATE (self); 102 102 103 103 return; … … 107 107 108 108 /** 109 * tny_ device_new:109 * tny_gpe_device_new: 110 110 * 111 111 * Return value: A new #TnyDeviceIface instance 112 112 **/ 113 TnyDevice *114 tny_ device_new (void)113 TnyDeviceIface* 114 tny_gpe_device_new (void) 115 115 { 116 Tny Device *self = g_object_new (TNY_TYPE_DEVICE, NULL);116 TnyGpeDevice *self = g_object_new (TNY_TYPE_GPE_DEVICE, NULL); 117 117 118 return self;118 return TNY_DEVICE_IFACE (self); 119 119 } 120 120 121 121 122 122 static void 123 tny_ device_finalize (GObject *object)123 tny_gpe_device_finalize (GObject *object) 124 124 { 125 TnyDevice *self = (TnyDevice *)object;126 TnyDevicePriv *priv = TNY_DEVICE_GET_PRIVATE (self);127 128 125 (*parent_class->finalize) (object); 129 126 130 127 return; 131 128 } … … 137 134 TnyDeviceIfaceClass *klass = (TnyDeviceIfaceClass *)g_iface; 138 135 139 klass->is_online_func = tny_ device_is_online;140 klass->reset_func = tny_ device_reset;141 klass->force_offline_func = tny_ device_force_offline;142 klass->force_online_func = tny_ device_force_online;136 klass->is_online_func = tny_gpe_device_is_online; 137 klass->reset_func = tny_gpe_device_reset; 138 klass->force_offline_func = tny_gpe_device_force_offline; 139 klass->force_online_func = tny_gpe_device_force_online; 143 140 144 141 return; … … 148 145 149 146 static void 150 tny_ device_class_init (TnyDeviceClass *class)147 tny_gpe_device_class_init (TnyGpeDeviceClass *class) 151 148 { 152 149 GObjectClass *object_class; … … 155 152 object_class = (GObjectClass*) class; 156 153 157 object_class->finalize = tny_ device_finalize;154 object_class->finalize = tny_gpe_device_finalize; 158 155 159 g_type_class_add_private (object_class, sizeof (Tny DevicePriv));156 g_type_class_add_private (object_class, sizeof (TnyGpeDevicePriv)); 160 157 161 158 return; … … 163 160 164 161 GType 165 tny_ device_get_type (void)162 tny_gpe_device_get_type (void) 166 163 { 167 164 static GType type = 0; … … 171 168 static const GTypeInfo info = 172 169 { 173 sizeof (Tny DeviceClass),170 sizeof (TnyGpeDeviceClass), 174 171 NULL, /* base_init */ 175 172 NULL, /* base_finalize */ 176 (GClassInitFunc) tny_ device_class_init, /* class_init */173 (GClassInitFunc) tny_gpe_device_class_init, /* class_init */ 177 174 NULL, /* class_finalize */ 178 175 NULL, /* class_data */ 179 sizeof (Tny Device),176 sizeof (TnyGpeDevice), 180 177 0, /* n_preallocs */ 181 tny_ device_instance_init /* instance_init */178 tny_gpe_device_instance_init /* instance_init */ 182 179 }; 183 180 … … 190 187 191 188 type = g_type_register_static (G_TYPE_OBJECT, 192 "Tny Device",189 "TnyGpeDevice", 193 190 &info, 0); 194 191 trunk/libtinymail-gpe/tny-gpe-device.h
r858 r876 1 #ifndef TNY_ DEVICE_H2 #define TNY_ DEVICE_H1 #ifndef TNY_GPE_DEVICE_H 2 #define TNY_GPE_DEVICE_H 3 3 4 4 /* libtinymail-camel - The Tiny Mail base library for Camel … … 28 28 G_BEGIN_DECLS 29 29 30 #define TNY_TYPE_ DEVICE (tny_device_get_type ())31 #define TNY_ DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TNY_TYPE_DEVICE, TnyDevice))32 #define TNY_ DEVICE_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), TNY_TYPE_DEVICE, TnyDeviceClass))33 #define TNY_IS_ DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TNY_TYPE_DEVICE))34 #define TNY_IS_ DEVICE_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), TNY_TYPE_DEVICE))35 #define TNY_ DEVICE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), TNY_TYPE_DEVICE, TnyDeviceClass))30 #define TNY_TYPE_GPE_DEVICE (tny_gpe_device_get_type ()) 31 #define TNY_GPE_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TNY_TYPE_GPE_DEVICE, TnyGpeDevice)) 32 #define TNY_GPE_DEVICE_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), TNY_TYPE_GPE_DEVICE, TnyGpeDeviceClass)) 33 #define TNY_IS_GPE_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TNY_TYPE_GPE_DEVICE)) 34 #define TNY_IS_GPE_DEVICE_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), TNY_TYPE_GPE_DEVICE)) 35 #define TNY_GPE_DEVICE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), TNY_TYPE_GPE_DEVICE, TnyGpeDeviceClass)) 36 36 37 37 /* This is an abstract type */ 38 38 39 typedef struct _Tny Device TnyDevice;40 typedef struct _Tny DeviceClass TnyDeviceClass;39 typedef struct _TnyGpeDevice TnyGpeDevice; 40 typedef struct _TnyGpeDeviceClass TnyGpeDeviceClass; 41 41 42 struct _Tny Device42 struct _TnyGpeDevice 43 43 { 44 44 GObject parent; 45 45 }; 46 46 47 struct _Tny DeviceClass47 struct _TnyGpeDeviceClass 48 48 { 49 49 GObjectClass parent; 50 50 }; 51 51 52 GType tny_ device_get_type (void);52 GType tny_gpe_device_get_type (void); 53 53 54 TnyDevice * tny_device_new (void);54 TnyDeviceIface* tny_gpe_device_new (void); 55 55 56 56 G_END_DECLS trunk/libtinymail-gpe/tny-gpe-password-dialog.c
r858 r876 22 22 23 23 #include <gtk/gtk.h> 24 #include <tny- password-dialog.h>24 #include <tny-gpe-password-dialog.h> 25 25 26 26 static GObjectClass *parent_class = NULL; 27 27 28 typedef struct _Tny PasswordDialogPriv TnyPasswordDialogPriv;28 typedef struct _TnyGpePasswordDialogPriv TnyGpePasswordDialogPriv; 29 29 30 struct _Tny PasswordDialogPriv30 struct _TnyGpePasswordDialogPriv 31 31 { 32 32 GtkEntry *pwd_entry; … … 34 34 }; 35 35 36 #define TNY_ PASSWORD_DIALOG_GET_PRIVATE(o) \37 (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_ PASSWORD_DIALOG, TnyPasswordDialogPriv))36 #define TNY_GPE_PASSWORD_DIALOG_GET_PRIVATE(o) \ 37 (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_GPE_PASSWORD_DIALOG, TnyGpePasswordDialogPriv)) 38 38 39 39 40 40 /** 41 * tny_ password_dialog_set_prompt:42 * @self: A #Tny PasswordDialog object41 * tny_gpe_password_dialog_set_prompt: 42 * @self: A #TnyGpePasswordDialog object 43 43 * @prompt: The prompt to set 44 44 * 45 45 **/ 46 46 void 47 tny_ password_dialog_set_prompt (TnyPasswordDialog *self, const gchar *prompt)47 tny_gpe_password_dialog_set_prompt (TnyGpePasswordDialog *self, const gchar *prompt) 48 48 { 49 Tny PasswordDialogPriv *priv = TNY_PASSWORD_DIALOG_GET_PRIVATE (self);49 TnyGpePasswordDialogPriv *priv = TNY_GPE_PASSWORD_DIALOG_GET_PRIVATE (self); 50 50 51 51 gtk_label_set_text (priv->prompt_label, prompt); … … 55 55 56 56 /** 57 * tny_ password_dialog_get_password:58 * @self: A #Tny PasswordDialog object57 * tny_gpe_password_dialog_get_password: 58 * @self: A #TnyGpePasswordDialog object 59 59 * 60 60 * Return value: The password (read-only) as typed by the user 61 61 **/ 62 62 const gchar* 63 tny_ password_dialog_get_password (TnyPasswordDialog *self)63 tny_gpe_password_dialog_get_password (TnyGpePasswordDialog *self) 64 64 { 65 Tny PasswordDialogPriv *priv = TNY_PASSWORD_DIALOG_GET_PRIVATE (self);65 TnyGpePasswordDialogPriv *priv = TNY_GPE_PASSWORD_DIALOG_GET_PRIVATE (self); 66 66 67 67 return gtk_entry_get_text (priv->pwd_entry); … … 69
