[gnome-games] libgames-support: Remove GamesSettings
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] libgames-support: Remove GamesSettings
- Date: Wed, 29 Aug 2012 03:15:46 +0000 (UTC)
commit b39c8bb846e4dd1b87508ecc8d42521906fc584b
Author: Robert Ancell <robert ancell canonical com>
Date: Wed Aug 29 14:59:37 2012 +1200
libgames-support: Remove GamesSettings
glines/src/Makefile.am | 2 +
{libgames-support => glines/src}/games-settings.c | 0
{libgames-support => glines/src}/games-settings.h | 0
glines/src/glines.c | 2 +-
gnobots2/src/Makefile.am | 2 +
.../src}/games-settings.c | 54 --------------------
.../src}/games-settings.h | 0
gnobots2/src/gnobots.c | 2 +-
gnobots2/src/properties.c | 2 +-
libgames-support/Makefile.am | 2 -
10 files changed, 7 insertions(+), 59 deletions(-)
---
diff --git a/glines/src/Makefile.am b/glines/src/Makefile.am
index c14744c..c97cf15 100644
--- a/glines/src/Makefile.am
+++ b/glines/src/Makefile.am
@@ -7,6 +7,8 @@ glines_SOURCES = \
games-gridframe.h \
games-preimage.c \
games-preimage.h \
+ games-settings.c \
+ games-settings.h \
glines.c \
glines.h
diff --git a/libgames-support/games-settings.c b/glines/src/games-settings.c
similarity index 100%
copy from libgames-support/games-settings.c
copy to glines/src/games-settings.c
diff --git a/libgames-support/games-settings.h b/glines/src/games-settings.h
similarity index 100%
copy from libgames-support/games-settings.h
copy to glines/src/games-settings.h
diff --git a/glines/src/glines.c b/glines/src/glines.c
index ba97cfe..1b545f8 100644
--- a/glines/src/glines.c
+++ b/glines/src/glines.c
@@ -38,13 +38,13 @@
#include <libgames-support/games-scores.h>
#include <libgames-support/games-scores-dialog.h>
-#include <libgames-support/games-settings.h>
#include <libgames-support/games-stock.h>
#include "glines.h"
#include "games-file-list.h"
#include "games-preimage.h"
#include "games-gridframe.h"
+#include "games-settings.h"
#define KEY_BACKGROUND_COLOR "background-color"
#define KEY_BALL_THEME "ball-theme"
diff --git a/gnobots2/src/Makefile.am b/gnobots2/src/Makefile.am
index 9048469..e6e7786 100644
--- a/gnobots2/src/Makefile.am
+++ b/gnobots2/src/Makefile.am
@@ -30,6 +30,8 @@ gnobots2_SOURCES = \
games-gridframe.h \
games-preimage.c \
games-preimage.h \
+ games-settings.c \
+ games-settings.h \
cursor-down.h \
cursor-down-left.h \
cursor-down-right.h \
diff --git a/libgames-support/games-settings.c b/gnobots2/src/games-settings.c
similarity index 80%
rename from libgames-support/games-settings.c
rename to gnobots2/src/games-settings.c
index 4a7fb9c..e61c892 100644
--- a/libgames-support/games-settings.c
+++ b/gnobots2/src/games-settings.c
@@ -84,60 +84,6 @@ window_state_event_cb (GtkWidget *widget,
return FALSE;
}
-typedef struct {
- guint keyval;
- GdkModifierType modifiers;
-} KeyEntry;
-
-static gboolean
-variant_to_keyval (GVariant *value,
- gpointer *result,
- KeyEntry *entry)
-{
- if (value == NULL) {
- entry->keyval = GDK_KEY_VoidSymbol;
- entry->modifiers = 0;
- return TRUE;
- }
-
- gtk_accelerator_parse (g_variant_get_string (value, NULL),
- &entry->keyval, &entry->modifiers);
- if (entry->keyval == 0 && entry->modifiers == 0)
- return FALSE;
-
- return TRUE;
-}
-
-/**
- * games_settings_get_keyval:
- * @settings: a #GSettings
- * @key: the key name
- * @keyval: (out):
- * @modifiers: (out):
- *
- * Returns the keyboard key associated with @key in @group, or 0 if
- * the value could not be parsed as a keyval.
- *
- * Returns: a keyboard key value
- */
-void
-games_settings_get_keyval (GSettings *settings,
- const char *key,
- guint *keyval,
- GdkModifierType *modifiers)
-{
- KeyEntry entry;
-
- g_return_if_fail (G_IS_SETTINGS (settings));
- g_return_if_fail (key != NULL && key[0] != '\0');
-
- g_settings_get_mapped (settings, key, (GSettingsGetMapping) variant_to_keyval, &entry);
- if (keyval)
- *keyval = entry.keyval;
- if (modifiers)
- *modifiers = entry.modifiers;
-}
-
/**
* games_settings_set_keyval:
* @settings: a #GSettings
diff --git a/libgames-support/games-settings.h b/gnobots2/src/games-settings.h
similarity index 100%
rename from libgames-support/games-settings.h
rename to gnobots2/src/games-settings.h
diff --git a/gnobots2/src/gnobots.c b/gnobots2/src/gnobots.c
index 798fc3c..8b5f7cc 100644
--- a/gnobots2/src/gnobots.c
+++ b/gnobots2/src/gnobots.c
@@ -31,7 +31,6 @@
#include <libgames-support/games-scores.h>
#include <libgames-support/games-scores-dialog.h>
-#include <libgames-support/games-settings.h>
#include <libgames-support/games-stock.h>
#include "gbdefs.h"
@@ -44,6 +43,7 @@
#include "game.h"
#include "cursors.h"
#include "games-gridframe.h"
+#include "games-settings.h"
/* Minimum sizes. */
#define MINIMUM_TILE_WIDTH 8
diff --git a/gnobots2/src/properties.c b/gnobots2/src/properties.c
index cc7b53d..2560430 100644
--- a/gnobots2/src/properties.c
+++ b/gnobots2/src/properties.c
@@ -30,7 +30,6 @@
#include <libgames-support/games-controls.h>
#include <libgames-support/games-scores.h>
#include <libgames-support/games-scores-dialog.h>
-#include <libgames-support/games-settings.h>
#include "properties.h"
#include "gameconfig.h"
@@ -41,6 +40,7 @@
#include "game.h"
#include "menu.h"
#include "games-file-list.h"
+#include "games-settings.h"
/**********************************************************************/
diff --git a/libgames-support/Makefile.am b/libgames-support/Makefile.am
index 13498b8..c776b5d 100644
--- a/libgames-support/Makefile.am
+++ b/libgames-support/Makefile.am
@@ -3,8 +3,6 @@ noinst_LTLIBRARIES = libgames-support.la
libgames_support_la_SOURCES = \
games-stock.c \
games-stock.h \
- games-settings.c \
- games-settings.h \
games-fullscreen-action.c \
games-fullscreen-action.h \
games-score.h \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]