Changeset 3

Show
Ignore:
Timestamp:
10/28/07 00:51:43
Author:
pvanhoof
Message:

2007-10-28 Philip Van Hoof <pvanhoof@gnome.org>

        • First actual implementations, made something that works
        • Implemented TMutMenuView
        • Implemented main.c
        • Implemented TMutPlatformFactory
        • Created project's infrastructure
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk

    • Property svn:ignore changed from configure Makefile.in config.log depcomp config.status config.guess stamp-h1 config.h ltmain.sh config.sub config.h.in autom4te.cache libtool missing aclocal.m4 Makefile install-sh to configure Makefile.in config.log depcomp config.guess config.h config.sub ltmain.sh Makefile config.status stamp-h1 config.h.in libtool autom4te.cache missing aclocal.m4 install-sh TODO.tasks .tm_project2.cache tmut.anjuta
  • trunk/ChangeLog

    r1 r3  
     12007-10-28  Philip Van Hoof  <pvanhoof@gnome.org> 
     2 
     3        * First actual implementations, made something that works 
     4        * Implemented TMutMenuView 
     5        * Implemented main.c 
     6        * Implemented TMutPlatformFactory 
     7        * Created project's infrastructure 
     8 
    192007-03-28  Philip Van Hoof  <pvanhoof@gnome.org> 
    210 
  • trunk/autogen.sh

    r1 r3  
    88 
    99(test -f $srcdir/configure.ac \ 
    10   && test -f $srcdir/src/tmut-account-store.c) || { 
     10  && test -f $srcdir/src/tmut-menu-view.c) || { 
    1111    echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" 
    1212    echo " top-level $PKG_NAME directory" 
  • trunk/configure.ac

    r1 r3  
    1515AC_PROG_LIBTOOL 
    1616 
    17 PKG_CHECK_MODULES(TMUT, gtk+-2.0 >= 2.6 libtinymail-1.0 libtinymail-camel-1.0 libtinymailui-1.0 libtinymailui-gtk-1.0)  
     17PKG_CHECK_MODULES(TMUT,  
     18        gtk+-2.0 >= 2.6  
     19        libtinymail-1.0  
     20        libtinymail-camel-1.0  
     21        libtinymailui-1.0  
     22        libtinymailui-gtk-1.0 
     23        libtinymail-gnome-desktop-1.0 
     24)  
     25 
    1826AC_SUBST(TMUT_CFLAGS) 
    1927AC_SUBST(TMUT_LIBS) 
  • trunk/src/Makefile.am

    r1 r3  
    1 INCLUDES = $(TMUT_CFLAGS) 
     1INCLUDES = $(TMUT_CFLAGS) -DGNOMEDESKTOP 
    22 
    33bin_PROGRAMS = tmut 
    44 
    55tmut_SOURCES = main.c \ 
    6         tmut-account-store.c \ 
    7         tmut-account-store.h \ 
    8         tmut-summary-view.c \ 
    9         tmut-summary-view.h \ 
    106        tmut-platform-factory.c \ 
    117        tmut-platform-factory.h \ 
    12         tmut-device.c \ 
    13         tmut-device.h \ 
    14         tmut-password-dialog.c \ 
    15         tmut-password-dialog.h 
     8        tmut-menu-view.c \ 
     9        tmut-menu-view.h \ 
     10        tmut-folder-view.c \ 
     11        tmut-folder-view.h \ 
     12        tmut-msg-view.c \ 
     13        tmut-msg-view.h  
     14          
    1615 
    1716tmut_LDFLAGS = $(TMUT_LIBS) 
  • trunk/src/main.c

    r1 r3  
     1/* TMut 
     2 * Copyright (C) 2006-2007 Philip Van Hoof <pvanhoof@gnome.org> 
     3 * 
     4 * This library is free software; you can redistribute it and/or 
     5 * modify it under the terms of the GNU Lesser General Public 
     6 * License as published by the Free Software Foundation; either 
     7 * version 2 of the License, or (at your option) any later version. 
     8 * 
     9 * This library is distributed in the hope that it will be useful, 
     10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
     11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     12 * Lesser General Public License for more details. 
     13 * 
     14 * You should have received a copy of the GNU Lesser General Public 
     15 * License along with self library; if not, write to the 
     16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 
     17 * Boston, MA 02110-1301, USA. 
     18 */ 
     19 
    120#include <gtk/gtk.h> 
    221 
     22#include <tny-account-store.h> 
     23#include <tny-account-store-view.h> 
     24 
    325#include "tmut-platform-factory.h" 
    4 #include "tmut-account-store.h" 
    5 #include "tmut-summary-view.h" 
     26#include "tmut-menu-view.h" 
    627 
    728int  
     
    1233        TnyAccountStore *account_store; 
    1334        TnyAccountStoreView *view; 
     35        GtkProgressBar *progressbar; 
     36        GtkWidget *box; 
    1437 
    1538        if (!g_thread_supported ())  
    1639                g_thread_init (NULL); 
     40 
    1741        gdk_threads_init (); 
     42 
    1843        gdk_threads_enter (); 
    1944        gtk_init (&argc, &argv); 
    2045 
    2146        window = gtk_window_new (GTK_WINDOW_TOPLEVEL); 
    22         gtk_window_set_title (GTK_WINDOW (window), "TMUT"); 
     47        gtk_window_set_title (GTK_WINDOW (window), "TMut"); 
     48 
     49        box = gtk_vbox_new (FALSE, 0); 
     50        gtk_widget_show (GTK_WIDGET (box)); 
     51        progressbar = GTK_PROGRESS_BAR (gtk_progress_bar_new ()); 
     52        gtk_widget_show (GTK_WIDGET (progressbar)); 
     53        gtk_box_pack_start (GTK_BOX (box), GTK_WIDGET (progressbar), FALSE, TRUE, 0); 
    2354 
    2455        platfact = tmut_platform_factory_get_instance (); 
    2556        account_store = tny_platform_factory_new_account_store (platfact); 
    26          
    27         view = TNY_ACCOUNT_STORE_VIEW (tmut_summary_view_new ()); 
     57 
     58        view = TNY_ACCOUNT_STORE_VIEW (tmut_menu_view_new (GTK_PROGRESS (progressbar))); 
     59        gtk_widget_show (GTK_WIDGET (view)); 
     60        gtk_box_pack_start (GTK_BOX (box), GTK_WIDGET (view), TRUE, TRUE, 0); 
    2861        tny_account_store_view_set_account_store (view, account_store); 
    2962 
    30         gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (view)); 
    31  
     63        gtk_container_add (GTK_CONTAINER (window), box); 
    3264        g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), 0); 
    3365 
    3466        gtk_widget_show (window); 
     67 
    3568        gtk_main(); 
    3669        gdk_threads_leave (); 
  • trunk/src/tmut-platform-factory.c

    r1 r3  
     1/* TMut 
     2 * Copyright (C) 2006-2007 Philip Van Hoof <pvanhoof@gnome.org> 
     3 * 
     4 * This library is free software; you can redistribute it and/or 
     5 * modify it under the terms of the GNU Lesser General Public 
     6 * License as published by the Free Software Foundation; either 
     7 * version 2 of the License, or (at your option) any later version. 
     8 * 
     9 * This library is distributed in the hope that it will be useful, 
     10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
     11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     12 * Lesser General Public License for more details. 
     13 * 
     14 * You should have received a copy of the GNU Lesser General Public 
     15 * License along with self library; if not, write to the 
     16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 
     17 * Boston, MA 02110-1301, USA. 
     18 */ 
    119#include <config.h> 
    220 
    3 #include <tmut-platform-factory.h> 
    4 #include <tmut-account-store.h> 
    5 #include <tmut-device.h> 
    6  
    7 #include <tny-gtk-msg-view.h> 
     21#include "tmut-platform-factory.h" 
     22#include "tmut-msg-view.h" 
     23 
     24#ifdef MAEMO 
     25#include <tny-maemo-account-store.h> 
     26#include <tny-maemo-device.h> 
     27#endif 
     28 
     29#ifdef GNOMEDESKTOP 
     30#include <tny-gnome-account-store.h> 
     31#include <tny-gnome-device.h> 
     32#endif 
     33 
     34#ifdef OLPC 
     35#include <tny-olpc-account-store.h> 
     36#include <tny-olpc-device.h> 
     37#endif 
     38 
     39#ifdef GPE 
     40#include <tny-gpe-account-store.h> 
     41#include <tny-gpe-device.h> 
     42#endif 
     43 
     44#include <tny-gtk-password-dialog.h> 
    845#include <tny-camel-mime-part.h> 
    946#include <tny-camel-msg.h> 
     
    1855 
    1956 
     57 
    2058static TnyMsg* 
    2159tmut_platform_factory_new_msg (TnyPlatformFactory *self) 
     
    3573tmut_platform_factory_new_account_store (TnyPlatformFactory *self) 
    3674{ 
    37         return TNY_ACCOUNT_STORE (tmut_account_store_new ()); 
     75#ifdef GNOMEDESKTOP 
     76        return tny_gnome_account_store_new (); 
     77#endif 
     78 
     79#ifdef GPE 
     80        return tny_gpe_account_store_new (); 
     81#endif 
     82 
     83#ifdef MAEMO 
     84        return tny_maemo_account_store_new (); 
     85#endif 
     86 
     87#ifdef OLPC 
     88        return tny_olpc_account_store_new (); 
     89#endif 
    3890} 
    3991 
     
    4193tmut_platform_factory_new_device (TnyPlatformFactory *self) 
    4294{ 
    43         return TNY_DEVICE (tmut_device_new ()); 
     95#ifdef GNOMEDESKTOP 
     96        return tny_gnome_device_new (); 
     97#endif 
     98 
     99#ifdef GPE 
     100        return tny_gpe_device_new (); 
     101#endif 
     102 
     103#ifdef MAEMO 
     104        return tny_maemo_device_new (); 
     105#endif 
     106 
     107#ifdef OLPC 
     108        return tny_olpc_device_new (); 
     109#endif 
     110 
    44111} 
    45112 
     
    47114tmut_platform_factory_new_msg_view (TnyPlatformFactory *self) 
    48115{ 
    49         return tny_gtk_msg_view_new ();     
     116        return tmut_msg_view_new (); 
     117
     118 
     119static TnyPasswordGetter* 
     120tmut_platform_factory_new_password_getter (TnyPlatformFactory *self) 
     121
     122        return tny_gtk_password_dialog_new (); 
    50123} 
    51124 
     
    54127 * 
    55128 * 
    56  * Return value: The #TnyPlatformFactory singleton instance implemented for TMUT 
     129 * Return value: The #TMutPlatformFactory singleton instance 
    57130 **/ 
    58131TnyPlatformFactory* 
     
    68141tmut_platform_factory_finalize (GObject *object) 
    69142{ 
    70         TMutPlatformFactory *self = (TMutPlatformFactory *)object;       
    71  
    72143        (*parent_class->finalize) (object); 
    73144 
     
    77148 
    78149static void 
    79 tny_platform_factory_init (gpointer g, gpointer iface_data) 
     150tmut_platform_factory_init (gpointer g, gpointer iface_data) 
    80151{ 
    81152        TnyPlatformFactoryIface *klass = (TnyPlatformFactoryIface *)g; 
     
    86157        klass->new_msg_func = tmut_platform_factory_new_msg; 
    87158        klass->new_mime_part_func = tmut_platform_factory_new_mime_part; 
    88  
    89         return; 
    90 
    91  
    92  
    93 static TMutPlatformFactory *the_singleton = NULL; 
    94  
     159        klass->new_password_getter_func = tmut_platform_factory_new_password_getter; 
     160 
     161        return; 
     162
     163 
     164 
     165static TnyPlatformFactory *the_singleton = NULL; 
    95166 
    96167static GObject* 
     
    100171        GObject *object; 
    101172 
    102         /* TODO: potential problem: singleton without lock */ 
    103  
    104         if (G_UNLIKELY (!the_singleton)) 
    105         { 
     173        if (G_UNLIKELY (!the_singleton)) { 
    106174                object = G_OBJECT_CLASS (parent_class)->constructor (type, 
    107175                                n_construct_params, construct_params); 
    108176 
    109                 the_singleton = TMUT_PLATFORM_FACTORY (object); 
    110         } 
    111         else 
    112         { 
     177                the_singleton = TNY_PLATFORM_FACTORY (object); 
     178        } else { 
    113179                object = G_OBJECT (the_singleton); 
    114180                g_object_freeze_notify (G_OBJECT(the_singleton)); 
     
    152218                }; 
    153219 
    154                 static const GInterfaceInfo tny_platform_factory_info =  
     220                static const GInterfaceInfo tmut_platform_factory_info =  
    155221                { 
    156                   (GInterfaceInitFunc) tny_platform_factory_init, /* interface_init */ 
     222                  (GInterfaceInitFunc) tmut_platform_factory_init, /* interface_init */ 
    157223                  NULL,         /* interface_finalize */ 
    158224                  NULL          /* interface_data */ 
     
    164230 
    165231                g_type_add_interface_static (type, TNY_TYPE_PLATFORM_FACTORY,  
    166                         &tny_platform_factory_info); 
    167  
     232                        &tmut_platform_factory_info); 
    168233        } 
    169234 
  • trunk/src/tmut-platform-factory.h

    r1 r3  
    11#ifndef TMUT_PLATFORM_FACTORY_H 
    22#define TMUT_PLATFORM_FACTORY_H 
     3 
     4/* TMut 
     5 * Copyright (C) 2006-2007 Philip Van Hoof <pvanhoof@gnome.org> 
     6 * 
     7 * This library is free software; you can redistribute it and/or 
     8 * modify it under the terms of the GNU Lesser General Public 
     9 * License as published by the Free Software Foundation; either 
     10 * version 2 of the License, or (at your option) any later version. 
     11 * 
     12 * This library is distributed in the hope that it will be useful, 
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     15 * Lesser General Public License for more details. 
     16 * 
     17 * You should have received a copy of the GNU Lesser General Public 
     18 * License along with self library; if not, write to the 
     19 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 
     20 * Boston, MA 02110-1301, USA. 
     21 */ 
    322 
    423#include <glib.h> 
     
    3049 
    3150GType tmut_platform_factory_get_type (void); 
    32  
    3351TnyPlatformFactory* tmut_platform_factory_get_instance (void); 
    3452