Send commitlog mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:

   1. r1457 - in trunk/oe/packages/openmoko-base: . files
      ([EMAIL PROTECTED])
   2. r1458 - trunk/oe/packages/sysvinit ([EMAIL PROTECTED])
   3. r1459 - in
      trunk/src/target/OM-2007/artwork/icons/openmoko-standard/scalable:        
      . stock ([EMAIL PROTECTED])
   4. r1460 - in
      trunk/src/target/OM-2007/applications/openmoko-today: . src
      ([EMAIL PROTECTED])
   5. r1461 - in
      trunk/src/target/OM-2007/applications/openmoko-rssreader: . data
      src ([EMAIL PROTECTED])
--- Begin Message ---
Author: mickey
Date: 2007-03-21 14:39:41 +0100 (Wed, 21 Mar 2007)
New Revision: 1457

Added:
   trunk/oe/packages/openmoko-base/openmoko-session_svn.bb
Modified:
   trunk/oe/packages/openmoko-base/files/session
   trunk/oe/packages/openmoko-base/openmoko-common_svn.bb
Log:
oe/openmoko-session: launch dialer in background within session file (taken 
from OE)
NOTE: starting dialer from main menu is just a workaround until the AUX button 
handling is done


Modified: trunk/oe/packages/openmoko-base/files/session
===================================================================
--- trunk/oe/packages/openmoko-base/files/session       2007-03-21 12:34:09 UTC 
(rev 1456)
+++ trunk/oe/packages/openmoko-base/files/session       2007-03-21 13:39:41 UTC 
(rev 1457)
@@ -2,16 +2,18 @@
 
 SHOWCURSOR="no"
 
-rxvt &
-sleep 2
-
-matchbox-desktop --icon-size 100 \
+matchbox-desktop --icon-size 96 \
                  --icon-padding 60 \
                  --font sans-16 \
                  --titlefont sans-20:bold \
                  --bg 
img-tiled:/usr/share/themes/openmoko-standard/gtk-2.0/mokopanedwindow-upper-enclosing.png
 &
 #                 --bg col-gradient-vertical:#000000,#aaaaaa &
-matchbox-panel --orientation north -b 
/usr/share/openmoko/pixmaps/openmoko-header-background.png &
-matchbox-panel --orientation south -b 
/usr/share/openmoko/pixmaps/openmoko-footer-background.png -ns -nm --id 2 &
+matchbox-panel --start-applets=showdesktop,systray,windowselector 
--end-applets=openmoko-panel-demo-simple,openmoko-panel-battery,openmoko-panel-clock,openmoko-panel-gsm
 &
+
+#start some old-style panel plugins to get a keyboard and battery status
+mbinputmgr &
+
+openmoko-footer &
+openmoko-dialer &
 exec matchbox-window-manager -use_titlebar no -use_cursor $SHOWCURSOR $@
 

Modified: trunk/oe/packages/openmoko-base/openmoko-common_svn.bb
===================================================================
--- trunk/oe/packages/openmoko-base/openmoko-common_svn.bb      2007-03-21 
12:34:09 UTC (rev 1456)
+++ trunk/oe/packages/openmoko-base/openmoko-common_svn.bb      2007-03-21 
13:39:41 UTC (rev 1457)
@@ -1,7 +1,7 @@
 DESCRIPTION = "Common files for the OpenMoko distribution"
 SECTION = "openmoko/base"
 PV = "0.0+svn${SRCDATE}"
-PR = "r1"
+PR = "r8"
 
 inherit openmoko-base
 

Added: trunk/oe/packages/openmoko-base/openmoko-session_svn.bb
===================================================================
--- trunk/oe/packages/openmoko-base/openmoko-session_svn.bb     2007-03-21 
12:34:09 UTC (rev 1456)
+++ trunk/oe/packages/openmoko-base/openmoko-session_svn.bb     2007-03-21 
13:39:41 UTC (rev 1457)
@@ -0,0 +1,29 @@
+DESCRIPTION = "Matchbox session files for OpenMoko"
+SECTION = "openmoko/base"
+RDEPENDS = "matchbox gconf matchbox-applet-startup-monitor 
gtk-theme-clearlooks"
+PV = "0.0+svn${SRCDATE}"
+PR = "r7"
+
+inherit openmoko-base
+
+SRC_URI = 
"${OPENMOKO_MIRROR}/src/target/${OPENMOKO_RELEASE};module=etc;proto=http \
+           file://session"
+S = "${WORKDIR}"
+
+do_install() {
+       cp -R ${S}/etc ${D}/${sysconfdir}
+       rm -fR ${D}/${sysconfdir}/.svn
+       rm -fR ${D}/${sysconfdir}/matchbox/.svn
+       chmod -R 755 ${D}/${sysconfdir}
+        # DEMO only!
+       install -m 0755 ${WORKDIR}/session ${D}/${sysconfdir}/matchbox/session
+}
+
+pkg_postinst_openmoko-session () {
+#!/bin/sh -e
+if [ "x$D" != "x" ]; then
+    exit 1
+fi
+
+gconftool-2 --config-source=xml::$D${sysconfdir}/gconf/gconf.xml.defaults 
--direct --type string --set /desktop/openmoko/interface/theme Clearlooks
+}




--- End Message ---
--- Begin Message ---
Author: mickey
Date: 2007-03-21 14:40:14 +0100 (Wed, 21 Mar 2007)
New Revision: 1458

Modified:
   trunk/oe/packages/sysvinit/sysvinit_2.86.bb
Log:
oe/sysvinit: bump PR


Modified: trunk/oe/packages/sysvinit/sysvinit_2.86.bb
===================================================================
--- trunk/oe/packages/sysvinit/sysvinit_2.86.bb 2007-03-21 13:39:41 UTC (rev 
1457)
+++ trunk/oe/packages/sysvinit/sysvinit_2.86.bb 2007-03-21 13:40:14 UTC (rev 
1458)
@@ -2,7 +2,7 @@
 SECTION = "base"
 LICENSE = "GPL"
 HOMEPAGE = "http://freshmeat.net/projects/sysvinit/";
-PR = "r31"
+PR = "r33"
 
 # USE_VT and SERIAL_CONSOLE are generally defined by the MACHINE .conf.
 # Set PACKAGE_ARCH appropriately.




--- End Message ---
--- Begin Message ---
Author: thomas
Date: 2007-03-21 15:28:29 +0100 (Wed, 21 Mar 2007)
New Revision: 1459

Added:
   trunk/src/target/OM-2007/artwork/icons/openmoko-standard/scalable/Makefile.am
   
trunk/src/target/OM-2007/artwork/icons/openmoko-standard/scalable/stock/Makefile.am
Log:
* Add missing makefiles


Added: 
trunk/src/target/OM-2007/artwork/icons/openmoko-standard/scalable/Makefile.am
===================================================================
--- 
trunk/src/target/OM-2007/artwork/icons/openmoko-standard/scalable/Makefile.am   
    2007-03-21 13:40:14 UTC (rev 1458)
+++ 
trunk/src/target/OM-2007/artwork/icons/openmoko-standard/scalable/Makefile.am   
    2007-03-21 14:28:29 UTC (rev 1459)
@@ -0,0 +1,2 @@
+SUBDIRS=stock
+MAINTAINERCLEANFILES = Makefile.in

Added: 
trunk/src/target/OM-2007/artwork/icons/openmoko-standard/scalable/stock/Makefile.am
===================================================================
--- 
trunk/src/target/OM-2007/artwork/icons/openmoko-standard/scalable/stock/Makefile.am
 2007-03-21 13:40:14 UTC (rev 1458)
+++ 
trunk/src/target/OM-2007/artwork/icons/openmoko-standard/scalable/stock/Makefile.am
 2007-03-21 14:28:29 UTC (rev 1459)
@@ -0,0 +1,6 @@
+themedir = $(datadir)/icons/openmoko-standard
+size = scalable
+context = stock
+iconsdir = $(themedir)/$(size)/$(context)
+icons_DATA = gtk-about.svg gtk-add.svg gtk-apply.svg gtk-bold.svg 
gtk-cancel.svg gtk-cdrom.svg gtk-clear.svg gtk-close.svg gtk-color-picker.svg 
gtk-connect.svg gtk-convert.svg gtk-copy.svg gtk-cut.svg gtk-delete.svg 
gtk-dialog-authentication.svg gtk-dialog-error.svg gtk-dialog-question.svg 
gtk-dialog-warning.svg gtk-directory.svg gtk-disconnect.svg 
gtk-dnd-multiple.svg gtk-dnd.svg gtk-edit.svg gtk-execute.svg gtk-file.svg 
gtk-find-and-replace.svg gtk-find.svg gtk-floppy.svg gtk-fullscreen.svg 
gtk-go-back.svg gtk-go-down.svg gtk-go-forward.svg gtk-goto-bottom.svg 
gtk-goto-first.svg gtk-goto-last.svg gtk-goto-top.svg gtk-go-up.svg 
gtk-harddisk.svg gtk-help.svg gtk-home.svg gtk-indent-ltr.svg 
gtk-indent-rtl.svg gtk-index.svg gtk-info.svg gtk-italic.svg 
gtk-jump-to-ltr.svg gtk-jump-to-rtl.svg gtk-justify-center.svg 
gtk-justify-fill.svg gtk-justify-left.svg gtk-justify-right.svg 
gtk-leave-fullscreen.svg gtk-media-forward.svg gtk-media-next.svg 
gtk-media-pause.svg gtk-media-play-ltr.svg gtk-media-play-rtl.svg 
gtk-media-previous-ltr.svg gtk-media-record.svg gtk-media-rewind-ltr.svg 
gtk-media-stop.svg gtk-missing-image.svg gtk-network.png.svg gtk-new.svg 
gtk-no.svg gtk-ok.svg gtk-open.svg gtk-orientation-landscape.svg 
gtk-orientation-portrait.svg gtk-orientation-reverse-landscape.svg 
gtk-orientation-reverse-portrait.svg gtk-paste.svg gtk-preferences.svg 
gtk-print-preview.svg gtk-print.svg gtk-properties.svg gtk-quit.svg 
gtk-redo.svg gtk-refresh.svg gtk-remove.svg gtk-revert-to-saved-ltr.svg 
gtk-revert-to-saved-rtl.svg gtk-save-as.svg gtk-save.svg gtk-select-color.svg 
gtk-select-font.svg gtk-sort-ascending.svg gtk-sort-descending.svg 
gtk-spell-check.svg gtk-strikethrough.svg gtk-undelete-ltr.svg 
gtk-undelete-rtl.svg gtk-underline.svg gtk-undo-ltr.svg gtk-unindent-ltr.svg 
gtk-unindent-rtl.svg gtk-yes.svg gtk-zoom-100.svg gtk-zoom-fit.svg 
gtk-zoom-in.svg gtk-zoom-out.svg
+EXTRA_DIST = $(icons_DATA)




--- End Message ---
--- Begin Message ---
Author: thomas
Date: 2007-03-21 18:38:30 +0100 (Wed, 21 Mar 2007)
New Revision: 1460

Modified:
   trunk/src/target/OM-2007/applications/openmoko-today/ChangeLog
   trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c
Log:
* src/today-main.c: Add support for icon themes, and assign applications to
the remaining launchers


Modified: trunk/src/target/OM-2007/applications/openmoko-today/ChangeLog
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-today/ChangeLog      
2007-03-21 14:28:29 UTC (rev 1459)
+++ trunk/src/target/OM-2007/applications/openmoko-today/ChangeLog      
2007-03-21 17:38:30 UTC (rev 1460)
@@ -1,3 +1,8 @@
+Wed, 21 Mar 2007 17:34:34 +0000 Thomas Wood
+
+       * src/today-main.c: Add support for icon themes, and assign 
applications to
+       the remaining launchers
+
 Tue, 20 Mar 2007 11:01:20 +0000 Thomas Wood
 
        * src/today-events-area.c: (render_event):

Modified: trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c       
2007-03-21 14:28:29 UTC (rev 1459)
+++ trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c       
2007-03-21 17:38:30 UTC (rev 1460)
@@ -143,7 +143,6 @@
 
 /**
  * today_launcher_button_new:
- * @icon: stock name to use as the icon in the button
  * @exec: command to execute when the button is clicked
  *
  * Utility function to create new launcher buttons
@@ -151,12 +150,23 @@
  * Return value: The parent widget of the new widgets
  */
 static GtkWidget *
-today_launcher_button_new (gchar * icon, gchar * exec)
+today_launcher_button_new (gchar * exec)
 {
   GtkWidget *button = moko_pixmap_button_new ();
-  GdkPixbuf *pb = gtk_widget_render_icon (button, icon, GTK_ICON_SIZE_BUTTON, 
"");
+  GdkPixbuf *pb;
+  GtkIconTheme *icon_theme = gtk_icon_theme_get_default ();
 
   /* libmokoui api really needs fixing... */
+
+  if (gtk_icon_theme_has_icon (icon_theme, exec))
+  {
+    pb = gtk_icon_theme_load_icon (icon_theme, exec, 48, 
GTK_ICON_LOOKUP_NO_SVG, NULL);
+  }
+  else
+  {
+    pb = gtk_icon_theme_load_icon (icon_theme, GTK_STOCK_MISSING_IMAGE, 48, 
GTK_ICON_LOOKUP_NO_SVG, NULL);
+  }
+
   moko_pixmap_button_set_finger_toolbox_btn_center_image_pixbuf (
       MOKO_PIXMAP_BUTTON (button), pb);
   g_object_unref (pb);
@@ -252,15 +262,15 @@
   gtk_box_pack_start (GTK_BOX (vbox), button_box, FALSE, FALSE, 0);
 
   gtk_container_add (GTK_CONTAINER (button_box),
-                     today_launcher_button_new (GTK_STOCK_EXECUTE, 
"contacts"));
+                     today_launcher_button_new ("openmoko-dialer"));
   gtk_container_add (GTK_CONTAINER (button_box),
-                     today_launcher_button_new (GTK_STOCK_EXECUTE, ""));
+                     today_launcher_button_new ("contacts"));
   gtk_container_add (GTK_CONTAINER (button_box),
-                     today_launcher_button_new (GTK_STOCK_EXECUTE, ""));
+                     today_launcher_button_new ("openmoko-messages"));
   gtk_container_add (GTK_CONTAINER (button_box),
-                     today_launcher_button_new (GTK_STOCK_EXECUTE, ""));
+                     today_launcher_button_new ("openmoko-gps"));
   gtk_container_add (GTK_CONTAINER (button_box),
-                     today_launcher_button_new (GTK_STOCK_EXECUTE, ""));
+                     today_launcher_button_new ("dates"));
 
   /* signals */
   g_signal_connect (G_OBJECT (window), "delete-event",




--- End Message ---
--- Begin Message ---
Author: zecke
Date: 2007-03-21 20:13:46 +0100 (Wed, 21 Mar 2007)
New Revision: 1461

Added:
   trunk/src/target/OM-2007/applications/openmoko-rssreader/AUTHORS
   trunk/src/target/OM-2007/applications/openmoko-rssreader/COPYING
   trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog
   trunk/src/target/OM-2007/applications/openmoko-rssreader/Makefile.am
   trunk/src/target/OM-2007/applications/openmoko-rssreader/NEWS
   trunk/src/target/OM-2007/applications/openmoko-rssreader/README
   trunk/src/target/OM-2007/applications/openmoko-rssreader/autogen.sh
   trunk/src/target/OM-2007/applications/openmoko-rssreader/configure.ac
   trunk/src/target/OM-2007/applications/openmoko-rssreader/data/
   trunk/src/target/OM-2007/applications/openmoko-rssreader/data/Makefile.am
   
trunk/src/target/OM-2007/applications/openmoko-rssreader/data/rssreader_refresh_all.png
   
trunk/src/target/OM-2007/applications/openmoko-rssreader/data/rssreader_subscribe.png
   trunk/src/target/OM-2007/applications/openmoko-rssreader/src/
   trunk/src/target/OM-2007/applications/openmoko-rssreader/src/Makefile.am
   
trunk/src/target/OM-2007/applications/openmoko-rssreader/src/application-data.h
   trunk/src/target/OM-2007/applications/openmoko-rssreader/src/callbacks.c
   trunk/src/target/OM-2007/applications/openmoko-rssreader/src/callbacks.h
   trunk/src/target/OM-2007/applications/openmoko-rssreader/src/main.c
Modified:
   trunk/src/target/OM-2007/applications/openmoko-rssreader/
Log:
openmoko-rssreader: Add the RSS Reader as announced on the mailinglist
    This application requires libmrss for feed reading. The application
    will eventually hang or segfault if you have at-spi running in your
    desktop as ATK/Gail/Orbit is not thread safe.



Property changes on: trunk/src/target/OM-2007/applications/openmoko-rssreader
___________________________________________________________________
Name: svn:ignore
   + Makefile.in
Makefile
*.bz2
mkinstalldirs
configure
depcomp
config.guess
ltmain.sh
config.sub
config.h.in
missing
aclocal.m4
install-sh


Added: trunk/src/target/OM-2007/applications/openmoko-rssreader/AUTHORS
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/AUTHORS    
2007-03-21 17:38:30 UTC (rev 1460)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/AUTHORS    
2007-03-21 19:13:46 UTC (rev 1461)
@@ -0,0 +1 @@
+Holger Hans Peter Freyther

Added: trunk/src/target/OM-2007/applications/openmoko-rssreader/COPYING
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/COPYING    
2007-03-21 17:38:30 UTC (rev 1460)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/COPYING    
2007-03-21 19:13:46 UTC (rev 1461)
@@ -0,0 +1,18 @@
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+

Added: trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog  
2007-03-21 17:38:30 UTC (rev 1460)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog  
2007-03-21 19:13:46 UTC (rev 1461)
@@ -0,0 +1,13 @@
+2007-03-20: Fix the size of the column headers
+       Combat the GtkTreeViewColumn sizing
+
+2007-03-20: Parse content of atom feeds manually
+       Parse content of ATOM feeds manually. Avoid setting NULL text inside the
+       GtkTextBuffer. Store content type and source inside the ListStore as 
well.
+
+2007-03-20: Fetch feeds inside a GThread
+       Fetching the feeds was implemented inside a GThread. gdk_threads_init et
+       alk is called and this works as long as AT-SPI is not enabled. If it is
+       enabled the application will eventuall crash.
+       Ekiga has the same trouble and it is documented as bug #329454 inside 
the
+       GNOME bug tracker.

Added: trunk/src/target/OM-2007/applications/openmoko-rssreader/Makefile.am
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/Makefile.am        
2007-03-21 17:38:30 UTC (rev 1460)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/Makefile.am        
2007-03-21 19:13:46 UTC (rev 1461)
@@ -0,0 +1,2 @@
+SUBDIRS = src data
+

Added: trunk/src/target/OM-2007/applications/openmoko-rssreader/NEWS
===================================================================

Added: trunk/src/target/OM-2007/applications/openmoko-rssreader/README
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/README     
2007-03-21 17:38:30 UTC (rev 1460)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/README     
2007-03-21 19:13:46 UTC (rev 1461)
@@ -0,0 +1,11 @@
+First try to get a Gtk+ GUI for libmrss
+
+
+Known design flaws:
+    -No real model for the feed
+    -No proxy model that makes use of the filter
+    -No caching of images
+    -Storage size is not limited
+    
+Main objective:
+    -Get familiar with the joy/pain of Gtk+
\ No newline at end of file

Added: trunk/src/target/OM-2007/applications/openmoko-rssreader/autogen.sh
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/autogen.sh 
2007-03-21 17:38:30 UTC (rev 1460)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/autogen.sh 
2007-03-21 19:13:46 UTC (rev 1461)
@@ -0,0 +1,4 @@
+#! /bin/sh
+autoreconf -v --install || exit 1
+glib-gettextize --force --copy || exit 1
+./configure --enable-maintainer-mode "$@"


Property changes on: 
trunk/src/target/OM-2007/applications/openmoko-rssreader/autogen.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/src/target/OM-2007/applications/openmoko-rssreader/configure.ac
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/configure.ac       
2007-03-21 17:38:30 UTC (rev 1460)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/configure.ac       
2007-03-21 19:13:46 UTC (rev 1461)
@@ -0,0 +1,21 @@
+AC_PREREQ([2.59])
+AC_INIT([openmoko-rssreader], [0.0.4], [http://openmoko.org])
+AM_INIT_AUTOMAKE([1.9 foreign dist-bzip2 no-dist-gzip])
+AC_CONFIG_SRCDIR(src/main.c)
+AM_CONFIG_HEADER(config.h)
+
+AC_PROG_CC
+AC_STDC_HEADERS
+AC_PROG_LIBTOOL
+
+# base deps
+PKG_CHECK_MODULES(OPENMOKO, openmoko-libs >= 0.0.1)
+PKG_CHECK_MODULES(MRSS,     mrss          >= 0.17 )
+PKG_CHECK_MODULES(GTHREAD,  gthread-2.0           )
+
+# output stuff
+AC_OUTPUT([
+Makefile
+src/Makefile
+data/Makefile
+])

Added: trunk/src/target/OM-2007/applications/openmoko-rssreader/data/Makefile.am
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/data/Makefile.am   
2007-03-21 17:38:30 UTC (rev 1460)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/data/Makefile.am   
2007-03-21 19:13:46 UTC (rev 1461)
@@ -0,0 +1,5 @@
+EXTRA_DIST = rssreader_refresh_all.png  rssreader_subscribe.png
+
+resourcedir = $(pkgdatadir)
+resource_DATA = rssreader_refresh_all.png  rssreader_subscribe.png
+

Added: 
trunk/src/target/OM-2007/applications/openmoko-rssreader/data/rssreader_refresh_all.png
===================================================================
(Binary files differ)


Property changes on: 
trunk/src/target/OM-2007/applications/openmoko-rssreader/data/rssreader_refresh_all.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: 
trunk/src/target/OM-2007/applications/openmoko-rssreader/data/rssreader_subscribe.png
===================================================================
(Binary files differ)


Property changes on: 
trunk/src/target/OM-2007/applications/openmoko-rssreader/data/rssreader_subscribe.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream


Property changes on: 
trunk/src/target/OM-2007/applications/openmoko-rssreader/src
___________________________________________________________________
Name: svn:ignore
   + *.*swp
*.swp
Makefile.in
Makefile


Added: trunk/src/target/OM-2007/applications/openmoko-rssreader/src/Makefile.am
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/src/Makefile.am    
2007-03-21 17:38:30 UTC (rev 1460)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/src/Makefile.am    
2007-03-21 19:13:46 UTC (rev 1461)
@@ -0,0 +1,12 @@
+AM_CPPFLAGS = -DDATADIR=\"$(datadir)\" \
+              -DPKGDATADIR=\"$(pkgdatadir)\"
+
+AM_CFLAGS = -Wall -Werror -pedantic -std=c99 @OPENMOKO_CFLAGS@ @MRSS_CFLAGS@
+
+bin_PROGRAMS = openmoko-rssreader
+
+EXTRA_DIST = application-data.h callbacks.h
+
+openmoko_rssreader_SOURCES = main.c callbacks.c
+openmoko_rssreader_LDADD = @OPENMOKO_LIBS@ @MRSS_LIBS@ @GTHREAD_LIBS@
+

Added: 
trunk/src/target/OM-2007/applications/openmoko-rssreader/src/application-data.h
===================================================================
--- 
trunk/src/target/OM-2007/applications/openmoko-rssreader/src/application-data.h 
    2007-03-21 17:38:30 UTC (rev 1460)
+++ 
trunk/src/target/OM-2007/applications/openmoko-rssreader/src/application-data.h 
    2007-03-21 19:13:46 UTC (rev 1461)
@@ -0,0 +1,83 @@
+/*
+ *  RSS Reader, a simple RSS reader
+ *
+ *  Copyright (C) 2007 Holger Hans Peter Freyther
+ *
+ *  Permission is hereby granted, free of charge, to any person obtaining a
+ *  copy of this software and associated documentation files (the "Software"),
+ *  to deal in the Software without restriction, including without limitation
+ *  the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ *  and/or sell copies of the Software, and to permit persons to whom the
+ *  Software is furnished to do so, subject to the following conditions:
+ *
+ *  The above copyright notice and this permission notice shall be included
+ *  in all copies or substantial portions of the Software.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ *  OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ *  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *  OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *  Current Version: $Rev$ ($Date$) [$Author$]
+ */
+
+#ifndef APPLICATION_DATA_H
+#define APPLICATION_DATA_H
+
+
+#include <libmokoui/moko-application.h>
+#include <libmokoui/moko-paned-window.h>
+#include <libmokoui/moko-tree-view.h>
+#include <libmokoui/moko-tool-box.h>
+
+#include <gtk/gtk.h>
+
+struct RSSReaderData {
+    MokoApplication   *app;
+    GtkMenu           *menu;
+    GtkMenu           *filter;
+    MokoPanedWindow   *window;
+    MokoToolBox       *box;
+    MokoMenuBox       *menubox;
+    MokoTreeView      *treeView;
+    GtkListStore      *feed_data;
+    GtkTextTagTable   *tagTable;
+    GtkTextBuffer     *textBuffer;
+    GtkTextView       *textView;
+
+    gchar             *current_filter;
+};
+
+/*
+ * Instead of having a real model we have this... as our feed
+ * model
+ * Either there is a link or text is included. And we contain
+ * the sourcename of the feed. This will be used by the ModelFilter
+ * to implement the FilterMenu
+ */
+enum {
+    RSS_READER_COLUMN_AUTHOR,
+    RSS_READER_COLUMN_SUBJECT,
+    RSS_READER_COLUMN_DATE,
+    RSS_READER_COLUMN_LINK,     /* Is this something like spiegel.de and only 
has a link */
+    RSS_READER_COLUMN_TEXT,     /* Either link is NULL, or this contains the 
article     */
+    RSS_READER_COLUMN_TEXT_TYPE,/* The Text Type of Atom feeds HTML, plain...  
          */
+    RSS_READER_COLUMN_CATEGORY, /* The category as shown in the filter box     
          */
+    RSS_READER_COLUMN_SOURCE,   /* the source of this entry, the URL of the 
feed, not the atom <source> */
+    RSS_READER_NUM_COLS,
+};
+
+/**
+ * text type for atom feeds, default is none
+ */
+enum {
+    RSS_READER_TEXT_TYPE_NONE,
+    RSS_READER_TEXT_TYPE_PLAIN,
+    RSS_READER_TEXT_TYPE_HTML,
+    RSS_READER_TEXT_TYPE_UNKNOWN
+};
+
+#endif

Added: trunk/src/target/OM-2007/applications/openmoko-rssreader/src/callbacks.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/src/callbacks.c    
2007-03-21 17:38:30 UTC (rev 1460)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/src/callbacks.c    
2007-03-21 19:13:46 UTC (rev 1461)
@@ -0,0 +1,228 @@
+/*
+ *  RSS Reader, a simple RSS reader
+ *
+ *  Copyright (C) 2007 Holger Hans Peter Freyther
+ *
+ *  Permission is hereby granted, free of charge, to any person obtaining a
+ *  copy of this software and associated documentation files (the "Software"),
+ *  to deal in the Software without restriction, including without limitation
+ *  the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ *  and/or sell copies of the Software, and to permit persons to whom the
+ *  Software is furnished to do so, subject to the following conditions:
+ *
+ *  The above copyright notice and this permission notice shall be included
+ *  in all copies or substantial portions of the Software.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ *  OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ *  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *  OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *  Current Version: $Rev$ ($Date$) [$Author$]
+ */
+
+#include "callbacks.h"
+
+#include <mrss.h>
+#include <string.h>
+
+#define _(x) (x)
+
+struct FeedEntry {
+    gchar *category;
+    gchar *url;
+};
+
+static const int NUMBER_OF_FEEDS = 2;
+static struct FeedEntry s_feeds[] = {
+    { "OpenMoko", "http://planet.openmoko.org/rss20.xml"; },
+    { "GNOME"   , "http://planet.gnome.org/atom.xml";     },
+};
+
+static void remove_container_item( GtkWidget *item, GtkWidget *container ) {
+    gtk_container_remove(GTK_CONTAINER(container), item);
+}
+
+
+/*
+ * TODO: Use the ModelFilter to filter for All or Category
+ */
+void filter_feeds( struct RSSReaderData *data ) {
+}
+
+/*
+ * TODO: use GConf to load the feed data
+ */
+void refresh_categories( struct RSSReaderData *data ) {
+    /*
+     * clear the old menu and add the new one
+     */
+    gtk_container_foreach( GTK_CONTAINER(data->filter), 
(GtkCallback)remove_container_item, data->filter );
+
+    for ( int i = 0; i < NUMBER_OF_FEEDS; ++i )
+        gtk_menu_shell_append( GTK_MENU_SHELL(data->filter), 
gtk_menu_item_new_with_label( s_feeds[i].category ) );
+
+    /*
+     * add separator + All
+     */
+    gtk_menu_shell_append( GTK_MENU_SHELL(data->filter), 
gtk_separator_menu_item_new() );
+    gtk_menu_shell_append( GTK_MENU_SHELL(data->filter), 
GTK_WIDGET(gtk_menu_item_new_with_label(_("All"))) );
+}
+
+gboolean cb_filter_changed( GtkWidget* widget, gchar *text, struct 
RSSReaderData *data ) {
+    if ( data->current_filter )
+        g_free( data->current_filter );
+    data->current_filter = g_strdup( text );
+
+    filter_feeds( data );
+    return TRUE;
+}
+
+void cb_subscribe_button_clicked( GtkButton *btn, struct RSSReaderData *data ) 
{}
+
+
+/*
+ * asynchronous update thread!
+ * This breaks with ATK+
+ */
+static void feed_update_thread( struct RSSReaderData *data ) {
+    GtkTreeIter iter;
+
+    for ( int i = 0; i < NUMBER_OF_FEEDS; ++i ) {
+        mrss_t *rss_data;
+        int ret = mrss_parse_url( s_feeds[i].url, &rss_data );
+        if ( ret ) {
+            /* TODO use the footer to report error? */
+            g_debug( "parse_url failed.." );
+            continue;
+        }
+
+        mrss_item_t *item = rss_data->item;
+        while ( item ) {
+            gint content_type = RSS_READER_TEXT_TYPE_NONE;
+            gchar *description = item->description;
+
+            /*
+             * let us try to find the 'content' tag
+             * and then extract the type
+             */
+            if ( !description && rss_data->version == MRSS_VERSION_ATOM_1_0 && 
item->other_tags ) {
+                for ( mrss_tag_t *tag = item->other_tags; tag; tag = tag->next 
) {
+                    if ( strcmp( tag->name, "content" ) == 0 ) {
+                        description = tag->value;
+
+                        for ( mrss_attribute_t *attribute = tag->attributes; 
attribute; attribute = attribute->next ) {
+                            if ( strcmp( attribute->name, "type" ) == 0 ) {
+                                if ( strcmp( attribute->value, "plain" ) == 0 
) {
+                                    content_type = RSS_READER_TEXT_TYPE_PLAIN;
+                                } else if ( strcmp( attribute->name, "html" ) 
== 0 ) {
+                                    content_type = RSS_READER_TEXT_TYPE_HTML;
+                                } else {
+                                    content_type = 
RSS_READER_TEXT_TYPE_UNKNOWN;
+                                }
+                            }
+                        }
+
+                        /* we are done */
+                        break;
+                    }
+                }
+            }
+
+            /*
+             * update the model here
+             */
+            gdk_threads_enter();
+            gtk_list_store_append( data->feed_data, &iter );
+            gtk_list_store_set   ( data->feed_data, &iter,
+                                   RSS_READER_COLUMN_AUTHOR, g_strdup( 
item->author  ),
+                                   RSS_READER_COLUMN_SUBJECT,g_strdup( 
item->title   ),
+                                   RSS_READER_COLUMN_DATE,   g_strdup( 
item->pubDate ),
+                                   RSS_READER_COLUMN_LINK,   g_strdup( 
item->link    ),
+                                   RSS_READER_COLUMN_TEXT,   g_strdup( 
description   ),
+                                   RSS_READER_COLUMN_TEXT_TYPE, content_type   
       ,
+                                   RSS_READER_COLUMN_CATEGORY, g_strdup( 
s_feeds[i].category ),
+                                   RSS_READER_COLUMN_SOURCE,  g_strdup( 
s_feeds[i].url ),
+                                   -1 );
+            gdk_threads_leave();
+            item = item->next;
+        }
+
+        mrss_free( data );
+    }
+
+    gdk_threads_enter();
+    filter_feeds( data );
+    gdk_threads_leave();
+}
+
+/*
+ * TODO use gconf and GThread as this will block
+ * DISCUSSION:
+ *    - Should everything be updated?
+ *    - What happens if we update but some feeds can not be connected? Should 
the old
+ *      data be kept?
+ *      ( Just keeping/building a new ListStore does not help, we need a model 
that consists
+ *        out of models... )
+ *
+ *
+ * Clear the current model
+ *
+ * For each feed:
+ *    - Get the Data
+ *    - Fill the GtkListStore
+ *
+ * Refilter the model...
+ */
+void cb_refresh_all_button_clicked( GtkButton *btn, struct RSSReaderData *data 
) {
+    /*
+     * once we have a SCM make it not clear the list but remove all items
+     * with the same URL
+     */
+    gtk_list_store_clear( data->feed_data );
+
+    /*
+     * do the complete work in a new thread
+     */
+    GError *error = NULL;
+    (void)g_thread_create( (GThreadFunc)feed_update_thread, data, FALSE, 
&error );
+
+    /* XXX FOOTER do error reporting */
+    if ( error != NULL ) {
+        fprintf( stderr, "Can not create thread %s:%d '%s'\n", __FILE__, 
__LINE__, error->message );
+    }
+
+}
+void cb_searchbox_visible( MokoToolBox *box, struct RSSReaderData *data ) {}
+void cb_searchbox_invisible( MokoToolBox *box, struct RSSReaderData *data ) {}
+
+/*
+ * TODO: Update the text and make it rich text.
+ *
+ * TODO: Decide if a browser should be opened or not... e.g. spiegel.de only 
distributes
+ *       the headlines and not the content. Either we fetch the code or leave 
it
+ */
+void cb_treeview_selection_changed( GtkTreeSelection *selection, struct 
RSSReaderData *data ) {
+    GtkTreeModel* model;
+    GtkTreeIter iter;
+    gboolean has_selection = gtk_tree_selection_get_selected( selection, 
&model, &iter );
+
+    /*
+     * Update the text
+     */
+    if ( has_selection ) {
+        gchar *message;
+        gtk_tree_model_get( model, &iter, RSS_READER_COLUMN_TEXT, &message, -1 
);
+        if ( message )
+            gtk_text_buffer_set_text( data->textBuffer, message, -1 );
+        else
+            gtk_text_buffer_set_text( data->textBuffer, g_strdup( "Failed to 
read the text" ), -1 );
+    }
+}
+
+gboolean cb_treeview_keypress_event( GtkWidget *entry, GdkEventKey *key, 
struct RSSReaderData *data ) { return TRUE; }
+void cb_search_entry_changed      ( GtkWidget *entry, struct RSSReaderData 
*data ) {}
+

Added: trunk/src/target/OM-2007/applications/openmoko-rssreader/src/callbacks.h
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/src/callbacks.h    
2007-03-21 17:38:30 UTC (rev 1460)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/src/callbacks.h    
2007-03-21 19:13:46 UTC (rev 1461)
@@ -0,0 +1,57 @@
+/*
+ *  RSS Reader, a simple RSS reader
+ *
+ *  Copyright (C) 2007 Holger Hans Peter Freyther
+ *
+ *  Permission is hereby granted, free of charge, to any person obtaining a
+ *  copy of this software and associated documentation files (the "Software"),
+ *  to deal in the Software without restriction, including without limitation
+ *  the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ *  and/or sell copies of the Software, and to permit persons to whom the
+ *  Software is furnished to do so, subject to the following conditions:
+ *
+ *  The above copyright notice and this permission notice shall be included
+ *  in all copies or substantial portions of the Software.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ *  OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ *  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *  OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *  Current Version: $Rev$ ($Date$) [$Author$]
+ */
+
+#ifndef RSS_READER_CALLBACKS_H
+#define RSS_READER_CALLBACKS_H
+
+#include "application-data.h"
+
+
+/*
+ * filter callbacks
+ */
+gboolean cb_filter_changed(GtkWidget* widget, gchar* text, struct 
RSSReaderData* d);
+
+/*
+ * toolbox callbacks
+ */
+void cb_subscribe_button_clicked  ( GtkButton *btn, struct RSSReaderData *d);
+void refresh_categories( struct RSSReaderData* );
+void refresh_feeds( struct RSSReaderData *data );
+void filter_feeds ( struct RSSReaderData *data );
+void cb_refresh_all_button_clicked( GtkButton *btn, struct RSSReaderData *d);
+void cb_searchbox_visible(MokoToolBox* toolbox, struct RSSReaderData* d);
+void cb_searchbox_invisible(MokoToolBox* toolbox, struct RSSReaderData* d);
+
+/*
+ * changes to the treeview
+ */
+void cb_treeview_selection_changed( GtkTreeSelection *selection, struct 
RSSReaderData *d );
+gboolean cb_treeview_keypress_event( GtkWidget *entry, GdkEventKey *key, 
struct RSSReaderData *d );
+void cb_search_entry_changed      ( GtkWidget *entry, struct RSSReaderData *d 
);
+
+
+#endif

Added: trunk/src/target/OM-2007/applications/openmoko-rssreader/src/main.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/src/main.c 
2007-03-21 17:38:30 UTC (rev 1460)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/src/main.c 
2007-03-21 19:13:46 UTC (rev 1461)
@@ -0,0 +1,193 @@
+/*
+ *  RSS Reader, a simple RSS reader
+ *
+ *  Copyright (C) 2007 Holger Hans Peter Freyther
+ *
+ *  Permission is hereby granted, free of charge, to any person obtaining a
+ *  copy of this software and associated documentation files (the "Software"),
+ *  to deal in the Software without restriction, including without limitation
+ *  the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ *  and/or sell copies of the Software, and to permit persons to whom the
+ *  Software is furnished to do so, subject to the following conditions:
+ *
+ *  The above copyright notice and this permission notice shall be included
+ *  in all copies or substantial portions of the Software.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ *  OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ *  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *  OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *  Current Version: $Rev$ ($Date$) [$Author$]
+ */
+
+#include "application-data.h"
+#include "callbacks.h"
+#include <assert.h>
+
+#include <libmokoui/moko-details-window.h>
+
+/*
+ * use gettext...
+ */
+#define _(x) (x)
+#define ASSERT_X(x, error) assert(x)
+
+/*
+ * setup the toolbar
+ */
+static void setup_toolbar( struct RSSReaderData *data ) {
+    GtkButton *a;
+    GtkWidget *anImage;
+    data->box = MOKO_TOOL_BOX(moko_tool_box_new_with_search());
+    gtk_widget_grab_focus( GTK_WIDGET(data->box) );
+    g_signal_connect( G_OBJECT(data->box), "searchbox_visible",   
G_CALLBACK(cb_searchbox_visible), data );
+    g_signal_connect( G_OBJECT(data->box), "searchbox_invisible", 
G_CALLBACK(cb_searchbox_invisible), data );
+
+
+    a = GTK_BUTTON(moko_tool_box_add_action_button( MOKO_TOOL_BOX(data->box) 
));
+    anImage = gtk_image_new_from_file( PKGDATADIR "/rssreader_refresh_all.png" 
);
+    moko_pixmap_button_set_center_image( MOKO_PIXMAP_BUTTON(a), anImage );
+    g_signal_connect( G_OBJECT(a), "clicked", 
G_CALLBACK(cb_refresh_all_button_clicked), data );
+
+    a = GTK_BUTTON(moko_tool_box_add_action_button( MOKO_TOOL_BOX(data->box) 
));
+    anImage = gtk_image_new_from_file( PKGDATADIR "/rssreader_subscribe.png" );
+    moko_pixmap_button_set_center_image( MOKO_PIXMAP_BUTTON(a), anImage );
+    g_signal_connect( G_OBJECT(a), "clicked", 
G_CALLBACK(cb_subscribe_button_clicked), data );
+
+    a = GTK_BUTTON(moko_tool_box_add_action_button( MOKO_TOOL_BOX(data->box)) 
);
+    gtk_button_set_label( GTK_BUTTON(a), _("Up for rent") );
+    a = GTK_BUTTON(moko_tool_box_add_action_button( MOKO_TOOL_BOX(data->box)) 
);
+    gtk_button_set_label( GTK_BUTTON(a), _("Buy more Mate") );
+
+    moko_paned_window_add_toolbox( MOKO_PANED_WINDOW(data->window), 
MOKO_TOOL_BOX(data->box) );
+}
+
+static void create_navigaton_area( struct RSSReaderData *data ) {
+    data->feed_data = gtk_list_store_new( RSS_READER_NUM_COLS,
+                                          G_TYPE_STRING /* Author    */,
+                                          G_TYPE_STRING /* Subject   */,
+                                          G_TYPE_STRING /* Date      */,
+                                          G_TYPE_STRING /* Link      */,
+                                          G_TYPE_STRING /* Text      */,
+                                          G_TYPE_INT    /* Text_Type */,
+                                          G_TYPE_STRING /* Category  */,
+                                          G_TYPE_STRING /* Source    */ );
+    data->treeView = 
MOKO_TREE_VIEW(moko_tree_view_new_with_model(GTK_TREE_MODEL(data->feed_data)));
+    moko_paned_window_set_upper_pane( MOKO_PANED_WINDOW(data->window), 
GTK_WIDGET(moko_tree_view_put_into_scrolled_window(data->treeView)) );
+
+    /*
+     * Only show the SUBJECT and DATE header
+     */
+    GtkCellRenderer *ren;
+    GtkTreeViewColumn *column;
+    ren = GTK_CELL_RENDERER(gtk_cell_renderer_text_new());
+    column = GTK_TREE_VIEW_COLUMN(gtk_tree_view_column_new_with_attributes( 
_("Subject"), ren, "text", RSS_READER_COLUMN_SUBJECT, NULL));
+    moko_tree_view_append_column( MOKO_TREE_VIEW(data->treeView), column );
+
+    ren = GTK_CELL_RENDERER(gtk_cell_renderer_text_new());
+    column = GTK_TREE_VIEW_COLUMN(gtk_tree_view_column_new_with_attributes( 
_("Date"), ren, "text", RSS_READER_COLUMN_DATE, NULL));
+    moko_tree_view_append_column( MOKO_TREE_VIEW(data->treeView), column );
+
+    /*
+     * auto completion and selection updates
+     */
+    GtkTreeSelection *selection = 
GTK_TREE_SELECTION(gtk_tree_view_get_selection( GTK_TREE_VIEW(data->treeView) 
));
+    g_signal_connect( G_OBJECT(selection), "changed", 
G_CALLBACK(cb_treeview_selection_changed), data );
+
+    GtkWidget *search_entry = 
GTK_WIDGET(moko_tool_box_get_entry(MOKO_TOOL_BOX(data->box)));
+    g_signal_connect( G_OBJECT(data->treeView), "key_press_event", 
G_CALLBACK(cb_treeview_keypress_event), data );
+    g_signal_connect( G_OBJECT(search_entry),   "changed", 
G_CALLBACK(cb_search_entry_changed), data );
+
+}
+
+static void create_details_area( struct RSSReaderData* data ) {
+    data->tagTable   = GTK_TEXT_TAG_TABLE(gtk_text_tag_table_new());
+    data->textBuffer = GTK_TEXT_BUFFER(gtk_text_buffer_new(data->tagTable));
+    data->textView   = 
GTK_TEXT_VIEW(gtk_text_view_new_with_buffer(GTK_TEXT_BUFFER(data->textBuffer)));
+
+    GValue value = { 0, };
+    g_value_init( &value, G_TYPE_BOOLEAN );
+    g_value_set_boolean( &value, FALSE );
+    g_object_set_property( G_OBJECT(data->textView), "editable",       &value 
);
+    g_object_set_property( G_OBJECT(data->textView), "cursor-visible", &value 
);
+    gtk_text_view_set_wrap_mode( data->textView, GTK_WRAP_WORD_CHAR );
+
+    GtkWidget *scrollWindow = GTK_WIDGET(moko_details_window_new());
+    gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrollWindow), 
GTK_WIDGET (data->textView));
+    moko_paned_window_set_lower_pane( MOKO_PANED_WINDOW(data->window), 
GTK_WIDGET(moko_details_window_put_in_box(MOKO_DETAILS_WINDOW(scrollWindow))) );
+}
+
+/*
+ * create the mainwindow
+ */
+static void setup_ui( struct RSSReaderData* data ) {
+    data->window = MOKO_PANED_WINDOW(moko_paned_window_new());
+    g_signal_connect( G_OBJECT(data->window), "delete_event", G_CALLBACK( 
gtk_main_quit ), NULL );
+
+    /*
+     * menu
+     */
+    data->menu = GTK_MENU(gtk_menu_new());
+    GtkMenuItem *closeitem = GTK_MENU_ITEM(gtk_menu_item_new_with_label( 
_("Close")));
+    g_signal_connect( G_OBJECT(closeitem), "activate", 
G_CALLBACK(gtk_main_quit), NULL );
+    gtk_menu_shell_append( GTK_MENU_SHELL(data->menu), GTK_WIDGET(closeitem) );
+    moko_paned_window_set_application_menu( MOKO_PANED_WINDOW(data->window), 
GTK_MENU(data->menu) );
+
+    /*
+     * filter
+     */
+    data->filter = GTK_MENU(gtk_menu_new());
+    moko_paned_window_set_filter_menu( MOKO_PANED_WINDOW(data->window), 
GTK_MENU(data->filter) );
+    data->menubox = MOKO_MENU_BOX(moko_paned_window_get_menubox( 
MOKO_PANED_WINDOW(data->window) ) );
+    g_signal_connect( G_OBJECT(data->menubox), "filter_changed", 
G_CALLBACK(cb_filter_changed), data );
+
+
+    /*
+     * tool bar
+     */
+    setup_toolbar( data );
+    create_navigaton_area( data );
+    create_details_area( data );
+}
+
+int main( int argc, char** argv )
+{
+    /*
+     * boiler plate code
+     */
+    g_debug( "openmoko-rssreader starting up" );
+
+    /*
+     * initialize threads for fetching the RSS in the background
+     */
+    g_thread_init( NULL );
+    gdk_threads_init();
+    gdk_threads_enter();
+    gtk_init( &argc, &argv );
+
+    struct RSSReaderData *data = g_new0( struct RSSReaderData, 1 );
+
+
+    data->app = MOKO_APPLICATION( moko_application_get_instance() );
+    g_set_application_name( _("FeedReader") );
+
+    setup_ui( data );
+
+    /*
+     * load data
+     */
+    refresh_categories( data );
+    moko_menu_box_set_active_filter( data->menubox, _("All") );
+
+    gtk_widget_show_all( GTK_WIDGET(data->window) );
+    gtk_main();
+    gdk_threads_leave();
+
+    return 0;
+}
+
+




--- End Message ---
_______________________________________________
commitlog mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/commitlog

Reply via email to