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. r1813 - trunk/src/host/qemu-neo1973/openmoko
([EMAIL PROTECTED])
2. r1814 - trunk/src/host/qemu-neo1973/openmoko
([EMAIL PROTECTED])
3. r1815 - in trunk/src/target/OM-2007/artwork/themes:
openmoko-standard/gtk-2.0 openmoko-standard-qvga/gtk-2.0
([EMAIL PROTECTED])
4. r1816 - in trunk/src/target/OM-2007/openmoko-libs: .
libmokoui ([EMAIL PROTECTED])
5. r1817 - in trunk/src/target/OM-2007/examples: .
openmoko-stylus-demo/src ([EMAIL PROTECTED])
--- Begin Message ---
Author: andrew
Date: 2007-04-23 22:45:48 +0200 (Mon, 23 Apr 2007)
New Revision: 1813
Modified:
trunk/src/host/qemu-neo1973/openmoko/flash.sh
Log:
Properly convert filesizes to hex - thanks to Marcus Smith. Apparently
some python versions' hex() adds a number width suffix.
Modified: trunk/src/host/qemu-neo1973/openmoko/flash.sh
===================================================================
--- trunk/src/host/qemu-neo1973/openmoko/flash.sh 2007-04-21 08:46:47 UTC
(rev 1812)
+++ trunk/src/host/qemu-neo1973/openmoko/flash.sh 2007-04-23 20:45:48 UTC
(rev 1813)
@@ -44,8 +44,8 @@
most_recent () {
cd $src_dir
export $2="`basename \`ls -d -1 $img_dir/$1 | sort | tail -n 1\``"
- export $3="`python -c \"import os; print hex(\
- os.stat('$img_dir/${!2}').st_size)\"`"
+ export $3="`python -c \"import os; print '0x%lx' \
+ %(os.stat('$img_dir/${!2}').st_size)\"`"
cd $script_dir
[ -e "${!2}" ] || ln -sf $img_dir/${!2} ${!2}
[ -n "${!3}" ]
--- End Message ---
--- Begin Message ---
Author: andrew
Date: 2007-04-24 00:03:25 +0200 (Tue, 24 Apr 2007)
New Revision: 1814
Modified:
trunk/src/host/qemu-neo1973/openmoko/flash.sh
Log:
Hardcode a NAND partition layout to accommodate for current u-boot confusion.
Modified: trunk/src/host/qemu-neo1973/openmoko/flash.sh
===================================================================
--- trunk/src/host/qemu-neo1973/openmoko/flash.sh 2007-04-23 20:45:48 UTC
(rev 1813)
+++ trunk/src/host/qemu-neo1973/openmoko/flash.sh 2007-04-23 22:03:25 UTC
(rev 1814)
@@ -96,7 +96,8 @@
setenv menu_2 'Set console to serial: setenv stdin serial; setenv stdout
serial; setenv stderr serial'
setenv menu_3 'Power off: neo1973 power-off'
setenv splashimage 'nand read.e $splash_addr splash $splash_size; unzip
$splash_addr 0x33d00000 0x96000'
-dynpart
+setenv mtdids nand0=neo1973-nand
+setenv mtdparts
mtdparts=neo1973-nand:0x00030000(u-boot),0x00004000(u-boot_env),0x00208000(kernel),0x00010000(splash),0x039c4000(rootfs)
nand write.e $kernel_addr u-boot $uboot_size
dynenv set u-boot_env
saveenv"
--- End Message ---
--- Begin Message ---
Author: mickey
Date: 2007-04-24 01:44:43 +0200 (Tue, 24 Apr 2007)
New Revision: 1815
Added:
trunk/src/target/OM-2007/artwork/themes/openmoko-standard-qvga/gtk-2.0/mokoscrolledpane
trunk/src/target/OM-2007/artwork/themes/openmoko-standard/gtk-2.0/mokoscrolledpane
Modified:
trunk/src/target/OM-2007/artwork/themes/openmoko-standard-qvga/gtk-2.0/gtkrc
trunk/src/target/OM-2007/artwork/themes/openmoko-standard/gtk-2.0/gtkrc
Log:
themes: add support for mokoscrolledpane (successor to mokodetailswindow)
Modified:
trunk/src/target/OM-2007/artwork/themes/openmoko-standard/gtk-2.0/gtkrc
===================================================================
--- trunk/src/target/OM-2007/artwork/themes/openmoko-standard/gtk-2.0/gtkrc
2007-04-23 22:03:25 UTC (rev 1814)
+++ trunk/src/target/OM-2007/artwork/themes/openmoko-standard/gtk-2.0/gtkrc
2007-04-23 23:44:43 UTC (rev 1815)
@@ -111,6 +111,7 @@
include "gtktreeview"
include "mokodetailswindow"
+include "mokoscrolledpane"
include "mokodialogwindow"
include "mokofingerbutton"
include "mokofingertoolbox"
Added:
trunk/src/target/OM-2007/artwork/themes/openmoko-standard/gtk-2.0/mokoscrolledpane
===================================================================
---
trunk/src/target/OM-2007/artwork/themes/openmoko-standard/gtk-2.0/mokoscrolledpane
2007-04-23 22:03:25 UTC (rev 1814)
+++
trunk/src/target/OM-2007/artwork/themes/openmoko-standard/gtk-2.0/mokoscrolledpane
2007-04-23 23:44:43 UTC (rev 1815)
@@ -0,0 +1,72 @@
+style "mokoscrolledpane-fullscreen-button" {
+ engine "pixmap" {
+ image {
+ function = BOX
+ recolorable = TRUE
+ state = NORMAL
+ file = "openmoko-scroll-fullscreen-btn-off.png"
+ border = { 0, 0, 0, 0 }
+ stretch = TRUE
+ }
+ image {
+ function = BOX
+ recolorable = TRUE
+ state = PRELIGHT
+ file = "openmoko-scroll-fullscreen-btn-off.png"
+ border = { 0, 0, 0, 0 }
+ stretch = TRUE
+ }
+ image {
+ function = BOX
+ recolorable = TRUE
+ state = ACTIVE
+ file = "openmoko-scroll-fullscreen-btn-off-pressed.png"
+ border = { 0, 0, 0, 0 }
+ stretch = TRUE
+ }
+ }
+ MokoPixmapButton::size-request = { 0, 37, 0, 26 }
+ GtkButton::focus-line-width = 0
+}
+widget "*.mokoscrolledpane-fullscreen-button" style
"mokoscrolledpane-fullscreen-button"
+
+style "mokoscrolledpane-fullscreen-button-on" {
+ engine "pixmap" {
+ image {
+ function = BOX
+ recolorable = TRUE
+ state = NORMAL
+ shadow = OUT
+ file = "openmoko-scroll-fullscreen-btn-on.png"
+ border = { 0, 0, 0, 0 }
+ stretch = TRUE
+ }
+ image {
+ function = BOX
+ recolorable = TRUE
+ state = PRELIGHT
+ file = "openmoko-scroll-fullscreen-btn-on.png"
+ border = { 0, 0, 0, 0 }
+ stretch = TRUE
+ }
+ image {
+ function = BOX
+ recolorable = TRUE
+ state = ACTIVE
+ file = "openmoko-scroll-fullscreen-btn-on-pressed.png"
+ border = { 0, 0, 0, 0 }
+ stretch = TRUE
+ }
+ }
+ MokoPixmapButton::size-request = { 0, 37, 0, 26 }
+ GtkButton::focus-line-width = 0
+}
+widget "*.mokoscrolledpane-fullscreen-button-on" style
"mokoscrolledpane-fullscreen-button-on"
+
+style "mokoscrolledpane" {
+ bg[NORMAL] = "#e5e5e5"
+ fg[NORMAL] = "#000"
+ bg_pixmap[NORMAL] = ""
+}
+widget "*.MokoScrolledPane.*" style "mokoscrolledpane"
+
Modified:
trunk/src/target/OM-2007/artwork/themes/openmoko-standard-qvga/gtk-2.0/gtkrc
===================================================================
---
trunk/src/target/OM-2007/artwork/themes/openmoko-standard-qvga/gtk-2.0/gtkrc
2007-04-23 22:03:25 UTC (rev 1814)
+++
trunk/src/target/OM-2007/artwork/themes/openmoko-standard-qvga/gtk-2.0/gtkrc
2007-04-23 23:44:43 UTC (rev 1815)
@@ -111,6 +111,7 @@
include "gtktreeview"
include "mokodetailswindow"
+include "mokoscrolledpane"
include "mokodialogwindow"
include "mokofingerbutton"
include "mokofingertoolbox"
Added:
trunk/src/target/OM-2007/artwork/themes/openmoko-standard-qvga/gtk-2.0/mokoscrolledpane
===================================================================
---
trunk/src/target/OM-2007/artwork/themes/openmoko-standard-qvga/gtk-2.0/mokoscrolledpane
2007-04-23 22:03:25 UTC (rev 1814)
+++
trunk/src/target/OM-2007/artwork/themes/openmoko-standard-qvga/gtk-2.0/mokoscrolledpane
2007-04-23 23:44:43 UTC (rev 1815)
@@ -0,0 +1,72 @@
+style "mokoscrolledpane-fullscreen-button" {
+ engine "pixmap" {
+ image {
+ function = BOX
+ recolorable = TRUE
+ state = NORMAL
+ file = "openmoko-scroll-fullscreen-btn-off.png"
+ border = { 0, 0, 0, 0 }
+ stretch = TRUE
+ }
+ image {
+ function = BOX
+ recolorable = TRUE
+ state = PRELIGHT
+ file = "openmoko-scroll-fullscreen-btn-off.png"
+ border = { 0, 0, 0, 0 }
+ stretch = TRUE
+ }
+ image {
+ function = BOX
+ recolorable = TRUE
+ state = ACTIVE
+ file = "openmoko-scroll-fullscreen-btn-off-pressed.png"
+ border = { 0, 0, 0, 0 }
+ stretch = TRUE
+ }
+ }
+ MokoPixmapButton::size-request = { 0, 19, 0, 13 }
+ GtkButton::focus-line-width = 0
+}
+widget "*.mokoscrolledpane-fullscreen-button" style
"mokoscrolledpane-fullscreen-button"
+
+style "mokoscrolledpane-fullscreen-button-on" {
+ engine "pixmap" {
+ image {
+ function = BOX
+ recolorable = TRUE
+ state = NORMAL
+ shadow = OUT
+ file = "openmoko-scroll-fullscreen-btn-on.png"
+ border = { 0, 0, 0, 0 }
+ stretch = TRUE
+ }
+ image {
+ function = BOX
+ recolorable = TRUE
+ state = PRELIGHT
+ file = "openmoko-scroll-fullscreen-btn-on.png"
+ border = { 0, 0, 0, 0 }
+ stretch = TRUE
+ }
+ image {
+ function = BOX
+ recolorable = TRUE
+ state = ACTIVE
+ file = "openmoko-scroll-fullscreen-btn-on-pressed.png"
+ border = { 0, 0, 0, 0 }
+ stretch = TRUE
+ }
+ }
+ MokoPixmapButton::size-request = { 0, 19, 0, 13 }
+ GtkButton::focus-line-width = 0
+}
+widget "*.mokoscrolledpane-fullscreen-button-on" style
"mokoscrolledpane-fullscreen-button-on"
+
+style "mokoscrolledpane" {
+ bg[NORMAL] = "#e5e5e5"
+ fg[NORMAL] = "#000"
+ bg_pixmap[NORMAL] = ""
+}
+widget "*.MokoScrolledPane.*" style "mokoscrolledpane"
+
--- End Message ---
--- Begin Message ---
Author: mickey
Date: 2007-04-24 01:46:33 +0200 (Tue, 24 Apr 2007)
New Revision: 1816
Added:
trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-scrolled-pane.c
trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-scrolled-pane.h
Modified:
trunk/src/target/OM-2007/openmoko-libs/configure.ac
trunk/src/target/OM-2007/openmoko-libs/libmokoui/Makefile.am
trunk/src/target/OM-2007/openmoko-libs/libmokoui/libmokoui.pro
trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-paned-window.c
trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-paned-window.h
Log:
openmoko-libs: add MokoScrolledPane (successor to MokoDetailsWindow)
Modified: trunk/src/target/OM-2007/openmoko-libs/configure.ac
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/configure.ac 2007-04-23 23:44:43 UTC
(rev 1815)
+++ trunk/src/target/OM-2007/openmoko-libs/configure.ac 2007-04-23 23:46:33 UTC
(rev 1816)
@@ -1,5 +1,5 @@
AC_PREREQ(2.53)
-AC_INIT(openmoko-libs, 0.0.3, http://www.openmoko.org/)
+AC_INIT(openmoko-libs, 0.0.4, http://www.openmoko.org/)
AM_INIT_AUTOMAKE()
AC_CONFIG_SRCDIR(libmokoui/moko-window.c)
AM_CONFIG_HEADER(config.h)
Modified: trunk/src/target/OM-2007/openmoko-libs/libmokoui/Makefile.am
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/libmokoui/Makefile.am
2007-04-23 23:44:43 UTC (rev 1815)
+++ trunk/src/target/OM-2007/openmoko-libs/libmokoui/Makefile.am
2007-04-23 23:46:33 UTC (rev 1816)
@@ -12,6 +12,7 @@
moko-panel-applet.h \
moko-pixmap-button.h \
moko-paned-window.h \
+ moko-scrolled-pane.h \
moko-tool-box.h \
moko-tree-view.h \
moko-window.h \
@@ -32,8 +33,9 @@
moko-panel-applet.c \
moko-pixmap-button.c \
moko-paned-window.c \
+ moko-scrolled-pane.c \
+ moko-tool-box.c \
moko-tree-view.c \
- moko-tool-box.c \
moko-window.c \
moko-dialog.c \
moko-message-dialog.c
Modified: trunk/src/target/OM-2007/openmoko-libs/libmokoui/libmokoui.pro
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/libmokoui/libmokoui.pro
2007-04-23 23:44:43 UTC (rev 1815)
+++ trunk/src/target/OM-2007/openmoko-libs/libmokoui/libmokoui.pro
2007-04-23 23:46:33 UTC (rev 1816)
@@ -18,8 +18,9 @@
moko-panel-applet.h \
moko-pixmap-button.h \
moko-paned-window.h \
+ moko-scrolled-pane.h \
+ moko-tree-view.h \
moko-tool-box.h \
- moko-tree-view.h \
moko-window.h
SOURCES = \
@@ -38,6 +39,7 @@
moko-panel-applet.c \
moko-pixmap-button.c \
moko-paned-window.c \
+ moko-scrolled-pane.c \
moko-tree-view.c \
moko-tool-box.c \
moko-window.c
Modified: trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-paned-window.c
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-paned-window.c
2007-04-23 23:44:43 UTC (rev 1815)
+++ trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-paned-window.c
2007-04-23 23:46:33 UTC (rev 1816)
@@ -18,6 +18,7 @@
*/
#include "moko-paned-window.h"
#include "moko-alignment.h"
+#include "moko-scrolled-pane.h"
#include <gtk/gtktoolbar.h>
#include <gtk/gtkvbox.h>
@@ -47,17 +48,18 @@
} MokoPanedWindowPriv;
-/* add your signals here */
+/* signals */
enum {
MOKO_PANED_WINDOW_SIGNAL,
LAST_SIGNAL
};
+static guint moko_paned_window_signals[LAST_SIGNAL] = { 0 };
-static void moko_paned_window_class_init (MokoPanedWindowClass
*klass);
-static void moko_paned_window_init (MokoPanedWindow *self);
+/* forwards */
+static void moko_paned_window_class_init(MokoPanedWindowClass* klass);
+static void moko_paned_window_init(MokoPanedWindow* self);
+static void _moko_paned_window_fullscreen_toggled(MokoScrolledPane* pane, gint
on, MokoPanedWindow* self);
-static guint moko_paned_window_signals[LAST_SIGNAL] = { 0 };
-
static void moko_paned_window_class_init (MokoPanedWindowClass *klass) /*
Class Initialization */
{
g_type_class_add_private(klass, sizeof(MokoPanedWindowPriv));
@@ -130,6 +132,15 @@
moko_menu_box_set_filter_menu( MOKO_MENU_BOX (priv->menubox), menu );
}
+void moko_paned_window_set_ratio(MokoPanedWindow* self, guint ratio)
+{
+ MokoPanedWindowPriv* priv = MOKO_PANED_WINDOW_GET_PRIVATE(self);
+ moko_debug( "moko_paned_window_set_ratio" );
+ //FIXME calculate this correctly, need to subtract the height of tool box
and menu box
+ // which is probably not 120 ;-)
+ gtk_paned_set_position( GTK_PANED(priv->outerframe),
ratio*(gdk_screen_height()-120)/100 );
+}
+
void moko_paned_window_set_upper_pane(MokoPanedWindow* self, GtkWidget* child)
{
moko_debug( "moko_paned_window_set_upper_pane" );
@@ -141,6 +152,10 @@
gtk_alignment_set_padding( GTK_ALIGNMENT(priv->upperenclosing), 7, 7, 11,
11 ); //FIXME get from style (MokoAlignment::padding)
gtk_box_pack_end( GTK_BOX(priv->upper), priv->upperenclosing, TRUE, TRUE,
0 );
gtk_container_add( GTK_CONTAINER(priv->upperenclosing), child );
+
+ if ( MOKO_IS_SCROLLED_PANE(child) )
+ g_signal_connect( G_OBJECT(child), "fullscreen-toggled",
G_CALLBACK(_moko_paned_window_fullscreen_toggled), self );
+
}
void moko_paned_window_set_lower_pane(MokoPanedWindow* self, GtkWidget* child)
@@ -158,6 +173,9 @@
gtk_box_pack_end( GTK_BOX(priv->lower), priv->lowerenclosing, TRUE, TRUE,
0 );
gtk_container_add( GTK_CONTAINER(priv->lowerenclosing), child );
#endif
+
+ if ( MOKO_IS_SCROLLED_PANE(child) )
+ g_signal_connect( G_OBJECT(child), "fullscreen-toggled",
G_CALLBACK(_moko_paned_window_fullscreen_toggled), self );
}
void moko_paned_window_add_toolbox(MokoPanedWindow* self, MokoToolBox* toolbox)
@@ -181,3 +199,24 @@
gtk_widget_show( priv->upper );
}
}
+
+static void _moko_paned_window_fullscreen_toggled(MokoScrolledPane* pane, gint
b, MokoPanedWindow* self)
+{
+ MokoPanedWindowPriv* priv = MOKO_PANED_WINDOW_GET_PRIVATE(self);
+ if ( pane == gtk_bin_get_child( GTK_BIN(priv->lowerenclosing) ) )
+ {
+ if ( b )
+ gtk_widget_hide( priv->upper );
+ else
+ gtk_widget_show( priv->upper );
+ }
+ else if ( pane == gtk_bin_get_child( GTK_BIN(priv->upperenclosing) ) )
+ {
+ if ( b )
+ gtk_widget_hide( priv->lower );
+ else
+ gtk_widget_show( priv->lower );
+ }
+ else
+ g_assert( FALSE ); // fail here, if invalid pane
+}
Modified: trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-paned-window.h
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-paned-window.h
2007-04-23 23:44:43 UTC (rev 1815)
+++ trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-paned-window.h
2007-04-23 23:46:33 UTC (rev 1816)
@@ -65,6 +65,7 @@
void moko_paned_window_add_toolbox(MokoPanedWindow* self, MokoToolBox*
toolbox);
/* panes */
+void moko_paned_window_set_ratio(MokoPanedWindow* self, guint ratio);
void moko_paned_window_set_upper_pane(MokoPanedWindow* self, GtkWidget* child);
void moko_paned_window_set_lower_pane(MokoPanedWindow* self, GtkWidget* child);
Added: trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-scrolled-pane.c
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-scrolled-pane.c
2007-04-23 23:44:43 UTC (rev 1815)
+++ trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-scrolled-pane.c
2007-04-23 23:46:33 UTC (rev 1816)
@@ -0,0 +1,152 @@
+/* moko-scrolled-pane.c
+ *
+ * Authored By Michael 'Mickey' Lauer <[EMAIL PROTECTED]>
+ *
+ * Copyright (C) 2007 Vanille-Media
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Public License as published by
+ * the Free Software Foundation; version 2.1 of the license.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Public License for more details.
+ *
+ * Current Version: $Rev$ ($Date: 2007/04/13 13:56:22 $) [$Author: mickey $]
+ */
+
+#include "moko-scrolled-pane.h"
+#include "moko-pixmap-button.h"
+
+#undef DEBUG_THIS_FILE
+#ifdef DEBUG_THIS_FILE
+#define moko_debug(fmt,...) g_debug(fmt,##__VA_ARGS__)
+#else
+#define moko_debug(fmt,...)
+#endif
+
+G_DEFINE_TYPE (MokoScrolledPane, moko_scrolled_pane, GTK_TYPE_HBOX)
+
+#define SCROLLED_PANE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o),
MOKO_TYPE_SCROLLED_PANE, MokoScrolledPanePrivate))
+
+typedef struct _MokoScrolledPanePrivate
+{
+ GtkWidget* scrolledwindow; /* GtkScrolledWindow */
+ GtkWidget* vbox; /* GtkVBox */
+ GtkWidget* button; /* MokoPixmapButton */
+ GtkWidget* scrollbar; /* GtkScrollBar */
+} MokoScrolledPanePrivate;
+
+/* parent class pointer */
+static GtkHBoxClass* parent_class = NULL;
+
+/* signals */
+enum {
+ FULLSCREEN_TOGGLED,
+ LAST_SIGNAL,
+};
+static guint moko_scrolled_pane_signals[LAST_SIGNAL] = { 0 };
+
+/* forward declarations */
+static void _moko_scrolled_pane_fullscreen_clicked (GtkButton* button,
MokoScrolledPane* self);
+
+static void
+moko_scrolled_pane_dispose(GObject* object)
+{
+ if (G_OBJECT_CLASS (moko_scrolled_pane_parent_class)->dispose)
+ G_OBJECT_CLASS (moko_scrolled_pane_parent_class)->dispose (object);
+}
+
+static void
+moko_scrolled_pane_finalize(GObject* object)
+{
+ G_OBJECT_CLASS (moko_scrolled_pane_parent_class)->finalize (object);
+}
+
+static void
+moko_scrolled_pane_class_init(MokoScrolledPaneClass* klass)
+{
+ /* hook parent */
+ GObjectClass* object_class = G_OBJECT_CLASS (klass);
+ parent_class = g_type_class_peek_parent(klass);
+
+ /* add private */
+ g_type_class_add_private (klass, sizeof(MokoScrolledPanePrivate));
+
+ /* hook destruction */
+ object_class->dispose = moko_scrolled_pane_dispose;
+ object_class->finalize = moko_scrolled_pane_finalize;
+
+ /* register signals */
+ moko_scrolled_pane_signals[FULLSCREEN_TOGGLED] = g_signal_new
("fullscreen-toggled",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS,
+ NULL,
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__INT,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_INT,
+ NULL);
+
+ /* virtual methods */
+
+ /* install properties */
+}
+
+GtkWidget*
+moko_scrolled_pane_new(void)
+{
+ return g_object_new(MOKO_TYPE_SCROLLED_PANE, NULL);
+}
+
+static void
+moko_scrolled_pane_init(MokoScrolledPane* self)
+{
+ /* Populate your instance here */
+ moko_debug ("moko_scrolled_pane_init");
+
+ MokoScrolledPanePrivate* priv = SCROLLED_PANE_GET_PRIVATE(self);
+ priv->scrolledwindow = gtk_scrolled_window_new( NULL, NULL );
+ gtk_scrolled_window_set_policy( priv->scrolledwindow, GTK_POLICY_NEVER,
GTK_POLICY_NEVER );
+
+ priv->vbox = gtk_vbox_new( FALSE, 0 );
+ gtk_box_pack_start( GTK_BOX(self), priv->scrolledwindow, TRUE, TRUE, 0 );
+ priv->button = moko_pixmap_button_new();
+ gtk_widget_set_name( GTK_WIDGET(priv->button),
"mokoscrolledpane-fullscreen-button-on" );
+ gtk_box_pack_start( GTK_BOX(priv->vbox), priv->button, FALSE, FALSE, 0);
+ priv->scrollbar = gtk_vscrollbar_new( gtk_scrolled_window_get_vadjustment(
GTK_SCROLLED_WINDOW(priv->scrolledwindow)));
+ gtk_box_pack_start( GTK_BOX(priv->vbox), priv->scrollbar, TRUE, TRUE, 0);
+ gtk_box_pack_start( GTK_BOX(self), priv->vbox, FALSE, FALSE, 0);
+ g_signal_connect( G_OBJECT(priv->button), "clicked",
G_CALLBACK(_moko_scrolled_pane_fullscreen_clicked), self );
+
+}
+
+static void _moko_scrolled_pane_fullscreen_clicked(GtkButton * button,
MokoScrolledPane * self)
+{
+ static gboolean on = TRUE;
+ if (on)
+ {
+ gtk_widget_set_name (GTK_WIDGET (button),
+ "mokoscrolledpane-fullscreen-button");
+ gtk_widget_queue_draw (GTK_WIDGET (button)); //FIXME necessary?
+ }
+ else
+ {
+ gtk_widget_set_name (GTK_WIDGET (button),
+ "mokoscrolledpane-fullscreen-button-on");
+ gtk_widget_queue_draw (GTK_WIDGET (button)); //FIXME necessary?
+ }
+
+ g_signal_emit( G_OBJECT(self),
moko_scrolled_pane_signals[FULLSCREEN_TOGGLED], 0, on );
+ on = !on;
+}
+
+GtkScrolledWindow* moko_scrolled_pane_get_scrolled_window(MokoScrolledPane*
self)
+{
+ MokoScrolledPanePrivate* priv = SCROLLED_PANE_GET_PRIVATE(self);
+ g_assert( priv->scrolledwindow );
+ return priv->scrolledwindow;
+}
Property changes on:
trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-scrolled-pane.c
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-scrolled-pane.h
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-scrolled-pane.h
2007-04-23 23:44:43 UTC (rev 1815)
+++ trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-scrolled-pane.h
2007-04-23 23:46:33 UTC (rev 1816)
@@ -0,0 +1,49 @@
+/* moko-scrolled-pane.h
+ *
+ * Authored By Michael 'Mickey' Lauer <[EMAIL PROTECTED]>
+ *
+ * Copyright (C) 2007 Vanille-Media
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Public License as published by
+ * the Free Software Foundation; version 2.1 of the license.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Public License for more details.
+ *
+ * Current Version: $Rev$ ($Date: 2007/04/13 13:56:22 $) [$Author: mickey $]
+ */
+
+#ifndef _MOKO_SCROLLED_PANE_H_
+#define _MOKO_SCROLLED_PANE_H_
+
+#include <gtk/gtkhbox.h>
+#include <gtk/gtkscrolledwindow.h>
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define MOKO_TYPE_SCROLLED_PANE moko_scrolled_pane_get_type()
+#define MOKO_SCROLLED_PANE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj),
MOKO_TYPE_SCROLLED_PANE, MokoScrolledPane))
+#define MOKO_SCROLLED_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass),
MOKO_TYPE_SCROLLED_PANE, MokoScrolledPaneClass))
+#define MOKO_IS_SCROLLED_PANE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),
MOKO_TYPE_SCROLLED_PANE))
+#define MOKO_IS_SCROLLED_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),
MOKO_TYPE_SCROLLED_PANE))
+#define MOKO_SCROLLED_PANE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),
MOKO_TYPE_SCROLLED_PANE, MokoScrolledPaneClass))
+
+typedef struct {
+ GtkHBox parent;
+} MokoScrolledPane;
+
+typedef struct {
+ GtkHBoxClass parent_class;
+} MokoScrolledPaneClass;
+
+GType moko_scrolled_pane_get_type();
+GtkWidget* moko_scrolled_pane_new();
+
+G_END_DECLS
+
+#endif // _MOKO_SCROLLED_PANE_H_
+
Property changes on:
trunk/src/target/OM-2007/openmoko-libs/libmokoui/moko-scrolled-pane.h
___________________________________________________________________
Name: svn:eol-style
+ native
--- End Message ---
--- Begin Message ---
Author: mickey
Date: 2007-04-24 01:47:01 +0200 (Tue, 24 Apr 2007)
New Revision: 1817
Modified:
trunk/src/target/OM-2007/examples/examples.pro
trunk/src/target/OM-2007/examples/openmoko-stylus-demo/src/demo-main.c
Log:
examples: use MokoScrolledPane for both panes
Modified: trunk/src/target/OM-2007/examples/examples.pro
===================================================================
--- trunk/src/target/OM-2007/examples/examples.pro 2007-04-23 23:46:33 UTC
(rev 1816)
+++ trunk/src/target/OM-2007/examples/examples.pro 2007-04-23 23:47:01 UTC
(rev 1817)
@@ -5,7 +5,6 @@
openmoko-finger-demo \
openmoko-panel-demo-simple \
openmoko-panel-demo \
- openmoko-dialog-demo \
openmoko-gsmd-demo
Modified: trunk/src/target/OM-2007/examples/openmoko-stylus-demo/src/demo-main.c
===================================================================
--- trunk/src/target/OM-2007/examples/openmoko-stylus-demo/src/demo-main.c
2007-04-23 23:46:33 UTC (rev 1816)
+++ trunk/src/target/OM-2007/examples/openmoko-stylus-demo/src/demo-main.c
2007-04-23 23:47:01 UTC (rev 1817)
@@ -18,7 +18,7 @@
*/
#include <libmokoui/moko-application.h>
-#include <libmokoui/moko-details-window.h>
+#include <libmokoui/moko-scrolled-pane.h>
#include <libmokoui/moko-dialog-window.h>
#include <libmokoui/moko-paned-window.h>
#include <libmokoui/moko-tool-box.h>
@@ -301,8 +301,13 @@
gtk_tree_view_set_model (moko_treeview, GTK_TREE_MODEL (model) );
clist_insert(moko_treeview);
- moko_paned_window_set_upper_pane( window,
GTK_WIDGET(moko_tree_view_put_into_scrolled_window(moko_treeview)) );
+ /*moko_paned_window_set_upper_pane( window,
GTK_WIDGET(moko_tree_view_put_into_scrolled_window(moko_treeview)) );*/
+ MokoScrolledPane* navigationwindow = moko_scrolled_pane_new();
+ GtkScrolledWindow* scrolledwindow1 =
moko_scrolled_pane_get_scrolled_window( navigationwindow );
+ gtk_container_add( scrolledwindow1, GTK_WIDGET(moko_treeview) );
+ moko_paned_window_set_upper_pane( window, GTK_WIDGET(navigationwindow) );
+
GtkButton* button1;
GtkButton* button2;
GtkButton* button3;
@@ -356,10 +361,12 @@
"\ndata entry here\n \n \n \n \n \n \n \nThis particular label\n
\nis very long\n"
"\nto make the fullscreen\n \ntrigger more interesting\n \n \n" );
- MokoDetailsWindow* detailswindow = moko_details_window_new();
- gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW(detailswindow),
GTK_WIDGET(details) );
+ MokoScrolledPane* detailswindow = moko_scrolled_pane_new();
+ GtkScrolledWindow* scrolledwindow2 =
moko_scrolled_pane_get_scrolled_window( detailswindow );
+ gtk_scrolled_window_add_with_viewport( scrolledwindow2,
GTK_WIDGET(details) );
+ moko_paned_window_set_lower_pane( window, GTK_WIDGET(detailswindow) );
- moko_paned_window_set_lower_pane( window,
GTK_WIDGET(moko_details_window_put_in_box(detailswindow) ) );
+ moko_paned_window_set_ratio( window, 50 );
/* show everything and run main loop */
gtk_widget_show_all( GTK_WIDGET(window) );
--- End Message ---
_______________________________________________
commitlog mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/commitlog