Bug#868424: gnome-breakout: Port to GooCanvas / GTK+ 3
Yavor Doganov
yavor at gnu.org
Tue Sep 11 07:22:07 BST 2018
tags 868424 + patch
thanks
Attached is a patch which fixes this this bug.
-------------- next part --------------
--- gnome-breakout-0.5.3.orig/debian/control
+++ gnome-breakout-0.5.3/debian/control
@@ -4,7 +4,7 @@ Priority: optional
Maintainer: Debian Games Team <pkg-games-devel at lists.alioth.debian.org>
Uploaders: Barry deFreese <bdefreese at debian.org>,
Vincent Legout <vlegout at debian.org>
-Build-Depends: debhelper (>= 9), libgnomeui-dev, libglib2.0-dev, autotools-dev, dh-autoreconf
+Build-Depends: debhelper (>= 9), libgoocanvas-2.0-dev, libgnome-games-support-1-dev, autotools-dev, dh-autoreconf
Standards-Version: 3.9.4
Vcs-Svn: svn://svn.debian.org/svn/pkg-games/packages/trunk/gnome-breakout/
Vcs-Browser: http://svn.debian.org/wsvn/pkg-games/packages/trunk/gnome-breakout/
--- gnome-breakout-0.5.3.orig/debian/copyright
+++ gnome-breakout-0.5.3/debian/copyright
@@ -14,3 +14,9 @@ You are free to distribute this software
the GNU General Public License.
On Debian systems, the complete text if the GNU General Public
License can be found in /usr/share/common-licenses/GPL
+
+As the program links dynamically with libgnome-games-support, the
+package is distributed under the terms of the GNU General Public
+License, version 3 or later.
+On Debian systems, the complete text if the GNU General Public
+License, version 3 can be found in /usr/share/common-licenses/GPL-3.
--- gnome-breakout-0.5.3.orig/debian/patches/09_goocanvas_port.patch
+++ gnome-breakout-0.5.3/debian/patches/09_goocanvas_port.patch
@@ -0,0 +1,2017 @@
+Description: Port to GooCanvas / GTK+ 3.
+ Migrate from old-style ~/.gnome2 configuration file to GSettings.
+ Use libgnome-games-support as replacement of libgnome's gnome-scores.
+Bug-Debian: https://bugs.debian.org/868424
+Author: Yavor Doganov <yavor at gnu.org>
+Forwarded: no
+Last-Update: 2018-09-11
+---
+
+--- gnome-breakout-0.5.3.orig/configure.in
++++ gnome-breakout-0.5.3/configure.in
+@@ -4,7 +4,7 @@
+ AC_CONFIG_SRCDIR(src/gnome-breakout.c)
+ AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
+
+-PKG_CHECK_MODULES(GNOMEUI, libgnomeui-2.0)
++PKG_CHECK_MODULES(GNOMEUI, goocanvas-2.0 libgnome-games-support-1)
+ AC_SUBST(GNOMEUI_CFLAGS)
+ AC_SUBST(GNOMEUI_LIBS)
+
+@@ -17,6 +17,10 @@
+ AC_ISC_POSIX
+ AC_HEADER_STDC
+
++GLIB_GSETTINGS
++# Avoid installation of schema in /usr/share/games.
++AC_SUBST(gsettingsschemadir, [${prefix}/share/glib-2.0/schemas])
++
+ GETTEXT_PACKAGE=gnome-breakout
+ ALL_LINGUAS="ru tr de sv"
+ AM_GLIB_GNU_GETTEXT
+--- gnome-breakout-0.5.3.orig/src/breakout.h
++++ gnome-breakout-0.5.3/src/breakout.h
+@@ -7,9 +7,7 @@
+ * "COPYING" for more details.
+ */
+
+-#include <gdk/gdk.h>
+-#include <gnome.h>
+-#include <libgnomecanvas/libgnomecanvas.h>
++#include <goocanvas.h>
+
+ /*
+ * Dimensions.
+@@ -56,7 +54,7 @@
+ gint frame_no;
+ gint num_frames;
+ GdkPixbuf **pixmaps;
+- GnomeCanvasItem *canvas_item;
++ GooCanvasItem *canvas_item;
+ AnimType type;
+ } Animation;
+
+@@ -139,6 +137,9 @@
+ #define ADD_SCORE(game, _score) game->score += _score * game->flags->score_modifier
+
+ typedef struct {
++ GSettings *settings;
++ gboolean migrated;
++
+ /* User set values */
+ Difficulty difficulty;
+ Difficulty next_game_difficulty;
+@@ -155,7 +156,7 @@
+ gboolean pause_on_pointer;
+ gboolean pause_on_pref;
+ gint bounce_entropy;
+- GList *level_files;
++ gchar **level_files;
+
+ /* Computed values */
+ gdouble score_modifier;
+--- gnome-breakout-0.5.3.orig/src/gui.h
++++ gnome-breakout-0.5.3/src/gui.h
+@@ -7,6 +7,8 @@
+ * "COPYING" for more details.
+ */
+
++#include <libgnome-games-support.h>
++
+ void gui_init(Game *game, int argc, char **argv);
+ void add_to_canvas(Entity *entity);
+ void remove_from_canvas(Entity *entity);
+@@ -23,10 +25,12 @@
+ /* This holds pointers to objects in the currently running GNOME app. It should
+ * only be used in gui.c and gui-callbacks.c */
+ typedef struct {
+- GnomeApp *app;
+- GnomeCanvas *canvas;
+- GnomeCanvasItem *title_image;
+- GnomeCanvasItem *background;
++ GtkWindow *app;
++ GamesScoresCategory *category;
++ GamesScoresContext *scores;
++ GooCanvas *canvas;
++ GooCanvasItem *title_image;
++ GooCanvasItem *background;
+ GtkWidget *vbox;
+ GtkWidget *label_hbox1;
+ GtkWidget *label_hbox2;
+--- gnome-breakout-0.5.3.orig/src/flags.c
++++ gnome-breakout-0.5.3/src/flags.c
+@@ -8,6 +8,8 @@
+ * "COPYING" for more details.
+ */
+
++#include <glib/gi18n.h>
++#include <glib/gstdio.h>
+ #include "breakout.h"
+ #include "flags.h"
+ #include "util.h"
+@@ -23,10 +25,10 @@
+ #define DEFAULT_PAUSE_ON_POINTER "true"
+ #define DEFAULT_PAUSE_ON_PREF "true"
+ #define DEFAULT_HIDE_POINTER "true"
+-#define DEFAULT_LEFT_KEY GDK_Left
+-#define DEFAULT_RIGHT_KEY GDK_Right
+-#define DEFAULT_FIRE1_KEY GDK_z
+-#define DEFAULT_FIRE2_KEY GDK_x
++#define DEFAULT_LEFT_KEY GDK_KEY_Left
++#define DEFAULT_RIGHT_KEY GDK_KEY_Right
++#define DEFAULT_FIRE1_KEY GDK_KEY_z
++#define DEFAULT_FIRE2_KEY GDK_KEY_x
+ #define DEFAULT_BOUNCE_ENTROPY 0
+ #define DEFAULT_LEVEL_FILES (LEVELDIR "/alcaron.gbl;" LEVELDIR "/mdutour.gbl;" LEVELDIR "/mmack.gbl")
+
+@@ -50,6 +52,99 @@
+ GList *unpack_string_list(gchar *s);
+ gchar *pack_string_list(GList *s);
+
++/* Migrate old settings from ~/.gnome2/gnome-breakout. */
++static gboolean migrate_old_settings(GSettings *settings) {
++ GKeyFile *kf;
++ gchar *file;
++ gboolean migrated = FALSE;
++
++ kf = g_key_file_new();
++ file = g_build_filename(g_get_home_dir(), ".gnome2",
++ "gnome-breakout", NULL);
++ if(g_key_file_load_from_file(kf, file, G_KEY_FILE_NONE, NULL)) {
++ gchar **groups;
++ gsize len;
++
++ /* File exists but if the user never changed the
++ settings it will contain only the Placement section
++ (automatically created internal Bonobo stuff). */
++ groups = g_key_file_get_groups(kf, &len);
++ if(len > 1) {
++ gchar **levels;
++ gboolean b;
++ gint i;
++
++ /* Apply all changes at once. */
++ g_settings_delay(settings);
++ b = g_key_file_get_boolean(kf, "control",
++ "mouse_control", NULL);
++ g_settings_set_boolean(settings, "mouse-control", b);
++ b = g_key_file_get_boolean(kf, "control",
++ "keyboard_control", NULL);
++ g_settings_set_boolean(settings, "keyboard-control", b);
++ b = g_key_file_get_boolean(kf, "game",
++ "pause_on_focus", NULL);
++ g_settings_set_boolean(settings, "pause-on-focus", b);
++ b = g_key_file_get_boolean(kf, "game",
++ "pause_on_pointer", NULL);
++ g_settings_set_boolean(settings, "pause-on-pointer", b);
++ b = g_key_file_get_boolean(kf, "game",
++ "pause_on_pref", NULL);
++ g_settings_set_boolean(settings, "pause-on-pref", b);
++ b = g_key_file_get_boolean(kf, "game",
++ "hide_pointer", NULL);
++ g_settings_set_boolean(settings, "hide-pointer", b);
++
++ i = g_key_file_get_integer(kf, "game",
++ "bounce_entropy", NULL);
++ g_settings_set_uint(settings, "bounce-entropy", i);
++
++ i = g_key_file_get_integer(kf, "control",
++ "bat_speed", NULL);
++ g_settings_set_int(settings, "bat-speed", i);
++
++ i = g_key_file_get_integer(kf, "game",
++ "difficulty", NULL);
++ g_settings_set_enum(settings, "difficulty", i);
++
++ i = g_key_file_get_integer(kf, "keys",
++ "left_key", NULL);
++ g_settings_set_string(settings, "left-key",
++ gdk_keyval_name(i));
++
++ i = g_key_file_get_integer(kf, "keys",
++ "right_key", NULL);
++ g_settings_set_string(settings, "right-key",
++ gdk_keyval_name(i));
++
++ i = g_key_file_get_integer(kf, "keys",
++ "fire1_key", NULL);
++ g_settings_set_string(settings, "fire1-key",
++ gdk_keyval_name(i));
++
++ i = g_key_file_get_integer(kf, "keys",
++ "fire2_key", NULL);
++ g_settings_set_string(settings, "fire2-key",
++ gdk_keyval_name(i));
++
++ levels = g_key_file_get_string_list(kf, "game",
++ "level_files",
++ NULL, NULL);
++ g_settings_set_strv(settings, "level-files",
++ (const gchar **) levels);
++ g_strfreev(levels);
++ g_settings_apply(settings);
++ migrated = TRUE;
++ }
++ g_strfreev(groups);
++ g_unlink(file);
++ }
++ g_free(file);
++ g_key_file_free(kf);
++
++ return migrated;
++}
++
+ /* Loads the flags, and computes certain difficulty values */
+ Flags *load_flags(void) {
+ Flags *flags;
+@@ -57,55 +152,62 @@
+
+ flags = g_malloc(sizeof(Flags));
+
+- gnome_config_push_prefix("/" PACKAGE "/");
++ flags->settings = g_settings_new("au.com.senet.gnome-breakout");
++ if(migrate_old_settings(flags->settings))
++ flags->migrated = TRUE;
++ else
++ flags->migrated = FALSE;
++
++ flags->mouse_control = g_settings_get_boolean(flags->settings,
++ "mouse-control");
++ flags->keyboard_control = g_settings_get_boolean(flags->settings,
++ "keyboard-control");
++ flags->pause_on_focus = g_settings_get_boolean(flags->settings,
++ "pause-on-focus");
++ flags->pause_on_pointer = g_settings_get_boolean(flags->settings,
++ "pause-on-pointer");
++ flags->pause_on_pref = g_settings_get_boolean(flags->settings,
++ "pause-on-pref");
++ flags->hide_pointer = g_settings_get_boolean(flags->settings,
++ "hide-pointer");
+
+- flags->mouse_control = gnome_config_get_bool(
+- "control/mouse_control=" DEFAULT_MOUSE_CONTROL);
+- flags->keyboard_control = gnome_config_get_bool(
+- "control/keyboard_control=" DEFAULT_KEYBOARD_CONTROL);
+- flags->pause_on_focus = gnome_config_get_bool(
+- "game/pause_on_focus=" DEFAULT_PAUSE_ON_FOCUS);
+- flags->pause_on_pointer = gnome_config_get_bool(
+- "game/pause_on_pointer=" DEFAULT_PAUSE_ON_POINTER);
+- flags->pause_on_pref = gnome_config_get_bool(
+- "game/pause_on_pref=" DEFAULT_PAUSE_ON_PREF);
+- flags->hide_pointer = gnome_config_get_bool(
+- "game/hide_pointer=" DEFAULT_HIDE_POINTER);
++ flags->bounce_entropy = g_settings_get_uint(flags->settings,
++ "bounce-entropy");
+
+- tmp = g_strdup_printf("game/bounce_entropy=%d", DEFAULT_BOUNCE_ENTROPY);
+- flags->bounce_entropy = gnome_config_get_int(tmp);
+- g_free(tmp);
++ flags->bat_speed = g_settings_get_int(flags->settings, "bat-speed");
+
+- tmp = g_strdup_printf("control/bat_speed=%d", DEFAULT_BAT_SPEED);
+- flags->bat_speed = gnome_config_get_int(tmp);
+- g_free(tmp);
+-
+- tmp = g_strdup_printf("game/difficulty=%d", DEFAULT_DIFFICULTY);
+- flags->next_game_difficulty = gnome_config_get_int(tmp);
++ flags->next_game_difficulty = g_settings_get_enum(flags->settings,
++ "difficulty");
+ flags->difficulty = flags->next_game_difficulty;
+- g_free(tmp);
+
+- tmp = g_strdup_printf("keys/left_key=%d", DEFAULT_LEFT_KEY);
+- flags->left_key = gnome_config_get_int(tmp);
++ tmp = g_settings_get_string(flags->settings, "left-key");
++ flags->left_key = gdk_keyval_from_name(tmp);
+ g_free(tmp);
+
+- tmp = g_strdup_printf("keys/right_key=%d", DEFAULT_RIGHT_KEY);
+- flags->right_key = gnome_config_get_int(tmp);
++ tmp = g_settings_get_string(flags->settings, "right-key");
++ flags->right_key = gdk_keyval_from_name(tmp);
+ g_free(tmp);
+
+- tmp = g_strdup_printf("keys/fire1_key=%d", DEFAULT_FIRE1_KEY);
+- flags->fire1_key = gnome_config_get_int(tmp);
++ tmp = g_settings_get_string(flags->settings, "fire1-key");
++ flags->fire1_key = gdk_keyval_from_name(tmp);
+ g_free(tmp);
+
+- tmp = g_strdup_printf("keys/fire2_key=%d", DEFAULT_FIRE2_KEY);
+- flags->fire2_key = gnome_config_get_int(tmp);
++ tmp = g_settings_get_string(flags->settings, "fire2-key");
++ flags->fire2_key = gdk_keyval_from_name(tmp);
+ g_free(tmp);
+
+- tmp = g_strdup_printf("game/level_files=%s", DEFAULT_LEVEL_FILES);
+- flags->level_files = unpack_string_list(gnome_config_get_string(tmp));
+- g_free(tmp);
++ flags->level_files = g_settings_get_strv(flags->settings,
++ "level-files");
++ if(g_strv_length(flags->level_files) == 0) {
++ flags->level_files = g_renew(gchar *, flags->level_files, 4);
++ flags->level_files[0] = g_strdup(LEVELDIR "/alcaron.gbl");
++ flags->level_files[1] = g_strdup(LEVELDIR "/mdutour.gbl");
++ flags->level_files[2] = g_strdup(LEVELDIR "/mmack.gbl");
++ flags->level_files[3] = NULL;
++ g_settings_set_strv(flags->settings, "level-files",
++ (const gchar **) flags->level_files);
++ }
+
+- gnome_config_pop_prefix();
+ compute_flags(flags);
+
+ return flags;
+@@ -116,14 +218,6 @@
+ void compute_flags(Flags *flags) {
+ gboolean resetcontrol = FALSE;
+
+- /* Difficulty sanity checks */
+- if(flags->next_game_difficulty != DIFFICULTY_EASY
+- && flags->next_game_difficulty != DIFFICULTY_MEDIUM
+- && flags->next_game_difficulty != DIFFICULTY_HARD) {
+- gb_warning(_("Difficulty in config files is an incorrect value, resetting to defaults"));
+- flags->next_game_difficulty = DEFAULT_DIFFICULTY;
+- }
+-
+ /* Difficulty computation */
+ switch(flags->difficulty) {
+ case DIFFICULTY_EASY :
+@@ -160,149 +254,115 @@
+ }
+
+ if(resetcontrol) {
+- if(!strcmp(DEFAULT_KEYBOARD_CONTROL, "true"))
+- flags->keyboard_control = TRUE;
+- else
++ if(!strcmp(DEFAULT_KEYBOARD_CONTROL, "true")) {
++ flags->keyboard_control = TRUE;
++ g_settings_set_boolean(flags->settings,
++ "keyboard-control", TRUE);
++ } else {
+ flags->keyboard_control = FALSE;
+- if(!strcmp(DEFAULT_MOUSE_CONTROL, "true"))
++ g_settings_set_boolean(flags->settings,
++ "mouse-control", FALSE);
++ }
++ if(!strcmp(DEFAULT_MOUSE_CONTROL, "true")) {
+ flags->mouse_control = TRUE;
+- else
++ g_settings_set_boolean(flags->settings,
++ "mouse-control", TRUE);
++ } else {
+ flags->keyboard_control = FALSE;
++ g_settings_set_boolean(flags->settings,
++ "mouse-control", FALSE);
++ }
+ /* Check to see if we've messed the defaults */
+ g_assert(flags->keyboard_control || flags->mouse_control);
+ g_assert(!(flags->keyboard_control && flags->mouse_control));
+ }
+-
+- /* Bat speed sanity checks */
+- if(flags->bat_speed < MIN_BATSPEED) {
+- gb_warning(_("Bat speed is lower than allowed range, setting to lowest"));
+- flags->bat_speed = MIN_BATSPEED;
+- }
+- if(flags->bat_speed > MAX_BATSPEED) {
+- gb_warning(_("Bat speed is higher than allowed range, setting to highest"));
+- flags->bat_speed = MAX_BATSPEED;
+- }
+-
+- /* Bounce entropy sanity checks */
+- if(flags->bounce_entropy < MIN_BOUNCE_ENTROPY) {
+- gb_warning(_("Bounce entropy is lower than allowed range, setting to lowest"));
+- flags->bounce_entropy = MIN_BOUNCE_ENTROPY;
+- }
+- if(flags->bounce_entropy > MAX_BOUNCE_ENTROPY) {
+- gb_warning(_("Bounce entropy is higher than allowed range, setting to highest"));
+- flags->bounce_entropy = MAX_BOUNCE_ENTROPY;
+- }
+ }
+
+ /* Saves the flags */
+ void save_flags(Flags *flags) {
+- gchar *tmp;
+-
+- gnome_config_push_prefix("/" PACKAGE "/");
+-
+- gnome_config_set_int("game/difficulty", flags->next_game_difficulty);
+- gnome_config_set_bool("game/pause_on_focus", flags->pause_on_focus);
+- gnome_config_set_bool("game/pause_on_pointer", flags->pause_on_pointer);
+- gnome_config_set_bool("game/pause_on_pref", flags->pause_on_pref);
+- gnome_config_set_bool("game/hide_pointer", flags->hide_pointer);
+- gnome_config_set_int("game/bounce_entropy", flags->bounce_entropy);
+- gnome_config_set_bool("control/mouse_control", flags->mouse_control);
+- gnome_config_set_bool("control/keyboard_control",
+- flags->keyboard_control);
+- gnome_config_set_int("control/bat_speed", flags->bat_speed);
+- gnome_config_set_int("keys/left_key", flags->left_key);
+- gnome_config_set_int("keys/right_key", flags->right_key);
+- gnome_config_set_int("keys/fire1_key", flags->fire1_key);
+- gnome_config_set_int("keys/fire2_key", flags->fire2_key);
+- tmp = pack_string_list(flags->level_files);
+- gnome_config_set_string("game/level_files", tmp);
+- g_free(tmp);
+-
+- gnome_config_pop_prefix();
+- gnome_config_sync();
+-}
+-
+-/* Takes a string, splitting it by the ; character, returning a list of the
+- * split values */
+-GList *unpack_string_list(gchar *s) {
+- GList *ret = NULL;
+- gchar *s_p, *s_new;
+-
+- if(*s) {
+- while((s_p = (gchar *) strsep(&s, ";"))) {
+- if(*s_p) {
+- s_new = g_strdup(s_p);
+- ret = g_list_prepend(ret, s_new);
+- }
+- }
+- }
+-
+- return ret;
+-}
+-
+-/* Takes a list of strings and generates a big string, seperating each entry
+- * with a ; */
+-gchar *pack_string_list(GList *l) {
+- GList *l_p;
+- gchar *ret;
+-
+- ret = g_malloc(1024 * sizeof(gchar));
+- *ret = '\0';
+- for(l_p = l; l_p; l_p = g_list_next(l_p)) {
+- strncat(ret, (char *) l_p->data, 1024);
+- strncat(ret, ";", 1024);
+- }
+-
+- return ret;
++ g_settings_delay(flags->settings);
++ g_settings_set_enum(flags->settings, "difficulty",
++ flags->next_game_difficulty);
++ g_settings_set_boolean(flags->settings, "pause-on-focus",
++ flags->pause_on_focus);
++ g_settings_set_boolean(flags->settings, "pause-on-pointer",
++ flags->pause_on_pointer);
++ g_settings_set_boolean(flags->settings, "pause-on-pref",
++ flags->pause_on_pref);
++ g_settings_set_boolean(flags->settings, "hide-pointer",
++ flags->hide_pointer);
++ g_settings_set_uint(flags->settings, "bounce-entropy",
++ flags->bounce_entropy);
++ g_settings_set_boolean(flags->settings, "mouse-control",
++ flags->mouse_control);
++ g_settings_set_boolean(flags->settings, "keyboard-control",
++ flags->keyboard_control);
++ g_settings_set_int(flags->settings, "bat-speed", flags->bat_speed);
++ g_settings_set_string(flags->settings, "left-key",
++ gdk_keyval_name(flags->left_key));
++ g_settings_set_string(flags->settings, "right-key",
++ gdk_keyval_name(flags->right_key));
++ g_settings_set_string(flags->settings, "fire1-key",
++ gdk_keyval_name(flags->fire1_key));
++ g_settings_set_string(flags->settings, "fire1-key",
++ gdk_keyval_name(flags->fire1_key));
++ g_settings_set_strv(flags->settings, "level-files",
++ (const gchar **) flags->level_files);
++ g_settings_apply(flags->settings);
+ }
+
+ /* Allocs and copies a Flags structure. */
+ Flags *copy_flags(Flags *flags) {
+ Flags *newflags;
+- GList *curr;
+
+ newflags = g_malloc(sizeof(Flags));
+
+ /* Most values can simply be memcpy'ed.... */
+ memcpy(newflags, flags, sizeof(Flags));
+
+- /* ... except for the LevelFiles list */
+- newflags->level_files = NULL;
+- for(curr = flags->level_files; curr; curr = g_list_next(curr)) {
+- newflags->level_files = g_list_prepend(newflags->level_files, g_strdup((gchar *) curr->data));
+- }
+-
+ return newflags;
+ }
+
+ /* Destroys and frees a Flags structure */
+ void destroy_flags(Flags *flags) {
+- GList *curr;
+-
+- for(curr = flags->level_files; curr; curr = g_list_next(curr)) {
+- g_free(curr->data);
+- curr->data = NULL;
+- }
+-
+- g_list_free(flags->level_files);
+ g_free(flags);
+ }
+
+ /* Adds a levelfile to the Flags structure */
+ void add_flags_levelfile(Flags *flags, gchar *filename) {
++ gchar **new;
++ guint i, len;
++
+ g_assert(flags && filename);
+- flags->level_files = g_list_prepend(flags->level_files, g_strdup(filename));
++ len = g_strv_length(flags->level_files);
++ new = g_new0(gchar *, len + 2);
++ for(i = 0; i < len; i++)
++ new[i] = g_strdup(flags->level_files[i]);
++
++ new[i++] = g_strdup(filename);
++ new[i] = NULL;
++ g_strfreev(flags->level_files);
++ flags->level_files = g_strdupv(new);
++ g_strfreev(new);
+ }
+
+ /* Removes a levelfile from the Flags structure. Assumes that it's there in the
+ * first place */
+ void remove_flags_levelfile(Flags *flags, gchar *filename) {
+- GList *curr;
++ gchar **new;
++ guint i, j, len;
+ g_assert(flags && filename);
+
+- for(curr = flags->level_files; curr && strcmp((gchar *) curr->data, filename); curr = g_list_next(curr));
+-
+- g_assert(curr && curr->data);
+- g_free(curr->data);
+- flags->level_files = g_list_remove(flags->level_files, curr->data);
++ len = g_strv_length(flags->level_files);
++ new = g_new0(gchar *, len);
++ for(i = 0, j = 0; j < len; i++, j++) {
++ if(!g_strcmp0(flags->level_files[i], filename)) {
++ j--;
++ continue;
++ }
++ new[j] = g_strdup(flags->level_files[i]);
++ }
++ g_strfreev(flags->level_files);
++ flags->level_files = g_strdupv(new);
++ g_strfreev(new);
+ }
+--- gnome-breakout-0.5.3.orig/Makefile.am
++++ gnome-breakout-0.5.3/Makefile.am
+@@ -4,6 +4,7 @@
+ EXTRA_DIST = \
+ gnome-breakout.desktop \
+ gnome-breakout.png \
++ $(gsettings_SCHEMAS) \
+ TODO \
+ BUGS
+
+@@ -13,6 +14,10 @@
+ Gamesdir = $(datadir)/gnome/apps/Games
+ Games_DATA = gnome-breakout.desktop
+
++gsettings_SCHEMAS = au.com.senet.gnome-breakout.gschema.xml
++
++ at GSETTINGS_RULES@
++
+ install-data-local:
+ -$(mkinstalldirs) $(DESTDIR)$(scoredir)
+ -touch $(DESTDIR)$(scoredir)/gnome-breakout.scores
+--- /dev/null
++++ gnome-breakout-0.5.3/au.com.senet.gnome-breakout.gschema.xml
+@@ -0,0 +1,55 @@
++<schemalist gettext-domain="gnome-breakout">
++
++ <enum id="au.com.senet.gnome-breakout.Difficulty">
++ <value nick="easy" value="1"/>
++ <value nick="medium" value="0"/>
++ <value nick="hard" value="2"/>
++ </enum>
++
++ <schema id="au.com.senet.gnome-breakout" path="/au/com/senet/gnome-breakout/">
++ <key name="difficulty" enum="au.com.senet.gnome-breakout.Difficulty">
++ <default>'medium'</default>
++ </key>
++ <key name="pause-on-focus" type="b">
++ <default>false</default>
++ </key>
++ <key name="pause-on-pointer" type="b">
++ <default>true</default>
++ </key>
++ <key name="pause-on-pref" type="b">
++ <default>true</default>
++ </key>
++ <key name="hide-pointer" type="b">
++ <default>true</default>
++ </key>
++ <key name="bounce-entropy" type="u">
++ <range min="0" max="40"/>
++ <default>0</default>
++ </key>
++ <key name="level-files" type="as">
++ <default>[]</default>
++ </key>
++ <key name="mouse-control" type="b">
++ <default>true</default>
++ </key>
++ <key name="keyboard-control" type="b">
++ <default>false</default>
++ </key>
++ <key name="bat-speed" type="i">
++ <range min="5" max="25"/>
++ <default>15</default>
++ </key>
++ <key name="left-key" type="s">
++ <default>'Left'</default>
++ </key>
++ <key name="right-key" type="s">
++ <default>'Right'</default>
++ </key>
++ <key name="fire1-key" type="s">
++ <default>'z'</default>
++ </key>
++ <key name="fire2-key" type="s">
++ <default>'x'</default>
++ </key>
++ </schema>
++</schemalist>
+--- gnome-breakout-0.5.3.orig/src/gnome-breakout.c
++++ gnome-breakout-0.5.3/src/gnome-breakout.c
+@@ -1,5 +1,6 @@
+ #include <unistd.h>
+ #include <time.h>
++#include <glib/gi18n.h>
+ #include "breakout.h"
+ #include "flags.h"
+ #include "anim.h"
+@@ -13,26 +14,21 @@
+ * files, and starts the gui */
+ int main(int argc, char **argv) {
+ Game game;
+- gboolean show_score_warning = FALSE;
+
+- show_score_warning = (gnome_score_init(PACKAGE) == -1);
+ memset(&game, 0, sizeof(Game));
+
+ srand((unsigned int) clock());
+
+ bindtextdomain(PACKAGE, GNOMELOCALEDIR);
+ textdomain(PACKAGE);
+- gnome_program_init(PACKAGE, VERSION, LIBGNOMEUI_MODULE, argc, argv,
+- GNOME_PARAM_NONE);
+- gui_init(&game, argc, argv);
++ gtk_init(&argc, &argv);
++
+ game.flags = load_flags();
++ gui_init(&game, argc, argv);
+ init_leveldata(&game);
+
+ init_animations();
+
+- if(show_score_warning)
+- gb_warning("Failed to initialise gnome_score. Is " PACKAGE " installed setgid to the games group?");
+-
+ gtk_main();
+
+ return 0;
+@@ -41,14 +37,11 @@
+ /* Loads the levelfiles into memory that are specified in game->flags, deleting
+ * the ones that won't load */
+ static void init_leveldata(Game *game) {
+- GList *curr, *next;
++ gint i;
+
+- curr = game->flags->level_files;
+- while(curr) {
+- next = g_list_next(curr);
+- if(!leveldata_add((gchar *) curr->data)) {
+- remove_flags_levelfile(game->flags, curr->data);
+- }
+- curr = next;
++ for(i = 0; i < g_strv_length(game->flags->level_files); i++) {
++ if(!leveldata_add(game->flags->level_files[i]))
++ remove_flags_levelfile(game->flags,
++ game->flags->level_files[i]);
+ }
+ }
+--- gnome-breakout-0.5.3.orig/src/gui.c
++++ gnome-breakout-0.5.3/src/gui.c
+@@ -8,6 +8,7 @@
+ * "COPYING" for more details.
+ */
+
++#include <glib/gi18n.h>
+ #include "breakout.h"
+ #include "gui.h"
+ #include "gui-callbacks.h"
+@@ -23,53 +24,104 @@
+ static void init_menus(void);
+ static void init_statusbar(void);
+
++static GamesScoresCategory* get_category(const gchar* key, gpointer data) {
++ return gui->category;
++}
++
++static void show_migration_message(void) {
++ GtkWidget *dlg;
++
++ dlg = gtk_message_dialog_new(gui->app,
++ GTK_DIALOG_DESTROY_WITH_PARENT,
++ GTK_MESSAGE_INFO,
++ GTK_BUTTONS_CLOSE,
++ "%s",
++ "Successfully migrated old settings.\n"
++ "Old scores were lost.");
++ gtk_dialog_run(GTK_DIALOG(dlg));
++ gtk_widget_destroy(dlg);
++}
++
+ /* Initialise the interface. */
+ void gui_init(Game *game, int argc, char **argv) {
++ GdkPixbuf *icon;
++ gchar **dirs;
++ gchar *file;
++ gint i;
+
+ /* Initialise the basic app */
+ gui = g_malloc(sizeof(GuiInfo));
+ gui->game = game;
+- gui->app = (GnomeApp *) gnome_app_new(PACKAGE,
+- _("GNOME Breakout"));
+- gtk_window_set_policy(GTK_WINDOW (gui->app), FALSE, FALSE, TRUE);
+- g_signal_connect(GTK_OBJECT (gui->app), "delete_event",
+- GTK_SIGNAL_FUNC (cb_sig_exit_game), gui);
++ gui->app = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL));
++ gtk_window_set_title(gui->app, _("GNOME Breakout"));
++ gtk_window_set_resizable(gui->app, FALSE);
++
++ dirs = (gchar **) g_get_system_data_dirs();
++ for(i = 0; i < g_strv_length(dirs); i++) {
++ file = g_build_filename (dirs[i], G_DIR_SEPARATOR_S,
++ "pixmaps", G_DIR_SEPARATOR_S,
++ "gnome-breakout.png", NULL);
++ if (g_file_test(file, G_FILE_TEST_EXISTS))
++ break;
++
++ g_free(file);
++ }
++
++ icon = gdk_pixbuf_new_from_file(file, NULL);
++ g_free(file);
++ gtk_window_set_icon(gui->app, icon);
++ g_object_unref(icon);
++
++ g_signal_connect(G_OBJECT (gui->app), "delete_event",
++ G_CALLBACK (cb_sig_exit_game), gui);
+
+ /* Bind the keypresses */
+- g_signal_connect(GTK_OBJECT (gui->app), "key_press_event",
+- GTK_SIGNAL_FUNC (cb_keydown), gui);
+- g_signal_connect(GTK_OBJECT (gui->app), "key_release_event",
+- GTK_SIGNAL_FUNC (cb_keyup), gui);
++ g_signal_connect(G_OBJECT (gui->app), "key_press_event",
++ G_CALLBACK (cb_keydown), gui);
++ g_signal_connect(G_OBJECT (gui->app), "key_release_event",
++ G_CALLBACK (cb_keyup), gui);
+
+ /* Pause on focus loss for keyboard control */
+- g_signal_connect(GTK_OBJECT(gui->app), "focus_in_event",
+- GTK_SIGNAL_FUNC(cb_main_focus_change), gui);
+- g_signal_connect(GTK_OBJECT(gui->app), "focus_out_event",
+- GTK_SIGNAL_FUNC(cb_main_focus_change), gui);
++ g_signal_connect(G_OBJECT(gui->app), "focus_in_event",
++ G_CALLBACK(cb_main_focus_change), gui);
++ g_signal_connect(G_OBJECT(gui->app), "focus_out_event",
++ G_CALLBACK(cb_main_focus_change), gui);
++
++ gui->category = games_scores_category_new("gnome-breakout",
++ "Highest Scores");
++ gui->scores = games_scores_context_new(
++ "gnome-breakout",
++ "Highest Scores",
++ gui->app,
++ get_category, NULL,
++ GAMES_SCORES_STYLE_POINTS_GREATER_IS_BETTER);
+
+ /* Main vbox */
+- gui->vbox = gtk_vbox_new(FALSE, 0);
++ gui->vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
++
++ /* Initialise the menus */
++ init_menus();
+
+ /* Initialise the top statusbar */
+ init_labels();
+
+ /* Initialise the canvas */
+- gnome_app_set_contents(GNOME_APP (gui->app), gui->vbox);
++ gtk_container_add(GTK_CONTAINER (gui->app), gui->vbox);
+ init_canvas();
+
+ /* Initialise the statusbar */
+- gui->appbar = gnome_appbar_new(FALSE, TRUE, GNOME_PREFERENCES_NEVER);
+- gnome_app_set_statusbar(gui->app, gui->appbar);
++ gui->appbar = gtk_statusbar_new();
+ init_statusbar();
+
+- /* Initialise the menus */
+- init_menus();
+-
+ gtk_widget_show_all(GTK_WIDGET (gui->app));
++
++ if(gui->game->flags->migrated)
++ show_migration_message();
+ }
+
+ static void init_canvas(void) {
+ GdkPixbuf *image;
++ GooCanvasItem *root;
+ GError *error = NULL;
+
+ /* Push the imlib colormap and visual, and make the canvas */
+@@ -77,20 +129,22 @@
+ gtk_widget_push_visual(gdk_imlib_get_visual());
+ gtk_widget_push_colormap(gdk_imlib_get_colormap());
+ */
+- gui->canvas = (GnomeCanvas *) gnome_canvas_new();
++ gui->canvas = (GooCanvas *) goo_canvas_new();
++ root = goo_canvas_get_root_item(gui->canvas);
+
+ /* Set the canvas attributes */
+- gnome_canvas_set_pixels_per_unit(gui->canvas, 1);
+- gtk_widget_set_usize(GTK_WIDGET(gui->canvas), GAME_WIDTH, GAME_HEIGHT);
+- gnome_canvas_set_scroll_region(gui->canvas, 0, 0, GAME_WIDTH,
++ gtk_widget_set_size_request(GTK_WIDGET(gui->canvas),
++ GAME_WIDTH, GAME_HEIGHT);
++ goo_canvas_set_bounds(gui->canvas, 0, 0, GAME_WIDTH,
+ GAME_HEIGHT);
+
+ /* Make the canvas background black */
+- gui->background = gnome_canvas_item_new(gnome_canvas_root(gui->canvas),
+- GNOME_TYPE_CANVAS_RECT, "x1", 0.0, "x2",
+- (double) GAME_WIDTH, "y1", 0.0, "y2",
+- (double) GAME_HEIGHT, "fill_color", "black", NULL);
+- gnome_canvas_item_hide(gui->background);
++ gui->background = goo_canvas_rect_new(root,
++ 0.0, 0.0,
++ (double) GAME_WIDTH,
++ (double) GAME_HEIGHT, "fill-color", "black", NULL);
++ g_object_set(gui->background, "visibility",
++ GOO_CANVAS_ITEM_INVISIBLE, NULL);
+
+ /* Add the title image */
+ image = gdk_pixbuf_new_from_file(PIXMAPDIR "/title.png", &error);
+@@ -99,26 +153,23 @@
+ error->message);
+
+ //gdk_imlib_render(image, image->rgb_width, image->rgb_height);
+- gui->title_image = gnome_canvas_item_new(
+- gnome_canvas_root(gui->canvas),
+- GNOME_TYPE_CANVAS_PIXBUF, "pixbuf", image,
+- "x", 0.0, "y", 0.0,
+- "width", (double) GAME_WIDTH,
++ gui->title_image = goo_canvas_image_new(
++ root,
++ image,
++ 0.0, 0.0,
++ "width", (double) GAME_WIDTH,
+ "height", (double) GAME_HEIGHT,
+- "anchor", GTK_ANCHOR_NORTH_WEST,
+ NULL);
+
+- gnome_canvas_update_now(gui->canvas);
+-
+ /* Hide pointer and automatic pause */
+- g_signal_connect(GTK_OBJECT (gui->canvas), "enter-notify-event",
+- GTK_SIGNAL_FUNC (cb_canvas_pointer), gui);
+- g_signal_connect(GTK_OBJECT (gui->canvas), "leave-notify-event",
+- GTK_SIGNAL_FUNC (cb_canvas_pointer), gui);
++ g_signal_connect(G_OBJECT (gui->canvas), "enter-notify-event",
++ G_CALLBACK (cb_canvas_pointer), gui);
++ g_signal_connect(G_OBJECT (gui->canvas), "leave-notify-event",
++ G_CALLBACK (cb_canvas_pointer), gui);
+
+ /* Bind the mouse fire events */
+- g_signal_connect(GTK_OBJECT(gui->canvas), "button_press_event",
+- GTK_SIGNAL_FUNC(cb_canvas_button_press), gui);
++ g_signal_connect(G_OBJECT(gui->canvas), "button_press_event",
++ G_CALLBACK(cb_canvas_button_press), gui);
+
+ gtk_box_pack_start(GTK_BOX(gui->vbox), GTK_WIDGET(gui->canvas),
+ FALSE, FALSE, 0);
+@@ -132,7 +183,7 @@
+ gui->lives_label = gtk_label_new(_("Lives: 0"));
+ gtk_label_set_justify(GTK_LABEL(gui->lives_label), GTK_JUSTIFY_LEFT);
+
+- vseparator1 = gtk_vseparator_new();
++ vseparator1 = gtk_separator_new(GTK_ORIENTATION_VERTICAL);
+
+ gtk_widget_set_sensitive(gui->score_label, FALSE);
+ gtk_widget_set_sensitive(gui->lives_label, FALSE);
+@@ -142,19 +193,18 @@
+ gtk_box_pack_end(GTK_BOX(gui->appbar), vseparator1, FALSE, FALSE, 0);
+ gtk_box_pack_end(GTK_BOX(gui->appbar), gui->lives_label,
+ FALSE, FALSE, 5);
++ gtk_container_add(GTK_CONTAINER(gui->vbox), gui->appbar);
+ }
+
+ /* Adds an entity to the gnome canvas */
+ void add_to_canvas(Entity *entity) {
+- entity->animation.canvas_item = gnome_canvas_item_new(
+- gnome_canvas_root(GNOME_CANVAS(gui->canvas)),
+- GNOME_TYPE_CANVAS_PIXBUF,
+- "pixbuf", entity->animation.pixmaps[entity->animation.frame_no],
+- "x", (double) entity->geometry.x1,
+- "y", (double) entity->geometry.y1,
++ entity->animation.canvas_item = goo_canvas_image_new(
++ goo_canvas_get_root_item(gui->canvas),
++ entity->animation.pixmaps[entity->animation.frame_no],
++ (double) entity->geometry.x1,
++ (double) entity->geometry.y1,
+ "width", (double) entity->geometry.x2 - entity->geometry.x1,
+ "height", (double) entity->geometry.y2 - entity->geometry.y1,
+- "anchor", GTK_ANCHOR_NORTH_WEST,
+ NULL);
+ }
+
+@@ -162,8 +212,8 @@
+ * actually has a canvas_item */
+ void remove_from_canvas(Entity *entity) {
+ if(entity->animation.canvas_item) {
+- gtk_object_destroy(GTK_OBJECT(entity->animation.canvas_item));
+- entity->animation.canvas_item = NULL;
++ if(GOO_IS_CANVAS_ITEM(entity->animation.canvas_item))
++ goo_canvas_item_remove(entity->animation.canvas_item);
+ }
+ }
+
+@@ -220,46 +270,94 @@
+ g_free(lives);
+ }
+
+- gnome_canvas_update_now(gui->canvas);
+ return;
+ }
+
+ /* Assumes that we already have an appbar */
+ static void init_menus() {
+- GnomeUIInfo game_menu[] = {
+- GNOMEUIINFO_MENU_NEW_GAME_ITEM(cb_new_game, gui),
+- GNOMEUIINFO_MENU_PAUSE_GAME_ITEM(cb_pause_game, gui),
+- GNOMEUIINFO_MENU_END_GAME_ITEM(cb_end_game, gui),
+- GNOMEUIINFO_SEPARATOR,
+- GNOMEUIINFO_MENU_PREFERENCES_ITEM(cb_preferences, gui),
+- /* FIXME: Remove this when appropriate */
+- GNOMEUIINFO_ITEM_DATA(_("_Kill ball"),
+- _("Kill the current ball if it gets stuck"),
+- cb_kill_ball, gui, NULL),
+- GNOMEUIINFO_MENU_SCORES_ITEM(cb_scores, gui),
+- GNOMEUIINFO_SEPARATOR,
+- GNOMEUIINFO_MENU_EXIT_ITEM(cb_exit_game, gui),
+- GNOMEUIINFO_END
+- };
+-
+- GnomeUIInfo help_menu[] = {
+- GNOMEUIINFO_ITEM_DATA("_Help", "Help on this application",
+- cb_help, gui, NULL),
+- GNOMEUIINFO_MENU_ABOUT_ITEM(cb_show_about_box, gui),
+- GNOMEUIINFO_END
+- };
+-
+- GnomeUIInfo menubar[] = {
+- GNOMEUIINFO_MENU_GAME_TREE(game_menu),
+- GNOMEUIINFO_MENU_HELP_TREE(help_menu),
+- GNOMEUIINFO_END
+- };
+-
+- gnome_app_create_menus(gui->app, menubar);
+- gnome_app_install_menu_hints(gui->app, menubar);
+- gui->menu_new_game = game_menu[0].widget;
+- gui->menu_pause = game_menu[1].widget;
+- gui->menu_end_game = game_menu[2].widget;
++ GtkAccelGroup *accel_group;
++ GtkWidget *menubar, *menu, *item;
++
++ menubar = gtk_menu_bar_new();
++ accel_group = gtk_accel_group_new();
++ gtk_window_add_accel_group(gui->app, accel_group);
++
++ menu = gtk_menu_new();
++ gtk_menu_set_accel_group(GTK_MENU(menu), accel_group);
++ item = gtk_menu_item_new_with_mnemonic(_("_Game"));
++ gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), menu);
++ gtk_menu_shell_append(GTK_MENU_SHELL(menubar), item);
++
++ gui->menu_new_game = gtk_menu_item_new_with_mnemonic(_("_New Game"));
++ gtk_widget_set_tooltip_text(gui->menu_new_game, _("Start a new game"));
++ gtk_widget_add_accelerator(gui->menu_new_game, "activate", accel_group,
++ GDK_KEY_N, GDK_CONTROL_MASK,
++ GTK_ACCEL_VISIBLE);
++ g_signal_connect(gui->menu_new_game, "activate",
++ G_CALLBACK(cb_new_game), gui);
++ gtk_menu_shell_append(GTK_MENU_SHELL(menu), gui->menu_new_game);
++
++ gui->menu_pause = gtk_menu_item_new_with_mnemonic(_("_Pause Game"));
++ gtk_widget_set_tooltip_text(gui->menu_pause, _("Pause the game"));
++ gtk_widget_add_accelerator(gui->menu_pause, "activate", accel_group,
++ GDK_KEY_Pause, 0, GTK_ACCEL_VISIBLE);
++ g_signal_connect(gui->menu_pause, "activate",
++ G_CALLBACK(cb_pause_game), gui);
++ gtk_menu_shell_append(GTK_MENU_SHELL(menu), gui->menu_pause);
++
++ gui->menu_end_game = gtk_menu_item_new_with_mnemonic(_("_End Game"));
++ gtk_widget_set_tooltip_text(gui->menu_end_game,
++ _("End the current game"));
++ g_signal_connect(gui->menu_end_game, "activate",
++ G_CALLBACK(cb_end_game), gui);
++ gtk_menu_shell_append(GTK_MENU_SHELL(menu), gui->menu_end_game);
++
++ item = gtk_separator_menu_item_new();
++ gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
++
++ item = gtk_menu_item_new_with_mnemonic(_("Prefere_nces"));
++ gtk_widget_set_tooltip_text(item, _("Configure the application"));
++ g_signal_connect(item, "activate", G_CALLBACK(cb_preferences), gui);
++ gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
++
++ item = gtk_menu_item_new_with_mnemonic(_("_Kill ball"));
++ gtk_widget_set_tooltip_text(item,
++ _("Kill the current ball if it gets stuck"));
++ g_signal_connect(item, "activate", G_CALLBACK(cb_kill_ball), gui);
++ gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
++
++ item = gtk_menu_item_new_with_mnemonic(_("_Scores..."));
++ gtk_widget_set_tooltip_text(item, _("View the scores"));
++ g_signal_connect(item, "activate", G_CALLBACK(cb_scores), gui);
++ gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
++
++ item = gtk_separator_menu_item_new();
++ gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
++
++ item = gtk_menu_item_new_with_mnemonic(_("_Quit"));
++ gtk_widget_set_tooltip_text(item, _("Quit the application"));
++ gtk_widget_add_accelerator(item, "activate", accel_group, GDK_KEY_Q,
++ GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
++ g_signal_connect(item, "activate", G_CALLBACK(cb_exit_game), gui);
++ gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
++
++ menu = gtk_menu_new();
++ item = gtk_menu_item_new_with_mnemonic(_("_Help"));
++ gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), menu);
++ gtk_menu_shell_append(GTK_MENU_SHELL(menubar), item);
++
++ item = gtk_menu_item_new_with_mnemonic(_("_Help"));
++ gtk_widget_set_tooltip_text(item, _("Help on this application"));
++ g_signal_connect(item, "activate", G_CALLBACK(cb_help), gui);
++ gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
++
++ item = gtk_menu_item_new_with_mnemonic(_("_About"));
++ gtk_widget_set_tooltip_text(item, _("About this application"));
++ g_signal_connect(item, "activate", G_CALLBACK(cb_show_about_box), gui);
++ gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
++
++ gtk_container_add(GTK_CONTAINER(gui->vbox), menubar);
++
+ gtk_widget_set_sensitive(gui->menu_pause, FALSE);
+ gtk_widget_set_sensitive(gui->menu_end_game, FALSE);
+ }
+@@ -268,7 +366,7 @@
+ * height of the object hasn't changed */
+ void update_canvas_position(Entity *entity) {
+ if(entity->animation.canvas_item) {
+- gnome_canvas_item_set(GNOME_CANVAS_ITEM(entity->animation.canvas_item),
++ g_object_set(G_OBJECT(entity->animation.canvas_item),
+ "x", (double) entity->geometry.x1,
+ "y", (double) entity->geometry.y1,
+ NULL);
+@@ -277,11 +375,20 @@
+
+ /* Updates the current pixmap of an item on the canvas */
+ void update_canvas_animation(Entity *entity) {
++ cairo_surface_t *surface;
++ cairo_pattern_t *pattern;
++
+ g_assert(entity->animation.pixmaps[entity->animation.frame_no]);
+ if(entity->animation.canvas_item) {
+- gnome_canvas_item_set(GNOME_CANVAS_ITEM(entity->animation.canvas_item),
+- "pixbuf", entity->animation.pixmaps[entity->animation.frame_no],
++ surface = gdk_cairo_surface_create_from_pixbuf(
++ entity->animation.pixmaps[entity->animation.frame_no],
++ 0, NULL);
++ pattern = cairo_pattern_create_for_surface(surface);
++ g_object_set(G_OBJECT(entity->animation.canvas_item),
++ "pattern", pattern,
+ NULL);
++ cairo_surface_destroy(surface);
++ cairo_pattern_destroy(pattern);
+ }
+ }
+
+@@ -289,12 +396,12 @@
+ * This must be called by everything that calls game.c:end_game, and it must
+ * be called before calling game.c:end_game */
+ void gui_end_game(EndGameStatus status) {
+- int pos;
+ char *title = NULL;
+
+- gnome_canvas_item_hide(gui->background);
+- gnome_canvas_item_show(gui->title_image);
+- gnome_canvas_update_now(gui->canvas);
++ g_object_set(gui->background, "visibility",
++ GOO_CANVAS_ITEM_INVISIBLE, NULL);
++ g_object_set(gui->title_image, "visibility",
++ GOO_CANVAS_ITEM_VISIBLE, NULL);
+
+ gtk_widget_set_sensitive(gui->score_label, FALSE);
+ gtk_widget_set_sensitive(gui->lives_label, FALSE);
+@@ -305,7 +412,9 @@
+ gtk_widget_set_sensitive(gui->menu_pause, FALSE);
+ gtk_widget_set_sensitive(gui->menu_end_game, FALSE);
+
+- pos = gnome_score_log((gfloat) gui->game->score, NULL, TRUE);
++ games_scores_context_add_score(gui->scores, gui->game->score,
++ gui->category, NULL,
++ cb_add_scores, NULL);
+ switch(status) {
+ case ENDGAME_WIN :
+ title = _("GNOME Breakout: You win!");
+@@ -320,14 +429,15 @@
+ }
+
+ if(title)
+- gnome_scores_display(title, PACKAGE, NULL, pos);
++ games_scores_context_run_dialog(gui->scores);
+ }
+
+ /* Tell the gui that the game has begun, and that we should hide the title */
+ void gui_begin_game(void) {
+- gnome_canvas_item_hide(gui->title_image);
+- gnome_canvas_item_show(gui->background);
+- gnome_canvas_update_now(gui->canvas);
++ g_object_set(gui->title_image, "visibility",
++ GOO_CANVAS_ITEM_INVISIBLE, NULL);
++ g_object_set(gui->background, "visibility",
++ GOO_CANVAS_ITEM_VISIBLE, NULL);
+
+ gtk_widget_set_sensitive(gui->score_label, TRUE);
+ gtk_widget_set_sensitive(gui->lives_label, TRUE);
+@@ -340,9 +450,14 @@
+ }
+
+ gint get_mouse_x_position(void) {
++ GdkWindow *window;
++ GdkSeat *seat;
+ gint x;
+ gint y;
+- gtk_widget_get_pointer(GTK_WIDGET(gui->app), &x, &y);
++ window = gtk_widget_get_window(GTK_WIDGET(gui->app));
++ seat = gdk_display_get_default_seat(gdk_window_get_display(window));
++ gdk_window_get_device_position(window, gdk_seat_get_pointer(seat),
++ &x, &y, NULL);
+ return x;
+ }
+
+@@ -398,15 +513,15 @@
+ static void init_labels(void) {
+ GtkWidget *vsep1, *vsep2, *hsep1;
+
+- gui->label_hbox1 = gtk_hbox_new(FALSE, 0);
+- gui->label_hbox2 = gtk_hbox_new(FALSE, 0);
++ gui->label_hbox1 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
++ gui->label_hbox2 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
+ gui->level_no_label = gtk_label_new(_("No:"));
+ gui->level_name_label = gtk_label_new(_("Name:"));
+ gui->level_author_label = gtk_label_new(_("Author:"));
+ gui->level_levelfile_label = gtk_label_new(_("Levelfile:"));
+- vsep1 = gtk_vseparator_new();
+- vsep2 = gtk_vseparator_new();
+- hsep1 = gtk_hseparator_new();
++ vsep1 = gtk_separator_new(GTK_ORIENTATION_VERTICAL);
++ vsep2 = gtk_separator_new(GTK_ORIENTATION_VERTICAL);
++ hsep1 = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
+
+ gtk_label_set_justify(GTK_LABEL(gui->level_no_label), GTK_JUSTIFY_LEFT);
+ gtk_label_set_justify(GTK_LABEL(gui->level_name_label), GTK_JUSTIFY_LEFT);
+@@ -419,10 +534,10 @@
+ gtk_widget_set_sensitive(gui->level_author_label, FALSE);
+
+ gtk_box_pack_start(GTK_BOX(gui->label_hbox1), gui->level_no_label, TRUE, TRUE, 5);
+- gtk_box_pack_start(GTK_BOX(gui->label_hbox1), vsep1, TRUE, TRUE, 0);
++ gtk_box_pack_start(GTK_BOX(gui->label_hbox1), vsep1, TRUE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(gui->label_hbox1), gui->level_name_label, TRUE, TRUE, 5);
+ gtk_box_pack_start(GTK_BOX(gui->label_hbox2), gui->level_author_label, TRUE, TRUE, 5);
+- gtk_box_pack_start(GTK_BOX(gui->label_hbox2), vsep2, TRUE, TRUE, 0);
++ gtk_box_pack_start(GTK_BOX(gui->label_hbox2), vsep2, TRUE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(gui->label_hbox2), gui->level_levelfile_label, TRUE, TRUE, 5);
+ gtk_box_pack_start(GTK_BOX(gui->vbox), gui->label_hbox1, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(gui->vbox), hsep1, TRUE, TRUE, 0);
+--- gnome-breakout-0.5.3.orig/src/gui-callbacks.c
++++ gnome-breakout-0.5.3/src/gui-callbacks.c
+@@ -19,9 +19,7 @@
+ #include "game.h"
+ #include "ball.h"
+
+-#include <X11/X.h>
+-#include <X11/Xlib.h>
+-#include <gdk/gdkx.h>
++#include <glib/gi18n.h>
+
+ //#define NEXTLEVEL_KEY 1
+
+@@ -35,8 +33,8 @@
+ end_game(gui->game, ENDGAME_MENU);
+ }
+
+- gtk_object_destroy(GTK_OBJECT(gui->background));
+- gtk_object_destroy(GTK_OBJECT(gui->title_image));
++ goo_canvas_item_remove(gui->background);
++ goo_canvas_item_remove(gui->title_image);
+
+ gtk_main_quit();
+ }
+@@ -51,13 +49,17 @@
+
+ /* Show the about box. I wonder, does the about box dialog free itself? */
+ void cb_show_about_box(GtkWidget *widget, gpointer data) {
+- static GtkWidget *dlg;
++ GdkPixbuf *logo;
++ gchar **dirs;
++ gchar *file;
++ gint i;
+ GuiInfo *gui;
+
+ const gchar *authors[] = {
+- "Development:",
+ "Michael Pearson <mipearson at internode.on.net>",
+- "",
++ NULL };
++
++ const gchar *artists[] = {
+ "Additional Levels:",
+ "Marisa Mack <marisa at teleport.com>",
+ "Mathieu Dutour <dutour at clipper.ens.fr>",
+@@ -69,34 +71,35 @@
+ "The classic arcade game Breakout."
+ );
+
+- const gchar *translator_credits = _("translator credits");
++ const gchar *translator_credits = _("translator_credits");
++
++ gui = (GuiInfo *) data;
++ dirs = (gchar **) g_get_system_data_dirs();
++ for(i = 0; i < g_strv_length(dirs); i++) {
++ file = g_build_filename (dirs[i], G_DIR_SEPARATOR_S,
++ "pixmaps", G_DIR_SEPARATOR_S,
++ "gnome-breakout.png", NULL);
++ if (g_file_test(file, G_FILE_TEST_EXISTS))
++ break;
+
+- gchar *use_tc = NULL;
+- if(strcmp(translator_credits, "translator credits")) {
+- /* This is a translation, show appropriate credits */
+- use_tc = (gchar *) translator_credits;
++ g_free(file);
+ }
+
+- if(dlg) {
+- gdk_window_show(dlg->window);
+- gdk_window_raise(dlg->window);
+- gtk_widget_grab_focus(GTK_WIDGET(dlg));
+- } else {
+- dlg = gnome_about_new(
+- _("GNOME Breakout"), // name
+- VERSION, // version
+- _("Copyright (c) 2000-2003 Michael Pearson"), // cp
+- _(comment), // comments
+- authors, // authors
+- NULL, // documenters
+- use_tc, // translator credits
+- NULL); // logo
+-
+- gui = (GuiInfo *) data;
+- g_signal_connect(GTK_OBJECT(dlg), "destroy",
+- GTK_SIGNAL_FUNC(cb_null), &dlg);
+- gtk_widget_show(dlg);
+- }
++ logo = gdk_pixbuf_new_from_file(file, NULL);
++ g_free(file);
++
++ gtk_show_about_dialog(gui->app,
++ "program name", _("GNOME Breakout"),
++ "version", VERSION,
++ "copyright",
++ _("Copyright (c) 2000-2003 Michael Pearson"),
++ "comments", comment,
++ "authors", authors,
++ "artists", artists,
++ "translator-credits", translator_credits,
++ "logo", logo,
++ NULL);
++ g_object_unref(logo);
+ }
+
+ /* Called when the user holds down a key. If it's a key we recognise, pass it
+@@ -203,8 +206,15 @@
+
+ gui = (GuiInfo *) data;
+ // FIXME!!
+- mbox = (GtkWidget *) gnome_ok_dialog_parented(_("Help hasn't been implimented yet. So go ahead and write some for me :)"), GTK_WINDOW(gui->app));
+- gtk_widget_show(mbox);
++ mbox = gtk_message_dialog_new(gui->app,
++ GTK_DIALOG_DESTROY_WITH_PARENT,
++ GTK_MESSAGE_INFO,
++ GTK_BUTTONS_CLOSE,
++ "%s", (_("Help hasn't been implimented "
++ "yet. So go ahead and write "
++ "some for me :)")));
++ gtk_dialog_run(GTK_DIALOG(mbox));
++ gtk_widget_destroy(mbox);
+ }
+
+ /* The application has gained or lost focus */
+@@ -252,9 +262,22 @@
+ ball_die(gui->game, (Ball *) gui->game->balls->data);
+ }
+
++void cb_add_scores(GObject *obj, GAsyncResult *res, gpointer data) {
++ GamesScoresContext *context = GAMES_SCORES_CONTEXT(obj);
++ GError *error = NULL;
++
++ games_scores_context_add_score_finish(context, res, &error);
++ if(error) {
++ g_warning("Failed to add score: %s", error->message);
++ g_error_free(error);
++ }
++}
++
+ /* Displays the scores */
+ void cb_scores(GtkWidget *widget, gpointer data) {
+- gnome_scores_display(_("GNOME Breakout: Scores"), PACKAGE, NULL, 0);
++ GuiInfo *gui;
++ gui = (GuiInfo *) data;
++ games_scores_context_run_dialog(gui->scores);
+ }
+
+ /* The pointer has either entered or left the canvas */
+@@ -284,59 +307,19 @@
+ return TRUE;
+ }
+
+-/* Maybe there are GTK+ functions for the following stuff, but I don't know them */
+-gboolean cb_grab_focus(GtkWidget *widget, GdkEvent *event, gpointer data) {
+- XGrabPointer(GDK_WINDOW_XDISPLAY(GTK_WIDGET(widget)->window),
+- GDK_WINDOW_XWINDOW(GTK_WIDGET(widget)->window), 1,
+- PointerMotionMask, GrabModeAsync, GrabModeAsync,
+- GDK_WINDOW_XWINDOW(GTK_WIDGET(widget)->window),
+- None, CurrentTime);
+-
+- return TRUE;
+-}
+-
+-gboolean cb_ungrab_focus(GtkWidget *widget, GdkEvent *event, gpointer data) {
+- XUngrabPointer(GDK_WINDOW_XDISPLAY(GTK_WIDGET(widget)->window), CurrentTime);
+-
+- return TRUE;
+-}
+-
+ gboolean cb_show_pointer(GtkWidget *widget, GdkEvent *event, gpointer data) {
+- XUndefineCursor(GDK_WINDOW_XDISPLAY(GTK_WIDGET(widget)->window),
+- GDK_WINDOW_XWINDOW(GTK_WIDGET(widget)->window));
++ gdk_window_set_cursor(gtk_widget_get_window(widget), NULL);
+
+ return TRUE;
+ }
+
+ gboolean cb_hide_pointer(GtkWidget *widget, GdkEvent *event, gpointer data) {
+- static Cursor cursor = 0;
+- XColor colour;
+- Pixmap cursorPixmap;
+-
+- colour.pixel = WhitePixel(GDK_WINDOW_XDISPLAY(GTK_WIDGET(widget)->window),
+- DefaultScreen(GDK_WINDOW_XDISPLAY(GTK_WIDGET(widget)->window)));
+- XQueryColor(GDK_WINDOW_XDISPLAY(GTK_WIDGET(widget)->window),
+- DefaultColormap(GDK_WINDOW_XDISPLAY(GTK_WIDGET(widget)->window),
+- DefaultScreen(GDK_WINDOW_XDISPLAY(GTK_WIDGET(widget)->window))), &colour);
+- if(cursor) {
+- XFreeCursor(GDK_WINDOW_XDISPLAY(GTK_WIDGET(widget)->window), cursor);
+- }
+- cursorPixmap = XCreatePixmap(GDK_WINDOW_XDISPLAY(GTK_WIDGET(widget)->window),
+- GDK_WINDOW_XWINDOW(GTK_WIDGET(widget)->window), 1, 1, 1);
+- cursor = XCreatePixmapCursor(GDK_WINDOW_XDISPLAY(GTK_WIDGET(widget)->window),
+- cursorPixmap, cursorPixmap, &colour, &colour, 0, 0);
+- if(cursorPixmap) {
+- XFreePixmap(GDK_WINDOW_XDISPLAY(GTK_WIDGET(widget)->window), cursorPixmap);
+- }
+- XDefineCursor(GDK_WINDOW_XDISPLAY(GTK_WIDGET(widget)->window),
+- GDK_WINDOW_XWINDOW(GTK_WIDGET(widget)->window), cursor);
+-
+- return TRUE;
+-}
++ GdkCursor *cursor;
+
+-/* Nulls the variable passed to it */
+-gboolean cb_null(GtkWidget *w, void **data) {
+- *data = NULL;
++ cursor = gdk_cursor_new_for_display(gdk_display_get_default(),
++ GDK_BLANK_CURSOR);
++ gdk_window_set_cursor(gtk_widget_get_window(widget), cursor);
++ g_object_unref(cursor);
+
+ return TRUE;
+ }
+--- gnome-breakout-0.5.3.orig/src/gui-callbacks.h
++++ gnome-breakout-0.5.3/src/gui-callbacks.h
+@@ -23,14 +23,12 @@
+ void cb_end_game(GtkWidget *widget, gpointer data);
+ void cb_kill_ball(GtkWidget *widget, gpointer data);
+ void cb_scores(GtkWidget *widget, gpointer data);
++void cb_add_scores(GObject *obj, GAsyncResult *res, gpointer data);
+ void cb_preferences(GtkWidget *widget, gpointer data);
+ void cb_help(GtkWidget *widget, gpointer data);
+ gboolean cb_main_focus_change(GtkWidget *widget, GdkEvent *event, gpointer data);
+ gboolean cb_canvas_button_press(GtkWidget *widget, GdkEventButton *event,
+ gpointer data);
+-gboolean cb_grab_focus(GtkWidget *widget, GdkEvent *event, gpointer data);
+-gboolean cb_ungrab_focus(GtkWidget *widget, GdkEvent *event, gpointer data);
+ gboolean cb_hide_pointer(GtkWidget *widget, GdkEvent *event, gpointer data);
+ gboolean cb_show_pointer(GtkWidget *widget, GdkEvent *event, gpointer data);
+ gboolean cb_canvas_pointer(GtkWidget *widget, GdkEvent *event, gpointer data);
+-gboolean cb_null(GtkWidget *widget, void **data);
+--- gnome-breakout-0.5.3.orig/src/gui-preferences.c
++++ gnome-breakout-0.5.3/src/gui-preferences.c
+@@ -8,6 +8,7 @@
+ * "COPYING" for more details.
+ */
+
++#include <glib/gi18n.h>
+ #include "breakout.h"
+ #include "gui.h"
+ #include "gui-preferences.h"
+@@ -60,17 +61,18 @@
+ gpointer data);
+ static void cb_level_add(GtkWidget *widget, gpointer data);
+ static void cb_level_remove(GtkWidget *widget, gpointer data);
+-static void cb_filesel_ok(GtkWidget *w, gpointer data);
+-static void cb_filesel_cancel(GtkWidget *w, gpointer data);
++static void cb_filesel_ok(GtkDialog *w, gint id, gpointer data);
+ static void cb_checkbox_toggled(GtkWidget *w, gboolean *flag);
+
+ void make_preferences_box(GuiInfo *gui) {
+ GtkNotebook *window_notebook;
++ GdkWindow *window;
+
+ /* Don't let the user run two preferences boxes at the same time */
+ if(dialog) {
+- gdk_window_show( dialog->window );
+- gdk_window_raise( dialog->window);
++ window = gtk_widget_get_window(dialog);
++ gdk_window_show(window);
++ gdk_window_raise(window);
+ gtk_widget_grab_focus(GTK_WIDGET(dialog));
+ return;
+ }
+@@ -146,17 +148,18 @@
+ static void init_preferences_box(GuiInfo *gui, GtkNotebook **window_notebook) {
+ dialog = gtk_dialog_new_with_buttons(
+ _("GNOME Breakout Preferences"), GTK_WINDOW(gui->app),
+- 0, GTK_STOCK_APPLY,
+- GTK_RESPONSE_APPLY, GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
+- GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
++ 0, _("_Apply"), GTK_RESPONSE_APPLY,
++ _("_Close"), GTK_RESPONSE_CLOSE,
++ _("_OK"), GTK_RESPONSE_OK, NULL);
+
+- g_signal_connect(GTK_OBJECT(dialog), "destroy",
++ g_signal_connect(G_OBJECT(dialog), "destroy",
+ G_CALLBACK(cb_pref_destroy), gui);
+- g_signal_connect(GTK_OBJECT(dialog), "response",
++ g_signal_connect(G_OBJECT(dialog), "response",
+ G_CALLBACK(cb_pref_response), gui);
+
+ *window_notebook = GTK_NOTEBOOK(gtk_notebook_new());
+- gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox),
++ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area
++ (GTK_DIALOG(dialog))),
+ GTK_WIDGET(*window_notebook));
+
+
+@@ -171,7 +174,7 @@
+
+ GtkWidget *bounce_entropy_label;
+ GtkWidget *bounce_entropy_hbox;
+- GtkObject *bounce_entropy_adjustment;
++ GtkAdjustment *bounce_entropy_adjustment;
+ GtkWidget *bounce_entropy_sbutton;
+ GtkWidget *hide_pointer_check;
+
+@@ -199,13 +202,13 @@
+
+ /* Vbox and Tablabel - Constructor */
+ gametablabel = gtk_label_new(_("Game"));
+- gamehbox = gtk_hbox_new(FALSE, GNOME_PAD);
+- gamevbox1 = gtk_vbox_new(FALSE, GNOME_PAD);
+- gamevbox2 = gtk_vbox_new(FALSE, GNOME_PAD);
++ gamehbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8);
++ gamevbox1 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 8);
++ gamevbox2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 8);
+
+ /* Vbox and Tablabel - Packing */
+- gtk_box_pack_start(GTK_BOX(gamehbox), gamevbox1, TRUE, TRUE, GNOME_PAD);
+- gtk_box_pack_start(GTK_BOX(gamehbox), gamevbox2, TRUE, TRUE, GNOME_PAD);
++ gtk_box_pack_start(GTK_BOX(gamehbox), gamevbox1, TRUE, TRUE, 8);
++ gtk_box_pack_start(GTK_BOX(gamehbox), gamevbox2, TRUE, TRUE, 8);
+
+ /* Vbox and Tablabel - Show */
+ gtk_widget_show(gametablabel);
+@@ -216,13 +219,13 @@
+ /* Level Frame - Constructor */
+ lf.game = gui->game;
+ lf.frame = gtk_frame_new(_("Levels"));
+- lf.vbox = gtk_vbox_new(FALSE, 0);
++ lf.vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
+ lf.level_list_store = gtk_list_store_new(1, G_TYPE_STRING);
+ lf.level_list_view = GTK_TREE_VIEW(gtk_tree_view_new_with_model(
+ GTK_TREE_MODEL(lf.level_list_store)));
+ //lf.warning_label = gtk_label_new(_("Levels cannot be added or removed\nwhile the game is running."));
+- lf.button_hbox = gtk_hbox_new(TRUE, 0);
+- lf.level_list_hbox = gtk_hbox_new(TRUE, 0);
++ lf.button_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
++ lf.level_list_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
+ lf.add_button = gtk_button_new_with_label(_("Add"));
+ lf.remove_button = gtk_button_new_with_label(_("Remove"));
+ lf.game = gui->game;
+@@ -253,8 +256,8 @@
+ g_signal_connect_object(GTK_OBJECT(lf.add_button), "clicked", GTK_SIGNAL_FUNC(cb_level_add), (gpointer) &lf, 0);
+ g_signal_connect_object(GTK_OBJECT(lf.remove_button), "clicked", GTK_SIGNAL_FUNC(cb_level_remove), (gpointer) &lf, 0);
+ */
+- g_signal_connect(GTK_OBJECT(lf.add_button), "clicked", GTK_SIGNAL_FUNC(cb_level_add), (gpointer) &lf);
+- g_signal_connect(GTK_OBJECT(lf.remove_button), "clicked", GTK_SIGNAL_FUNC(cb_level_remove), (gpointer) &lf);
++ g_signal_connect(G_OBJECT(lf.add_button), "clicked", G_CALLBACK(cb_level_add), (gpointer) &lf);
++ g_signal_connect(G_OBJECT(lf.remove_button), "clicked", G_CALLBACK(cb_level_remove), (gpointer) &lf);
+
+
+ /* Level Frame - Sensitivity */
+@@ -266,15 +269,15 @@
+ gtk_widget_set_sensitive(GTK_WIDGET(lf.remove_button), FALSE);
+
+ /* Level Frame - Packing */
+- gtk_box_pack_start(GTK_BOX(gamevbox1), lf.frame, TRUE, TRUE, GNOME_PAD);
++ gtk_box_pack_start(GTK_BOX(gamevbox1), lf.frame, TRUE, TRUE, 8);
+ gtk_container_add(GTK_CONTAINER(lf.frame), lf.vbox);
+ //gtk_box_pack_start_defaults(GTK_BOX(lf.vbox), lf.warning_label);
+- gtk_box_pack_start(GTK_BOX(lf.vbox), lf.level_list_hbox, TRUE, TRUE, GNOME_PAD);
+- gtk_box_pack_start(GTK_BOX(lf.vbox), lf.button_hbox, FALSE, FALSE, GNOME_PAD);
++ gtk_box_pack_start(GTK_BOX(lf.vbox), lf.level_list_hbox, TRUE, TRUE, 8);
++ gtk_box_pack_start(GTK_BOX(lf.vbox), lf.button_hbox, FALSE, FALSE, 8);
+ gtk_container_add(GTK_CONTAINER(lf.level_list_scrollpane), GTK_WIDGET(lf.level_list_view));
+- gtk_box_pack_start(GTK_BOX(lf.level_list_hbox), lf.level_list_scrollpane, TRUE, TRUE, GNOME_PAD);
+- gtk_box_pack_start(GTK_BOX(lf.button_hbox), lf.add_button, TRUE, TRUE, GNOME_PAD);
+- gtk_box_pack_start(GTK_BOX(lf.button_hbox), lf.remove_button, TRUE, TRUE, GNOME_PAD);
++ gtk_box_pack_start(GTK_BOX(lf.level_list_hbox), lf.level_list_scrollpane, TRUE, TRUE, 8);
++ gtk_box_pack_start(GTK_BOX(lf.button_hbox), lf.add_button, TRUE, TRUE, 8);
++ gtk_box_pack_start(GTK_BOX(lf.button_hbox), lf.remove_button, TRUE, TRUE, 8);
+
+ /* Level Frame - Show */
+ gtk_widget_show(lf.frame);
+@@ -293,7 +296,7 @@
+ else
+ difficulty_frame = gtk_frame_new(_("Difficulty (next game)"));
+
+- difficulty_vbox = gtk_vbox_new(FALSE, 0);
++ difficulty_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
+ difficulty_easy_radio = gtk_radio_button_new_with_label(NULL,
+ _("Easy"));
+ difficulty_medium_radio = gtk_radio_button_new_with_label_from_widget(
+@@ -318,22 +321,22 @@
+ }
+
+ /* Difficulty frame and radio buttons - Signals */
+- g_signal_connect(GTK_OBJECT(difficulty_easy_radio), "toggled",
+- GTK_SIGNAL_FUNC(cb_diff), (gpointer) DIFFICULTY_EASY);
+- g_signal_connect(GTK_OBJECT(difficulty_medium_radio), "toggled",
+- GTK_SIGNAL_FUNC(cb_diff), (gpointer) DIFFICULTY_MEDIUM);
+- g_signal_connect(GTK_OBJECT(difficulty_hard_radio), "toggled",
+- GTK_SIGNAL_FUNC(cb_diff), (gpointer) DIFFICULTY_HARD);
++ g_signal_connect(G_OBJECT(difficulty_easy_radio), "toggled",
++ G_CALLBACK(cb_diff), (gpointer) DIFFICULTY_EASY);
++ g_signal_connect(G_OBJECT(difficulty_medium_radio), "toggled",
++ G_CALLBACK(cb_diff), (gpointer) DIFFICULTY_MEDIUM);
++ g_signal_connect(G_OBJECT(difficulty_hard_radio), "toggled",
++ G_CALLBACK(cb_diff), (gpointer) DIFFICULTY_HARD);
+
+ /* Difficulty frame and radio buttons - Packing */
+- gtk_box_pack_start_defaults(GTK_BOX(difficulty_vbox),
+- difficulty_easy_radio);
+- gtk_box_pack_start_defaults(GTK_BOX(difficulty_vbox),
+- difficulty_medium_radio);
+- gtk_box_pack_start_defaults(GTK_BOX(difficulty_vbox),
+- difficulty_hard_radio);
++ gtk_box_pack_start(GTK_BOX(difficulty_vbox),
++ difficulty_easy_radio, TRUE, TRUE, 0);
++ gtk_box_pack_start(GTK_BOX(difficulty_vbox),
++ difficulty_medium_radio, TRUE, TRUE, 0);
++ gtk_box_pack_start(GTK_BOX(difficulty_vbox),
++ difficulty_hard_radio, TRUE, TRUE, 0);
+ gtk_container_add(GTK_CONTAINER(difficulty_frame), difficulty_vbox);
+- gtk_box_pack_start(GTK_BOX(gamevbox2), difficulty_frame, TRUE, TRUE, GNOME_PAD);
++ gtk_box_pack_start(GTK_BOX(gamevbox2), difficulty_frame, TRUE, TRUE, 8);
+
+ /* Difficulty frame and radio buttons - Show */
+ gtk_widget_show(difficulty_frame);
+@@ -344,7 +347,7 @@
+
+ /* Automatic Pause Frame - Constructor */
+ pause_frame = gtk_frame_new(_("Automatic Pause"));
+- pause_vbox = gtk_vbox_new(FALSE, 0);
++ pause_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
+ pause_on_focus_check = gtk_check_button_new_with_label(_("When we lose keyboard focus"));
+ pause_on_pointer_check = gtk_check_button_new_with_label(_("When the mouse pointer leaves the play window"));
+ pause_on_pref_check = gtk_check_button_new_with_label(_("When the preferences dialog is active"));
+@@ -355,16 +358,19 @@
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pause_on_pointer_check), newflags->pause_on_pointer);
+
+ /* Automatic Pause Frame - Signals */
+- g_signal_connect(GTK_OBJECT(pause_on_focus_check), "toggled", GTK_SIGNAL_FUNC(cb_checkbox_toggled), &newflags->pause_on_focus);
+- g_signal_connect(GTK_OBJECT(pause_on_pointer_check), "toggled", GTK_SIGNAL_FUNC(cb_checkbox_toggled), &newflags->pause_on_pointer);
+- g_signal_connect(GTK_OBJECT(pause_on_pref_check), "toggled", GTK_SIGNAL_FUNC(cb_checkbox_toggled), &newflags->pause_on_pref);
++ g_signal_connect(G_OBJECT(pause_on_focus_check), "toggled", G_CALLBACK(cb_checkbox_toggled), &newflags->pause_on_focus);
++ g_signal_connect(G_OBJECT(pause_on_pointer_check), "toggled", G_CALLBACK(cb_checkbox_toggled), &newflags->pause_on_pointer);
++ g_signal_connect(G_OBJECT(pause_on_pref_check), "toggled", G_CALLBACK(cb_checkbox_toggled), &newflags->pause_on_pref);
+
+ /* Automatic Pause Frame - Packing */
+- gtk_box_pack_start_defaults(GTK_BOX(pause_vbox), pause_on_focus_check);
+- gtk_box_pack_start_defaults(GTK_BOX(pause_vbox), pause_on_pointer_check);
+- gtk_box_pack_start_defaults(GTK_BOX(pause_vbox), pause_on_pref_check);
++ gtk_box_pack_start(GTK_BOX(pause_vbox), pause_on_focus_check,
++ TRUE, TRUE, 0);
++ gtk_box_pack_start(GTK_BOX(pause_vbox), pause_on_pointer_check,
++ TRUE, TRUE, 0);
++ gtk_box_pack_start(GTK_BOX(pause_vbox), pause_on_pref_check,
++ TRUE, TRUE, 0);
+ gtk_container_add(GTK_CONTAINER(pause_frame), pause_vbox);
+- gtk_box_pack_start(GTK_BOX(gamevbox2), pause_frame, TRUE, FALSE, GNOME_PAD);
++ gtk_box_pack_start(GTK_BOX(gamevbox2), pause_frame, TRUE, FALSE, 8);
+
+ /* Automatic Pause Frame - Show */
+ gtk_widget_show(pause_frame);
+@@ -380,15 +386,15 @@
+ GTK_TOGGLE_BUTTON(hide_pointer_check),
+ newflags->hide_pointer);
+ gtk_box_pack_start(GTK_BOX(gamevbox2), hide_pointer_check,
+- TRUE, FALSE, GNOME_PAD);
++ TRUE, FALSE, 8);
+ gtk_widget_show(hide_pointer_check);
+- g_signal_connect(GTK_OBJECT(hide_pointer_check), "toggled",
+- GTK_SIGNAL_FUNC(cb_checkbox_toggled),
++ g_signal_connect(G_OBJECT(hide_pointer_check), "toggled",
++ G_CALLBACK(cb_checkbox_toggled),
+ &newflags->hide_pointer);
+
+ /* Bounce Entropy - Constructor */
+ bounce_entropy_label = gtk_label_new(_("Bounce Entropy (Experimental): "));
+- bounce_entropy_hbox = gtk_hbox_new(FALSE, GNOME_PAD);
++ bounce_entropy_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8);
+ bounce_entropy_adjustment = gtk_adjustment_new((gfloat)
+ newflags->bounce_entropy, (gfloat) MIN_BOUNCE_ENTROPY,
+ (gfloat) MAX_BOUNCE_ENTROPY, 1.0, 5.0, 1.0);
+@@ -403,17 +409,17 @@
+ TRUE);
+
+ /* Bounce Entropy - Signals */
+- g_signal_connect(GTK_OBJECT(bounce_entropy_adjustment),
+- "value_changed", GTK_SIGNAL_FUNC(cb_bounce_entropy),
++ g_signal_connect(G_OBJECT(bounce_entropy_adjustment),
++ "value_changed", G_CALLBACK(cb_bounce_entropy),
+ bounce_entropy_sbutton);
+
+ /* Bounce Entropy - Packing */
+- gtk_box_pack_start_defaults(GTK_BOX(bounce_entropy_hbox),
+- bounce_entropy_label);
+- gtk_box_pack_start_defaults(GTK_BOX(bounce_entropy_hbox),
+- bounce_entropy_sbutton);
++ gtk_box_pack_start(GTK_BOX(bounce_entropy_hbox),
++ bounce_entropy_label, TRUE, TRUE, 0);
++ gtk_box_pack_start(GTK_BOX(bounce_entropy_hbox),
++ bounce_entropy_sbutton, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(gamevbox2), bounce_entropy_hbox, TRUE,
+- FALSE, GNOME_PAD);
++ FALSE, 8);
+
+ /* Bounce Entropy - Show */
+ gtk_widget_show(bounce_entropy_label);
+@@ -433,7 +439,7 @@
+
+ GtkWidget *bat_speed_label;
+ GtkWidget *bat_speed_hbox;
+- GtkObject *bat_speed_adjustment;
++ GtkAdjustment *bat_speed_adjustment;
+ GtkWidget *bat_speed_sbutton;
+
+ GtkWidget *method_frame;
+@@ -461,12 +467,12 @@
+ GtkWidget *keyb_fire2_entry;
+
+ /* Init the vbox */
+- controlhbox = gtk_hbox_new(TRUE, GNOME_PAD);
+- controlvbox1 = gtk_vbox_new(TRUE, GNOME_PAD);
+- controlvbox2 = gtk_vbox_new(TRUE, GNOME_PAD);
++ controlhbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8);
++ controlvbox1 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 8);
++ controlvbox2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 8);
+ controltablabel = gtk_label_new(_("Control"));
+- gtk_box_pack_start(GTK_BOX(controlhbox), controlvbox1, TRUE, TRUE, GNOME_PAD);
+- gtk_box_pack_start(GTK_BOX(controlhbox), controlvbox2, TRUE, TRUE, GNOME_PAD);
++ gtk_box_pack_start(GTK_BOX(controlhbox), controlvbox1, TRUE, TRUE, 8);
++ gtk_box_pack_start(GTK_BOX(controlhbox), controlvbox2, TRUE, TRUE, 8);
+ gtk_widget_show(controlhbox);
+ gtk_widget_show(controlvbox1);
+ gtk_widget_show(controlvbox2);
+@@ -474,32 +480,32 @@
+ /* Method Frame and Radio Buttons */
+ method_frame = gtk_frame_new(_("Method"));
+ gtk_frame_set_shadow_type(GTK_FRAME(method_frame), GTK_SHADOW_ETCHED_IN);
+- method_vbox = gtk_vbox_new(FALSE, 0);
++ method_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
+ gtk_container_add(GTK_CONTAINER(method_frame), method_vbox);
+ method_keyboard_radio = gtk_radio_button_new_with_label(NULL, _("Keyboard"));
+ method_mouse_radio = gtk_radio_button_new_with_label_from_widget(
+ GTK_RADIO_BUTTON(method_keyboard_radio), _("Mouse"));
+- gtk_box_pack_start_defaults(GTK_BOX(method_vbox),
+- method_keyboard_radio);
+- gtk_box_pack_start_defaults(GTK_BOX(method_vbox),
+- method_mouse_radio);
++ gtk_box_pack_start(GTK_BOX(method_vbox),
++ method_keyboard_radio, TRUE, TRUE, 0);
++ gtk_box_pack_start(GTK_BOX(method_vbox),
++ method_mouse_radio, TRUE, TRUE, 0);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(method_mouse_radio),
+ newflags->mouse_control);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(method_keyboard_radio),
+ newflags->keyboard_control);
+- gtk_box_pack_start(GTK_BOX(controlvbox1), method_frame, TRUE, TRUE, GNOME_PAD);
++ gtk_box_pack_start(GTK_BOX(controlvbox1), method_frame, TRUE, TRUE, 8);
+ gtk_widget_show(method_frame);
+ gtk_widget_show(method_vbox);
+ gtk_widget_show(method_keyboard_radio);
+ gtk_widget_show(method_mouse_radio);
+- g_signal_connect(GTK_OBJECT(method_keyboard_radio), "toggled",
+- GTK_SIGNAL_FUNC(cb_ctrl_key), NULL);
+- g_signal_connect(GTK_OBJECT(method_mouse_radio), "toggled",
+- GTK_SIGNAL_FUNC(cb_ctrl_mouse), NULL);
++ g_signal_connect(G_OBJECT(method_keyboard_radio), "toggled",
++ G_CALLBACK(cb_ctrl_key), NULL);
++ g_signal_connect(G_OBJECT(method_mouse_radio), "toggled",
++ G_CALLBACK(cb_ctrl_mouse), NULL);
+
+ /* Bat speed */
+ bat_speed_label = gtk_label_new(_("Bat speed: "));
+- bat_speed_hbox = gtk_hbox_new(FALSE, GNOME_PAD);
++ bat_speed_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8);
+ bat_speed_adjustment = gtk_adjustment_new((gfloat) newflags->bat_speed,
+ (gfloat) MIN_BATSPEED, (gfloat) MAX_BATSPEED,
+ 1.0, 5.0, 1.0);
+@@ -508,91 +514,101 @@
+ gtk_spin_button_set_digits(GTK_SPIN_BUTTON(bat_speed_sbutton), 0);
+ gtk_spin_button_set_wrap(GTK_SPIN_BUTTON(bat_speed_sbutton), FALSE);
+ gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(bat_speed_sbutton), TRUE);
+- gtk_box_pack_start_defaults(GTK_BOX(bat_speed_hbox), bat_speed_label);
+- gtk_box_pack_start_defaults(GTK_BOX(bat_speed_hbox), bat_speed_sbutton);
+- gtk_box_pack_start(GTK_BOX(controlvbox1), bat_speed_hbox, TRUE, FALSE, GNOME_PAD);
++ gtk_box_pack_start(GTK_BOX(bat_speed_hbox), bat_speed_label,
++ TRUE, TRUE, 0);
++ gtk_box_pack_start(GTK_BOX(bat_speed_hbox), bat_speed_sbutton,
++ TRUE, TRUE, 0);
++ gtk_box_pack_start(GTK_BOX(controlvbox1), bat_speed_hbox, TRUE, FALSE, 8);
+ gtk_widget_show(bat_speed_label);
+ gtk_widget_show(bat_speed_hbox);
+ gtk_widget_show(bat_speed_sbutton);
+- g_signal_connect(GTK_OBJECT(bat_speed_adjustment), "value_changed",
+- GTK_SIGNAL_FUNC(cb_bat_speed), bat_speed_sbutton);
++ g_signal_connect(G_OBJECT(bat_speed_adjustment), "value_changed",
++ G_CALLBACK(cb_bat_speed), bat_speed_sbutton);
+
+ /* Keybindings Frame */
+ keyb_frame = gtk_frame_new(_("Keybindings"));
+ gtk_frame_set_shadow_type(GTK_FRAME(keyb_frame), GTK_SHADOW_ETCHED_IN);
+- keyb_vbox = gtk_vbox_new(TRUE, GNOME_PAD);
++ keyb_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 8);
+ gtk_container_add(GTK_CONTAINER(keyb_frame), keyb_vbox);
+- gtk_box_pack_start(GTK_BOX(controlvbox2), keyb_frame, TRUE, TRUE, GNOME_PAD);
++ gtk_box_pack_start(GTK_BOX(controlvbox2), keyb_frame, TRUE, TRUE, 8);
+ gtk_widget_show(keyb_vbox);
+ gtk_widget_show(keyb_frame);
+
+ /* KB: Left */
+- keyb_left_hbox = gtk_hbox_new(FALSE, GNOME_PAD);
++ keyb_left_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8);
+ keyb_left_label = gtk_label_new(_("Left:"));
+- gtk_misc_set_alignment(GTK_MISC(keyb_left_label), 0.0, 0.5);
++ gtk_label_set_yalign(GTK_LABEL(keyb_left_label), 0.5);
+ keyb_left_entry = gtk_entry_new();
+- gtk_entry_set_editable(GTK_ENTRY(keyb_left_entry), FALSE);
++ gtk_editable_set_editable(GTK_EDITABLE(keyb_left_entry), FALSE);
+ gtk_entry_set_text(GTK_ENTRY(keyb_left_entry),
+ gdk_keyval_name(newflags->left_key));
+- gtk_box_pack_start_defaults(GTK_BOX(keyb_left_hbox), keyb_left_label);
+- gtk_box_pack_start_defaults(GTK_BOX(keyb_left_hbox), keyb_left_entry);
+- gtk_box_pack_start(GTK_BOX(keyb_vbox), keyb_left_hbox, TRUE, TRUE, GNOME_PAD);
++ gtk_box_pack_start(GTK_BOX(keyb_left_hbox), keyb_left_label,
++ TRUE, TRUE, 0);
++ gtk_box_pack_start(GTK_BOX(keyb_left_hbox), keyb_left_entry,
++ TRUE, TRUE, 0);
++ gtk_box_pack_start(GTK_BOX(keyb_vbox), keyb_left_hbox, TRUE, TRUE, 8);
+ gtk_widget_show(keyb_left_label);
+ gtk_widget_show(keyb_left_entry);
+ gtk_widget_show(keyb_left_hbox);
+- g_signal_connect(GTK_OBJECT(keyb_left_entry), "key_press_event",
+- GTK_SIGNAL_FUNC(cb_key_left), NULL);
++ g_signal_connect(G_OBJECT(keyb_left_entry), "key_press_event",
++ G_CALLBACK(cb_key_left), NULL);
+
+ /* KB: Right */
+- keyb_right_hbox = gtk_hbox_new(FALSE, GNOME_PAD);
++ keyb_right_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8);
+ keyb_right_label = gtk_label_new(_("Right:"));
+- gtk_misc_set_alignment(GTK_MISC(keyb_right_label), 0.0, 0.5);
++ gtk_label_set_yalign(GTK_LABEL(keyb_right_label), 0.5);
+ keyb_right_entry = gtk_entry_new();
+- gtk_entry_set_editable(GTK_ENTRY(keyb_right_entry), FALSE);
++ gtk_editable_set_editable(GTK_EDITABLE(keyb_right_entry), FALSE);
+ gtk_entry_set_text(GTK_ENTRY(keyb_right_entry),
+ gdk_keyval_name(newflags->right_key));
+- gtk_box_pack_start_defaults(GTK_BOX(keyb_right_hbox), keyb_right_label);
+- gtk_box_pack_start_defaults(GTK_BOX(keyb_right_hbox), keyb_right_entry);
+- gtk_box_pack_start(GTK_BOX(keyb_vbox), keyb_right_hbox, TRUE, TRUE, GNOME_PAD);
++ gtk_box_pack_start(GTK_BOX(keyb_right_hbox), keyb_right_label,
++ TRUE, TRUE, 0);
++ gtk_box_pack_start(GTK_BOX(keyb_right_hbox), keyb_right_entry,
++ TRUE, TRUE, 0);
++ gtk_box_pack_start(GTK_BOX(keyb_vbox), keyb_right_hbox, TRUE, TRUE, 8);
+ gtk_widget_show(keyb_right_label);
+ gtk_widget_show(keyb_right_entry);
+ gtk_widget_show(keyb_right_hbox);
+- g_signal_connect(GTK_OBJECT(keyb_right_entry), "key_press_event",
+- GTK_SIGNAL_FUNC(cb_key_right), NULL);
++ g_signal_connect(G_OBJECT(keyb_right_entry), "key_press_event",
++ G_CALLBACK(cb_key_right), NULL);
+
+ /* KB: Fire1 */
+- keyb_fire1_hbox = gtk_hbox_new(FALSE, GNOME_PAD);
++ keyb_fire1_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8);
+ keyb_fire1_label = gtk_label_new(_("Fire One:"));
+- gtk_misc_set_alignment(GTK_MISC(keyb_fire1_label), 0.0, 0.5);
++ gtk_label_set_yalign(GTK_LABEL(keyb_fire1_label), 0.5);
+ keyb_fire1_entry = gtk_entry_new();
+- gtk_entry_set_editable(GTK_ENTRY(keyb_fire1_entry), FALSE);
++ gtk_editable_set_editable(GTK_EDITABLE(keyb_fire1_entry), FALSE);
+ gtk_entry_set_text(GTK_ENTRY(keyb_fire1_entry),
+ gdk_keyval_name(newflags->fire1_key));
+- gtk_box_pack_start_defaults(GTK_BOX(keyb_fire1_hbox), keyb_fire1_label);
+- gtk_box_pack_start_defaults(GTK_BOX(keyb_fire1_hbox), keyb_fire1_entry);
+- gtk_box_pack_start(GTK_BOX(keyb_vbox), keyb_fire1_hbox, TRUE, TRUE, GNOME_PAD);
++ gtk_box_pack_start(GTK_BOX(keyb_fire1_hbox), keyb_fire1_label,
++ TRUE, TRUE, 0);
++ gtk_box_pack_start(GTK_BOX(keyb_fire1_hbox), keyb_fire1_entry,
++ TRUE, TRUE, 0);
++ gtk_box_pack_start(GTK_BOX(keyb_vbox), keyb_fire1_hbox, TRUE, TRUE, 8);
+ gtk_widget_show(keyb_fire1_label);
+ gtk_widget_show(keyb_fire1_entry);
+ gtk_widget_show(keyb_fire1_hbox);
+- g_signal_connect(GTK_OBJECT(keyb_fire1_entry), "key_press_event",
+- GTK_SIGNAL_FUNC(cb_key_fire1), NULL);
++ g_signal_connect(G_OBJECT(keyb_fire1_entry), "key_press_event",
++ G_CALLBACK(cb_key_fire1), NULL);
+
+ /* KB: Fire2 */
+- keyb_fire2_hbox = gtk_hbox_new(FALSE, GNOME_PAD);
++ keyb_fire2_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8);
+ keyb_fire2_label = gtk_label_new(_("Fire Two:"));
+- gtk_misc_set_alignment(GTK_MISC(keyb_fire2_label), 0.0, 0.5);
++ gtk_label_set_yalign(GTK_LABEL(keyb_fire2_label), 0.5);
+ keyb_fire2_entry = gtk_entry_new();
+- gtk_entry_set_editable(GTK_ENTRY(keyb_fire2_entry), FALSE);
++ gtk_editable_set_editable(GTK_EDITABLE(keyb_fire2_entry), FALSE);
+ gtk_entry_set_text(GTK_ENTRY(keyb_fire2_entry),
+ gdk_keyval_name(newflags->fire2_key));
+- gtk_box_pack_start_defaults(GTK_BOX(keyb_fire2_hbox), keyb_fire2_label);
+- gtk_box_pack_start_defaults(GTK_BOX(keyb_fire2_hbox), keyb_fire2_entry);
+- gtk_box_pack_start(GTK_BOX(keyb_vbox), keyb_fire2_hbox, TRUE, TRUE, GNOME_PAD);
++ gtk_box_pack_start(GTK_BOX(keyb_fire2_hbox), keyb_fire2_label,
++ TRUE, TRUE, 0);
++ gtk_box_pack_start(GTK_BOX(keyb_fire2_hbox), keyb_fire2_entry,
++ TRUE, TRUE, 0);
++ gtk_box_pack_start(GTK_BOX(keyb_vbox), keyb_fire2_hbox, TRUE, TRUE, 8);
+ gtk_widget_show(keyb_fire2_label);
+ gtk_widget_show(keyb_fire2_entry);
+ gtk_widget_show(keyb_fire2_hbox);
+- g_signal_connect(GTK_OBJECT(keyb_fire2_entry), "key_press_event",
+- GTK_SIGNAL_FUNC(cb_key_fire2), NULL);
++ g_signal_connect(G_OBJECT(keyb_fire2_entry), "key_press_event",
++ G_CALLBACK(cb_key_fire2), NULL);
+
+ /* Add it to the dialog */
+ gtk_notebook_append_page(GTK_NOTEBOOK(window_notebook),
+@@ -719,21 +735,26 @@
+
+ static void cb_level_add(GtkWidget *widget, gpointer data) {
+ LevelFrame *lf = (LevelFrame *) data;
++ GtkFileFilter *filter;
+
+ if(lf->game->state == STATE_STOPPED) {
+- lf->fsel = gtk_file_selection_new ("Add Levelfile");
+-
+- /* Connect Signals */
+- g_signal_connect(GTK_OBJECT(lf->fsel), "destroy", (GtkSignalFunc) cb_filesel_cancel, data);
+- g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION (lf->fsel)->cancel_button), "clicked", (GtkSignalFunc) cb_filesel_cancel, data);
+-
+- g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION (lf->fsel)->ok_button), "clicked", (GtkSignalFunc) cb_filesel_ok, data);
+-
+- /* Set defaults */
+- gtk_file_selection_set_filename(GTK_FILE_SELECTION(lf->fsel), "*.gbl");
+-
++ lf->fsel
++ = gtk_file_chooser_dialog_new("Add Levelfile",
++ NULL,
++ GTK_FILE_CHOOSER_ACTION_OPEN,
++ _("OK"), GTK_RESPONSE_ACCEPT,
++ _("_Cancel"),
++ GTK_RESPONSE_REJECT, NULL);
++
++ /* Connect Signals */
++ g_signal_connect(lf->fsel, "response",
++ G_CALLBACK(cb_filesel_ok), data);
++ filter = gtk_file_filter_new();
++ gtk_file_filter_add_pattern(filter, "*.gbl");
++ gtk_file_filter_set_name(filter, "Level Files");
++ gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(lf->fsel), filter);
+ /* Show the selector */
+- gtk_widget_show(lf->fsel);
++ gtk_dialog_run(GTK_DIALOG(lf->fsel));
+ } else {
+ gui_warning("Cannot add or remove levels while the game is running");
+ }
+@@ -742,6 +763,7 @@
+
+ static void cb_level_remove(GtkWidget *widget, gpointer data) {
+ LevelFrame *lf = (LevelFrame *) data;
++ GtkTreeSelection *sel;
+ gchar *text;
+ gchar *filename;
+
+@@ -755,18 +777,26 @@
+ gtk_list_store_remove(lf->level_list_store, &(lf->level_list_iter));
+ g_free(lf->level_list_selection);
+ lf->level_list_selection = NULL;
++ sel = gtk_tree_view_get_selection(lf->level_list_view);
++ gtk_tree_selection_unselect_all(sel);
+ } else {
+ gui_warning("Cannot add or remove levels while the game is running");
+ }
+ set_flags_changed(TRUE);
+ }
+
+-static void cb_filesel_ok(GtkWidget *w, gpointer data) {
++static void cb_filesel_ok(GtkDialog *w, gint id, gpointer data) {
+ LevelFrame *lf = (LevelFrame *) data;
+ gchar *filename;
+ gchar *title;
+
+- filename = (gchar *) gtk_file_selection_get_filename (GTK_FILE_SELECTION (lf->fsel));
++ if(id != GTK_RESPONSE_ACCEPT) {
++ gtk_widget_destroy(lf->fsel);
++ lf->fsel = NULL;
++ return;
++ }
++
++ filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (lf->fsel));
+
+ if(lf->game->state == STATE_STOPPED) {
+ if((title = leveldata_add(filename))) {
+@@ -778,14 +808,8 @@
+ gui_warning("Cannot add or remove levels while the game is running");
+ }
+
++ g_free(filename);
+ gtk_widget_destroy(GTK_WIDGET(lf->fsel));
+ lf->fsel = NULL;
+ set_flags_changed(TRUE);
+ }
+-
+-static void cb_filesel_cancel(GtkWidget *w, gpointer data) {
+- LevelFrame *lf = (LevelFrame *) data;
+-
+- gtk_widget_destroy(GTK_WIDGET(lf->fsel));
+- lf->fsel = NULL;
+-}
+--- gnome-breakout-0.5.3.orig/src/leveldata.c
++++ gnome-breakout-0.5.3/src/leveldata.c
+@@ -14,6 +14,7 @@
+ #include "leveldata.h"
+ #include <errno.h>
+ #include <string.h>
++#include <glib/gi18n.h>
+
+ /* Internal Contants */
+ #define DEFAULT_NAME "No Name"
--- gnome-breakout-0.5.3.orig/debian/patches/series
+++ gnome-breakout-0.5.3/debian/patches/series
@@ -6,3 +6,4 @@
06_fix_pixmaps_makefile.patch
07_fix_wformat_warnings.patch
08_link_mathlib.patch
+09_goocanvas_port.patch
--- gnome-breakout-0.5.3.orig/debian/postinst
+++ gnome-breakout-0.5.3/debian/postinst
@@ -1,20 +0,0 @@
-#! /bin/sh
-
-set -e
-
-if [ ! -d /var/games ]; then
- mkdir -p /var/games
-fi
-
-# 0.5.1-2 installed highscore file the wrong place
-if [ -f /var/lib/games/gnome-breakout.scores ]; then
- mv /var/lib/games/gnome-breakout.scores /var/games/gnome-breakout.scores
-fi
-
-if [ ! -f /var/games/gnome-breakout.scores ]; then
- touch /var/games/gnome-breakout.scores
- chown root:games /var/games/gnome-breakout.scores
- chmod 0664 /var/games/gnome-breakout.scores
-fi
-
-#DEBHELPER#
--- gnome-breakout-0.5.3.orig/debian/postrm
+++ gnome-breakout-0.5.3/debian/postrm
@@ -1,9 +0,0 @@
-#! /bin/sh
-set -e
-
-case "$1" in
- purge)
- rm /var/games/gnome-breakout.scores
-esac
-
-#DEBHELPER#
--- gnome-breakout-0.5.3.orig/debian/preinst
+++ gnome-breakout-0.5.3/debian/preinst
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -e
+set -u
+
+if [ "$1" = "upgrade" ] || [ "$1" = "install" ]; then
+ if [ -f /var/games/gnome-breakout.scores ]; then
+ rm /var/games/gnome-breakout.scores
+ rmdir --ignore-fail-on-non-empty /var/games
+ fi
+fi
+
+#DEBHELPER#
--- gnome-breakout-0.5.3.orig/debian/rules
+++ gnome-breakout-0.5.3/debian/rules
@@ -1,6 +1,7 @@
#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS := hardening=+all
+export DEB_LDFLAGS_MAINT_APPEND := -Wl,--as-needed
%:
dh $@ --with autoreconf --with autotools-dev
@@ -26,8 +27,3 @@ override_dh_auto_install:
mv debian/gnome-breakout/usr/share/games/pixmaps/gnome-breakout.png \
debian/gnome-breakout/usr/share/pixmaps/
rm -rf debian/gnome-breakout/usr/share/games/pixmaps
-
-override_dh_fixperms:
- dh_fixperms
- chgrp games debian/gnome-breakout/usr/games/gnome-breakout
- chmod 2755 debian/gnome-breakout/usr/games/gnome-breakout
More information about the Pkg-games-devel
mailing list