[gnome-games] Use accessor functions for -DGSEAL_ENABLE
- From: Thomas Hindoe Paaboel Andersen <thomashpa src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-games] Use accessor functions for -DGSEAL_ENABLE
- Date: Sun, 19 Jul 2009 23:34:36 +0000 (UTC)
commit 3d7e8cc33b78fa6c6a10b11fbc8004c377e7b4db
Author: Thomas Hindoe Paaboel Andersen <phomes gmail com>
Date: Thu Jun 25 00:37:09 2009 +0200
Use accessor functions for -DGSEAL_ENABLE
Fixes gnotravex, gnotski, and gtali.
Still needs work for GtkWidget allocation and GtkObject flags as no solution for these exists.
GNOME bug #586731
gnotravex/gnotravex.c | 37 +++++++++++++++++++------------------
gnotski/gnotski.c | 12 ++++++------
gtali/setup.c | 8 ++++----
3 files changed, 29 insertions(+), 28 deletions(-)
---
diff --git a/gnotravex/gnotravex.c b/gnotravex/gnotravex.c
index 05adb89..11333e1 100644
--- a/gnotravex/gnotravex.c
+++ b/gnotravex/gnotravex.c
@@ -503,7 +503,7 @@ main (int argc, char **argv)
gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
gtk_widget_realize (space);
- bg_gc = gdk_gc_new (space->window);
+ bg_gc = gdk_gc_new (gtk_widget_get_window (space));
gdk_gc_set_tile (bg_gc, default_background_pixmap);
gdk_gc_set_fill (bg_gc, GDK_TILED);
@@ -610,8 +610,8 @@ create_window (void)
gint
expose_space (GtkWidget * widget, GdkEventExpose * event)
{
- gdk_draw_drawable (widget->window,
- widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
+ gdk_draw_drawable (gtk_widget_get_window (widget),
+ gtk_widget_get_style (widget)->fg_gc[GTK_STATE_NORMAL],
buffer, event->area.x, event->area.y,
event->area.x, event->area.y,
event->area.width, event->area.height);
@@ -1334,14 +1334,14 @@ redraw_all (void)
guint x, y;
GdkRegion *region;
- if (!space->window)
+ if (!gtk_widget_get_window (space))
return;
- region = gdk_drawable_get_clip_region (GDK_DRAWABLE (space->window));
- gdk_window_begin_paint_region (space->window, region);
+ region = gdk_drawable_get_clip_region (GDK_DRAWABLE (gtk_widget_get_window (space)));
+ gdk_window_begin_paint_region (gtk_widget_get_window (space), region);
- gdk_window_clear (space->window);
- gdk_draw_rectangle (space->window, bg_gc, TRUE, 0, 0, -1, -1);
+ gdk_window_clear (gtk_widget_get_window (space));
+ gdk_draw_rectangle (gtk_widget_get_window (space), bg_gc, TRUE, 0, 0, -1, -1);
gdk_draw_rectangle (buffer, bg_gc, TRUE, 0, 0, -1, -1);
for (y = 0; y < size; y++)
for (x = 0; x < size * 2; x++)
@@ -1349,7 +1349,7 @@ redraw_all (void)
gui_draw_arrow(buffer);
- gdk_window_end_paint (space->window);
+ gdk_window_end_paint (gtk_widget_get_window (space));
gdk_region_destroy (region);
}
@@ -1363,13 +1363,13 @@ redraw_left (void)
region = gdk_region_rectangle (&rect);
- gdk_window_begin_paint_region (space->window, region);
+ gdk_window_begin_paint_region (gtk_widget_get_window (space), region);
for (y = 0; y < size; y++)
for (x = 0; x < size; x++)
gui_draw_pixmap (buffer, x, y, FALSE);
- gdk_window_end_paint (space->window);
+ gdk_window_end_paint (gtk_widget_get_window (space));
gdk_region_destroy (region);
}
@@ -1410,16 +1410,16 @@ create_mover (void)
{
GdkWindowAttr attributes;
- /* The depth of mover.window must match the depth of space->window. */
+ /* The depth of mover.window must match the depth of gtk_widget_get_window (space). */
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.window_type = GDK_WINDOW_CHILD;
attributes.event_mask = 0;
attributes.width = tile_size;
attributes.height = tile_size;
- attributes.colormap = gdk_drawable_get_colormap (space->window);
- attributes.visual = gdk_drawable_get_visual (space->window);
+ attributes.colormap = gdk_drawable_get_colormap (gtk_widget_get_window (space));
+ attributes.visual = gdk_drawable_get_visual (gtk_widget_get_window (space));
- mover.window = gdk_window_new (space->window, &attributes,
+ mover.window = gdk_window_new (gtk_widget_get_window (space), &attributes,
(GDK_WA_VISUAL | GDK_WA_COLORMAP));
mover.pixmap = NULL;
}
@@ -1598,7 +1598,8 @@ make_buffer (GtkWidget * widget)
if (buffer)
g_object_unref (buffer);
- buffer = gdk_pixmap_new (widget->window, widget->allocation.width,
+ buffer = gdk_pixmap_new (gtk_widget_get_window (widget),
+ widget->allocation.width,
widget->allocation.height, -1);
}
@@ -1652,7 +1653,7 @@ save_state_cb (EggSMClient *client,
gint argc;
gint xpos, ypos;
- gdk_window_get_origin (window->window, &xpos, &ypos);
+ gdk_window_get_origin (gtk_widget_get_window (window), &xpos, &ypos);
argc = 0;
argv[argc++] = g_get_prgname ();
@@ -1688,7 +1689,7 @@ size_cb (GtkAction * action, gpointer data)
newsize = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
- gdk_drawable_get_size (space->window, &width, &height);
+ gdk_drawable_get_size (gtk_widget_get_window (space), &width, &height);
if (game_state == paused)
gtk_action_activate (resume_action);
diff --git a/gnotski/gnotski.c b/gnotski/gnotski.c
index 747cc4b..30bb60d 100644
--- a/gnotski/gnotski.c
+++ b/gnotski/gnotski.c
@@ -582,8 +582,8 @@ expose_space (GtkWidget * widget, GdkEventExpose * event)
if (clear_game)
return FALSE;
- gdk_draw_drawable (widget->window,
- widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
+ gdk_draw_drawable (gtk_widget_get_window (widget),
+ gtk_widget_get_style (widget)->fg_gc[GTK_STATE_NORMAL],
buffer, event->area.x, event->area.y,
event->area.x, event->area.y,
event->area.width, event->area.height);
@@ -714,9 +714,9 @@ gui_draw_space (void)
GtkStyle *style;
if (!backgc)
- backgc = gdk_gc_new (space->window);
+ backgc = gdk_gc_new (gtk_widget_get_window (space));
if (!bordergc)
- bordergc = gdk_gc_new (space->window);
+ bordergc = gdk_gc_new (gtk_widget_get_window (space));
style = gtk_widget_get_style (space);
@@ -733,7 +733,7 @@ gui_draw_space (void)
if (buffer)
g_object_unref (buffer);
- buffer = gdk_pixmap_new (space->window,
+ buffer = gdk_pixmap_new (gtk_widget_get_window (space),
width * tile_size + SPACE_PADDING,
height * tile_size + SPACE_PADDING, -1);
@@ -1457,7 +1457,7 @@ save_state_cb (EggSMClient *client,
gint argc;
gint xpos, ypos;
- gdk_window_get_origin (window->window, &xpos, &ypos);
+ gdk_window_get_origin (gtk_widget_get_window (window), &xpos, &ypos);
argc = 0;
argv[argc++] = g_get_prgname ();
diff --git a/gtali/setup.c b/gtali/setup.c
index eb16614..b985f22 100644
--- a/gtali/setup.c
+++ b/gtali/setup.c
@@ -205,7 +205,7 @@ setupdialog_destroy (GtkWidget * widget, gint mode)
static gint
set_as_int (GtkWidget * widget, gpointer * data)
{
- *((int *) data) = GTK_TOGGLE_BUTTON (widget)->active;
+ *((int *) data) = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
return FALSE;
}
@@ -268,7 +268,7 @@ setup_game (GtkAction * action, gpointer data)
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CLOSE,
GTK_RESPONSE_CLOSE, NULL);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (setupdialog)->vbox), 2);
+ gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (setupdialog))), 2);
gtk_window_set_resizable (GTK_WINDOW (setupdialog), FALSE);
gtk_dialog_set_has_separator (GTK_DIALOG (setupdialog), FALSE);
g_signal_connect (G_OBJECT (setupdialog), "delete_event",
@@ -282,8 +282,8 @@ setup_game (GtkAction * action, gpointer data)
gtk_table_set_row_spacings (GTK_TABLE (table), 18);
gtk_table_set_col_spacings (GTK_TABLE (table), 18);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (setupdialog)->vbox), table,
- FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (setupdialog))),
+ table, FALSE, FALSE, 0);
frame = games_frame_new (_("Human Players"));
gtk_table_attach (GTK_TABLE (table), frame, 0, 1, 0, 1, GTK_FILL, GTK_FILL,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]