Changeset 3
- Timestamp:
- 10/28/07 00:51:43
- Files:
-
- trunk (modified) (1 prop)
- trunk/.svnignore (added)
- trunk/ChangeLog (modified) (1 diff)
- trunk/autogen.sh (modified) (1 diff)
- trunk/configure.ac (modified) (1 diff)
- trunk/src/Makefile.am (modified) (1 diff)
- trunk/src/main.c (modified) (2 diffs)
- trunk/src/tmut-account-store.c (deleted)
- trunk/src/tmut-account-store.h (deleted)
- trunk/src/tmut-device.c (deleted)
- trunk/src/tmut-device.h (deleted)
- trunk/src/tmut-folder-view.c (added)
- trunk/src/tmut-folder-view.h (added)
- trunk/src/tmut-menu-view.c (added)
- trunk/src/tmut-menu-view.h (added)
- trunk/src/tmut-msg-view.c (added)
- trunk/src/tmut-msg-view.h (added)
- trunk/src/tmut-password-dialog.c (deleted)
- trunk/src/tmut-password-dialog.h (deleted)
- trunk/src/tmut-platform-factory.c (modified) (12 diffs)
- trunk/src/tmut-platform-factory.h (modified) (2 diffs)
- trunk/src/tmut-summary-view.c (deleted)
- trunk/src/tmut-summary-view.h (deleted)
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 1 2007-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 1 9 2007-03-28 Philip Van Hoof <pvanhoof@gnome.org> 2 10 trunk/autogen.sh
r1 r3 8 8 9 9 (test -f $srcdir/configure.ac \ 10 && test -f $srcdir/src/tmut- account-store.c) || {10 && test -f $srcdir/src/tmut-menu-view.c) || { 11 11 echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" 12 12 echo " top-level $PKG_NAME directory" trunk/configure.ac
r1 r3 15 15 AC_PROG_LIBTOOL 16 16 17 PKG_CHECK_MODULES(TMUT, gtk+-2.0 >= 2.6 libtinymail-1.0 libtinymail-camel-1.0 libtinymailui-1.0 libtinymailui-gtk-1.0) 17 PKG_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 18 26 AC_SUBST(TMUT_CFLAGS) 19 27 AC_SUBST(TMUT_LIBS) trunk/src/Makefile.am
r1 r3 1 INCLUDES = $(TMUT_CFLAGS) 1 INCLUDES = $(TMUT_CFLAGS) -DGNOMEDESKTOP 2 2 3 3 bin_PROGRAMS = tmut 4 4 5 5 tmut_SOURCES = main.c \ 6 tmut-account-store.c \7 tmut-account-store.h \8 tmut-summary-view.c \9 tmut-summary-view.h \10 6 tmut-platform-factory.c \ 11 7 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 16 15 17 16 tmut_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 1 20 #include <gtk/gtk.h> 2 21 22 #include <tny-account-store.h> 23 #include <tny-account-store-view.h> 24 3 25 #include "tmut-platform-factory.h" 4 #include "tmut-account-store.h" 5 #include "tmut-summary-view.h" 26 #include "tmut-menu-view.h" 6 27 7 28 int … … 12 33 TnyAccountStore *account_store; 13 34 TnyAccountStoreView *view; 35 GtkProgressBar *progressbar; 36 GtkWidget *box; 14 37 15 38 if (!g_thread_supported ()) 16 39 g_thread_init (NULL); 40 17 41 gdk_threads_init (); 42 18 43 gdk_threads_enter (); 19 44 gtk_init (&argc, &argv); 20 45 21 46 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); 23 54 24 55 platfact = tmut_platform_factory_get_instance (); 25 56 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); 28 61 tny_account_store_view_set_account_store (view, account_store); 29 62 30 gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (view)); 31 63 gtk_container_add (GTK_CONTAINER (window), box); 32 64 g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), 0); 33 65 34 66 gtk_widget_show (window); 67 35 68 gtk_main(); 36 69 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 */ 1 19 #include <config.h> 2 20 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> 8 45 #include <tny-camel-mime-part.h> 9 46 #include <tny-camel-msg.h> … … 18 55 19 56 57 20 58 static TnyMsg* 21 59 tmut_platform_factory_new_msg (TnyPlatformFactory *self) … … 35 73 tmut_platform_factory_new_account_store (TnyPlatformFactory *self) 36 74 { 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 38 90 } 39 91 … … 41 93 tmut_platform_factory_new_device (TnyPlatformFactory *self) 42 94 { 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 44 111 } 45 112 … … 47 114 tmut_platform_factory_new_msg_view (TnyPlatformFactory *self) 48 115 { 49 return tny_gtk_msg_view_new (); 116 return tmut_msg_view_new (); 117 } 118 119 static TnyPasswordGetter* 120 tmut_platform_factory_new_password_getter (TnyPlatformFactory *self) 121 { 122 return tny_gtk_password_dialog_new (); 50 123 } 51 124 … … 54 127 * 55 128 * 56 * Return value: The #T nyPlatformFactory singleton instance implemented for TMUT129 * Return value: The #TMutPlatformFactory singleton instance 57 130 **/ 58 131 TnyPlatformFactory* … … 68 141 tmut_platform_factory_finalize (GObject *object) 69 142 { 70 TMutPlatformFactory *self = (TMutPlatformFactory *)object;71 72 143 (*parent_class->finalize) (object); 73 144 … … 77 148 78 149 static void 79 t ny_platform_factory_init (gpointer g, gpointer iface_data)150 tmut_platform_factory_init (gpointer g, gpointer iface_data) 80 151 { 81 152 TnyPlatformFactoryIface *klass = (TnyPlatformFactoryIface *)g; … … 86 157 klass->new_msg_func = tmut_platform_factory_new_msg; 87 158 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 165 static TnyPlatformFactory *the_singleton = NULL; 95 166 96 167 static GObject* … … 100 171 GObject *object; 101 172 102 /* TODO: potential problem: singleton without lock */ 103 104 if (G_UNLIKELY (!the_singleton)) 105 { 173 if (G_UNLIKELY (!the_singleton)) { 106 174 object = G_OBJECT_CLASS (parent_class)->constructor (type, 107 175 n_construct_params, construct_params); 108 176 109 the_singleton = TMUT_PLATFORM_FACTORY (object); 110 } 111 else 112 { 177 the_singleton = TNY_PLATFORM_FACTORY (object); 178 } else { 113 179 object = G_OBJECT (the_singleton); 114 180 g_object_freeze_notify (G_OBJECT(the_singleton)); … … 152 218 }; 153 219 154 static const GInterfaceInfo t ny_platform_factory_info =220 static const GInterfaceInfo tmut_platform_factory_info = 155 221 { 156 (GInterfaceInitFunc) t ny_platform_factory_init, /* interface_init */222 (GInterfaceInitFunc) tmut_platform_factory_init, /* interface_init */ 157 223 NULL, /* interface_finalize */ 158 224 NULL /* interface_data */ … … 164 230 165 231 g_type_add_interface_static (type, TNY_TYPE_PLATFORM_FACTORY, 166 &tny_platform_factory_info); 167 232 &tmut_platform_factory_info); 168 233 } 169 234 trunk/src/tmut-platform-factory.h
r1 r3 1 1 #ifndef TMUT_PLATFORM_FACTORY_H 2 2 #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 */ 3 22 4 23 #include <glib.h> … … 30 49 31 50 GType tmut_platform_factory_get_type (void); 32 33 51 TnyPlatformFactory* tmut_platform_factory_get_instance (void); 34 52
