[gnome-games] gnect: Fix GSEAL issues
- From: Thomas Hindoe Paaboel Andersen <thomashpa src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-games] gnect: Fix GSEAL issues
- Date: Tue, 29 Sep 2009 19:44:44 +0000 (UTC)
commit b618858d900cb4daac9c91529b436be5ec205147
Author: Thomas Hindoe Paaboel Andersen <phomes gmail com>
Date: Tue Sep 29 21:41:24 2009 +0200
gnect: Fix GSEAL issues
gnect/src/gfx.c | 17 ++++++++---------
gnect/src/main.c | 7 ++++---
gnect/src/prefs.c | 20 +++++++++++---------
3 files changed, 23 insertions(+), 21 deletions(-)
---
diff --git a/gnect/src/gfx.c b/gnect/src/gfx.c
index a2ac67e..1364cda 100644
--- a/gnect/src/gfx.c
+++ b/gnect/src/gfx.c
@@ -209,12 +209,11 @@ gfx_refresh_pixmaps (void)
void
gfx_resize (GtkWidget * w)
{
- int width, height;
+ GtkAllocation allocation;
- width = w->allocation.width;
- height = w->allocation.height;
+ gtk_widget_get_allocation (w, &allocation);
- boardsize = MIN (width, height);
+ boardsize = MIN (allocation.width, allocation.height);
tilesize = boardsize / 7;
offset[TILE_PLAYER1] = 0;
@@ -230,8 +229,8 @@ gfx_resize (GtkWidget * w)
if (pm_bground != NULL)
g_object_unref (pm_bground);
- pm_display = gdk_pixmap_new (w->window, boardsize, boardsize, -1);
- pm_bground = gdk_pixmap_new (w->window, boardsize, boardsize, -1);
+ pm_display = gdk_pixmap_new (gtk_widget_get_window (w), boardsize, boardsize, -1);
+ pm_bground = gdk_pixmap_new (gtk_widget_get_window (w), boardsize, boardsize, -1);
/* the first time the configure signal is emitted, the drawarea
* is not shown yet so we do not have the gc.
@@ -247,7 +246,7 @@ gfx_resize (GtkWidget * w)
void
gfx_expose (GdkRectangle * area)
{
- gdk_draw_drawable (GDK_DRAWABLE (drawarea->window),
+ gdk_draw_drawable (GDK_DRAWABLE (gtk_widget_get_window (drawarea)),
gc,
pm_display,
area->x, area->y,
@@ -363,8 +362,8 @@ gfx_set_grid_style (void)
g_return_val_if_fail (drawarea != NULL, FALSE);
if (!gc) {
- gc = gdk_gc_new (drawarea->window);
- solidgc = gdk_gc_new (drawarea->window);
+ gc = gdk_gc_new (gtk_widget_get_window (drawarea));
+ solidgc = gdk_gc_new (gtk_widget_get_window (drawarea));
}
if (theme[p.theme_id].grid_rgb == NULL)
diff --git a/gnect/src/main.c b/gnect/src/main.c
index ceaf357..f551152 100644
--- a/gnect/src/main.c
+++ b/gnect/src/main.c
@@ -30,6 +30,7 @@
#include <libgames-support/games-conf.h>
#include <libgames-support/games-gridframe.h>
+#include <libgames-support/games-gtk-compat.h>
#include <libgames-support/games-help.h>
#include <libgames-support/games-runtime.h>
#include <libgames-support/games-sound.h>
@@ -823,15 +824,15 @@ on_game_scores (GtkMenuItem * m, gpointer data)
gtk_dialog_set_has_separator (GTK_DIALOG (scorebox), FALSE);
gtk_window_set_resizable (GTK_WINDOW (scorebox), FALSE);
gtk_container_set_border_width (GTK_CONTAINER (scorebox), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (scorebox)->vbox), 2);
+ gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (scorebox))), 2);
g_signal_connect (GTK_OBJECT (scorebox), "destroy",
G_CALLBACK (gtk_widget_destroyed), &scorebox);
vbox = gtk_vbox_new (FALSE, 6);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (scorebox)->vbox), vbox, TRUE, TRUE,
- 0);
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (scorebox))),
+ vbox, TRUE, TRUE, 0);
icon = gtk_image_new_from_icon_name ("gnome-gnect", 48);
gtk_box_pack_start (GTK_BOX (vbox), icon, FALSE, FALSE, 0);
diff --git a/gnect/src/prefs.c b/gnect/src/prefs.c
index 80ea2e5..5765d39 100644
--- a/gnect/src/prefs.c
+++ b/gnect/src/prefs.c
@@ -32,6 +32,7 @@
#include <libgames-support/games-conf.h>
#include <libgames-support/games-frame.h>
+#include <libgames-support/games-gtk-compat.h>
#include <libgames-support/games-controls.h>
#include <libgames-support/games-sound.h>
@@ -178,21 +179,21 @@ on_select_theme (GtkComboBox * combo, gpointer data)
static void
on_toggle_animate (GtkToggleButton * t, gpointer data)
{
- p.do_animate = t->active;
- games_conf_set_boolean (NULL, KEY_DO_ANIMATE, t->active);
+ p.do_animate = gtk_toggle_button_get_active (t);
+ games_conf_set_boolean (NULL, KEY_DO_ANIMATE, gtk_toggle_button_get_active (t));
}
static void
on_toggle_sound (GtkToggleButton * t, gpointer data)
{
- p.do_sound = t->active;
- games_conf_set_boolean (NULL, KEY_DO_SOUND, t->active);
+ p.do_sound = gtk_toggle_button_get_active (t);
+ games_conf_set_boolean (NULL, KEY_DO_SOUND, gtk_toggle_button_get_active (t));
}
static void
on_select_player1 (GtkWidget * w, gpointer data)
{
- if (!GTK_TOGGLE_BUTTON (w)->active)
+ if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w)))
return;
p.level[PLAYER1] = GPOINTER_TO_INT (data);
games_conf_set_integer (NULL, KEY_LEVEL_PLAYER1, GPOINTER_TO_INT (data));
@@ -204,7 +205,7 @@ on_select_player1 (GtkWidget * w, gpointer data)
static void
on_select_player2 (GtkWidget * w, gpointer data)
{
- if (!GTK_TOGGLE_BUTTON (w)->active)
+ if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w)))
return;
p.level[PLAYER2] = GPOINTER_TO_INT (data);
games_conf_set_integer (NULL, KEY_LEVEL_PLAYER2, GPOINTER_TO_INT (data));
@@ -283,15 +284,16 @@ prefsbox_open (void)
GTK_RESPONSE_ACCEPT, NULL);
gtk_dialog_set_has_separator (GTK_DIALOG (prefsbox), FALSE);
gtk_container_set_border_width (GTK_CONTAINER (prefsbox), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (prefsbox)->vbox), 2);
+ gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (prefsbox))),
+ 2);
g_signal_connect (G_OBJECT (prefsbox), "destroy",
G_CALLBACK (gtk_widget_destroyed), &prefsbox);
notebook = gtk_notebook_new ();
gtk_container_set_border_width (GTK_CONTAINER (notebook), 5);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (prefsbox)->vbox), notebook,
- TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (prefsbox))),
+ notebook, TRUE, TRUE, 0);
/* game tab */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]