Changeset 878

Show
Ignore:
Timestamp:
09/04/06 22:51:14
Author:
pvanhoof
Message:

Renamed the OLPC types in libtinymail-olpc

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ChangeLog

    r877 r878  
    33        * Renamed the GPE types in libtinymail-gpe 
    44        * Renamed the Maemo types in libtinymail-maemo 
     5        * Renamed the OLPC types in libtinymail-olpc 
     6 
    57        * Made compilation of the demo-ui optional 
    68        * Added some ifdefs to the demo-ui 
    79 
    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 
    912 
    10132006-09-04  Philip Van Hoof <pvanhoof@gnome.org> 
  • trunk/configure.ac

    r877 r878  
    6868        PLATFORM=1 
    6969        ;; 
    70   olpc) 
    71         PLATFORMDIR=libtinymail-olpc 
    72         build_gtkhtml=false 
    73         build_mozembed=false 
    74         build_gnome=false 
    75         with_html_component=none 
    76         build_demoui=true 
    77         PLATFORM=4 
    78         ;; 
    7970  maemo) 
    8071        PLATFORMDIR=libtinymail-maemo 
     
    9182        PLATFORM=3 
    9283        ;; 
     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        ;; 
    9393  *)  
    9494        PLATFORMDIR=${with_platform} 
  • trunk/libtinymail-olpc/Makefile.am

    r848 r878  
    1111lib_LTLIBRARIES = libtinymail-olpc-1.0.la 
    1212 
    13 libtinymail_olpc_1_0_headers =                 
    14         tny-account-store.h                     
    15         tny-password-dialog.h                   
    16         tny-device.h                           
    17         tny-platform-factory.h 
     13libtinymail_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 
    1818 
    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.c 
     19libtinymail_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 
    2626 
    2727libtinymail_olpc_1_0_la_LIBADD =        \ 
  • trunk/libtinymail-olpc/tny-olpc-account-store.c

    r876 r878  
    2828 
    2929#include <tny-platform-factory-iface.h> 
    30 #include <tny-platform-factory.h> 
     30#include <tny-olpc-platform-factory.h> 
    3131 
    3232#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> 
    3535#include <tny-account-iface.h> 
    3636#include <tny-store-account-iface.h> 
     
    4242#include <tny-camel-transport-account.h> 
    4343#include <tny-session-camel.h> 
    44 #include <tny-device.h> 
     44#include <tny-olpc-device.h> 
    4545 
    4646/* GKeyFile vs. Camel implementation */ 
     
    4848static GObjectClass *parent_class = NULL; 
    4949 
    50 typedef struct _TnyAccountStorePriv TnyAccountStorePriv; 
    51  
    52 struct _TnyAccountStorePriv 
     50typedef struct _TnyOlpcAccountStorePriv TnyOlpcAccountStorePriv; 
     51 
     52struct _TnyOlpcAccountStorePriv 
    5353{ 
    5454        gchar *cache_dir; 
     
    5858}; 
    5959 
    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)) 
    6262 
    6363 
     
    7777        if (G_UNLIKELY (!retval)) 
    7878        { 
    79                 GtkDialog *dialog = GTK_DIALOG (tny_password_dialog_new ()); 
     79                GtkDialog *dialog = GTK_DIALOG (tny_olpc_password_dialog_new ()); 
    8080         
    81                 tny_password_dialog_set_prompt (TNY_PASSWORD_DIALOG (dialog), prompt); 
     81                tny_olpc_password_dialog_set_prompt (TNY_OLPC_PASSWORD_DIALOG (dialog), prompt); 
    8282 
    8383                if (G_LIKELY (gtk_dialog_run (dialog) == GTK_RESPONSE_OK)) 
    8484                { 
    85                         const gchar *pwd = tny_password_dialog_get_password  
    86                                 (TNY_PASSWORD_DIALOG (dialog)); 
     85                        const gchar *pwd = tny_olpc_password_dialog_get_password  
     86                                (TNY_OLPC_PASSWORD_DIALOG (dialog)); 
    8787         
    8888                        retval = g_strdup (pwd); 
     
    135135 
    136136static gboolean 
    137 tny_account_store_alert (TnyAccountStoreIface *self, TnyAlertType type, const gchar *prompt) 
     137tny_olpc_account_store_alert (TnyAccountStoreIface *self, TnyAlertType type, const gchar *prompt) 
    138138{ 
    139139        GtkMessageType gtktype; 
     
    168168 
    169169static const gchar* 
    170 tny_account_store_get_cache_dir (TnyAccountStoreIface *self) 
    171 { 
    172         TnyAccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self); 
     170tny_olpc_account_store_get_cache_dir (TnyAccountStoreIface *self) 
     171{ 
     172        TnyOlpcAccountStorePriv *priv = TNY_OLPC_ACCOUNT_STORE_GET_PRIVATE (self); 
    173173 
    174174        if (!priv->cache_dir) 
     
    180180 
    181181static void 
    182 tny_account_store_get_accounts (TnyAccountStoreIface *self, TnyListIface *list, TnyGetAccountsRequestType types) 
    183 { 
    184         TnyAccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self); 
     182tny_olpc_account_store_get_accounts (TnyAccountStoreIface *self, TnyListIface *list, TnyGetAccountsRequestType types) 
     183{ 
     184        TnyOlpcAccountStorePriv *priv = TNY_OLPC_ACCOUNT_STORE_GET_PRIVATE (self); 
    185185        const gchar *filen; 
    186186        gchar *configd; 
     
    313313 
    314314static void 
    315 tny_account_store_add_account (TnyAccountStoreIface *self, TnyAccountIface *account, const gchar *type) 
     315tny_olpc_account_store_add_account (TnyAccountStoreIface *self, TnyAccountIface *account, const gchar *type) 
    316316{ 
    317317        g_warning ("Not implemented\n"); 
     
    323323 
    324324static void 
    325 tny_account_store_add_store_account (TnyAccountStoreIface *self, TnyStoreAccountIface *account) 
    326 { 
    327         TnyAccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self); 
    328  
    329         tny_account_store_add_account (self, TNY_ACCOUNT_IFACE (account), "store"); 
     325tny_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"); 
    330330 
    331331        g_signal_emit (self, tny_account_store_iface_signals [TNY_ACCOUNT_STORE_IFACE_ACCOUNT_INSERTED], 0, account); 
     
    335335 
    336336static void 
    337 tny_account_store_add_transport_account (TnyAccountStoreIface *self, TnyTransportAccountIface *account) 
    338 { 
    339         TnyAccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self); 
    340  
    341         tny_account_store_add_account (self, TNY_ACCOUNT_IFACE (account), "transport"); 
     337tny_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"); 
    342342 
    343343        g_signal_emit (self, tny_account_store_iface_signals [TNY_ACCOUNT_STORE_IFACE_ACCOUNT_INSERTED], 0, account); 
     
    347347 
    348348static TnyDeviceIface* 
    349 tny_account_store_get_device (TnyAccountStoreIface *self) 
    350 { 
    351         TnyAccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self); 
     349tny_olpc_account_store_get_device (TnyAccountStoreIface *self) 
     350{ 
     351        TnyOlpcAccountStorePriv *priv = TNY_OLPC_ACCOUNT_STORE_GET_PRIVATE (self); 
    352352 
    353353        return priv->device; 
     
    355355 
    356356/** 
    357  * tny_account_store_new: 
    358  * 
    359  * 
    360  * Return value: A new #TnyAccountStoreIface instance 
     357 * tny_olpc_account_store_new: 
     358 * 
     359 * 
     360 * Return value: A new #TnyAccountStoreIface implemented for OLPC 
    361361 **/ 
    362 TnyAccountStore
    363 tny_account_store_new (void) 
    364 { 
    365         TnyAccountStore *self = g_object_new (TNY_TYPE_ACCOUNT_STORE, NULL); 
    366         TnyAccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self); 
     362TnyAccountStoreIface
     363tny_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); 
    367367        priv->session = tny_session_camel_new (TNY_ACCOUNT_STORE_IFACE (self)); 
    368368 
    369         return self
    370 } 
    371  
    372  
    373 static void 
    374 tny_account_store_instance_init (GTypeInstance *instance, gpointer g_class) 
    375 { 
    376         TnyAccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (instance); 
     369        return TNY_ACCOUNT_STORE_IFACE (self)
     370} 
     371 
     372 
     373static void 
     374tny_olpc_account_store_instance_init (GTypeInstance *instance, gpointer g_class) 
     375{ 
     376        TnyOlpcAccountStorePriv *priv = TNY_OLPC_ACCOUNT_STORE_GET_PRIVATE (instance); 
    377377        TnyPlatformFactoryIface *platfact = TNY_PLATFORM_FACTORY_IFACE ( 
    378                 tny_platform_factory_get_instance ()); 
     378                tny_olpc_platform_factory_get_instance ()); 
    379379 
    380380        priv->device = tny_platform_factory_iface_new_device (platfact); 
     
    386386 
    387387static void 
    388 tny_account_store_finalize (GObject *object) 
     388tny_olpc_account_store_finalize (GObject *object) 
    389389{        
    390         TnyAccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (object); 
     390        TnyOlpcAccountStorePriv *priv = TNY_OLPC_ACCOUNT_STORE_GET_PRIVATE (object); 
    391391 
    392392        if (priv->cache_dir) 
     
    400400 
    401401/** 
    402  * tny_account_store_get_session: 
    403  * @self: The #TnyAccountStore instance 
     402 * tny_olpc_account_store_get_session: 
     403 * @self: The #TnyOlpcAccountStore instance 
    404404 * 
    405405 * Return value: A #TnySessionCamel instance 
    406406 **/ 
    407407TnySessionCamel* 
    408 tny_account_store_get_session (TnyAccountStore *self) 
    409 { 
    410         TnyAccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self); 
     408tny_olpc_account_store_get_session (TnyOlpcAccountStore *self) 
     409{ 
     410        TnyOlpcAccountStorePriv *priv = TNY_OLPC_ACCOUNT_STORE_GET_PRIVATE (self); 
    411411 
    412412        return priv->session; 
     
    414414 
    415415static void  
    416 tny_account_store_class_init (TnyAccountStoreClass *class) 
     416tny_olpc_account_store_class_init (TnyOlpcAccountStoreClass *class) 
    417417{ 
    418418        GObjectClass *object_class; 
     
    421421        object_class = (GObjectClass*) class; 
    422422 
    423         object_class->finalize = tny_account_store_finalize; 
    424  
    425         g_type_class_add_private (object_class, sizeof (TnyAccountStorePriv)); 
     423        object_class->finalize = tny_olpc_account_store_finalize; 
     424 
     425        g_type_class_add_private (object_class, sizeof (TnyOlpcAccountStorePriv)); 
    426426 
    427427        return; 
     
    433433        TnyAccountStoreIfaceClass *klass = (TnyAccountStoreIfaceClass *)g_iface; 
    434434 
    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; 
    441441 
    442442        return; 
     
    445445 
    446446GType  
    447 tny_account_store_get_type (void) 
     447tny_olpc_account_store_get_type (void) 
    448448{ 
    449449        static GType type = 0; 
     
    453453                static const GTypeInfo info =  
    454454                { 
    455                   sizeof (TnyAccountStoreClass), 
     455                  sizeof (TnyOlpcAccountStoreClass), 
    456456                  NULL,   /* base_init */ 
    457457                  NULL,   /* base_finalize */ 
    458                   (GClassInitFunc) tny_account_store_class_init,   /* class_init */ 
     458                  (GClassInitFunc) tny_olpc_account_store_class_init,   /* class_init */ 
    459459                  NULL,   /* class_finalize */ 
    460460                  NULL,   /* class_data */ 
    461                   sizeof (TnyAccountStore), 
     461                  sizeof (TnyOlpcAccountStore), 
    462462                  0,      /* n_preallocs */ 
    463                   tny_account_store_instance_init    /* instance_init */ 
     463                  tny_olpc_account_store_instance_init    /* instance_init */ 
    464464                }; 
    465465 
     
    472472 
    473473                type = g_type_register_static (G_TYPE_OBJECT, 
    474                         "TnyAccountStore", 
     474                        "TnyOlpcAccountStore", 
    475475                        &info, 0); 
    476476 
  • trunk/libtinymail-olpc/tny-olpc-account-store.h

    r876 r878  
    1 #ifndef TNY_ACCOUNT_STORE_H 
    2 #define TNY_ACCOUNT_STORE_H 
     1#ifndef TNY_OLPC_ACCOUNT_STORE_H 
     2#define TNY_OLPC_ACCOUNT_STORE_H 
    33 
    44/* tinymail - Tiny Mail 
     
    2828G_BEGIN_DECLS 
    2929 
    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)) 
    3636 
    37 typedef struct _TnyAccountStore TnyAccountStore; 
    38 typedef struct _TnyAccountStoreClass TnyAccountStoreClass; 
     37typedef struct _TnyOlpcAccountStore TnyOlpcAccountStore; 
     38typedef struct _TnyOlpcAccountStoreClass TnyOlpcAccountStoreClass; 
    3939 
    40 struct _TnyAccountStore 
     40struct _TnyOlpcAccountStore 
    4141{ 
    4242        GObject parent; 
    4343}; 
    4444 
    45 struct _TnyAccountStoreClass 
     45struct _TnyOlpcAccountStoreClass 
    4646{ 
    4747        GObjectClass parent; 
    4848}; 
    4949 
    50 GType               tny_account_store_get_type      (void); 
    51 TnyAccountStore*    tny_account_store_new            (void); 
    52 TnySessionCamel*    tny_account_store_get_session    (TnyAccountStore *self); 
     50GType tny_olpc_account_store_get_type (void); 
     51TnyAccountStoreIface* tny_olpc_account_store_new (void); 
     52TnySessionCamel* tny_olpc_account_store_get_session (TnyOlpcAccountStore *self); 
    5353 
    5454G_END_DECLS 
  • trunk/libtinymail-olpc/tny-olpc-device-priv.h

    r876 r878  
    1 #ifndef TNY_DEVICE_PRIV_H 
    2 #define TNY_DEVICE_PRIV_H 
     1#ifndef TNY_OLPC_DEVICE_PRIV_H 
     2#define TNY_OLPC_DEVICE_PRIV_H 
    33 
    44/* libtinymail-camel - The Tiny Mail base library for Camel 
     
    2121 */ 
    2222 
    23 typedef struct _TnyDevicePriv TnyDevicePriv; 
     23typedef struct _TnyOlpcDevicePriv TnyOlpcDevicePriv; 
    2424 
    25 struct _TnyDevicePriv 
     25struct _TnyOlpcDevicePriv 
    2626{ 
    2727        gboolean forced, fset; 
     
    2929 
    3030 
    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)) 
    3333 
    3434#endif 
  • trunk/libtinymail-olpc/tny-olpc-device.c

    r876 r878  
    2222#include <glib/gi18n-lib.h> 
    2323 
    24 #include <tny-device.h> 
     24#include <tny-olpc-device.h> 
    2525 
    2626static GObjectClass *parent_class = NULL; 
    2727 
    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 
     30static void tny_olpc_device_on_online (TnyDeviceIface *self); 
     31static void tny_olpc_device_on_offline (TnyDeviceIface *self); 
     32static gboolean tny_olpc_device_is_online (TnyDeviceIface *self); 
    3333 
    3434 
    3535static void  
    36 tny_device_reset (TnyDeviceIface *self) 
    37 { 
    38         TnyDevicePriv *priv = TNY_DEVICE_GET_PRIVATE (self); 
     36tny_olpc_device_reset (TnyDeviceIface *self) 
     37{ 
     38        TnyOlpcDevicePriv *priv = TNY_OLPC_DEVICE_GET_PRIVATE (self); 
    3939 
    4040        priv->fset = FALSE; 
     
    4444 
    4545static void  
    46 tny_device_force_online (TnyDeviceIface *self) 
    47 { 
    48         TnyDevicePriv *priv = TNY_DEVICE_GET_PRIVATE (self); 
     46tny_olpc_device_force_online (TnyDeviceIface *self) 
     47{ 
     48        TnyOlpcDevicePriv *priv = TNY_OLPC_DEVICE_GET_PRIVATE (self); 
    4949 
    5050        priv->fset = TRUE; 
    5151        priv->forced = TRUE; 
    5252 
    53         tny_device_on_online (self); 
    54  
    55         return; 
    56 } 
    57  
    58  
    59 static void 
    60 tny_device_force_offline (TnyDeviceIface *self) 
    61 { 
    62         TnyDevicePriv *priv = TNY_DEVICE_GET_PRIVATE (self); 
     53        tny_olpc_device_on_online (self); 
     54 
     55        return; 
     56} 
     57 
     58 
     59static void 
     60tny_olpc_device_force_offline (TnyDeviceIface *self) 
     61{ 
     62        TnyOlpcDevicePriv *priv = TNY_OLPC_DEVICE_GET_PRIVATE (self); 
    6363 
    6464        priv->fset = TRUE; 
     
    6666 
    6767 
    68         tny_device_on_offline (self); 
     68        tny_olpc_device_on_offline (self); 
    6969         
    7070        return; 
     
    7272 
    7373static void 
    74 tny_device_on_online (TnyDeviceIface *self) 
     74tny_olpc_device_on_online (TnyDeviceIface *self) 
    7575{ 
    7676        g_signal_emit (self, tny_device_iface_signals [TNY_DEVICE_IFACE_CONNECTION_CHANGED], 0, TRUE); 
     
    8080 
    8181static void 
    82 tny_device_on_offline (TnyDeviceIface *self) 
     82tny_olpc_device_on_offline (TnyDeviceIface *self) 
    8383{ 
    8484        g_signal_emit (self, tny_device_iface_signals [TNY_DEVICE_IFACE_CONNECTION_CHANGED], 0, FALSE); 
     
    8888 
    8989static gboolean 
    90 tny_device_is_online (TnyDeviceIface *self) 
    91 { 
    92         TnyDevicePriv *priv = TNY_DEVICE_GET_PRIVATE (self); 
     90tny_olpc_device_is_online (TnyDeviceIface *self) 
     91{ 
     92        TnyOlpcDevicePriv *priv = TNY_OLPC_DEVICE_GET_PRIVATE (self); 
    9393        gboolean retval = FALSE; 
    9494        return retval; 
     
    9696 
    9797static void 
    98 tny_device_instance_init (GTypeInstance *instance, gpointer g_class) 
    99 { 
    100         TnyDevice *self = (TnyDevice *)instance; 
    101         TnyDevicePriv *priv = TNY_DEVICE_GET_PRIVATE (self); 
     98tny_olpc_device_instance_init (GTypeInstance *instance, gpointer g_class) 
     99{ 
     100        TnyOlpcDevice *self = (TnyOlpcDevice *)instance; 
     101        TnyOlpcDevicePriv *priv = TNY_OLPC_DEVICE_GET_PRIVATE (self); 
    102102 
    103103        return; 
     
    107107 
    108108/** 
    109  * tny_device_new: 
    110  * 
    111  * Return value: A new #TnyDeviceIface instance 
     109 * tny_olpc_device_new: 
     110 * 
     111 * Return value: A new #TnyDeviceIface implemented for OLPC 
    112112 **/ 
    113 TnyDevice
    114 tny_device_new (void) 
    115 { 
    116         TnyDevice *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         TnyDevice *self = (TnyDevice *)object;         
    126         TnyDevicePriv *priv = TNY_DEVICE_GET_PRIVATE (self); 
     113TnyDeviceIface
     114tny_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 
     122static void 
     123tny_olpc_device_finalize (GObject *object) 
     124{ 
     125        TnyOlpcDevice *self = (TnyOlpcDevice *)object;         
     126        TnyOlpcDevicePriv *priv = TNY_OLPC_DEVICE_GET_PRIVATE (self); 
    127127 
    128128        (*parent_class->finalize) (object); 
     
    137137        TnyDeviceIfaceClass *klass = (TnyDeviceIfaceClass *)g_iface; 
    138138 
    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; 
    143143 
    144144        return; 
     
    148148 
    149149static void  
    150 tny_device_class_init (TnyDeviceClass *class) 
     150tny_olpc_device_class_init (TnyOlpcDeviceClass *class) 
    151151{ 
    152152        GObjectClass *object_class; 
     
    155155        object_class = (GObjectClass*) class; 
    156156 
    157         object_class->finalize = tny_device_finalize; 
    158  
    159         g_type_class_add_private (object_class, sizeof (TnyDevicePriv)); 
     157        object_class->finalize = tny_olpc_device_finalize; 
     158 
     159        g_type_class_add_private (object_class, sizeof (TnyOlpcDevicePriv)); 
    160160 
    161161        return; 
     
    163163 
    164164GType  
    165 tny_device_get_type (void) 
     165tny_olpc_device_get_type (void) 
    166166{ 
    167167        static GType type = 0; 
     
    171171                static const GTypeInfo info =  
    172172                { 
    173                   sizeof (TnyDeviceClass), 
     173                  sizeof (TnyOlpcDeviceClass), 
    174174                  NULL,   /* base_init */ 
    175175                  NULL,   /* base_finalize */ 
    176                   (GClassInitFunc) tny_device_class_init,   /* class_init */ 
     176                  (GClassInitFunc) tny_olpc_device_class_init,   /* class_init */ 
    177177                  NULL,   /* class_finalize */ 
    178178                  NULL,   /* class_data */ 
    179                   sizeof (TnyDevice), 
     179                  sizeof (TnyOlpcDevice), 
    180180                  0,      /* n_preallocs */ 
    181                   tny_device_instance_init    /* instance_init */ 
     181                  tny_olpc_device_instance_init    /* instance_init */ 
    182182                }; 
    183183 
     
    190190 
    191191                type = g_type_register_static (G_TYPE_OBJECT, 
    192                         "TnyDevice", 
     192                        "TnyOlpcDevice", 
    193193                        &info, 0); 
    194194 
  • trunk/libtinymail-olpc/tny-olpc-device.h

    r876 r878  
    1 #ifndef TNY_DEVICE_H 
    2 #define TNY_DEVICE_H 
     1#ifndef TNY_OLPC_DEVICE_H 
     2#define TNY_OLPC_DEVICE_H 
    33 
    44/* libtinymail-camel - The Tiny Mail base library for Camel 
     
    2828G_BEGIN_DECLS 
    2929 
    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)) 
    3636 
    3737/* This is an abstract type */ 
    3838 
    39 typedef struct _TnyDevice TnyDevice; 
    40 typedef struct _TnyDeviceClass TnyDeviceClass; 
     39typedef struct _TnyOlpcDevice TnyOlpcDevice; 
     40typedef struct _TnyOlpcDeviceClass TnyOlpcDeviceClass; 
    4141 
    42 struct _TnyDevice 
     42struct _TnyOlpcDevice 
    4343{ 
    4444        GObject parent; 
    4545}; 
    4646 
    47 struct _TnyDeviceClass  
     47struct _TnyOlpcDeviceClass  
    4848{ 
    4949        GObjectClass parent; 
    5050}; 
    5151 
    52 GType tny_device_get_type (void); 
     52GType tny_olpc_device_get_type (void); 
    5353 
    54 TnyDevice* tny_device_new (void); 
     54TnyDeviceIface* tny_olpc_device_new (void); 
    5555 
    5656G_END_DECLS 
  • trunk/libtinymail-olpc/tny-olpc-password-dialog.c

    r876 r878  
    2222 
    2323#include <gtk/gtk.h> 
    24 #include <tny-password-dialog.h> 
     24#include <tny-olpc-password-dialog.h> 
    2525 
    2626static GObjectClass *parent_class = NULL; 
    2727 
    28 typedef struct _TnyPasswordDialogPriv TnyPasswordDialogPriv; 
     28typedef struct _TnyOlpcPasswordDialogPriv TnyOlpcPasswordDialogPriv; 
    2929 
    30 struct _TnyPasswordDialogPriv 
     30struct _TnyOlpcPasswordDialogPriv 
    3131{ 
    3232        GtkEntry *pwd_entry; 
     
    3434}; 
    3535 
    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)) 
    3838 
    3939 
    4040/** 
    41  * tny_password_dialog_set_prompt: 
    42  * @self: A #TnyPasswordDialog object 
     41 * tny_olpc_password_dialog_set_prompt: 
     42 * @self: A #TnyOlpcPasswordDialog object 
    4343 * @prompt: The prompt to set 
    4444 *  
    4545 **/ 
    4646void 
    47 tny_password_dialog_set_prompt (TnyPasswordDialog *self, const gchar *prompt) 
     47tny_olpc_password_dialog_set_prompt (TnyOlpcPasswordDialog *self, const gchar *prompt) 
    4848{ 
    49         TnyPasswordDialogPriv *priv = TNY_PASSWORD_DIALOG_GET_PRIVATE (self); 
     49        TnyOlpcPasswordDialogPriv *priv = TNY_OLPC_PASSWORD_DIALOG_GET_PRIVATE (self); 
    5050 
    5151        gtk_label_set_text (priv->prompt_label, prompt); 
     
    5555 
    5656/** 
    57  * tny_password_dialog_get_password: 
    58  * @self: A #TnyPasswordDialog object 
     57 * tny_olpc_password_dialog_get_password: 
     58 * @self: A #TnyOlpcPasswordDialog object 
    5959 * 
    6060 * Return value: The password (read-only) as typed by the user 
    6161 **/ 
    6262const gchar* 
    63 tny_password_dialog_get_password (TnyPasswordDialog *self) 
     63tny_olpc_password_dialog_get_password (TnyOlpcPasswordDialog *self) 
    6464{ 
    65         TnyPasswordDialogPriv *priv = TNY_PASSWORD_DIALOG_GET_PRIVATE (self); 
     65        TnyOlpcPasswordDialogPriv *priv = TNY_OLPC_PASSWORD_DIALOG_GET_PRIVATE (self); 
    6666 
    6767        return gtk_entry_get_text (priv->pwd_entry); 
     
    6969 
    7070/** 
    71  * tny_password_dialog_new: 
     71 * tny_olpc_password_dialog_new: 
    7272 *  
    7373 * 
    74  * Return value: A new #TnyPasswordDialog instance implemented for Gtk+ 
     74 * Return value: A new #GtkDialog password dialog instance implemented for Gtk+ 
    7575 **/ 
    76 TnyPasswordDialog* 
    77 tny_password_dialog_new (void) 
     76GtkDialog* 
     77tny_olpc_password_dialog_new (void) 
    7878{ 
    79         TnyPasswordDialog *self = g_object_new (TNY_TYPE_PASSWORD_DIALOG, NULL); 
     79        TnyOlpcPasswordDialog *self = g_object_new (TNY_TYPE_OLPC_PASSWORD_DIALOG, NULL); 
    8080 
    81         return self
     81        return GTK_DIALOG (self)
    8282} 
    8383 
    8484static void 
    85 tny_password_dialog_instance_init (GTypeInstance *instance, gpointer g_class) 
     85tny_olpc_password_dialog_instance_init (GTypeInstance *instance, gpointer g_class) 
    8686{ 
    87         TnyPasswordDialog *self = (TnyPasswordDialog *)instance; 
    88         TnyPasswordDialogPriv *priv = TNY_PASSWORD_DIALOG_GET_PRIVATE (self); 
     87        TnyOlpcPasswordDialog *self = (TnyOlpcPasswordDialog *)instance; 
     88        TnyOlpcPasswordDialogPriv *priv = TNY_OLPC_PASSWORD_DIALOG_GET_PRIVATE (self); 
    8989 
    9090        gtk_dialog_add_buttons (GTK_DIALOG (self), GTK_STOCK_OK, GTK_RESPONSE_OK, 
     
    113113 
    114114static void 
    115 tny_password_dialog_finalize (GObject *object) 
     115tny_olpc_password_dialog_finalize (GObject *object) 
    116116{ 
    117         TnyPasswordDialog *self = (TnyPasswordDialog *)object;         
     117        TnyOlpcPasswordDialog *self = (TnyOlpcPasswordDialog *)object;         
    118118         
    119119        (*parent_class->finalize) (object); 
     
    124124 
    125125static void  
    126 tny_password_dialog_class_init (TnyPasswordDialogClass *class) 
     126tny_olpc_password_dialog_class_init (TnyOlpcPasswordDialogClass *class) 
    127127{ 
    128128        GObjectClass *object_class; 
     
    132132        object_class = (GObjectClass*) class; 
    133133 
    134         object_class->finalize = tny_password_dialog_finalize; 
     134        object_class->finalize = tny_olpc_password_dialog_finalize; 
    135135 
    136         g_type_class_add_private (object_class, sizeof (TnyPasswordDialogPriv)); 
     136        g_type_class_add_private (object_class, sizeof (TnyOlpcPasswordDialogPriv)); 
    137137 
    138138        return; 
     
    140140 
    141141GType  
    142 tny_password_dialog_get_type (void) 
     142tny_olpc_password_dialog_get_type (void) 
    143143{ 
    144144        static GType type = 0; 
     
    148148                static const GTypeInfo info =  
    149149                { 
    150                   sizeof (TnyPasswordDialogClass), 
     150                  sizeof (TnyOlpcPasswordDialogClass), 
    151151                  NULL,   /* base_init */ 
    152152                  NULL,   /* base_finalize */ 
    153                   (GClassInitFunc) tny_password_dialog_class_init,   /* class_init */ 
     153                  (GClassInitFunc) tny_olpc_password_dialog_class_init,   /* class_init */ 
    154154                  NULL,   /* class_finalize */ 
    155155                  NULL,   /* class_data */ 
    156                   sizeof (TnyPasswordDialog), 
     156                  sizeof (TnyOlpcPasswordDialog), 
    157157                  0,      /* n_preallocs */ 
    158                   tny_password_dialog_instance_init    /* instance_init */ 
     158                  tny_olpc_password_dialog_instance_init    /* instance_init */ 
    159159                }; 
    160160 
    161161                type = g_type_register_static (GTK_TYPE_DIALOG, 
    162                         "TnyPasswordDialog", 
     162                        "TnyOlpcPasswordDialog", 
    163163                        &info, 0); 
    164164 
  • trunk/libtinymail-olpc/tny-olpc-password-dialog.h

    r876 r878  
    1 #ifndef TNY_PASSWORD_DIALOG_H 
    2 #define TNY_PASSWORD_DIALOG_H 
     1#ifndef TNY_OLPC_PASSWORD_DIALOG_H 
     2#define TNY_OLPC_PASSWORD_DIALOG_H 
    33 
    44/* tinymail - Tiny Mail 
     
    2626G_BEGIN_DECLS 
    2727 
    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)) 
    3434 
    35 typedef struct _TnyPasswordDialog TnyPasswordDialog; 
    36 typedef struct _TnyPasswordDialogClass TnyPasswordDialogClass; 
     35typedef struct _TnyOlpcPasswordDialog TnyOlpcPasswordDialog; 
     36typedef struct _TnyOlpcPasswordDialogClass TnyOlpcPasswordDialogClass; 
    3737 
    38 struct _TnyPasswordDialog 
     38struct _TnyOlpcPasswordDialog 
    3939{ 
    4040        GtkDialog parent; 
    4141}; 
    4242 
    43 struct _TnyPasswordDialogClass 
     43struct _TnyOlpcPasswordDialogClass 
    4444{ 
    4545        GtkDialogClass parent_class; 
    4646}; 
    4747 
    48 GType               tny_password_dialog_get_type      (void); 
    49 TnyPasswordDialog*  tny_password_dialog_new            (void); 
     48GType tny_olpc_password_dialog_get_type (void); 
     49GtkDialog* tny_olpc_password_dialog_new (void); 
    5050 
    51 const gchar*        tny_password_dialog_get_password   (TnyPasswordDialog *self); 
    52 void                tny_password_dialog_set_prompt     (TnyPasswordDialog *self, const gchar *prompt); 
     51const gchar* tny_olpc_password_dialog_get_password (TnyOlpcPasswordDialog *self); 
     52void tny_olpc_password_dialog_set_prompt (TnyOlpcPasswordDialog *self, const gchar *prompt); 
    5353 
    5454G_END_DECLS