[Frugalware-git] gnometesting: gtk+3-engines-murrine-0.98.1.1-1-x86_64 *new package *murrine for gtk3
bouleetbil
bouleetbil at frogdev.info
Sat Mar 19 22:39:39 CET 2011
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=gnometesting.git;a=commitdiff;h=5992aa7374a0f811c66d78e629272cc27fb2a301
commit 5992aa7374a0f811c66d78e629272cc27fb2a301
Author: bouleetbil <bouleetbil at frogdev.info>
Date: Sat Mar 19 22:40:13 2011 +0100
gtk+3-engines-murrine-0.98.1.1-1-x86_64
*new package
*murrine for gtk3
diff --git a/source/gnome-extra/gtk+3-engines-murrine/Add-function-declarations-to-supporth-to-fix-warni.patch b/source/gnome-extra/gtk+3-engines-murrine/Add-function-declarations-to-supporth-to-fix-warni.patch
new file mode 100644
index 0000000..6c2fd8c
--- /dev/null
+++ b/source/gnome-extra/gtk+3-engines-murrine/Add-function-declarations-to-supporth-to-fix-warni.patch
@@ -0,0 +1,25 @@
+From 911a32047ddd0eddb7dec5b51b748f5e1291f81a Mon Sep 17 00:00:00 2001
+From: Vincent Untz <vuntz at gnome.org>
+Date: Mon, 8 Nov 2010 13:13:04 -0500
+Subject: [PATCH] Add function declarations to support.h to fix warnings
+
+https://bugzilla.gnome.org/show_bug.cgi?id=634348
+---
+ src/support.h | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/src/support.h b/src/support.h
+index e0c7d17..d9dea9d 100644
+--- a/src/support.h
++++ b/src/support.h
+@@ -119,6 +119,8 @@
+ #define MRN_WIDGET_HAS_DEFAULT(object) ((object) && MRN_IS_WIDGET(object) && GTK_WIDGET_HAS_DEFAULT(object))
+
+ G_GNUC_INTERNAL GtkTextDirection murrine_get_direction (GtkWidget *widget);
++G_GNUC_INTERNAL gboolean murrine_widget_is_ltr (GtkWidget *widget);
++G_GNUC_INTERNAL gboolean murrine_object_is_a (const GObject * object, const gchar * type_name);
+ G_GNUC_INTERNAL GtkWidget *murrine_special_get_ancestor (GtkWidget *widget, GType widget_type);
+ G_GNUC_INTERNAL GdkColor* murrine_get_parent_bgcolor (GtkWidget *widget);
+ G_GNUC_INTERNAL GtkWidget* murrine_get_parent_window (GtkWidget *widget);
+--
+1.7.3.1
\ No newline at end of file
diff --git a/source/gnome-extra/gtk+3-engines-murrine/FrugalBuild b/source/gnome-extra/gtk+3-engines-murrine/FrugalBuild
new file mode 100644
index 0000000..ab2c273
--- /dev/null
+++ b/source/gnome-extra/gtk+3-engines-murrine/FrugalBuild
@@ -0,0 +1,33 @@
+# Compiling Time: 0.04 SBU
+# Maintainer: Priyank Gosalia <priyankmg at gmail.com>
+
+pkgname=gtk+3-engines-murrine
+pkgver=0.98.1.1
+_F_gnome_name="murrine"
+Finclude gnome
+pkgrel=1
+pkgdesc="Murrine GTK3 Theme Engine"
+depends=('gtk+3')
+makedepends=('intltool')
+groups=('gnome-extra')
+archs=('i686' 'x86_64' 'ppc')
+source=($source gtk3-engine-murrine-git-branch.patch Remove-unneeded-argument-to-gscannerwarn.patch \
+ Add-function-declarations-to-supporth-to-fix-warni.patch Initialize-some-variables-to-remove-warnings.patch \
+ Remove-unused-static-functions.patch Use-MRNSHADOW-instead-of-GTKSHADOW.patch Help-compiler-find-out-that-a-variable-is-always-s.patch)
+sha1sums=('ffd6226b9941c01696497ec7c881551ea2f150c7' \
+ '4b5f01f3e7eb1313eccf824959461d0c6bac951e' \
+ '444dc49694e88f158951dcaa5ad2a351b14e5be7' \
+ 'd18b4dd38902b0f2a4e8b2c21f47bdd628f83981' \
+ 'eb2db9cb083b0f9e69e68617c4032555a866cd0f' \
+ '44fd3bf8c858b161f6dd577a18b40ab101ae45d2' \
+ '6a1f8f709cff5f475955e8d2488c6e10151e7b0a' \
+ '5fa0a2e4a1f9917fb686a547443033fecca07a86')
+
+build() {
+ Fcd $_F_gnome_name-$pkgver
+ Fpatchall
+ Fautoreconf
+ Fmake
+ Fmakeinstall
+}
+
diff --git a/source/gnome-extra/gtk+3-engines-murrine/Help-compiler-find-out-that-a-variable-is-always-s.patch b/source/gnome-extra/gtk+3-engines-murrine/Help-compiler-find-out-that-a-variable-is-always-s.patch
new file mode 100644
index 0000000..6b8765c
--- /dev/null
+++ b/source/gnome-extra/gtk+3-engines-murrine/Help-compiler-find-out-that-a-variable-is-always-s.patch
@@ -0,0 +1,25 @@
+From 12fc4543a3362f045eaf875474cd442024d35631 Mon Sep 17 00:00:00 2001
+From: Vincent Untz <vuntz at gnome.org>
+Date: Mon, 8 Nov 2010 13:45:17 -0500
+Subject: [PATCH] Help compiler find out that a variable is always set
+
+https://bugzilla.gnome.org/show_bug.cgi?id=634348
+---
+ src/cairo-support.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/cairo-support.c b/src/cairo-support.c
+index 2a3592c..c09572d 100644
+--- a/src/cairo-support.c
++++ b/src/cairo-support.c
+@@ -85,7 +85,7 @@ murrine_rgb_to_hls (gdouble *r,
+ h = (green-blue)/delta;
+ else if (green == max)
+ h = 2+(blue-red)/delta;
+- else if (blue == max)
++ else /* ie: if (blue == max) */
+ h = 4+(red-green)/delta;
+
+ h *= 60;
+--
+1.7.3.1
\ No newline at end of file
diff --git a/source/gnome-extra/gtk+3-engines-murrine/Initialize-some-variables-to-remove-warnings.patch b/source/gnome-extra/gtk+3-engines-murrine/Initialize-some-variables-to-remove-warnings.patch
new file mode 100644
index 0000000..088dd1a
--- /dev/null
+++ b/source/gnome-extra/gtk+3-engines-murrine/Initialize-some-variables-to-remove-warnings.patch
@@ -0,0 +1,61 @@
+From 822299634f8df37039b6661d57e6a766b201f641 Mon Sep 17 00:00:00 2001
+From: Vincent Untz <vuntz at gnome.org>
+Date: Mon, 8 Nov 2010 13:38:07 -0500
+Subject: [PATCH] Initialize some variables to remove warnings
+
+https://bugzilla.gnome.org/show_bug.cgi?id=634348
+---
+ src/murrine_draw.c | 6 +++---
+ src/murrine_draw_rgba.c | 6 +++---
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/src/murrine_draw.c b/src/murrine_draw.c
+index 605b0b2..184aa69 100644
+--- a/src/murrine_draw.c
++++ b/src/murrine_draw.c
+@@ -1261,8 +1261,8 @@ murrine_draw_frame (cairo_t *cr,
+ int x, int y, int width, int height)
+ {
+ MurrineRGB *border = frame->border;
+- MurrineRectangle bevel_clip;
+- MurrineRectangle frame_clip;
++ MurrineRectangle bevel_clip = { 0, 0, 0, 0 };
++ MurrineRectangle frame_clip = { 0, 0, 0, 0 };
+ const MurrineRGB *dark = &colors->shade[3];
+ MurrineRGB highlight, shadow_color;
+
+@@ -1348,7 +1348,7 @@ murrine_draw_tab (cairo_t *cr,
+ {
+ const MurrineRGB *fill = &colors->bg[widget->state_type];
+ const MurrineRGB *border = &colors->shade[!widget->active ? 5 : 4];
+- cairo_pattern_t *pat;
++ cairo_pattern_t *pat = NULL;
+
+ /* Set clip */
+ cairo_rectangle (cr, x, y, width, height);
+diff --git a/src/murrine_draw_rgba.c b/src/murrine_draw_rgba.c
+index eaf8fe0..5743b2c 100644
+--- a/src/murrine_draw_rgba.c
++++ b/src/murrine_draw_rgba.c
+@@ -1043,8 +1043,8 @@ murrine_rgba_draw_frame (cairo_t *cr,
+ int x, int y, int width, int height)
+ {
+ MurrineRGB *border = frame->border;
+- MurrineRectangle bevel_clip;
+- MurrineRectangle frame_clip;
++ MurrineRectangle bevel_clip = { 0, 0, 0, 0 };
++ MurrineRectangle frame_clip = { 0, 0, 0, 0 };
+ const MurrineRGB *dark = &colors->shade[5];
+ MurrineRGB highlight, shadow_color;
+
+@@ -1130,7 +1130,7 @@ murrine_rgba_draw_tab (cairo_t *cr,
+ {
+ const MurrineRGB *fill = &colors->bg[widget->state_type];
+ const MurrineRGB *border = &colors->shade[!widget->active ? 5 : 4];
+- cairo_pattern_t *pat;
++ cairo_pattern_t *pat = NULL;
+
+ /* Set clip */
+ cairo_rectangle (cr, x, y, width, height);
+--
+1.7.3.1
\ No newline at end of file
diff --git a/source/gnome-extra/gtk+3-engines-murrine/Remove-unneeded-argument-to-gscannerwarn.patch b/source/gnome-extra/gtk+3-engines-murrine/Remove-unneeded-argument-to-gscannerwarn.patch
new file mode 100644
index 0000000..fdc3e3c
--- /dev/null
+++ b/source/gnome-extra/gtk+3-engines-murrine/Remove-unneeded-argument-to-gscannerwarn.patch
@@ -0,0 +1,41 @@
+From 8d209cb6f2ca62e2e7ef53cfbad6c5cecbef7738 Mon Sep 17 00:00:00 2001
+From: Vincent Untz <vuntz at gnome.org>
+Date: Mon, 8 Nov 2010 13:06:43 -0500
+Subject: [PATCH] Remove unneeded argument to g_scanner_warn()
+
+This causes a warning.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=634348
+---
+ src/murrine_rc_style.c | 6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/murrine_rc_style.c b/src/murrine_rc_style.c
+index 96786d4..36bed89 100644
+--- a/src/murrine_rc_style.c
++++ b/src/murrine_rc_style.c
+@@ -803,19 +803,19 @@ murrine_rc_style_parse (GtkRcStyle *rc_style,
+ token = murrine_gtk2_rc_parse_dummy (settings, scanner, "gradients");
+ break;
+ case TOKEN_HILIGHT_RATIO:
+- g_scanner_warn (scanner, "Murrine configuration option \"hilight_ratio\" will be deprecated in future releases. Please use \"highlight_shade\" instead.", "hilight_ratio");
++ g_scanner_warn (scanner, "Murrine configuration option \"hilight_ratio\" will be deprecated in future releases. Please use \"highlight_shade\" instead.");
+ double hilight_ratio;
+ token = theme_parse_shade (settings, scanner, &hilight_ratio);
+ murrine_style->highlight_shade = hilight_ratio/0.909090;
+ murrine_style->flags |= MRN_FLAG_HIGHLIGHT_SHADE;
+ break;
+ case TOKEN_HIGHLIGHT_RATIO:
+- g_scanner_warn (scanner, "Murrine configuration option \"highlight_ratio\" will be deprecated in future releases. Please use \"highlight_shade\" instead.", "highlight_ratio");
++ g_scanner_warn (scanner, "Murrine configuration option \"highlight_ratio\" will be deprecated in future releases. Please use \"highlight_shade\" instead.");
+ token = theme_parse_shade (settings, scanner, &murrine_style->highlight_shade);
+ murrine_style->flags |= MRN_FLAG_HIGHLIGHT_SHADE;
+ break;
+ case TOKEN_LIGHTBORDER_RATIO:
+- g_scanner_warn (scanner, "Murrine configuration option \"lightborder_ratio\" will be deprecated in future releases. Please use \"lightborder_shade\" instead.", "lightborder_ratio");
++ g_scanner_warn (scanner, "Murrine configuration option \"lightborder_ratio\" will be deprecated in future releases. Please use \"lightborder_shade\" instead.");
+ token = theme_parse_shade (settings, scanner, &murrine_style->lightborder_shade);
+ murrine_style->flags |= MRN_FLAG_LIGHTBORDER_SHADE;
+ break;
+--
+1.7.3.1
\ No newline at end of file
diff --git a/source/gnome-extra/gtk+3-engines-murrine/Remove-unused-static-functions.patch b/source/gnome-extra/gtk+3-engines-murrine/Remove-unused-static-functions.patch
new file mode 100644
index 0000000..060ea1a
--- /dev/null
+++ b/source/gnome-extra/gtk+3-engines-murrine/Remove-unused-static-functions.patch
@@ -0,0 +1,60 @@
+From 662a5a1f89cecc1b2aaf284d693d28ab73113f73 Mon Sep 17 00:00:00 2001
+From: Vincent Untz <vuntz at gnome.org>
+Date: Mon, 8 Nov 2010 13:40:23 -0500
+Subject: [PATCH] Remove unused static functions
+
+https://bugzilla.gnome.org/show_bug.cgi?id=634348
+---
+ src/murrine_draw.c | 10 ----------
+ src/murrine_style.c | 15 ---------------
+ 2 files changed, 0 insertions(+), 25 deletions(-)
+
+diff --git a/src/murrine_draw.c b/src/murrine_draw.c
+index 184aa69..5c211b4 100644
+--- a/src/murrine_draw.c
++++ b/src/murrine_draw.c
+@@ -3373,16 +3373,6 @@ murrine_draw_focus_classic (cairo_t *cr,
+ }
+
+ static void
+-murrine_draw_tab_focus (cairo_t *cr,
+- const MurrineColors *colors,
+- const WidgetParameters *widget,
+- const FocusParameters *focus,
+- int x, int y, int width, int height)
+-{
+-
+-}
+-
+-static void
+ murrine_draw_focus_border (cairo_t *cr,
+ const MurrineColors *colors,
+ const WidgetParameters *widget,
+diff --git a/src/murrine_style.c b/src/murrine_style.c
+index 8e3bfff..edcd6be 100644
+--- a/src/murrine_style.c
++++ b/src/murrine_style.c
+@@ -2376,21 +2376,6 @@ murrine_style_realize (GtkStyle *style)
+ }
+
+ static void
+-gdk_cairo_set_source_color_alpha (cairo_t *cr,
+- GdkColor *color,
+- float alpha)
+-{
+- g_return_if_fail (cr != NULL);
+- g_return_if_fail (color != NULL);
+-
+- cairo_set_source_rgba (cr,
+- color->red/65535.,
+- color->green/65535.,
+- color->blue/65535.,
+- alpha);
+-}
+-
+-static void
+ murrine_style_copy (GtkStyle *style, GtkStyle *src)
+ {
+ MurrineStyle *mrn_style = MURRINE_STYLE (style);
+--
+1.7.3.1
\ No newline at end of file
diff --git a/source/gnome-extra/gtk+3-engines-murrine/Use-MRNSHADOW-instead-of-GTKSHADOW.patch b/source/gnome-extra/gtk+3-engines-murrine/Use-MRNSHADOW-instead-of-GTKSHADOW.patch
new file mode 100644
index 0000000..4c14c3d
--- /dev/null
+++ b/source/gnome-extra/gtk+3-engines-murrine/Use-MRNSHADOW-instead-of-GTKSHADOW.patch
@@ -0,0 +1,87 @@
+From 036cfe4c599b53c438128089f26f5ca54d4350e1 Mon Sep 17 00:00:00 2001
+From: Vincent Untz <vuntz at gnome.org>
+Date: Mon, 8 Nov 2010 13:42:26 -0500
+Subject: [PATCH] Use MRN_SHADOW_* instead of GTK_SHADOW_*
+
+This is needed to avoid warnings when comparing of MurrineShadowType.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=634348
+---
+ src/murrine_draw.c | 8 ++++----
+ src/murrine_draw_rgba.c | 8 ++++----
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/src/murrine_draw.c b/src/murrine_draw.c
+index 5c211b4..318511b 100644
+--- a/src/murrine_draw.c
++++ b/src/murrine_draw.c
+@@ -2775,13 +2775,13 @@ murrine_draw_radiobutton (cairo_t *cr,
+ const MurrineRGB *bg = &colors->base[0];
+ gboolean inconsistent = FALSE;
+ gboolean draw_box = !checkbox->in_menu;
+- gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN);
++ gboolean draw_bullet = (checkbox->shadow_type == MRN_SHADOW_IN);
+ int roundness = width+height;
+ double highlight_shade_new = widget->highlight_shade;
+ double lightborder_shade_new = widget->lightborder_shade;
+ MurrineGradients mrn_gradient_new = widget->mrn_gradient;
+
+- inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN);
++ inconsistent = (checkbox->shadow_type == MRN_SHADOW_ETCHED_IN);
+ draw_bullet |= inconsistent;
+
+ if (widget->state_type == GTK_STATE_INSENSITIVE)
+@@ -2919,13 +2919,13 @@ murrine_draw_checkbox (cairo_t *cr,
+ const MurrineRGB *bg = &colors->base[0];
+ gboolean inconsistent = FALSE;
+ gboolean draw_box = !checkbox->in_menu;
+- gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN);
++ gboolean draw_bullet = (checkbox->shadow_type == MRN_SHADOW_IN);
+ int roundness = CLAMP (widget->roundness, 0, 2);
+ double highlight_shade_new = widget->highlight_shade;
+ double lightborder_shade_new = widget->lightborder_shade;
+ MurrineGradients mrn_gradient_new = widget->mrn_gradient;
+
+- inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN);
++ inconsistent = (checkbox->shadow_type == MRN_SHADOW_ETCHED_IN);
+ draw_bullet |= inconsistent;
+
+ if (widget->state_type == GTK_STATE_INSENSITIVE)
+diff --git a/src/murrine_draw_rgba.c b/src/murrine_draw_rgba.c
+index 5743b2c..05cb5ea 100644
+--- a/src/murrine_draw_rgba.c
++++ b/src/murrine_draw_rgba.c
+@@ -1821,13 +1821,13 @@ murrine_rgba_draw_radiobutton (cairo_t *cr,
+ const MurrineRGB *bg = &colors->base[0];
+ gboolean inconsistent = FALSE;
+ gboolean draw_box = !checkbox->in_menu;
+- gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN);
++ gboolean draw_bullet = (checkbox->shadow_type == MRN_SHADOW_IN);
+ int roundness = width+height;
+ double highlight_shade_new = widget->highlight_shade;
+ double lightborder_shade_new = widget->lightborder_shade;
+ MurrineGradients mrn_gradient_new = widget->mrn_gradient;
+
+- inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN);
++ inconsistent = (checkbox->shadow_type == MRN_SHADOW_ETCHED_IN);
+ draw_bullet |= inconsistent;
+
+ if (widget->state_type == GTK_STATE_INSENSITIVE)
+@@ -1967,13 +1967,13 @@ murrine_rgba_draw_checkbox (cairo_t *cr,
+ const MurrineRGB *bg = &colors->base[0];
+ gboolean inconsistent = FALSE;
+ gboolean draw_box = !checkbox->in_menu;
+- gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN);
++ gboolean draw_bullet = (checkbox->shadow_type == MRN_SHADOW_IN);
+ int roundness = CLAMP (widget->roundness, 0, 2);
+ double highlight_shade_new = widget->highlight_shade;
+ double lightborder_shade_new = widget->lightborder_shade;
+ MurrineGradients mrn_gradient_new = widget->mrn_gradient;
+
+- inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN);
++ inconsistent = (checkbox->shadow_type == MRN_SHADOW_ETCHED_IN);
+ draw_bullet |= inconsistent;
+
+ if (widget->state_type == GTK_STATE_INSENSITIVE)
+--
+1.7.3.1
\ No newline at end of file
diff --git a/source/gnome-extra/gtk+3-engines-murrine/gtk3-engine-murrine-git-branch.patch b/source/gnome-extra/gtk+3-engines-murrine/gtk3-engine-murrine-git-branch.patch
new file mode 100644
index 0000000..4138836
--- /dev/null
+++ b/source/gnome-extra/gtk+3-engines-murrine/gtk3-engine-murrine-git-branch.patch
@@ -0,0 +1,2461 @@
+diff --git a/Makefile.am b/Makefile.am
+index 131ca9f..5f02bf4 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -3,7 +3,7 @@ INCLUDES = $(GTK_CFLAGS)
+ SUBDIRS = schema
+ DIST_SUBDIRS = $(SUBDIRS) po
+
+-enginedir = $(libdir)/gtk-2.0/$(GTK_VERSION)/engines
++enginedir = $(libdir)/gtk-3.0/$(GTK_VERSION)/engines
+ engine_LTLIBRARIES = libmurrine.la
+
+ EXTRA_DIST = ./src/config.h.in \
+diff --git a/configure.ac b/configure.ac
+index 832edec..a69e244 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -39,15 +39,15 @@ AC_ARG_ENABLE(rgba,
+ [rgba=$enableval],
+ [rgba="yes"], )
+
+-PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.18.0,,
+- AC_MSG_ERROR([GTK+-2.18 is required to compile murrine]))
++PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 2.91.0,,
++ AC_MSG_ERROR([GTK+-3.0 is required to compile murrine]))
+
+ PKG_CHECK_MODULES(pixman,[pixman-1],,AC_MSG_ERROR([Pixman is required to compile murrine]))
+
+ AC_SUBST(GTK_CFLAGS)
+ AC_SUBST(GTK_LIBS)
+
+-GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
++GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-3.0`
+ AC_SUBST(GTK_VERSION)
+
+ AC_SUBST(BUILD_ENGINES)
+diff --git a/schema/Makefile.am b/schema/Makefile.am
+index d16a3ec..64cb9f5 100644
+--- a/schema/Makefile.am
++++ b/schema/Makefile.am
+@@ -1,4 +1,4 @@
+-xmldir = $(datadir)/gtk-engines
++xmldir = $(datadir)/gtk-engines/3.0
+
+ xml_DATA = murrine.xml
+ xml_in_files = $(xml_DATA:.xml=.xml.in)
+diff --git a/src/cairo-support.c b/src/cairo-support.c
+index 5ba17d3..2a3592c 100644
+--- a/src/cairo-support.c
++++ b/src/cairo-support.c
+@@ -263,24 +263,41 @@ murrine_gdk_color_to_rgb (GdkColor *c, double *r, double *g, double *b)
+ }
+
+ void
++murrine_gdk_color_to_murrinergb (const GdkColor *c, MurrineRGB *cc)
++{
++ gdouble r, g, b;
++
++ g_return_if_fail (c && cc);
++
++ r = c->red / 65535.0;
++ g = c->green / 65535.0;
++ b = c->blue / 65535.0;
++
++ cc->r = r;
++ cc->g = g;
++ cc->b = b;
++}
++
++void
+ murrine_get_parent_bg (const GtkWidget *widget, MurrineRGB *color)
+ {
+ GtkStateType state_type;
+ const GtkWidget *parent;
+ GdkColor *gcolor;
+ gboolean stop;
++ GtkStyle *style;
+
+ if (widget == NULL)
+ return;
+
+- parent = widget->parent;
++ parent = gtk_widget_get_parent ((GtkWidget *) widget);
+ stop = FALSE;
+
+ while (parent && !stop)
+ {
+ stop = FALSE;
+
+- stop |= !GTK_WIDGET_NO_WINDOW (parent);
++ stop |= !gtk_widget_get_has_window ((GtkWidget *) parent);
+ stop |= GTK_IS_NOTEBOOK (parent) &&
+ gtk_notebook_get_show_tabs (GTK_NOTEBOOK (parent)) &&
+ gtk_notebook_get_show_border (GTK_NOTEBOOK (parent));
+@@ -294,20 +311,53 @@ murrine_get_parent_bg (const GtkWidget *widget, MurrineRGB *color)
+ }
+
+ if (!stop)
+- parent = parent->parent;
++ parent = gtk_widget_get_parent ((GtkWidget *) parent);
+ }
+
+ if (parent == NULL)
+ return;
+
+- state_type = GTK_WIDGET_STATE (parent);
++ state_type = gtk_widget_get_state ((GtkWidget *) parent);
+
+- gcolor = &parent->style->bg[state_type];
++ style = gtk_widget_get_style ((GtkWidget *) parent);
++ gcolor = &style->bg[state_type];
+
+ murrine_gdk_color_to_rgb (gcolor, &color->r, &color->g, &color->b);
+ }
+
+ void
++murrine_transform_for_layout (cairo_t *cr,
++ PangoLayout *layout,
++ int x,
++ int y)
++{
++ const PangoMatrix *matrix;
++
++ matrix = pango_context_get_matrix (pango_layout_get_context (layout));
++ if (matrix)
++ {
++ cairo_matrix_t cairo_matrix;
++ PangoRectangle rect;
++
++ cairo_matrix_init (&cairo_matrix,
++ matrix->xx, matrix->yx,
++ matrix->xy, matrix->yy,
++ matrix->x0, matrix->y0);
++
++ pango_layout_get_extents (layout, NULL, &rect);
++ pango_matrix_transform_rectangle (matrix, &rect);
++ pango_extents_to_pixels (&rect, NULL);
++
++ cairo_matrix.x0 += x - rect.x;
++ cairo_matrix.y0 += y - rect.y;
++
++ cairo_set_matrix (cr, &cairo_matrix);
++ }
++ else
++ cairo_translate (cr, x, y);
++}
++
++void
+ murrine_set_color_rgb (cairo_t *cr, const MurrineRGB *color)
+ {
+ g_return_if_fail (cr && color);
+diff --git a/src/cairo-support.h b/src/cairo-support.h
+index cb9082f..c9f81a3 100644
+--- a/src/cairo-support.h
++++ b/src/cairo-support.h
+@@ -33,9 +33,13 @@ G_GNUC_INTERNAL void murrine_mix_color (const MurrineRGB *color1, const MurrineR
+ G_GNUC_INTERNAL void murrine_gdk_color_to_rgb (GdkColor *c,
+ double *r, double *g, double *b);
+
++G_GNUC_INTERNAL void murrine_gdk_color_to_murrinergb (const GdkColor * gc, MurrineRGB *cc);
++
+ G_GNUC_INTERNAL void murrine_get_parent_bg (const GtkWidget *widget,
+ MurrineRGB *color);
+
++G_GNUC_INTERNAL void murrine_transform_for_layout (cairo_t *cr, PangoLayout *layout, int x, int y);
++
+ G_GNUC_INTERNAL void murrine_set_color_rgb (cairo_t *cr,
+ const MurrineRGB *color);
+
+diff --git a/src/murrine_draw.c b/src/murrine_draw.c
+index eb7f92d..01e1beb 100644
+--- a/src/murrine_draw.c
++++ b/src/murrine_draw.c
+@@ -719,8 +719,8 @@ murrine_draw_slider_handle (cairo_t *cr,
+
+ if (!horizontal)
+ {
+- rotate_mirror_translate (cr, M_PI/2, x, y, FALSE, FALSE);
+- int tmp = height; height = width; width = tmp;
++ murrine_exchange_axis (cr, &x, &y, &width, &height);
++ cairo_translate (cr, x, y);
+ }
+
+ if (width % 2 != 0)
+@@ -865,21 +865,24 @@ murrine_draw_progressbar_fill (cairo_t *cr,
+ /* progressbar->orientation < 2 == boolean is_horizontal */
+ if (progressbar->orientation < 2)
+ {
+- if (progressbar->orientation == MRN_ORIENTATION_LEFT_TO_RIGHT)
+- rotate_mirror_translate (cr, 0, x, y, FALSE, FALSE);
+- else
+- rotate_mirror_translate (cr, 0, x+width, y, TRUE, FALSE);
++ cairo_translate (cr, x, y);
++/* if (progressbar->orientation == MRN_ORIENTATION_LEFT_TO_RIGHT)*/
++/* rotate_mirror_translate (cr, 0, x, y, FALSE, FALSE);*/
++/* else*/
++/* rotate_mirror_translate (cr, 0, x+width, y, TRUE, FALSE);*/
+ }
+ else
+ {
+- int tmp = height; height = width; width = tmp;
++/* int tmp = height; height = width; width = tmp;*/
+
+- x = x+1; y = y-1; width = width+2; height = height-2;
++ x = x+1; y = y-1; width = width-2; height = height+2;
+
+- if (progressbar->orientation == MRN_ORIENTATION_TOP_TO_BOTTOM)
+- rotate_mirror_translate (cr, M_PI/2, x, y, FALSE, FALSE);
+- else
+- rotate_mirror_translate (cr, M_PI/2, x, y+width, TRUE, FALSE);
++ murrine_exchange_axis (cr, &x, &y, &width, &height);
++
++/* if (progressbar->orientation == MRN_ORIENTATION_TOP_TO_BOTTOM)*/
++/* rotate_mirror_translate (cr, M_PI/2, x, y, FALSE, FALSE);*/
++/* else*/
++/* rotate_mirror_translate (cr, M_PI/2, x, y+width, TRUE, FALSE);*/
+ }
+
+ roundness = MIN (widget->roundness-widget->xthickness, height/2.0);
+@@ -1048,34 +1051,6 @@ murrine_draw_combobox (cairo_t *cr,
+ }
+
+ static void
+-murrine_draw_optionmenu (cairo_t *cr,
+- const MurrineColors *colors,
+- const WidgetParameters *widget,
+- const OptionMenuParameters *optionmenu,
+- int x, int y, int width, int height)
+-{
+- ButtonParameters button;
+- button.has_default_button_color = FALSE;
+- int offset = widget->ythickness + 1;
+-
+- boolean horizontal = TRUE;
+- if (((float)width/height<0.5) || (widget->glazestyle > 0 && width<height))
+- horizontal = FALSE;
+-
+- widget->style_functions->draw_button (cr, colors, widget, &button, x, y, width, height, horizontal);
+-
+- /* Draw the separator */
+- MurrineRGB *dark = (MurrineRGB*)&colors->shade[6];
+-
+- cairo_translate (cr, optionmenu->linepos+0.5, 1);
+-
+- murrine_set_color_rgba (cr, dark, 0.4);
+- cairo_move_to (cr, 0.0, offset);
+- cairo_line_to (cr, 0.0, height - offset - widget->ythickness + 1);
+- cairo_stroke (cr);
+-}
+-
+-static void
+ murrine_draw_menubar (cairo_t *cr,
+ const MurrineColors *colors,
+ const WidgetParameters *widget,
+@@ -1901,10 +1876,11 @@ murrine_draw_scrollbar_trough (cairo_t *cr,
+ }
+ else
+ {
+- int tmp = height;
+- rotate_mirror_translate (cr, M_PI/2, x, y, FALSE, FALSE);
+- height = width;
+- width = tmp;
++/* int tmp = height;*/
++/* rotate_mirror_translate (cr, M_PI/2, x, y, FALSE, FALSE);*/
++/* height = width;*/
++/* width = tmp;*/
++ murrine_exchange_axis (cr, &x, &y, &width, &height);
+ }
+
+ /* Draw fill */
+@@ -1924,20 +1900,24 @@ murrine_draw_scrollbar_trough (cairo_t *cr,
+ murrine_rounded_rectangle_closed (cr, 0.5, 0.5, width-1, height-1, widget->roundness, widget->corners);
+ cairo_clip (cr);
+
+- corners = MRN_CORNER_BOTTOMLEFT | MRN_CORNER_BOTTOMRIGHT;
+- murrine_rounded_rectangle_inverted (cr, 0.5, 0.5, width-1, scrollbar->steppersize, widget->roundness, corners);
+- murrine_set_color_rgb (cr, &fill_stepper);
+- cairo_fill_preserve (cr);
+- murrine_draw_trough_border_from_path (cr, &border,0.5, 0.5, width-1, scrollbar->steppersize, widget->mrn_gradient, 1.0, FALSE);
+-
+- corners = MRN_CORNER_TOPLEFT | MRN_CORNER_TOPRIGHT;
+- murrine_rounded_rectangle_inverted (cr, 0.5, height-scrollbar->steppersize-0.5, width-1, scrollbar->steppersize, widget->roundness, corners);
+- murrine_set_color_rgb (cr, &fill_stepper);
+- cairo_fill_preserve (cr);
+- murrine_draw_trough_border_from_path (cr, &border, 0.5, height-scrollbar->steppersize-0.5, width-1, scrollbar->steppersize, widget->mrn_gradient, 1.0, FALSE);
+-
+- cairo_restore (cr);
++ if (!scrollbar->trough_upper)
++ {
++ corners = MRN_CORNER_BOTTOMLEFT | MRN_CORNER_BOTTOMRIGHT;
++ murrine_rounded_rectangle_inverted (cr, 0.5, 0.5, width-1, scrollbar->steppersize, widget->roundness, corners);
++ murrine_set_color_rgb (cr, &fill_stepper);
++ cairo_fill_preserve (cr);
++ murrine_draw_trough_border_from_path (cr, &border,0.5, 0.5, width-1, scrollbar->steppersize, widget->mrn_gradient, 1.0, FALSE);
++ }
++ else
++ {
++ corners = MRN_CORNER_TOPLEFT | MRN_CORNER_TOPRIGHT;
++ murrine_rounded_rectangle_inverted (cr, 0.5, height-scrollbar->steppersize-0.5, width-1, scrollbar->steppersize, widget->roundness, corners);
++ murrine_set_color_rgb (cr, &fill_stepper);
++ cairo_fill_preserve (cr);
++ murrine_draw_trough_border_from_path (cr, &border, 0.5, height-scrollbar->steppersize-0.5, width-1, scrollbar->steppersize, widget->mrn_gradient, 1.0, FALSE);
+ }
++ cairo_restore (cr);
++ }
+
+ /* Draw border */
+ if (!scrollbar->within_bevel)
+@@ -2068,12 +2048,7 @@ murrine_draw_scrollbar_slider (cairo_t *cr,
+ if (scrollbar->horizontal)
+ cairo_translate (cr, x, y);
+ else
+- {
+- int tmp = height;
+- rotate_mirror_translate (cr, M_PI/2, x, y, FALSE, FALSE);
+- height = width;
+- width = tmp;
+- }
++ murrine_exchange_axis (cr, &x, &y, &width, &height);
+
+ cairo_save (cr);
+
+@@ -2485,10 +2460,11 @@ murrine_draw_handle (cairo_t *cr,
+
+ if (handle->horizontal)
+ {
+- int tmp = height;
+- rotate_mirror_translate (cr, M_PI/2, x+0.5+width/2-bar_height/2, y+height/2-bar_width/2, FALSE, FALSE);
+- height = width;
+- width = tmp;
++/* int tmp = height;*/
++/* rotate_mirror_translate (cr, M_PI/2, x+0.5+width/2-bar_height/2, y+height/2-bar_width/2, FALSE, FALSE);*/
++/* height = width;*/
++/* width = tmp;*/
++ murrine_exchange_axis (cr, &x, &y, &width, &height);
+ }
+ else
+ {
+@@ -2778,12 +2754,12 @@ murrine_draw_arrow (cairo_t *cr,
+
+ if (widget->disabled)
+ {
++ cairo_save (cr);
+ _murrine_draw_arrow (cr, &colors->shade[0], arrow,
+ tx+0.5, ty+0.5, width, height);
++ cairo_restore (cr);
+ }
+
+- cairo_identity_matrix (cr);
+-
+ _murrine_draw_arrow (cr, &color, arrow,
+ tx, ty, width, height);
+ }
+@@ -3666,7 +3642,6 @@ murrine_register_style_murrine (MurrineStyleFunctions *functions)
+ functions->draw_slider_handle = murrine_draw_slider_handle;
+ functions->draw_spinbutton = murrine_draw_spinbutton;
+ functions->draw_spinbutton_down = murrine_draw_spinbutton_down;
+- functions->draw_optionmenu = murrine_draw_optionmenu;
+ functions->draw_combo_separator = murrine_draw_combo_separator;
+ functions->draw_menubar = murrine_draw_menubar;
+ functions->draw_tab = murrine_draw_tab;
+diff --git a/src/murrine_draw_rgba.c b/src/murrine_draw_rgba.c
+index 4a6df60..539e965 100644
+--- a/src/murrine_draw_rgba.c
++++ b/src/murrine_draw_rgba.c
+@@ -693,21 +693,24 @@ murrine_rgba_draw_progressbar_fill (cairo_t *cr,
+ /* progressbar->orientation < 2 == boolean is_horizontal */
+ if (progressbar->orientation < 2)
+ {
+- if (progressbar->orientation == MRN_ORIENTATION_LEFT_TO_RIGHT)
+- rotate_mirror_translate (cr, 0, x, y, FALSE, FALSE);
+- else
+- rotate_mirror_translate (cr, 0, x+width, y, TRUE, FALSE);
++ cairo_translate (cr, x, y);
++/* if (progressbar->orientation == MRN_ORIENTATION_LEFT_TO_RIGHT)*/
++/* rotate_mirror_translate (cr, 0, x, y, FALSE, FALSE);*/
++/* else*/
++/* rotate_mirror_translate (cr, 0, x+width, y, TRUE, FALSE);*/
+ }
+ else
+ {
+- int tmp = height; height = width; width = tmp;
++/* int tmp = height; height = width; width = tmp;*/
+
+- x = x+1; y = y-1; width = width+2; height = height-2;
++ x = x+1; y = y-1; width = width-2; height = height+2;
+
+- if (progressbar->orientation == MRN_ORIENTATION_TOP_TO_BOTTOM)
+- rotate_mirror_translate (cr, M_PI/2, x, y, FALSE, FALSE);
+- else
+- rotate_mirror_translate (cr, M_PI/2, x, y+width, TRUE, FALSE);
++ murrine_exchange_axis (cr, &x, &y, &width, &height);
++
++/* if (progressbar->orientation == MRN_ORIENTATION_TOP_TO_BOTTOM)*/
++/* rotate_mirror_translate (cr, M_PI/2, x, y, FALSE, FALSE);*/
++/* else*/
++/* rotate_mirror_translate (cr, M_PI/2, x, y+width, TRUE, FALSE);*/
+ }
+
+ roundness = MIN (widget->roundness-widget->xthickness, height/2.0);
+@@ -1340,10 +1343,11 @@ murrine_rgba_draw_scrollbar_trough (cairo_t *cr,
+ }
+ else
+ {
+- int tmp = height;
+- rotate_mirror_translate (cr, M_PI/2, x, y, FALSE, FALSE);
+- height = width;
+- width = tmp;
++/* int tmp = height;*/
++/* rotate_mirror_translate (cr, M_PI/2, x, y, FALSE, FALSE);*/
++/* height = width;*/
++/* width = tmp;*/
++ murrine_exchange_axis (cr, &x, &y, &width, &height);
+ }
+
+ /* Draw fill */
+@@ -1510,10 +1514,11 @@ murrine_rgba_draw_scrollbar_slider (cairo_t *cr,
+ cairo_translate (cr, x, y);
+ else
+ {
+- int tmp = height;
+- rotate_mirror_translate (cr, M_PI/2, x, y, FALSE, FALSE);
+- height = width;
+- width = tmp;
++/* int tmp = height;*/
++/* rotate_mirror_translate (cr, M_PI/2, x, y, FALSE, FALSE);*/
++/* height = width;*/
++/* width = tmp;*/
++ murrine_exchange_axis (cr, &x, &y, &width, &height);
+ }
+
+ cairo_save (cr);
+@@ -1736,10 +1741,11 @@ murrine_rgba_draw_handle (cairo_t *cr,
+
+ if (handle->horizontal)
+ {
+- int tmp = height;
+- rotate_mirror_translate (cr, M_PI/2, x+0.5+width/2-bar_height/2, y+height/2-bar_width/2, FALSE, FALSE);
+- height = width;
+- width = tmp;
++/* int tmp = height;*/
++/* rotate_mirror_translate (cr, M_PI/2, x+0.5+width/2-bar_height/2, y+height/2-bar_width/2, FALSE, FALSE);*/
++/* height = width;*/
++/* width = tmp;*/
++ murrine_exchange_axis (cr, &x, &y, &width, &height);
+ }
+ else
+ {
+diff --git a/src/murrine_rc_style.h b/src/murrine_rc_style.h
+index 8e3d7a8..79f9a99 100644
+--- a/src/murrine_rc_style.h
++++ b/src/murrine_rc_style.h
+@@ -18,7 +18,7 @@
+ *
+ */
+
+-#include <gtk/gtkrc.h>
++#include <gtk/gtk.h>
+
+ #ifndef MURRINE_RC_STYLE_H
+ #define MURRINE_RC_STYLE_H
+@@ -153,6 +153,7 @@ struct _MurrineRcStyleClass
+ GtkRcStyleClass parent_class;
+ };
+
+-GType murrine_rc_style_get_type (void);
++G_GNUC_INTERNAL void murrine_rc_style_register_types (GTypeModule *module);
++G_GNUC_INTERNAL GType murrine_rc_style_get_type (void);
+
+ #endif /* MURRINE_RC_STYLE_H */
+diff --git a/src/murrine_style.c b/src/murrine_style.c
+index 30af80e..99ace6e 100644
+--- a/src/murrine_style.c
++++ b/src/murrine_style.c
+@@ -22,7 +22,6 @@
+ #include <cairo.h>
+ #include <math.h>
+ #include <string.h>
+-#include <sys/time.h>
+
+ #include "murrine_style.h"
+ #include "murrine_rc_style.h"
+@@ -35,13 +34,11 @@
+ #define SCALE_SIZE 5
+
+ #define DETAIL(xx) ((detail) && (!strcmp(xx, detail)))
+-#define COMPARE_COLORS(a,b) (a.red == b.red && a.green == b.green && a.blue == b.blue)
+
+ #define DRAW_ARGS GtkStyle *style, \
+- GdkWindow *window, \
++ cairo_t *cr, \
+ GtkStateType state_type, \
+ GtkShadowType shadow_type, \
+- GdkRectangle *area, \
+ GtkWidget *widget, \
+ const gchar *detail, \
+ gint x, \
+@@ -50,19 +47,9 @@
+ gint height
+
+ #define CHECK_ARGS \
+- g_return_if_fail (window != NULL); \
+- g_return_if_fail (style != NULL);
+-
+-#define SANITIZE_SIZE \
+- g_return_if_fail (width >= -1); \
+- g_return_if_fail (height >= -1); \
+- \
+- if ((width == -1) && (height == -1)) \
+- gdk_drawable_get_size (window, &width, &height); \
+- else if (width == -1) \
+- gdk_drawable_get_size (window, &width, NULL); \
+- else if (height == -1) \
+- gdk_drawable_get_size (window, NULL, &height);
++ g_return_if_fail (cr != NULL); \
++ g_return_if_fail (style != NULL); \
++ cairo_set_line_width (cr, 1.0);
+
+ #ifdef HAVE_ANIMATION
+ #include "animation.h"
+@@ -70,27 +57,9 @@
+
+ #define STYLE_FUNCTION(function) (MURRINE_STYLE_GET_CLASS (style)->style_functions[params.style].function)
+
+-G_DEFINE_DYNAMIC_TYPE (MurrineStyle, murrine_style, GTK_TYPE_STYLE)
+-
+-static cairo_t *
+-murrine_begin_paint (GdkDrawable *window, GdkRectangle *area)
+-{
+- cairo_t *cr;
+-
+- g_return_val_if_fail (window != NULL, NULL);
+-
+- cr = (cairo_t*) gdk_cairo_create (window);
+- cairo_set_line_width (cr, 1.0);
+-
+- if (area)
+- {
+- cairo_rectangle (cr, area->x, area->y, area->width, area->height);
+- cairo_clip_preserve (cr);
+- cairo_new_path (cr);
+- }
++#define PRINT_DETAIL(section,detail,widget) printf("%s: %s %s\n", section, detail, G_OBJECT_TYPE_NAME (widget));
+
+- return cr;
+-}
++G_DEFINE_DYNAMIC_TYPE (MurrineStyle, murrine_style, GTK_TYPE_STYLE)
+
+ static
+ boolean murrine_widget_is_rgba (GtkWidget *widget)
+@@ -106,10 +75,20 @@ boolean murrine_widget_is_rgba (GtkWidget *widget)
+ #ifdef HAVE_RGBA
+ if (gdk_screen_is_composited(screen))
+ {
+- GdkVisual *visual = gtk_widget_get_visual (widget);
+- if (visual->depth == 32 && (visual->red_mask == 0xff0000 &&
+- visual->green_mask == 0x00ff00 &&
+- visual->blue_mask == 0x0000ff))
++ GdkVisual *visual;
++ guint32 red_mask;
++ guint32 green_mask;
++ guint32 blue_mask;
++
++ visual = gtk_widget_get_visual (widget);
++
++ gdk_visual_get_red_pixel_details (visual, &red_mask, NULL, NULL);
++ gdk_visual_get_green_pixel_details (visual, &green_mask, NULL, NULL);
++ gdk_visual_get_blue_pixel_details (visual, &blue_mask, NULL, NULL);
++
++ if (gdk_visual_get_depth (visual) == 32 && (red_mask == 0xff0000 &&
++ green_mask == 0x00ff00 &&
++ blue_mask == 0x0000ff))
+ use_rgba = TRUE;
+ }
+ #endif
+@@ -128,11 +107,11 @@ murrine_set_widget_parameters (const GtkWidget *widget,
+ params->active = (state_type == GTK_STATE_ACTIVE);
+ params->prelight = (state_type == GTK_STATE_PRELIGHT);
+ params->disabled = (state_type == GTK_STATE_INSENSITIVE);
+- params->state_type = (MurrineStateType)state_type;
++ params->state_type = state_type;
+ params->corners = MRN_CORNER_ALL;
+ params->ltr = murrine_widget_is_ltr ((GtkWidget*)widget);
+- params->focus = (MURRINE_STYLE (style)->focusstyle != 0) && widget && GTK_WIDGET_HAS_FOCUS (widget);
+- params->is_default = widget && GTK_WIDGET_HAS_DEFAULT (widget);
++ params->focus = (MURRINE_STYLE (style)->focusstyle != 0) && widget && gtk_widget_has_focus ((GtkWidget *) widget);
++ params->is_default = widget && gtk_widget_has_default ((GtkWidget *) widget);
+
+ params->xthickness = style->xthickness;
+ params->ythickness = style->ythickness;
+@@ -247,12 +226,8 @@ murrine_style_draw_flat_box (DRAW_ARGS)
+ {
+ MurrineStyle *murrine_style = MURRINE_STYLE (style);
+ MurrineColors *colors = &murrine_style->colors;
+- cairo_t *cr;
+
+ CHECK_ARGS
+- SANITIZE_SIZE
+-
+- cr = murrine_begin_paint (window, area);
+
+ WidgetParameters params;
+ CellParameters cell;
+@@ -262,19 +237,13 @@ murrine_style_draw_flat_box (DRAW_ARGS)
+ murrine_set_widget_parameters (widget, style, state_type, ¶ms);
+
+ STYLE_FUNCTION(draw_selected_cell) (cr, colors, ¶ms, &cell, x, y, width, height);
+-
+- cairo_destroy (cr);
+ }
+ else if (DETAIL ("tooltip"))
+ {
+ MurrineStyle *murrine_style = MURRINE_STYLE (style);
+ MurrineColors *colors = &murrine_style->colors;
+- cairo_t *cr;
+
+ CHECK_ARGS
+- SANITIZE_SIZE
+-
+- cr = murrine_begin_paint (window, area);
+
+ WidgetParameters params;
+
+@@ -287,27 +256,19 @@ murrine_style_draw_flat_box (DRAW_ARGS)
+ params.corners = MRN_CORNER_NONE;
+
+ STYLE_FUNCTION(draw_tooltip) (cr, colors, ¶ms, x, y, width, height);
+-
+- cairo_destroy (cr);
+ }
+ else if (DETAIL ("icon_view_item"))
+ {
+ MurrineStyle *murrine_style = MURRINE_STYLE (style);
+ MurrineColors *colors = &murrine_style->colors;
+- cairo_t *cr;
+
+ CHECK_ARGS
+- SANITIZE_SIZE
+-
+- cr = murrine_begin_paint (window, area);
+
+ WidgetParameters params;
+
+ murrine_set_widget_parameters (widget, style, state_type, ¶ms);
+
+- STYLE_FUNCTION(draw_iconview) (cr, colors, ¶ms, x, y, width, height);
+-
+- cairo_destroy (cr);
++ STYLE_FUNCTION(draw_iconview) (cr, colors, ¶ms, x, y, width, height);
+ }
+ else
+ {
+@@ -315,25 +276,21 @@ murrine_style_draw_flat_box (DRAW_ARGS)
+ {
+ MurrineStyle *murrine_style = MURRINE_STYLE (style);
+ MurrineColors *colors = &murrine_style->colors;
+- cairo_t *cr;
+ boolean use_rgba = FALSE;
+
+ CHECK_ARGS
+- SANITIZE_SIZE
+
+ use_rgba = (murrine_widget_is_rgba (widget) && murrine_style->rgba);
+
+ if (!use_rgba)
+ {
+- GTK_STYLE_CLASS (murrine_style_parent_class)->draw_flat_box (style, window, state_type,
+- shadow_type,
+- area, widget, detail,
+- x, y, width, height);
++ GTK_STYLE_CLASS (murrine_style_parent_class)->draw_flat_box (style, cr, state_type,
++ shadow_type,
++ widget, detail,
++ x, y, width, height);
+ }
+ else
+ {
+- cr = (cairo_t*) gdk_cairo_create (window);
+-
+ if (DETAIL ("entry_bg"))
+ {
+ cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
+@@ -361,17 +318,15 @@ murrine_style_draw_flat_box (DRAW_ARGS)
+ cairo_fill (cr);
+ cairo_pattern_destroy (pat);
+ }
+-
+- cairo_destroy (cr);
+ }
+ }
+ else
+ {
+ /* printf( "draw_flat_box: %s %s\n", detail, G_OBJECT_TYPE_NAME (widget));*/
+- GTK_STYLE_CLASS (murrine_style_parent_class)->draw_flat_box (style, window, state_type,
+- shadow_type,
+- area, widget, detail,
+- x, y, width, height);
++ GTK_STYLE_CLASS (murrine_style_parent_class)->draw_flat_box (style, cr, state_type,
++ shadow_type,
++ widget, detail,
++ x, y, width, height);
+ }
+ }
+
+@@ -387,12 +342,8 @@ murrine_style_draw_flat_box (DRAW_ARGS)
+ case 1:
+ {
+ MurrineColors *colors = &murrine_style->colors;
+- cairo_t *cr;
+
+ CHECK_ARGS
+- SANITIZE_SIZE
+-
+- cr = murrine_begin_paint (window, area);
+
+ cairo_translate (cr, x, y);
+ int i;
+@@ -404,19 +355,13 @@ murrine_style_draw_flat_box (DRAW_ARGS)
+ cairo_rectangle (cr, -pos, i, 1, 1);
+ cairo_fill (cr);
+ }
+-
+- cairo_destroy (cr);
+ break;
+ }
+ case 2:
+ {
+ MurrineColors *colors = &murrine_style->colors;
+- cairo_t *cr;
+
+ CHECK_ARGS
+- SANITIZE_SIZE
+-
+- cr = murrine_begin_paint (window, area);
+
+ cairo_translate (cr, murrine_style->listviewheaderstyle != 1 ? x-1 : x, y);
+
+@@ -424,8 +369,6 @@ murrine_style_draw_flat_box (DRAW_ARGS)
+ cairo_line_to (cr, -0.5, height);
+ murrine_set_color_rgba (cr, &colors->text[GTK_STATE_NORMAL], 0.2);
+ cairo_stroke (cr);
+-
+- cairo_destroy (cr);
+ break;
+ }
+ }
+@@ -437,14 +380,10 @@ murrine_style_draw_shadow (DRAW_ARGS)
+ {
+ MurrineStyle *murrine_style = MURRINE_STYLE (style);
+ MurrineColors *colors = &murrine_style->colors;
+- cairo_t *cr;
+
+ CHECK_ARGS
+- SANITIZE_SIZE
+-
+- cr = murrine_begin_paint (window, area);
+
+- if (DETAIL ("entry") && !(widget && widget->parent && MRN_IS_TREE_VIEW (widget->parent)))
++ if (DETAIL ("entry") && !(widget && gtk_widget_get_parent (widget) && MRN_IS_TREE_VIEW (gtk_widget_get_parent (widget))))
+ {
+ WidgetParameters params;
+ FocusParameters focus;
+@@ -452,12 +391,12 @@ murrine_style_draw_shadow (DRAW_ARGS)
+ /* Override the entries state type, because we are too lame to handle this via
+ * the focus ring, and GtkEntry doesn't even set the INSENSITIVE state ... */
+ if (state_type == GTK_STATE_NORMAL && widget && MRN_IS_ENTRY (widget))
+- state_type = GTK_WIDGET_STATE (widget);
++ state_type = gtk_widget_get_state (widget);
+
+ murrine_set_widget_parameters (widget, style, state_type, ¶ms);
+
+- if (widget && (MRN_IS_COMBO (widget->parent) ||
+- MRN_IS_COMBO_BOX_ENTRY(widget->parent) ||
++ if (widget && (MRN_IS_COMBO (gtk_widget_get_parent (widget)) ||
++ MRN_IS_COMBO_BOX_ENTRY(gtk_widget_get_parent (widget)) ||
+ MRN_IS_SPIN_BUTTON (widget)))
+ {
+ width += style->xthickness;
+@@ -505,7 +444,7 @@ murrine_style_draw_shadow (DRAW_ARGS)
+ STYLE_FUNCTION(draw_entry) (cr, &murrine_style->colors, ¶ms, &focus,
+ x, y, width, height);
+ }
+- else if (DETAIL ("frame") && widget && MRN_IS_STATUSBAR (widget->parent))
++ else if (DETAIL ("frame") && widget && MRN_IS_STATUSBAR (gtk_widget_get_parent (widget)))
+ {
+ WidgetParameters params;
+
+@@ -513,8 +452,8 @@ murrine_style_draw_shadow (DRAW_ARGS)
+
+ if (!params.mrn_gradient.use_rgba)
+ {
+- gtk_style_apply_default_background (style, window, TRUE, state_type,
+- area, x, y, width, height);
++ gtk_style_apply_default_background (style, cr, gtk_widget_get_window (widget),
++ state_type, x, y, width, height);;
+ }
+
+ if (shadow_type != GTK_SHADOW_NONE)
+@@ -566,8 +505,6 @@ murrine_style_draw_shadow (DRAW_ARGS)
+
+ STYLE_FUNCTION(draw_frame) (cr, colors, ¶ms, &frame, x, y, width, height);
+ }
+-
+- cairo_destroy (cr);
+ }
+
+ static void
+@@ -578,12 +515,8 @@ murrine_style_draw_box_gap (DRAW_ARGS,
+ {
+ MurrineStyle *murrine_style = MURRINE_STYLE (style);
+ MurrineColors *colors = &murrine_style->colors;
+- cairo_t *cr;
+
+ CHECK_ARGS
+- SANITIZE_SIZE
+-
+- cr = murrine_begin_paint (window, area);
+
+ if (DETAIL ("notebook"))
+ {
+@@ -673,13 +606,11 @@ murrine_style_draw_box_gap (DRAW_ARGS,
+ else
+ {
+ //printf( "draw_box_gap: %s %s\n", detail, G_OBJECT_TYPE_NAME (widget));
+- GTK_STYLE_CLASS (murrine_style_parent_class)->draw_box_gap (style, window, state_type, shadow_type,
+- area, widget, detail,
++ GTK_STYLE_CLASS (murrine_style_parent_class)->draw_box_gap (style, cr, state_type, shadow_type,
++ widget, detail,
+ x, y, width, height,
+ gap_side, gap_x, gap_width);
+ }
+-
+- cairo_destroy (cr);
+ }
+
+ static void
+@@ -687,12 +618,8 @@ murrine_style_draw_extension (DRAW_ARGS, GtkPositionType gap_side)
+ {
+ MurrineStyle *murrine_style = MURRINE_STYLE (style);
+ MurrineColors *colors = &murrine_style->colors;
+- cairo_t *cr;
+
+ CHECK_ARGS
+- SANITIZE_SIZE
+-
+- cr = murrine_begin_paint (window, area);
+
+ if (DETAIL ("tab"))
+ {
+@@ -723,11 +650,9 @@ murrine_style_draw_extension (DRAW_ARGS, GtkPositionType gap_side)
+ else
+ {
+ //printf( "draw_extension: %s %s\n", detail, G_OBJECT_TYPE_NAME (widget));
+- GTK_STYLE_CLASS (murrine_style_parent_class)->draw_extension (style, window, state_type, shadow_type, area,
++ GTK_STYLE_CLASS (murrine_style_parent_class)->draw_extension (style, cr, state_type, shadow_type,
+ widget, detail, x, y, width, height, gap_side);
+ }
+-
+- cairo_destroy (cr);
+ }
+
+ static void
+@@ -735,12 +660,8 @@ murrine_style_draw_handle (DRAW_ARGS, GtkOrientation orientation)
+ {
+ MurrineStyle *murrine_style = MURRINE_STYLE (style);
+ MurrineColors *colors = &murrine_style->colors;
+- cairo_t *cr;
+
+ CHECK_ARGS
+- SANITIZE_SIZE
+-
+- cr = murrine_begin_paint (window, area);
+
+ if (DETAIL ("handlebox"))
+ {
+@@ -753,6 +674,7 @@ murrine_style_draw_handle (DRAW_ARGS, GtkOrientation orientation)
+
+ murrine_set_widget_parameters (widget, style, state_type, ¶ms);
+
++
+ STYLE_FUNCTION(draw_handle) (cr, colors, ¶ms, &handle, x, y, width, height);
+ }
+ else if (DETAIL ("paned"))
+@@ -781,8 +703,6 @@ murrine_style_draw_handle (DRAW_ARGS, GtkOrientation orientation)
+
+ STYLE_FUNCTION(draw_handle) (cr, colors, ¶ms, &handle, x, y, width, height);
+ }
+-
+- cairo_destroy (cr);
+ }
+
+ static void
+@@ -790,15 +710,11 @@ murrine_style_draw_box (DRAW_ARGS)
+ {
+ MurrineStyle *murrine_style = MURRINE_STYLE (style);
+ MurrineColors *colors = &murrine_style->colors;
+- cairo_t *cr;
+
+ CHECK_ARGS
+- SANITIZE_SIZE
+-
+- cr = murrine_begin_paint (window, area);
+
+ if (DETAIL ("menubar") &&
+- !(widget && (murrine_is_panel_widget (widget->parent))))
++ !(widget && (murrine_is_panel_widget (gtk_widget_get_parent (widget)))))
+ {
+ WidgetParameters params;
+ gboolean horizontal;
+@@ -826,9 +742,8 @@ murrine_style_draw_box (DRAW_ARGS)
+ STYLE_FUNCTION(draw_menubar) (cr, colors, ¶ms, x, y,
+ width, height+offset, menubarstyle);
+ }
+- else if (DETAIL ("button") && widget && widget->parent &&
+- (MRN_IS_TREE_VIEW (widget->parent) ||
+- MRN_IS_CLIST (widget->parent)))
++ else if (DETAIL ("button") && widget && gtk_widget_get_parent (widget) &&
++ MRN_IS_TREE_VIEW (gtk_widget_get_parent (widget)))
+ {
+ WidgetParameters params;
+ ListViewHeaderParameters header;
+@@ -844,17 +759,12 @@ murrine_style_draw_box (DRAW_ARGS)
+ murrine_set_widget_parameters (widget, style, state_type, ¶ms);
+ params.corners = MRN_CORNER_NONE;
+
+- if (MRN_IS_TREE_VIEW (widget->parent))
++ if (MRN_IS_TREE_VIEW (gtk_widget_get_parent (widget)))
+ {
+- murrine_gtk_treeview_get_header_index (GTK_TREE_VIEW(widget->parent),
++ murrine_gtk_treeview_get_header_index (GTK_TREE_VIEW(gtk_widget_get_parent (widget)),
+ widget, &column_index, &columns,
+ &resizable);
+ }
+- else if (MRN_IS_CLIST (widget->parent))
+- {
+- murrine_gtk_clist_get_header_index (GTK_CLIST(widget->parent),
+- widget, &column_index, &columns);
+- }
+
+ header.resizable = resizable;
+
+@@ -864,7 +774,7 @@ murrine_style_draw_box (DRAW_ARGS)
+ if (column_index == columns-1)
+ header.order |= params.ltr ? MRN_ORDER_LAST : MRN_ORDER_FIRST;
+
+- gtk_style_apply_default_background (style, window, FALSE, state_type, area, x, y, width, height);
++ gtk_style_apply_default_background (style, cr, gtk_widget_get_window (widget), state_type, x, y, width, height);
+
+ STYLE_FUNCTION(draw_list_view_header) (cr, colors, ¶ms, &header, x, y, width, height);
+ }
+@@ -899,7 +809,7 @@ murrine_style_draw_box (DRAW_ARGS)
+ (murrine_style->highlight_shade != 1.0 && murrine_style->glazestyle > 0 && width<height))
+ horizontal = FALSE;
+
+- if ((widget && (MRN_IS_COMBO_BOX_ENTRY (widget->parent) || MRN_IS_COMBO (widget->parent))))
++ if ((widget && (MRN_IS_COMBO_BOX_ENTRY (gtk_widget_get_parent (widget)) || MRN_IS_COMBO (gtk_widget_get_parent (widget)))))
+ {
+ if (murrine_style->roundness > 0)
+ {
+@@ -929,20 +839,20 @@ murrine_style_draw_box (DRAW_ARGS)
+ }
+
+ /* Basic hack to theme the task list when x/y thickness == 0 */
+- if (widget->parent && widget->parent->parent &&
+- MRN_IS_PANEL_APPLET(widget->parent->parent))
+- {
+- if (params.xthickness == 0 && params.ythickness == 0)
+- {
+- x--; width+=1;
+- y-=2; height+=4;
+- params.roundness = 0;
+- }
+- }
+-
+- if (!MRN_IS_COMBO_BOX(widget->parent) ||
+- MRN_IS_COMBO_BOX_ENTRY (widget->parent) ||
+- MRN_IS_COMBO (widget->parent))
++/* if (gtk_widget_get_parent (widget) && widget->parent->parent && */
++/* MRN_IS_PANEL_APPLET(widget->parent->parent))*/
++/* {*/
++/* if (params.xthickness == 0 && params.ythickness == 0)*/
++/* {*/
++/* x--; width+=1;*/
++/* y-=2; height+=4;*/
++/* params.roundness = 0;*/
++/* } */
++/* }*/
++
++ if (!MRN_IS_COMBO_BOX(gtk_widget_get_parent (widget)) ||
++ MRN_IS_COMBO_BOX_ENTRY (gtk_widget_get_parent (widget)) ||
++ MRN_IS_COMBO (gtk_widget_get_parent (widget)))
+ STYLE_FUNCTION(draw_button) (cr, &murrine_style->colors, ¶ms, &button, x, y, width, height, horizontal);
+ else
+ {
+@@ -952,7 +862,7 @@ murrine_style_draw_box (DRAW_ARGS)
+ combobox.style = murrine_style->comboboxstyle;
+ combobox.prelight_shade = murrine_style->prelight_shade;
+
+- gtk_widget_style_get (widget->parent, "appears-as-list", &combobox.as_list, NULL);
++ gtk_widget_style_get (gtk_widget_get_parent (widget), "appears-as-list", &combobox.as_list, NULL);
+
+ STYLE_FUNCTION(draw_combobox) (cr, murrine_style->colors, params, &combobox, x, y, width, height, horizontal);
+ }
+@@ -1003,7 +913,7 @@ murrine_style_draw_box (DRAW_ARGS)
+ /* The "spinbutton" box is always drawn with state NORMAL, even if it is insensitive.
+ * So work around this here. */
+ if (state_type == GTK_STATE_NORMAL && widget && MRN_IS_ENTRY (widget))
+- state_type = GTK_WIDGET_STATE (widget);
++ state_type = gtk_widget_get_state (widget);
+
+ murrine_set_widget_parameters (widget, style, state_type, ¶ms);
+
+@@ -1056,7 +966,7 @@ murrine_style_draw_box (DRAW_ARGS)
+
+ slider.lower = DETAIL ("trough-lower");
+ slider.fill_level = DETAIL ("trough-fill-level") || DETAIL ("trough-fill-level-full");
+- slider.horizontal = (GTK_RANGE (widget)->orientation == GTK_ORIENTATION_HORIZONTAL);
++ slider.horizontal = gtk_orientable_get_orientation (GTK_ORIENTABLE (widget)) == GTK_ORIENTATION_HORIZONTAL;
+
+ murrine_set_widget_parameters (widget, style, state_type, ¶ms);
+ params.corners = MRN_CORNER_ALL;
+@@ -1094,34 +1004,49 @@ murrine_style_draw_box (DRAW_ARGS)
+ }
+
+ if (widget && MRN_IS_PROGRESS_BAR (widget))
+- progressbar.orientation = gtk_progress_bar_get_orientation (GTK_PROGRESS_BAR (widget));
++ {
++ if (gtk_orientable_get_orientation (GTK_ORIENTABLE (widget)) == GTK_ORIENTATION_HORIZONTAL)
++ {
++ if (gtk_progress_bar_get_inverted (GTK_PROGRESS_BAR (widget)))
++ progressbar.orientation = MRN_ORIENTATION_RIGHT_TO_LEFT;
++ else
++ progressbar.orientation = MRN_ORIENTATION_LEFT_TO_RIGHT;
++ }
++ else
++ {
++ if (gtk_progress_bar_get_inverted (GTK_PROGRESS_BAR (widget)))
++ progressbar.orientation = MRN_ORIENTATION_BOTTOM_TO_TOP;
++ else
++ progressbar.orientation = MRN_ORIENTATION_TOP_TO_BOTTOM;
++ }
++ }
+ else
+ progressbar.orientation = MRN_ORIENTATION_LEFT_TO_RIGHT;
+
+ if (!params.ltr)
+ {
+- if (progressbar.orientation == GTK_PROGRESS_LEFT_TO_RIGHT)
+- progressbar.orientation = GTK_PROGRESS_RIGHT_TO_LEFT;
+- else if (progressbar.orientation == GTK_PROGRESS_RIGHT_TO_LEFT)
+- progressbar.orientation = GTK_PROGRESS_LEFT_TO_RIGHT;
++ if (progressbar.orientation == MRN_ORIENTATION_LEFT_TO_RIGHT)
++ progressbar.orientation = MRN_ORIENTATION_RIGHT_TO_LEFT;
++ else if (progressbar.orientation == MRN_ORIENTATION_RIGHT_TO_LEFT)
++ progressbar.orientation = MRN_ORIENTATION_LEFT_TO_RIGHT;
+ }
+
+ STYLE_FUNCTION(draw_progressbar_trough) (cr, colors, ¶ms, &progressbar, x, y, width, height);
+ }
+- else if (DETAIL ("trough") && widget && (MRN_IS_VSCROLLBAR (widget) || MRN_IS_HSCROLLBAR (widget)))
++ else if ((DETAIL ("trough-upper") || DETAIL ("trough-lower")) && widget && (MRN_IS_VSCROLLBAR (widget) || MRN_IS_HSCROLLBAR (widget)))
+ {
+ WidgetParameters params;
+ ScrollBarParameters scrollbar;
+ boolean within_bevel = FALSE;
+
+- if (widget->parent && MRN_IS_SCROLLED_WINDOW (widget->parent))
+- gtk_widget_style_get (widget->parent, "scrollbars-within-bevel", &within_bevel, NULL);
++ if (gtk_widget_get_parent (widget) && MRN_IS_SCROLLED_WINDOW (gtk_widget_get_parent (widget)))
++ gtk_widget_style_get (gtk_widget_get_parent (widget), "scrollbars-within-bevel", &within_bevel, NULL);
+
+ scrollbar.horizontal = TRUE;
+ scrollbar.junction = murrine_scrollbar_get_junction (widget);
+- scrollbar.steppers = murrine_scrollbar_visible_steppers (widget);
+ scrollbar.stepperstyle = murrine_style->stepperstyle;
+ scrollbar.within_bevel = within_bevel;
++ scrollbar.trough_upper = DETAIL ("trough-upper");
+ gtk_widget_style_get (widget, "stepper-size", &scrollbar.steppersize, NULL);
+
+ murrine_set_widget_parameters (widget, style, state_type, ¶ms);
+@@ -1129,8 +1054,7 @@ murrine_style_draw_box (DRAW_ARGS)
+ if (within_bevel)
+ params.corners = MRN_CORNER_NONE;
+
+- if (MRN_IS_RANGE (widget))
+- scrollbar.horizontal = GTK_RANGE (widget)->orientation == GTK_ORIENTATION_HORIZONTAL;
++ scrollbar.horizontal = gtk_orientable_get_orientation ((GtkOrientable*)widget) == GTK_ORIENTATION_HORIZONTAL;
+
+ if (murrine_style->stepperstyle != 1 && murrine_style->stepperstyle != 3 && !params.mrn_gradient.use_rgba)
+ {
+@@ -1158,25 +1082,45 @@ murrine_style_draw_box (DRAW_ARGS)
+ progressbar.style = murrine_style->progressbarstyle;
+
+ if (widget && MRN_IS_PROGRESS_BAR (widget))
+- progressbar.orientation = gtk_progress_bar_get_orientation (GTK_PROGRESS_BAR (widget));
++ {
++ if (gtk_orientable_get_orientation (GTK_ORIENTABLE (widget)) == GTK_ORIENTATION_HORIZONTAL)
++ {
++ if (gtk_progress_bar_get_inverted (GTK_PROGRESS_BAR (widget)))
++ progressbar.orientation = MRN_ORIENTATION_RIGHT_TO_LEFT;
++ else
++ progressbar.orientation = MRN_ORIENTATION_LEFT_TO_RIGHT;
++/* x-=1;*/
++/* width+=2;*/
++ }
++ else
++ {
++ if (gtk_progress_bar_get_inverted (GTK_PROGRESS_BAR (widget)))
++ progressbar.orientation = MRN_ORIENTATION_BOTTOM_TO_TOP;
++ else
++ progressbar.orientation = MRN_ORIENTATION_TOP_TO_BOTTOM;
++
++/* x-=1;*/
++/* y-=2;*/
++/* width+=2;*/
++/* height+=4;*/
++ }
++ }
+ else
+ progressbar.orientation = MRN_ORIENTATION_LEFT_TO_RIGHT;
+
+ if (!params.ltr)
+ {
+- if (progressbar.orientation == GTK_PROGRESS_LEFT_TO_RIGHT)
+- progressbar.orientation = GTK_PROGRESS_RIGHT_TO_LEFT;
+- else if (progressbar.orientation == GTK_PROGRESS_RIGHT_TO_LEFT)
+- progressbar.orientation = GTK_PROGRESS_LEFT_TO_RIGHT;
++ if (progressbar.orientation == MRN_ORIENTATION_LEFT_TO_RIGHT)
++ progressbar.orientation = MRN_ORIENTATION_RIGHT_TO_LEFT;
++ else if (progressbar.orientation == MRN_ORIENTATION_RIGHT_TO_LEFT)
++ progressbar.orientation = MRN_ORIENTATION_LEFT_TO_RIGHT;
+ }
+
+ #ifdef HAVE_ANIMATION
+ if(murrine_style->animation && MRN_IS_PROGRESS_BAR (widget))
+ {
+- gboolean activity_mode = GTK_PROGRESS (widget)->activity_mode;
+-
+- if (!activity_mode)
+- murrine_animation_progressbar_add ((gpointer)widget);
++#warning Assuming non-pulsing progress bars because there is currently no way to query them in GTK+ 3.0.
++ murrine_animation_progressbar_add ((gpointer)widget);
+ }
+
+ elapsed = murrine_animation_elapsed (widget);
+@@ -1229,51 +1173,25 @@ murrine_style_draw_box (DRAW_ARGS)
+ /* We got an entry, but well, we may not be drawing to
+ * this particular widget ... it may not even be realized.
+ * Also, we need to be drawing on a window obviously ... */
+- if (GTK_WIDGET_REALIZED (widget) &&
+- GDK_IS_WINDOW (window) &&
+- gdk_window_is_visible (widget->window))
++ if (gtk_widget_get_realized (widget) &&
++ gdk_window_is_visible (gtk_widget_get_window (widget)))
+ {
+ /* Assumptions done by this code:
+ * - GtkEntry has some nested windows.
+- * - widget->window is the entries window
+- * - widget->window is the size of the entry part
++ * - gtk_widget_get_window (widget) is the entries window
++ * - gtk_widget_get_window (widget) is the size of the entry part
+ * (and not larger)
+ * - only one layer of subwindows
+ * These should be true with any GTK+ 2.x version.
+ */
+
+- if (widget->window == window)
+- {
+- progress.max_size_known = TRUE;
+- gdk_drawable_get_size (widget->window,
+- &progress.max_size.width,
+- &progress.max_size.height);
+-
+- }
+- else
+- {
+- GdkWindow *parent;
+- parent = gdk_window_get_parent (window);
+- if (widget->window == parent)
+- {
+- gint pos_x, pos_y;
+- /* widget->window is the parent window
+- * of the current one. This means we can
+- * calculate the correct offsets. */
+- gdk_window_get_position (window, &pos_x, &pos_y);
+- progress.max_size.x = -pos_x;
+- progress.max_size.y = -pos_y;
+-
+- progress.max_size_known = TRUE;
+- gdk_drawable_get_size (widget->window,
+- &progress.max_size.width,
+- &progress.max_size.height);
+- } /* Nothing we can do in this case ... */
+- }
++ progress.max_size_known = TRUE;
++ progress.max_size.width = gdk_window_get_width (gtk_widget_get_window (widget));
++ progress.max_size.height = gdk_window_get_height (gtk_widget_get_window (widget));
+
+ /* Now, one more thing needs to be done. If interior-focus
+ * is off, then the entry may be a bit smaller. */
+- if (progress.max_size_known && GTK_WIDGET_HAS_FOCUS (widget))
++ if (progress.max_size_known && gtk_widget_has_focus (widget))
+ {
+ gboolean interior_focus = TRUE;
+ gint focus_line_width = 1;
+@@ -1357,50 +1275,21 @@ murrine_style_draw_box (DRAW_ARGS)
+ STYLE_FUNCTION(draw_slider_handle) (cr, &murrine_style->colors, ¶ms, &handle, x, y, width, height, horizontal);
+ }
+ }
+- else if (DETAIL ("optionmenu"))
+- {
+- WidgetParameters params;
+- OptionMenuParameters optionmenu;
+-
+- GtkRequisition indicator_size;
+- GtkBorder indicator_spacing;
+-
+- murrine_option_menu_get_props (widget, &indicator_size, &indicator_spacing);
+-
+- if (widget && murrine_get_direction (widget) == GTK_TEXT_DIR_RTL)
+- optionmenu.linepos = (indicator_size.width+indicator_spacing.left+indicator_spacing.right)+style->xthickness;
+- else
+- optionmenu.linepos = width-(indicator_size.width+indicator_spacing.left+indicator_spacing.right)-style->xthickness;
+-
+- murrine_set_widget_parameters (widget, style, state_type, ¶ms);
+-
+- if (murrine_style->comboboxstyle > 0)
+- {
+- ComboBoxParameters combobox;
+- combobox.as_list = FALSE;
+- combobox.box_w = indicator_size.width+indicator_spacing.left+indicator_spacing.right+3;
+- combobox.style = murrine_style->comboboxstyle;
+- combobox.prelight_shade = murrine_style->prelight_shade;
+- STYLE_FUNCTION(draw_combobox) (cr, murrine_style->colors, params, &combobox, x, y, width, height, TRUE);
+- }
+- else
+- STYLE_FUNCTION(draw_optionmenu) (cr, colors, ¶ms, &optionmenu, x, y, width, height);
+- }
+ else if (DETAIL ("menuitem"))
+ {
+ WidgetParameters params;
+
+ murrine_set_widget_parameters (widget, style, state_type, ¶ms);
+
+- if (widget && !(MRN_IS_MENU_BAR (widget->parent) && murrine_style->menubaritemstyle))
++ if (widget && !(MRN_IS_MENU_BAR (gtk_widget_get_parent (widget)) && murrine_style->menubaritemstyle))
+ {
+- if (murrine_style->menustyle != 1 || (MRN_IS_MENU_BAR (widget->parent) && !murrine_style->menubaritemstyle))
++ if (murrine_style->menustyle != 1 || (MRN_IS_MENU_BAR (gtk_widget_get_parent (widget)) && !murrine_style->menubaritemstyle))
+ STYLE_FUNCTION(draw_menuitem) (cr, colors, ¶ms, x, y, width, height, murrine_style->menuitemstyle);
+ else
+ STYLE_FUNCTION(draw_menuitem) (cr, colors, ¶ms, x+3, y, width-3, height, murrine_style->menuitemstyle);
+ }
+
+- if (widget && MRN_IS_MENU_BAR (widget->parent) && murrine_style->menubaritemstyle)
++ if (widget && MRN_IS_MENU_BAR (gtk_widget_get_parent (widget)) && murrine_style->menubaritemstyle)
+ {
+ ButtonParameters button;
+ button.has_default_button_color = FALSE;
+@@ -1408,7 +1297,7 @@ murrine_style_draw_box (DRAW_ARGS)
+ params.active = FALSE;
+ params.prelight = TRUE;
+ params.focus = TRUE;
+- params.state_type = MRN_STATE_SELECTED;
++ params.state_type = GTK_STATE_SELECTED;
+ params.xthickness = 2;
+ params.ythickness = 2;
+ params.reliefstyle = 0;
+@@ -1417,7 +1306,7 @@ murrine_style_draw_box (DRAW_ARGS)
+ STYLE_FUNCTION(draw_button) (cr, colors, ¶ms, &button, x, y, width, height+1, TRUE);
+ }
+ }
+- else if (DETAIL ("hscrollbar") || DETAIL ("vscrollbar") || DETAIL ("slider") || DETAIL ("stepper"))
++ else if (detail && (g_str_has_prefix (detail, "hscrollbar") || g_str_has_prefix (detail, "vscrollbar"))) /* This can't be "stepper" for scrollbars ... */
+ {
+ WidgetParameters params;
+ ScrollBarParameters scrollbar;
+@@ -1427,14 +1316,12 @@ murrine_style_draw_box (DRAW_ARGS)
+ scrollbar.horizontal = TRUE;
+ scrollbar.junction = murrine_scrollbar_get_junction (widget);
+ scrollbar.handlestyle = murrine_style->handlestyle;
+- scrollbar.steppers = murrine_scrollbar_visible_steppers (widget);
+ scrollbar.style = murrine_style->scrollbarstyle;
+ scrollbar.stepperstyle = murrine_style->stepperstyle;
+ scrollbar.prelight_shade = murrine_style->prelight_shade;
+ gtk_widget_style_get (widget, "stepper-size", &scrollbar.steppersize, NULL);
+
+- if (MRN_IS_RANGE (widget))
+- scrollbar.horizontal = GTK_RANGE (widget)->orientation == GTK_ORIENTATION_HORIZONTAL;
++ scrollbar.horizontal = g_str_has_prefix (detail, "hscrollbar");
+
+ if (murrine_style->colorize_scrollbar)
+ {
+@@ -1447,68 +1334,55 @@ murrine_style_draw_box (DRAW_ARGS)
+ murrine_set_widget_parameters (widget, style, state_type, ¶ms);
+ params.corners = MRN_CORNER_NONE;
+
+- if (DETAIL ("slider"))
++ if (murrine_style->roundness > 1)
+ {
+- int trough_border = 0;
+- int trough_under_steppers = 1;
+-
+- gtk_widget_style_get (widget,
+- "trough-border", &trough_border,
+- "trough-under-steppers", &trough_under_steppers,
+- NULL);
+-
+- if (trough_border > 0 ||
+- trough_under_steppers == 0 ||
+- scrollbar.stepperstyle == 2 ||
+- scrollbar.stepperstyle == 3 ||
+- murrine_style->roundness == 1)
+- params.corners = MRN_CORNER_ALL;
++ ScrollBarStepperParameters stepper;
++ GdkRectangle this_rectangle = { x, y, width, height };
++
++ if (g_str_equal(detail + 10, "_start"))
++ stepper.stepper = MRN_STEPPER_START;
++ else if (g_str_equal(detail + 10, "_end"))
++ stepper.stepper = MRN_STEPPER_END;
++ else if (g_str_equal(detail + 10, "_start_inner"))
++ stepper.stepper = MRN_STEPPER_START_INNER;
++ else if (g_str_equal(detail + 10, "_end_inner"))
++ stepper.stepper = MRN_STEPPER_END_INNER;
+ else
+- params.corners = MRN_CORNER_NONE;
+-
+- STYLE_FUNCTION(draw_scrollbar_slider) (cr, colors, ¶ms, &scrollbar, x, y, width, height);
+- }
+- else
+- {
+- if (murrine_style->roundness > 1)
+- {
+- ScrollBarStepperParameters stepper;
+- GdkRectangle this_rectangle = { x, y, width, height };
++ stepper.stepper = MRN_STEPPER_UNKNOWN;
+
+- stepper.stepper = murrine_scrollbar_get_stepper (widget, &this_rectangle);
++ /* XXX Check later for corners - might be OK 20101013 */
+
+- if (scrollbar.horizontal)
+- {
+- if (stepper.stepper == MRN_STEPPER_A)
+- params.corners = MRN_CORNER_TOPLEFT | MRN_CORNER_BOTTOMLEFT;
+- else if (stepper.stepper == MRN_STEPPER_D)
+- params.corners = MRN_CORNER_TOPRIGHT | MRN_CORNER_BOTTOMRIGHT;
+- }
+- else
+- {
+- if (stepper.stepper == MRN_STEPPER_A)
+- params.corners = MRN_CORNER_BOTTOMLEFT | MRN_CORNER_TOPLEFT;
+- else if (stepper.stepper == MRN_STEPPER_D)
+- params.corners = MRN_CORNER_TOPRIGHT | MRN_CORNER_BOTTOMRIGHT;
+- }
++ if (scrollbar.horizontal)
++ {
++ if (stepper.stepper == MRN_STEPPER_START)
++ params.corners = MRN_CORNER_TOPLEFT | MRN_CORNER_BOTTOMLEFT;
++ else if (stepper.stepper == MRN_STEPPER_END)
++ params.corners = MRN_CORNER_TOPRIGHT | MRN_CORNER_BOTTOMRIGHT;
+ }
+- else if (murrine_style->roundness == 1)
+- params.corners = MRN_CORNER_ALL;
+ else
+- params.corners = MRN_CORNER_NONE;
++ {
++ if (stepper.stepper == MRN_STEPPER_START)
++ params.corners = MRN_CORNER_BOTTOMLEFT | MRN_CORNER_TOPLEFT;
++ else if (stepper.stepper == MRN_STEPPER_END)
++ params.corners = MRN_CORNER_TOPRIGHT | MRN_CORNER_BOTTOMRIGHT;
++ }
++ }
++ else if (murrine_style->roundness == 1)
++ params.corners = MRN_CORNER_ALL;
++ else
++ params.corners = MRN_CORNER_NONE;
+
+- if (widget->parent && MRN_IS_SCROLLED_WINDOW (widget->parent))
+- gtk_widget_style_get (widget->parent, "scrollbars-within-bevel", &within_bevel, NULL);
++ if (gtk_widget_get_parent (widget) && MRN_IS_SCROLLED_WINDOW (gtk_widget_get_parent (widget)))
++ gtk_widget_style_get (gtk_widget_get_parent (widget), "scrollbars-within-bevel", &within_bevel, NULL);
+
+- if (within_bevel)
+- params.corners = MRN_CORNER_NONE;
++ if (within_bevel)
++ params.corners = MRN_CORNER_NONE;
+
+- if (scrollbar.stepperstyle == 2)
+- params.corners = MRN_CORNER_NONE;
++ if (scrollbar.stepperstyle == 2)
++ params.corners = MRN_CORNER_NONE;
+
+- if (scrollbar.stepperstyle != 1 && scrollbar.stepperstyle != 3)
+- STYLE_FUNCTION(draw_scrollbar_stepper) (cr, colors, ¶ms, &scrollbar, x, y, width, height);
+- }
++ if (scrollbar.stepperstyle != 1 && scrollbar.stepperstyle != 3)
++ STYLE_FUNCTION(draw_scrollbar_stepper) (cr, colors, ¶ms, &scrollbar, x, y, width, height);
+ }
+ else if (DETAIL ("toolbar") || DETAIL ("handlebox_bin") || DETAIL ("dockitem_bin"))
+ {
+@@ -1518,7 +1392,7 @@ murrine_style_draw_box (DRAW_ARGS)
+
+ murrine_set_widget_parameters (widget, style, state_type, ¶ms);
+
+- murrine_set_toolbar_parameters (&toolbar, widget, window, x, y);
++ murrine_set_toolbar_parameters (&toolbar, widget, x, y);
+ toolbar.style = murrine_style->toolbarstyle;
+
+ if ((DETAIL ("handlebox_bin") || DETAIL ("dockitem_bin")) && MRN_IS_BIN (widget))
+@@ -1577,33 +1451,81 @@ murrine_style_draw_box (DRAW_ARGS)
+
+ if (DETAIL ("hseparator"))
+ {
+- gtk_paint_hline (style, window, state_type, area, widget, new_detail,
++ gtk_paint_hline (style, cr, state_type, widget, new_detail,
+ x, x+width-1, y+height/2);
+ }
+ else
+- gtk_paint_vline (style, window, state_type, area, widget, new_detail,
++ gtk_paint_vline (style, cr, state_type, widget, new_detail,
+ y, y+height-1, x+width/2);
+ }
+ else
+ {
+ //printf( "draw_box: %s %s\n", detail, G_OBJECT_TYPE_NAME (widget));
+- GTK_STYLE_CLASS (murrine_style_parent_class)->draw_box (style, window, state_type, shadow_type, area,
++ GTK_STYLE_CLASS (murrine_style_parent_class)->draw_box (style, cr, state_type, shadow_type,
+ widget, detail, x, y, width, height);
+ }
+-
+- cairo_destroy (cr);
+ }
+
+ static void
+ murrine_style_draw_slider (DRAW_ARGS, GtkOrientation orientation)
+ {
++ MurrineStyle *murrine_style = MURRINE_STYLE (style);
++ MurrineColors *colors = &murrine_style->colors;
++
++ CHECK_ARGS
++
+ if (DETAIL ("hscale") || DETAIL ("vscale"))
+ {
+- murrine_style_draw_box (style, window, state_type, shadow_type, area,
++ murrine_style_draw_box (style, cr, state_type, shadow_type,
+ widget, detail, x, y, width, height);
+ }
++ else if (DETAIL ("slider"))
++ {
++ WidgetParameters params;
++ ScrollBarParameters scrollbar;
++ boolean within_bevel = FALSE;
++
++ scrollbar.has_color = FALSE;
++ scrollbar.horizontal = (orientation == GTK_ORIENTATION_HORIZONTAL);
++ scrollbar.junction = murrine_scrollbar_get_junction (widget);
++ scrollbar.handlestyle = murrine_style->handlestyle;
++ scrollbar.style = murrine_style->scrollbarstyle;
++ scrollbar.stepperstyle = murrine_style->stepperstyle;
++ scrollbar.prelight_shade = murrine_style->prelight_shade;
++ gtk_widget_style_get (widget, "stepper-size", &scrollbar.steppersize, NULL);
++
++ if (murrine_style->colorize_scrollbar)
++ {
++ scrollbar.color = colors->spot[1];
++ scrollbar.has_color = TRUE;
++ }
++ else
++ scrollbar.color = colors->bg[0];
++
++ murrine_set_widget_parameters (widget, style, state_type, ¶ms);
++ params.corners = MRN_CORNER_NONE;
++
++ int trough_border = 0;
++ int trough_under_steppers = 1;
++
++ gtk_widget_style_get (widget,
++ "trough-border", &trough_border,
++ "trough-under-steppers", &trough_under_steppers,
++ NULL);
++
++ if (trough_border > 0 ||
++ trough_under_steppers == 0 ||
++ scrollbar.stepperstyle == 2 ||
++ scrollbar.stepperstyle == 3 ||
++ murrine_style->roundness == 1)
++ params.corners = MRN_CORNER_ALL;
++ else
++ params.corners = MRN_CORNER_NONE;
++
++ STYLE_FUNCTION(draw_scrollbar_slider) (cr, colors, ¶ms, &scrollbar, x, y, width, height);
++ }
+ else
+- GTK_STYLE_CLASS (murrine_style_parent_class)->draw_slider (style, window, state_type, shadow_type, area,
++ GTK_STYLE_CLASS (murrine_style_parent_class)->draw_slider (style, cr, state_type, shadow_type,
+ widget, detail, x, y, width, height, orientation);
+ }
+
+@@ -1612,19 +1534,15 @@ murrine_style_draw_option (DRAW_ARGS)
+ {
+ MurrineStyle *murrine_style = MURRINE_STYLE (style);
+ MurrineColors *colors = &murrine_style->colors;
+- cairo_t *cr;
+
+ CHECK_ARGS
+- SANITIZE_SIZE
+-
+- cr = murrine_begin_paint (window, area);
+
+ WidgetParameters params;
+ CheckboxParameters checkbox;
+
+ checkbox.shadow_type = shadow_type;
+ checkbox.in_cell = DETAIL ("cellradio");
+- checkbox.in_menu = (widget && widget->parent && GTK_IS_MENU(widget->parent));
++ checkbox.in_menu = (widget && gtk_widget_get_parent (widget) && GTK_IS_MENU(gtk_widget_get_parent (widget)));
+
+ murrine_set_widget_parameters (widget, style, state_type, ¶ms);
+
+@@ -1645,8 +1563,6 @@ murrine_style_draw_option (DRAW_ARGS)
+ #endif
+
+ STYLE_FUNCTION(draw_radiobutton) (cr, colors, ¶ms, &checkbox, x, y, width, height, trans);
+-
+- cairo_destroy (cr);
+ }
+
+ static void
+@@ -1654,19 +1570,15 @@ murrine_style_draw_check (DRAW_ARGS)
+ {
+ MurrineStyle *murrine_style = MURRINE_STYLE (style);
+ MurrineColors *colors = &murrine_style->colors;
+- cairo_t *cr;
+
+ CHECK_ARGS
+- SANITIZE_SIZE
+-
+- cr = murrine_begin_paint (window, area);
+
+ WidgetParameters params;
+ CheckboxParameters checkbox;
+
+ checkbox.shadow_type = shadow_type;
+ checkbox.in_cell = DETAIL ("cellcheck");
+- checkbox.in_menu = (widget && widget->parent && GTK_IS_MENU(widget->parent));
++ checkbox.in_menu = (widget && gtk_widget_get_parent (widget) && GTK_IS_MENU(gtk_widget_get_parent (widget)));
+
+ murrine_set_widget_parameters (widget, style, state_type, ¶ms);
+
+@@ -1686,8 +1598,6 @@ murrine_style_draw_check (DRAW_ARGS)
+ #endif
+
+ STYLE_FUNCTION(draw_checkbox) (cr, colors, ¶ms, &checkbox, x, y, width, height, trans);
+-
+- cairo_destroy (cr);
+ }
+
+ static void
+@@ -1696,12 +1606,7 @@ murrine_style_draw_tab (DRAW_ARGS)
+ MurrineStyle *murrine_style = MURRINE_STYLE (style);
+ MurrineColors *colors = &murrine_style->colors;
+
+- cairo_t *cr;
+-
+ CHECK_ARGS
+- SANITIZE_SIZE
+-
+- cr = murrine_begin_paint (window, area);
+
+ WidgetParameters params;
+ ArrowParameters arrow;
+@@ -1713,15 +1618,12 @@ murrine_style_draw_tab (DRAW_ARGS)
+ murrine_set_widget_parameters (widget, style, state_type, ¶ms);
+
+ STYLE_FUNCTION(draw_arrow) (cr, colors, ¶ms, &arrow, x, y, width, height);
+-
+- cairo_destroy (cr);
+ }
+
+ static void
+ murrine_style_draw_vline (GtkStyle *style,
+- GdkWindow *window,
++ cairo_t *cr,
+ GtkStateType state_type,
+- GdkRectangle *area,
+ GtkWidget *widget,
+ const gchar *detail,
+ gint y1,
+@@ -1733,12 +1635,9 @@ murrine_style_draw_vline (GtkStyle *style,
+
+ MurrineStyle *murrine_style = MURRINE_STYLE (style);
+ MurrineColors *colors = &murrine_style->colors;
+- cairo_t *cr;
+
+ CHECK_ARGS
+
+- cr = murrine_begin_paint (window, area);
+-
+ SeparatorParameters separator;
+ separator.horizontal = FALSE;
+ separator.style = murrine_style->separatorstyle;
+@@ -1753,21 +1652,18 @@ murrine_style_draw_vline (GtkStyle *style,
+ }
+
+ if (!(widget &&
+- MRN_IS_HBOX (widget->parent) &&
+- MRN_IS_TOGGLE_BUTTON (widget->parent->parent) &&
+- MRN_IS_COMBO_BOX (widget->parent->parent->parent)))
++ MRN_IS_HBOX (gtk_widget_get_parent (widget)) &&
++ MRN_IS_TOGGLE_BUTTON (gtk_widget_get_parent (gtk_widget_get_parent (widget))) &&
++ MRN_IS_COMBO_BOX (gtk_widget_get_parent (gtk_widget_get_parent (gtk_widget_get_parent (widget))))))
+ {
+ STYLE_FUNCTION(draw_separator) (cr, colors, ¶ms, &separator, x, y1, 2, y2-y1);
+ }
+-
+- cairo_destroy (cr);
+ }
+
+ static void
+ murrine_style_draw_hline (GtkStyle *style,
+- GdkWindow *window,
++ cairo_t *cr,
+ GtkStateType state_type,
+- GdkRectangle *area,
+ GtkWidget *widget,
+ const gchar *detail,
+ gint x1,
+@@ -1779,12 +1675,9 @@ murrine_style_draw_hline (GtkStyle *style,
+
+ MurrineStyle *murrine_style = MURRINE_STYLE (style);
+ MurrineColors *colors = &murrine_style->colors;
+- cairo_t *cr;
+
+ CHECK_ARGS
+
+- cr = murrine_begin_paint (window, area);
+-
+ SeparatorParameters separator;
+ separator.horizontal = TRUE;
+ separator.style = murrine_style->separatorstyle;
+@@ -1799,8 +1692,6 @@ murrine_style_draw_hline (GtkStyle *style,
+ }
+
+ STYLE_FUNCTION(draw_separator) (cr, colors, ¶ms, &separator, x1, y, x2-x1, 2);
+-
+- cairo_destroy (cr);
+ }
+
+ static void
+@@ -1811,12 +1702,8 @@ murrine_style_draw_shadow_gap (DRAW_ARGS,
+ {
+ MurrineStyle *murrine_style = MURRINE_STYLE (style);
+ const MurrineColors *colors = &murrine_style->colors;
+- cairo_t *cr;
+
+ CHECK_ARGS
+- SANITIZE_SIZE
+-
+- cr = murrine_begin_paint (window, area);
+
+ if (DETAIL ("frame"))
+ {
+@@ -1838,19 +1725,16 @@ murrine_style_draw_shadow_gap (DRAW_ARGS,
+ }
+ else
+ {
+- GTK_STYLE_CLASS (murrine_style_parent_class)->draw_shadow_gap (style, window, state_type, shadow_type, area,
++ GTK_STYLE_CLASS (murrine_style_parent_class)->draw_shadow_gap (style, cr, state_type, shadow_type,
+ widget, detail, x, y, width, height,
+ gap_side, gap_x, gap_width);
+ }
+-
+- cairo_destroy (cr);
+ }
+
+ static void
+ murrine_style_draw_resize_grip (GtkStyle *style,
+- GdkWindow *window,
++ cairo_t *cr,
+ GtkStateType state_type,
+- GdkRectangle *area,
+ GtkWidget *widget,
+ const gchar *detail,
+ GdkWindowEdge edge,
+@@ -1862,12 +1746,7 @@ murrine_style_draw_resize_grip (GtkStyle *style,
+ MurrineStyle *murrine_style = MURRINE_STYLE (style);
+ MurrineColors *colors = &murrine_style->colors;
+
+- cairo_t *cr;
+-
+ CHECK_ARGS
+- SANITIZE_SIZE
+-
+- cr = murrine_begin_paint (window, area);
+
+ WidgetParameters params;
+ ResizeGripParameters grip;
+@@ -1875,8 +1754,6 @@ murrine_style_draw_resize_grip (GtkStyle *style,
+
+ int lx, ly;
+
+- g_return_if_fail (window != NULL);
+-
+ if (edge != GDK_WINDOW_EDGE_SOUTH_EAST)
+ return; /* sorry... need to work on this :P */
+
+@@ -1884,17 +1761,14 @@ murrine_style_draw_resize_grip (GtkStyle *style,
+
+ STYLE_FUNCTION(draw_resize_grip) (cr, colors, ¶ms, &grip, x, y, width, height);
+
+- cairo_destroy (cr);
+-
+ return;
+ }
+
+ static void
+ murrine_style_draw_arrow (GtkStyle *style,
+- GdkWindow *window,
++ cairo_t *cr,
+ GtkStateType state_type,
+ GtkShadowType shadow,
+- GdkRectangle *area,
+ GtkWidget *widget,
+ const gchar *detail,
+ GtkArrowType arrow_type,
+@@ -1906,19 +1780,14 @@ murrine_style_draw_arrow (GtkStyle *style,
+ {
+ MurrineStyle *murrine_style = MURRINE_STYLE (style);
+ MurrineColors *colors = &murrine_style->colors;
+- cairo_t *cr;
+
+ CHECK_ARGS
+- SANITIZE_SIZE;
+-
+- cr = murrine_begin_paint (window, area);
+
+ WidgetParameters params;
+ ArrowParameters arrow;
+
+ if (arrow_type == GTK_ARROW_NONE)
+ {
+- cairo_destroy (cr);
+ return;
+ }
+
+@@ -1950,7 +1819,7 @@ murrine_style_draw_arrow (GtkStyle *style,
+ height = 5; width = 4;
+ }
+ }
+- else if (DETAIL ("hscrollbar") || DETAIL ("vscrollbar"))
++ else if (g_str_has_prefix (detail, "hscrollbar") || g_str_has_prefix (detail, "vscrollbar"))
+ {
+ int steppersize;
+ gtk_widget_style_get (widget, "stepper-size", &steppersize, NULL);
+@@ -2032,29 +1901,20 @@ murrine_style_draw_arrow (GtkStyle *style,
+ }
+
+ STYLE_FUNCTION(draw_arrow) (cr, colors, ¶ms, &arrow, x, y, width, height);
+-
+- cairo_destroy (cr);
+ }
+
+ static void
+ murrine_style_draw_layout (GtkStyle *style,
+- GdkWindow *window,
++ cairo_t *cr,
+ GtkStateType state_type,
+ gboolean use_text,
+- GdkRectangle *area,
+ GtkWidget *widget,
+ const gchar *detail, gint x, gint y,
+ PangoLayout *layout)
+ {
+- GdkGC *gc;
+-
+- g_return_if_fail (GTK_IS_STYLE (style));
+- g_return_if_fail (window != NULL);
+-
+- gc = use_text ? style->text_gc[state_type] : style->fg_gc[state_type];
++ CHECK_ARGS
+
+- if (area)
+- gdk_gc_set_clip_rectangle (gc, area);
++ murrine_transform_for_layout (cr, layout, x, y);
+
+ if (widget && (state_type == GTK_STATE_INSENSITIVE ||
+ (MURRINE_STYLE (style)->textstyle != 0 &&
+@@ -2068,7 +1928,6 @@ murrine_style_draw_layout (GtkStyle *style,
+
+ murrine_set_widget_parameters (widget, style, state_type, ¶ms);
+
+- GdkColor etched;
+ MurrineRGB temp;
+
+ double shade_level = murrine_style->text_shade;
+@@ -2103,23 +1962,22 @@ murrine_style_draw_layout (GtkStyle *style,
+ if (!gtk_widget_get_has_window (widget))
+ {
+ boolean use_parentbg = TRUE;
+- while (widget->parent)
++ while (gtk_widget_get_parent (widget))
+ {
+- if (MRN_IS_BUTTON(widget->parent) ||
+- MRN_IS_TOGGLE_BUTTON(widget->parent) ||
+- MRN_IS_COMBO_BOX(widget->parent) ||
+- MRN_IS_COMBO_BOX_ENTRY(widget->parent) ||
+- MRN_IS_COMBO(widget->parent) ||
+- MRN_IS_OPTION_MENU(widget->parent) ||
+- MRN_IS_NOTEBOOK(widget->parent))
++ if (MRN_IS_BUTTON(gtk_widget_get_parent (widget)) ||
++ MRN_IS_TOGGLE_BUTTON(gtk_widget_get_parent (widget)) ||
++ MRN_IS_COMBO_BOX(gtk_widget_get_parent (widget)) ||
++ MRN_IS_COMBO_BOX_ENTRY(gtk_widget_get_parent (widget)) ||
++ MRN_IS_COMBO(gtk_widget_get_parent (widget)) ||
++ MRN_IS_NOTEBOOK(gtk_widget_get_parent (widget)))
+ {
+ GtkReliefStyle relief = GTK_RELIEF_NORMAL;
+ /* Check for the shadow type. */
+- if (MRN_IS_BUTTON (widget->parent))
+- g_object_get (G_OBJECT (widget->parent), "relief", &relief, NULL);
++ if (MRN_IS_BUTTON (gtk_widget_get_parent (widget)))
++ g_object_get (G_OBJECT (gtk_widget_get_parent (widget)), "relief", &relief, NULL);
+
+- if (!MRN_IS_CHECK_BUTTON(widget->parent) &&
+- !MRN_IS_RADIO_BUTTON(widget->parent) &&
++ if (!MRN_IS_CHECK_BUTTON(gtk_widget_get_parent (widget)) &&
++ !MRN_IS_RADIO_BUTTON(gtk_widget_get_parent (widget)) &&
+ !(relief == GTK_RELIEF_NONE &&
+ (state_type == GTK_STATE_NORMAL ||
+ state_type == GTK_STATE_INSENSITIVE)))
+@@ -2127,38 +1985,27 @@ murrine_style_draw_layout (GtkStyle *style,
+
+ break;
+ }
+- widget = widget->parent;
++ widget = gtk_widget_get_parent (widget);
+ }
+
+ if (use_parentbg)
+ murrine_shade (¶ms.parentbg, shade_level, &temp);
+- else if (DETAIL ("cellrenderertext"))
+- murrine_shade (&colors->base[state_type], shade_level, &temp);
+ else
+- murrine_shade (&colors->bg[state_type], shade_level, &temp);
++ murrine_shade (use_text ? &colors->base[state_type] : &colors->bg[state_type], shade_level, &temp);
+ }
+- else if (DETAIL ("cellrenderertext"))
+- murrine_shade (&colors->base[state_type], shade_level, &temp);
+ else
+- murrine_shade (&colors->bg[state_type], shade_level, &temp);
+-
+- etched.red = (int) (temp.r*65535);
+- etched.green = (int) (temp.g*65535);
+- etched.blue = (int) (temp.b*65535);
++ murrine_shade (use_text ? &colors->base[state_type] : &colors->bg[state_type], shade_level, &temp);
+
+-/* gdk_draw_layout_with_colors (window, gc, x+xos, y+yos, layout, &etched, NULL);*/
++ cairo_save (cr);
+
+- /* with cairo *
+- */
+- cairo_t *cr;
+- cr = murrine_begin_paint (window, area);
+- cairo_translate (cr, x+xos, y+yos);
++ /* XXX or cairo_move_to (cr, xos, yos); */
++ cairo_translate (cr, xos, yos);
+ pango_cairo_layout_path (cr, layout);
+ murrine_set_color_rgba (cr, &temp, 0.5);
+ cairo_stroke (cr);
+- cairo_destroy (cr);
+
+-/* printf( "draw_layout: %s %s\n", detail, G_OBJECT_TYPE_NAME (widget->parent));*/
++ cairo_restore (cr);
++/* printf( "draw_layout: %s %s\n", detail, G_OBJECT_TYPE_NAME (gtk_widget_get_parent (widget)));*/
+ }
+
+ if (DETAIL ("accellabel"))
+@@ -2170,29 +2017,26 @@ murrine_style_draw_layout (GtkStyle *style,
+
+ murrine_set_widget_parameters (widget, style, state_type, ¶ms);
+
+- GdkColor etched;
+ MurrineRGB temp;
+
+ murrine_mix_color (&colors->fg[state_type], ¶ms.parentbg, state_type != GTK_STATE_PRELIGHT ? 0.4 : 0.2, &temp);
+
+- etched.red = (int) (temp.r*65535);
+- etched.green = (int) (temp.g*65535);
+- etched.blue = (int) (temp.b*65535);
++ murrine_set_color_rgb (cr, &temp);
+
+- gdk_draw_layout_with_colors(window, gc, x, y, layout, &etched, NULL);
++ pango_cairo_show_layout (cr, layout);
+ }
+ else
+- gdk_draw_layout (window, gc, x, y, layout);
++ {
++ gdk_cairo_set_source_color (cr, use_text ? &style->text[state_type] : &style->fg[state_type]);
+
+- if (area)
+- gdk_gc_set_clip_rectangle (gc, NULL);
++ pango_cairo_show_layout (cr, layout);
++ }
+ }
+
+ static void
+ murrine_style_draw_expander (GtkStyle *style,
+- GdkWindow *window,
++ cairo_t *cr,
+ GtkStateType state_type,
+- GdkRectangle *area,
+ GtkWidget *widget,
+ const gchar *detail,
+ gint x,
+@@ -2202,12 +2046,8 @@ murrine_style_draw_expander (GtkStyle *style,
+ MurrineStyle *murrine_style = MURRINE_STYLE (style);
+ MurrineColors *colors = &murrine_style->colors;
+
+- cairo_t *cr;
+-
+ CHECK_ARGS
+
+- cr = murrine_begin_paint (window, area);
+-
+ WidgetParameters params;
+ ExpanderParameters expander;
+
+@@ -2224,13 +2064,11 @@ murrine_style_draw_expander (GtkStyle *style,
+ expander.style = murrine_style->expanderstyle;
+
+ STYLE_FUNCTION(draw_expander) (cr, colors, ¶ms, &expander, x, y);
+-
+- cairo_destroy (cr);
+ }
+
+ static void
+-murrine_style_draw_focus (GtkStyle *style, GdkWindow *window, GtkStateType state_type,
+- GdkRectangle *area, GtkWidget *widget, const gchar *detail,
++murrine_style_draw_focus (GtkStyle *style, cairo_t *cr, GtkStateType state_type,
++ GtkWidget *widget, const gchar *detail,
+ gint x, gint y, gint width, gint height)
+ {
+ MurrineStyle *murrine_style = MURRINE_STYLE (style);
+@@ -2239,21 +2077,16 @@ murrine_style_draw_focus (GtkStyle *style, GdkWindow *window, GtkStateType state
+ FocusParameters focus;
+ guint8* dash_list;
+
+- cairo_t *cr;
+-
+ CHECK_ARGS
+- SANITIZE_SIZE
+
+ /* Just return if focus drawing is disabled. */
+ if (murrine_style->focusstyle == 0)
+ return;
+
+- cr = gdk_cairo_create (window);
+-
+ murrine_set_widget_parameters (widget, style, state_type, ¶ms);
+
+ /* Corners */
+- if (widget && widget->parent && MRN_IS_COMBO_BOX_ENTRY(widget->parent))
++ if (widget && gtk_widget_get_parent (widget) && MRN_IS_COMBO_BOX_ENTRY(gtk_widget_get_parent (widget)))
+ {
+ if (params.ltr)
+ params.corners = MRN_CORNER_TOPRIGHT | MRN_CORNER_BOTTOMRIGHT;
+@@ -2292,9 +2125,8 @@ murrine_style_draw_focus (GtkStyle *style, GdkWindow *window, GtkStateType state
+ /* Focus type */
+ if (DETAIL("button"))
+ {
+- if (widget && widget->parent &&
+- (MRN_IS_TREE_VIEW (widget->parent) ||
+- MRN_IS_CLIST (widget->parent)))
++ if (widget && gtk_widget_get_parent (widget) &&
++ (MRN_IS_TREE_VIEW (gtk_widget_get_parent (widget))))
+ {
+ focus.type = MRN_FOCUS_TREEVIEW_HEADER;
+ }
+@@ -2308,7 +2140,7 @@ murrine_style_draw_focus (GtkStyle *style, GdkWindow *window, GtkStateType state
+
+ if (relief == GTK_RELIEF_NORMAL)
+ {
+- if (widget && GTK_WIDGET_HAS_DEFAULT (widget))
++ if (widget && gtk_widget_has_default (widget))
+ focus.type = MRN_FOCUS_BUTTON_DEFAULT;
+ else
+ focus.type = MRN_FOCUS_BUTTON;
+@@ -2406,8 +2238,6 @@ murrine_style_draw_focus (GtkStyle *style, GdkWindow *window, GtkStateType state
+ STYLE_FUNCTION(draw_focus) (cr, colors, ¶ms, &focus, x, y, width, height);
+
+ g_free (focus.dash_list);
+-
+- cairo_destroy (cr);
+ }
+
+ static void
+@@ -2523,11 +2353,9 @@ murrine_style_realize (GtkStyle *style)
+
+ contrast = MURRINE_RC_STYLE (style->rc_style)->contrast;
+
+- bg_normal.r = style->bg[0].red/65535.0;
+- bg_normal.g = style->bg[0].green/65535.0;
+- bg_normal.b = style->bg[0].blue/65535.0;
++ murrine_gdk_color_to_murrinergb (&style->bg[GTK_STATE_NORMAL], &bg_normal);
+
+- /* Apply contrast */
++ /* (GtkWidget *) Apply contrast */
+ for (i = 0; i < 9; i++)
+ {
+ murrine_shade (&bg_normal,
+@@ -2536,9 +2364,7 @@ murrine_style_realize (GtkStyle *style)
+ }
+ spots[2] = murrine_get_contrast(spots[2], contrast);
+
+- spot_color.r = style->bg[GTK_STATE_SELECTED].red/65535.0;
+- spot_color.g = style->bg[GTK_STATE_SELECTED].green/65535.0;
+- spot_color.b = style->bg[GTK_STATE_SELECTED].blue/65535.0;
++ murrine_gdk_color_to_murrinergb (&style->bg[GTK_STATE_SELECTED], &spot_color);
+
+ murrine_shade (&spot_color, spots[0], &murrine_style->colors.spot[0]);
+ murrine_shade (&spot_color, spots[1], &murrine_style->colors.spot[1]);
+@@ -2546,25 +2372,10 @@ murrine_style_realize (GtkStyle *style)
+
+ for (i=0; i<5; i++)
+ {
+- murrine_gdk_color_to_rgb (&style->bg[i],
+- &murrine_style->colors.bg[i].r,
+- &murrine_style->colors.bg[i].g,
+- &murrine_style->colors.bg[i].b);
+-
+- murrine_gdk_color_to_rgb (&style->base[i],
+- &murrine_style->colors.base[i].r,
+- &murrine_style->colors.base[i].g,
+- &murrine_style->colors.base[i].b);
+-
+- murrine_gdk_color_to_rgb (&style->text[i],
+- &murrine_style->colors.text[i].r,
+- &murrine_style->colors.text[i].g,
+- &murrine_style->colors.text[i].b);
+-
+- murrine_gdk_color_to_rgb (&style->fg[i],
+- &murrine_style->colors.fg[i].r,
+- &murrine_style->colors.fg[i].g,
+- &murrine_style->colors.fg[i].b);
++ murrine_gdk_color_to_murrinergb (&style->bg[i], &murrine_style->colors.bg[i]);
++ murrine_gdk_color_to_murrinergb (&style->base[i], &murrine_style->colors.base[i]);
++ murrine_gdk_color_to_murrinergb (&style->text[i], &murrine_style->colors.text[i]);
++ murrine_gdk_color_to_murrinergb (&style->fg[i], &murrine_style->colors.fg[i]);
+ }
+ }
+
+@@ -2741,9 +2552,9 @@ murrine_style_draw_render_icon (GtkStyle *style,
+ screen = gtk_widget_get_screen (widget);
+ settings = gtk_settings_get_for_screen (screen);
+ }
+- else if (style->colormap)
++ else if (style->visual)
+ {
+- screen = gdk_colormap_get_screen (style->colormap);
++ screen = gdk_visual_get_screen (style->visual);
+ settings = gtk_settings_get_for_screen (screen);
+ }
+ else
+diff --git a/src/murrine_style.h b/src/murrine_style.h
+index 33ae51c..609f910 100644
+--- a/src/murrine_style.h
++++ b/src/murrine_style.h
+@@ -18,7 +18,7 @@
+ *
+ */
+
+-#include <gtk/gtkstyle.h>
++#include <gtk/gtk.h>
+
+ #ifndef MURRINE_STYLE_H
+ #define MURRINE_STYLE_H
+@@ -101,6 +101,7 @@ struct _MurrineStyleClass
+ MurrineStyleFunctions style_functions[MRN_NUM_DRAW_STYLES];
+ };
+
+-GType murrine_style_get_type (void);
++G_GNUC_INTERNAL void murrine_style_register_types (GTypeModule *module);
++G_GNUC_INTERNAL GType murrine_style_get_type (void);
+
+ #endif /* MURRINE_STYLE_H */
+diff --git a/src/murrine_types.h b/src/murrine_types.h
+index 5dd76a5..9d46b02 100644
+--- a/src/murrine_types.h
++++ b/src/murrine_types.h
+@@ -34,14 +34,6 @@ typedef enum
+
+ typedef enum
+ {
+- MRN_STATE_NORMAL,
+- MRN_STATE_ACTIVE,
+- MRN_STATE_SELECTED,
+- MRN_STATE_INSENSITIVE
+-} MurrineStateType;
+-
+-typedef enum
+-{
+ MRN_CORNER_NONE = 0,
+ MRN_CORNER_TOPLEFT = 1,
+ MRN_CORNER_TOPRIGHT = 2,
+@@ -66,11 +58,11 @@ typedef enum
+
+ typedef enum
+ {
+- MRN_STEPPER_UNKNOWN = 0,
+- MRN_STEPPER_A = 1,
+- MRN_STEPPER_B = 2,
+- MRN_STEPPER_C = 4,
+- MRN_STEPPER_D = 8
++ MRN_STEPPER_UNKNOWN = 0,
++ MRN_STEPPER_START = 1,
++ MRN_STEPPER_START_INNER = 2,
++ MRN_STEPPER_END = 4,
++ MRN_STEPPER_END_INNER = 8
+ } MurrineStepper;
+
+ typedef enum
+@@ -314,6 +306,7 @@ typedef struct
+ boolean horizontal;
+ boolean has_color;
+ boolean within_bevel;
++ boolean trough_upper;
+ int handlestyle;
+ int style;
+ int steppersize;
+@@ -370,7 +363,7 @@ typedef struct
+ boolean ltr;
+ boolean focus;
+ boolean is_default;
+- MurrineStateType state_type;
++ GtkStateType state_type;
+ uint8 corners;
+ uint8 xthickness;
+ uint8 ythickness;
+@@ -470,12 +463,6 @@ struct _MurrineStyleFunctions
+ const WidgetParameters *widget,
+ int x, int y, int width, int height);
+
+- void (*draw_optionmenu) (cairo_t *cr,
+- const MurrineColors *colors,
+- const WidgetParameters *widget,
+- const OptionMenuParameters *optionmenu,
+- int x, int y, int width, int height);
+-
+ void (*draw_menubar) (cairo_t *cr,
+ const MurrineColors *colors,
+ const WidgetParameters *widget,
+diff --git a/src/support.c b/src/support.c
+index dc3a71a..95850fe 100644
+--- a/src/support.c
++++ b/src/support.c
+@@ -46,35 +46,18 @@ murrine_gtk_treeview_get_header_index (GtkTreeView *tv, GtkWidget *header,
+ do
+ {
+ GtkTreeViewColumn *column = GTK_TREE_VIEW_COLUMN(list->data);
+- if ( column->button == header )
++ if ( gtk_tree_view_column_get_widget (column) == header )
+ {
+ *column_index = *columns;
+- *resizable = column->resizable;
++ *resizable = gtk_tree_view_column_get_resizable (column);
+ }
+- if ( column->visible )
++ if ( gtk_tree_view_column_get_visible (column) )
+ (*columns)++;
+ } while ((list = g_list_next(list)));
+
+ g_list_free (list_start);
+ }
+
+-void
+-murrine_gtk_clist_get_header_index (GtkCList *clist, GtkWidget *button,
+- gint *column_index, gint *columns)
+-{
+- int i;
+- *columns = clist->columns;
+-
+- for (i=0; i<*columns; i++)
+- {
+- if (clist->column[i].button == button)
+- {
+- *column_index = i;
+- break;
+- }
+- }
+-}
+-
+ static GtkRequisition default_option_indicator_size = { 7, 13 };
+ static GtkBorder default_option_indicator_spacing = { 7, 5, 2, 2 };
+
+@@ -107,46 +90,6 @@ murrine_option_menu_get_props (GtkWidget *widget,
+ *indicator_spacing = default_option_indicator_spacing;
+ }
+
+-GtkWidget*
+-murrine_special_get_ancestor (GtkWidget *widget, GType widget_type)
+-{
+- g_return_val_if_fail(GTK_IS_WIDGET(widget), NULL);
+-
+- while (widget && widget->parent
+- && !g_type_is_a(GTK_WIDGET_TYPE(widget->parent),
+- widget_type))
+- widget = widget->parent;
+-
+- if (!
+- (widget && widget->parent
+- && g_type_is_a(GTK_WIDGET_TYPE(widget->parent), widget_type)))
+- return NULL;
+-
+- return widget;
+-}
+-
+-GtkWidget*
+-murrine_get_parent_window (GtkWidget *widget)
+-{
+- GtkWidget *parent = widget->parent;
+-
+- while (parent && GTK_WIDGET_NO_WINDOW (parent))
+- parent = parent->parent;
+-
+- return parent;
+-}
+-
+-GdkColor*
+-murrine_get_parent_bgcolor (GtkWidget *widget)
+-{
+- GtkWidget *parent = murrine_get_parent_window (widget);
+-
+- if (parent && parent->style)
+- return &parent->style->bg[GTK_STATE_NORMAL];
+-
+- return NULL;
+-}
+-
+ gboolean
+ murrine_object_is_a (const GObject * object, const gchar * type_name)
+ {
+@@ -190,7 +133,7 @@ murrine_find_combo_box_widget (GtkWidget *widget)
+ if (GTK_IS_COMBO_BOX (widget))
+ result = widget;
+ else
+- result = murrine_find_combo_box_widget(widget->parent);
++ result = murrine_find_combo_box_widget(gtk_widget_get_parent(widget));
+ }
+
+ return result;
+@@ -202,100 +145,19 @@ murrine_is_combo_box (GtkWidget *widget)
+ return (murrine_find_combo_box_widget(widget) != NULL);
+ }
+
+-MurrineStepper
+-murrine_scrollbar_get_stepper (GtkWidget *widget,
+- GdkRectangle *stepper)
+-{
+- MurrineStepper value = MRN_STEPPER_UNKNOWN;
+- GdkRectangle tmp;
+- GdkRectangle check_rectangle;
+- GtkOrientation orientation;
+-
+- g_return_val_if_fail (GTK_IS_RANGE (widget), MRN_STEPPER_UNKNOWN);
+-
+- check_rectangle.x = widget->allocation.x;
+- check_rectangle.y = widget->allocation.y;
+- check_rectangle.width = stepper->width;
+- check_rectangle.height = stepper->height;
+-
+- orientation = GTK_RANGE (widget)->orientation;
+-
+- if (widget->allocation.x == -1 && widget->allocation.y == -1)
+- return MRN_STEPPER_UNKNOWN;
+-
+- if (gdk_rectangle_intersect (stepper, &check_rectangle, &tmp))
+- value = MRN_STEPPER_A;
+-
+- if (value == MRN_STEPPER_UNKNOWN) /* Haven't found a match */
+- {
+- if (orientation == GTK_ORIENTATION_HORIZONTAL)
+- check_rectangle.x = widget->allocation.x + stepper->width;
+- else
+- check_rectangle.y = widget->allocation.y + stepper->height;
+-
+- if (gdk_rectangle_intersect (stepper, &check_rectangle, &tmp))
+- value = MRN_STEPPER_B;
+- }
+-
+- if (value == MRN_STEPPER_UNKNOWN) /* Still haven't found a match */
+- {
+- if (orientation == GTK_ORIENTATION_HORIZONTAL)
+- check_rectangle.x = widget->allocation.x + widget->allocation.width - (stepper->width * 2);
+- else
+- check_rectangle.y = widget->allocation.y + widget->allocation.height - (stepper->height * 2);
+-
+- if (gdk_rectangle_intersect (stepper, &check_rectangle, &tmp))
+- value = MRN_STEPPER_C;
+- }
+-
+- if (value == MRN_STEPPER_UNKNOWN) /* STILL haven't found a match */
+- {
+- if (orientation == GTK_ORIENTATION_HORIZONTAL)
+- check_rectangle.x = widget->allocation.x + widget->allocation.width - stepper->width;
+- else
+- check_rectangle.y = widget->allocation.y + widget->allocation.height - stepper->height;
+-
+- if (gdk_rectangle_intersect (stepper, &check_rectangle, &tmp))
+- value = MRN_STEPPER_D;
+- }
+-
+- return value;
+-}
+-
+-MurrineStepper
+-murrine_scrollbar_visible_steppers (GtkWidget *widget)
+-{
+- MurrineStepper steppers = 0;
+-
+- g_return_val_if_fail (GTK_IS_RANGE (widget), MRN_STEPPER_UNKNOWN);
+-
+- if (GTK_RANGE (widget)->has_stepper_a)
+- steppers |= MRN_STEPPER_A;
+-
+- if (GTK_RANGE (widget)->has_stepper_b)
+- steppers |= MRN_STEPPER_B;
+-
+- if (GTK_RANGE (widget)->has_stepper_c)
+- steppers |= MRN_STEPPER_C;
+-
+- if (GTK_RANGE (widget)->has_stepper_d)
+- steppers |= MRN_STEPPER_D;
+-
+- return steppers;
+-}
+-
+ MurrineJunction
+ murrine_scrollbar_get_junction (GtkWidget *widget)
+ {
+ GtkAdjustment *adj;
+ MurrineJunction junction = MRN_JUNCTION_NONE;
+
+- g_return_val_if_fail (GTK_IS_RANGE (widget), MRN_JUNCTION_NONE);
++ if (!GTK_IS_RANGE (widget))
++ return MRN_JUNCTION_NONE;
+
+- adj = GTK_RANGE (widget)->adjustment;
++ adj = gtk_range_get_adjustment(GTK_RANGE (widget));
+
+- if (adj->value <= adj->lower &&
+- (GTK_RANGE (widget)->has_stepper_a || GTK_RANGE (widget)->has_stepper_b))
++ if (gtk_adjustment_get_value(adj) <= gtk_adjustment_get_lower(adj) /*&&
++ (GTK_RANGE (widget)->has_stepper_a || GTK_RANGE (widget)->has_stepper_b)*/)
+ {
+ if (!gtk_range_get_inverted (GTK_RANGE (widget)))
+ junction |= MRN_JUNCTION_BEGIN;
+@@ -303,8 +165,8 @@ murrine_scrollbar_get_junction (GtkWidget *widget)
+ junction |= MRN_JUNCTION_END;
+ }
+
+- if (adj->value >= adj->upper - adj->page_size &&
+- (GTK_RANGE (widget)->has_stepper_c || GTK_RANGE (widget)->has_stepper_d))
++ if (gtk_adjustment_get_value(adj) >= gtk_adjustment_get_upper(adj) - gtk_adjustment_get_page_size(adj) /*&&
++ (GTK_RANGE (widget)->has_stepper_c || GTK_RANGE (widget)->has_stepper_d)*/)
+ {
+ if (!gtk_range_get_inverted (GTK_RANGE (widget)))
+ junction |= MRN_JUNCTION_END;
+@@ -324,16 +186,17 @@ gboolean murrine_is_panel_widget (GtkWidget *widget)
+ void
+ murrine_set_toolbar_parameters (ToolbarParameters *toolbar,
+ GtkWidget *widget,
+- GdkWindow *window,
+ gint x, gint y)
+ {
++ GtkAllocation allocation;
++
++ gtk_widget_get_allocation (widget, &allocation);
+ toolbar->topmost = FALSE;
+
+- if (x == 0 && y == 0)
+- {
+- if (widget && widget->allocation.x == 0 && widget->allocation.y == 0)
++ if (x == 0 && y == 0) {
++ if (widget && allocation.x == 0 && allocation.y == 0)
+ {
+- if (widget->window == window && MRN_IS_TOOLBAR (widget))
++ if (MRN_IS_TOOLBAR (widget))
+ {
+ toolbar->topmost = TRUE;
+ }
+@@ -382,7 +245,7 @@ murrine_get_notebook_tab_position (GtkWidget *widget,
+
+ /* Skip invisible tabs */
+ tab_label = gtk_notebook_get_tab_label (notebook, tab_child);
+- if (!tab_label || !GTK_WIDGET_VISIBLE (tab_label))
++ if (!tab_label || !gtk_widget_get_visible (tab_label))
+ continue;
+ /* This is the same what the notebook does internally. */
+ if (tab_label && !gtk_widget_get_child_visible (tab_label))
+@@ -394,29 +257,23 @@ murrine_get_notebook_tab_position (GtkWidget *widget,
+ return;
+ }
+
+- gtk_notebook_query_tab_label_packing (notebook, tab_child,
+- &expand,
+- NULL, /* don't need fill */
+- &pack_type);
++ gtk_container_child_get (GTK_CONTAINER (notebook), tab_child,
++ "tab-expand", &expand,
++ "tab-pack", &pack_type,
++ NULL);
+
+- if (!found_tabs)
+- {
++ if (!found_tabs) {
+ found_tabs = TRUE;
+ *start = FALSE;
+ *end = FALSE;
+ }
+
+- if (expand)
+- {
++ if (expand) {
+ *start = TRUE;
+ *end = TRUE;
+- }
+- else if (pack_type == GTK_PACK_START)
+- {
++ } else if (pack_type == GTK_PACK_START) {
+ *start = TRUE;
+- }
+- else
+- {
++ } else {
+ *end = TRUE;
+ }
+ }
+diff --git a/src/support.h b/src/support.h
+index 719edcf..e0c7d17 100644
+--- a/src/support.h
++++ b/src/support.h
+@@ -129,10 +129,6 @@ G_GNUC_INTERNAL void murrine_gtk_treeview_get_header_index (GtkTreeView *tv,
+ gint *column_index,
+ gint *columns,
+ gboolean *resizable);
+-G_GNUC_INTERNAL void murrine_gtk_clist_get_header_index (GtkCList *clist,
+- GtkWidget *button,
+- gint *column_index,
+- gint *columns);
+ G_GNUC_INTERNAL void murrine_option_menu_get_props (GtkWidget *widget,
+ GtkRequisition *indicator_size,
+ GtkBorder *indicator_spacing);
+@@ -142,7 +138,6 @@ G_GNUC_INTERNAL MurrineJunction murrine_scrollbar_get_junction (GtkWidget *widge
+ G_GNUC_INTERNAL gboolean murrine_is_panel_widget (GtkWidget *widget);
+ G_GNUC_INTERNAL void murrine_set_toolbar_parameters (ToolbarParameters *toolbar,
+ GtkWidget *widget,
+- GdkWindow *window,
+ gint x, gint y);
+ G_GNUC_INTERNAL void murrine_get_notebook_tab_position (GtkWidget *widget,
+ gboolean *start,
More information about the Frugalware-git
mailing list