Changeset 879
- Timestamp:
- 09/04/06 23:06:44
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/configure.ac (modified) (1 diff)
- trunk/libtinymail-gnome-desktop/Makefile.am (modified) (1 diff)
- trunk/libtinymail-gnome-desktop/tny-gnome-account-store.c (moved) (moved from trunk/libtinymail-gnome-desktop/tny-account-store.c) (25 diffs)
- trunk/libtinymail-gnome-desktop/tny-gnome-account-store.h (moved) (moved from trunk/libtinymail-gnome-desktop/tny-account-store.h) (2 diffs)
- trunk/libtinymail-gnome-desktop/tny-gnome-device-priv.h (moved) (moved from trunk/libtinymail-gnome-desktop/tny-device-priv.h) (3 diffs)
- trunk/libtinymail-gnome-desktop/tny-gnome-device.c (moved) (moved from trunk/libtinymail-gnome-desktop/tny-device.c) (15 diffs)
- trunk/libtinymail-gnome-desktop/tny-gnome-device.h (moved) (moved from trunk/libtinymail-gnome-desktop/tny-device.h) (2 diffs)
- trunk/libtinymail-gnome-desktop/tny-gnome-password-dialog.c (moved) (moved from trunk/libtinymail-gnome-desktop/tny-password-dialog.c) (9 diffs)
- trunk/libtinymail-gnome-desktop/tny-gnome-password-dialog.h (moved) (moved from trunk/libtinymail-gnome-desktop/tny-password-dialog.h) (2 diffs)
- trunk/libtinymail-gnome-desktop/tny-gnome-platform-factory.c (moved) (moved from trunk/libtinymail-gnome-desktop/tny-platform-factory.c) (13 diffs)
- trunk/libtinymail-gnome-desktop/tny-gnome-platform-factory.h (moved) (moved from trunk/libtinymail-gnome-desktop/tny-platform-factory.h) (2 diffs)
- trunk/tinymail/tny-summary-view.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r878 r879 4 4 * Renamed the Maemo types in libtinymail-maemo 5 5 * Renamed the OLPC types in libtinymail-olpc 6 * Renamed the GNOME types in libtinymail-gnome-desktop 6 7 7 8 * Made compilation of the demo-ui optional trunk/configure.ac
r878 r879 58 58 build_doxygen=false 59 59 PLATFORMDIR=libtinymail-gnome-desktop 60 PLATFORM=1 60 61 61 62 dnl ### Select the platform library ## trunk/libtinymail-gnome-desktop/Makefile.am
r792 r879 18 18 lib_LTLIBRARIES = libtinymail-gnome-desktop-1.0.la 19 19 20 libtinymail_gnome_desktop_1_0_headers = \21 tny- account-store.h\22 tny- password-dialog.h\23 tny- device.h\24 tny- platform-factory.h20 libtinymail_gnome_desktop_1_0_headers = \ 21 tny-gnome-account-store.h \ 22 tny-gnome-password-dialog.h \ 23 tny-gnome-device.h \ 24 tny-gnome-platform-factory.h 25 25 26 libtinymail_gnome_desktop_1_0_la_SOURCES = \26 libtinymail_gnome_desktop_1_0_la_SOURCES = \ 27 27 $(libtinymail_gnome_desktop_1_0_headers) \ 28 tny- account-store.c\29 tny- device-priv.h\30 tny- device.c\31 tny- password-dialog.c\32 tny- platform-factory.c28 tny-gnome-account-store.c \ 29 tny-gnome-device-priv.h \ 30 tny-gnome-device.c \ 31 tny-gnome-password-dialog.c \ 32 tny-gnome-platform-factory.c 33 33 34 34 libtinymail_gnome_desktop_1_0_la_LIBADD = \ trunk/libtinymail-gnome-desktop/tny-gnome-account-store.c
r876 r879 29 29 30 30 #include <tny-platform-factory-iface.h> 31 #include <tny- platform-factory.h>31 #include <tny-gnome-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-gnome-account-store.h> 34 #include <tny-gnome-password-dialog.h> 35 35 #include <tny-account-iface.h> 36 36 #include <tny-store-account-iface.h> … … 44 44 #include <tny-camel-pop-store-account.h> 45 45 #include <tny-camel-transport-account.h> 46 #include <tny- device.h>46 #include <tny-gnome-device.h> 47 47 #include <tny-session-camel.h> 48 48 … … 56 56 static GObjectClass *parent_class = NULL; 57 57 58 typedef struct _Tny AccountStorePriv TnyAccountStorePriv;59 60 struct _Tny AccountStorePriv58 typedef struct _TnyGnomeAccountStorePriv TnyGnomeAccountStorePriv; 59 60 struct _TnyGnomeAccountStorePriv 61 61 { 62 62 GConfClient *client; … … 67 67 }; 68 68 69 #define TNY_ ACCOUNT_STORE_GET_PRIVATE(o) \70 (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_ ACCOUNT_STORE, TnyAccountStorePriv))69 #define TNY_GNOME_ACCOUNT_STORE_GET_PRIVATE(o) \ 70 (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_GNOME_ACCOUNT_STORE, TnyGnomeAccountStorePriv)) 71 71 72 72 … … 195 195 if (G_UNLIKELY (!retval)) 196 196 { 197 GtkDialog *dialog = GTK_DIALOG (tny_ password_dialog_new ());197 GtkDialog *dialog = GTK_DIALOG (tny_gnome_password_dialog_new ()); 198 198 199 tny_ password_dialog_set_prompt (TNY_PASSWORD_DIALOG (dialog), prompt);199 tny_gnome_password_dialog_set_prompt (TNY_GNOME_PASSWORD_DIALOG (dialog), prompt); 200 200 201 201 if (G_LIKELY (gtk_dialog_run (dialog) == GTK_RESPONSE_OK)) 202 202 { 203 const gchar *pwd = tny_ password_dialog_get_password204 (TNY_ PASSWORD_DIALOG (dialog));203 const gchar *pwd = tny_gnome_password_dialog_get_password 204 (TNY_GNOME_PASSWORD_DIALOG (dialog)); 205 205 206 206 retval = g_strdup (pwd); … … 234 234 { 235 235 const TnyAccountStoreIface *self = tny_account_iface_get_account_store (account); 236 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);236 TnyGnomeAccountStorePriv *priv = TNY_GNOME_ACCOUNT_STORE_GET_PRIVATE (self); 237 237 TnyGetPassFunc func; 238 238 if (G_LIKELY (passwords)) … … 258 258 259 259 static gboolean 260 tny_ account_store_alert (TnyAccountStoreIface *self, TnyAlertType type, const gchar *prompt)260 tny_gnome_account_store_alert (TnyAccountStoreIface *self, TnyAlertType type, const gchar *prompt) 261 261 { 262 262 GtkMessageType gtktype; … … 312 312 313 313 static const gchar* 314 tny_ account_store_get_cache_dir (TnyAccountStoreIface *self)315 { 316 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);314 tny_gnome_account_store_get_cache_dir (TnyAccountStoreIface *self) 315 { 316 TnyGnomeAccountStorePriv *priv = TNY_GNOME_ACCOUNT_STORE_GET_PRIVATE (self); 317 317 318 318 if (G_UNLIKELY (!priv->cache_dir)) … … 343 343 344 344 static void 345 tny_ account_store_get_accounts (TnyAccountStoreIface *self, TnyListIface *list, TnyGetAccountsRequestType types)346 { 347 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);345 tny_gnome_account_store_get_accounts (TnyAccountStoreIface *self, TnyListIface *list, TnyGetAccountsRequestType types) 346 { 347 TnyGnomeAccountStorePriv *priv = TNY_GNOME_ACCOUNT_STORE_GET_PRIVATE (self); 348 348 gint i=0, count; 349 349 … … 494 494 495 495 static void 496 tny_ account_store_notify_add (TnyAccountStoreIface *self)497 { 498 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);496 tny_gnome_account_store_notify_add (TnyAccountStoreIface *self) 497 { 498 TnyGnomeAccountStorePriv *priv = TNY_GNOME_ACCOUNT_STORE_GET_PRIVATE (self); 499 499 priv->notify = gconf_client_notify_add (priv->client, 500 500 "/apps/tinymail/accounts", gconf_listener_account_changed, … … 504 504 505 505 static void 506 tny_ account_store_notify_remove (TnyAccountStoreIface *self)507 { 508 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);506 tny_gnome_account_store_notify_remove (TnyAccountStoreIface *self) 507 { 508 TnyGnomeAccountStorePriv *priv = TNY_GNOME_ACCOUNT_STORE_GET_PRIVATE (self); 509 509 gconf_client_notify_remove (priv->client, priv->notify); 510 510 return; … … 526 526 527 527 static void 528 tny_ account_store_add_account (TnyAccountStoreIface *self, TnyAccountIface *account, const gchar *type)529 { 530 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);528 tny_gnome_account_store_add_account (TnyAccountStoreIface *self, TnyAccountIface *account, const gchar *type) 529 { 530 TnyGnomeAccountStorePriv *priv = TNY_GNOME_ACCOUNT_STORE_GET_PRIVATE (self); 531 531 gchar *key = NULL; 532 532 gint count = gconf_client_get_int (priv->client, "/apps/tinymail/accounts/count", NULL); … … 562 562 563 563 static void 564 tny_ account_store_add_store_account (TnyAccountStoreIface *self, TnyStoreAccountIface *account)565 { 566 tny_ account_store_notify_remove (self);567 tny_ account_store_add_account (self, TNY_ACCOUNT_IFACE (account), "store");568 tny_ account_store_notify_add (self);564 tny_gnome_account_store_add_store_account (TnyAccountStoreIface *self, TnyStoreAccountIface *account) 565 { 566 tny_gnome_account_store_notify_remove (self); 567 tny_gnome_account_store_add_account (self, TNY_ACCOUNT_IFACE (account), "store"); 568 tny_gnome_account_store_notify_add (self); 569 569 570 570 g_signal_emit (self, tny_account_store_iface_signals [TNY_ACCOUNT_STORE_IFACE_ACCOUNT_INSERTED], 0, account); … … 574 574 575 575 static void 576 tny_ account_store_add_transport_account (TnyAccountStoreIface *self, TnyTransportAccountIface *account)577 { 578 tny_ account_store_notify_remove (self);579 tny_ account_store_add_account (self, TNY_ACCOUNT_IFACE (account), "transport");580 tny_ account_store_notify_add (self);576 tny_gnome_account_store_add_transport_account (TnyAccountStoreIface *self, TnyTransportAccountIface *account) 577 { 578 tny_gnome_account_store_notify_remove (self); 579 tny_gnome_account_store_add_account (self, TNY_ACCOUNT_IFACE (account), "transport"); 580 tny_gnome_account_store_notify_add (self); 581 581 582 582 g_signal_emit (self, tny_account_store_iface_signals [TNY_ACCOUNT_STORE_IFACE_ACCOUNT_INSERTED], 0, account); … … 586 586 587 587 static TnyDeviceIface* 588 tny_ account_store_get_device (TnyAccountStoreIface *self)589 { 590 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);588 tny_gnome_account_store_get_device (TnyAccountStoreIface *self) 589 { 590 TnyGnomeAccountStorePriv *priv = TNY_GNOME_ACCOUNT_STORE_GET_PRIVATE (self); 591 591 592 592 return priv->device; … … 594 594 595 595 /** 596 * tny_ account_store_new:596 * tny_gnome_account_store_new: 597 597 * 598 598 * 599 599 * Return value: A new #TnyAccountStoreIface instance 600 600 **/ 601 TnyAccountStore *602 tny_ account_store_new (void)603 { 604 Tny AccountStore *self = g_object_new (TNY_TYPE_ACCOUNT_STORE, NULL);605 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);601 TnyAccountStoreIface* 602 tny_gnome_account_store_new (void) 603 { 604 TnyGnomeAccountStore *self = g_object_new (TNY_TYPE_GNOME_ACCOUNT_STORE, NULL); 605 TnyGnomeAccountStorePriv *priv = TNY_GNOME_ACCOUNT_STORE_GET_PRIVATE (self); 606 606 priv->session = tny_session_camel_new (TNY_ACCOUNT_STORE_IFACE (self)); 607 607 608 return self;609 } 610 611 612 static void 613 tny_ account_store_instance_init (GTypeInstance *instance, gpointer g_class)614 { 615 Tny AccountStore *self = (TnyAccountStore *)instance;616 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);608 return TNY_ACCOUNT_STORE_IFACE (self); 609 } 610 611 612 static void 613 tny_gnome_account_store_instance_init (GTypeInstance *instance, gpointer g_class) 614 { 615 TnyGnomeAccountStore *self = (TnyGnomeAccountStore *)instance; 616 TnyGnomeAccountStorePriv *priv = TNY_GNOME_ACCOUNT_STORE_GET_PRIVATE (self); 617 617 TnyPlatformFactoryIface *platfact; 618 618 … … 622 622 GCONF_CLIENT_PRELOAD_RECURSIVE, NULL); 623 623 624 tny_ account_store_notify_add (TNY_ACCOUNT_STORE_IFACE (self));625 626 platfact = TNY_PLATFORM_FACTORY_IFACE (tny_ platform_factory_get_instance ());624 tny_gnome_account_store_notify_add (TNY_ACCOUNT_STORE_IFACE (self)); 625 626 platfact = TNY_PLATFORM_FACTORY_IFACE (tny_gnome_platform_factory_get_instance ()); 627 627 priv->device = tny_platform_factory_iface_new_device (platfact); 628 628 /* tny_device_iface_force_online (priv->device); */ … … 634 634 635 635 static void 636 tny_ account_store_finalize (GObject *object)637 { 638 Tny AccountStore *self = (TnyAccountStore *)object;639 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);640 641 tny_ account_store_notify_remove (TNY_ACCOUNT_STORE_IFACE (self));636 tny_gnome_account_store_finalize (GObject *object) 637 { 638 TnyGnomeAccountStore *self = (TnyGnomeAccountStore *)object; 639 TnyGnomeAccountStorePriv *priv = TNY_GNOME_ACCOUNT_STORE_GET_PRIVATE (self); 640 641 tny_gnome_account_store_notify_remove (TNY_ACCOUNT_STORE_IFACE (self)); 642 642 g_object_unref (G_OBJECT (priv->client)); 643 643 … … 652 652 653 653 /** 654 * tny_ account_store_get_session:655 * @self: The #Tny AccountStore instance654 * tny_gnome_account_store_get_session: 655 * @self: The #TnyGnomeAccountStore instance 656 656 * 657 657 * Return value: A #TnySessionCamel instance 658 658 **/ 659 659 TnySessionCamel* 660 tny_ account_store_get_session (TnyAccountStore *self)661 { 662 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);660 tny_gnome_account_store_get_session (TnyGnomeAccountStore *self) 661 { 662 TnyGnomeAccountStorePriv *priv = TNY_GNOME_ACCOUNT_STORE_GET_PRIVATE (self); 663 663 664 664 return priv->session; … … 666 666 667 667 static void 668 tny_ account_store_class_init (TnyAccountStoreClass *class)668 tny_gnome_account_store_class_init (TnyGnomeAccountStoreClass *class) 669 669 { 670 670 GObjectClass *object_class; … … 673 673 object_class = (GObjectClass*) class; 674 674 675 object_class->finalize = tny_ account_store_finalize;676 677 g_type_class_add_private (object_class, sizeof (Tny AccountStorePriv));675 object_class->finalize = tny_gnome_account_store_finalize; 676 677 g_type_class_add_private (object_class, sizeof (TnyGnomeAccountStorePriv)); 678 678 679 679 return; … … 685 685 TnyAccountStoreIfaceClass *klass = (TnyAccountStoreIfaceClass *)g_iface; 686 686 687 klass->get_accounts_func = tny_ account_store_get_accounts;688 klass->add_store_account_func = tny_ account_store_add_store_account;689 klass->add_transport_account_func = tny_ account_store_add_transport_account;690 klass->get_cache_dir_func = tny_ account_store_get_cache_dir;691 klass->get_device_func = tny_ account_store_get_device;692 klass->alert_func = tny_ account_store_alert;687 klass->get_accounts_func = tny_gnome_account_store_get_accounts; 688 klass->add_store_account_func = tny_gnome_account_store_add_store_account; 689 klass->add_transport_account_func = tny_gnome_account_store_add_transport_account; 690 klass->get_cache_dir_func = tny_gnome_account_store_get_cache_dir; 691 klass->get_device_func = tny_gnome_account_store_get_device; 692 klass->alert_func = tny_gnome_account_store_alert; 693 693 694 694 return; … … 697 697 698 698 GType 699 tny_ account_store_get_type (void)699 tny_gnome_account_store_get_type (void) 700 700 { 701 701 static GType type = 0; … … 705 705 static const GTypeInfo info = 706 706 { 707 sizeof (Tny AccountStoreClass),707 sizeof (TnyGnomeAccountStoreClass), 708 708 NULL, /* base_init */ 709 709 NULL, /* base_finalize */ 710 (GClassInitFunc) tny_ account_store_class_init, /* class_init */710 (GClassInitFunc) tny_gnome_account_store_class_init, /* class_init */ 711 711 NULL, /* class_finalize */ 712 712 NULL, /* class_data */ 713 sizeof (Tny AccountStore),713 sizeof (TnyGnomeAccountStore), 714 714 0, /* n_preallocs */ 715 tny_ account_store_instance_init /* instance_init */715 tny_gnome_account_store_instance_init /* instance_init */ 716 716 }; 717 717 … … 724 724 725 725 type = g_type_register_static (G_TYPE_OBJECT, 726 "Tny AccountStore",726 "TnyGnomeAccountStore", 727 727 &info, 0); 728 728 trunk/libtinymail-gnome-desktop/tny-gnome-account-store.h
r876 r879 1 #ifndef TNY_ ACCOUNT_STORE_H2 #define TNY_ ACCOUNT_STORE_H1 #ifndef TNY_GNOME_ACCOUNT_STORE_H 2 #define TNY_GNOME_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_GNOME_ACCOUNT_STORE (tny_gnome_account_store_get_type ()) 31 #define TNY_GNOME_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TNY_TYPE_GNOME_ACCOUNT_STORE, TnyGnomeAccountStore)) 32 #define TNY_GNOME_ACCOUNT_STORE_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), TNY_TYPE_GNOME_ACCOUNT_STORE, TnyGnomeAccountStoreClass)) 33 #define TNY_IS_GNOME_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TNY_TYPE_GNOME_ACCOUNT_STORE)) 34 #define TNY_IS_GNOME_ACCOUNT_STORE_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), TNY_TYPE_GNOME_ACCOUNT_STORE)) 35 #define TNY_GNOME_ACCOUNT_STORE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), TNY_TYPE_GNOME_ACCOUNT_STORE, TnyGnomeAccountStoreClass)) 36 36 37 typedef struct _Tny AccountStore TnyAccountStore;38 typedef struct _Tny AccountStoreClass TnyAccountStoreClass;37 typedef struct _TnyGnomeAccountStore TnyGnomeAccountStore; 38 typedef struct _TnyGnomeAccountStoreClass TnyGnomeAccountStoreClass; 39 39 40 struct _Tny AccountStore40 struct _TnyGnomeAccountStore 41 41 { 42 42 GObject parent; 43 43 }; 44 44 45 struct _Tny AccountStoreClass45 struct _TnyGnomeAccountStoreClass 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_gnome_account_store_get_type (void); 51 TnyAccountStoreIface* tny_gnome_account_store_new (void); 52 TnySessionCamel* tny_gnome_account_store_get_session (TnyGnomeAccountStore *self); 53 53 54 54 G_END_DECLS trunk/libtinymail-gnome-desktop/tny-gnome-device-priv.h
r876 r879 1 #ifndef TNY_ DEVICE_PRIV_H2 #define TNY_ DEVICE_PRIV_H1 #ifndef TNY_GNOME_DEVICE_PRIV_H 2 #define TNY_GNOME_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 _TnyGnomeDevicePriv TnyGnomeDevicePriv; 24 24 25 struct _Tny DevicePriv25 struct _TnyGnomeDevicePriv 26 26 { 27 27 gboolean forced, fset; … … 35 35 36 36 37 #define TNY_ DEVICE_GET_PRIVATE(o) \38 (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_ DEVICE, TnyDevicePriv))37 #define TNY_GNOME_DEVICE_GET_PRIVATE(o) \ 38 (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_GNOME_DEVICE, TnyGnomeDevicePriv)) 39 39 40 40 #endif trunk/libtinymail-gnome-desktop/tny-gnome-device.c
r876 r879 22 22 #include <glib/gi18n-lib.h> 23 23 24 #include <tny- device.h>24 #include <tny-gnome-device.h> 25 25 26 26 #ifdef GNOME … … 30 30 static GObjectClass *parent_class = NULL; 31 31 32 #include "tny- device-priv.h"33 34 static void tny_ device_on_online (TnyDeviceIface *self);35 static void tny_ device_on_offline (TnyDeviceIface *self);36 static gboolean tny_ device_is_online (TnyDeviceIface *self);32 #include "tny-gnome-device-priv.h" 33 34 static void tny_gnome_device_on_online (TnyDeviceIface *self); 35 static void tny_gnome_device_on_offline (TnyDeviceIface *self); 36 static gboolean tny_gnome_device_is_online (TnyDeviceIface *self); 37 37 38 38 #ifdef GNOME … … 42 42 TnyDeviceIface *self = (TnyDeviceIface *)user_data; 43 43 44 if (tny_ device_is_online (self))45 tny_ device_on_online (self);44 if (tny_gnome_device_is_online (self)) 45 tny_gnome_device_on_online (self); 46 46 else 47 tny_ device_on_offline (self);48 49 return; 50 } 51 #endif 52 53 static void 54 tny_ device_reset (TnyDeviceIface *self)55 { 56 Tny DevicePriv *priv = TNY_DEVICE_GET_PRIVATE (self);47 tny_gnome_device_on_offline (self); 48 49 return; 50 } 51 #endif 52 53 static void 54 tny_gnome_device_reset (TnyDeviceIface *self) 55 { 56 TnyGnomeDevicePriv *priv = TNY_GNOME_DEVICE_GET_PRIVATE (self); 57 57 58 58 priv->fset = FALSE; … … 65 65 66 66 static void 67 tny_ device_force_online (TnyDeviceIface *self)68 { 69 Tny DevicePriv *priv = TNY_DEVICE_GET_PRIVATE (self);67 tny_gnome_device_force_online (TnyDeviceIface *self) 68 { 69 TnyGnomeDevicePriv *priv = TNY_GNOME_DEVICE_GET_PRIVATE (self); 70 70 71 71 priv->fset = TRUE; … … 81 81 82 82 static void 83 tny_ device_force_offline (TnyDeviceIface *self)84 { 85 Tny DevicePriv *priv = TNY_DEVICE_GET_PRIVATE (self);83 tny_gnome_device_force_offline (TnyDeviceIface *self) 84 { 85 TnyGnomeDevicePriv *priv = TNY_GNOME_DEVICE_GET_PRIVATE (self); 86 86 87 87 priv->fset = TRUE; … … 96 96 97 97 static void 98 tny_ device_on_online (TnyDeviceIface *self)98 tny_gnome_device_on_online (TnyDeviceIface *self) 99 99 { 100 100 g_signal_emit (self, tny_device_iface_signals [TNY_DEVICE_IFACE_CONNECTION_CHANGED], 0, TRUE); … … 104 104 105 105 static void 106 tny_ device_on_offline (TnyDeviceIface *self)106 tny_gnome_device_on_offline (TnyDeviceIface *self) 107 107 { 108 108 g_signal_emit (self, tny_device_iface_signals [TNY_DEVICE_IFACE_CONNECTION_CHANGED], 0, FALSE); … … 112 112 113 113 static gboolean 114 tny_ device_is_online (TnyDeviceIface *self)115 { 116 Tny DevicePriv *priv = TNY_DEVICE_GET_PRIVATE (self);114 tny_gnome_device_is_online (TnyDeviceIface *self) 115 { 116 TnyGnomeDevicePriv *priv = TNY_GNOME_DEVICE_GET_PRIVATE (self); 117 117 gboolean retval = priv->forced; 118 118 … … 145 145 146 146 static void 147 tny_ device_instance_init (GTypeInstance *instance, gpointer g_class)148 { 149 Tny Device *self = (TnyDevice *)instance;150 Tny DevicePriv *priv = TNY_DEVICE_GET_PRIVATE (self);147 tny_gnome_device_instance_init (GTypeInstance *instance, gpointer g_class) 148 { 149 TnyGnomeDevice *self = (TnyGnomeDevice *)instance; 150 TnyGnomeDevicePriv *priv = TNY_GNOME_DEVICE_GET_PRIVATE (self); 151 151 152 152 priv->fset = FALSE; … … 166 166 167 167 /** 168 * tny_ device_new:168 * tny_gnome_device_new: 169 169 * 170 170 * Return value: A new #TnyDeviceIface instance 171 171 **/ 172 TnyDevice *173 tny_ device_new (void)174 { 175 Tny Device *self = g_object_new (TNY_TYPE_DEVICE, NULL);176 177 return self;178 } 179 180 181 static void 182 tny_ device_finalize (GObject *object)183 { 184 Tny Device *self = (TnyDevice *)object;185 Tny DevicePriv *priv = TNY_DEVICE_GET_PRIVATE (self);172 TnyDeviceIface* 173 tny_gnome_device_new (void) 174 { 175 TnyGnomeDevice *self = g_object_new (TNY_TYPE_GNOME_DEVICE, NULL); 176 177 return TNY_DEVICE_IFACE (self); 178 } 179 180 181 static void 182 tny_gnome_device_finalize (GObject *object) 183 { 184 TnyGnomeDevice *self = (TnyGnomeDevice *)object; 185 TnyGnomeDevicePriv *priv = TNY_GNOME_DEVICE_GET_PRIVATE (self); 186 186 187 187 #ifdef GNOME … … 201 201 TnyDeviceIfaceClass *klass = (TnyDeviceIfaceClass *)g_iface; 202 202 203 klass->is_online_func = tny_ device_is_online;204 klass->reset_func = tny_ device_reset;205 klass->force_offline_func = tny_ device_force_offline;206 klass->force_online_func = tny_ device_force_online;207 208 return; 209 } 210 211 212 213 static void 214 tny_ device_class_init (TnyDeviceClass *class)203 klass->is_online_func = tny_gnome_device_is_online; 204 klass->reset_func = tny_gnome_device_reset; 205 klass->force_offline_func = tny_gnome_device_force_offline; 206 klass->force_online_func = tny_gnome_device_force_online; 207 208 return; 209 } 210 211 212 213 static void 214 tny_gnome_device_class_init (TnyGnomeDeviceClass *class) 215 215 { 216 216 GObjectClass *object_class; … … 219 219 object_class = (GObjectClass*) class; 220 220 221 object_class->finalize = tny_ device_finalize;222 223 g_type_class_add_private (object_class, sizeof (Tny DevicePriv));221 object_class->finalize = tny_gnome_device_finalize; 222 223 g_type_class_add_private (object_class, sizeof (TnyGnomeDevicePriv)); 224 224 225 225 return; … … 227 227 228 228 GType 229 tny_ device_get_type (void)229 tny_gnome_device_get_type (void) 230 230 { 231 231 static GType type = 0; … … 235 235 static const GTypeInfo info = 236 236 { 237 sizeof (Tny DeviceClass),237 sizeof (TnyGnomeDeviceClass), 238 238 NULL, /* base_init */ 239 239 NULL, /* base_finalize */ 240 (GClassInitFunc) tny_ device_class_init, /* class_init */240 (GClassInitFunc) tny_gnome_device_class_init, /* class_init */ 241 241 NULL, /* class_finalize */ 242 242 NULL, /* class_data */ 243 sizeof (Tny Device),243 sizeof (TnyGnomeDevice), 244 244 0, /* n_preallocs */ 245 tny_ device_instance_init /* instance_init */245 tny_gnome_device_instance_init /* instance_init */ 246 246 }; 247 247 … … 254 254 255 255 type = g_type_register_static (G_TYPE_OBJECT, 256 "Tny Device",256 "TnyGnomeDevice", 257 257 &info, 0); 258 258 trunk/libtinymail-gnome-desktop/tny-gnome-device.h
r876 r879 1 #ifndef TNY_ DEVICE_H2 #define TNY_ DEVICE_H1 #ifndef TNY_GNOME_DEVICE_H 2 #define TNY_GNOME_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_GNOME_DEVICE (tny_gnome_device_get_type ()) 31 #define TNY_GNOME_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TNY_TYPE_GNOME_DEVICE, TnyGnomeDevice)) 32 #define TNY_GNOME_DEVICE_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), TNY_TYPE_GNOME_DEVICE, TnyGnomeDeviceClass)) 33 #define TNY_IS_GNOME_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TNY_TYPE_GNOME_DEVICE)) 34 #define TNY_IS_GNOME_DEVICE_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), TNY_TYPE_GNOME_DEVICE)) 35 #define TNY_GNOME_DEVICE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), TNY_TYPE_GNOME_DEVICE, TnyGnomeDeviceClass)) 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 _TnyGnomeDevice TnyGnomeDevice; 40 typedef struct _TnyGnomeDeviceClass TnyGnomeDeviceClass; 41 41 42 struct _Tny Device42 struct _TnyGnomeDevice 43 43 { 44 44 GObject parent; 45 45 }; 46 46 47 struct _Tny DeviceClass47 struct _TnyGnomeDeviceClass 48 48 { 49 49 GObjectClass parent; 50 50 }; 51 51 52 GType tny_ device_get_type (void);52 GType tny_gnome_device_get_type (void); 53 53 54 TnyDevice * tny_device_new (void);54 TnyDeviceIface* tny_gnome_device_new (void); 55 55 56 56 G_END_DECLS trunk/libtinymail-gnome-desktop/tny-gnome-password-dialog.c
r876 r879 23 23 24 24 #include <gtk/gtk.h> 25 #include <tny- password-dialog.h>25 #include <tny-gnome-password-dialog.h> 26 26 27 27 static GObjectClass *parent_class = NULL; 28 28 29 typedef struct _Tny PasswordDialogPriv TnyPasswordDialogPriv;29 typedef struct _TnyGnomePasswordDialogPriv TnyGnomePasswordDialogPriv; 30 30 31 struct _Tny PasswordDialogPriv31 struct _TnyGnomePasswordDialogPriv 32 32 { 33 33 GtkEntry *pwd_entry; … … 35 35 }; 36 36 37 #define TNY_ PASSWORD_DIALOG_GET_PRIVATE(o) \38 (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_ PASSWORD_DIALOG, TnyPasswordDialogPriv))37 #define TNY_GNOME_PASSWORD_DIALOG_GET_PRIVATE(o) \ 38 (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_GNOME_PASSWORD_DIALOG, TnyGnomePasswordDialogPriv)) 39 39 40 40 41 41 /** 42 * tny_ password_dialog_set_prompt:43 * @self: A #Tny PasswordDialog object42 * tny_gnome_password_dialog_set_prompt: 43 * @self: A #TnyGnomePasswordDialog object 44 44 * @prompt: The prompt to set 45 45 * 46 46 **/ 47 47 void 48 tny_ password_dialog_set_prompt (TnyPasswordDialog *self, const gchar *prompt)48 tny_gnome_password_dialog_set_prompt (TnyGnomePasswordDialog *self, const gchar *prompt) 49 49 { 50 Tny PasswordDialogPriv *priv = TNY_PASSWORD_DIALOG_GET_PRIVATE (self);50 TnyGnomePasswordDialogPriv *priv = TNY_GNOME_PASSWORD_DIALOG_GET_PRIVATE (self); 51 51 52 52 gtk_label_set_text (priv->prompt_label, prompt); … … 56 56 57 57 /** 58 * tny_ password_dialog_get_password:59 * @self: A #Tny PasswordDialog object58 * tny_gnome_password_dialog_get_password: 59 * @self: A #TnyGnomePasswordDialog object 60 60 * 61 61 * Return value: The password (read-only) as typed by the user 62 62 **/ 63 63 const gchar* 64 tny_ password_dialog_get_password (TnyPasswordDialog *self)64 tny_gnome_password_dialog_get_password (TnyGnomePasswordDialog *self) 65 65 { 66 Tny PasswordDialogPriv *priv = TNY_PASSWORD_DIALOG_GET_PRIVATE (self);66 TnyGnomePasswordDialogPriv *priv = TNY_GNOME_PASSWORD_DIALOG_GET_PRIVATE (self); 67 67 68 68 return gtk_entry_get_text (priv->pwd_entry); … … 70 70 71 71 /** 72 * tny_ password_dialog_new:72 * tny_gnome_password_dialog_new: 73 73 * 74 74 * 75 * Return value: A new # TnyPasswordDialog instance implemented for Gtk+75 * Return value: A new #GtkDialog password dialog instance implemented for Gtk+ 76 76 **/ 77 TnyPasswordDialog*78 tny_ password_dialog_new (void)77 GtkDialog* 78 tny_gnome_password_dialog_new (void) 79 79 { 80 Tny PasswordDialog *self = g_object_new (TNY_TYPE_PASSWORD_DIALOG, NULL);80 TnyGnomePasswordDialog *self = g_object_new (TNY_TYPE_GNOME_PASSWORD_DIALOG, NULL); 81 81 82 return self;82 return GTK_DIALOG (self); 83 83 } 84 84 85 85 static void 86 tny_ password_dialog_instance_init (GTypeInstance *instance, gpointer g_class)86 tny_gnome_password_dialog_instance_init (GTypeInstance *instance, gpointer g_class) 87 87 { 88 Tny PasswordDialog *self = (TnyPasswordDialog *)instance;89 Tny PasswordDialogPriv *priv = TNY_PASSWORD_DIALOG_GET_PRIVATE (self);88 TnyGnomePasswordDialog *self = (TnyGnomePasswordDialog *)instance; 89 TnyGnomePasswordDialogPriv *priv = TNY_GNOME_PASSWORD_DIALOG_GET_PRIVATE (self); 90 90 91 91 gtk_dialog_add_buttons (GTK_DIALOG (self), GTK_STOCK_OK, GTK_RESPONSE_OK, … … 114 114 115 115 static void 116 tny_ password_dialog_finalize (GObject *object)116 tny_gnome_password_dialog_finalize (GObject *object) 117 117 { 118 118 (*parent_class->finalize) (object); … … 123 123 124 124 static void 125 tny_ password_dialog_class_init (TnyPasswordDialogClass *class)125 tny_gnome_password_dialog_class_init (TnyGnomePasswordDialogClass *class) 126 126 { 127 127 GObjectClass *object_class; … … 131 131 object_class = (GObjectClass*) class; 132 132 133 object_class->finalize = tny_ password_dialog_finalize;133 object_class->finalize = tny_gnome_password_dialog_finalize; 134 134 135 g_type_class_add_private (object_class, sizeof (Tny PasswordDialogPriv));135 g_type_class_add_private (object_class, sizeof (TnyGnomePasswordDialogPriv)); 136 136 137 137 return; … … 139 139 140 140 GType 141 tny_ password_dialog_get_type (void)141 tny_gnome_password_dialog_get_type (void) 142 142 { 143 143 static GType type = 0; … … 147 147 static const GTypeInfo info = 148 148 { 149 sizeof (Tny PasswordDialogClass),149 sizeof (TnyGnomePasswordDialogClass), 150 150 NULL, /* base_init */ 151 151 NULL, /* base_finalize */ 152 (GClassInitFunc) tny_ password_dialog_class_init, /* class_init */152 (GClassInitFunc) tny_gnome_password_dialog_class_init, /* class_init */ 153 153 NULL, /* class_finalize */ 154 154 NULL, /* class_data */ 155 sizeof (Tny PasswordDialog),155 sizeof (TnyGnomePasswordDialog), 156 156 0, /* n_preallocs */ 157 tny_ password_dialog_instance_init /* instance_init */157 tny_gnome_password_dialog_instance_init /* instance_init */ 158 158 }; 159 159 160 160 type = g_type_register_static (GTK_TYPE_DIALOG, 161 "Tny PasswordDialog",161 "TnyGnomePasswordDialog", 162 162 &info, 0); 163 163 trunk/libtinymail-gnome-desktop/tny-gnome-password-dialog.h
r876 r879 1 #ifndef TNY_ PASSWORD_DIALOG_H2 #define TNY_ PASSWORD_DIALOG_H1 #ifndef TNY_GNOME_PASSWORD_DIALOG_H 2 #define TNY_GNOME_PASSWORD_DIALOG_H 3 3 4 4 /* tinymail - Tiny Mail … … 26 26 G_BEGIN_DECLS 27 27 28 #define TNY_TYPE_ PASSWORD_DIALOG (tny_password_dialog_get_type ())29 #define TNY_ PASSWORD_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TNY_TYPE_PASSWORD_DIALOG, TnyPasswordDialog))30 #define TNY_ PASSWORD_DIALOG_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), TNY_TYPE_PASSWORD_DIALOG, TnyPasswordDialogClass))31 #define TNY_IS_ PASSWORD_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TNY_TYPE_PASSWORD_DIALOG))32 #define TNY_IS_ PASSWORD_DIALOG_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), TNY_TYPE_PASSWORD_DIALOG))33 #define TNY_ PASSWORD_DIALOG_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), TNY_TYPE_PASSWORD_DIALOG, TnyPasswordDialogClass))28 #define TNY_TYPE_GNOME_PASSWORD_DIALOG (tny_gnome_password_dialog_get_type ()) 29 #define TNY_GNOME_PASSWORD_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TNY_TYPE_GNOME_PASSWORD_DIALOG, TnyGnomePasswordDialog)) 30 #define TNY_GNOME_PASSWORD_DIALOG_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), TNY_TYPE_GNOME_PASSWORD_DIALOG, TnyGnomePasswordDialogClass)) 31 #define TNY_IS_GNOME_PASSWORD_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TNY_TYPE_GNOME_PASSWORD_DIALOG)) 32
