r49 - in trunk/src/target/OM-2007: . applications/openmoko-taskmanager qmake
mickey at gta01.hmw-consulting.de
mickey at gta01.hmw-consulting.de
Sat Sep 23 15:43:12 CEST 2006
Author: mickey
Date: 2006-09-23 13:43:11 +0000 (Sat, 23 Sep 2006)
New Revision: 49
Added:
trunk/src/target/OM-2007/applications/openmoko-taskmanager/footer.c
trunk/src/target/OM-2007/applications/openmoko-taskmanager/footer.h
trunk/src/target/OM-2007/applications/openmoko-taskmanager/main.c
trunk/src/target/OM-2007/applications/openmoko-taskmanager/openmoko-taskmanager.pro
trunk/src/target/OM-2007/qmake/
trunk/src/target/OM-2007/qmake/openmoko-include.pro
Log:
first shot at openmoko-taskmanager
Added: trunk/src/target/OM-2007/applications/openmoko-taskmanager/footer.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-taskmanager/footer.c 2006-09-23 11:23:29 UTC (rev 48)
+++ trunk/src/target/OM-2007/applications/openmoko-taskmanager/footer.c 2006-09-23 13:43:11 UTC (rev 49)
@@ -0,0 +1,82 @@
+#include "footer.h"
+
+enum {
+ FOOTER_SIGNAL,
+ LAST_SIGNAL
+};
+
+static void footer_class_init (FooterClass *klass);
+static void footer_init (Footer *f);
+
+static guint footer_signals[LAST_SIGNAL] = { 0 };
+
+GType footer_get_type (void) /* Typechecking */
+{
+ static GType f_type = 0;
+
+ if (!f_type)
+ {
+ static const GTypeInfo f_info =
+ {
+ sizeof (FooterClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) footer_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (Footer),
+ 0,
+ (GInstanceInitFunc) footer_init,
+ };
+
+ f_type = g_type_register_static(GTK_TYPE_HBOX, "Footer", &f_info, 0);
+ }
+
+ return f_type;
+}
+
+static void footer_class_init (FooterClass *klass) /* Class Initialization */
+{
+ g_printf( "footer_class_init\n" );
+ footer_signals[FOOTER_SIGNAL] = g_signal_new ("footer",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (FooterClass, footer),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+
+}
+
+static void footer_init (Footer *f) /* Instance Construction */
+{
+ f->leftbutton = gtk_button_new_with_label( "A" );
+ gtk_box_pack_start( f, GTK_WIDGET(f->leftbutton), FALSE, FALSE, 0 );
+
+ f->statusbar = gtk_statusbar_new();
+ gtk_statusbar_set_has_resize_grip( f->statusbar, FALSE );
+ gtk_box_pack_start( f, GTK_WIDGET(f->statusbar), TRUE, TRUE, 0 );
+
+ gtk_statusbar_push( f->statusbar, 1, "Ready." );
+
+ f->rightbutton = gtk_button_new_with_label( "B" );
+ gtk_box_pack_start( f, GTK_WIDGET(f->rightbutton), FALSE, FALSE, 0 );
+
+ gtk_widget_show( f->leftbutton );
+ gtk_widget_show( f->statusbar );
+ gtk_widget_show( f->rightbutton );
+}
+
+GtkWidget* footer_new() /* Construction */
+{
+ g_printf( "footer_new\n" );
+ return GTK_WIDGET(g_object_new(footer_get_type(), NULL));
+}
+
+void footer_clear (Footer *f) /* Destruction */
+{
+ g_printf( "footer_clear\n" );
+}
+
Property changes on: trunk/src/target/OM-2007/applications/openmoko-taskmanager/footer.c
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/src/target/OM-2007/applications/openmoko-taskmanager/footer.h
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-taskmanager/footer.h 2006-09-23 11:23:29 UTC (rev 48)
+++ trunk/src/target/OM-2007/applications/openmoko-taskmanager/footer.h 2006-09-23 13:43:11 UTC (rev 49)
@@ -0,0 +1,41 @@
+#ifndef __OPENMOKO_FOOTER_H__
+#define __OPENMOKO_FOOTER_H__
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gtk/gtkhbox.h>
+#include <gtk/gtkstatusbar.h>
+#include <gtk/gtkbutton.h>
+
+G_BEGIN_DECLS
+
+#define FOOTER_TYPE (footer_get_type())
+#define FOOTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOOTER_TYPE, Footer))
+#define FOOTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOOTER_TYPE, FooterClass))
+#define IS_FOOTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOOTER_TYPE))
+#define IS_FOOTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOOTER_TYPE))
+
+typedef struct _Footer Footer;
+typedef struct _FooterClass FooterClass;
+
+struct _Footer
+{
+ GtkHBox hbox;
+ GtkButton* leftbutton;
+ GtkStatusbar* statusbar;
+ GtkButton* rightbutton;
+};
+
+struct _FooterClass
+{
+ GtkHBoxClass parent_class;
+ void (*footer) (Footer *f);
+};
+
+GType footer_get_type (void);
+GtkWidget* footer_new (void);
+void footer_clear (Footer *f);
+
+G_END_DECLS
+
+#endif /* __OPENMOKO_FOOTER_H__ */
Property changes on: trunk/src/target/OM-2007/applications/openmoko-taskmanager/footer.h
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/src/target/OM-2007/applications/openmoko-taskmanager/main.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-taskmanager/main.c 2006-09-23 11:23:29 UTC (rev 48)
+++ trunk/src/target/OM-2007/applications/openmoko-taskmanager/main.c 2006-09-23 13:43:11 UTC (rev 49)
@@ -0,0 +1,19 @@
+#include "footer.h"
+
+#include <gtk/gtk.h>
+
+int main( int argc, char **argv )
+{
+ gtk_init (&argc, &argv);
+
+ GtkWidget* window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ gtk_widget_show( window );
+
+ Footer* footer = footer_new();
+ gtk_container_add( GTK_CONTAINER(window), GTK_WIDGET(footer) );
+
+ gtk_widget_show_all( footer );
+ gtk_main();
+
+ return 0;
+}
Property changes on: trunk/src/target/OM-2007/applications/openmoko-taskmanager/main.c
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/src/target/OM-2007/applications/openmoko-taskmanager/openmoko-taskmanager.pro
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-taskmanager/openmoko-taskmanager.pro 2006-09-23 11:23:29 UTC (rev 48)
+++ trunk/src/target/OM-2007/applications/openmoko-taskmanager/openmoko-taskmanager.pro 2006-09-23 13:43:11 UTC (rev 49)
@@ -0,0 +1,6 @@
+HEADERS = footer.h
+SOURCES = footer.c main.c
+
+PKGCONFIG += gtk+-2.0
+
+include ( ../../qmake/openmoko-include.pro )
Added: trunk/src/target/OM-2007/qmake/openmoko-include.pro
===================================================================
--- trunk/src/target/OM-2007/qmake/openmoko-include.pro 2006-09-23 11:23:29 UTC (rev 48)
+++ trunk/src/target/OM-2007/qmake/openmoko-include.pro 2006-09-23 13:43:11 UTC (rev 49)
@@ -0,0 +1,14 @@
+CONFIG = debug warn_on link_pkgconfig console
+
+# handle pkg-config files (from qt4)
+for(PKGCONFIG_LIB, $$list($$unique(PKGCONFIG))) {
+ QMAKE_CXXFLAGS += $$system(pkg-config --cflags $$PKGCONFIG_LIB)
+ QMAKE_CFLAGS += $$system(pkg-config --cflags $$PKGCONFIG_LIB)
+ LIBS += $$system(pkg-config --libs $$PKGCONFIG_LIB)
+}
+
+QMAKE_CFLAGS += -std=c99 -pedantic
+
+MOC_DIR=.moc/$(PLATFORM)
+OBJECTS_DIR=.obj/$(PLATFORM)
+
More information about the commitlog
mailing list