[gnumeric] dead kittens: handle gtk_layout_get_bin_window
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] dead kittens: handle gtk_layout_get_bin_window
- Date: Wed, 9 Jun 2010 15:48:11 +0000 (UTC)
commit 777daa318367daaa24ce668e81e56dcdfdb259f3
Author: Morten Welinder <terra gnome org>
Date: Wed Jun 9 11:47:46 2010 -0400
dead kittens: handle gtk_layout_get_bin_window
configure.in | 2 +-
src/dead-kittens.h | 4 ++++
src/gnm-pane.c | 6 ++++--
src/gui-util.c | 5 +++--
src/item-bar.c | 13 ++++++++-----
5 files changed, 20 insertions(+), 10 deletions(-)
---
diff --git a/configure.in b/configure.in
index df2e770..0745f04 100644
--- a/configure.in
+++ b/configure.in
@@ -689,7 +689,7 @@ LIBS="$GNUMERIC_LIBS $LIBS"
AC_CHECK_FUNCS(g_date_set_time_t g_slice_alloc g_option_context_set_delocalize)
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)
+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)
AC_CHECK_FUNCS(gsf_infile_msvba_steal_modules)
AC_MSG_CHECKING([for PANGO_WEIGHT_THIN etc.])
diff --git a/src/dead-kittens.h b/src/dead-kittens.h
index 4c65041..d2b1f7b 100644
--- a/src/dead-kittens.h
+++ b/src/dead-kittens.h
@@ -7,6 +7,10 @@
#define gtk_entry_get_text_length(x) g_utf8_strlen (gtk_entry_get_text (x), -1)
#endif
+#ifndef HAVE_GTK_LAYOUT_GET_BIN_WINDOW
+#define gtk_layout_get_bin_window(x) (x)->bin_window
+#endif
+
#ifndef HAVE_GTK_WIDGET_SET_VISIBLE
#define gtk_widget_set_visible(_w_,_v_) do { if (_v_) gtk_widget_show (_w_); else gtk_widget_hide (_w_); } while (0)
#endif
diff --git a/src/gnm-pane.c b/src/gnm-pane.c
index 3c38ccd..9ffb4cd 100644
--- a/src/gnm-pane.c
+++ b/src/gnm-pane.c
@@ -39,6 +39,7 @@
#include "item-edit.h"
#include "item-grid.h"
#include "gnumeric-gconf.h"
+#include "dead-kittens.h"
#include <gsf/gsf-impl-utils.h>
@@ -957,9 +958,10 @@ GSF_CLASS (GnmPane, gnm_pane,
GNM_SIMPLE_CANVAS_TYPE)
static void
-cb_gnm_pane_header_realized (GtkWidget *widget)
+cb_gnm_pane_header_realized (GtkLayout *layout)
{
- gdk_window_set_back_pixmap (GTK_LAYOUT (widget)->bin_window, NULL, FALSE);
+ GdkWindow *window = gtk_layout_get_bin_window (layout);
+ gdk_window_set_back_pixmap (window, NULL, FALSE);
}
static void
diff --git a/src/gui-util.c b/src/gui-util.c
index 8db4638..bcd655b 100644
--- a/src/gui-util.c
+++ b/src/gui-util.c
@@ -23,6 +23,7 @@
#include "workbook.h"
#include "libgnumeric.h"
#include "wbc-gtk.h"
+#include "dead-kittens.h"
#include "widgets/gnumeric-expr-entry.h"
#include <goffice/goffice.h>
@@ -1353,7 +1354,7 @@ void
gnm_canvas_get_position (GocCanvas *canvas, int *x, int *y, gint64 px, gint64 py)
{
GtkWidget *cw = GTK_WIDGET (canvas);
- GdkWindow *cbw = GTK_LAYOUT (cw)->bin_window;
+ GdkWindow *cbw = gtk_layout_get_bin_window (GTK_LAYOUT (cw));
int wx, wy;
int ox = 0, oy = 0;
@@ -1390,7 +1391,7 @@ gnm_canvas_get_screen_position (GocCanvas *canvas,
double x, double y,
int *ix, int *iy)
{
- GdkWindow *cbw = GTK_LAYOUT (canvas)->bin_window;
+ GdkWindow *cbw = gtk_layout_get_bin_window (GTK_LAYOUT (canvas));
int wx, wy;
gdk_window_get_origin (cbw, &wx, &wy);
diff --git a/src/item-bar.c b/src/item-bar.c
index f115f32..4c3777d 100644
--- a/src/item-bar.c
+++ b/src/item-bar.c
@@ -23,6 +23,7 @@
#include "gui-util.h"
#include "parse-util.h"
#include "commands.h"
+#include "dead-kittens.h"
#include <goffice/goffice.h>
#include <gsf/gsf-impl-utils.h>
@@ -286,7 +287,9 @@ ib_draw_cell (ItemBar const * const ib, cairo_t *cr,
/* The widget parameters could be NULL, but if so some themes would emit a warning.
* (Murrine is known to do this: http://bugzilla.gnome.org/show_bug.cgi?id=564410). */
- gtk_paint_shadow (widget->style, canvas->bin_window, GTK_STATE_NORMAL, shadow,
+ gtk_paint_shadow (widget->style,
+ gtk_layout_get_bin_window (canvas),
+ GTK_STATE_NORMAL, shadow,
NULL, widget, "GnmItemBarCell",
rect->x, rect->y, rect->width + 1, rect->height + 1);
@@ -444,7 +447,7 @@ item_bar_draw_region (GocItem const *item, cairo_t *cr, double x_0, double y_0,
else if (size < 6)
safety = 6 - size;
- gtk_paint_shadow (canvas->style, GTK_LAYOUT (canvas)->bin_window,
+ gtk_paint_shadow (canvas->style, gtk_layout_get_bin_window (GTK_LAYOUT (canvas)),
GTK_STATE_NORMAL,
prev_visible ? GTK_SHADOW_OUT : GTK_SHADOW_IN,
NULL, NULL, "GnmItemBarCell",
@@ -476,7 +479,7 @@ item_bar_draw_region (GocItem const *item, cairo_t *cr, double x_0, double y_0,
safety = 6 - size;
right = (rtl ? (total + pixels) : total) - size;
- gtk_paint_shadow (canvas->style, GTK_LAYOUT (canvas)->bin_window,
+ gtk_paint_shadow (canvas->style, gtk_layout_get_bin_window (GTK_LAYOUT (canvas)),
GTK_STATE_NORMAL,
prev_visible ? GTK_SHADOW_OUT : GTK_SHADOW_IN,
NULL, NULL, "GnmItemBarCell",
@@ -605,7 +608,7 @@ item_bar_draw_region (GocItem const *item, cairo_t *cr, double x_0, double y_0,
left = pos - dir * (.2 * inc - 2);
if (rtl)
left -= size;
- gtk_paint_shadow (canvas->style, GTK_LAYOUT (canvas)->bin_window,
+ gtk_paint_shadow (canvas->style, gtk_layout_get_bin_window (GTK_LAYOUT (canvas)),
GTK_STATE_NORMAL,
prev_visible ? GTK_SHADOW_OUT : GTK_SHADOW_IN,
NULL, NULL, "GnmItemBarCell",
@@ -639,7 +642,7 @@ item_bar_draw_region (GocItem const *item, cairo_t *cr, double x_0, double y_0,
if (rtl)
left -= size;
bottom = total - size;
- gtk_paint_shadow (canvas->style, GTK_LAYOUT (canvas)->bin_window,
+ gtk_paint_shadow (canvas->style, gtk_layout_get_bin_window (GTK_LAYOUT (canvas)),
GTK_STATE_NORMAL,
next->visible ? GTK_SHADOW_OUT : GTK_SHADOW_IN,
NULL, NULL, "GnmItemBarCell",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]