[gnumeric] Compilation: celebrate dead kittens. (Incomplete.)



commit 1f20ca23d4bcf2a7401a1f37d61b8f7f5a72f489
Author: Morten Welinder <terra gnome org>
Date:   Fri Nov 5 11:11:43 2010 -0400

    Compilation: celebrate dead kittens.  (Incomplete.)

 README                                |    1 -
 configure.in                          |   12 +++++--
 src/dead-kittens.h                    |   49 +++++++++++++++++++++++++++++
 src/dialogs/ChangeLog                 |   21 +++++++++++-
 src/dialogs/dialog-about.c            |    8 +++--
 src/dialogs/dialog-analysis-tools.c   |   55 ++++++++++++++++++++++-----------
 src/dialogs/dialog-autoformat.c       |   39 ++++++++++-------------
 src/dialogs/dialog-cell-format.c      |    3 +-
 src/dialogs/dialog-col-width.c        |    5 ++-
 src/dialogs/dialog-formula-guru.c     |    3 +-
 src/dialogs/dialog-password.c         |    3 +-
 src/dialogs/dialog-preferences.c      |    5 ++-
 src/dialogs/dialog-printer-setup.c    |    6 ++--
 src/dialogs/dialog-quit.c             |    4 ++-
 src/dialogs/dialog-random-generator.c |   10 +++++-
 src/dialogs/dialog-row-height.c       |    5 ++-
 src/dialogs/dialog-search-replace.c   |    3 +-
 src/dialogs/dialog-sheet-resize.c     |    7 ++--
 src/dialogs/dialog-so-styled.c        |    5 ++-
 src/dialogs/dialog-solver.c           |   11 ++++--
 src/dialogs/dialog-stf-format-page.c  |   17 +++++-----
 src/dialogs/dialog-stf-main-page.c    |    6 ++--
 src/dialogs/dialog-stf-preview.c      |    3 +-
 src/dialogs/dialog-tabulate.c         |    3 +-
 src/wbc-gtk.c                         |   10 +++---
 25 files changed, 202 insertions(+), 92 deletions(-)
---
diff --git a/README b/README
index 4a971e4..a49f927 100644
--- a/README
+++ b/README
@@ -18,7 +18,6 @@ You need:				Debian package name
 	gtk+		>= 2.12.0	libgtk2.0-dev
 	libgsf		>= 1.14.18	libgsf-1-dev
 	libgoffice	>= 0.8.10	libgoffice-0-8-dev
-	libglade	>= 2.3.6	libglade2-dev
 	gnome-xml   	>= 2.4.12	libxml2-dev
 	pango		>= 1.12.0	libpango1.0-dev
 	NOTE: gnome-xml is also known as libxml
diff --git a/configure.in b/configure.in
index 5a2a30a..c604c37 100644
--- a/configure.in
+++ b/configure.in
@@ -279,7 +279,7 @@ if test $gnumeric_devel = yes; then
 	    CFLAGS="$CFLAGS -DGDK_DISABLE_DEPRECATED"
 	    CFLAGS="$CFLAGS -DGDK_MULTIHEAD_SAFE"
 	    CFLAGS="$CFLAGS -DGTK_DISABLE_DEPRECATED"
-	    CFLAGS="$CFLAGS -DLIBGLADE_DISABLE_DEPRECATED"
+	    # CFLAGS="$CFLAGS -DGSEAL_ENABLE"
     fi
     if test "x$gnumeric_with_gnome" = xtrue; then
 	    CFLAGS="$CFLAGS -DGNOME_DISABLE_DEPRECATED"
@@ -688,8 +688,14 @@ LIBS="$GNUMERIC_LIBS $LIBS"
 
 AC_CHECK_FUNCS(g_option_context_set_delocalize g_hash_table_get_keys)
 AC_CHECK_FUNCS(pango_font_map_create_context)
-AC_CHECK_FUNCS(gtk_orientable_set_orientation gtk_adjustment_configure gtk_widget_set_visible gtk_widget_get_state gtk_widget_is_toplevel gtk_widget_get_window gsf_open_pkg_foreach_rel gtk_dialog_get_content_area gtk_entry_get_buffer gtk_widget_get_can_focus gtk_entry_get_text_length gtk_entry_set_icon_from_stock gtk_layout_get_bin_window gtk_widget_get_allocation)
-AC_CHECK_FUNCS(gsf_infile_msvba_steal_modules)
+AC_CHECK_FUNCS(gtk_adjustment_configure gtk_adjustment_set_lower gtk_adjustment_set_upper gtk_adjustment_get_page_size)
+AC_CHECK_FUNCS(gtk_check_menu_item_get_active)
+AC_CHECK_FUNCS(gtk_dialog_get_content_area gtk_dialog_get_action_area)
+AC_CHECK_FUNCS(gtk_entry_get_text_length gtk_entry_set_icon_from_stock gtk_entry_get_buffer )
+AC_CHECK_FUNCS(gtk_layout_get_bin_window)
+AC_CHECK_FUNCS(gtk_orientable_set_orientation)
+AC_CHECK_FUNCS(gtk_widget_get_visible gtk_widget_set_visible gtk_widget_get_state gtk_widget_is_toplevel gtk_widget_get_window gtk_widget_get_can_focus gtk_widget_has_focus gtk_widget_get_style gtk_widget_get_allocation)
+AC_CHECK_FUNCS(gsf_infile_msvba_steal_modules gsf_open_pkg_foreach_rel )
 
 AC_MSG_CHECKING([for PANGO_WEIGHT_THIN etc.])
 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pango/pango.h>]],
diff --git a/src/dead-kittens.h b/src/dead-kittens.h
index e015854..f6f2899 100644
--- a/src/dead-kittens.h
+++ b/src/dead-kittens.h
@@ -3,6 +3,14 @@
 
 /* To be included only from C files, not headers.  */
 
+#ifndef HAVE_GTK_DIALOG_GET_ACTION_AREA
+#define gtk_dialog_get_action_area(x) ((x)->action_area)
+#endif
+
+#ifndef HAVE_GTK_DIALOG_GET_CONTENT_AREA
+#define gtk_dialog_get_content_area(x) ((x)->vbox)
+#endif
+
 #ifndef HAVE_GTK_ENTRY_GET_TEXT_LENGTH
 #define gtk_entry_get_text_length(x) g_utf8_strlen (gtk_entry_get_text (x), -1)
 #endif
@@ -15,6 +23,10 @@
 #define gtk_widget_set_visible(_w_,_v_) do { if (_v_) gtk_widget_show (_w_); else gtk_widget_hide (_w_); } while (0)
 #endif
 
+#ifndef HAVE_GTK_WIDGET_GET_VISIBLE
+#define gtk_widget_get_visible(_w_) GTK_WIDGET_VISIBLE(_w_)
+#endif
+
 #ifndef HAVE_GTK_WIDGET_IS_TOPLEVEL
 #define gtk_widget_is_toplevel(w_) (GTK_WIDGET_FLAGS ((w_)) & GTK_TOPLEVEL)
 #endif
@@ -31,9 +43,46 @@
 #define gtk_widget_get_allocation(w,a) (*(a) = (w)->allocation)
 #endif
 
+#ifndef HAVE_GTK_WIDGET_GET_STYLE
+#define gtk_widget_get_style(w) (w)->style
+#endif
+
+#ifndef HAVE_GTK_WIDGET_HAS_FOCUS
+#define gtk_widget_has_focus(w) GTK_WIDGET_HAS_FOCUS (w)
+#endif
+
 #ifndef  HAVE_GTK_DIALOG_GET_CONTENT_AREA
 #define gtk_dialog_get_content_area(w) ((w)->vbox)
 #endif
 
+#ifndef HAVE_GTK_CHECK_MENU_ITEM_GET_ACTIVE
+#define gtk_check_menu_item_get_active(cm) ((cm)->active)
+#endif
+
+#ifndef HAVE_GTK_ADJUSTMENT_CONFIGURE
+#define gtk_adjustment_configure(_a,_v,_l,_u,_si,_pi,_ps)	\
+  g_object_set (_a,						\
+                "lower", (double)(_l),				\
+                "upper", (double)(_u),				\
+                "step-increment", (double)(_si),		\
+                "page-increment", (double)(_pi),		\
+                "page-size", (double)(_ps),			\
+		"value", (double)(_v),				\
+                NULL)
+#endif
+
+#ifndef HAVE_GTK_ADJUSTMENT_GET_PAGE_SIZE
+#define gtk_adjustment_get_page_size (_a) ((_a)->page_size)
+#endif
+
+#ifndef HAVE_GTK_ADJUSTMENT_SET_LOWER
+#define gtk_adjustment_set_lower (_a,_l) \
+  g_object_set (_a, "lower", (double)(_l), NULL)
+#endif
+
+#ifndef HAVE_GTK_ADJUSTMENT_SET_UPPER
+#define gtk_adjustment_set_upper (_a,_u) \
+  g_object_set (_a, "upper", (double)(_u), NULL)
+#endif
 
 #endif
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index fc01a20..bb54590 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,3 +1,20 @@
+2010-11-05  Morten Welinder  <terra gnome org>
+
+	* dialog-about.c: Celebrate dead kittens.
+	* dialog-analysis-tools.c: Ditto.
+	* dialog-autoformat.c: Ditto:
+	* dialog-cell-format.c: Ditto.
+	* dialog-col-width.c: Ditto.
+	* dialog-formula-guru.c: Ditto.
+	* dialog-password.c: Ditto.
+	* dialog-preferences.c: Ditto.
+	* dialog-quit.c: Ditto.
+	* dialog-random-generator.c: Ditto.
+	* dialog-row-height.c: Ditto.
+	* dialog-search-replace.c: Ditto.
+	* dialog-sheet-resize.c: Ditto.
+	* dialog-so-styled.c: Ditto.
+
 2010-10-27  Morten Welinder  <terra gnome org>
 
 	* dialog-cell-format.c (fmt_dialog_impl): Fix destruction.
@@ -16,8 +33,8 @@
 
 2010-10-24  Jean Brefort  <jean brefort normalesup org>
 
-	* dialog-printer-setup.c: do not destroy the GtkBuilder after intializing
-	the Header/Footer setup dialog. [See #632999]
+	* dialog-printer-setup.c: do not destroy the GtkBuilder after
+	intializing the Header/Footer setup dialog. [See #632999]
 
 2010-10-19  Morten Welinder  <terra gnome org>
 
diff --git a/src/dialogs/dialog-about.c b/src/dialogs/dialog-about.c
index 9f1b95a..23cc9e9 100644
--- a/src/dialogs/dialog-about.c
+++ b/src/dialogs/dialog-about.c
@@ -233,11 +233,12 @@ text_item_renderer (AboutRenderer *r, AboutState *state)
 	int age = state->now - r->start_time;
 	double rage = CLAMP (age / (double)r->duration, 0.0, 1.0);
 	GtkWidget *widget = state->anim_area;
-	GdkDrawable *drawable = widget->window;
+	GdkDrawable *drawable = gtk_widget_get_window (widget);
 	GtkStyle *style;
 	const int fade = 500;
 	int x, y, width, height;
 	cairo_t *cr;
+	GtkAllocation wa;
 
 	if (age >= r->duration)
 		return FALSE;
@@ -249,9 +250,10 @@ text_item_renderer (AboutRenderer *r, AboutState *state)
 
 	style = gtk_widget_get_style (widget);
 
-	x = (int)(PANGO_SCALE * widget->allocation.width *
+	gtk_widget_get_allocation (widget, &wa);
+	x = (int)(PANGO_SCALE * wa.width *
 		  (r->start.x + rage * (r->end.x - r->start.x)));
-	y = (int)(PANGO_SCALE * widget->allocation.height *
+	y = (int)(PANGO_SCALE * wa.height *
 		  (r->start.y + rage * (r->end.y - r->start.y)));
 
 	if (r->expansion.count) {
diff --git a/src/dialogs/dialog-analysis-tools.c b/src/dialogs/dialog-analysis-tools.c
index 34f6166..6b1181d 100644
--- a/src/dialogs/dialog-analysis-tools.c
+++ b/src/dialogs/dialog-analysis-tools.c
@@ -31,6 +31,7 @@
 #include "analysis-anova.h"
 #include "analysis-histogram.h"
 #include "analysis-exp-smoothing.h"
+#include <dead-kittens.h>
 
 #include <workbook.h>
 #include <workbook-control.h>
@@ -412,6 +413,7 @@ dialog_tool_init (GenericToolState *state,
 	} else {
 		GList *this_label_widget;
 		GtkTableChild *tchild;
+		GList *children;
 
 		table = GTK_TABLE (gtk_widget_get_parent (widget));
 		state->input_entry = gnm_expr_entry_new (state->wbcg, TRUE);
@@ -419,9 +421,11 @@ dialog_tool_init (GenericToolState *state,
 		gnm_expr_entry_set_flags (state->input_entry, flags | GNM_EE_FORCE_ABS_REF,
 					  GNM_EE_MASK);
 
+		children = gtk_container_get_children (GTK_CONTAINER (table));
 		this_label_widget = g_list_find_custom
-		  (table->children, widget, (GCompareFunc) dialog_tool_cmp);
+		  (children, widget, (GCompareFunc) dialog_tool_cmp);
 		tchild = (GtkTableChild *)(this_label_widget->data);
+		g_list_free (children);
 
 		gtk_table_attach (table, GTK_WIDGET (state->input_entry),
 				  tchild->right_attach, tchild->right_attach + 1,
@@ -449,6 +453,7 @@ dialog_tool_init (GenericToolState *state,
 	} else {
 		GList *this_label_widget;
 		GtkTableChild *tchild;
+		GList *children;
 
 		state->input_entry_2 = gnm_expr_entry_new (state->wbcg, TRUE);
 		gnm_expr_entry_disable_tips (state->input_entry_2);
@@ -456,9 +461,11 @@ dialog_tool_init (GenericToolState *state,
 					  GNM_EE_SINGLE_RANGE | GNM_EE_FORCE_ABS_REF, GNM_EE_MASK);
 		table = GTK_TABLE (gtk_widget_get_parent (widget));
 
+		children = gtk_container_get_children (GTK_CONTAINER (table));
 		this_label_widget = g_list_find_custom
-		  (table->children, widget, (GCompareFunc) dialog_tool_cmp);
+		  (children, widget, (GCompareFunc) dialog_tool_cmp);
 		tchild = (GtkTableChild *)(this_label_widget->data);
+		g_list_free (children);
 
 		gtk_table_attach (table, GTK_WIDGET (state->input_entry_2),
 				  tchild->right_attach, tchild->right_attach + 1,
@@ -1547,18 +1554,24 @@ static void
 dialog_ttest_realized (G_GNUC_UNUSED GtkWidget *widget,
 		       TTestState *state)
 {
+	GtkAllocation alloc;
+
+	gtk_widget_get_allocation (state->options_table, &alloc);
 	gtk_widget_set_size_request (state->options_table,
-				     state->options_table->allocation.width,
-				     state->options_table->allocation.height);
+				     alloc.width, alloc.height);
+
+	gtk_widget_get_allocation (state->paired_button, &alloc);
 	gtk_widget_set_size_request (state->paired_button,
-				     state->paired_button->allocation.width,
-				     state->paired_button->allocation.height);
+				     alloc.width, alloc.height);
+
+	gtk_widget_get_allocation (state->unpaired_button, &alloc);
 	gtk_widget_set_size_request (state->unpaired_button,
-				     state->unpaired_button->allocation.width,
-				     state->unpaired_button->allocation.height);
+				     alloc.width, alloc.height);
+
+	gtk_widget_get_allocation (state->variablespaired_label, &alloc);
 	gtk_widget_set_size_request (state->variablespaired_label,
-				     state->variablespaired_label->allocation.width,
-				     state->variablespaired_label->allocation.height);
+				     alloc.width, alloc.height);
+
 	ttest_paired_toggled_cb (state->paired_button, state);
 	dialog_ttest_adjust_to_invocation (state);
 }
@@ -1995,18 +2008,24 @@ static void
 dialog_sampling_realized (G_GNUC_UNUSED GtkWidget *widget,
 			  SamplingState *state)
 {
+	GtkAllocation alloc;
+
+	gtk_widget_get_allocation (state->options_table, &alloc);
 	gtk_widget_set_size_request (state->options_table,
-				     state->options_table->allocation.width,
-				     state->options_table->allocation.height);
+				     alloc.width, alloc.height);
+
+	gtk_widget_get_allocation (state->random_button, &alloc);
 	gtk_widget_set_size_request (state->random_button,
-				     state->random_button->allocation.width,
-				     state->random_button->allocation.height);
+				     alloc.width, alloc.height);
+
+	gtk_widget_get_allocation (state->periodic_button, &alloc);
 	gtk_widget_set_size_request (state->periodic_button,
-				     state->periodic_button->allocation.width,
-				     state->periodic_button->allocation.height);
+				     alloc.width, alloc.height);
+
+	gtk_widget_get_allocation (state->method_label, &alloc);
 	gtk_widget_set_size_request (state->method_label,
-				     state->method_label->allocation.width,
-				     state->method_label->allocation.height);
+				     alloc.width, alloc.height);
+
 	sampling_method_toggled_cb (state->periodic_button, state);
 }
 
diff --git a/src/dialogs/dialog-autoformat.c b/src/dialogs/dialog-autoformat.c
index 1bcf5e4..3bcdb8b 100644
--- a/src/dialogs/dialog-autoformat.c
+++ b/src/dialogs/dialog-autoformat.c
@@ -29,6 +29,7 @@
 #include <gnumeric.h>
 #include "dialogs.h"
 #include "help.h"
+#include <dead-kittens.h>
 
 #include <gui-util.h>
 #include <mstyle.h>
@@ -170,7 +171,7 @@ auto_format_grid_new (AutoFormatState *state, int i, GnmFormatTemplate *ft)
 	GocItem *item = goc_item_new (
 		goc_canvas_get_root (state->canvas[i]),
 		auto_format_grid_get_type (),
-		"render-gridlines",	state->gridlines->active,
+		"render-gridlines",	gtk_check_menu_item_get_active (state->gridlines),
 		"default-col-width",	DEFAULT_COL_WIDTH,
 		"default-row-height",	DEFAULT_ROW_HEIGHT,
 		"x",			0.,
@@ -234,15 +235,9 @@ templates_load (AutoFormatState *state)
 	state->previews_locked = TRUE;
 	{
 		GtkAdjustment *adjustment = gtk_range_get_adjustment (GTK_RANGE (state->scroll));
-
-		adjustment->value = 0;
-		adjustment->lower = 0;
-		adjustment->upper = n_templates / 2;
-		adjustment->step_increment = 1;
-		adjustment->page_increment = 3;
-		adjustment->page_size = 3;
-
-		gtk_adjustment_changed (adjustment);
+		gtk_adjustment_configure (adjustment,
+					  0, 0, n_templates / 2,
+					  1, 3, 3);
 	}
 	state->previews_locked = FALSE;
 
@@ -387,7 +382,7 @@ static void
 cb_scroll_value_changed (GtkAdjustment *adjustment, AutoFormatState *state)
 {
 	previews_free (state);
-	previews_load (state, rint (adjustment->value) * 2);
+	previews_load (state, rint (gtk_adjustment_get_value (adjustment)) * 2);
 }
 
 static gboolean
@@ -437,16 +432,16 @@ cb_check_item_toggled (G_GNUC_UNUSED GtkCheckMenuItem *item,
 	for (ptr = state->templates; ptr != NULL ; ptr = ptr->next) {
 		GnmFormatTemplate *ft = ptr->data;
 
-		ft->number    = state->number->active;
-		ft->border    = state->border->active;
-		ft->font      = state->font->active;
-		ft->patterns  = state->patterns->active;
-		ft->alignment = state->alignment->active;
+		ft->number    = gtk_check_menu_item_get_active (state->number);
+		ft->border    = gtk_check_menu_item_get_active (state->border);
+		ft->font      = gtk_check_menu_item_get_active (state->font);
+		ft->patterns  = gtk_check_menu_item_get_active (state->patterns);
+		ft->alignment = gtk_check_menu_item_get_active (state->alignment);
 
-		ft->edges.left   = state->edges.left->active;
-		ft->edges.right  = state->edges.right->active;
-		ft->edges.top    = state->edges.top->active;
-		ft->edges.bottom = state->edges.bottom->active;
+		ft->edges.left   = gtk_check_menu_item_get_active (state->edges.left);
+		ft->edges.right  = gtk_check_menu_item_get_active (state->edges.right);
+		ft->edges.top    = gtk_check_menu_item_get_active (state->edges.top);
+		ft->edges.bottom = gtk_check_menu_item_get_active (state->edges.bottom);
 
 		ft->invalidate_hash = TRUE;
 	}
@@ -549,7 +544,7 @@ static gboolean
 cb_canvas_focus (GtkWidget *canvas, GtkDirectionType direction,
 		 AutoFormatState *state)
 {
-	if (!GTK_WIDGET_HAS_FOCUS (canvas)) {
+	if (!gtk_widget_has_focus (canvas)) {
 		gtk_widget_grab_focus (canvas);
 		cb_canvas_button_press (GOC_CANVAS (canvas), NULL, state);
 		return TRUE;
@@ -654,7 +649,7 @@ dialog_autoformat (WBCGtk *wbcg)
 			G_CALLBACK (cb_canvas_focus), state);
 	}
 
-	g_signal_connect (G_OBJECT (GTK_RANGE (state->scroll)->adjustment),
+	g_signal_connect (G_OBJECT (gtk_range_get_adjustment (GTK_RANGE (state->scroll))),
 		"value_changed",
 		G_CALLBACK (cb_scroll_value_changed), state);
 	g_signal_connect (G_OBJECT (state->gridlines),
diff --git a/src/dialogs/dialog-cell-format.c b/src/dialogs/dialog-cell-format.c
index bf78800..49f1a4a 100644
--- a/src/dialogs/dialog-cell-format.c
+++ b/src/dialogs/dialog-cell-format.c
@@ -27,6 +27,7 @@
 #include <gnumeric.h>
 #include "dialogs.h"
 #include "help.h"
+#include <dead-kittens.h>
 
 #include <sheet.h>
 #include <sheet-view.h>
@@ -2504,7 +2505,7 @@ fmt_dialog_impl (FormatState *state, FormatDialogPosition_t pageno)
 	fmt_dialog_init_input_msg_page (state);
 	fmt_dialog_init_conditions_page (state);
 
-	default_border_color = GO_COLOR_FROM_GDK (GTK_WIDGET (state->dialog)->style->black);
+	default_border_color = GO_COLOR_FROM_GDK (gtk_widget_get_style (GTK_WIDGET (state->dialog))->black);
 
 	if (pageno == FD_CURRENT)
 		pageno = fmt_dialog_page;
diff --git a/src/dialogs/dialog-col-width.c b/src/dialogs/dialog-col-width.c
index 52bd60a..934ce7d 100644
--- a/src/dialogs/dialog-col-width.c
+++ b/src/dialogs/dialog-col-width.c
@@ -26,6 +26,7 @@
 #include <gnumeric.h>
 #include "dialogs.h"
 #include "help.h"
+#include <dead-kittens.h>
 
 #include <gui-util.h>
 #include <commands.h>
@@ -261,8 +262,8 @@ dialog_col_width (WBCGtk *wbcg, gboolean use_default)
 	state->points = GTK_WIDGET (go_gtk_builder_get_widget (gui, "pts-label"));
 
 	state->spin  = GTK_SPIN_BUTTON (go_gtk_builder_get_widget (gui, "spin"));
-	gtk_spin_button_get_adjustment (state->spin)->lower =
-		GNM_COL_MARGIN + GNM_COL_MARGIN;
+	gtk_adjustment_set_lower (gtk_spin_button_get_adjustment (state->spin),
+				  GNM_COL_MARGIN + GNM_COL_MARGIN);
 	g_signal_connect (G_OBJECT (state->spin),
 		"value-changed",
 		G_CALLBACK (cb_dialog_col_width_value_changed), state);
diff --git a/src/dialogs/dialog-formula-guru.c b/src/dialogs/dialog-formula-guru.c
index 51e25f0..215a37f 100644
--- a/src/dialogs/dialog-formula-guru.c
+++ b/src/dialogs/dialog-formula-guru.c
@@ -28,6 +28,7 @@
 #include <gnumeric.h>
 #include "dialogs.h"
 #include "help.h"
+#include <dead-kittens.h>
 
 #include <parse-util.h>
 #include <gui-util.h>
@@ -1100,7 +1101,7 @@ dialog_formula_guru (WBCGtk *wbcg, GnmFunc *fd)
 	gnumeric_keyed_dialog (state->wbcg, GTK_WINDOW (state->dialog),
 			       FORMULA_GURU_KEY);
 
-	gtk_widget_show_all (GTK_DIALOG (state->dialog)->vbox);
+	gtk_widget_show_all (gtk_dialog_get_content_area (GTK_DIALOG (state->dialog)));
 	gtk_widget_realize (state->dialog);
 
 	if (fd == NULL) {
diff --git a/src/dialogs/dialog-password.c b/src/dialogs/dialog-password.c
index ead8e4e..66f5619 100644
--- a/src/dialogs/dialog-password.c
+++ b/src/dialogs/dialog-password.c
@@ -2,6 +2,7 @@
 #include <gtk/gtk.h>
 #include <glib/gi18n-lib.h>
 #include "dialogs.h"
+#include <dead-kittens.h>
 
 static void
 cb_accept_password (GtkWidget *IGNORED, GtkDialog *d)
@@ -43,7 +44,7 @@ dialog_get_password (GtkWindow *parent, const char *filename)
 					 NULL);
 	gtk_window_set_resizable (GTK_WINDOW (d), FALSE);
 	hb = gtk_hbox_new (FALSE, 0);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (d)->vbox), hb,
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (d))), hb,
 			    TRUE, TRUE, 8);
 	image = gtk_image_new_from_stock ("Gnumeric_Protection_Yes_Dialog",
 					  GTK_ICON_SIZE_DIALOG);
diff --git a/src/dialogs/dialog-preferences.c b/src/dialogs/dialog-preferences.c
index 08f6b3a..7e80063 100644
--- a/src/dialogs/dialog-preferences.c
+++ b/src/dialogs/dialog-preferences.c
@@ -28,6 +28,7 @@
 #include "application.h"
 #include "dialogs.h"
 #include "help.h"
+#include <dead-kittens.h>
 
 #include "mstyle.h"
 #include "value.h"
@@ -384,7 +385,7 @@ powerof2 (int i)
 static void
 cb_power_of_2 (GtkAdjustment *adj)
 {
-	int val = (int)adj->value;
+	int val = (int)gtk_adjustment_get_value (adj);
 
 	if (powerof2 (val - 1))
 		gtk_adjustment_set_value (adj, (val - 1) * 2);
@@ -1285,7 +1286,7 @@ dialog_preferences (WBCGtk *wbcg, gint page)
 	w = g_object_get_data (gnm_app_get_app (), PREF_DIALOG_KEY);
 	if (w) {
 		gtk_widget_show (w);
-		gdk_window_raise (w->window);
+		gdk_window_raise (gtk_widget_get_window (w));
 		return;
 	}
 
diff --git a/src/dialogs/dialog-printer-setup.c b/src/dialogs/dialog-printer-setup.c
index edc0703..c4f0de1 100644
--- a/src/dialogs/dialog-printer-setup.c
+++ b/src/dialogs/dialog-printer-setup.c
@@ -25,9 +25,9 @@
 #include <glib/gi18n-lib.h>
 #include <gnumeric.h>
 #include <gtk/gtk.h>
-
 #include "dialogs.h"
 #include "help.h"
+#include <dead-kittens.h>
 
 #include <gui-util.h>
 #include <commands.h>
@@ -1691,8 +1691,8 @@ do_hf_customize (gboolean header, PrinterSetupState *state)
 		dialog = state->customize_footer;
 
 	if (dialog != NULL) {
-		gdk_window_show (dialog->window);
-		gdk_window_raise (dialog->window);
+		gdk_window_show (gtk_widget_get_window (dialog));
+		gdk_window_raise (gtk_widget_get_window (dialog));
 		return;
 	}
 
diff --git a/src/dialogs/dialog-quit.c b/src/dialogs/dialog-quit.c
index 1bd415c..85b70ce 100644
--- a/src/dialogs/dialog-quit.c
+++ b/src/dialogs/dialog-quit.c
@@ -29,6 +29,7 @@
 #include <wbc-gtk.h>
 #include <gui-clipboard.h>
 #include <application.h>
+#include <dead-kittens.h>
 
 #include <goffice/goffice.h>
 #include <gtk/gtk.h>
@@ -213,7 +214,8 @@ show_quit_dialog (GList *dirty, WBCGtk *wbcg)
 					     GTK_SHADOW_IN);
 	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrollw),
 					GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
-	gtk_box_pack_start (GTK_BOX (dialog->vbox), scrollw, TRUE, TRUE, 0);
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (dialog)),
+			    scrollw, TRUE, TRUE, 0);
 
 	gtk_dialog_set_default_response (dialog, GTK_RESPONSE_OK);
 
diff --git a/src/dialogs/dialog-random-generator.c b/src/dialogs/dialog-random-generator.c
index 2385358..e61cc32 100644
--- a/src/dialogs/dialog-random-generator.c
+++ b/src/dialogs/dialog-random-generator.c
@@ -29,6 +29,7 @@
 #include "help.h"
 #include "tool-dialogs.h"
 #include "random-generator.h"
+#include <dead-kittens.h>
 
 #include <workbook.h>
 #include <workbook-control.h>
@@ -504,9 +505,14 @@ dialog_random_realized (GtkWidget *widget, RandomToolState *state)
 {
 	GtkWidget *t = state->distribution_table;
 	GtkWidget *l = state->par1_label;
+	GtkAllocation a;
+
+	gtk_widget_get_allocation (t, &a);
+	gtk_widget_set_size_request (t, a.width, a.height);
+
+	gtk_widget_get_allocation (l, &a);
+	gtk_widget_set_size_request (l, a.width, a.height);
 
-	gtk_widget_set_size_request (t, t->allocation.width, t->allocation.height);
-	gtk_widget_set_size_request (l, l->allocation.width, l->allocation.height);
 	distribution_callback (widget, state);
 }
 
diff --git a/src/dialogs/dialog-row-height.c b/src/dialogs/dialog-row-height.c
index a864364..cbecb41 100644
--- a/src/dialogs/dialog-row-height.c
+++ b/src/dialogs/dialog-row-height.c
@@ -26,6 +26,7 @@
 #include <gnumeric.h>
 #include "dialogs.h"
 #include "help.h"
+#include <dead-kittens.h>
 
 #include <gui-util.h>
 #include <commands.h>
@@ -264,8 +265,8 @@ dialog_row_height (WBCGtk *wbcg, gboolean use_default)
 	state->points = GTK_WIDGET (go_gtk_builder_get_widget (state->gui, "pts-label"));
 
 	state->spin  = GTK_SPIN_BUTTON (go_gtk_builder_get_widget (state->gui, "spin"));
-	gtk_spin_button_get_adjustment (state->spin)->lower =
-		GNM_ROW_MARGIN + GNM_ROW_MARGIN + 1;
+	gtk_adjustment_set_lower (gtk_spin_button_get_adjustment (state->spin),
+				  GNM_ROW_MARGIN + GNM_ROW_MARGIN + 1);
 	g_signal_connect (G_OBJECT (state->spin),
 		"value-changed",
 		G_CALLBACK (cb_dialog_row_height_value_changed), state);
diff --git a/src/dialogs/dialog-search-replace.c b/src/dialogs/dialog-search-replace.c
index ec4e554..1f01ef6 100644
--- a/src/dialogs/dialog-search-replace.c
+++ b/src/dialogs/dialog-search-replace.c
@@ -27,6 +27,7 @@
 #include <gnumeric.h>
 #include "dialogs.h"
 #include "help.h"
+#include <dead-kittens.h>
 
 #include <gnumeric-gconf.h>
 #include <gui-util.h>
@@ -352,7 +353,7 @@ dialog_search_replace (WBCGtk *wbcg,
 	g_object_set_data_full (G_OBJECT (dialog),
 		"state", dd, (GDestroyNotify) cb_dialog_destroy);
 
-	gtk_widget_show_all (dialog->vbox);
+	gtk_widget_show_all (gtk_dialog_get_content_area (dialog));
 	gtk_widget_grab_focus (GTK_WIDGET (dd->search_text));
 
 	gnm_dialog_setup_destroy_handlers (dialog, wbcg,
diff --git a/src/dialogs/dialog-sheet-resize.c b/src/dialogs/dialog-sheet-resize.c
index f5480b7..9cc3d2f 100644
--- a/src/dialogs/dialog-sheet-resize.c
+++ b/src/dialogs/dialog-sheet-resize.c
@@ -26,6 +26,7 @@
 #include <gnumeric.h>
 #include "dialogs.h"
 #include "help.h"
+#include <dead-kittens.h>
 
 #include <gui-util.h>
 #include <wbc-gtk.h>
@@ -52,10 +53,10 @@ get_sizes (ResizeState *state, int *cols, int *rows)
 	GtkAdjustment *adj;
 
 	adj = gtk_range_get_adjustment (GTK_RANGE (state->columns_scale));
-	*cols = 1 << (int)adj->value;
+	*cols = 1 << (int)gtk_adjustment_get_value (adj);
 
 	adj = gtk_range_get_adjustment (GTK_RANGE (state->rows_scale));
-	*rows = 1 << (int)adj->value;
+	*rows = 1 << (int)gtk_adjustment_get_value (adj);
 }
 
 static void
@@ -164,7 +165,7 @@ dialog_sheet_resize (WBCGtk *wbcg)
 				    GNM_MAX_COLS / GNM_MIN_COLS)) *
 		go_pango_measure_string
 		(gtk_widget_get_pango_context (GTK_WIDGET (wbcg_toplevel (wbcg))),
-		 state->dialog->style->font_desc, "00");
+		 gtk_widget_get_style (state->dialog)->font_desc, "00");
 
 	state->columns_scale = go_gtk_builder_get_widget (gui, "columns_scale");
 	gtk_widget_set_size_request (state->columns_scale, slider_width, -1);
diff --git a/src/dialogs/dialog-so-styled.c b/src/dialogs/dialog-so-styled.c
index 782caca..640601d 100644
--- a/src/dialogs/dialog-so-styled.c
+++ b/src/dialogs/dialog-so-styled.c
@@ -24,6 +24,7 @@
 #include <glib/gi18n-lib.h>
 #include "gnumeric.h"
 #include "dialogs.h"
+#include <dead-kittens.h>
 
 #include "gui-gnumeric.h"
 #include "gui-util.h"
@@ -156,7 +157,7 @@ dialog_so_styled (WBCGtk *wbcg,
 	editor = go_style_get_editor (orig, default_style,
 				      GO_CMD_CONTEXT (wbcg), G_OBJECT (so));
 
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
 		editor, TRUE, TRUE, TRUE);
 	g_object_unref (default_style);
 
@@ -168,7 +169,7 @@ dialog_so_styled (WBCGtk *wbcg,
 						  text_w,
 						  gtk_label_new (_("Content")));
 		else
-			gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
+			gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
 					    text_w, TRUE, TRUE, TRUE);
 	}
 
diff --git a/src/dialogs/dialog-solver.c b/src/dialogs/dialog-solver.c
index e6e3a87..677ce7e 100644
--- a/src/dialogs/dialog-solver.c
+++ b/src/dialogs/dialog-solver.c
@@ -28,6 +28,7 @@
 #include <gnumeric.h>
 #include "dialogs.h"
 #include "help.h"
+#include <dead-kittens.h>
 
 #include <gui-util.h>
 #include <func.h>
@@ -688,9 +689,10 @@ run_solver (SolverState *state, GnmSolverParameters *param)
 		gtk_widget_ensure_style (w);
 		gtk_widget_set_size_request
 			(w,
-			 go_pango_measure_string (context,
-						  w->style->font_desc,
-						  "0") * (5 + GNM_DIG),
+			 go_pango_measure_string
+			 (context,
+			  gtk_widget_get_style (w)->font_desc,
+			  "0") * (5 + GNM_DIG),
 			 -1);
 		gtk_table_attach_defaults (GTK_TABLE (table),
 					   w, 1, 2, y, y + 1);
@@ -703,7 +705,8 @@ run_solver (SolverState *state, GnmSolverParameters *param)
 		}
 	}
 
-	gtk_box_pack_start (GTK_BOX (dialog->vbox), table, TRUE, TRUE, 0);
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (dialog)),
+			    table, TRUE, TRUE, 0);
 	gtk_widget_show_all (GTK_WIDGET (dialog));
 
 	state->run.sig_notify_result =
diff --git a/src/dialogs/dialog-stf-format-page.c b/src/dialogs/dialog-stf-format-page.c
index f692a79..22e3e18 100644
--- a/src/dialogs/dialog-stf-format-page.c
+++ b/src/dialogs/dialog-stf-format-page.c
@@ -97,17 +97,18 @@ tree_view_clamp_column_visible (GtkTreeView       *tree_view,
 				GtkTreeViewColumn *column)
 {
 	GtkAdjustment *hadjustment = gtk_tree_view_get_hadjustment (tree_view);
+	double hval = gtk_adjustment_get_value (hadjustment);
+	double hps = gtk_adjustment_get_page_size (hadjustment);
 	GtkWidget *button = column->button;
+	GtkAllocation ba;
 
-	if ((hadjustment->value + hadjustment->page_size) <
-	    (button->allocation.x + button->allocation.width))
+	gtk_widget_get_allocation (button, &ba);
+	
+	if (hval + hps < ba.x + ba.width)
 		gtk_adjustment_set_value (hadjustment,
-					  button->allocation.x +
-					  button->allocation.width -
-					  hadjustment->page_size);
-	else if (hadjustment->value > button->allocation.x)
-		gtk_adjustment_set_value (hadjustment,
-					  button->allocation.x);
+					  ba.x + ba.width - hps);
+	else if (hval > ba.x)
+		gtk_adjustment_set_value (hadjustment, ba.x);
 }
 
 static void
diff --git a/src/dialogs/dialog-stf-main-page.c b/src/dialogs/dialog-stf-main-page.c
index 1bcac5b..b4fed74 100644
--- a/src/dialogs/dialog-stf-main-page.c
+++ b/src/dialogs/dialog-stf-main-page.c
@@ -30,6 +30,7 @@
 #include <gtk/gtk.h>
 #include <goffice/goffice.h>
 #include <string.h>
+#include <dead-kittens.h>
 
 /*************************************************************************************************
  * MISC UTILITY FUNCTIONS
@@ -118,9 +119,8 @@ main_page_set_spin_button_adjustment (GtkSpinButton* spinbutton, int min, int ma
 	GtkAdjustment *spinadjust;
 
 	spinadjust = gtk_spin_button_get_adjustment (spinbutton);
-	spinadjust->lower = min;
-	spinadjust->upper = max;
-	gtk_spin_button_set_adjustment (spinbutton, spinadjust);
+	gtk_adjustment_set_lower (spinadjust, min);
+	gtk_adjustment_set_upper (spinadjust, max);
 }
 
 /**
diff --git a/src/dialogs/dialog-stf-preview.c b/src/dialogs/dialog-stf-preview.c
index 4152a91..4e1fc37 100644
--- a/src/dialogs/dialog-stf-preview.c
+++ b/src/dialogs/dialog-stf-preview.c
@@ -25,6 +25,7 @@
 #include <gnumeric.h>
 #include "dialog-stf-preview.h"
 #include "dialog-stf.h"
+#include <dead-kittens.h>
 
 #include <gnm-format.h>
 #include <number-match.h>
@@ -201,7 +202,7 @@ stf_preview_set_lines (RenderData_t *renderdata,
 	 * If we are making large changes we need to hide the treeview
 	 * because performance otherwise suffers a lot.
 	 */
-	hidden = GTK_WIDGET_VISIBLE (GTK_WIDGET (renderdata->tree_view)) &&
+	hidden = gtk_widget_get_visible (GTK_WIDGET (renderdata->tree_view)) &&
 		(colcount < renderdata->colcount - 1 ||
 		 colcount > renderdata->colcount + 10);
 	if (hidden)
diff --git a/src/dialogs/dialog-tabulate.c b/src/dialogs/dialog-tabulate.c
index 3d928e2..48c2845 100644
--- a/src/dialogs/dialog-tabulate.c
+++ b/src/dialogs/dialog-tabulate.c
@@ -27,6 +27,7 @@
 #include <gnumeric.h>
 #include "dialogs.h"
 #include "help.h"
+#include <dead-kittens.h>
 
 #include <gui-util.h>
 #include <widgets/gnumeric-expr-entry.h>
@@ -379,7 +380,7 @@ dialog_tabulate (WBCGtk *wbcg, Sheet *sheet)
 	gnm_dialog_setup_destroy_handlers (dialog, wbcg,
 					   GNM_DIALOG_DESTROY_SHEET_REMOVED);
 
-	gtk_widget_show_all (dialog->vbox);
+	gtk_widget_show_all (gtk_dialog_get_content_area (dialog));
 	wbc_gtk_attach_guru (wbcg, GTK_WIDGET (dialog));
 
 	non_model_dialog (wbcg, dialog, TABULATE_KEY);
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index 699e6af..2152f27 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -954,8 +954,8 @@ cb_paned_size_allocate (GtkHPaned *hpaned,
 	GtkWidget *child1 = paned->child1;
 	GtkWidget *child2 = paned->child2;
 
-	if (child1 == NULL || !GTK_WIDGET_VISIBLE (child1) ||
-	    child2 == NULL || !GTK_WIDGET_VISIBLE (child2))
+	if (child1 == NULL || !gtk_widget_get_visible (child1) ||
+	    child2 == NULL || !gtk_widget_get_visible (child2))
 		goto chain;
 
 	g_object_get (G_OBJECT (paned), "position-set", &position_set, NULL);
@@ -2412,7 +2412,7 @@ wbcg_toggle_visibility (WBCGtk *wbcg, GtkToggleAction *action)
 static void
 cb_visibility (char const *action, GtkWidget *orig_widget, WBCGtk *new_wbcg)
 {
-	set_visibility (new_wbcg, action, GTK_WIDGET_VISIBLE (orig_widget));
+	set_visibility (new_wbcg, action, gtk_widget_get_visible (orig_widget));
 }
 
 void
@@ -2568,7 +2568,7 @@ wbcg_get_label_for_position (WBCGtk *wbcg, GtkWidget *source,
 		GtkWidget *label = gnm_notebook_get_nth_label (wbcg->bnotebook, i);
 		int x0, x1;
 
-		if (!GTK_WIDGET_VISIBLE (label))
+		if (!gtk_widget_get_visible (label))
 			continue;
 
 		x0 = label->allocation.x;
@@ -4136,7 +4136,7 @@ cb_toolbar_box_visible (GtkWidget *box, G_GNUC_UNUSED GParamSpec *pspec,
 	GtkToggleAction *toggle_action = g_object_get_data (
 		G_OBJECT (box), "toggle_action");
 	char const *name = g_object_get_data (G_OBJECT (box), "name");
-	gboolean visible = GTK_WIDGET_VISIBLE (box);
+	gboolean visible = gtk_widget_get_visible (box);
 
 	gtk_toggle_action_set_active (toggle_action, visible);
 	if (!wbcg->is_fullscreen) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]