Begin breaking out a new main-window file
authorTravis Reitter <treitter@torizo.(none)>
Mon, 14 Sep 2009 01:53:15 +0000 (18:53 -0700)
committerTravis Reitter <treitter@gmail.com>
Fri, 4 Dec 2009 06:01:12 +0000 (22:01 -0800)
src/Makefile.am
src/milk-main-window.c [new file with mode: 0644]
src/milk-main-window.h [new file with mode: 0644]
src/milk-main.c
src/milk-main.h [new file with mode: 0644]

index 063d66c..4bf330a 100644 (file)
@@ -8,7 +8,10 @@ AM_CFLAGS = \
 bin_PROGRAMS = milk
 
 milk_SOURCES = \
-       milk-main.c
+       milk-main.c \
+       milk-main.h \
+       milk-main-window.c \
+       milk-main-window.h
 
 milk_LDADD = $(MILK_LIBS)
 
diff --git a/src/milk-main-window.c b/src/milk-main-window.c
new file mode 100644 (file)
index 0000000..4e8afcc
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * 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
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ *
+ * Authors: Travis Reitter <treitter@gmail.com>
+ */
+
+#include <config.h>
+
+#include <glib.h>
+#include <gtk/gtk.h>
+#include <hildon/hildon.h>
+
+GtkWidget*
+milk_main_window_new ()
+{
+        HildonProgram *program;
+        GtkWidget *window;
+
+        program = hildon_program_get_instance ();
+
+        window = hildon_window_new ();
+        hildon_program_add_window (program, HILDON_WINDOW (window));
+
+        return window;
+}
diff --git a/src/milk-main-window.h b/src/milk-main-window.h
new file mode 100644 (file)
index 0000000..13fd249
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * 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
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ *
+ * Authors: Travis Reitter <treitter@gmail.com>
+ */
+
+GtkWidget* milk_main_window_new ();
index a93a535..d17e95c 100644 (file)
 #include <gtk/gtk.h>
 #include <hildon/hildon.h>
 
+#include "milk-main.h"
+#include "milk-main-window.h"
+
 int
 main (int argc, char *argv[])
 {
-        HildonProgram *program;
-        GtkWidget *window;
+        MilkApp app;
 
         hildon_gtk_init (&argc, &argv);
 
-        program = hildon_program_get_instance ();
-
-        window = hildon_window_new ();
-        hildon_program_add_window (program, HILDON_WINDOW (window));
+        memset (&app, 0, sizeof (app));
+        app.main_window = milk_main_window_new ();
 
-        gtk_widget_show_all (GTK_WIDGET (window));
+        gtk_widget_show_all (app.main_window);
 
         gtk_main ();
 
diff --git a/src/milk-main.h b/src/milk-main.h
new file mode 100644 (file)
index 0000000..07ab842
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * 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
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ *
+ * Authors: Travis Reitter <treitter@gmail.com>
+ */
+
+typedef struct {
+        GtkWidget *main_window;
+} MilkApp;