Changeset 878
- Timestamp:
- 09/04/06 22:51:14
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/configure.ac (modified) (2 diffs)
- trunk/libtinymail-olpc/Makefile.am (modified) (1 diff)
- trunk/libtinymail-olpc/tny-olpc-account-store.c (moved) (moved from trunk/libtinymail-olpc/tny-account-store.c) (21 diffs)
- trunk/libtinymail-olpc/tny-olpc-account-store.h (moved) (moved from trunk/libtinymail-olpc/tny-account-store.h) (2 diffs)
- trunk/libtinymail-olpc/tny-olpc-device-priv.h (moved) (moved from trunk/libtinymail-olpc/tny-device-priv.h) (3 diffs)
- trunk/libtinymail-olpc/tny-olpc-device.c (moved) (moved from trunk/libtinymail-olpc/tny-device.c) (14 diffs)
- trunk/libtinymail-olpc/tny-olpc-device.h (moved) (moved from trunk/libtinymail-olpc/tny-device.h) (2 diffs)
- trunk/libtinymail-olpc/tny-olpc-password-dialog.c (moved) (moved from trunk/libtinymail-olpc/tny-password-dialog.c) (9 diffs)
- trunk/libtinymail-olpc/tny-olpc-password-dialog.h (moved) (moved from trunk/libtinymail-olpc/tny-password-dialog.h) (2 diffs)
- trunk/libtinymail-olpc/tny-olpc-platform-factory.c (moved) (moved from trunk/libtinymail-olpc/tny-platform-factory.c) (12 diffs)
- trunk/libtinymail-olpc/tny-olpc-platform-factory.h (moved) (moved from trunk/libtinymail-olpc/tny-platform-factory.h) (2 diffs)
- trunk/tinymail/tny-main.c (modified) (4 diffs)
- trunk/tinymail/tny-summary-view.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r877 r878 3 3 * Renamed the GPE types in libtinymail-gpe 4 4 * Renamed the Maemo types in libtinymail-maemo 5 * Renamed the OLPC types in libtinymail-olpc 6 5 7 * Made compilation of the demo-ui optional 6 8 * Added some ifdefs to the demo-ui 7 9 8 * This was a major API change in libtinymail-gpe, libtinymail-maemo 10 * This was a major API change in libtinymail-gpe, libtinymail-maemo, 11 libtinymail-olpc 9 12 10 13 2006-09-04 Philip Van Hoof <pvanhoof@gnome.org> trunk/configure.ac
r877 r878 68 68 PLATFORM=1 69 69 ;; 70 olpc)71 PLATFORMDIR=libtinymail-olpc72 build_gtkhtml=false73 build_mozembed=false74 build_gnome=false75 with_html_component=none76 build_demoui=true77 PLATFORM=478 ;;79 70 maemo) 80 71 PLATFORMDIR=libtinymail-maemo … … 91 82 PLATFORM=3 92 83 ;; 84 olpc) 85 PLATFORMDIR=libtinymail-olpc 86 build_gtkhtml=false 87 build_mozembed=false 88 build_gnome=false 89 with_html_component=none 90 build_demoui=true 91 PLATFORM=4 92 ;; 93 93 *) 94 94 PLATFORMDIR=${with_platform} trunk/libtinymail-olpc/Makefile.am
r848 r878 11 11 lib_LTLIBRARIES = libtinymail-olpc-1.0.la 12 12 13 libtinymail_olpc_1_0_headers = \14 tny- account-store.h\15 tny- password-dialog.h\16 tny- device.h\17 tny- platform-factory.h13 libtinymail_olpc_1_0_headers = \ 14 tny-olpc-account-store.h \ 15 tny-olpc-password-dialog.h \ 16 tny-olpc-device.h \ 17 tny-olpc-platform-factory.h 18 18 19 libtinymail_olpc_1_0_la_SOURCES = \20 $(libtinymail_olpc_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_olpc_1_0_la_SOURCES = \ 20 $(libtinymail_olpc_1_0_headers) \ 21 tny-olpc-account-store.c \ 22 tny-olpc-device-priv.h \ 23 tny-olpc-device.c \ 24 tny-olpc-password-dialog.c \ 25 tny-olpc-platform-factory.c 26 26 27 27 libtinymail_olpc_1_0_la_LIBADD = \ trunk/libtinymail-olpc/tny-olpc-account-store.c
r876 r878 28 28 29 29 #include <tny-platform-factory-iface.h> 30 #include <tny- platform-factory.h>30 #include <tny-olpc-platform-factory.h> 31 31 32 32 #include <tny-account-store-iface.h> 33 #include <tny- account-store.h>34 #include <tny- password-dialog.h>33 #include <tny-olpc-account-store.h> 34 #include <tny-olpc-password-dialog.h> 35 35 #include <tny-account-iface.h> 36 36 #include <tny-store-account-iface.h> … … 42 42 #include <tny-camel-transport-account.h> 43 43 #include <tny-session-camel.h> 44 #include <tny- device.h>44 #include <tny-olpc-device.h> 45 45 46 46 /* GKeyFile vs. Camel implementation */ … … 48 48 static GObjectClass *parent_class = NULL; 49 49 50 typedef struct _Tny AccountStorePriv TnyAccountStorePriv;51 52 struct _Tny AccountStorePriv50 typedef struct _TnyOlpcAccountStorePriv TnyOlpcAccountStorePriv; 51 52 struct _TnyOlpcAccountStorePriv 53 53 { 54 54 gchar *cache_dir; … … 58 58 }; 59 59 60 #define TNY_ ACCOUNT_STORE_GET_PRIVATE(o) \61 (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_ ACCOUNT_STORE, TnyAccountStorePriv))60 #define TNY_OLPC_ACCOUNT_STORE_GET_PRIVATE(o) \ 61 (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_OLPC_ACCOUNT_STORE, TnyOlpcAccountStorePriv)) 62 62 63 63 … … 77 77 if (G_UNLIKELY (!retval)) 78 78 { 79 GtkDialog *dialog = GTK_DIALOG (tny_ password_dialog_new ());79 GtkDialog *dialog = GTK_DIALOG (tny_olpc_password_dialog_new ()); 80 80 81 tny_ password_dialog_set_prompt (TNY_PASSWORD_DIALOG (dialog), prompt);81 tny_olpc_password_dialog_set_prompt (TNY_OLPC_PASSWORD_DIALOG (dialog), prompt); 82 82 83 83 if (G_LIKELY (gtk_dialog_run (dialog) == GTK_RESPONSE_OK)) 84 84 { 85 const gchar *pwd = tny_ password_dialog_get_password86 (TNY_ PASSWORD_DIALOG (dialog));85 const gchar *pwd = tny_olpc_password_dialog_get_password 86 (TNY_OLPC_PASSWORD_DIALOG (dialog)); 87 87 88 88 retval = g_strdup (pwd); … … 135 135 136 136 static gboolean 137 tny_ account_store_alert (TnyAccountStoreIface *self, TnyAlertType type, const gchar *prompt)137 tny_olpc_account_store_alert (TnyAccountStoreIface *self, TnyAlertType type, const gchar *prompt) 138 138 { 139 139 GtkMessageType gtktype; … … 168 168 169 169 static const gchar* 170 tny_ account_store_get_cache_dir (TnyAccountStoreIface *self)171 { 172 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);170 tny_olpc_account_store_get_cache_dir (TnyAccountStoreIface *self) 171 { 172 TnyOlpcAccountStorePriv *priv = TNY_OLPC_ACCOUNT_STORE_GET_PRIVATE (self); 173 173 174 174 if (!priv->cache_dir) … … 180 180 181 181 static void 182 tny_ account_store_get_accounts (TnyAccountStoreIface *self, TnyListIface *list, TnyGetAccountsRequestType types)183 { 184 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);182 tny_olpc_account_store_get_accounts (TnyAccountStoreIface *self, TnyListIface *list, TnyGetAccountsRequestType types) 183 { 184 TnyOlpcAccountStorePriv *priv = TNY_OLPC_ACCOUNT_STORE_GET_PRIVATE (self); 185 185 const gchar *filen; 186 186 gchar *configd; … … 313 313 314 314 static void 315 tny_ account_store_add_account (TnyAccountStoreIface *self, TnyAccountIface *account, const gchar *type)315 tny_olpc_account_store_add_account (TnyAccountStoreIface *self, TnyAccountIface *account, const gchar *type) 316 316 { 317 317 g_warning ("Not implemented\n"); … … 323 323 324 324 static void 325 tny_ account_store_add_store_account (TnyAccountStoreIface *self, TnyStoreAccountIface *account)326 { 327 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);328 329 tny_ account_store_add_account (self, TNY_ACCOUNT_IFACE (account), "store");325 tny_olpc_account_store_add_store_account (TnyAccountStoreIface *self, TnyStoreAccountIface *account) 326 { 327 TnyOlpcAccountStorePriv *priv = TNY_OLPC_ACCOUNT_STORE_GET_PRIVATE (self); 328 329 tny_olpc_account_store_add_account (self, TNY_ACCOUNT_IFACE (account), "store"); 330 330 331 331 g_signal_emit (self, tny_account_store_iface_signals [TNY_ACCOUNT_STORE_IFACE_ACCOUNT_INSERTED], 0, account); … … 335 335 336 336 static void 337 tny_ account_store_add_transport_account (TnyAccountStoreIface *self, TnyTransportAccountIface *account)338 { 339 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);340 341 tny_ account_store_add_account (self, TNY_ACCOUNT_IFACE (account), "transport");337 tny_olpc_account_store_add_transport_account (TnyAccountStoreIface *self, TnyTransportAccountIface *account) 338 { 339 TnyOlpcAccountStorePriv *priv = TNY_OLPC_ACCOUNT_STORE_GET_PRIVATE (self); 340 341 tny_olpc_account_store_add_account (self, TNY_ACCOUNT_IFACE (account), "transport"); 342 342 343 343 g_signal_emit (self, tny_account_store_iface_signals [TNY_ACCOUNT_STORE_IFACE_ACCOUNT_INSERTED], 0, account); … … 347 347 348 348 static TnyDeviceIface* 349 tny_ account_store_get_device (TnyAccountStoreIface *self)350 { 351 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);349 tny_olpc_account_store_get_device (TnyAccountStoreIface *self) 350 { 351 TnyOlpcAccountStorePriv *priv = TNY_OLPC_ACCOUNT_STORE_GET_PRIVATE (self); 352 352 353 353 return priv->device; … … 355 355 356 356 /** 357 * tny_ account_store_new:358 * 359 * 360 * Return value: A new #TnyAccountStoreIface i nstance357 * tny_olpc_account_store_new: 358 * 359 * 360 * Return value: A new #TnyAccountStoreIface implemented for OLPC 361 361 **/ 362 TnyAccountStore *363 tny_ account_store_new (void)364 { 365 Tny AccountStore *self = g_object_new (TNY_TYPE_ACCOUNT_STORE, NULL);366 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);362 TnyAccountStoreIface* 363 tny_olpc_account_store_new (void) 364 { 365 TnyOlpcAccountStore *self = g_object_new (TNY_TYPE_OLPC_ACCOUNT_STORE, NULL); 366 TnyOlpcAccountStorePriv *priv = TNY_OLPC_ACCOUNT_STORE_GET_PRIVATE (self); 367 367 priv->session = tny_session_camel_new (TNY_ACCOUNT_STORE_IFACE (self)); 368 368 369 return self;370 } 371 372 373 static void 374 tny_ account_store_instance_init (GTypeInstance *instance, gpointer g_class)375 { 376 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (instance);369 return TNY_ACCOUNT_STORE_IFACE (self); 370 } 371 372 373 static void 374 tny_olpc_account_store_instance_init (GTypeInstance *instance, gpointer g_class) 375 { 376 TnyOlpcAccountStorePriv *priv = TNY_OLPC_ACCOUNT_STORE_GET_PRIVATE (instance); 377 377 TnyPlatformFactoryIface *platfact = TNY_PLATFORM_FACTORY_IFACE ( 378 tny_ platform_factory_get_instance ());378 tny_olpc_platform_factory_get_instance ()); 379 379 380 380 priv->device = tny_platform_factory_iface_new_device (platfact); … … 386 386 387 387 static void 388 tny_ account_store_finalize (GObject *object)388 tny_olpc_account_store_finalize (GObject *object) 389 389 { 390 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (object);390 TnyOlpcAccountStorePriv *priv = TNY_OLPC_ACCOUNT_STORE_GET_PRIVATE (object); 391 391 392 392 if (priv->cache_dir) … … 400 400 401 401 /** 402 * tny_ account_store_get_session:403 * @self: The #Tny AccountStore instance402 * tny_olpc_account_store_get_session: 403 * @self: The #TnyOlpcAccountStore instance 404 404 * 405 405 * Return value: A #TnySessionCamel instance 406 406 **/ 407 407 TnySessionCamel* 408 tny_ account_store_get_session (TnyAccountStore *self)409 { 410 Tny AccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self);408 tny_olpc_account_store_get_session (TnyOlpcAccountStore *self) 409 { 410 TnyOlpcAccountStorePriv *priv = TNY_OLPC_ACCOUNT_STORE_GET_PRIVATE (self); 411 411 412 412 return priv->session; … … 414 414 415 415 static void 416 tny_ account_store_class_init (TnyAccountStoreClass *class)416 tny_olpc_account_store_class_init (TnyOlpcAccountStoreClass *class) 417 417 { 418 418 GObjectClass *object_class; … … 421 421 object_class = (GObjectClass*) class; 422 422 423 object_class->finalize = tny_ account_store_finalize;424 425 g_type_class_add_private (object_class, sizeof (Tny AccountStorePriv));423 object_class->finalize = tny_olpc_account_store_finalize; 424 425 g_type_class_add_private (object_class, sizeof (TnyOlpcAccountStorePriv)); 426 426 427 427 return; … … 433 433 TnyAccountStoreIfaceClass *klass = (TnyAccountStoreIfaceClass *)g_iface; 434 434 435 klass->get_accounts_func = tny_ account_store_get_accounts;436 klass->add_store_account_func = tny_ account_store_add_store_account;437 klass->add_transport_account_func = tny_ account_store_add_transport_account;438 klass->get_cache_dir_func = tny_ account_store_get_cache_dir;439 klass->get_device_func = tny_ account_store_get_device;440 klass->alert_func = tny_ account_store_alert;435 klass->get_accounts_func = tny_olpc_account_store_get_accounts; 436 klass->add_store_account_func = tny_olpc_account_store_add_store_account; 437 klass->add_transport_account_func = tny_olpc_account_store_add_transport_account; 438 klass->get_cache_dir_func = tny_olpc_account_store_get_cache_dir; 439 klass->get_device_func = tny_olpc_account_store_get_device; 440 klass->alert_func = tny_olpc_account_store_alert; 441 441 442 442 return; … … 445 445 446 446 GType 447 tny_ account_store_get_type (void)447 tny_olpc_account_store_get_type (void) 448 448 { 449 449 static GType type = 0; … … 453 453 static const GTypeInfo info = 454 454 { 455 sizeof (Tny AccountStoreClass),455 sizeof (TnyOlpcAccountStoreClass), 456 456 NULL, /* base_init */ 457 457 NULL, /* base_finalize */ 458 (GClassInitFunc) tny_ account_store_class_init, /* class_init */458 (GClassInitFunc) tny_olpc_account_store_class_init, /* class_init */ 459 459 NULL, /* class_finalize */ 460 460 NULL, /* class_data */ 461 sizeof (Tny AccountStore),461 sizeof (TnyOlpcAccountStore), 462 462 0, /* n_preallocs */ 463 tny_ account_store_instance_init /* instance_init */463 tny_olpc_account_store_instance_init /* instance_init */ 464 464 }; 465 465 … … 472 472 473 473 type = g_type_register_static (G_TYPE_OBJECT, 474 "Tny AccountStore",474 "TnyOlpcAccountStore", 475 475 &info, 0); 476 476 trunk/libtinymail-olpc/tny-olpc-account-store.h
r876 r878 1 #ifndef TNY_ ACCOUNT_STORE_H2 #define TNY_ ACCOUNT_STORE_H1 #ifndef TNY_OLPC_ACCOUNT_STORE_H 2 #define TNY_OLPC_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_OLPC_ACCOUNT_STORE (tny_olpc_account_store_get_type ()) 31 #define TNY_OLPC_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TNY_TYPE_OLPC_ACCOUNT_STORE, TnyOlpcAccountStore)) 32 #define TNY_OLPC_ACCOUNT_STORE_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), TNY_TYPE_OLPC_ACCOUNT_STORE, TnyOlpcAccountStoreClass)) 33 #define TNY_IS_OLPC_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TNY_TYPE_OLPC_ACCOUNT_STORE)) 34 #define TNY_IS_OLPC_ACCOUNT_STORE_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), TNY_TYPE_OLPC_ACCOUNT_STORE)) 35 #define TNY_OLPC_ACCOUNT_STORE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), TNY_TYPE_OLPC_ACCOUNT_STORE, TnyOlpcAccountStoreClass)) 36 36 37 typedef struct _Tny AccountStore TnyAccountStore;38 typedef struct _Tny AccountStoreClass TnyAccountStoreClass;37 typedef struct _TnyOlpcAccountStore TnyOlpcAccountStore; 38 typedef struct _TnyOlpcAccountStoreClass TnyOlpcAccountStoreClass; 39 39 40 struct _Tny AccountStore40 struct _TnyOlpcAccountStore 41 41 { 42 42 GObject parent; 43 43 }; 44 44 45 struct _Tny AccountStoreClass45 struct _TnyOlpcAccountStoreClass 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_olpc_account_store_get_type (void); 51 TnyAccountStoreIface* tny_olpc_account_store_new (void); 52 TnySessionCamel* tny_olpc_account_store_get_session (TnyOlpcAccountStore *self); 53 53 54 54 G_END_DECLS trunk/libtinymail-olpc/tny-olpc-device-priv.h
r876 r878 1 #ifndef TNY_ DEVICE_PRIV_H2 #define TNY_ DEVICE_PRIV_H1 #ifndef TNY_OLPC_DEVICE_PRIV_H 2 #define TNY_OLPC_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 _TnyOlpcDevicePriv TnyOlpcDevicePriv; 24 24 25 struct _Tny DevicePriv25 struct _TnyOlpcDevicePriv 26 26 { 27 27 gboolean forced, fset; … … 29 29 30 30 31 #define TNY_ DEVICE_GET_PRIVATE(o) \32 (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_ DEVICE, TnyDevicePriv))31 #define TNY_OLPC_DEVICE_GET_PRIVATE(o) \ 32 (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_OLPC_DEVICE, TnyOlpcDevicePriv)) 33 33 34 34 #endif trunk/libtinymail-olpc/tny-olpc-device.c
r876 r878 22 22 #include <glib/gi18n-lib.h> 23 23 24 #include <tny- device.h>24 #include <tny-olpc-device.h> 25 25 26 26 static GObjectClass *parent_class = NULL; 27 27 28 #include "tny- device-priv.h"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);28 #include "tny-olpc-device-priv.h" 29 30 static void tny_olpc_device_on_online (TnyDeviceIface *self); 31 static void tny_olpc_device_on_offline (TnyDeviceIface *self); 32 static gboolean tny_olpc_device_is_online (TnyDeviceIface *self); 33 33 34 34 35 35 static void 36 tny_ device_reset (TnyDeviceIface *self)37 { 38 Tny DevicePriv *priv = TNY_DEVICE_GET_PRIVATE (self);36 tny_olpc_device_reset (TnyDeviceIface *self) 37 { 38 TnyOlpcDevicePriv *priv = TNY_OLPC_DEVICE_GET_PRIVATE (self); 39 39 40 40 priv->fset = FALSE; … … 44 44 45 45 static void 46 tny_ device_force_online (TnyDeviceIface *self)47 { 48 Tny DevicePriv *priv = TNY_DEVICE_GET_PRIVATE (self);46 tny_olpc_device_force_online (TnyDeviceIface *self) 47 { 48 TnyOlpcDevicePriv *priv = TNY_OLPC_DEVICE_GET_PRIVATE (self); 49 49 50 50 priv->fset = TRUE; 51 51 priv->forced = TRUE; 52 52 53 tny_ device_on_online (self);54 55 return; 56 } 57 58 59 static void 60 tny_ device_force_offline (TnyDeviceIface *self)61 { 62 Tny DevicePriv *priv = TNY_DEVICE_GET_PRIVATE (self);53 tny_olpc_device_on_online (self); 54 55 return; 56 } 57 58 59 static void 60 tny_olpc_device_force_offline (TnyDeviceIface *self) 61 { 62 TnyOlpcDevicePriv *priv = TNY_OLPC_DEVICE_GET_PRIVATE (self); 63 63 64 64 priv->fset = TRUE; … … 66 66 67 67 68 tny_ device_on_offline (self);68 tny_olpc_device_on_offline (self); 69 69 70 70 return; … … 72 72 73 73 static void 74 tny_ device_on_online (TnyDeviceIface *self)74 tny_olpc_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_olpc_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)91 { 92 Tny DevicePriv *priv = TNY_DEVICE_GET_PRIVATE (self);90 tny_olpc_device_is_online (TnyDeviceIface *self) 91 { 92 TnyOlpcDevicePriv *priv = TNY_OLPC_DEVICE_GET_PRIVATE (self); 93 93 gboolean retval = FALSE; 94 94 return retval; … … 96 96 97 97 static void 98 tny_ device_instance_init (GTypeInstance *instance, gpointer g_class)99 { 100 Tny Device *self = (TnyDevice *)instance;101 Tny DevicePriv *priv = TNY_DEVICE_GET_PRIVATE (self);98 tny_olpc_device_instance_init (GTypeInstance *instance, gpointer g_class) 99 { 100 TnyOlpcDevice *self = (TnyOlpcDevice *)instance; 101 TnyOlpcDevicePriv *priv = TNY_OLPC_DEVICE_GET_PRIVATE (self); 102 102 103 103 return; … … 107 107 108 108 /** 109 * tny_ device_new:110 * 111 * Return value: A new #TnyDeviceIface i nstance109 * tny_olpc_device_new: 110 * 111 * Return value: A new #TnyDeviceIface implemented for OLPC 112 112 **/ 113 TnyDevice *114 tny_ device_new (void)115 { 116 Tny Device *self = g_object_new (TNY_TYPE_DEVICE, NULL);117 118 return self;119 } 120 121 122 static void 123 tny_ device_finalize (GObject *object)124 { 125 Tny Device *self = (TnyDevice *)object;126 Tny DevicePriv *priv = TNY_DEVICE_GET_PRIVATE (self);113 TnyDeviceIface* 114 tny_olpc_device_new (void) 115 { 116 TnyOlpcDevice *self = g_object_new (TNY_TYPE_OLPC_DEVICE, NULL); 117 118 return TNY_DEVICE_IFACE (self); 119 } 120 121 122 static void 123 tny_olpc_device_finalize (GObject *object) 124 { 125 TnyOlpcDevice *self = (TnyOlpcDevice *)object; 126 TnyOlpcDevicePriv *priv = TNY_OLPC_DEVICE_GET_PRIVATE (self); 127 127 128 128 (*parent_class->finalize) (object); … … 137 137 TnyDeviceIfaceClass *klass = (TnyDeviceIfaceClass *)g_iface; 138 138 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;139 klass->is_online_func = tny_olpc_device_is_online; 140 klass->reset_func = tny_olpc_device_reset; 141 klass->force_offline_func = tny_olpc_device_force_offline; 142 klass->force_online_func = tny_olpc_device_force_online; 143 143 144 144 return; … … 148 148 149 149 static void 150 tny_ device_class_init (TnyDeviceClass *class)150 tny_olpc_device_class_init (TnyOlpcDeviceClass *class) 151 151 { 152 152 GObjectClass *object_class; … … 155 155 object_class = (GObjectClass*) class; 156 156 157 object_class->finalize = tny_ device_finalize;158 159 g_type_class_add_private (object_class, sizeof (Tny DevicePriv));157 object_class->finalize = tny_olpc_device_finalize; 158 159 g_type_class_add_private (object_class, sizeof (TnyOlpcDevicePriv)); 160 160 161 161 return; … … 163 163 164 164 GType 165 tny_ device_get_type (void)165 tny_olpc_device_get_type (void) 166 166 { 167 167 static GType type = 0; … … 171 171 static const GTypeInfo info = 172 172 { 173 sizeof (Tny DeviceClass),173 sizeof (TnyOlpcDeviceClass), 174 174 NULL, /* base_init */ 175 175 NULL, /* base_finalize */ 176 (GClassInitFunc) tny_ device_class_init, /* class_init */176 (GClassInitFunc) tny_olpc_device_class_init, /* class_init */ 177 177 NULL, /* class_finalize */ 178 178 NULL, /* class_data */ 179 sizeof (Tny Device),179 sizeof (TnyOlpcDevice), 180 180 0, /* n_preallocs */ 181 tny_ device_instance_init /* instance_init */181 tny_olpc_device_instance_init /* instance_init */ 182 182 }; 183 183 … … 190 190 191 191 type = g_type_register_static (G_TYPE_OBJECT, 192 "Tny Device",192 "TnyOlpcDevice", 193 193 &info, 0); 194 194 trunk/libtinymail-olpc/tny-olpc-device.h
r876 r878 1 #ifndef TNY_ DEVICE_H2 #define TNY_ DEVICE_H1 #ifndef TNY_OLPC_DEVICE_H 2 #define TNY_OLPC_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_OLPC_DEVICE (tny_olpc_device_get_type ()) 31 #define TNY_OLPC_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TNY_TYPE_OLPC_DEVICE, TnyOlpcDevice)) 32 #define TNY_OLPC_DEVICE_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), TNY_TYPE_OLPC_DEVICE, TnyOlpcDeviceClass)) 33 #define TNY_IS_OLPC_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TNY_TYPE_OLPC_DEVICE)) 34 #define TNY_IS_OLPC_DEVICE_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), TNY_TYPE_OLPC_DEVICE)) 35 #define TNY_OLPC_DEVICE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), TNY_TYPE_OLPC_DEVICE, TnyOlpcDeviceClass)) 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 _TnyOlpcDevice TnyOlpcDevice; 40 typedef struct _TnyOlpcDeviceClass TnyOlpcDeviceClass; 41 41 42 struct _Tny Device42 struct _TnyOlpcDevice 43 43 { 44 44 GObject parent; 45 45 }; 46 46 47 struct _Tny DeviceClass47 struct _TnyOlpcDeviceClass 48 48 { 49 49 GObjectClass parent; 50 50 }; 51 51 52 GType tny_ device_get_type (void);52 GType tny_olpc_device_get_type (void); 53 53 54 TnyDevice * tny_device_new (void);54 TnyDeviceIface* tny_olpc_device_new (void); 55 55 56 56 G_END_DECLS trunk/libtinymail-olpc/tny-olpc-password-dialog.c
r876 r878 22 22 23 23 #include <gtk/gtk.h> 24 #include <tny- password-dialog.h>24 #include <tny-olpc-password-dialog.h> 25 25 26 26 static GObjectClass *parent_class = NULL; 27 27 28 typedef struct _Tny PasswordDialogPriv TnyPasswordDialogPriv;28 typedef struct _TnyOlpcPasswordDialogPriv TnyOlpcPasswordDialogPriv; 29 29 30 struct _Tny PasswordDialogPriv30 struct _TnyOlpcPasswordDialogPriv 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_OLPC_PASSWORD_DIALOG_GET_PRIVATE(o) \ 37 (G_TYPE_INSTANCE_GET_PRIVATE ((o), TNY_TYPE_OLPC_PASSWORD_DIALOG, TnyOlpcPasswordDialogPriv)) 38 38 39 39 40 40 /** 41 * tny_ password_dialog_set_prompt:42 * @self: A #Tny PasswordDialog object41 * tny_olpc_password_dialog_set_prompt: 42 * @self: A #TnyOlpcPasswordDialog 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_olpc_password_dialog_set_prompt (TnyOlpcPasswordDialog *self, const gchar *prompt) 48 48 { 49 Tny PasswordDialogPriv *priv = TNY_PASSWORD_DIALOG_GET_PRIVATE (self);49 TnyOlpcPasswordDialogPriv *priv = TNY_OLPC_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_olpc_password_dialog_get_password: 58 * @self: A #TnyOlpcPasswordDialog 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_olpc_password_dialog_get_password (TnyOlpcPasswordDialog *self) 64 64 { 65 Tny PasswordDialogPriv *priv = TNY_PASSWORD_DIALOG_GET_PRIVATE (self);65 TnyOlpcPasswordDialogPriv *priv = TNY_OLPC_PASSWORD_DIALOG_GET_PRIVATE (self); 66 66 67 67 return gtk_entry_get_text (priv->pwd_entry); … … 69 69 70 70 /** 71 * tny_ password_dialog_new:71 * tny_olpc_password_dialog_new: 72 72 * 73 73 * 74 * Return value: A new # TnyPasswordDialog instance implemented for Gtk+74 * Return value: A new #GtkDialog password dialog instance implemented for Gtk+ 75 75 **/ 76 TnyPasswordDialog*77 tny_ password_dialog_new (void)76 GtkDialog* 77 tny_olpc_password_dialog_new (void) 78 78 { 79 Tny PasswordDialog *self = g_object_new (TNY_TYPE_PASSWORD_DIALOG, NULL);79 TnyOlpcPasswordDialog *self = g_object_new (TNY_TYPE_OLPC_PASSWORD_DIALOG, NULL); 80 80 81 return self;81 return GTK_DIALOG (self); 82 82 } 83 83 84 84 static void 85 tny_ password_dialog_instance_init (GTypeInstance *instance, gpointer g_class)85 tny_olpc_password_dialog_instance_init (GTypeInstance *instance, gpointer g_class) 86 86 { 87 Tny PasswordDialog *self = (TnyPasswordDialog *)instance;88 Tny PasswordDialogPriv *priv = TNY_PASSWORD_DIALOG_GET_PRIVATE (self);87 TnyOlpcPasswordDialog *self = (TnyOlpcPasswordDialog *)instance; 88 TnyOlpcPasswordDialogPriv *priv = TNY_OLPC_PASSWORD_DIALOG_GET_PRIVATE (self); 89 89 90 90 gtk_dialog_add_buttons (GTK_DIALOG (self), GTK_STOCK_OK, GTK_RESPONSE_OK, … … 113 113 114 114 static void 115 tny_ password_dialog_finalize (GObject *object)115 tny_olpc_password_dialog_finalize (GObject *object) 116 116 { 117 Tny PasswordDialog *self = (TnyPasswordDialog *)object;117 TnyOlpcPasswordDialog *self = (TnyOlpcPasswordDialog *)object; 118 118 119 119 (*parent_class->finalize) (object); … … 124 124 125 125 static void 126 tny_ password_dialog_class_init (TnyPasswordDialogClass *class)126 tny_olpc_password_dialog_class_init (TnyOlpcPasswordDialogClass *class) 127 127 { 128 128 GObjectClass *object_class; … … 132 132 object_class = (GObjectClass*) class; 133 133 134 object_class->finalize = tny_ password_dialog_finalize;134 object_class->finalize = tny_olpc_password_dialog_finalize; 135 135 136 g_type_class_add_private (object_class, sizeof (Tny PasswordDialogPriv));136 g_type_class_add_private (object_class, sizeof (TnyOlpcPasswordDialogPriv)); 137 137 138 138 return; … … 140 140 141 141 GType 142 tny_ password_dialog_get_type (void)142 tny_olpc_password_dialog_get_type (void) 143 143 { 144 144 static GType type = 0; … … 148 148 static const GTypeInfo info = 149 149 { 150 sizeof (Tny PasswordDialogClass),150 sizeof (TnyOlpcPasswordDialogClass), 151 151 NULL, /* base_init */ 152 152 NULL, /* base_finalize */ 153 (GClassInitFunc) tny_ password_dialog_class_init, /* class_init */153 (GClassInitFunc) tny_olpc_password_dialog_class_init, /* class_init */ 154 154 NULL, /* class_finalize */ 155 155 NULL, /* class_data */ 156 sizeof (Tny PasswordDialog),156 sizeof (TnyOlpcPasswordDialog), 157 157 0, /* n_preallocs */ 158 tny_ password_dialog_instance_init /* instance_init */158 tny_olpc_password_dialog_instance_init /* instance_init */ 159 159 }; 160 160 161 161 type = g_type_register_static (GTK_TYPE_DIALOG, 162 "Tny PasswordDialog",162 "TnyOlpcPasswordDialog", 163 163 &info, 0); 164 164 trunk/libtinymail-olpc/tny-olpc-password-dialog.h
r876 r878 1 #ifndef TNY_ PASSWORD_DIALOG_H2 #define TNY_ PASSWORD_DIALOG_H1 #ifndef TNY_OLPC_PASSWORD_DIALOG_H 2 #define TNY_OLPC_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_OLPC_PASSWORD_DIALOG (tny_olpc_password_dialog_get_type ()) 29 #define TNY_OLPC_PASSWORD_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TNY_TYPE_OLPC_PASSWORD_DIALOG, TnyOlpcPasswordDialog)) 30 #define TNY_OLPC_PASSWORD_DIALOG_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), TNY_TYPE_OLPC_PASSWORD_DIALOG, TnyOlpcPasswordDialogClass)) 31 #define TNY_IS_OLPC_PASSWORD_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TNY_TYPE_OLPC_PASSWORD_DIALOG)) 32 #define TNY_IS_OLPC_PASSWORD_DIALOG_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), TNY_TYPE_OLPC_PASSWORD_DIALOG)) 33 #define TNY_OLPC_PASSWORD_DIALOG_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), TNY_TYPE_OLPC_PASSWORD_DIALOG, TnyOlpcPasswordDialogClass)) 34 34 35 typedef struct _Tny PasswordDialog TnyPasswordDialog;36 typedef struct _Tny PasswordDialogClass TnyPasswordDialogClass;35 typedef struct _TnyOlpcPasswordDialog TnyOlpcPasswordDialog; 36 typedef struct _TnyOlpcPasswordDialogClass TnyOlpcPasswordDialogClass; 37 37 38 struct _Tny PasswordDialog38 struct _TnyOlpcPasswordDialog 39 39 { 40 40 GtkDialog parent; 41 41 }; 42 42 43 struct _Tny PasswordDialogClass43 struct _TnyOlpcPasswordDialogClass 44 44 { 45 45 GtkDialogClass parent_class; 46 46 }; 47 47 48 GType tny_password_dialog_get_type(void);49 TnyPasswordDialog* tny_password_dialog_new(void);48 GType tny_olpc_password_dialog_get_type (void); 49 GtkDialog* tny_olpc_password_dialog_new (void); 50 50 51 const gchar* tny_password_dialog_get_password (TnyPasswordDialog *self);52 void tny_password_dialog_set_prompt (TnyPasswordDialog *self, const gchar *prompt);51 const gchar* tny_olpc_password_dialog_get_password (TnyOlpcPasswordDialog *self); 52 void tny_olpc_password_dialog_set_prompt (TnyOlpcPasswordDialog *self, const gchar *prompt); 53 53 54 54 G_END_DECLS
