gnome-games r8051 - trunk/gnobots2



Author: thomashpa
Date: Wed Oct 15 23:10:29 2008
New Revision: 8051
URL: http://svn.gnome.org/viewvc/gnome-games?rev=8051&view=rev

Log:
remove parts of libgnome dependency + cleanup

Modified:
   trunk/gnobots2/Makefile.am
   trunk/gnobots2/game.c
   trunk/gnobots2/gameconfig.c
   trunk/gnobots2/gnobots.c
   trunk/gnobots2/graphics.c
   trunk/gnobots2/keyboard.c
   trunk/gnobots2/menu.c
   trunk/gnobots2/properties.c
   trunk/gnobots2/sound.c
   trunk/gnobots2/statusbar.c

Modified: trunk/gnobots2/Makefile.am
==============================================================================
--- trunk/gnobots2/Makefile.am	(original)
+++ trunk/gnobots2/Makefile.am	Wed Oct 15 23:10:29 2008
@@ -3,8 +3,8 @@
 schema_DATA = $(schema_in_files:.schemas.in=.schemas)
 @INTLTOOL_SCHEMAS_RULE@
 
-pixmapdir=$(datadir)/pixmaps/gnobots2
-configdir=$(datadir)/gnobots2
+pixmapdir=$(datadir)/gnome-games/gnobots2/pixmaps
+configdir=$(datadir)/gnome-games/gnobots2/games
 Gamesdir=$(datadir)/applications
 
 SUBDIRS = help
@@ -48,16 +48,16 @@
 	$(INTLLIBS)
 
 pixmap_DATA = gnomes.png \
-	      yahoo.png \
-	      aieee.png \
-	      splat.png \
-	      robots.svg \
-	      boo.svg \
+              yahoo.png \
+              aieee.png \
+              splat.png \
+              robots.svg \
+              boo.svg \
               ufo.svg
 
 config_DATA = robots2.cfg \
               robots2_easy.cfg \
-	      classic_robots.cfg \
+              classic_robots.cfg \
               robots_with_safe_teleport.cfg \
               nightmare.cfg
 
@@ -67,8 +67,8 @@
 
 EXTRA_DIST = AUTHORS \
              $(pixmap_DATA) \
-	     $(Games_DATA) \
-	     $(config_DATA) \
+             $(Games_DATA) \
+             $(config_DATA) \
              $(schema_in_files)
 
 install-data-local:

Modified: trunk/gnobots2/game.c
==============================================================================
--- trunk/gnobots2/game.c	(original)
+++ trunk/gnobots2/game.c	Wed Oct 15 23:10:29 2008
@@ -20,11 +20,15 @@
  */
 
 #include <config.h>
-#include <gnome.h>
+
 #include <stdlib.h>
 #include <math.h>
-#include <games-scores.h>
-#include <games-scores-dialog.h>
+
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+
+#include <libgames-support/games-scores.h>
+#include <libgames-support/games-scores-dialog.h>
 
 #include "gbdefs.h"
 #include "gameconfig.h"

Modified: trunk/gnobots2/gameconfig.c
==============================================================================
--- trunk/gnobots2/gameconfig.c	(original)
+++ trunk/gnobots2/gameconfig.c	Wed Oct 15 23:10:29 2008
@@ -20,7 +20,6 @@
  */
 
 #include <config.h>
-#include <gnome.h>
 
 #include <sys/types.h>
 #include <string.h>
@@ -28,6 +27,10 @@
 #include <time.h>
 #include <dirent.h>
 
+#include <gtk/gtk.h>
+
+#include <libgames-support/games-runtime.h>
+
 #include "gameconfig.h"
 #include "gbdefs.h"
 
@@ -214,12 +217,12 @@
   G_CONST_RETURN gchar *dent;
   GDir *dir;
   gchar *buffer;
+  const char *dname;
 
-  gchar *dname = gnome_program_locate_file (NULL,
-					    GNOME_FILE_DOMAIN_APP_DATADIR,
-					    (GAME_NAME),
-					    FALSE, NULL);
-
+  dname = games_runtime_get_directory (GAMES_RUNTIME_GAME_GAMES_DIRECTORY);
+  g_printerr("sti:\n");
+  g_printerr(dname);
+  g_printerr("/sti:\n");
   if (game_configs != NULL) {
     free_game_configs ();
   }

Modified: trunk/gnobots2/gnobots.c
==============================================================================
--- trunk/gnobots2/gnobots.c	(original)
+++ trunk/gnobots2/gnobots.c	Wed Oct 15 23:10:29 2008
@@ -20,16 +20,19 @@
  */
 
 #include <config.h>
-#include <gnome.h>
+
 #include <sys/time.h>
 #include <string.h>
-#include <games-stock.h>
-#include <games-scores.h>
-#include <games-scores-dialog.h>
-#include <games-sound.h>
-#include <games-gridframe.h>
-#include <games-conf.h>
-#include <games-runtime.h>
+
+#include <gnome.h>
+
+#include <libgames-support/games-conf.h>
+#include <libgames-support/games-gridframe.h>
+#include <libgames-support/games-runtime.h>
+#include <libgames-support/games-scores.h>
+#include <libgames-support/games-scores-dialog.h>
+#include <libgames-support/games-sound.h>
+#include <libgames-support/games-stock.h>
 
 #include "gbdefs.h"
 #include "statusbar.h"
@@ -195,15 +198,15 @@
   struct timeval tv;
   gint i;
 
-  bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
-  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
-  textdomain (GETTEXT_PACKAGE);
- 
   g_thread_init (NULL);
 
-  if (!games_runtime_init ("gnobots"))
+  if (!games_runtime_init ("gnobots2"))
     return 1;
 
+  bindtextdomain (GETTEXT_PACKAGE, games_runtime_get_directory (GAMES_RUNTIME_LOCALE_DIRECTORY));
+  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+  textdomain (GETTEXT_PACKAGE);
+ 
   gettimeofday (&tv, NULL);
   srand (tv.tv_usec);
 
@@ -234,7 +237,8 @@
   g_signal_connect (G_OBJECT (client), "die",
 		    G_CALLBACK (quit_game), argv[0]);
 
-  app = gnome_app_new (GAME_NAME, _("Robots"));
+  app = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+  gtk_window_set_title (GTK_WINDOW (app), _("Robots"));
 
   gtk_window_set_default_size (GTK_WINDOW (app), DEFAULT_WIDTH, DEFAULT_HEIGHT);
   games_conf_add_window (GTK_WINDOW (app), KEY_GEOMETRY_GROUP);
@@ -278,7 +282,7 @@
   gtk_box_pack_start (GTK_BOX (vbox), gridframe, TRUE, TRUE, 0);
   gtk_box_pack_start (GTK_BOX (vbox), statusbar, FALSE, FALSE, 0);
 
-  gnome_app_set_contents (GNOME_APP (app), vbox);
+  gtk_container_add (GTK_CONTAINER (app), vbox);
 
   gtk_widget_set_size_request (GTK_WIDGET (game_area),
 			       MINIMUM_TILE_WIDTH * GAME_WIDTH,

Modified: trunk/gnobots2/graphics.c
==============================================================================
--- trunk/gnobots2/graphics.c	(original)
+++ trunk/gnobots2/graphics.c	Wed Oct 15 23:10:29 2008
@@ -20,11 +20,14 @@
  */
 
 #include <config.h>
-#include <gnome.h>
+
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
 
-#include <games-preimage.h>
 #include <games-find-file.h>
+#include <games-preimage.h>
+#include <games-runtime.h>
 #include <games-scores.h>
 #include <games-scores-dialog.h>
 
@@ -172,9 +175,9 @@
 load_bubble_graphics (void)
 {
   gchar *buffer = NULL;
-  gchar *dname =
-    gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_APP_PIXMAP,
-			       GAME_NAME, FALSE, NULL);
+  const char *dname;
+
+  dname = games_runtime_get_directory (GAMES_RUNTIME_GAME_PIXMAP_DIRECTORY);
 
   buffer = g_build_filename (dname, "yahoo.png", NULL);
   if (!load_bubble_graphic (buffer, &yahoo_pixbuf))

Modified: trunk/gnobots2/keyboard.c
==============================================================================
--- trunk/gnobots2/keyboard.c	(original)
+++ trunk/gnobots2/keyboard.c	Wed Oct 15 23:10:29 2008
@@ -20,10 +20,12 @@
  */
 
 #include <config.h>
-#include <gnome.h>
-#include <gdk/gdkkeysyms.h>
+
 #include <ctype.h>
 
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+
 #include "keyboard.h"
 #include "keylabels.h"
 #include "game.h"

Modified: trunk/gnobots2/menu.c
==============================================================================
--- trunk/gnobots2/menu.c	(original)
+++ trunk/gnobots2/menu.c	Wed Oct 15 23:10:29 2008
@@ -20,11 +20,15 @@
  */
 
 #include <config.h>
-#include <gnome.h>
+
 #include <string.h>
-#include <games-stock.h>
-#include <games-scores.h>
-#include <games-scores-dialog.h>
+
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+
+#include <libgames-support/games-stock.h>
+#include <libgames-support/games-scores.h>
+#include <libgames-support/games-scores-dialog.h>
 
 #include "gbdefs.h"
 #include "menu.h"

Modified: trunk/gnobots2/properties.c
==============================================================================
--- trunk/gnobots2/properties.c	(original)
+++ trunk/gnobots2/properties.c	Wed Oct 15 23:10:29 2008
@@ -20,16 +20,20 @@
  */
 
 #include <config.h>
-#include <gnome.h>
+
 #include <string.h>
+
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
-#include <games-frame.h>
-#include <games-controls.h>
-#include <games-files.h>
-#include <games-scores.h>
-#include <games-scores-dialog.h>
-#include <games-conf.h>
-#include <games-sound.h>
+
+#include <libgames-support/games-frame.h>
+#include <libgames-support/games-controls.h>
+#include <libgames-support/games-files.h>
+#include <libgames-support/games-scores.h>
+#include <libgames-support/games-scores-dialog.h>
+#include <libgames-support/games-conf.h>
+#include <libgames-support/games-sound.h>
 
 #include "properties.h"
 #include "gameconfig.h"

Modified: trunk/gnobots2/sound.c
==============================================================================
--- trunk/gnobots2/sound.c	(original)
+++ trunk/gnobots2/sound.c	Wed Oct 15 23:10:29 2008
@@ -20,9 +20,8 @@
  */
 
 #include <config.h>
-#include <gnome.h>
 
-#include <games-sound.h>
+#include <libgames-support/games-sound.h>
 
 #include "gbdefs.h"
 #include "sound.h"
@@ -83,13 +82,6 @@
       games_sound_play ("splat");
       break;
     case SOUND_BAD:
-#if 0
-      if (gnome_sound_connection >= 0) {
-	gnome_triggers_do ("", "program", GAME_NAME, "bad-move", NULL);
-      } else {
-	gdk_beep ();
-      }
-#endif
       gdk_beep ();
       break;
     case SOUND_YAHOO:

Modified: trunk/gnobots2/statusbar.c
==============================================================================
--- trunk/gnobots2/statusbar.c	(original)
+++ trunk/gnobots2/statusbar.c	Wed Oct 15 23:10:29 2008
@@ -20,7 +20,9 @@
  */
 
 #include <config.h>
-#include <gnome.h>
+
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
 
 #include "statusbar.h"
 



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