[monkey-bubble: 748/753] move libgnomeui's game part into our own code tree



commit 2914953802b9282049e077c241d7fe71ab20d075
Author: Sven Herzberg <herzi gnome-de org>
Date:   Wed Jul 14 21:54:50 2010 +0200

    move libgnomeui's game part into our own code tree
    
    * .gitignore: silence
    * configure.in: replace libgnomeui-2.0 by its dependencies
    * Makefile.am: add the new subfolder
    * libgnomeui/Makefile.am: build rules
    * libgnomeui/gnome-scores.c: make compilable standalone
    * libgnomeui/linktest.c: add a test binary to link against the new lib
    * src/ui/Makefile.am: link against the new library instead of the
      system's libgnomeui

 .gitignore                |    1 +
 Makefile.am               |   13 +++++++------
 configure.in              |    2 ++
 libgnomeui/Makefile.am    |   25 +++++++++++++++++++++++++
 libgnomeui/gnome-scores.c |   11 +++--------
 libgnomeui/linktest.c     |   45 +++++++++++++++++++++++++++++++++++++++++++++
 src/ui/Makefile.am        |    2 ++
 7 files changed, 85 insertions(+), 14 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 00d0281..d60374d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
 *.a
 aclocal.m4
 *autom4te.cache
+compile
 config.*
 configure
 depcomp
diff --git a/Makefile.am b/Makefile.am
index 4e27d4b..34d620c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,12 +1,13 @@
 NULL=
 
 always_subdirs=\
-	data	\
-	pixmaps	\
-	sounds 	\
-        src     \
-        po      \
-	$(NULL)
+	data \
+	pixmaps \
+        sounds \
+        libgnomeui \
+        src \
+        po \
+        $(NULL)
 
 SUBDIRS=\
 	$(always_subdirs) \
diff --git a/configure.in b/configure.in
index 38ed5b5..5ccc69b 100644
--- a/configure.in
+++ b/configure.in
@@ -22,6 +22,7 @@ F77=no
 AC_ISC_POSIX
 AC_PROG_CC
 AM_PROG_CC_STDC
+AM_PROG_CC_C_O
 AC_HEADER_STDC
 
 dnl Initialize libtool
@@ -221,6 +222,7 @@ dnl  --------
 AC_OUTPUT([
   Makefile
   data/Makefile
+  libgnomeui/Makefile
   pixmaps/Makefile
   pixmaps/bubbles/Makefile
   pixmaps/snake/Makefile
diff --git a/libgnomeui/Makefile.am b/libgnomeui/Makefile.am
new file mode 100644
index 0000000..bea2c89
--- /dev/null
+++ b/libgnomeui/Makefile.am
@@ -0,0 +1,25 @@
+noinst_LTLIBRARIES=libgnomeui.la
+
+libgnomeui_la_CPPFLAGS=\
+        $(LIBMONKEYUTIL_A_CFLAGS) \
+        $(PLATFORM_CFLAGS) \
+        $(AM_CPPFLAGS)
+libgnomeui_la_LIBADD=\
+        $(LIBMONKEYUTIL_A_LIBS) \
+        $(PLATFORM_LIBS) \
+        $(LIBADD)
+libgnomeui_la_SOURCES=\
+        gnome-scores.c \
+        gnome-scores.h \
+        $(NULL)
+
+noinst_PROGRAMS=linktest
+linktest_CPPFLAGS=\
+        -I$(top_srcdir) \
+        $(libgnomeui_la_CPPFLAGS)
+linktest_LDADD=\
+        libgnomeui.la \
+        $(libgnomeui_la_LIBADD)
+linktest_SOURCES=\
+        linktest.c \
+        $(NULL)
diff --git a/libgnomeui/gnome-scores.c b/libgnomeui/gnome-scores.c
index 4732ba3..a909cd0 100644
--- a/libgnomeui/gnome-scores.c
+++ b/libgnomeui/gnome-scores.c
@@ -35,10 +35,6 @@
 
 #include <glib/gi18n-lib.h>
 #include <gtk/gtk.h>
-
-#include <libgnome/gnome-macros.h>
-#include <libgnome/gnome-util.h>
-#include <libgnome/gnome-config.h>
 #include <libgnome/gnome-score.h>
 
 #include "gnome-scores.h"
@@ -64,11 +60,10 @@ static void gnome_scores_finalize   (GObject          *object);
  *
  * Returns the GType for the GnomeScores widget
  */
-GNOME_CLASS_BOILERPLATE (GnomeScores, gnome_scores,
-			 GtkDialog, GTK_TYPE_DIALOG)
+G_DEFINE_TYPE (GnomeScores, gnome_scores, GTK_TYPE_DIALOG)
 
 static void
-gnome_scores_instance_init (GnomeScores *gs)
+gnome_scores_init (GnomeScores *gs)
 {
 	GtkWidget *label;
 
@@ -142,7 +137,7 @@ gnome_scores_finalize(GObject *object)
 	g_free (gs->_priv);
 	gs->_priv = NULL;
 
-	GNOME_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
+	G_OBJECT_CLASS (gnome_scores_parent_class)->finalize (object);
 }
 
 /**
diff --git a/libgnomeui/linktest.c b/libgnomeui/linktest.c
new file mode 100644
index 0000000..0381341
--- /dev/null
+++ b/libgnomeui/linktest.c
@@ -0,0 +1,45 @@
+/* This file is part of monkey-bubble
+ *
+ * Copyright (C) 2010  Sven Herzberg
+ *
+ * This work is provided "as is"; redistribution and modification
+ * in whole or in part, in any medium, physical or electronic is
+ * permitted without restriction.
+ *
+ * This work 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.
+ *
+ * In no event shall the authors or contributors be liable for any
+ * direct, indirect, incidental, special, exemplary, or consequential
+ * damages (including, but not limited to, procurement of substitute
+ * goods or services; loss of use, data, or profits; or business
+ * interruption) however caused and on any theory of liability, whether
+ * in contract, strict liability, or tort (including negligence or
+ * otherwise) arising in any way out of the use of this software, even
+ * if advised of the possibility of such damage.
+ */
+
+#include <libgnomeui/gnome-scores.h>
+
+#define N_SCORES 10
+
+int
+main (int   argc,
+      char**argv)
+{
+  GtkWidget* dialog;
+  gchar    * names[N_SCORES];
+  double     scores[N_SCORES];
+  time_t     times[N_SCORES];
+
+  gtk_init (&argc, &argv);
+
+  dialog = gnome_scores_new (G_N_ELEMENTS (names),
+                             names,
+                             scores,
+                             times,
+                             FALSE);
+}
+
+/* vim:set et sw=2 cino=t0,f0,(0,{s,>2s,n-1s,^-1s,e2s: */
diff --git a/src/ui/Makefile.am b/src/ui/Makefile.am
index c569589..2720cf3 100644
--- a/src/ui/Makefile.am
+++ b/src/ui/Makefile.am
@@ -7,6 +7,7 @@ INCLUDES = \
         -DLIBDIR=\""$(libdir)"\"                        \
         -DSYSCONFDIR=\""$(sysconfdir)"\"                \
         -DPREFIX=\""$(prefix)"\" 			\
+        -I$(top_srcdir) \
         -I$(top_srcdir)/src/monkey			\
 	-I$(top_srcdir)/src/view 			\
 	-I$(top_srcdir)/src/audio			\
@@ -49,6 +50,7 @@ monkey_bubble_LDADD =  \
 	../net/libmonkeynet.a \
 	../audio/libmonkeyaudio.a \
 	../input/libmbinput.a \
+        $(top_builddir)/libgnomeui/libgnomeui.la \
 	$(UI_LIBS) \
 	$(PLATFORM_LIBS) \
 	$(NULL)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]