gnome-games r7934 - trunk/aisleriot
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-games r7934 - trunk/aisleriot
- Date: Sat, 27 Sep 2008 13:11:38 +0000 (UTC)
Author: chpe
Date: Sat Sep 27 13:11:38 2008
New Revision: 7934
URL: http://svn.gnome.org/viewvc/gnome-games?rev=7934&view=rev
Log:
Use games-runtime to lookup directories.
Modified:
trunk/aisleriot/board.c
trunk/aisleriot/game.c
trunk/aisleriot/sol.c
trunk/aisleriot/window.c
Modified: trunk/aisleriot/board.c
==============================================================================
--- trunk/aisleriot/board.c (original)
+++ trunk/aisleriot/board.c Sat Sep 27 13:11:38 2008
@@ -31,6 +31,7 @@
#include <libgames-support/games-files.h>
#include <libgames-support/games-marshal.h>
#include <libgames-support/games-pixbuf-utils.h>
+#include <libgames-support/games-runtime.h>
#include <libgames-support/games-sound.h>
#include "conf.h"
@@ -378,7 +379,7 @@
char *path;
int width, height;
- path = games_build_filename (PIXMAPDIR, "baize.png");
+ path = games_runtime_get_file (GAMES_RUNTIME_PIXMAP_DIRECTORY, "baize.png");
pixbuf = gdk_pixbuf_new_from_file (path, &error);
g_free (path);
Modified: trunk/aisleriot/game.c
==============================================================================
--- trunk/aisleriot/game.c (original)
+++ trunk/aisleriot/game.c Sat Sep 27 13:11:38 2008
@@ -36,7 +36,7 @@
#include "conf.h"
#include "util.h"
-#include <libgames-support/games-files.h>
+#include <libgames-support/games-runtime.h>
#include "game.h"
@@ -1076,7 +1076,7 @@
return FALSE;
}
- path = games_build_filename (GAMESDIR, filename);
+ path = games_runtime_get_file (GAMES_RUNTIME_GAME_GAMES_DIRECTORY, filename);
if (g_file_test (path, G_FILE_TEST_EXISTS) &&
g_file_test (path, G_FILE_TEST_IS_REGULAR)) {
scm_c_primitive_load (path);
Modified: trunk/aisleriot/sol.c
==============================================================================
--- trunk/aisleriot/sol.c (original)
+++ trunk/aisleriot/sol.c Sat Sep 27 13:11:38 2008
@@ -69,6 +69,7 @@
#include <libgames-support/games-files.h>
#include <libgames-support/games-stock.h>
+#include <libgames-support/games-runtime.h>
#include <libgames-support/games-sound.h>
#include "conf.h"
@@ -510,7 +511,6 @@
{
AppData data;
GOptionContext *option_context;
- GtkIconTheme *sol_icon_theme;
#ifdef HAVE_GNOME
GnomeClient *master_client;
#else
@@ -627,9 +627,6 @@
g_signal_connect (data.window, "destroy",
G_CALLBACK (gtk_main_quit), NULL);
- sol_icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (data.window)));
- gtk_icon_theme_append_search_path (sol_icon_theme, games_path_runtime_fix (ICONDIR));
-
gtk_window_set_default_icon_name (data.freecell ? "gnome-freecell" : "gnome-aisleriot");
@@ -697,13 +694,13 @@
osso_deinitialize (data.osso_context);
}
#endif /* HAVE_MAEMO */
+
+ games_runtime_shutdown ();
}
int
main (int argc, char *argv[])
{
- char *localedir;
-
setlocale (LC_ALL, "");
#if defined(HAVE_GNOME) || defined(HAVE_RSVG_GNOMEVFS) || defined(HAVE_GSTREAMER)
@@ -713,13 +710,14 @@
g_thread_init (NULL);
#endif
- localedir = games_path_runtime_fix (GNOMELOCALEDIR);
- bindtextdomain (GETTEXT_PACKAGE, localedir);
+ if (!games_runtime_init ("aisleriot"))
+ return 1;
+
+ bindtextdomain (GETTEXT_PACKAGE, games_runtime_get_directory (GAMES_RUNTIME_LOCALE_DIRECTORY));
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
- g_free (localedir);
- scm_boot_guile (argc, argv, main_prog, NULL);
+ scm_boot_guile (argc, argv, main_prog, NULL); /* no return */
return 0;
}
Modified: trunk/aisleriot/window.c
==============================================================================
--- trunk/aisleriot/window.c (original)
+++ trunk/aisleriot/window.c Sat Sep 27 13:11:38 2008
@@ -52,6 +52,7 @@
#include <libgames-support/games-clock.h>
#include <libgames-support/games-files.h>
#include <libgames-support/games-stock.h>
+#include <libgames-support/games-runtime.h>
#include <libgames-support/games-sound.h>
#include "board.h"
@@ -217,6 +218,7 @@
GtkTreeIter current_iter, selection_iter;
gboolean current_iter_set = FALSE;
const char *current_game_file;
+ const char *games_dir;
GList *l;
if (priv->game_choice_dialog) {
@@ -228,7 +230,8 @@
list_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (list));
g_object_unref (list);
- files = games_file_list_new ("*.scm", games_path_runtime_fix (GAMESDIR), NULL);
+ games_dir = games_runtime_get_directory (GAMES_RUNTIME_GAME_GAMES_DIRECTORY);
+ files = games_file_list_new ("*.scm", games_dir, NULL);
games_file_list_transform_basename (files);
current_game_file = aisleriot_game_get_game_file (priv->game);
@@ -759,12 +762,14 @@
DebugWindowData *data;
GamesFileList *files;
GList *l;
+ const char *games_dir;
data = g_object_get_data (G_OBJECT (window), DEBUG_WINDOW_DATA_KEY);
if (data != NULL)
return data;
- files = games_file_list_new ("*.scm", games_path_runtime_fix (GAMESDIR), NULL);
+ games_dir = games_runtime_get_directory (GAMES_RUNTIME_GAME_GAMES_DIRECTORY);
+ files = games_file_list_new ("*.scm", games_dir, NULL);
games_file_list_transform_basename (files);
data = g_slice_new (DebugWindowData);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]