[atomix/wip/gtk3-port: 1/3] Cleanup before porting to GTK3
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [atomix/wip/gtk3-port: 1/3] Cleanup before porting to GTK3
- Date: Sat, 10 Jan 2015 21:35:16 +0000 (UTC)
commit 181e3086f2225a566c13d0bc82b35a355ec437bb
Author: Robert Roth <robert roth off gmail com>
Date: Sat Jan 10 23:06:18 2015 +0200
Cleanup before porting to GTK3
Cleanup Hildon support
Cleanup games-runtime support
Cleanup Maemo support
configure.ac | 5 +-
src/Makefile.am | 1 -
src/games-runtime.c | 592 --------------------------------------------
src/games-runtime.h | 89 -------
src/games-scores-backend.c | 3 +-
src/games-show.c | 58 -----
src/level-convert.c | 4 +-
src/main.c | 5 -
src/pf-test.c | 2 -
9 files changed, 6 insertions(+), 753 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index aa2c10d..facf744 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,8 +18,9 @@ GNOME_COMPILE_WARNINGS([maximum])
GNOME_MAINTAINER_MODE_DEFINES
dnl ================= Requirements =======================
-LIBGTK_REQUIRED=2.12.0
+LIBGTK_REQUIRED=2.14.0
LIBXML_REQUIRED=2.4.23
+GLIB_REQUIRED=2.36.0
GDK_PIXBUF_REQUIRED=2.0.5
LIBGNOMECANVAS_REQUIRED=2.0.1
@@ -27,7 +28,7 @@ dnl ******************************
dnl pkg-config checks
dnl ******************************
-ATOMIX_MODULES="gtk+-2.0 >= $LIBGTK_REQUIRED libxml-2.0 >= $LIBXML_REQUIRED gdk-pixbuf-2.0 >=
$GDK_PIXBUF_REQUIRED libgnomecanvas-2.0 >= $LIBGNOMECANVAS_REQUIRED"
+ATOMIX_MODULES="gtk+-2.0 >= $LIBGTK_REQUIRED libxml-2.0 >= $LIBXML_REQUIRED gdk-pixbuf-2.0 >=
$GDK_PIXBUF_REQUIRED libgnomecanvas-2.0 >= $LIBGNOMECANVAS_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
PKG_CHECK_MODULES(ATOMIX, $ATOMIX_MODULES)
AC_SUBST(ATOMIX_CFLAGS)
AC_SUBST(ATOMIX_LIBS)
diff --git a/src/Makefile.am b/src/Makefile.am
index 0875966..e23103a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -24,7 +24,6 @@ atomix_SOURCES = \
games-debug.c games-debug.h \
games-gtk-compat.h \
games-profile.c games-profile.h \
- games-runtime.c games-runtime.h \
games-score.c games-score.h \
games-scores.c games-scores.h \
games-scores-backend.c games-scores-backend.h \
diff --git a/src/games-scores-backend.c b/src/games-scores-backend.c
index 530fced..3491850 100644
--- a/src/games-scores-backend.c
+++ b/src/games-scores-backend.c
@@ -29,7 +29,6 @@
#include "games-score.h"
#include "games-scores.h"
#include "games-scores-backend.h"
-#include "games-runtime.h"
#ifdef ENABLE_SETGID
#include "games-setgid-io.h"
@@ -92,7 +91,7 @@ games_scores_backend_new (GamesScoreStyle style,
backend->priv->timestamp = 0;
backend->priv->style = style;
backend->scores_list = NULL;
- backend->priv->filename = g_build_filename (games_runtime_get_directory (GAMES_RUNTIME_SCORES_DIRECTORY),
+ backend->priv->filename = g_build_filename ("/usr/share/",
fullname, NULL);
g_free (fullname);
diff --git a/src/games-show.c b/src/games-show.c
index dd747d5..b3dec0c 100644
--- a/src/games-show.c
+++ b/src/games-show.c
@@ -22,22 +22,12 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
-#ifdef HAVE_MAEMO
-#ifdef HAVE_MAEMO_3
-#include <osso-browser-interface.h>
-#else
-#include <tablet-browser-interface.h>
-#endif /* HAVE_MAEMO_3 */
-#endif /* HAVE_MAEMO */
-
#ifdef G_OS_WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <io.h>
#endif /* G_OS_WIN32 */
-#include "games-runtime.h"
-
#include "games-show.h"
/**
@@ -60,56 +50,13 @@ games_show_uri (GdkScreen *screen,
guint32 timestamp,
GError **error)
{
-#ifdef HAVE_MAEMO
- osso_rpc_run_with_defaults (games_runtime_get_osso_context (),
- "osso_browser",
- OSSO_BROWSER_OPEN_NEW_WINDOW_REQ,
- NULL,
- DBUS_TYPE_STRING, uri,
- DBUS_TYPE_INVALID);
- return TRUE;
-#else
-
#ifdef G_OS_WIN32
ShellExecute (NULL, "open", uri, NULL, NULL, SW_SHOWNORMAL);
return TRUE;
#else /* !G_OS_WIN32 */
-#if GTK_CHECK_VERSION (2, 14, 0)
return gtk_show_uri (screen, uri, timestamp, error);
-#else /* GTK+ < 2.14 */
- char *argv[3] = { (char *) "xdg-open", (char *) uri, NULL };
-
- if (gdk_spawn_on_screen (screen,
- NULL /* working directory */,
- argv,
- NULL /* environment */,
- G_SPAWN_SEARCH_PATH,
- NULL, NULL,
- NULL,
- error))
- return TRUE;
-
- g_clear_error (error);
-
- /* Try falling back to gnome-open */
- argv[0] = (char *) "gnome-open";
- if (gdk_spawn_on_screen (screen,
- NULL /* working directory */,
- argv,
- NULL /* environment */,
- G_SPAWN_SEARCH_PATH,
- NULL, NULL,
- NULL,
- error))
- return TRUE;
-
- g_set_error (error, G_SPAWN_ERROR, G_SPAWN_ERROR_FAILED,
- "%s", "Failed to show help");
- return FALSE;
-#endif /* GTK+ >= 2.14 */
#endif /* G_OS_WIN32 */
-#endif /* HAVE_MAEMO */
}
/**
@@ -146,12 +93,7 @@ games_show_error (GtkWidget *window,
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
"%s", error->message);
-#ifdef HAVE_HILDON
- /* Empty title shows up as "<unnamed>" on maemo */
- gtk_window_set_title (GTK_WINDOW (dialog), _("Error"));
-#else
gtk_window_set_title (GTK_WINDOW (dialog), "");
-#endif /* HAVE_HILDON */
g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
diff --git a/src/level-convert.c b/src/level-convert.c
index cc3cfc1..bb0d371 100644
--- a/src/level-convert.c
+++ b/src/level-convert.c
@@ -597,6 +597,8 @@ static void save_tile (xmlNodePtr parent, Tile *tile)
case TILE_TYPE_FLOOR:
type_str = "TILE_TYPE_FLOOR";
break;
+ default:
+ break;
}
if (type_str == NULL)
@@ -625,8 +627,6 @@ int main (int argc, char** argv)
gchar *src_file = NULL;
PlayField *npf;
- g_type_init ();
-
calculate_translation_quark (atom_map);
calculate_translation_quark (link_map);
calculate_translation_quark (wall_map);
diff --git a/src/main.c b/src/main.c
index dea13d3..49e1d5d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -26,8 +26,6 @@
#include <unistd.h>
#include <errno.h>
-#include "games-runtime.h"
-
#include "board.h"
#include "playfield.h"
#include "main.h"
@@ -814,9 +812,6 @@ int main (int argc, char *argv[])
gboolean retval;
GError *error = NULL;
- if (!games_runtime_init ("atomix"))
- return 1;
-
context = g_option_context_new (NULL);
g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
g_option_context_add_group (context, gtk_get_option_group (TRUE));
diff --git a/src/pf-test.c b/src/pf-test.c
index 6615585..2ef11ba 100644
--- a/src/pf-test.c
+++ b/src/pf-test.c
@@ -8,8 +8,6 @@ int main (void)
PlayField *cpf;
Tile *tile;
- g_type_init ();
-
pf = playfield_new ();
playfield_set_matrix_size (pf, 10, 7);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]