summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.van.berkom@gmail.com>2010-12-05 00:36:37 +0900
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2010-12-05 00:36:37 +0900
commit0d786985a368d88e8ab4e45fc3607efc5e773732 (patch)
tree5dfc8ec0e27ac3c23b9dc2eb097018971c28fd6b
parent1d3961b34258a7a8c97ca12993220554369fccb1 (diff)
parentcd76b057e9693b6919f4ccbe40ce205efc8d3caf (diff)
downloadgtk+-0d786985a368d88e8ab4e45fc3607efc5e773732.tar.gz
Merge branch 'master' into treeview-refactor
Conflicts: gtk/gtkmarshalers.list tests/Makefile.am
-rw-r--r--config.h.win32.in6
-rw-r--r--configure.ac22
-rw-r--r--demos/gtk-demo/colorsel.c65
-rw-r--r--demos/gtk-demo/combobox.c6
-rw-r--r--demos/gtk-demo/main.c2
-rw-r--r--demos/gtk-demo/offscreen_window.c25
-rw-r--r--demos/gtk-demo/offscreen_window2.c19
-rw-r--r--demos/gtk-demo/rotated_text.c50
-rw-r--r--demos/gtk-demo/textview.c6
-rw-r--r--docs/reference/gdk/gdk-docs.sgml1
-rw-r--r--docs/reference/gdk/gdk3-overrides.txt23
-rw-r--r--docs/reference/gdk/gdk3-sections.txt45
-rw-r--r--docs/reference/gdk/gdk3.types3
-rw-r--r--docs/reference/gtk/Makefile.am29
-rw-r--r--docs/reference/gtk/gtk-docs.sgml23
-rw-r--r--docs/reference/gtk/gtk3-sections.txt345
-rw-r--r--docs/reference/gtk/gtk3.types4
-rw-r--r--docs/reference/gtk/images/arrows.pngbin0 -> 549 bytes
-rw-r--r--docs/reference/gtk/images/background.pngbin0 -> 1400 bytes
-rw-r--r--docs/reference/gtk/images/border1.pngbin0 -> 961 bytes
-rw-r--r--docs/reference/gtk/images/border2.pngbin0 -> 1684 bytes
-rw-r--r--docs/reference/gtk/images/border3.pngbin0 -> 2713 bytes
-rw-r--r--docs/reference/gtk/images/checks.pngbin0 -> 529 bytes
-rw-r--r--docs/reference/gtk/images/ease-in-out.pngbin0 -> 8955 bytes
-rw-r--r--docs/reference/gtk/images/ease-in.pngbin0 -> 8862 bytes
-rw-r--r--docs/reference/gtk/images/ease-out.pngbin0 -> 8819 bytes
-rw-r--r--docs/reference/gtk/images/ease.pngbin0 -> 9216 bytes
-rw-r--r--docs/reference/gtk/images/expanders.pngbin0 -> 697 bytes
-rw-r--r--docs/reference/gtk/images/extensions.pngbin0 -> 475 bytes
-rw-r--r--docs/reference/gtk/images/focus.pngbin0 -> 371 bytes
-rw-r--r--docs/reference/gtk/images/frame-gap.pngbin0 -> 322 bytes
-rw-r--r--docs/reference/gtk/images/frames.pngbin0 -> 3393 bytes
-rw-r--r--docs/reference/gtk/images/gradient1.pngbin0 -> 722 bytes
-rw-r--r--docs/reference/gtk/images/gradient2.pngbin0 -> 397 bytes
-rw-r--r--docs/reference/gtk/images/gradient3.pngbin0 -> 2579 bytes
-rw-r--r--docs/reference/gtk/images/gradient4.pngbin0 -> 4901 bytes
-rw-r--r--docs/reference/gtk/images/handles.pngbin0 -> 660 bytes
-rw-r--r--docs/reference/gtk/images/linear.pngbin0 -> 8693 bytes
-rw-r--r--docs/reference/gtk/images/options.pngbin0 -> 1048 bytes
-rw-r--r--docs/reference/gtk/images/slices.pngbin0 -> 1217 bytes
-rw-r--r--docs/reference/gtk/images/sliders.pngbin0 -> 470 bytes
-rw-r--r--docs/reference/gtk/migrating-2to3.xml6
-rw-r--r--docs/reference/gtk/migrating-ClientSideWindows.sgml14
-rw-r--r--docs/reference/gtk/migrating-GtkStyleContext.xml631
-rw-r--r--docs/reference/gtk/tmpl/gtkenums.sgml23
-rw-r--r--docs/reference/gtk/tmpl/gtkrc.sgml4
-rw-r--r--docs/tools/shooter.c2
-rw-r--r--gdk/Makefile.am12
-rw-r--r--gdk/gdk.h1
-rw-r--r--gdk/gdk.symbols14
-rw-r--r--gdk/gdkcairo.c78
-rw-r--r--gdk/gdkcairo.h4
-rw-r--r--gdk/gdkdevice.c10
-rw-r--r--gdk/gdkdisplay.c9
-rw-r--r--gdk/gdkdraw.c123
-rw-r--r--gdk/gdkdrawable.h95
-rw-r--r--gdk/gdkevents.c21
-rw-r--r--gdk/gdkevents.h22
-rw-r--r--gdk/gdkinternals.h50
-rw-r--r--gdk/gdkmedialib.c120
-rw-r--r--gdk/gdkmedialib.h45
-rw-r--r--gdk/gdkoffscreenwindow.c211
-rw-r--r--gdk/gdkpixbuf-drawable.c2
-rw-r--r--gdk/gdkprivate.h15
-rw-r--r--gdk/gdktypes.h4
-rw-r--r--gdk/gdkwindow.c2262
-rw-r--r--gdk/gdkwindow.h25
-rw-r--r--gdk/gdkwindowimpl.c18
-rw-r--r--gdk/gdkwindowimpl.h29
-rw-r--r--gdk/quartz/GdkQuartzWindow.c10
-rw-r--r--gdk/quartz/gdkeventloop-quartz.c3
-rw-r--r--gdk/quartz/gdkwindow-quartz.c26
-rw-r--r--gdk/tests/gdk-color.c1
-rw-r--r--gdk/win32/gdkdrawable-win32.c12
-rw-r--r--gdk/win32/gdkevents-win32.c93
-rw-r--r--gdk/win32/gdkwindow-win32.c28
-rw-r--r--gdk/x11/Makefile.am2
-rw-r--r--gdk/x11/gdkcursor-x11.c2
-rw-r--r--gdk/x11/gdkdevice-core.c27
-rw-r--r--gdk/x11/gdkdevice-xi.c4
-rw-r--r--gdk/x11/gdkdevice-xi2.c8
-rw-r--r--gdk/x11/gdkdevicemanager-core.c20
-rw-r--r--gdk/x11/gdkdevicemanager-xi2.c2
-rw-r--r--gdk/x11/gdkdisplay-x11.c74
-rw-r--r--gdk/x11/gdkdnd-x11.c134
-rw-r--r--gdk/x11/gdkdrawable-x11.c235
-rw-r--r--gdk/x11/gdkdrawable-x11.h75
-rw-r--r--gdk/x11/gdkeventsource.c8
-rw-r--r--gdk/x11/gdkgeometry-x11.c44
-rw-r--r--gdk/x11/gdkinput.c26
-rw-r--r--gdk/x11/gdkkeys-x11.c5
-rw-r--r--gdk/x11/gdkprivate-x11.h6
-rw-r--r--gdk/x11/gdkproperty-x11.c4
-rw-r--r--gdk/x11/gdkscreen-x11.c2
-rw-r--r--gdk/x11/gdkselection-x11.c6
-rw-r--r--gdk/x11/gdktestutils-x11.c26
-rw-r--r--gdk/x11/gdkwindow-x11.c699
-rw-r--r--gdk/x11/gdkwindow-x11.h23
-rw-r--r--gdk/x11/gdkx.h52
-rw-r--r--gtk/Makefile.am80
-rw-r--r--gtk/gtk.h9
-rw-r--r--gtk/gtk.symbols7
-rw-r--r--gtk/gtk9slice.c375
-rw-r--r--gtk/gtk9slice.h59
-rw-r--r--gtk/gtkanimationdescription.c137
-rw-r--r--gtk/gtkanimationdescription.h49
-rw-r--r--gtk/gtkborder.c76
-rw-r--r--gtk/gtkborder.h68
-rw-r--r--gtk/gtkbutton.c120
-rw-r--r--gtk/gtkcellrenderer.c6
-rw-r--r--gtk/gtkcellrendererpixbuf.c26
-rw-r--r--gtk/gtkcheckbutton.c88
-rw-r--r--gtk/gtkcombobox.c309
-rw-r--r--gtk/gtkcontainer.c53
-rw-r--r--gtk/gtkcontainer.h5
-rw-r--r--gtk/gtkcssprovider.c3847
-rw-r--r--gtk/gtkcssprovider.h79
-rw-r--r--gtk/gtkentry.c23
-rw-r--r--gtk/gtkenums.h106
-rw-r--r--gtk/gtkexpander.c13
-rw-r--r--gtk/gtkgradient.c282
-rw-r--r--gtk/gtkgradient.h61
-rw-r--r--gtk/gtkiconfactory.c224
-rw-r--r--gtk/gtkiconfactory.h1
-rw-r--r--gtk/gtkicontheme.c94
-rw-r--r--gtk/gtkicontheme.h7
-rw-r--r--gtk/gtkiconview.c4
-rw-r--r--gtk/gtkimage.c24
-rw-r--r--gtk/gtkimcontextsimple.c2
-rw-r--r--gtk/gtkimmodule.c4
-rw-r--r--gtk/gtkimmulticontext.c2
-rw-r--r--gtk/gtkinfobar.c49
-rw-r--r--gtk/gtklabel.c77
-rw-r--r--gtk/gtkmain.c8
-rw-r--r--gtk/gtkmarshalers.list1
-rw-r--r--gtk/gtkmenu.c380
-rw-r--r--gtk/gtkmenubar.c59
-rw-r--r--gtk/gtkmenuitem.c6
-rw-r--r--gtk/gtkmodifierstyle.c287
-rw-r--r--gtk/gtkmodifierstyle.h74
-rw-r--r--gtk/gtknotebook.c62
-rw-r--r--gtk/gtkplug-x11.c10
-rw-r--r--gtk/gtkradiobutton.c74
-rw-r--r--gtk/gtkrange.c16
-rw-r--r--gtk/gtkrc.c55
-rw-r--r--gtk/gtkrc.h4
-rw-r--r--gtk/gtkscrollbar.c4
-rw-r--r--gtk/gtkselection.c2
-rw-r--r--gtk/gtksettings.c188
-rw-r--r--gtk/gtksettings.h2
-rw-r--r--gtk/gtksocket-x11.c45
-rw-r--r--gtk/gtkspinner.c157
-rw-r--r--gtk/gtkstatusicon.c10
-rw-r--r--gtk/gtkstyle.c3106
-rw-r--r--gtk/gtkstyle.h33
-rw-r--r--gtk/gtkstylecontext.c3985
-rw-r--r--gtk/gtkstylecontext.h564
-rw-r--r--gtk/gtkstyleproperties.c1226
-rw-r--r--gtk/gtkstyleproperties.h117
-rw-r--r--gtk/gtkstyleprovider.c148
-rw-r--r--gtk/gtkstyleprovider.h128
-rw-r--r--gtk/gtksymboliccolor.c558
-rw-r--r--gtk/gtksymboliccolor.h55
-rw-r--r--gtk/gtktextbufferserialize.c4
-rw-r--r--gtk/gtkthemes.h4
-rw-r--r--gtk/gtkthemingengine.c3059
-rw-r--r--gtk/gtkthemingengine.h251
-rw-r--r--gtk/gtktimeline.c735
-rw-r--r--gtk/gtktimeline.h117
-rw-r--r--gtk/gtktogglebutton.c28
-rw-r--r--gtk/gtktoolitemgroup.c2
-rw-r--r--gtk/gtktrayicon-x11.c4
-rw-r--r--gtk/gtkwidget.c1197
-rw-r--r--gtk/gtkwidget.h93
-rw-r--r--gtk/gtkwidgetpath.c1048
-rw-r--r--gtk/gtkwidgetpath.h113
-rw-r--r--gtk/gtkwindow.c76
-rw-r--r--gtk/gtkxembed.c4
-rw-r--r--gtk/tests/Makefile.am9
-rw-r--r--gtk/tests/stylecontext.c534
-rw-r--r--gtk/tests/test.css0
-rw-r--r--gtk/tests/test.pngbin0 -> 3569 bytes
-rw-r--r--modules/input/gtkimcontextxim.c10
-rw-r--r--modules/other/gail/gailwindow.c12
-rw-r--r--po-properties/es.po2395
-rw-r--r--po-properties/he.po2252
-rw-r--r--po/es.po417
-rw-r--r--po/he.po410
-rw-r--r--po/sl.po4
-rw-r--r--tests/Makefile.am16
-rw-r--r--tests/gtkoffscreenbox.c31
-rw-r--r--tests/styleexamples.c384
-rw-r--r--tests/testadjustsize.c14
-rw-r--r--tests/testcalendar.c27
-rw-r--r--tests/testcombochange.c27
-rw-r--r--tests/testexpand.c20
-rw-r--r--tests/testframe.c84
-rw-r--r--tests/testgrid.c6
-rw-r--r--tests/testgtk.c167
-rw-r--r--tests/testgtk.css33
-rw-r--r--tests/testgtk2.css9
-rw-r--r--tests/testgtkrc228
-rw-r--r--tests/testgtkrc221
-rw-r--r--tests/testtext.c3082
-rw-r--r--tests/testtooltips.c4
-rw-r--r--tests/testwindows.c5
206 files changed, 28337 insertions, 12510 deletions
diff --git a/config.h.win32.in b/config.h.win32.in
index dec0d03092..23f0156685 100644
--- a/config.h.win32.in
+++ b/config.h.win32.in
@@ -276,12 +276,6 @@
/* Whether to load modules via .la files rather than directly */
/* #undef USE_LA_MODULES */
-/* Define to 1 if medialib is available and should be used */
-/* #undef USE_MEDIALIB */
-
-/* Define to 1 if medialib 2.5 is available */
-/* #undef USE_MEDIALIB25 */
-
/* Define to 1 if XXM is available and should be used */
#ifndef _MSC_VER
# define USE_MMX 1
diff --git a/configure.ac b/configure.ac
index d5ef2b7bb2..477aa7cda8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -858,28 +858,6 @@ AC_CHECK_HEADER(sys/sysinfo.h,
AC_DEFINE(HAVE_SYS_SYSINFO_H, 1,
[Define to 1 if sys/sysinfo.h is available]))
-AC_MSG_CHECKING(for mediaLib 2.3)
-use_mlib25=no
-# Check for a mediaLib 2.3 function since that is what the GTK+ mediaLib
-# patch requires.
-AC_CHECK_LIB(mlib, mlib_ImageSetStruct, use_mlib=yes, use_mlib=no)
-if test $use_mlib = yes; then
- AC_DEFINE(USE_MEDIALIB, 1,
- [Define to 1 if medialib is available and should be used])
- MEDIA_LIB=-lmlib
-
- AC_MSG_CHECKING(for mediaLib 2.5)
- # Check for a mediaLib 2.5 function since that is what is needed for
- # gdk_rgb_convert integration.
- AC_CHECK_LIB(mlib, mlib_VideoColorRGBint_to_BGRAint, use_mlib25=yes, use_mlib25=no)
- if test $use_mlib25 = yes; then
- AC_DEFINE(USE_MEDIALIB25, 1,
- [Define to 1 if medialib 2.5 is available])
- fi
-fi
-AM_CONDITIONAL(USE_MEDIALIB, test $use_mlib = yes)
-AM_CONDITIONAL(USE_MEDIALIB25, test $use_mlib25 = yes)
-
dnl Look for a host system's gdk-pixbuf-csource if we are cross-compiling
AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
diff --git a/demos/gtk-demo/colorsel.c b/demos/gtk-demo/colorsel.c
index eacfa17d38..14ea9107c4 100644
--- a/demos/gtk-demo/colorsel.c
+++ b/demos/gtk-demo/colorsel.c
@@ -9,35 +9,37 @@
static GtkWidget *window = NULL;
static GtkWidget *da;
-static GdkColor color;
+static GdkRGBA color;
static GtkWidget *frame;
-/* Expose callback for the drawing area
+/* draw callback for the drawing area
*/
static gboolean
-draw_callback (GtkWidget *widget,
+draw_callback (GtkWidget *widget,
cairo_t *cr,
gpointer data)
{
- GtkStyle *style;
+ GtkStyleContext *context;
+ GdkRGBA *bg;
- style = gtk_widget_get_style (widget);
-
- gdk_cairo_set_source_color (cr, &style->bg[GTK_STATE_NORMAL]);
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_get (context, 0, "background-color", &bg, NULL);
+ gdk_cairo_set_source_rgba (cr, bg);
cairo_paint (cr);
+ gdk_rgba_free (bg);
return TRUE;
}
static void
change_color_callback (GtkWidget *button,
- gpointer data)
+ gpointer data)
{
GtkWidget *dialog;
GtkColorSelection *colorsel;
GtkColorSelectionDialog *selection_dialog;
gint response;
-
+
dialog = gtk_color_selection_dialog_new ("Changing color");
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window));
@@ -45,20 +47,19 @@ change_color_callback (GtkWidget *button,
selection_dialog = GTK_COLOR_SELECTION_DIALOG (dialog);
colorsel = GTK_COLOR_SELECTION (gtk_color_selection_dialog_get_color_selection (selection_dialog));
- gtk_color_selection_set_previous_color (colorsel, &color);
- gtk_color_selection_set_current_color (colorsel, &color);
+ gtk_color_selection_set_previous_rgba (colorsel, &color);
+ gtk_color_selection_set_current_rgba (colorsel, &color);
gtk_color_selection_set_has_palette (colorsel, TRUE);
-
+
response = gtk_dialog_run (GTK_DIALOG (dialog));
if (response == GTK_RESPONSE_OK)
{
- gtk_color_selection_get_current_color (colorsel,
- &color);
-
- gtk_widget_modify_bg (da, GTK_STATE_NORMAL, &color);
+ gtk_color_selection_get_current_rgba (colorsel, &color);
+
+ gtk_widget_override_background_color (da, 0, &color);
}
-
+
gtk_widget_destroy (dialog);
}
@@ -68,20 +69,21 @@ do_colorsel (GtkWidget *do_widget)
GtkWidget *vbox;
GtkWidget *button;
GtkWidget *alignment;
-
+
if (!window)
{
color.red = 0;
- color.blue = 65535;
+ color.blue = 1;
color.green = 0;
-
+ color.alpha = 1;
+
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Color Selection");
g_signal_connect (window, "destroy",
- G_CALLBACK (gtk_widget_destroyed), &window);
+ G_CALLBACK (gtk_widget_destroyed), &window);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
@@ -92,33 +94,32 @@ do_colorsel (GtkWidget *do_widget)
/*
* Create the color swatch area
*/
-
-
+
+
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
da = gtk_drawing_area_new ();
- g_signal_connect (da, "draw",
- G_CALLBACK (draw_callback), NULL);
+ g_signal_connect (da, "draw", G_CALLBACK (draw_callback), NULL);
/* set a minimum size */
gtk_widget_set_size_request (da, 200, 200);
/* set the color */
- gtk_widget_modify_bg (da, GTK_STATE_NORMAL, &color);
-
+ gtk_widget_override_background_color (da, 0, &color);
+
gtk_container_add (GTK_CONTAINER (frame), da);
alignment = gtk_alignment_new (1.0, 0.5, 0.0, 0.0);
-
+
button = gtk_button_new_with_mnemonic ("_Change the above color");
gtk_container_add (GTK_CONTAINER (alignment), button);
-
+
gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0);
-
+
g_signal_connect (button, "clicked",
- G_CALLBACK (change_color_callback), NULL);
+ G_CALLBACK (change_color_callback), NULL);
}
if (!gtk_widget_get_visible (window))
diff --git a/demos/gtk-demo/combobox.c b/demos/gtk-demo/combobox.c
index 308242b109..fbe6c12eeb 100644
--- a/demos/gtk-demo/combobox.c
+++ b/demos/gtk-demo/combobox.c
@@ -281,18 +281,18 @@ G_DEFINE_TYPE_WITH_CODE (MaskEntry, mask_entry, GTK_TYPE_ENTRY,
static void
mask_entry_set_background (MaskEntry *entry)
{
- static const GdkColor error_color = { 0, 65535, 60000, 60000 };
+ static const GdkRGBA error_color = { 1.0, 0.9, 0.9, 1.0 };
if (entry->mask)
{
if (!g_regex_match_simple (entry->mask, gtk_entry_get_text (GTK_ENTRY (entry)), 0, 0))
{
- gtk_widget_modify_base (GTK_WIDGET (entry), GTK_STATE_NORMAL, &error_color);
+ gtk_widget_override_color (GTK_WIDGET (entry), 0, &error_color);
return;
}
}
- gtk_widget_modify_base (GTK_WIDGET (entry), GTK_STATE_NORMAL, NULL);
+ gtk_widget_override_color (GTK_WIDGET (entry), 0, NULL);
}
diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c
index e0c9fb896a..81bd5b6e4e 100644
--- a/demos/gtk-demo/main.c
+++ b/demos/gtk-demo/main.c
@@ -751,7 +751,7 @@ create_text (GtkTextBuffer **buffer,
if (is_source)
{
font_desc = pango_font_description_from_string ("monospace");
- gtk_widget_modify_font (text_view, font_desc);
+ gtk_widget_override_font (text_view, font_desc);
pango_font_description_free (font_desc);
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view),
diff --git a/demos/gtk-demo/offscreen_window.c b/demos/gtk-demo/offscreen_window.c
index cb014bc2ac..27ff99ef8d 100644
--- a/demos/gtk-demo/offscreen_window.c
+++ b/demos/gtk-demo/offscreen_window.c
@@ -230,7 +230,7 @@ gtk_rotated_bin_realize (GtkWidget *widget)
{
GtkRotatedBin *bin = GTK_ROTATED_BIN (widget);
GtkAllocation allocation;
- GtkStyle *style;
+ GtkStyleContext *context;
GdkWindow *window;
GdkWindowAttr attributes;
gint attributes_mask;
@@ -291,9 +291,9 @@ gtk_rotated_bin_realize (GtkWidget *widget)
G_CALLBACK (offscreen_window_from_parent), bin);
gtk_widget_style_attach (widget);
- style = gtk_widget_get_style (widget);
- gtk_style_set_background (style, window, GTK_STATE_NORMAL);
- gtk_style_set_background (style, bin->offscreen_window, GTK_STATE_NORMAL);
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_set_background (context, window);
+ gtk_style_context_set_background (context, bin->offscreen_window);
gdk_window_show (bin->offscreen_window);
}
@@ -542,12 +542,11 @@ gtk_rotated_bin_draw (GtkWidget *widget,
}
if (gtk_cairo_should_draw_window (cr, bin->offscreen_window))
{
- gtk_paint_flat_box (gtk_widget_get_style (widget), cr,
- GTK_STATE_NORMAL, GTK_SHADOW_NONE,
- widget, "blah",
- 0, 0,
- gdk_window_get_width (bin->offscreen_window),
- gdk_window_get_height (bin->offscreen_window));
+ gtk_render_background (gtk_widget_get_style_context (widget),
+ cr,
+ 0, 0,
+ gdk_window_get_width (bin->offscreen_window),
+ gdk_window_get_height (bin->offscreen_window));
if (bin->child)
gtk_container_propagate_draw (GTK_CONTAINER (widget),
@@ -575,7 +574,7 @@ do_offscreen_window (GtkWidget *do_widget)
if (!window)
{
GtkWidget *bin, *vbox, *scale, *button;
- GdkColor black;
+ GdkRGBA black;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
@@ -585,8 +584,8 @@ do_offscreen_window (GtkWidget *do_widget)
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
- gdk_color_parse ("black", &black);
- gtk_widget_modify_bg (window, GTK_STATE_NORMAL, &black);
+ gdk_rgba_parse (&black, "black");
+ gtk_widget_override_background_color (window, 0, &black);
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
diff --git a/demos/gtk-demo/offscreen_window2.c b/demos/gtk-demo/offscreen_window2.c
index 7fd2940f3a..96d953dbbe 100644
--- a/demos/gtk-demo/offscreen_window2.c
+++ b/demos/gtk-demo/offscreen_window2.c
@@ -168,7 +168,7 @@ gtk_mirror_bin_realize (GtkWidget *widget)
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
GtkAllocation allocation;
- GtkStyle *style;
+ GtkStyleContext *context;
GdkWindow *window;
GdkWindowAttr attributes;
gint attributes_mask;
@@ -229,9 +229,9 @@ gtk_mirror_bin_realize (GtkWidget *widget)
G_CALLBACK (offscreen_window_from_parent), bin);
gtk_widget_style_attach (widget);
- style = gtk_widget_get_style (widget);
- gtk_style_set_background (style, window, GTK_STATE_NORMAL);
- gtk_style_set_background (style, bin->offscreen_window, GTK_STATE_NORMAL);
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_set_background (context, window);
+ gtk_style_context_set_background (context, bin->offscreen_window);
gdk_window_show (bin->offscreen_window);
}
@@ -451,12 +451,11 @@ gtk_mirror_bin_draw (GtkWidget *widget,
}
else if (gtk_cairo_should_draw_window (cr, bin->offscreen_window))
{
- gtk_paint_flat_box (gtk_widget_get_style (widget), cr,
- GTK_STATE_NORMAL, GTK_SHADOW_NONE,
- widget, "blah",
- 0, 0,
- gdk_window_get_width (bin->offscreen_window),
- gdk_window_get_height (bin->offscreen_window));
+ gtk_render_background (gtk_widget_get_style_context (widget),
+ cr,
+ 0, 0,
+ gdk_window_get_width (bin->offscreen_window),
+ gdk_window_get_height (bin->offscreen_window));
if (bin->child)
gtk_container_propagate_draw (GTK_CONTAINER (widget),
diff --git a/demos/gtk-demo/rotated_text.c b/demos/gtk-demo/rotated_text.c
index ab6ac71a7f..3d1df15cb8 100644
--- a/demos/gtk-demo/rotated_text.c
+++ b/demos/gtk-demo/rotated_text.c
@@ -18,17 +18,17 @@ const char text[] = "I ♥ GTK+";
static void
fancy_shape_renderer (cairo_t *cr,
- PangoAttrShape *attr,
- gboolean do_path,
- gpointer data)
+ PangoAttrShape *attr,
+ gboolean do_path,
+ gpointer data)
{
double x, y;
cairo_get_current_point (cr, &x, &y);
cairo_translate (cr, x, y);
cairo_scale (cr,
- (double) attr->ink_rect.width / PANGO_SCALE,
- (double) attr->ink_rect.height / PANGO_SCALE);
+ (double) attr->ink_rect.width / PANGO_SCALE,
+ (double) attr->ink_rect.height / PANGO_SCALE);
switch (GPOINTER_TO_UINT (attr->data))
{
@@ -36,9 +36,9 @@ fancy_shape_renderer (cairo_t *cr,
{
cairo_move_to (cr, .5, .0);
cairo_line_to (cr, .9, -.4);
- cairo_curve_to (cr, 1.1, -.8, .5, -.9, .5, -.5);
- cairo_curve_to (cr, .5, -.9, -.1, -.8, .1, -.4);
- cairo_close_path (cr);
+ cairo_curve_to (cr, 1.1, -.8, .5, -.9, .5, -.5);
+ cairo_curve_to (cr, .5, -.9, -.1, -.8, .1, -.4);
+ cairo_close_path (cr);
}
break;
}
@@ -60,8 +60,8 @@ create_fancy_attr_list_for_layout (PangoLayout *layout)
/* Get font metrics and prepare fancy shape size */
metrics = pango_context_get_metrics (pango_layout_get_context (layout),
- pango_layout_get_font_description (layout),
- NULL);
+ pango_layout_get_font_description (layout),
+ NULL);
ascent = pango_font_metrics_get_ascent (metrics);
logical_rect.x = 0;
logical_rect.width = ascent;
@@ -77,9 +77,9 @@ create_fancy_attr_list_for_layout (PangoLayout *layout)
PangoAttribute *attr;
attr = pango_attr_shape_new_with_data (&ink_rect,
- &logical_rect,
- GUINT_TO_POINTER (g_utf8_get_char (p)),
- NULL, NULL);
+ &logical_rect,
+ GUINT_TO_POINTER (g_utf8_get_char (p)),
+ NULL, NULL);
attr->start_index = p - text;
attr->end_index = attr->start_index + strlen (HEART);
@@ -93,7 +93,7 @@ create_fancy_attr_list_for_layout (PangoLayout *layout)
static gboolean
rotated_text_draw (GtkWidget *widget,
cairo_t *cr,
- gpointer data)
+ gpointer data)
{
#define RADIUS 150
#define N_WORDS 5
@@ -119,8 +119,8 @@ rotated_text_draw (GtkWidget *widget,
height = gtk_widget_get_allocated_height (widget);
device_radius = MIN (width, height) / 2.;
cairo_translate (cr,
- device_radius + (width - 2 * device_radius) / 2,
- device_radius + (height - 2 * device_radius) / 2);
+ device_radius + (width - 2 * device_radius) / 2,
+ device_radius + (height - 2 * device_radius) / 2);
cairo_scale (cr, device_radius / RADIUS, device_radius / RADIUS);
/* Create and a subtle gradient source and use it. */
@@ -132,8 +132,8 @@ rotated_text_draw (GtkWidget *widget,
/* Create a PangoContext and set up our shape renderer */
context = gtk_widget_create_pango_context (widget);
pango_cairo_context_set_shape_renderer (context,
- fancy_shape_renderer,
- NULL, NULL);
+ fancy_shape_renderer,
+ NULL, NULL);
/* Create a PangoLayout, set the text, font, and attributes */
layout = pango_layout_new (context);
@@ -181,11 +181,11 @@ do_rotated_text (GtkWidget *do_widget)
PangoLayout *layout;
PangoAttrList *attrs;
- const GdkColor white = { 0, 0xffff, 0xffff, 0xffff };
-
+ const GdkRGBA white = { 1.0, 1.0, 1.0, 1.0 };
+
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (do_widget));
+ gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Rotated Text");
gtk_window_set_default_size (GTK_WINDOW (window), 4 * RADIUS, 2 * RADIUS);
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
@@ -200,10 +200,10 @@ do_rotated_text (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (box), drawing_area);
/* This overrides the background color from the theme */
- gtk_widget_modify_bg (drawing_area, GTK_STATE_NORMAL, &white);
+ gtk_widget_override_background_color (drawing_area, 0, &white);
g_signal_connect (drawing_area, "draw",
- G_CALLBACK (rotated_text_draw), NULL);
+ G_CALLBACK (rotated_text_draw), NULL);
/* And a label */
@@ -215,8 +215,8 @@ do_rotated_text (GtkWidget *do_widget)
/* Set up fancy stuff on the label */
layout = gtk_label_get_layout (GTK_LABEL (label));
pango_cairo_context_set_shape_renderer (pango_layout_get_context (layout),
- fancy_shape_renderer,
- NULL, NULL);
+ fancy_shape_renderer,
+ NULL, NULL);
attrs = create_fancy_attr_list_for_layout (layout);
gtk_label_set_attributes (GTK_LABEL (label), attrs);
pango_attr_list_unref (attrs);
diff --git a/demos/gtk-demo/textview.c b/demos/gtk-demo/textview.c
index 469bb87b88..acc677ca7f 100644
--- a/demos/gtk-demo/textview.c
+++ b/demos/gtk-demo/textview.c
@@ -561,7 +561,7 @@ recursive_attach_view (int depth,
{
GtkWidget *child_view;
GtkWidget *event_box;
- GdkColor color;
+ GdkRGBA color;
GtkWidget *align;
if (depth > 4)
@@ -571,8 +571,8 @@ recursive_attach_view (int depth,
/* Event box is to add a black border around each child view */
event_box = gtk_event_box_new ();
- gdk_color_parse ("black", &color);
- gtk_widget_modify_bg (event_box, GTK_STATE_NORMAL, &color);
+ gdk_rgba_parse (&color, "black");
+ gtk_widget_override_background_color (event_box, 0, &color);
align = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
gtk_container_set_border_width (GTK_CONTAINER (align), 1);
diff --git a/docs/reference/gdk/gdk-docs.sgml b/docs/reference/gdk/gdk-docs.sgml
index a4f4d39123..c77b8be902 100644
--- a/docs/reference/gdk/gdk-docs.sgml
+++ b/docs/reference/gdk/gdk-docs.sgml
@@ -22,7 +22,6 @@
<xi:include href="xml/gdkdisplaymanager.xml" />
<xi:include href="xml/gdkscreen.xml" />
<xi:include href="xml/regions.xml" />
- <xi:include href="xml/drawing.xml" />
<xi:include href="xml/colors.xml" />
<xi:include href="xml/rgba_colors.xml" />
<xi:include href="xml/visuals.xml" />
diff --git a/docs/reference/gdk/gdk3-overrides.txt b/docs/reference/gdk/gdk3-overrides.txt
index bcc85bba84..3ba60be322 100644
--- a/docs/reference/gdk/gdk3-overrides.txt
+++ b/docs/reference/gdk/gdk3-overrides.txt
@@ -1,27 +1,4 @@
-# GdkPixmap, GdkBitmap and GdkDrawable are the same as GdkWindow.
-<STRUCT>
-<NAME>GdkWindow</NAME>
-struct GdkPixmap
-{
- gpointer user_data;
-};
-</STRUCT>
-<STRUCT>
-<NAME>GdkPixmap</NAME>
-struct GdkPixmap
-{
- gpointer user_data;
-};
-</STRUCT>
-<STRUCT>
-<NAME>GdkDrawable</NAME>
-struct GdkDrawable
-{
- gpointer user_data;
-};
-</STRUCT>
-
# GdkAtom is an opaque typedef
<STRUCT>
<NAME>GdkAtom</NAME>
diff --git a/docs/reference/gdk/gdk3-sections.txt b/docs/reference/gdk/gdk3-sections.txt
index 40bcaaf67d..f4b7e32999 100644
--- a/docs/reference/gdk/gdk3-sections.txt
+++ b/docs/reference/gdk/gdk3-sections.txt
@@ -257,6 +257,8 @@ gdk_color_to_string
<SUBSECTION Standard>
GDK_TYPE_COLOR
+<SUBSECTION Private>
+gdk_color_get_type
</SECTION>
<SECTION>
@@ -272,25 +274,9 @@ gdk_rgba_to_string
<SUBSECTION Standard>
GDK_TYPE_RGBA
-</SECTION>
-
-<SECTION>
-<TITLE>Drawing Primitives</TITLE>
-<FILE>drawing</FILE>
-GdkDrawable
-gdk_drawable_get_clip_region
-gdk_drawable_get_visible_region
-
-<SUBSECTION Standard>
-GDK_DRAWABLE
-GDK_DRAWABLE_GET_CLASS
-GDK_TYPE_DRAWABLE
-GDK_IS_DRAWABLE
-GDK_DRAWABLE_CLASS
-GDK_IS_DRAWABLE_CLASS
<SUBSECTION Private>
-GdkDrawableClass
+gdk_rgba_get_type
</SECTION>
<SECTION>
@@ -331,6 +317,7 @@ GDK_VISUAL_GET_CLASS
<SUBSECTION Private>
GdkVisualClass
+GdkVisualPrivate
gdk_visual_get_type
</SECTION>
@@ -339,7 +326,7 @@ gdk_visual_get_type
<FILE>windows</FILE>
GdkWindow
GdkWindowType
-GdkWindowClass
+GdkWindowWindowClass
GdkWindowHints
GdkGeometry
GdkGravity
@@ -397,9 +384,11 @@ gdk_window_constrain_size
gdk_window_beep
<SUBSECTION>
+gdk_window_get_clip_region
gdk_window_begin_paint_rect
gdk_window_begin_paint_region
gdk_window_end_paint
+gdk_window_get_visible_region
<SUBSECTION>
gdk_window_invalidate_rect
@@ -524,12 +513,12 @@ GDK_TYPE_WM_DECORATION
GDK_TYPE_WM_FUNCTION
<SUBSECTION Private>
-gdk_window_object_get_type
-gdk_drawable_get_type
+gdk_window_get_type
+gdk_window_window_class_get_type
GdkWindowObject
-GdkWindowObjectClass
+GdkWindowClass
GdkWindowImpl
-GdkWindowImplIface
+GdkWindowImplClass
GdkWindowRedirect
gdk_window_impl_get_type
gdk_window_freeze_toplevel_updates_libgtk_only
@@ -616,7 +605,6 @@ gdk_cairo_set_source_pixbuf
gdk_cairo_set_source_window
gdk_cairo_rectangle
gdk_cairo_region
-gdk_cairo_reset_clip
gdk_cairo_region_create_from_surface
</SECTION>
@@ -733,6 +721,7 @@ gdk_device_get_device_type
gdk_device_get_display
gdk_device_get_has_cursor
gdk_device_get_n_axes
+gdk_device_get_n_keys
<SUBSECTION>
gdk_device_grab
@@ -862,7 +851,6 @@ GdkNativeWindow
GdkEventDND
GdkEventProximity
GdkEventClient
-GdkEventNoExpose
GdkEventWindowState
GdkEventSetting
GdkEventOwnerChange
@@ -966,17 +954,13 @@ gdk_drag_context_get_type
<TITLE>X Window System Interaction</TITLE>
<FILE>x_interaction</FILE>
GDK_ROOT_WINDOW
-GDK_WINDOW_XDISPLAY
GDK_WINDOW_XID
GDK_DISPLAY_XDISPLAY
-GDK_DRAWABLE_XDISPLAY
-GDK_DRAWABLE_XID
GDK_SCREEN_XDISPLAY
GDK_SCREEN_XNUMBER
GDK_SCREEN_XSCREEN
GDK_CURSOR_XCURSOR
GDK_CURSOR_XDISPLAY
-GDK_WINDOW_XWINDOW
gdkx_visual_get
gdk_window_foreign_new
gdk_window_foreign_new_for_display
@@ -998,6 +982,7 @@ gdk_x11_cursor_get_xcursor
gdk_x11_cursor_get_xdisplay
gdk_x11_display_broadcast_startup_message
gdk_x11_display_get_startup_notification_id
+gdk_x11_display_set_startup_notification_id
gdk_x11_display_get_xdisplay
gdk_x11_display_grab
gdk_x11_display_ungrab
@@ -1006,8 +991,7 @@ gdk_x11_display_error_trap_pop
gdk_x11_display_error_trap_pop_ignored
gdk_x11_display_set_cursor_theme
gdk_x11_register_standard_event_type
-gdk_x11_drawable_get_xdisplay
-gdk_x11_drawable_get_xid
+gdk_x11_window_get_xid
gdk_x11_get_default_root_xwindow
gdk_x11_get_default_screen
gdk_x11_get_default_xdisplay
@@ -1028,7 +1012,6 @@ gdk_x11_get_xatom_name_for_display
<SUBSECTION Private>
GDK_HAVE_WCHAR_H
GDK_HAVE_WCTYPE_H
-gdk_x11_window_get_drawable_impl
</SECTION>
<SECTION>
diff --git a/docs/reference/gdk/gdk3.types b/docs/reference/gdk/gdk3.types
index f5889831f9..bb8607d4f8 100644
--- a/docs/reference/gdk/gdk3.types
+++ b/docs/reference/gdk/gdk3.types
@@ -3,8 +3,7 @@
gdk_display_get_type
gdk_display_manager_get_type
gdk_screen_get_type
-gdk_drawable_get_type
-gdk_window_object_get_type
+gdk_window_get_type
gdk_keymap_get_type
gdk_device_get_type
gdk_device_manager_get_type
diff --git a/docs/reference/gtk/Makefile.am b/docs/reference/gtk/Makefile.am
index 1de3259a6d..42d23fc1c1 100644
--- a/docs/reference/gtk/Makefile.am
+++ b/docs/reference/gtk/Makefile.am
@@ -22,6 +22,8 @@ CFILE_GLOB=$(top_srcdir)/gtk/*.c
# Header files to ignore when scanning
IGNORE_HFILES= \
fnmatch.h \
+ gtk9slice.h \
+ gtkanimationdescription.h \
gtkdebug.h \
gtkbuilderprivate.h \
gtkdndcursors.h \
@@ -77,6 +79,7 @@ IGNORE_HFILES= \
gtktexttagprivate.h \
gtktexttypes.h \
gtktextutil.h \
+ gtktimeline.h \
gtkthemes.h \
gtktrayicon.h \
gtktreedatalist.h \
@@ -122,6 +125,7 @@ content_files = \
migrating-2to3.xml \
migrating-checklist.sgml \
migrating-GtkApplication.xml \
+ migrating-GtkStyleContext.xml \
objects_grouped.sgml \
osx.sgml \
question_index.sgml \
@@ -144,6 +148,7 @@ expand_content_files = \
migrating-2to3.xml \
migrating-checklist.sgml \
migrating-GtkApplication.xml \
+ migrating-GtkStyleContext.xml \
question_index.sgml \
text_widget.sgml \
tree_widget.sgml
@@ -324,6 +329,30 @@ HTML_IMAGES = \
$(srcdir)/images/window-default.png \
$(srcdir)/images/hello-world.png \
$(srcdir)/images/switch.png
+ $(srcdir)/images/linear.png \
+ $(srcdir)/images/ease.png \
+ $(srcdir)/images/ease-in-out.png \
+ $(srcdir)/images/ease-in.png \
+ $(srcdir)/images/ease-out.png \
+ $(srcdir)/images/gradient1.png \
+ $(srcdir)/images/gradient2.png \
+ $(srcdir)/images/gradient3.png \
+ $(srcdir)/images/gradient4.png \
+ $(srcdir)/images/border1.png \
+ $(srcdir)/images/border2.png \
+ $(srcdir)/images/border3.png \
+ $(srcdir)/images/slices.png \
+ $(srcdir)/images/checks.png \
+ $(srcdir)/images/options.png \
+ $(srcdir)/images/arrows.png \
+ $(srcdir)/images/expanders.png \
+ $(srcdir)/images/background.png \
+ $(srcdir)/images/frames.png \
+ $(srcdir)/images/frame-gap.png \
+ $(srcdir)/images/sliders.png \
+ $(srcdir)/images/focus.png \
+ $(srcdir)/images/handles.png \
+ $(srcdir)/images/extensions.png
# Extra options to supply to gtkdoc-fixref
FIXXREF_OPTIONS=--extra-dir=../gdk/html \
diff --git a/docs/reference/gtk/gtk-docs.sgml b/docs/reference/gtk/gtk-docs.sgml
index db3435cb71..39b9624c0a 100644
--- a/docs/reference/gtk/gtk-docs.sgml
+++ b/docs/reference/gtk/gtk-docs.sgml
@@ -3,6 +3,8 @@
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
+<!ENTITY pi "&#960;">
+<!ENTITY solidus "&#8260;">
]>
<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
<bookinfo>
@@ -38,19 +40,31 @@
<xi:include href="xml/gtkaccelmap.xml" />
<xi:include href="xml/gtkclipboard.xml" />
<xi:include href="xml/gtkdnd.xml" />
- <xi:include href="xml/gtkicontheme.xml" />
<xi:include href="xml/gtkstock.xml" />
- <xi:include href="xml/gtkiconfactory.xml" />
- <xi:include href="xml/gtkrc.xml" />
<xi:include href="xml/gtksettings.xml" />
<xi:include href="xml/gtkbindings.xml" />
<xi:include href="xml/gtkenums.xml" />
- <xi:include href="xml/gtkstyle.xml" />
<xi:include href="xml/gtkselection.xml" />
<xi:include href="xml/gtktesting.xml" />
<xi:include href="xml/filesystem.xml" />
</part>
+ <part id="theming">
+ <title>Theming in GTK+</title>
+ <xi:include href="xml/gtkstylecontext.xml" />
+ <xi:include href="xml/gtkcssprovider.xml" />
+ <xi:include href="xml/gtkstyleprovider.xml" />
+ <xi:include href="xml/gtkstyleproperties.xml" />
+ <xi:include href="xml/gtkthemingengine.xml" />
+ <xi:include href="xml/gtkwidgetpath.xml" />
+ <xi:include href="xml/gtksymboliccolor.xml" />
+ <xi:include href="xml/gtkgradient.xml" />
+ <xi:include href="xml/gtkicontheme.xml" />
+ <xi:include href="xml/gtkiconfactory.xml" />
+ <xi:include href="xml/gtkrc.xml" />
+ <xi:include href="xml/gtkstyle.xml" />
+ </part>
+
<part id="gtkobjects">
<title>GTK+ Widgets and Objects</title>
@@ -336,6 +350,7 @@
<xi:include href="xml/migrating-checklist.sgml" />
<xi:include href="xml/migrating-2to3.xml" />
<xi:include href="xml/migrating-GtkApplication.xml" />
+ <xi:include href="xml/migrating-GtkStyleContext.xml" />
</part>
<part>
diff --git a/docs/reference/gtk/gtk3-sections.txt b/docs/reference/gtk/gtk3-sections.txt
index 8104875f3d..08f6a2f475 100644
--- a/docs/reference/gtk/gtk3-sections.txt
+++ b/docs/reference/gtk/gtk3-sections.txt
@@ -881,6 +881,7 @@ gtk_container_set_resize_mode
gtk_container_check_resize
gtk_container_foreach
gtk_container_get_children
+gtk_container_get_path_for_child
gtk_container_set_reallocate_redraws
gtk_container_get_focus_child
gtk_container_set_focus_child
@@ -4956,6 +4957,11 @@ gtk_widget_input_shape_combine_region
gtk_widget_path
gtk_widget_class_path
gtk_widget_get_composite_name
+gtk_widget_override_background_color
+gtk_widget_override_color
+gtk_widget_override_font
+gtk_widget_override_symbolic_color
+gtk_widget_override_cursor
gtk_widget_modify_style
gtk_widget_get_modifier_style
gtk_widget_modify_fg
@@ -4964,11 +4970,11 @@ gtk_widget_modify_text
gtk_widget_modify_base
gtk_widget_modify_font
gtk_widget_modify_cursor
-gtk_widget_modify_symbolic_color
gtk_widget_create_pango_context
gtk_widget_get_pango_context
gtk_widget_create_pango_layout
gtk_widget_render_icon
+gtk_widget_render_icon_pixbuf
gtk_widget_pop_composite_child
gtk_widget_push_composite_child
gtk_widget_queue_draw_area
@@ -5043,6 +5049,9 @@ gtk_widget_is_sensitive
gtk_widget_get_state
gtk_widget_get_visible
gtk_widget_set_visible
+gtk_widget_set_state_flags
+gtk_widget_unset_state_flags
+gtk_widget_get_state_flags
gtk_widget_has_default
gtk_widget_has_focus
gtk_widget_has_grab
@@ -5062,6 +5071,11 @@ gtk_widget_get_requisition
gtk_widget_device_is_shadowed
<SUBSECTION>
+gtk_widget_get_path
+gtk_widget_get_style_context
+gtk_widget_reset_style
+
+<SUBSECTION>
gtk_requisition_new
gtk_requisition_copy
gtk_requisition_free
@@ -5358,6 +5372,319 @@ GTK_CHECK_VERSION
</SECTION>
<SECTION>
+<FILE>gtkwidgetpath</FILE>
+<TITLE>GtkWidgetPath</TITLE>
+GtkWidgetPath
+gtk_widget_path_append_type
+gtk_widget_path_copy
+gtk_widget_path_free
+gtk_widget_path_get_widget_type
+gtk_widget_path_has_parent
+gtk_widget_path_is_type
+gtk_widget_path_iter_add_class
+gtk_widget_path_iter_add_region
+gtk_widget_path_iter_clear_classes
+gtk_widget_path_iter_clear_regions
+gtk_widget_path_iter_get_name
+gtk_widget_path_iter_get_widget_type
+gtk_widget_path_iter_has_class
+gtk_widget_path_iter_has_name
+gtk_widget_path_iter_has_qclass
+gtk_widget_path_iter_has_qname
+gtk_widget_path_iter_has_qregion
+gtk_widget_path_iter_has_region
+gtk_widget_path_iter_list_classes
+gtk_widget_path_iter_list_regions
+gtk_widget_path_iter_remove_class
+gtk_widget_path_iter_remove_region
+gtk_widget_path_iter_set_name
+gtk_widget_path_iter_set_widget_type
+gtk_widget_path_length
+gtk_widget_path_new
+gtk_widget_path_prepend_type
+</SECTION>
+
+<SECTION>
+<FILE>gtkstyleprovider</FILE>
+<TITLE>GtkStyleProvider</TITLE>
+GtkStyleProviderIface
+GtkStyleProvider
+GTK_STYLE_PROVIDER_PRIORITY_FALLBACK
+GTK_STYLE_PROVIDER_PRIORITY_THEME
+GTK_STYLE_PROVIDER_PRIORITY_SETTINGS
+GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
+GTK_STYLE_PROVIDER_PRIORITY_USER
+gtk_style_provider_get_icon_factory
+gtk_style_provider_get_style
+gtk_style_provider_get_style_property
+<SUBSECTION Standard>
+GTK_TYPE_STYLE_PROVIDER
+GTK_STYLE_PROVIDER
+GTK_IS_STYLE_PROVIDER
+GTK_STYLE_PROVIDER_GET_IFACE
+<SUBSECTION Private>
+gtk_style_provider_get_type
+</SECTION>
+
+<SECTION>
+<FILE>gtkstyleproperties</FILE>
+<TITLE>GtkStyleProperties</TITLE>
+GtkStyleProperties
+gtk_style_properties_clear
+gtk_style_properties_get
+gtk_style_properties_get_property
+gtk_style_properties_get_valist
+gtk_style_properties_lookup_color
+gtk_style_properties_lookup_property
+gtk_style_properties_map_color
+gtk_style_properties_merge
+gtk_style_properties_new
+GtkStylePropertyParser
+gtk_style_properties_register_property
+gtk_style_properties_set
+gtk_style_properties_set_property
+gtk_style_properties_set_valist
+gtk_style_properties_unset_property
+<SUBSECTION Standard>
+GTK_TYPE_STYLE_PROPERTIES
+GTK_IS_STYLE_PROPERTIES
+GTK_IS_STYLE_PROPERTIES_CLASS
+GTK_STYLE_PROPERTIES
+GTK_STYLE_PROPERTIES_CLASS
+GTK_STYLE_PROPERTIES_GET_CLASS
+<SUBSECTION Private>
+gtk_style_properties_get_type
+</SECTION>
+
+<SECTION>
+<FILE>gtkstylecontext</FILE>
+<TITLE>GtkStyleContext</TITLE>
+<SUBSECTION>
+GTK_STYLE_PROPERTY_BACKGROUND_COLOR
+GTK_STYLE_PROPERTY_COLOR
+GTK_STYLE_PROPERTY_FONT
+GTK_STYLE_PROPERTY_MARGIN
+GTK_STYLE_PROPERTY_PADDING
+GTK_STYLE_PROPERTY_BORDER_WIDTH
+GTK_STYLE_PROPERTY_BORDER_RADIUS
+GTK_STYLE_PROPERTY_BORDER_STYLE
+GTK_STYLE_PROPERTY_BORDER_COLOR
+GTK_STYLE_PROPERTY_BACKGROUND_IMAGE
+<SUBSECTION>
+GTK_STYLE_CLASS_BACKGROUND
+GTK_STYLE_CLASS_BUTTON
+GTK_STYLE_CLASS_CALENDAR
+GTK_STYLE_CLASS_CELL
+GTK_STYLE_CLASS_CHECK
+GTK_STYLE_CLASS_DEFAULT
+GTK_STYLE_CLASS_ENTRY
+GTK_STYLE_CLASS_HEADER
+GTK_STYLE_CLASS_MENU
+GTK_STYLE_CLASS_RADIO
+GTK_STYLE_CLASS_RUBBERBAND
+GTK_STYLE_CLASS_SCROLLBAR
+GTK_STYLE_CLASS_SLIDER
+GTK_STYLE_CLASS_TOOLTIP
+GTK_STYLE_CLASS_TROUGH
+GTK_STYLE_CLASS_ACCELERATOR
+GTK_STYLE_CLASS_DOCK
+GTK_STYLE_CLASS_GRIP
+GTK_STYLE_CLASS_MENUBAR
+GTK_STYLE_CLASS_MENUITEM
+GTK_STYLE_CLASS_PROGRESSBAR
+GTK_STYLE_CLASS_SPINNER
+GTK_STYLE_CLASS_TOOLBAR
+GTK_STYLE_REGION_COLUMN
+GTK_STYLE_REGION_COLUMN_HEADER
+GTK_STYLE_REGION_ROW
+GTK_STYLE_REGION_TAB
+<SUBSECTION>
+GtkStyleContext
+gtk_style_context_new
+gtk_style_context_add_provider
+gtk_style_context_add_provider_for_screen
+gtk_style_context_get
+gtk_style_context_get_direction
+gtk_style_context_get_junction_sides
+gtk_style_context_get_path
+gtk_style_context_get_property
+gtk_style_context_get_screen
+gtk_style_context_get_state
+gtk_style_context_get_style
+gtk_style_context_get_style_property
+gtk_style_context_get_style_valist
+gtk_style_context_get_valist
+gtk_style_context_get_color
+gtk_style_context_get_background_color
+gtk_style_context_get_border_color
+gtk_style_context_get_border
+gtk_style_context_get_padding
+gtk_style_context_get_margin
+gtk_style_context_invalidate
+gtk_style_context_state_is_running
+gtk_style_context_lookup_color
+gtk_style_context_lookup_icon_set
+gtk_style_context_notify_state_change
+gtk_style_context_pop_animatable_region
+gtk_style_context_push_animatable_region
+gtk_style_context_remove_provider
+gtk_style_context_remove_provider_for_screen
+gtk_style_context_reset_widgets
+gtk_style_context_set_background
+gtk_style_context_restore
+gtk_style_context_save
+gtk_style_context_set_direction
+gtk_style_context_set_junction_sides
+gtk_style_context_set_path
+gtk_style_context_add_class
+gtk_style_context_remove_class
+gtk_style_context_has_class
+gtk_style_context_list_classes
+gtk_style_context_add_region
+gtk_style_context_remove_region
+gtk_style_context_has_region
+gtk_style_context_list_regions
+gtk_style_context_set_screen
+gtk_style_context_set_state
+
+<SUBSECTION>
+GtkBorder
+gtk_border_new
+gtk_border_copy
+gtk_border_free
+
+<SUBSECTION>
+gtk_render_arrow
+gtk_render_background
+gtk_render_check
+gtk_render_expander
+gtk_render_extension
+gtk_render_focus
+gtk_render_frame
+gtk_render_frame_gap
+gtk_render_handle
+gtk_render_layout
+gtk_render_line
+gtk_render_option
+gtk_render_slider
+gtk_render_activity
+gtk_render_icon_pixbuf
+
+<SUBSECTION Standard>
+GTK_TYPE_STYLE_CONTEXT
+GTK_STYLE_CONTEXT
+GTK_STYLE_CONTEXT_CLASS
+GTK_STYLE_CONTEXT_GET_CLASS
+GTK_IS_STYLE_CONTEXT
+GTK_IS_STYLE_CONTEXT_CLASS
+GTK_TYPE_BORDER
+
+<SUBSECTION Private>
+gtk_style_context_get_type
+gtk_border_get_type
+</SECTION>
+
+<SECTION>
+<FILE>gtkcssprovider</FILE>
+<TITLE>GtkCssProvider</TITLE>
+GtkCssProvider
+gtk_css_provider_get_default
+gtk_css_provider_get_named
+gtk_css_provider_load_from_data
+gtk_css_provider_load_from_file
+gtk_css_provider_load_from_path
+gtk_css_provider_new
+GTK_CSS_PROVIDER_ERROR
+GtkCssProviderError
+<SUBSECTION Standard>
+GTK_TYPE_CSS_PROVIDER
+GTK_CSS_PROVIDER
+GTK_CSS_PROVIDER_CLASS
+GTK_CSS_PROVIDER_GET_CLASS
+GTK_IS_CSS_PROVIDER
+GTK_IS_CSS_PROVIDER_CLASS
+<SUBSECTION Private>
+gtk_css_provider_get_type
+gtk_css_provider_error_quark
+</SECTION>
+
+<SECTION>
+<FILE>gtkthemingengine</FILE>
+<TITLE>GtkThemingEngine</TITLE>
+GtkThemingEngineClass
+GtkThemingEngine
+gtk_theming_engine_get
+gtk_theming_engine_get_direction
+gtk_theming_engine_get_junction_sides
+gtk_theming_engine_get_path
+gtk_theming_engine_get_property
+gtk_theming_engine_get_screen
+gtk_theming_engine_get_state
+gtk_theming_engine_get_style
+gtk_theming_engine_get_style_property
+gtk_theming_engine_get_style_valist
+gtk_theming_engine_get_valist
+gtk_theming_engine_get_color
+gtk_theming_engine_get_background_color
+gtk_theming_engine_get_border_color
+gtk_theming_engine_get_border
+gtk_theming_engine_get_padding
+gtk_theming_engine_get_margin
+gtk_theming_engine_has_class
+gtk_theming_engine_has_region
+gtk_theming_engine_lookup_color
+gtk_theming_engine_state_is_running
+gtk_theming_engine_load
+gtk_theming_engine_register_property
+<SUBSECTION Standard>
+GTK_THEMING_ENGINE
+GTK_THEMING_ENGINE_CLASS
+GTK_THEMING_ENGINE_GET_CLASS
+GTK_IS_THEMING_ENGINE
+GTK_IS_THEMING_ENGINE_CLASS
+<SUBSECTION Private>
+GTK_TYPE_THEMING_ENGINE
+gtk_theming_engine_get_type
+</SECTION>
+
+<SECTION>
+<FILE>gtksymboliccolor</FILE>
+<TITLE>GtkSymbolicColor</TITLE>
+GtkSymbolicColor
+gtk_symbolic_color_new_literal
+gtk_symbolic_color_new_name
+gtk_symbolic_color_new_shade
+gtk_symbolic_color_new_alpha
+gtk_symbolic_color_new_mix
+gtk_symbolic_color_ref
+gtk_symbolic_color_unref
+gtk_symbolic_color_resolve
+
+<SUBSECTION Standard>
+GTK_TYPE_SYMBOLIC_COLOR
+
+<SUBSECTION Private>
+gtk_symbolic_color_get_type
+</SECTION>
+
+<SECTION>
+<FILE>gtkgradient</FILE>
+<TITLE>GtkGradient</TITLE>
+GtkGradient
+gtk_gradient_new_linear
+gtk_gradient_new_radial
+gtk_gradient_add_color_stop
+gtk_gradient_ref
+gtk_gradient_unref
+gtk_gradient_resolve
+
+<SUBSECTION Standard>
+GTK_TYPE_GRADIENT
+
+gtk_gradient_get_type
+</SECTION>
+
+<SECTION>
<FILE>gtkstyle</FILE>
<TITLE>GtkStyle</TITLE>
GTK_STYLE_ATTACHED
@@ -5397,12 +5724,6 @@ gtk_paint_resize_grip
gtk_draw_insertion_cursor
<SUBSECTION>
-GtkBorder
-gtk_border_new
-gtk_border_copy
-gtk_border_free
-
-<SUBSECTION>
GtkRcProperty
GtkRcPropertyParser
@@ -5414,10 +5735,8 @@ GTK_TYPE_STYLE
GTK_STYLE_CLASS
GTK_IS_STYLE_CLASS
GTK_STYLE_GET_CLASS
-GTK_TYPE_BORDER
-<SUBSECTION Private>
+
gtk_style_get_type
-gtk_border_get_type
GtkThemeEngine
</SECTION>
@@ -5667,12 +5986,16 @@ GtkScrollType
GtkSelectionMode
GtkShadowType
GtkStateType
+GtkStateFlags
GtkToolbarStyle
GtkUpdateType
GtkWindowPosition
GtkWindowType
GtkSortType
GtkDragResult
+GtkJunctionSides
+GtkBorderStyle
+GtkRegionFlags
<SUBSECTION Private>
GTK_PATH_PRIO_MASK
@@ -5834,6 +6157,7 @@ gtk_icon_info_get_builtin_pixbuf
gtk_icon_info_load_icon
gtk_icon_info_load_symbolic
gtk_icon_info_load_symbolic_for_style
+gtk_icon_info_load_symbolic_for_context
gtk_icon_info_set_raw_coordinates
gtk_icon_info_get_embedded_rect
gtk_icon_info_get_attach_points
@@ -5875,6 +6199,7 @@ gtk_icon_set_new
gtk_icon_set_new_from_pixbuf
gtk_icon_set_ref
gtk_icon_set_render_icon
+gtk_icon_set_render_icon_pixbuf
gtk_icon_set_unref
gtk_icon_size_lookup
gtk_icon_size_lookup_for_settings
diff --git a/docs/reference/gtk/gtk3.types b/docs/reference/gtk/gtk3.types
index bdf3063bd2..fe0ff45f6b 100644
--- a/docs/reference/gtk/gtk3.types
+++ b/docs/reference/gtk/gtk3.types
@@ -50,6 +50,7 @@ gtk_color_selection_get_type
gtk_combo_box_get_type
gtk_combo_box_text_get_type
gtk_container_get_type
+gtk_css_provider_get_type
gtk_dialog_get_type
gtk_drawing_area_get_type
gtk_editable_get_type
@@ -144,6 +145,8 @@ gtk_statusbar_get_type
gtk_status_icon_get_type
gtk_switch_get_type
gtk_style_get_type
+gtk_style_context_get_type
+gtk_style_provider_get_type
gtk_table_get_type
gtk_tearoff_menu_item_get_type
gtk_text_buffer_get_type
@@ -153,6 +156,7 @@ gtk_text_mark_get_type
gtk_text_tag_get_type
gtk_text_tag_table_get_type
gtk_text_view_get_type
+gtk_theming_engine_get_type
gtk_toggle_action_get_type
gtk_toggle_button_get_type
gtk_toggle_tool_button_get_type
diff --git a/docs/reference/gtk/images/arrows.png b/docs/reference/gtk/images/arrows.png
new file mode 100644
index 0000000000..d189a510a5
--- /dev/null
+++ b/docs/reference/gtk/images/arrows.png
Binary files differ
diff --git a/docs/reference/gtk/images/background.png b/docs/reference/gtk/images/background.png
new file mode 100644
index 0000000000..ad6ea36a99
--- /dev/null
+++ b/docs/reference/gtk/images/background.png
Binary files differ
diff --git a/docs/reference/gtk/images/border1.png b/docs/reference/gtk/images/border1.png
new file mode 100644
index 0000000000..92e2cc5bf2
--- /dev/null
+++ b/docs/reference/gtk/images/border1.png
Binary files differ
diff --git a/docs/reference/gtk/images/border2.png b/docs/reference/gtk/images/border2.png
new file mode 100644
index 0000000000..808c3a56d0
--- /dev/null
+++ b/docs/reference/gtk/images/border2.png
Binary files differ
diff --git a/docs/reference/gtk/images/border3.png b/docs/reference/gtk/images/border3.png
new file mode 100644
index 0000000000..980f4bdbc4
--- /dev/null
+++ b/docs/reference/gtk/images/border3.png
Binary files differ
diff --git a/docs/reference/gtk/images/checks.png b/docs/reference/gtk/images/checks.png
new file mode 100644
index 0000000000..143043a274
--- /dev/null
+++ b/docs/reference/gtk/images/checks.png
Binary files differ
diff --git a/docs/reference/gtk/images/ease-in-out.png b/docs/reference/gtk/images/ease-in-out.png
new file mode 100644
index 0000000000..1591b6fee1
--- /dev/null
+++ b/docs/reference/gtk/images/ease-in-out.png
Binary files differ
diff --git a/docs/reference/gtk/images/ease-in.png b/docs/reference/gtk/images/ease-in.png
new file mode 100644
index 0000000000..cece95df7f
--- /dev/null
+++ b/docs/reference/gtk/images/ease-in.png
Binary files differ
diff --git a/docs/reference/gtk/images/ease-out.png b/docs/reference/gtk/images/ease-out.png
new file mode 100644
index 0000000000..9a5162f082
--- /dev/null
+++ b/docs/reference/gtk/images/ease-out.png
Binary files differ
diff --git a/docs/reference/gtk/images/ease.png b/docs/reference/gtk/images/ease.png
new file mode 100644
index 0000000000..6a70bcdc2d
--- /dev/null
+++ b/docs/reference/gtk/images/ease.png
Binary files differ
diff --git a/docs/reference/gtk/images/expanders.png b/docs/reference/gtk/images/expanders.png
new file mode 100644
index 0000000000..629922e4d1
--- /dev/null
+++ b/docs/reference/gtk/images/expanders.png
Binary files differ
diff --git a/docs/reference/gtk/images/extensions.png b/docs/reference/gtk/images/extensions.png
new file mode 100644
index 0000000000..f41d710ac8
--- /dev/null
+++ b/docs/reference/gtk/images/extensions.png
Binary files differ
diff --git a/docs/reference/gtk/images/focus.png b/docs/reference/gtk/images/focus.png
new file mode 100644
index 0000000000..583d292c9c
--- /dev/null
+++ b/docs/reference/gtk/images/focus.png
Binary files differ
diff --git a/docs/reference/gtk/images/frame-gap.png b/docs/reference/gtk/images/frame-gap.png
new file mode 100644
index 0000000000..3c0caf24d4
--- /dev/null
+++ b/docs/reference/gtk/images/frame-gap.png
Binary files differ
diff --git a/docs/reference/gtk/images/frames.png b/docs/reference/gtk/images/frames.png
new file mode 100644
index 0000000000..12d6c7efc7
--- /dev/null
+++ b/docs/reference/gtk/images/frames.png
Binary files differ
diff --git a/docs/reference/gtk/images/gradient1.png b/docs/reference/gtk/images/gradient1.png
new file mode 100644
index 0000000000..248c998daf
--- /dev/null
+++ b/docs/reference/gtk/images/gradient1.png
Binary files differ
diff --git a/docs/reference/gtk/images/gradient2.png b/docs/reference/gtk/images/gradient2.png
new file mode 100644
index 0000000000..cc5fc054d3
--- /dev/null
+++ b/docs/reference/gtk/images/gradient2.png
Binary files differ
diff --git a/docs/reference/gtk/images/gradient3.png b/docs/reference/gtk/images/gradient3.png
new file mode 100644
index 0000000000..4ff8f90bd8
--- /dev/null
+++ b/docs/reference/gtk/images/gradient3.png
Binary files differ
diff --git a/docs/reference/gtk/images/gradient4.png b/docs/reference/gtk/images/gradient4.png
new file mode 100644
index 0000000000..b619cae336
--- /dev/null
+++ b/docs/reference/gtk/images/gradient4.png
Binary files differ
diff --git a/docs/reference/gtk/images/handles.png b/docs/reference/gtk/images/handles.png
new file mode 100644
index 0000000000..24151b559b
--- /dev/null
+++ b/docs/reference/gtk/images/handles.png
Binary files differ
diff --git a/docs/reference/gtk/images/linear.png b/docs/reference/gtk/images/linear.png
new file mode 100644
index 0000000000..2339839e21
--- /dev/null
+++ b/docs/reference/gtk/images/linear.png
Binary files differ
diff --git a/docs/reference/gtk/images/options.png b/docs/reference/gtk/images/options.png
new file mode 100644
index 0000000000..3c274810fa
--- /dev/null
+++ b/docs/reference/gtk/images/options.png
Binary files differ
diff --git a/docs/reference/gtk/images/slices.png b/docs/reference/gtk/images/slices.png
new file mode 100644
index 0000000000..c0a064efbf
--- /dev/null
+++ b/docs/reference/gtk/images/slices.png
Binary files differ
diff --git a/docs/reference/gtk/images/sliders.png b/docs/reference/gtk/images/sliders.png
new file mode 100644
index 0000000000..e832aa708d
--- /dev/null
+++ b/docs/reference/gtk/images/sliders.png
Binary files differ
diff --git a/docs/reference/gtk/migrating-2to3.xml b/docs/reference/gtk/migrating-2to3.xml
index d150987e11..fc39ff1e24 100644
--- a/docs/reference/gtk/migrating-2to3.xml
+++ b/docs/reference/gtk/migrating-2to3.xml
@@ -134,7 +134,7 @@
them, are gone. This includes the <literal>gdk_draw</literal> family
of functions like gdk_draw_rectangle() and gdk_draw_drawable(). As
#GdkGC is roughly equivalent to #cairo_t and #GdkImage was used for
- drawing images to GdkDrawables, which cairo supports automatically,
+ drawing images to GdkWindows, which cairo supports automatically,
a transition is usually straightforward.
</para>
<para>
@@ -143,7 +143,7 @@
was replaced.
</para>
<example>
- <title>Drawing a GdkPixbuf onto a GdkDrawable</title>
+ <title>Drawing a GdkPixbuf onto a GdkWindow</title>
<para>
Drawing a pixbuf onto a drawable used to be done like this:
<programlisting><![CDATA[
@@ -170,7 +170,7 @@ cairo_destroy (cr);
</para>
</example>
<example>
- <title>Drawing a tiled GdkPixmap to a GdkDrawable</title>
+ <title>Drawing a tiled GdkPixmap to a GdkWindow</title>
<para>
Tiled pixmaps are often used for drawing backgrounds.
Old code looked something like this:
diff --git a/docs/reference/gtk/migrating-ClientSideWindows.sgml b/docs/reference/gtk/migrating-ClientSideWindows.sgml
index 845e9561b2..017249c3e9 100644
--- a/docs/reference/gtk/migrating-ClientSideWindows.sgml
+++ b/docs/reference/gtk/migrating-ClientSideWindows.sgml
@@ -13,7 +13,7 @@
longer correct to assume that each window has an associated XID.
Code that makes this assumption can sometimes be fixed by calling
gdk_window_ensure_native() on the windows in question.
- Calling gdk_x11_drawable_get_xid() (or GDK_WINDOW_XID()) from the
+ Calling gdk_x11_window_get_xid() (or GDK_WINDOW_XID()) from the
X11-specific API on a non-native window will explicitly call
gdk_window_ensure_native(), so old code using this will continue to
work. A small gotcha is that the GDK_WINDOW_XID() call is no longer a
@@ -46,15 +46,9 @@
<para>
Problems can also occur when using cairo for drawing. One thing that can
- go wrong is clip handling. If you ever need to reset the clip region on
- a cairo_t (i.e. use cairo_reset_clip()), you have to to use
- gdk_cairo_reset_clip() instead. The reason for this is that the cairo_reset_clip() call will remove the initial clip region that limits your drawing to
- the client-side window at hand, so you will end up drawing over stuff
- outside the window. You also need to use gdk_cairo_reset_clip() if you
- use a cairo_t that was not allocated in a double-buffered expose handler
- and keep it in use after window hierarchy changes (resizing, moving,
- stacking order changes). The easiest fix for this kind of problem is to
- simply create a new cairo context for each expose event.
+ go wrong is clip handling. You may not use cairo_reset_clip() on a
+ cairo_t on a cairo context created via gdk_cairo_create() or passed to
+ the GtkWidget::draw signal.
</para>
<para>
diff --git a/docs/reference/gtk/migrating-GtkStyleContext.xml b/docs/reference/gtk/migrating-GtkStyleContext.xml
new file mode 100644
index 0000000000..775fee0545
--- /dev/null
+++ b/docs/reference/gtk/migrating-GtkStyleContext.xml
@@ -0,0 +1,631 @@
+<?xml version="1.0"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+ "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
+]>
+<chapter id="gtk-migrating-GtkStyleContext">
+ <title>Migrating from GtkStyle to GtkStyleContext</title>
+
+ <para>
+ In GTK+ 3.0, #GtkStyleContext was added to replace #GtkStyle and
+ the theming infrastructure available in 2.x. GtkStyleContext is an
+ object similar in spirit to GtkStyle, as it contains theming information,
+ although in a more complete and tokenized fashion. There are two aspects
+ to switching to GtkStyleContext: porting themes and theme engines, and
+ porting applications, libraries and widgets.
+ </para>
+
+ <refsect2 id="gtk-migrating-GtkStyleContext-themes">
+ <title>Migrating themes</title>
+
+ <para>
+ From GTK+ 3.0 on, theme engines must implement #GtkThemingEngine and be
+ installed in <filename>$libdir/gtk+-3.0/$GTK_VERSION/theming-engines</filename>,
+ and the files containing style information must be written in the CSS-like
+ format that is understood by #GtkCssProvider. For a theme named
+ "Clearlooks", the CSS file parsed by default is
+ <filename>$datadir/themes/Clearlooks/gtk-3.0/gtk.css</filename>,
+ with possible variants such as the dark theme being named
+ <filename>gtk-dark.css</filename> in the same directory.
+ </para>
+ </refsect2>
+
+ <refsect2 id="gtk-migrating-theme-GtkStyleContext-engines">
+ <title>Migrating theme engines</title>
+
+ <para>
+ Migrating a #GtkStyle based engine to a #GtkThemingEngine based one
+ should be straightforward for most of the vfuncs. Besides a cleanup
+ in the available paint methods and a simplification in the passed
+ arguments (in favor of #GtkStyleContext containing all the information),
+ the available render methods resemble those of #GtkStyle quite
+ evidently. Notable differences include:
+ </para>
+
+ <orderedlist>
+ <listitem>
+ All variations of gtk_paint_box(), gtk_paint_flat_box(),
+ gtk_paint_shadow(), gtk_paint_box_gap() and gtk_paint_shadow_gap()
+ are replaced by gtk_render_background(), gtk_render_frame() and
+ gtk_render_frame_gap(). The first function renders frameless
+ backgrounds and the last two render frames in various forms.
+ </listitem>
+ <listitem>
+ gtk_paint_resize_grip() has been subsumed by gtk_render_handle()
+ with a #GTK_STYLE_CLASS_GRIP class set in the style context.
+ </listitem>
+ <listitem>
+ gtk_paint_spinner() disappears in favor of gtk_render_activity()
+ with a #GTK_STYLE_CLASS_SPINNER class set in the style context.
+ </listitem>
+ </orderedlist>
+
+ <para>
+ The list of available render methods is:
+ </para>
+
+ <simplelist>
+ <member>
+ gtk_render_background(): Renders a widget/area background.
+ </member>
+ <member>
+ gtk_render_frame(): Renders a frame border around the given rectangle.
+ Usually the detail of the border depends on the theme information,
+ plus the current widget state.
+ </member>
+ <member>
+ gtk_render_frame_gap(): Renders a frame border with a gap on one side.
+ </member>
+ <member>
+ gtk_render_layout(): Renders a #PangoLayout.
+ </member>
+ <member>
+ gtk_render_handle(): Renders all kind of handles and resize grips,
+ depending on the style class.
+ </member>
+ <member>
+ gtk_render_check(): Render checkboxes.
+ </member>
+ <member>
+ gtk_render_option(): Render radiobuttons.
+ </member>
+ <member>
+ gtk_render_arrow(): Renders an arrow pointing to a direction.
+ </member>
+ <member>
+ gtk_render_expander(): Renders an expander indicator, such as in
+ #GtkExpander.
+ </member>
+ <member>
+ gtk_render_focus(): Renders the indication that a widget has the
+ keyboard focus.
+ </member>
+ <member>
+ gtk_render_line(): Renders a line from one coordinate to another.
+ </member>
+ <member>
+ gtk_render_slider(): Renders a slider, such as in #GtkScale.
+ </member>
+ <member>
+ gtk_render_extension(): Renders an extension that protrudes from
+ a UI element, such as a notebook tab.
+ </member>
+ <member>
+ gtk_render_activity(): Renders an area displaying activity, be it
+ a progressbar or a spinner.
+ </member>
+ <member>
+ gtk_render_icon_pixbuf(): Renders an icon into a #GdkPixbuf.
+ </member>
+ </simplelist>
+
+ <para>
+ One of the main differences to #GtkStyle-based engines is that the
+ rendered widget is totally isolated from the theme engine, all style
+ information is meant to be retrieved from the #GtkThemingEngine API,
+ or from the #GtkWidgetPath obtained from gtk_theming_engine_get_path(),
+ which fully represents the rendered widget's hierarchy from a styling
+ point of view.
+ </para>
+
+ <para>
+ The detail string available in #GtkStyle-based engines has been
+ replaced by widget regions and style classes. Regions are a way for
+ complex widgets to associate different styles with different areas,
+ such as even and odd rows in a treeview. Style classes allow sharing
+ of style information between widgets, regardless of their type.
+ Regions and style classes can be used in style sheets to associate
+ styles, and them engines can also access them. There are several
+ predefined classes and regions such as %GTK_STYLE_CLASS_BUTTON or
+ %GTK_STYLE_REGION_TAB in <filename>gtkstylecontext.h</filename>,
+ although custom widgets may define their own, which themes may
+ attempt to handle.
+ </para>
+
+ </refsect2>
+
+ <refsect2 id="gtk-migrating-GtkStyleContext-parser-extensions">
+ <title>Extending the CSS parser</title>
+
+ <para>
+ In #GtkStyle-based engines, #GtkRCStyle provided ways to extend the
+ gtkrc parser with engine-specific extensions. This has been replaced
+ by gtk_theming_engine_register_property(), which lets a theme engine
+ register new properties with an arbitrary type. While there is built-in
+ support for most basic types, it is possible to use a custom parser
+ for the property.
+ </para>
+
+ <para>
+ The installed properties depend on the #GtkThemeEngine::name property,
+ so they should be added in the <literal>constructed()</literal> vfunc.
+ For example, if an engine with the name "Clearlooks" installs a
+ "focus-color" property with the type #GdkRGBA, the property
+ <literal>-Clearlooks-focus-color</literal> will be registered and
+ accepted in CSS like this:
+ <informalexample><programlisting>
+ GtkEntry {
+ -Clearlooks-focus-color: rgba(255, 0, 0, 1.0);
+ }
+ </programlisting></informalexample>
+ </para>
+
+ <para>
+ Widget style properties also follow a similar syntax, with the widget
+ type name used as a prefix. For example, the #GtkWidget:focus-line-width
+ style property can be modified in CSS as
+ <literal>-GtkWidget-focus-line-width</literal>.
+ </para>
+ </refsect2>
+
+ <refsect2 id="gtk-migrating-GtkStyleContext-css">
+ <title>Using the CSS file format</title>
+
+ <para>
+ The syntax of RC and CSS files formats is obviously different.
+ The CSS-like syntax will hopefully be much more familiar to many
+ people, lowering the barrier for custom theming.
+ </para>
+ <para>
+ Instead of going through the syntax differences one-by-one, we
+ will present a more or less comprehensive example and discuss
+ how it can be translated into CSS:
+ </para>
+
+ <example>
+ <title>Sample RC code</title>
+ <programlisting>
+ style "default" {
+ xthickness = 1
+ ythickness = 1
+
+ GtkButton::child-displacement-x = 1
+ GtkButton::child-displacement-y = 1
+ GtkCheckButton::indicator-size = 14
+
+ bg[NORMAL] = @bg_color
+ bg[PRELIGHT] = shade (1.02, @bg_color)
+ bg[SELECTED] = @selected_bg_color
+ bg[INSENSITIVE] = @bg_color
+ bg[ACTIVE] = shade (0.9, @bg_color)
+
+ fg[NORMAL] = @fg_color
+ fg[PRELIGHT] = @fg_color
+ fg[SELECTED] = @selected_fg_color
+ fg[INSENSITIVE] = darker (@bg_color)
+ fg[ACTIVE] = @fg_color
+
+ text[NORMAL] = @text_color
+ text[PRELIGHT] = @text_color
+ text[SELECTED] = @selected_fg_color
+ text[INSENSITIVE] = darker (@bg_color)
+ text[ACTIVE] = @selected_fg_color
+
+ base[NORMAL] = @base_color
+ base[PRELIGHT] = shade (0.95, @bg_color)
+ base[SELECTED] = @selected_bg_color
+ base[INSENSITIVE] = @bg_color
+ base[ACTIVE] = shade (0.9, @selected_bg_color)
+
+ engine "clearlooks" {
+ colorize_scrollbar = TRUE
+ style = CLASSIC
+ }
+ }
+
+ style "tooltips" {
+ xthickness = 4
+ ythickness = 4
+
+ bg[NORMAL] = @tooltip_bg_color
+ fg[NORMAL] = @tooltip_fg_color
+ }
+
+ style "button" {
+ xthickness = 3
+ ythickness = 3
+
+ bg[NORMAL] = shade (1.04, @bg_color)
+ bg[PRELIGHT] = shade (1.06, @bg_color)
+ bg[ACTIVE] = shade (0.85, @bg_color)
+ }
+
+ style "entry" {
+ xthickness = 3
+ ythickness = 3
+
+ bg[SELECTED] = mix (0.4, @selected_bg_color, @base_color)
+ fg[SELECTED] = @text_color
+
+ engine "clearlooks" {
+ focus_color = shade (0.65, @selected_bg_color)
+ }
+ }
+
+ style "other" {
+ bg[NORMAL] = &num;fff;
+ }
+
+ class "GtkWidget" style "default"
+ class "GtkEntry" style "entry"
+ widget_class "*&lt;GtkButton&gt;" style "button"
+ widget "gtk-tooltip*" style "tooltips"
+ widget_class "window-name.*.GtkButton" style "other"
+ </programlisting>
+ </example>
+
+ <para>
+ would roughly translate to this CSS:
+ </para>
+
+ <example>
+ <title>CSS translation</title>
+ <programlisting>
+ * {
+ padding: 1;
+ -GtkButton-child-displacement-x: 1;
+ -GtkButton-child-displacement-y: 1;
+ -GtkCheckButton-indicator-size: 14;
+
+ background-color: @bg_color;
+ color: @fg_color;
+
+ -Clearlooks-colorize-scrollbar: true;
+ -Clearlooks-style: classic;
+ }
+
+ *:hover {
+ background-color: shade (@bg_color, 1.02);
+ }
+
+ *:selected {
+ background-color: @selected_bg_color;
+ color: @selected_fg_color;
+ }
+
+ *:insensitive {
+ color: shade (@bg_color, 0.7);
+ }
+
+ *:active {
+ background-color: shade (@bg_color, 0.9);
+ }
+
+ .tooltip {
+ padding: 4;
+
+ background-color: @tooltip_bg_color;
+ color: @tooltip_fg_color;
+ }
+
+ .button {
+ padding: 3;
+ background-color: shade (@bg_color, 1.04);
+ }
+
+ .button:hover {
+ background-color: shade (@bg_color, 1.06);
+ }
+
+ .button:active {
+ background-color: shade (@bg_color, 0.85);
+ }
+
+ .entry {
+ padding: 3;
+
+ background-color: @base_color;
+ color: @text_color;
+ }
+
+ .entry:selected {
+ background-color: mix (@selected_bg_color, @base_color, 0.4);
+ -Clearlooks-focus-color: shade (0.65, @selected_bg_color)
+ }
+
+ /* The latter selector is an specification of the first,
+ since any widget may use the same classes or names */
+ &num;window-name .button,
+ GtkWindow&num;window-name GtkButton.button {
+ background-color: &num;fff;
+ }
+ </programlisting>
+ </example>
+
+ <para>
+ One notable difference is the reduction from fg/bg/text/base colors
+ to only foreground/background, in exchange the widget is able to render
+ its various elements with different CSS classes, which can be themed
+ independently.
+ </para>
+
+ <para>
+ Access to colors has also changed a bit. With #GtkStyle, the common
+ way to access colors is:
+ <informalexample><programlisting>
+ GdkColor *color1;
+ GdkColor color2;
+
+ color1 = &amp;style->bg[GTK_STATE_PRELIGHT];
+ gtk_style_lookup_color (style, "focus_color", &amp;color2);
+ </programlisting></informalexample>
+ With #GtkStyleContext, you generally use #GdkRGBA instead of #GdkColor
+ and the code looks like this:
+ <informalexample><programlisting>
+ GdkRGBA *color1;
+ GdkRGBA color2;
+
+ gtk_style_context_get (context, GTK_STATE_FLAG_PRELIGHT,
+ "background-color", &amp;color1,
+ NULL);
+ gtk_style_context_lookup_color (context, "focus_color", &amp;color2);
+
+ ...
+
+ gdk_rgba_free (color1);
+ </programlisting></informalexample>
+ Note that the memory handling here is different: gtk_style_context_get()
+ expects the address of a GdkRGBA* and returns a newly allocated struct,
+ gtk_style_context_lookup_color() expects the address of an existing
+ struct, and fills it.
+ </para>
+
+ <para>
+ It is worth mentioning that the new file format does not support
+ custom keybindings nor stock icon mappings as the RC format did.
+ </para>
+ </refsect2>
+
+ <refsect2 id="gtk-migrating-GtkStyleContext-checklist">
+ <title>A checklist for widgets</title>
+
+ <para>
+ When porting your widgets to use #GtkStyleContext, this checklist
+ might be useful.
+ </para>
+
+ <orderedlist>
+ <listitem>
+ Replace <literal>style_set()</literal> calls with
+ <literal>style_updated()</literal>.
+ </listitem>
+
+ <listitem>
+ <para>
+ Try to identify the role of what you're rendering with any number
+ of classes. This will replace the detail string. There is a predefined
+ set of CSS classes which you can reuse where appropriate. Doing so
+ will give you theming 'for free', whereas custom classes will require
+ extra work in the theme. Note that complex widgets are likely to
+ need different styles when rendering different parts, and style
+ classes are one way to achieve this. This could result in code like
+ the following (simplified) examples:
+ </para>
+
+ <example>
+ <title>Setting a permanent CSS class</title>
+ <programlisting>
+ static void
+ gtk_button_init (GtkButton *button)
+ {
+ GtkStyleContext *context;
+
+ ...
+
+ context = gtk_widget_get_style_context (GTK_WIDGET (button));
+
+ /* Set the "button" class */
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_BUTTON);
+ }
+ </programlisting>
+ </example>
+
+ <para>
+ Or
+ </para>
+
+ <example>
+ <title>Using dynamic CSS classes for different elements</title>
+ <programlisting>
+ static gboolean
+ gtk_spin_button_draw (GtkSpinButton *spin,
+ cairo_t *cr)
+ {
+ GtkStyleContext *context;
+
+ ...
+
+ context = gtk_widget_get_style_context (GTK_WIDGET (spin));
+
+ gtk_style_context_save (context);
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_ENTRY);
+
+ /* Call to entry draw impl with "entry" class */
+ parent_class->draw (spin, cr);
+
+ gtk_style_context_restore (context);
+ gtk_style_context_save (context);
+
+ /* Render up/down buttons with the "button" class */
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_BUTTON);
+ draw_up_button (spin, cr);
+ draw_down_button (spin, cr);
+
+ gtk_style_context_restore (context);
+
+ ...
+ }
+ </programlisting>
+ </example>
+
+ <para>
+ Note that #GtkStyleContext only provides fg/bg colors, so text/base
+ is done through distinctive theming of the different classes. For
+ example, an entry would usually be black on white while a button
+ would usually be black on light grey.
+ </para>
+ </listitem>
+
+ <listitem>
+ Replace all <literal>gtk_paint_*()</literal> calls with corresponding
+ <literal>gtk_render_*()</literal> calls. The most distinctive changes
+ are the use of #GtkStateFlags to represent the widget state and the
+ lack of #GtkShadowType. For gtk_render_check() and gtk_render_option(),
+ the @shadow_type parameter is replaced by the #GTK_STATE_FLAG_ACTIVE
+ and #GTK_STATE_FLAG_INCONSISTENT state flags. For things such as
+ pressed/unpressed button states, #GTK_STATE_FLAG_ACTIVE is used, and
+ the CSS may style normal/active states differently to render
+ outset/inset borders, respectively.
+ </listitem>
+
+ <listitem>
+ The various <literal>gtk_widget_modify_*()</literal> functions to
+ override colors or fonts for individual widgets have been replaced
+ by similar <literal>gtk_widget_override_*()</literal> functions.
+ </listitem>
+
+ <listitem>
+ It is no longer necessary to call gtk_widget_style_attach(),
+ gtk_style_attach(), gtk_style_detach() or gtk_widget_ensure_style().
+ </listitem>
+
+ <listitem>
+ Replace all uses of xthickness/ythickness. #GtkStyleContext uses the
+ CSS box model, and there are border-width/padding/margin properties to
+ replace the different applications of X and Y thickness. Note that all
+ of this is merely a guideline. Widgets may choose to follow it or not.
+ </listitem>
+ </orderedlist>
+ </refsect2>
+
+ <refsect2 id="gtk-migrating-GtkStyleContext-parsing">
+ <title>Parsing of custom resources</title>
+ <para>
+ As a consequence of the RC format going away, calling gtk_rc_parse() or
+ gtk_rc_parse_string() won't have any effect on a widgets appearance.
+ The way to replace these calls is using a custom #GtkStyleProvider,
+ either for an individual widget through gtk_style_context_add_provider()
+ or for all widgets on a screen through gtk_style_context_add_provider_for_screen().
+ Typically, the provider will be a #GtkCssProvider, which parse CSS
+ information from a file or from a string.
+ </para>
+
+ <para>
+ Notice that you can also get style information from custom resources
+ by implementing the #GtkStyleProvider interface yourself. This is
+ an advanced feature that should be rarely used.
+ </para>
+ </refsect2>
+
+ <refsect2 id="gtk-migrating-GtkStyleContext-bonus-points">
+ <title>Bonus points</title>
+
+ <para>
+ There are some features in #GtkStyleContext that were not available in
+ #GtkStyle, or were made available over time for certain widgets through
+ extending the detail string in obscure ways. There is a lot more
+ information available when rendering UI elements, and it is accessible
+ in more uniform, less hacky ways. By going through this list you'll
+ ensure your widget is a good citizen in a fully themable user interface.
+ </para>
+
+ <orderedlist>
+ <listitem>
+ If your widget renders a series of similar elements, such as tabs
+ in a #GtkNotebook or rows/column in a #GtkTreeView, consider adding
+ regions through gtk_style_context_add_region(). These regions can be
+ referenced in CSS and the :nth-child pseudo-class may be used to match
+ the elements depending on the flags passed.
+
+ <example>
+ <title>Theming widget regions</title>
+ <programlisting>
+ GtkNotebook tab {
+ background-color: &num;f3329d;
+ }
+
+ GtkTreeView row::nth-child (even) {
+ background-color: &num;dddddd;
+ }
+ </programlisting>
+ </example>
+ </listitem>
+
+ <listitem>
+ <para>
+ If your container renders child widgets within different regions,
+ make it implement GtkContainer::get_path_for_child(). This function
+ lets containers assign a special #GtkWidgetPath to child widgets
+ depending on their role/region. This is necessary to extend the
+ concept above throughout the widget hierarchy.
+ </para>
+
+ <para>
+ For example, a #GtkNotebook modifies the tab labels' #GtkWidgetPath
+ so the "tab" region is added. This makes it possible to theme tab
+ labels through:
+ </para>
+
+ <example>
+ <title>Theming a widget within a parent container region</title>
+ <programlisting>
+ GtkNotebook tab GtkLabel {
+ font: Sans 8;
+ }
+ </programlisting>
+ </example>
+
+ </listitem>
+
+ <listitem>
+ If you intend several visual elements to look interconnected,
+ make sure you specify rendered elements' connection areas with
+ gtk_style_context_set_junction_sides(). It is of course up to the
+ theme to make use of this information or not.
+ </listitem>
+
+ <listitem>
+ <para>
+ #GtkStyleContext supports implicit animations on state changes for
+ the most simple case out-of-the-box: widgets with a single animatable
+ area, whose state is changed with gtk_widget_set_state_flags() or
+ gtk_widget_unset_state_flags(). These functions trigger animated
+ transitions for the affected state flags. Examples of widgets for
+ which this kind of animation may be sufficient are #GtkButton or
+ #GtkEntry.
+ </para>
+ <para>
+ If your widget consists of more than a simple area, and these areas
+ may be rendered with different states, make sure to mark the rendered
+ areas with gtk_style_context_push_animatable_region() and
+ gtk_style_context_pop_animatable_region().
+ </para>
+
+ <para>
+ gtk_style_context_notify_state_change() may be used to trigger a
+ transition for a given state. The region ID will determine the
+ animatable region that is affected by this transition.
+ </para>
+ </listitem>
+ </orderedlist>
+ </refsect2>
+</chapter>
diff --git a/docs/reference/gtk/tmpl/gtkenums.sgml b/docs/reference/gtk/tmpl/gtkenums.sgml
index 90c5817326..24b4d335af 100644
--- a/docs/reference/gtk/tmpl/gtkenums.sgml
+++ b/docs/reference/gtk/tmpl/gtkenums.sgml
@@ -315,19 +315,16 @@ Used to change the appearance of an outline typically provided by a #GtkFrame.
<!-- ##### ENUM GtkStateType ##### -->
<para>
-This type indicates the current state of a widget; the state determines how
-the widget is drawn. The #GtkStateType enumeration is also used to
-identify different colors in a #GtkStyle for drawing, so states can be
-used for subparts of a widget as well as entire widgets.
-</para>
-
-@GTK_STATE_NORMAL: State during normal operation.
-@GTK_STATE_ACTIVE: State of a currently active widget, such as a depressed button.
-@GTK_STATE_PRELIGHT: State indicating that the mouse pointer is over
-the widget and the widget will respond to mouse clicks.
-@GTK_STATE_SELECTED: State of a selected item, such the selected row in a list.
-@GTK_STATE_INSENSITIVE: State indicating that the widget is
-unresponsive to user actions.
+
+</para>
+
+@GTK_STATE_NORMAL:
+@GTK_STATE_ACTIVE:
+@GTK_STATE_PRELIGHT:
+@GTK_STATE_SELECTED:
+@GTK_STATE_INSENSITIVE:
+@GTK_STATE_INCONSISTENT:
+@GTK_STATE_FOCUSED:
<!-- ##### ENUM GtkToolbarStyle ##### -->
<para>
diff --git a/docs/reference/gtk/tmpl/gtkrc.sgml b/docs/reference/gtk/tmpl/gtkrc.sgml
index e146d3157f..b89710a3f6 100644
--- a/docs/reference/gtk/tmpl/gtkrc.sgml
+++ b/docs/reference/gtk/tmpl/gtkrc.sgml
@@ -10,6 +10,10 @@ GTK+ provides resource file mechanism for configuring
various aspects of the operation of a GTK+ program
at runtime.
</para>
+<para>
+In GTK+ 3.0, resource files have been deprecated and replaced
+by CSS-like style sheets, which are understood by #GtkCssProvider.
+</para>
<refsect2><title>Default files</title>
<para>
diff --git a/docs/tools/shooter.c b/docs/tools/shooter.c
index 873609d972..f9492f62e1 100644
--- a/docs/tools/shooter.c
+++ b/docs/tools/shooter.c
@@ -224,7 +224,7 @@ int main (int argc, char **argv)
gtk_main_iteration ();
}
- id = gdk_x11_drawable_get_xid (GDK_DRAWABLE (window));
+ id = gdk_x11_window_get_xid (window);
screenshot = take_window_shot (id, info->include_decorations);
filename = g_strdup_printf ("./%s.png", info->name);
gdk_pixbuf_save (screenshot, filename, "png", NULL, NULL);
diff --git a/gdk/Makefile.am b/gdk/Makefile.am
index 9a48fe8042..987379bc9c 100644
--- a/gdk/Makefile.am
+++ b/gdk/Makefile.am
@@ -21,7 +21,6 @@ EXTRA_DIST += \
gdkkeysyms-update.pl \
gdk.def \
gdkmarshalers.list \
- gdkmedialib.h \
gdkwindowimpl.h \
makeenums.pl \
makefile.msc \
@@ -55,13 +54,6 @@ LDADD = \
$(no_undefined) \
$(LIBTOOL_EXPORT_OPTIONS)
-if USE_MEDIALIB
-medialib_sources = \
- gdkmedialib.c
-else
-medialib_sources =
-endif
-
#
# setup source file variables
#
@@ -79,7 +71,6 @@ gdk_public_h_sources = \
gdkdisplay.h \
gdkdisplaymanager.h \
gdkdnd.h \
- gdkdrawable.h \
gdkevents.h \
gdkinput.h \
gdkkeys.h \
@@ -111,7 +102,6 @@ gdk_private_headers = \
gdkpoly-generic.h
gdk_c_sources = \
- $(medialib_sources) \
gdk.c \
gdkapplaunchcontext.c \
gdkcairo.c \
@@ -122,7 +112,6 @@ gdk_c_sources = \
gdkdisplay.c \
gdkdisplaymanager.c \
gdkdnd.c \
- gdkdraw.c \
gdkevents.c \
gdkglobals.c \
gdkkeys.c \
@@ -202,7 +191,6 @@ x11_introspection_files = \
x11/gdkdevice-xi.c \
x11/gdkdisplay-x11.c \
x11/gdkdnd-x11.c \
- x11/gdkdrawable-x11.c \
x11/gdkeventsource.c \
x11/gdkeventtranslator.c \
x11/gdkgeometry-x11.c \
diff --git a/gdk/gdk.h b/gdk/gdk.h
index 9bc962201f..851185a8c0 100644
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -38,7 +38,6 @@
#include <gdk/gdkdisplay.h>
#include <gdk/gdkdisplaymanager.h>
#include <gdk/gdkdnd.h>
-#include <gdk/gdkdrawable.h>
#include <gdk/gdkenumtypes.h>
#include <gdk/gdkevents.h>
#include <gdk/gdkinput.h>
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index 557e7aebf0..f884f6011f 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -22,7 +22,6 @@ gdk_cairo_get_clip_rectangle
gdk_cairo_rectangle
gdk_cairo_region
gdk_cairo_region_create_from_surface
-gdk_cairo_reset_clip
gdk_cairo_set_source_color
gdk_cairo_set_source_pixbuf
gdk_cairo_set_source_rgba
@@ -154,9 +153,6 @@ gdk_drag_get_selection
gdk_drag_motion
gdk_drag_protocol_get_type G_GNUC_CONST
gdk_drag_status
-gdk_drawable_get_clip_region
-gdk_drawable_get_type G_GNUC_CONST
-gdk_drawable_get_visible_region
gdk_drop_finish
gdk_drop_reply
gdk_enable_multidevice
@@ -390,7 +386,7 @@ gdk_window_begin_move_drag
gdk_window_begin_paint_rect
gdk_window_begin_paint_region
gdk_window_begin_resize_drag
-gdk_window_class_get_type G_GNUC_CONST
+gdk_window_class_class_get_type G_GNUC_CONST
gdk_window_configure_finished
gdk_window_constrain_size
gdk_window_coords_from_parent
@@ -414,6 +410,7 @@ gdk_window_geometry_changed
gdk_window_get_accept_focus
gdk_window_get_background_pattern
gdk_window_get_children
+gdk_window_get_clip_region
gdk_window_get_composited
gdk_window_get_cursor
gdk_window_get_decorations
@@ -440,9 +437,11 @@ gdk_window_get_screen
gdk_window_get_state
gdk_window_get_support_multidevice
gdk_window_get_toplevel
+gdk_window_get_type G_GNUC_CONST
gdk_window_get_type_hint
gdk_window_get_update_area
gdk_window_get_user_data
+gdk_window_get_visible_region
gdk_window_get_visual
gdk_window_get_width
gdk_window_get_window_type
@@ -471,7 +470,6 @@ gdk_window_move
gdk_window_move_region
gdk_window_move_resize
gdk_window_new
-gdk_window_object_get_type G_GNUC_CONST
gdk_window_peek_children
gdk_window_process_all_updates
gdk_window_process_updates
@@ -547,8 +545,6 @@ gdk_x11_display_grab
gdk_x11_display_set_cursor_theme
gdk_x11_display_set_startup_notification_id
gdk_x11_display_ungrab
-gdk_x11_drawable_get_xdisplay
-gdk_x11_drawable_get_xid
gdk_x11_get_default_root_xwindow
gdk_x11_get_default_screen
gdk_x11_get_default_xdisplay
@@ -568,7 +564,7 @@ gdk_x11_screen_lookup_visual
gdk_x11_screen_supports_net_wm_hint
gdk_x11_ungrab_server
gdk_x11_visual_get_xvisual
-gdk_x11_window_get_drawable_impl
+gdk_x11_window_get_xid
gdk_x11_window_move_to_current_desktop
gdk_x11_window_set_user_time
gdk_x11_xatom_to_atom
diff --git a/gdk/gdkcairo.c b/gdk/gdkcairo.c
index 197e2c41e9..0d4b8bde09 100644
--- a/gdk/gdkcairo.c
+++ b/gdk/gdkcairo.c
@@ -21,7 +21,6 @@
#include "gdkcairo.h"
-#include "gdkdrawable.h"
#include "gdkinternals.h"
#include <math.h>
@@ -43,70 +42,6 @@
/**
- * gdk_cairo_create:
- * @drawable: a #GdkDrawable
- *
- * Creates a Cairo context for drawing to @drawable.
- *
- * <note><para>
- * Note that due to double-buffering, Cairo contexts created
- * in a GTK+ expose event handler cannot be cached and reused
- * between different expose events.
- * </para></note>
- *
- * Return value: A newly created Cairo context. Free with
- * cairo_destroy() when you are done drawing.
- *
- * Since: 2.8
- **/
-cairo_t *
-gdk_cairo_create (GdkDrawable *drawable)
-{
- cairo_surface_t *surface;
- cairo_t *cr;
-
- g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
-
- surface = _gdk_drawable_ref_cairo_surface (drawable);
- cr = cairo_create (surface);
-
- if (GDK_DRAWABLE_GET_CLASS (drawable)->set_cairo_clip)
- GDK_DRAWABLE_GET_CLASS (drawable)->set_cairo_clip (drawable, cr);
-
- cairo_surface_destroy (surface);
-
- return cr;
-}
-
-/**
- * gdk_cairo_reset_clip:
- * @cr: a #cairo_t
- * @drawable: a #GdkDrawable
- *
- * Resets the clip region for a Cairo context created by gdk_cairo_create().
- *
- * This resets the clip region to the "empty" state for the given drawable.
- * This is required for non-native windows since a direct call to
- * cairo_reset_clip() would unset the clip region inherited from the
- * drawable (i.e. the window clip region), and thus let you e.g.
- * draw outside your window.
- *
- * This is rarely needed though, since most code just create a new cairo_t
- * using gdk_cairo_create() each time they want to draw something.
- *
- * Since: 2.18
- **/
-void
-gdk_cairo_reset_clip (cairo_t *cr,
- GdkDrawable *drawable)
-{
- cairo_reset_clip (cr);
-
- if (GDK_DRAWABLE_GET_CLASS (drawable)->set_cairo_clip)
- GDK_DRAWABLE_GET_CLASS (drawable)->set_cairo_clip (drawable, cr);
-}
-
-/**
* gdk_cairo_get_clip_rectangle:
* @cr: a cairo context
* @rect: (out) (allow-none): return location for the clip, or %NULL
@@ -149,7 +84,7 @@ gdk_cairo_get_clip_rectangle (cairo_t *cr,
* gdk_cairo_set_source_color:
* @cr: a #cairo_t
* @color: a #GdkColor
- *
+ *
* Sets the specified #GdkColor as the source color of @cr.
*
* Since: 2.8
@@ -167,6 +102,15 @@ gdk_cairo_set_source_color (cairo_t *cr,
color->blue / 65535.);
}
+/**
+ * gdk_cairo_set_source_rgba:
+ * @cr: a #cairo_t
+ * @rgba: a #GdkRGBA
+ *
+ * Sets the specified #GdkRGBA as the source color of @cr.
+ *
+ * Since: 3.0
+ **/
void
gdk_cairo_set_source_rgba (cairo_t *cr,
const GdkRGBA *rgba)
@@ -363,7 +307,7 @@ gdk_cairo_set_source_window (cairo_t *cr,
g_return_if_fail (cr != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
- surface = _gdk_drawable_ref_cairo_surface (GDK_DRAWABLE (window));
+ surface = _gdk_window_ref_cairo_surface (window);
cairo_set_source_surface (cr, surface, x, y);
cairo_surface_destroy (surface);
}
diff --git a/gdk/gdkcairo.h b/gdk/gdkcairo.h
index b9b45e5f08..67e08aa933 100644
--- a/gdk/gdkcairo.h
+++ b/gdk/gdkcairo.h
@@ -31,9 +31,7 @@
G_BEGIN_DECLS
-cairo_t *gdk_cairo_create (GdkDrawable *drawable);
-void gdk_cairo_reset_clip (cairo_t *cr,
- GdkDrawable *drawable);
+cairo_t *gdk_cairo_create (GdkWindow *window);
gboolean gdk_cairo_get_clip_rectangle(cairo_t *cr,
GdkRectangle *rect);
diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c
index afe8b94ce7..4e9b3d24e8 100644
--- a/gdk/gdkdevice.c
+++ b/gdk/gdkdevice.c
@@ -1067,7 +1067,7 @@ gdk_device_grab (GdkDevice *device,
else
native = gdk_window_get_toplevel (window);
- while (((GdkWindowObject *) native)->window_type == GDK_WINDOW_OFFSCREEN)
+ while (native->window_type == GDK_WINDOW_OFFSCREEN)
{
native = gdk_offscreen_window_get_embedder (native);
@@ -1231,7 +1231,6 @@ _gdk_device_translate_window_coord (GdkDevice *device,
gdouble x_resolution, y_resolution;
gdouble device_aspect;
gint window_width, window_height;
- GdkWindowObject *window_private;
priv = device->priv;
@@ -1274,7 +1273,6 @@ _gdk_device_translate_window_coord (GdkDevice *device,
y_min = 0;
}
- window_private = (GdkWindowObject *) window;
window_width = gdk_window_get_width (window);
window_height = gdk_window_get_height (window);
@@ -1342,7 +1340,6 @@ _gdk_device_translate_screen_coord (GdkDevice *device,
GdkDevicePrivate *priv = device->priv;
GdkAxisInfo axis_info;
gdouble axis_width, scale, offset;
- GdkWindowObject *window_private;
if (priv->mode != GDK_MODE_SCREEN)
return FALSE;
@@ -1357,7 +1354,6 @@ _gdk_device_translate_screen_coord (GdkDevice *device,
return FALSE;
axis_width = axis_info.max_value - axis_info.min_value;
- window_private = (GdkWindowObject *) window;
if (axis_info.use == GDK_AXIS_X)
{
@@ -1366,7 +1362,7 @@ _gdk_device_translate_screen_coord (GdkDevice *device,
else
scale = 1;
- offset = - window_root_x - window_private->abs_x;
+ offset = - window_root_x - window->abs_x;
}
else
{
@@ -1375,7 +1371,7 @@ _gdk_device_translate_screen_coord (GdkDevice *device,
else
scale = 1;
- offset = - window_root_y - window_private->abs_y;
+ offset = - window_root_y - window->abs_y;
}
if (axis_value)
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index 564d4b5ca5..d5c01fdc02 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -933,20 +933,17 @@ gdk_window_real_window_get_device_position (GdkDisplay *display,
gint *y,
GdkModifierType *mask)
{
- GdkWindowObject *private;
gint tmpx, tmpy;
GdkModifierType tmp_mask;
gboolean normal_child;
- private = (GdkWindowObject *) window;
-
- normal_child = GDK_WINDOW_IMPL_GET_IFACE (private->impl)->get_device_state (window,
+ normal_child = GDK_WINDOW_IMPL_GET_CLASS (window->impl)->get_device_state (window,
device,
&tmpx, &tmpy,
&tmp_mask);
/* We got the coords on the impl, convert to the window */
- tmpx -= private->abs_x;
- tmpy -= private->abs_y;
+ tmpx -= window->abs_x;
+ tmpy -= window->abs_y;
if (x)
*x = tmpx;
diff --git a/gdk/gdkdraw.c b/gdk/gdkdraw.c
deleted file mode 100644
index d31dfd9a66..0000000000
--- a/gdk/gdkdraw.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/* GDK - The GIMP Drawing Kit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
- * file for a list of people on the GTK+ Team. See the ChangeLog
- * files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
- */
-
-#include "config.h"
-
-#include "gdkdrawable.h"
-
-#include "gdkcairo.h"
-#include "gdkinternals.h"
-#include "gdkwindow.h"
-#include "gdkscreen.h"
-#include "gdkpixbuf.h"
-
-#include <pango/pangocairo.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <math.h>
-
-G_DEFINE_ABSTRACT_TYPE (GdkDrawable, gdk_drawable, G_TYPE_OBJECT)
-
-static void
-gdk_drawable_class_init (GdkDrawableClass *klass)
-{
-}
-
-static void
-gdk_drawable_init (GdkDrawable *drawable)
-{
-}
-
-/**
- * gdk_drawable_get_clip_region:
- * @drawable: a #GdkDrawable
- *
- * Computes the region of a drawable that potentially can be written
- * to by drawing primitives. This region will not take into account
- * the clip region for the GC, and may also not take into account
- * other factors such as if the window is obscured by other windows,
- * but no area outside of this region will be affected by drawing
- * primitives.
- *
- * Returns: a #cairo_region_t. This must be freed with cairo_region_destroy()
- * when you are done.
- **/
-cairo_region_t *
-gdk_drawable_get_clip_region (GdkDrawable *drawable)
-{
- g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
-
- return GDK_DRAWABLE_GET_CLASS (drawable)->get_clip_region (drawable);
-}
-
-/**
- * gdk_drawable_get_visible_region:
- * @drawable: a #GdkDrawable
- *
- * Computes the region of a drawable that is potentially visible.
- * This does not necessarily take into account if the window is
- * obscured by other windows, but no area outside of this region
- * is visible.
- *
- * Returns: a #cairo_region_t. This must be freed with cairo_region_destroy()
- * when you are done.
- **/
-cairo_region_t *
-gdk_drawable_get_visible_region (GdkDrawable *drawable)
-{
- g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
-
- return GDK_DRAWABLE_GET_CLASS (drawable)->get_visible_region (drawable);
-}
-
-/**
- * _gdk_drawable_ref_cairo_surface:
- * @drawable: a #GdkDrawable
- *
- * Obtains a #cairo_surface_t for the given drawable. If a
- * #cairo_surface_t for the drawable already exists, it will be
- * referenced, otherwise a new surface will be created.
- *
- * Return value: a newly referenced #cairo_surface_t that points
- * to @drawable. Unref with cairo_surface_destroy()
- **/
-cairo_surface_t *
-_gdk_drawable_ref_cairo_surface (GdkDrawable *drawable)
-{
- g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
-
- return GDK_DRAWABLE_GET_CLASS (drawable)->ref_cairo_surface (drawable);
-}
-
-/************************************************************************/
-
-cairo_surface_t *
-_gdk_drawable_create_cairo_surface (GdkDrawable *drawable,
- int width,
- int height)
-{
- return GDK_DRAWABLE_GET_CLASS (drawable)->create_cairo_surface (drawable,
- width, height);
-}
diff --git a/gdk/gdkdrawable.h b/gdk/gdkdrawable.h
deleted file mode 100644
index a32c18524f..0000000000
--- a/gdk/gdkdrawable.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* GDK - The GIMP Drawing Kit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
- * file for a list of people on the GTK+ Team. See the ChangeLog
- * files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
- */
-
-#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
-#error "Only <gdk/gdk.h> can be included directly."
-#endif
-
-#ifndef __GDK_DRAWABLE_H__
-#define __GDK_DRAWABLE_H__
-
-#include <gdk/gdktypes.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-
-#include <cairo.h>
-
-G_BEGIN_DECLS
-
-typedef struct _GdkDrawableClass GdkDrawableClass;
-
-#define GDK_TYPE_DRAWABLE (gdk_drawable_get_type ())
-#define GDK_DRAWABLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DRAWABLE, GdkDrawable))
-#define GDK_DRAWABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAWABLE, GdkDrawableClass))
-#define GDK_IS_DRAWABLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DRAWABLE))
-#define GDK_IS_DRAWABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAWABLE))
-#define GDK_DRAWABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAWABLE, GdkDrawableClass))
-
-/**
- * GdkDrawable:
- *
- * An opaque structure representing an object that can be
- * drawn onto.
- */
-struct _GdkDrawable
-{
- GObject parent_instance;
-};
-
-struct _GdkDrawableClass
-{
- GObjectClass parent_class;
-
- cairo_region_t* (*get_clip_region) (GdkDrawable *drawable);
- cairo_region_t* (*get_visible_region) (GdkDrawable *drawable);
-
- cairo_surface_t *(*ref_cairo_surface) (GdkDrawable *drawable);
-
- void (*set_cairo_clip) (GdkDrawable *drawable,
- cairo_t *cr);
-
- cairo_surface_t * (*create_cairo_surface) (GdkDrawable *drawable,
- int width,
- int height);
-
- /* Padding for future expansion */
- void (*_gdk_reserved7) (void);
- void (*_gdk_reserved9) (void);
- void (*_gdk_reserved10) (void);
- void (*_gdk_reserved11) (void);
- void (*_gdk_reserved12) (void);
- void (*_gdk_reserved13) (void);
- void (*_gdk_reserved14) (void);
- void (*_gdk_reserved15) (void);
-};
-
-GType gdk_drawable_get_type (void) G_GNUC_CONST;
-
-cairo_region_t *gdk_drawable_get_clip_region (GdkDrawable *drawable);
-cairo_region_t *gdk_drawable_get_visible_region (GdkDrawable *drawable);
-
-G_END_DECLS
-
-#endif /* __GDK_DRAWABLE_H__ */
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index d60f3b16f9..438beb8a1f 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -59,9 +59,16 @@ struct _GdkIOClosure
/* Private variable declarations
*/
-GdkEventFunc _gdk_event_func = NULL; /* Callback for events */
-gpointer _gdk_event_data = NULL;
-GDestroyNotify _gdk_event_notify = NULL;
+static GdkEventFunc _gdk_event_func = NULL; /* Callback for events */
+static gpointer _gdk_event_data = NULL;
+static GDestroyNotify _gdk_event_notify = NULL;
+
+void
+_gdk_event_emit (GdkEvent *event)
+{
+ if (_gdk_event_func)
+ (*_gdk_event_func) (event, _gdk_event_data);
+}
/*********************************************
* Functions for maintaining the event queue *
@@ -636,7 +643,6 @@ gdk_event_get_time (const GdkEvent *event)
return event->dnd.time;
case GDK_CLIENT_EVENT:
case GDK_VISIBILITY_NOTIFY:
- case GDK_NO_EXPOSE:
case GDK_CONFIGURE:
case GDK_FOCUS_CHANGE:
case GDK_NOTHING:
@@ -704,7 +710,6 @@ gdk_event_get_state (const GdkEvent *event,
return TRUE;
case GDK_VISIBILITY_NOTIFY:
case GDK_CLIENT_EVENT:
- case GDK_NO_EXPOSE:
case GDK_CONFIGURE:
case GDK_FOCUS_CHANGE:
case GDK_SELECTION_CLEAR:
@@ -1435,7 +1440,7 @@ gdk_synthesize_window_state (GdkWindow *window,
temp_event.window_state.type = GDK_WINDOW_STATE;
temp_event.window_state.send_event = FALSE;
- old = ((GdkWindowObject*) temp_event.window_state.window)->state;
+ old = temp_event.window_state.window->state;
temp_event.window_state.new_window_state = old;
temp_event.window_state.new_window_state |= set_flags;
@@ -1450,7 +1455,7 @@ gdk_synthesize_window_state (GdkWindow *window,
* inconsistent state to the user.
*/
- ((GdkWindowObject*) window)->state = temp_event.window_state.new_window_state;
+ window->state = temp_event.window_state.new_window_state;
if (temp_event.window_state.changed_mask & GDK_WINDOW_STATE_WITHDRAWN)
_gdk_window_update_viewable (window);
@@ -1460,7 +1465,7 @@ gdk_synthesize_window_state (GdkWindow *window,
* Non-toplevels do use the GDK_WINDOW_STATE_WITHDRAWN flag
* internally so we needed to update window->state.
*/
- switch (((GdkWindowObject*) window)->window_type)
+ switch (window->window_type)
{
case GDK_WINDOW_TOPLEVEL:
case GDK_WINDOW_TEMP: /* ? */
diff --git a/gdk/gdkevents.h b/gdk/gdkevents.h
index caecd97dad..fcefc6c1c8 100644
--- a/gdk/gdkevents.h
+++ b/gdk/gdkevents.h
@@ -77,7 +77,6 @@ G_BEGIN_DECLS
typedef struct _GdkEventAny GdkEventAny;
typedef struct _GdkEventExpose GdkEventExpose;
-typedef struct _GdkEventNoExpose GdkEventNoExpose;
typedef struct _GdkEventVisibility GdkEventVisibility;
typedef struct _GdkEventMotion GdkEventMotion;
typedef struct _GdkEventButton GdkEventButton;
@@ -205,8 +204,6 @@ typedef GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent,
* @GDK_DROP_FINISHED: the drop operation initiated by the window has completed.
* @GDK_CLIENT_EVENT: a message has been received from another application.
* @GDK_VISIBILITY_NOTIFY: the window visibility status has changed.
- * @GDK_NO_EXPOSE: indicates that the source region was completely available
- * when parts of a drawable were copied. This is not very useful.
* @GDK_SCROLL: the scroll wheel was turned
* @GDK_WINDOW_STATE: the state of a window has changed. See #GdkWindowState
* for the possible window states
@@ -258,7 +255,6 @@ typedef enum
GDK_DROP_FINISHED = 27,
GDK_CLIENT_EVENT = 28,
GDK_VISIBILITY_NOTIFY = 29,
- GDK_NO_EXPOSE = 30,
GDK_SCROLL = 31,
GDK_WINDOW_STATE = 32,
GDK_SETTING = 33,
@@ -466,23 +462,6 @@ struct _GdkEventExpose
};
/**
- * GdkEventNoExpose:
- * @type: the type of the event (%GDK_NO_EXPOSE).
- * @window: the window which received the event.
- * @send_event: %TRUE if the event was sent explicitly (e.g. using
- * <function>XSendEvent</function>).
- *
- * Generated when the area of a #GdkDrawable being copied was completely
- * available.
- */
-struct _GdkEventNoExpose
-{
- GdkEventType type;
- GdkWindow *window;
- gint8 send_event;
-};
-
-/**
* GdkEventVisibility:
* @type: the type of the event (%GDK_VISIBILITY_NOTIFY).
* @window: the window which received the event.
@@ -1064,7 +1043,6 @@ union _GdkEvent
GdkEventType type;
GdkEventAny any;
GdkEventExpose expose;
- GdkEventNoExpose no_expose;
GdkEventVisibility visibility;
GdkEventMotion motion;
GdkEventButton button;
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index c425447871..a0063cdc97 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -32,10 +32,8 @@
#include <gio/gio.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkwindow.h>
+#include <gdk/gdkwindowimpl.h>
#include <gdk/gdkprivate.h>
-#ifdef USE_MEDIALIB
-#include <gdk/gdkmedialib.h>
-#endif
G_BEGIN_DECLS
@@ -178,25 +176,20 @@ typedef struct
} GdkDeviceGrabInfo;
typedef struct _GdkInputWindow GdkInputWindow;
+typedef struct _GdkWindowPaint GdkWindowPaint;
typedef void (* GdkDisplayPointerInfoForeach) (GdkDisplay *display,
GdkDevice *device,
GdkPointerWindowInfo *device_info,
gpointer user_data);
-/* Private version of GdkWindowObject. The initial part of this strucuture
- is public for historical reasons. Don't change that part */
-typedef struct _GdkWindowPaint GdkWindowPaint;
-
-#define GDK_WINDOW_OBJECT(object) ((GdkWindowObject *) GDK_WINDOW (object))
-
-struct _GdkWindowObject
+struct _GdkWindow
{
- GdkDrawable parent_instance;
+ GObject parent_instance;
- GdkDrawable *impl; /* window-system-specific delegate object */
+ GdkWindowImpl *impl; /* window-system-specific delegate object */
- GdkWindowObject *parent;
+ GdkWindow *parent;
GdkVisual *visual;
gpointer user_data;
@@ -238,10 +231,10 @@ struct _GdkWindowObject
guint update_and_descendants_freeze_count;
- /* The GdkWindowObject that has the impl, ref:ed if another window.
+ /* The GdkWindow that has the impl, ref:ed if another window.
* This ref is required to keep the wrapper of the impl window alive
* for as long as any GdkWindow references the impl. */
- GdkWindowObject *impl_window;
+ GdkWindow *impl_window;
int abs_x, abs_y; /* Absolute offset in impl */
gint width, height;
guint32 clip_tag;
@@ -267,18 +260,13 @@ struct _GdkWindowObject
cairo_region_t *input_shape;
cairo_surface_t *cairo_surface;
- guint outstanding_surfaces; /* only set on impl window */
GList *devices_inside;
GHashTable *device_events;
};
-#define GDK_WINDOW_TYPE(d) (((GdkWindowObject*)(GDK_WINDOW (d)))->window_type)
-#define GDK_WINDOW_DESTROYED(d) (((GdkWindowObject*)(GDK_WINDOW (d)))->destroyed)
-
-extern GdkEventFunc _gdk_event_func; /* Callback for events */
-extern gpointer _gdk_event_data;
-extern GDestroyNotify _gdk_event_notify;
+#define GDK_WINDOW_TYPE(d) (((GDK_WINDOW (d)))->window_type)
+#define GDK_WINDOW_DESTROYED(d) (GDK_WINDOW (d)->destroyed)
extern GSList *_gdk_displays;
extern gchar *_gdk_display_name;
@@ -289,6 +277,7 @@ extern gboolean _gdk_enable_multidevice;
void _gdk_events_queue (GdkDisplay *display);
GdkEvent* _gdk_event_unqueue (GdkDisplay *display);
+void _gdk_event_emit (GdkEvent *event);
GList* _gdk_event_queue_find_first (GdkDisplay *display);
void _gdk_event_queue_remove_link (GdkDisplay *display,
GList *node);
@@ -318,16 +307,13 @@ GdkDeviceManager * _gdk_device_manager_new (GdkDisplay *display);
gboolean _gdk_cairo_surface_extents (cairo_surface_t *surface,
GdkRectangle *extents);
-cairo_surface_t *_gdk_drawable_ref_cairo_surface (GdkDrawable *drawable);
-
-cairo_surface_t * _gdk_drawable_create_cairo_surface (GdkDrawable *drawable,
- int width,
- int height);
-
/*************************************
* Interfaces used by windowing code *
*************************************/
+cairo_surface_t *
+ _gdk_window_ref_cairo_surface (GdkWindow *window);
+
void _gdk_window_impl_new (GdkWindow *window,
GdkWindow *real_parent,
GdkScreen *screen,
@@ -367,9 +353,6 @@ gulong _gdk_windowing_window_get_next_serial (GdkDisplay *display);
void _gdk_windowing_window_get_offsets (GdkWindow *window,
gint *x_offset,
gint *y_offset);
-cairo_region_t *_gdk_windowing_window_get_shape (GdkWindow *window);
-cairo_region_t *_gdk_windowing_window_get_input_shape(GdkWindow *window);
-void _gdk_windowing_window_beep (GdkWindow *window);
void _gdk_windowing_get_device_state (GdkDisplay *display,
@@ -407,7 +390,7 @@ gint _gdk_windowing_get_bits_for_depth (GdkDisplay *display,
gint depth);
-#define GDK_WINDOW_IS_MAPPED(window) ((((GdkWindowObject*)window)->state & GDK_WINDOW_STATE_WITHDRAWN) == 0)
+#define GDK_WINDOW_IS_MAPPED(window) (((window)->state & GDK_WINDOW_STATE_WITHDRAWN) == 0)
/* Called when gdk_window_destroy() is called on a foreign window
@@ -443,9 +426,6 @@ struct _GdkPaintableIface
GType _gdk_paintable_get_type (void) G_GNUC_CONST;
-/* Implementation types */
-GType _gdk_window_impl_get_type (void) G_GNUC_CONST;
-
struct GdkAppLaunchContextPrivate
{
GdkDisplay *display;
diff --git a/gdk/gdkmedialib.c b/gdk/gdkmedialib.c
deleted file mode 100644
index 597726824b..0000000000
--- a/gdk/gdkmedialib.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/* GDK - The GIMP Drawing Kit
- * Copyright (C) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- * (Brian Cameron, Dmitriy Demin, James Cheng, Padraig O'Briain)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2007. See the AUTHORS
- * file for a list of people on the GTK+ Team. See the ChangeLog
- * files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
- */
-
-#include "config.h"
-
-#include "gdkmedialib.h"
-
-#include <stdlib.h>
-#include <dlfcn.h>
-
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#if defined(HAVE_SYS_SYSTEMINFO_H)
-#include <sys/systeminfo.h>
-#elif defined(HAVE_SYS_SYSINFO_H)
-#include <sys/sysinfo.h>
-#endif
-
-typedef char * (*ml_version) (void);
-
-static ml_version medialib_version = mlib_version;
-
-gboolean
-_gdk_use_medialib (void)
-{
- char *mlib_version_string;
- char sys_info[257];
- long count;
-
- /*
- * Sun mediaLib(tm) support.
- *
- * http://www.sun.com/processors/vis/mlib.html
- *
- */
- if (getenv ("GDK_DISABLE_MEDIALIB"))
- return FALSE;
-
- /*
- * The imaging functions we want to use were added in mediaLib version 2.
- * So turn off mediaLib support if the user has an older version.
- * mlib_version returns a string in this format:
- *
- * mediaLib:0210:20011101:v8plusa
- * ^^^^^^^^ ^^^^ ^^^^^^^^ ^^^^^^^
- * libname vers build ISALIST identifier
- * date (in this case sparcv8plus+vis)
- *
- * The first 2 digits of the version are the major version. The 3rd digit
- * is the minor version, and the 4th digit is the micro version. So the
- * above string corresponds to version 2.1.0.In the following test we only
- * care about the major version.
- */
- mlib_version_string = medialib_version ();
-
- count = sysinfo (SI_ARCHITECTURE, &sys_info[0], 257);
-
- if (count != -1)
- {
- if (strcmp (sys_info, "i386") == 0)
- {
- char *mlib_target_isa = &mlib_version_string[23];
-
- /*
- * For x86 processors mediaLib generic C implementation
- * does not give any performance advantage so disable it.
- */
- if (strncmp (mlib_target_isa, "sse", 3) != 0)
- {
- return FALSE;
- }
-
- /*
- * For x86 processors use of libumem conflicts with
- * mediaLib, so avoid using it.
- */
- if (dlsym (RTLD_PROBE, "umem_alloc") != NULL)
- {
- return FALSE;
- }
- }
- }
- else
- {
- /* Failed to get system architecture, disable mediaLib */
- return FALSE;
- }
-
- return TRUE;
-}
diff --git a/gdk/gdkmedialib.h b/gdk/gdkmedialib.h
deleted file mode 100644
index 1912e9d70d..0000000000
--- a/gdk/gdkmedialib.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* GDK - The GIMP Drawing Kit
- * Copyright (C) 2001-2007 Sun Microsystems, Inc. All rights reserved.
- * (Brian Cameron, Dmitriy Demin, James Cheng, Padraig O'Briain)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
- * file for a list of people on the GTK+ Team. See the ChangeLog
- * files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
- */
-
-#ifndef __GDK_MEDIALIB_H__
-#define __GDK_MEDIALIB_H__
-
-#ifdef USE_MEDIALIB
-#include <mlib_image.h>
-#include <mlib_video.h>
-
-#include <gdktypes.h>
-
-G_BEGIN_DECLS
-
-gboolean _gdk_use_medialib (void);
-
-G_END_DECLS
-
-#endif /* USE_MEDIALIB */
-#endif /* __GDK_MEDIALIB_H__ */
-
diff --git a/gdk/gdkoffscreenwindow.c b/gdk/gdkoffscreenwindow.c
index f7c071b16c..9ade91bee1 100644
--- a/gdk/gdkoffscreenwindow.c
+++ b/gdk/gdkoffscreenwindow.c
@@ -44,7 +44,7 @@ typedef struct _GdkOffscreenWindowClass GdkOffscreenWindowClass;
struct _GdkOffscreenWindow
{
- GdkDrawable parent_instance;
+ GdkWindowImpl parent_instance;
GdkWindow *wrapper;
@@ -54,7 +54,7 @@ struct _GdkOffscreenWindow
struct _GdkOffscreenWindowClass
{
- GdkDrawableClass parent_class;
+ GdkWindowImplClass parent_class;
};
#define GDK_TYPE_OFFSCREEN_WINDOW (gdk_offscreen_window_get_type())
@@ -64,14 +64,9 @@ struct _GdkOffscreenWindowClass
#define GDK_IS_OFFSCREEN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_OFFSCREEN_WINDOW))
#define GDK_OFFSCREEN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_OFFSCREEN_WINDOW, GdkOffscreenWindowClass))
-static void gdk_offscreen_window_impl_iface_init (GdkWindowImplIface *iface);
static void gdk_offscreen_window_hide (GdkWindow *window);
-G_DEFINE_TYPE_WITH_CODE (GdkOffscreenWindow,
- gdk_offscreen_window,
- GDK_TYPE_DRAWABLE,
- G_IMPLEMENT_INTERFACE (GDK_TYPE_WINDOW_IMPL,
- gdk_offscreen_window_impl_iface_init));
+G_DEFINE_TYPE (GdkOffscreenWindow, gdk_offscreen_window, GDK_TYPE_WINDOW_IMPL)
static void
@@ -95,10 +90,9 @@ gdk_offscreen_window_destroy (GdkWindow *window,
gboolean recursing,
gboolean foreign_destroy)
{
- GdkWindowObject *private = GDK_WINDOW_OBJECT (window);
GdkOffscreenWindow *offscreen;
- offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
+ offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
gdk_offscreen_window_set_embedder (window, NULL);
@@ -111,11 +105,11 @@ get_surface (GdkOffscreenWindow *offscreen)
{
if (! offscreen->surface)
{
- GdkWindowObject *private = (GdkWindowObject *) offscreen->wrapper;
+ GdkWindow *window = offscreen->wrapper;
- g_signal_emit_by_name (private, "create-surface",
- private->width,
- private->height,
+ g_signal_emit_by_name (window, "create-surface",
+ window->width,
+ window->height,
&offscreen->surface);
}
@@ -141,9 +135,9 @@ is_parent_of (GdkWindow *parent,
}
static cairo_surface_t *
-gdk_offscreen_window_ref_cairo_surface (GdkDrawable *drawable)
+gdk_offscreen_window_ref_cairo_surface (GdkWindow *window)
{
- GdkOffscreenWindow *offscreen = GDK_OFFSCREEN_WINDOW (drawable);
+ GdkOffscreenWindow *offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
return cairo_surface_reference (get_surface (offscreen));
}
@@ -153,14 +147,13 @@ _gdk_offscreen_window_create_surface (GdkWindow *offscreen,
gint width,
gint height)
{
- GdkWindowObject *private = (GdkWindowObject *) offscreen;
cairo_surface_t *similar;
cairo_surface_t *surface;
cairo_content_t content = CAIRO_CONTENT_COLOR;
- g_return_val_if_fail (GDK_IS_OFFSCREEN_WINDOW (private->impl), NULL);
+ g_return_val_if_fail (GDK_IS_OFFSCREEN_WINDOW (offscreen->impl), NULL);
- similar = _gdk_drawable_ref_cairo_surface ((GdkWindow *)private->parent);
+ similar = _gdk_window_ref_cairo_surface (offscreen->parent);
if (gdk_window_get_visual (offscreen) ==
gdk_screen_get_rgba_visual (gdk_window_get_screen (offscreen)))
@@ -180,7 +173,6 @@ _gdk_offscreen_window_new (GdkWindow *window,
GdkWindowAttr *attributes,
gint attributes_mask)
{
- GdkWindowObject *private;
GdkOffscreenWindow *offscreen;
g_return_if_fail (attributes != NULL);
@@ -188,13 +180,11 @@ _gdk_offscreen_window_new (GdkWindow *window,
if (attributes->wclass != GDK_INPUT_OUTPUT)
return; /* Can't support input only offscreens */
- private = (GdkWindowObject *)window;
-
- if (private->parent != NULL && GDK_WINDOW_DESTROYED (private->parent))
+ if (window->parent != NULL && GDK_WINDOW_DESTROYED (window->parent))
return;
- private->impl = g_object_new (GDK_TYPE_OFFSCREEN_WINDOW, NULL);
- offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
+ window->impl = g_object_new (GDK_TYPE_OFFSCREEN_WINDOW, NULL);
+ offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
offscreen->wrapper = window;
}
@@ -204,15 +194,13 @@ gdk_offscreen_window_reparent (GdkWindow *window,
gint x,
gint y)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
- GdkWindowObject *new_parent_private = (GdkWindowObject *)new_parent;
- GdkWindowObject *old_parent;
+ GdkWindow *old_parent;
gboolean was_mapped;
if (new_parent)
{
/* No input-output children of input-only windows */
- if (new_parent_private->input_only && !private->input_only)
+ if (new_parent->input_only && !window->input_only)
return FALSE;
/* Don't create loops in hierarchy */
@@ -224,20 +212,20 @@ gdk_offscreen_window_reparent (GdkWindow *window,
gdk_window_hide (window);
- if (private->parent)
- private->parent->children = g_list_remove (private->parent->children, window);
+ if (window->parent)
+ window->parent->children = g_list_remove (window->parent->children, window);
- old_parent = private->parent;
- private->parent = new_parent_private;
- private->x = x;
- private->y = y;
+ old_parent = window->parent;
+ window->parent = new_parent;
+ window->x = x;
+ window->y = y;
- if (new_parent_private)
- private->parent->children = g_list_prepend (private->parent->children, window);
+ if (new_parent)
+ window->parent->children = g_list_prepend (window->parent->children, window);
_gdk_synthesize_crossing_events_for_geometry_change (window);
if (old_parent)
- _gdk_synthesize_crossing_events_for_geometry_change (GDK_WINDOW (old_parent));
+ _gdk_synthesize_crossing_events_for_geometry_change (old_parent);
return was_mapped;
}
@@ -247,11 +235,7 @@ from_embedder (GdkWindow *window,
double embedder_x, double embedder_y,
double *offscreen_x, double *offscreen_y)
{
- GdkWindowObject *private;
-
- private = (GdkWindowObject *)window;
-
- g_signal_emit_by_name (private->impl_window,
+ g_signal_emit_by_name (window->impl_window,
"from-embedder",
embedder_x, embedder_y,
offscreen_x, offscreen_y,
@@ -263,11 +247,7 @@ to_embedder (GdkWindow *window,
double offscreen_x, double offscreen_y,
double *embedder_x, double *embedder_y)
{
- GdkWindowObject *private;
-
- private = (GdkWindowObject *)window;
-
- g_signal_emit_by_name (private->impl_window,
+ g_signal_emit_by_name (window->impl_window,
"to-embedder",
offscreen_x, offscreen_y,
embedder_x, embedder_y,
@@ -281,14 +261,13 @@ gdk_offscreen_window_get_root_coords (GdkWindow *window,
gint *root_x,
gint *root_y)
{
- GdkWindowObject *private = GDK_WINDOW_OBJECT (window);
GdkOffscreenWindow *offscreen;
int tmpx, tmpy;
tmpx = x;
tmpy = y;
- offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
+ offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
if (offscreen->embedder)
{
double dx, dy;
@@ -318,7 +297,6 @@ gdk_offscreen_window_get_device_state (GdkWindow *window,
gint *y,
GdkModifierType *mask)
{
- GdkWindowObject *private = GDK_WINDOW_OBJECT (window);
GdkOffscreenWindow *offscreen;
int tmpx, tmpy;
double dtmpx, dtmpy;
@@ -328,7 +306,7 @@ gdk_offscreen_window_get_device_state (GdkWindow *window,
tmpy = 0;
tmpmask = 0;
- offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
+ offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
if (offscreen->embedder != NULL)
{
gdk_window_get_device_position (offscreen->embedder, device, &tmpx, &tmpy, &tmpmask);
@@ -361,15 +339,14 @@ gdk_offscreen_window_get_device_state (GdkWindow *window,
cairo_surface_t *
gdk_offscreen_window_get_surface (GdkWindow *window)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
GdkOffscreenWindow *offscreen;
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
- if (!GDK_IS_OFFSCREEN_WINDOW (private->impl))
+ if (!GDK_IS_OFFSCREEN_WINDOW (window->impl))
return NULL;
- offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
+ offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
return get_surface (offscreen);
}
@@ -396,33 +373,32 @@ gdk_offscreen_window_move_resize_internal (GdkWindow *window,
gint height,
gboolean send_expose_events)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
GdkOffscreenWindow *offscreen;
gint dx, dy, dw, dh;
- offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
+ offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
if (width < 1)
width = 1;
if (height < 1)
height = 1;
- if (private->destroyed)
+ if (window->destroyed)
return;
- dx = x - private->x;
- dy = y - private->y;
- dw = width - private->width;
- dh = height - private->height;
+ dx = x - window->x;
+ dy = y - window->y;
+ dw = width - window->width;
+ dh = height - window->height;
- private->x = x;
- private->y = y;
+ window->x = x;
+ window->y = y;
- if (private->width != width ||
- private->height != height)
+ if (window->width != width ||
+ window->height != height)
{
- private->width = width;
- private->height = height;
+ window->width = width;
+ window->height = height;
if (offscreen->surface)
{
@@ -443,7 +419,7 @@ gdk_offscreen_window_move_resize_internal (GdkWindow *window,
}
}
- if (GDK_WINDOW_IS_MAPPED (private))
+ if (GDK_WINDOW_IS_MAPPED (window))
{
// TODO: Only invalidate new area, i.e. for larger windows
gdk_window_invalidate_rect (window, NULL, TRUE);
@@ -459,22 +435,21 @@ gdk_offscreen_window_move_resize (GdkWindow *window,
gint width,
gint height)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
GdkOffscreenWindow *offscreen;
- offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
+ offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
if (!with_move)
{
- x = private->x;
- y = private->y;
+ x = window->x;
+ y = window->y;
}
if (width < 0)
- width = private->width;
+ width = window->width;
if (height < 0)
- height = private->height;
+ height = window->height;
gdk_offscreen_window_move_resize_internal (window, x, y,
width, height,
@@ -485,8 +460,7 @@ static void
gdk_offscreen_window_show (GdkWindow *window,
gboolean already_mapped)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
- GdkRectangle area = { 0, 0, private->width, private->height };
+ GdkRectangle area = { 0, 0, window->width, window->height };
gdk_window_invalidate_rect (window, &area, FALSE);
}
@@ -495,14 +469,12 @@ gdk_offscreen_window_show (GdkWindow *window,
static void
gdk_offscreen_window_hide (GdkWindow *window)
{
- GdkWindowObject *private;
GdkOffscreenWindow *offscreen;
GdkDisplay *display;
g_return_if_fail (window != NULL);
- private = (GdkWindowObject*) window;
- offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
+ offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
/* May need to break grabs on children */
display = gdk_window_get_display (window);
@@ -580,22 +552,18 @@ gdk_offscreen_window_get_geometry (GdkWindow *window,
gint *height,
gint *depth)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
-
- g_return_if_fail (window == NULL || GDK_IS_WINDOW (window));
-
if (!GDK_WINDOW_DESTROYED (window))
{
if (x)
- *x = private->x;
+ *x = window->x;
if (y)
- *y = private->y;
+ *y = window->y;
if (width)
- *width = private->width;
+ *width = window->width;
if (height)
- *height = private->height;
+ *height = window->height;
if (depth)
- *depth = private->depth;
+ *depth = window->depth;
}
}
@@ -612,7 +580,7 @@ gdk_offscreen_window_translate (GdkWindow *window,
gint dx,
gint dy)
{
- GdkOffscreenWindow *offscreen = GDK_OFFSCREEN_WINDOW (((GdkWindowObject *) window)->impl);
+ GdkOffscreenWindow *offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
if (offscreen->surface)
{
@@ -672,26 +640,25 @@ void
gdk_offscreen_window_set_embedder (GdkWindow *window,
GdkWindow *embedder)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
GdkOffscreenWindow *offscreen;
g_return_if_fail (GDK_IS_WINDOW (window));
- if (!GDK_IS_OFFSCREEN_WINDOW (private->impl))
+ if (!GDK_IS_OFFSCREEN_WINDOW (window->impl))
return;
- offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
+ offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
if (embedder)
{
g_object_ref (embedder);
- GDK_WINDOW_OBJECT (embedder)->num_offscreen_children++;
+ embedder->num_offscreen_children++;
}
if (offscreen->embedder)
{
g_object_unref (offscreen->embedder);
- GDK_WINDOW_OBJECT (offscreen->embedder)->num_offscreen_children--;
+ offscreen->embedder->num_offscreen_children--;
}
offscreen->embedder = embedder;
@@ -711,15 +678,14 @@ gdk_offscreen_window_set_embedder (GdkWindow *window,
GdkWindow *
gdk_offscreen_window_get_embedder (GdkWindow *window)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
GdkOffscreenWindow *offscreen;
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
- if (!GDK_IS_OFFSCREEN_WINDOW (private->impl))
+ if (!GDK_IS_OFFSCREEN_WINDOW (window->impl))
return NULL;
- offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
+ offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
return offscreen->embedder;
}
@@ -727,35 +693,30 @@ gdk_offscreen_window_get_embedder (GdkWindow *window)
static void
gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
{
- GdkDrawableClass *drawable_class = GDK_DRAWABLE_CLASS (klass);
+ GdkWindowImplClass *impl_class = GDK_WINDOW_IMPL_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gdk_offscreen_window_finalize;
- drawable_class->ref_cairo_surface = gdk_offscreen_window_ref_cairo_surface;
-}
-
-static void
-gdk_offscreen_window_impl_iface_init (GdkWindowImplIface *iface)
-{
- iface->show = gdk_offscreen_window_show;
- iface->hide = gdk_offscreen_window_hide;
- iface->withdraw = gdk_offscreen_window_withdraw;
- iface->raise = gdk_offscreen_window_raise;
- iface->lower = gdk_offscreen_window_lower;
- iface->move_resize = gdk_offscreen_window_move_resize;
- iface->set_background = gdk_offscreen_window_set_background;
- iface->get_events = gdk_offscreen_window_get_events;
- iface->set_events = gdk_offscreen_window_set_events;
- iface->reparent = gdk_offscreen_window_reparent;
- iface->get_geometry = gdk_offscreen_window_get_geometry;
- iface->shape_combine_region = gdk_offscreen_window_shape_combine_region;
- iface->input_shape_combine_region = gdk_offscreen_window_input_shape_combine_region;
- iface->set_static_gravities = gdk_offscreen_window_set_static_gravities;
- iface->queue_antiexpose = gdk_offscreen_window_queue_antiexpose;
- iface->translate = gdk_offscreen_window_translate;
- iface->get_root_coords = gdk_offscreen_window_get_root_coords;
- iface->get_device_state = gdk_offscreen_window_get_device_state;
- iface->destroy = gdk_offscreen_window_destroy;
- iface->resize_cairo_surface = gdk_offscreen_window_resize_cairo_surface;
+ impl_class->ref_cairo_surface = gdk_offscreen_window_ref_cairo_surface;
+ impl_class->show = gdk_offscreen_window_show;
+ impl_class->hide = gdk_offscreen_window_hide;
+ impl_class->withdraw = gdk_offscreen_window_withdraw;
+ impl_class->raise = gdk_offscreen_window_raise;
+ impl_class->lower = gdk_offscreen_window_lower;
+ impl_class->move_resize = gdk_offscreen_window_move_resize;
+ impl_class->set_background = gdk_offscreen_window_set_background;
+ impl_class->get_events = gdk_offscreen_window_get_events;
+ impl_class->set_events = gdk_offscreen_window_set_events;
+ impl_class->reparent = gdk_offscreen_window_reparent;
+ impl_class->get_geometry = gdk_offscreen_window_get_geometry;
+ impl_class->shape_combine_region = gdk_offscreen_window_shape_combine_region;
+ impl_class->input_shape_combine_region = gdk_offscreen_window_input_shape_combine_region;
+ impl_class->set_static_gravities = gdk_offscreen_window_set_static_gravities;
+ impl_class->queue_antiexpose = gdk_offscreen_window_queue_antiexpose;
+ impl_class->translate = gdk_offscreen_window_translate;
+ impl_class->get_root_coords = gdk_offscreen_window_get_root_coords;
+ impl_class->get_device_state = gdk_offscreen_window_get_device_state;
+ impl_class->destroy = gdk_offscreen_window_destroy;
+ impl_class->resize_cairo_surface = gdk_offscreen_window_resize_cairo_surface;
}
diff --git a/gdk/gdkpixbuf-drawable.c b/gdk/gdkpixbuf-drawable.c
index 3869099e08..fd14b9e352 100644
--- a/gdk/gdkpixbuf-drawable.c
+++ b/gdk/gdkpixbuf-drawable.c
@@ -91,7 +91,7 @@ gdk_pixbuf_get_from_window (GdkWindow *src,
g_return_val_if_fail (GDK_IS_WINDOW (src), NULL);
g_return_val_if_fail (gdk_window_is_viewable (src), NULL);
- surface = _gdk_drawable_ref_cairo_surface (src);
+ surface = _gdk_window_ref_cairo_surface (src);
dest = gdk_pixbuf_get_from_surface (surface,
src_x, src_y,
width, height);
diff --git a/gdk/gdkprivate.h b/gdk/gdkprivate.h
index 8e70c98e0a..6549b85ad0 100644
--- a/gdk/gdkprivate.h
+++ b/gdk/gdkprivate.h
@@ -31,27 +31,12 @@
G_BEGIN_DECLS
-#ifndef GDK_COMPILATION
-#define GDK_WINDOW_TYPE(d) (gdk_window_get_window_type (GDK_WINDOW (d)))
-#define GDK_WINDOW_DESTROYED(d) (gdk_window_is_destroyed (GDK_WINDOW (d)))
-#endif
-
void gdk_window_destroy_notify (GdkWindow *window);
void gdk_synthesize_window_state (GdkWindow *window,
GdkWindowState unset_flags,
GdkWindowState set_flags);
-/* Tests whether a pair of x,y may cause overflows when converted to Pango
- * units (multiplied by PANGO_SCALE). We don't allow the entire range, leave
- * some space for additions afterwards, to be safe...
- */
-#define GDK_PANGO_UNITS_OVERFLOWS(x,y) (G_UNLIKELY ( \
- (y) >= PANGO_PIXELS (G_MAXINT-PANGO_SCALE)/2 || \
- (x) >= PANGO_PIXELS (G_MAXINT-PANGO_SCALE)/2 || \
- (y) <=-PANGO_PIXELS (G_MAXINT-PANGO_SCALE)/2 || \
- (x) <=-PANGO_PIXELS (G_MAXINT-PANGO_SCALE)/2))
-
G_END_DECLS
#endif /* __GDK_PRIVATE_H__ */
diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h
index 417aec211d..865a7f5226 100644
--- a/gdk/gdktypes.h
+++ b/gdk/gdktypes.h
@@ -139,14 +139,12 @@ typedef struct _GdkRGBA GdkRGBA;
typedef struct _GdkCursor GdkCursor;
typedef struct _GdkVisual GdkVisual;
-typedef struct _GdkDrawable GdkDrawable;
-
/**
* GdkWindow:
*
* An opaque structure representing an onscreen drawable.
*/
-typedef struct _GdkDrawable GdkWindow;
+typedef struct _GdkWindow GdkWindow;
typedef struct _GdkDisplay GdkDisplay;
typedef struct _GdkScreen GdkScreen;
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index dca9df1fd3..4307f34ae9 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -40,7 +40,6 @@
#include "gdkintl.h"
#include "gdkscreen.h"
#include "gdkdeviceprivate.h"
-#include "gdkdrawable.h"
#include "gdkmarshalers.h"
#include "gdkscreen.h"
#include "gdkwindowimpl.h"
@@ -219,21 +218,12 @@ typedef struct {
/* Global info */
-static cairo_surface_t *gdk_window_ref_cairo_surface (GdkDrawable *drawable);
-static cairo_surface_t *gdk_window_create_cairo_surface (GdkDrawable *drawable,
- int width,
- int height);
-static void gdk_window_drop_cairo_surface (GdkWindowObject *private);
-static void gdk_window_set_cairo_clip (GdkDrawable *drawable,
- cairo_t *cr);
-
-static cairo_region_t* gdk_window_get_clip_region (GdkDrawable *drawable);
-static cairo_region_t* gdk_window_get_visible_region (GdkDrawable *drawable);
+static void gdk_window_drop_cairo_surface (GdkWindow *private);
static void gdk_window_free_paint_stack (GdkWindow *window);
-static void gdk_window_init (GdkWindowObject *window);
-static void gdk_window_class_init (GdkWindowObjectClass *klass);
+static void gdk_window_init (GdkWindow *window);
+static void gdk_window_class_init (GdkWindowClass *klass);
static void gdk_window_finalize (GObject *object);
static void gdk_window_set_property (GObject *object,
@@ -248,19 +238,19 @@ static void gdk_window_get_property (GObject *object,
static void gdk_window_clear_backing_region (GdkWindow *window,
cairo_region_t *region);
-static void recompute_visible_regions (GdkWindowObject *private,
+static void recompute_visible_regions (GdkWindow *private,
gboolean recalculate_siblings,
gboolean recalculate_children);
static void gdk_window_flush_outstanding_moves (GdkWindow *window);
-static void gdk_window_flush_recursive (GdkWindowObject *window);
-static void do_move_region_bits_on_impl (GdkWindowObject *private,
+static void gdk_window_flush_recursive (GdkWindow *window);
+static void do_move_region_bits_on_impl (GdkWindow *window,
cairo_region_t *region, /* In impl window coords */
int dx, int dy);
-static void gdk_window_invalidate_in_parent (GdkWindowObject *private);
-static void move_native_children (GdkWindowObject *private);
+static void gdk_window_invalidate_in_parent (GdkWindow *private);
+static void move_native_children (GdkWindow *private);
static void update_cursor (GdkDisplay *display,
GdkDevice *device);
-static void impl_window_add_update_area (GdkWindowObject *impl_window,
+static void impl_window_add_update_area (GdkWindow *impl_window,
cairo_region_t *region);
static void gdk_window_region_move_free (GdkWindowRegionMove *move);
static void gdk_window_invalidate_region_full (GdkWindow *window,
@@ -287,16 +277,16 @@ new_region_tag (void)
}
GType
-gdk_window_object_get_type (void)
+gdk_window_get_type (void)
{
static GType object_type = 0;
if (!object_type)
- object_type = g_type_register_static_simple (GDK_TYPE_DRAWABLE,
+ object_type = g_type_register_static_simple (G_TYPE_OBJECT,
"GdkWindow",
- sizeof (GdkWindowObjectClass),
+ sizeof (GdkWindowClass),
(GClassInitFunc) gdk_window_class_init,
- sizeof (GdkWindowObject),
+ sizeof (GdkWindow),
(GInstanceInitFunc) gdk_window_init,
0);
@@ -328,7 +318,7 @@ _gdk_paintable_get_type (void)
}
static void
-gdk_window_init (GdkWindowObject *window)
+gdk_window_init (GdkWindow *window)
{
/* 0-initialization is good for all other fields. */
@@ -372,10 +362,9 @@ create_surface_accumulator (GSignalInvocationHint *ihint,
static GQuark quark_pointer_window = 0;
static void
-gdk_window_class_init (GdkWindowObjectClass *klass)
+gdk_window_class_init (GdkWindowClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- GdkDrawableClass *drawable_class = GDK_DRAWABLE_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
@@ -383,12 +372,6 @@ gdk_window_class_init (GdkWindowObjectClass *klass)
object_class->set_property = gdk_window_set_property;
object_class->get_property = gdk_window_get_property;
- drawable_class->ref_cairo_surface = gdk_window_ref_cairo_surface;
- drawable_class->create_cairo_surface = gdk_window_create_cairo_surface;
- drawable_class->set_cairo_clip = gdk_window_set_cairo_clip;
- drawable_class->get_clip_region = gdk_window_get_clip_region;
- drawable_class->get_visible_region = gdk_window_get_visible_region;
-
klass->create_surface = _gdk_offscreen_window_create_surface;
quark_pointer_window = g_quark_from_static_string ("gtk-pointer-window");
@@ -429,7 +412,7 @@ gdk_window_class_init (GdkWindowObjectClass *klass)
g_signal_new (g_intern_static_string ("pick-embedded-child"),
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GdkWindowObjectClass, pick_embedded_child),
+ G_STRUCT_OFFSET (GdkWindowClass, pick_embedded_child),
accumulate_get_window, NULL,
_gdk_marshal_OBJECT__DOUBLE_DOUBLE,
GDK_TYPE_WINDOW,
@@ -456,7 +439,7 @@ gdk_window_class_init (GdkWindowObjectClass *klass)
g_signal_new (g_intern_static_string ("to-embedder"),
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GdkWindowObjectClass, to_embedder),
+ G_STRUCT_OFFSET (GdkWindowClass, to_embedder),
NULL, NULL,
_gdk_marshal_VOID__DOUBLE_DOUBLE_POINTER_POINTER,
G_TYPE_NONE,
@@ -485,7 +468,7 @@ gdk_window_class_init (GdkWindowObjectClass *klass)
g_signal_new (g_intern_static_string ("from-embedder"),
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GdkWindowObjectClass, from_embedder),
+ G_STRUCT_OFFSET (GdkWindowClass, from_embedder),
NULL, NULL,
_gdk_marshal_VOID__DOUBLE_DOUBLE_POINTER_POINTER,
G_TYPE_NONE,
@@ -520,7 +503,7 @@ gdk_window_class_init (GdkWindowObjectClass *klass)
g_signal_new (g_intern_static_string ("create-surface"),
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GdkWindowObjectClass, create_surface),
+ G_STRUCT_OFFSET (GdkWindowClass, create_surface),
create_surface_accumulator, NULL,
_gdk_marshal_BOXED__INT_INT,
CAIRO_GOBJECT_TYPE_SURFACE,
@@ -534,22 +517,17 @@ device_removed_cb (GdkDeviceManager *device_manager,
GdkDevice *device,
GdkWindow *window)
{
- GdkWindowObject *private;
-
- private = (GdkWindowObject *) window;
-
- private->devices_inside = g_list_remove (private->devices_inside, device);
- g_hash_table_remove (private->device_cursor, device);
+ window->devices_inside = g_list_remove (window->devices_inside, device);
+ g_hash_table_remove (window->device_cursor, device);
- if (private->device_events)
- g_hash_table_remove (private->device_events, device);
+ if (window->device_events)
+ g_hash_table_remove (window->device_events, device);
}
static void
gdk_window_finalize (GObject *object)
{
GdkWindow *window = GDK_WINDOW (object);
- GdkWindowObject *obj = (GdkWindowObject *) object;
GdkDeviceManager *device_manager;
device_manager = gdk_display_get_device_manager (gdk_window_get_display (window));
@@ -569,37 +547,37 @@ gdk_window_finalize (GObject *object)
_gdk_window_destroy (window, TRUE);
}
- gdk_window_drop_cairo_surface (obj);
+ gdk_window_drop_cairo_surface (window);
- if (obj->impl)
+ if (window->impl)
{
- g_object_unref (obj->impl);
- obj->impl = NULL;
+ g_object_unref (window->impl);
+ window->impl = NULL;
}
- if (obj->impl_window != obj)
+ if (window->impl_window != window)
{
- g_object_unref (obj->impl_window);
- obj->impl_window = NULL;
+ g_object_unref (window->impl_window);
+ window->impl_window = NULL;
}
- if (obj->shape)
- cairo_region_destroy (obj->shape);
+ if (window->shape)
+ cairo_region_destroy (window->shape);
- if (obj->input_shape)
- cairo_region_destroy (obj->input_shape);
+ if (window->input_shape)
+ cairo_region_destroy (window->input_shape);
- if (obj->cursor)
- gdk_cursor_unref (obj->cursor);
+ if (window->cursor)
+ gdk_cursor_unref (window->cursor);
- if (obj->device_cursor)
- g_hash_table_destroy (obj->device_cursor);
+ if (window->device_cursor)
+ g_hash_table_destroy (window->device_cursor);
- if (obj->device_events)
- g_hash_table_destroy (obj->device_events);
+ if (window->device_events)
+ g_hash_table_destroy (window->device_events);
- if (obj->devices_inside)
- g_list_free (obj->devices_inside);
+ if (window->devices_inside)
+ g_list_free (window->devices_inside);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -645,13 +623,13 @@ gdk_window_get_property (GObject *object,
}
static gboolean
-gdk_window_is_offscreen (GdkWindowObject *window)
+gdk_window_is_offscreen (GdkWindow *window)
{
return window->window_type == GDK_WINDOW_OFFSCREEN;
}
-static GdkWindowObject *
-gdk_window_get_impl_window (GdkWindowObject *window)
+static GdkWindow *
+gdk_window_get_impl_window (GdkWindow *window)
{
return window->impl_window;
}
@@ -659,17 +637,17 @@ gdk_window_get_impl_window (GdkWindowObject *window)
GdkWindow *
_gdk_window_get_impl_window (GdkWindow *window)
{
- return (GdkWindow *)gdk_window_get_impl_window ((GdkWindowObject *)window);
+ return gdk_window_get_impl_window (window);
}
static gboolean
-gdk_window_has_impl (GdkWindowObject *window)
+gdk_window_has_impl (GdkWindow *window)
{
return window->impl_window == window;
}
static gboolean
-gdk_window_is_toplevel (GdkWindowObject *window)
+gdk_window_is_toplevel (GdkWindow *window)
{
return
window->parent == NULL ||
@@ -679,22 +657,22 @@ gdk_window_is_toplevel (GdkWindowObject *window)
gboolean
_gdk_window_has_impl (GdkWindow *window)
{
- return gdk_window_has_impl ((GdkWindowObject *)window);
+ return gdk_window_has_impl (window);
}
static gboolean
-gdk_window_has_no_impl (GdkWindowObject *window)
+gdk_window_has_no_impl (GdkWindow *window)
{
return window->impl_window != window;
}
static void
-remove_child_area (GdkWindowObject *private,
- GdkWindowObject *until,
+remove_child_area (GdkWindow *private,
+ GdkWindow *until,
gboolean for_input,
cairo_region_t *region)
{
- GdkWindowObject *child;
+ GdkWindow *child;
cairo_region_t *child_region;
GdkRectangle r;
GList *l;
@@ -740,7 +718,7 @@ remove_child_area (GdkWindowObject *private,
}
else if (private->window_type == GDK_WINDOW_FOREIGN)
{
- shape = _gdk_windowing_window_get_shape ((GdkWindow *)child);
+ shape = GDK_WINDOW_IMPL_GET_CLASS (child)->get_shape (child);
if (shape)
{
cairo_region_intersect (child_region, shape);
@@ -754,7 +732,7 @@ remove_child_area (GdkWindowObject *private,
cairo_region_intersect (child_region, child->input_shape);
else if (private->window_type == GDK_WINDOW_FOREIGN)
{
- shape = _gdk_windowing_window_get_input_shape ((GdkWindow *)child);
+ shape = GDK_WINDOW_IMPL_GET_CLASS (child)->get_input_shape (child);
if (shape)
{
cairo_region_intersect (child_region, shape);
@@ -770,40 +748,40 @@ remove_child_area (GdkWindowObject *private,
}
static GdkVisibilityState
-effective_visibility (GdkWindowObject *private)
+effective_visibility (GdkWindow *window)
{
GdkVisibilityState native;
- if (!gdk_window_is_viewable ((GdkWindow *)private))
+ if (!gdk_window_is_viewable (window))
return GDK_VISIBILITY_NOT_VIEWABLE;
- native = private->impl_window->native_visibility;
+ native = window->impl_window->native_visibility;
if (native == GDK_VISIBILITY_FULLY_OBSCURED ||
- private->visibility == GDK_VISIBILITY_FULLY_OBSCURED)
+ window->visibility == GDK_VISIBILITY_FULLY_OBSCURED)
return GDK_VISIBILITY_FULLY_OBSCURED;
else if (native == GDK_VISIBILITY_UNOBSCURED)
- return private->visibility;
+ return window->visibility;
else /* native PARTIAL, private partial or unobscured */
return GDK_VISIBILITY_PARTIAL;
}
static void
-gdk_window_update_visibility (GdkWindowObject *private)
+gdk_window_update_visibility (GdkWindow *window)
{
GdkVisibilityState new_visibility;
GdkEvent *event;
- new_visibility = effective_visibility (private);
+ new_visibility = effective_visibility (window);
- if (new_visibility != private->effective_visibility)
+ if (new_visibility != window->effective_visibility)
{
- private->effective_visibility = new_visibility;
+ window->effective_visibility = new_visibility;
if (new_visibility != GDK_VISIBILITY_NOT_VIEWABLE &&
- private->event_mask & GDK_VISIBILITY_NOTIFY)
+ window->event_mask & GDK_VISIBILITY_NOTIFY)
{
- event = _gdk_make_event ((GdkWindow *)private, GDK_VISIBILITY_NOTIFY,
+ event = _gdk_make_event (window, GDK_VISIBILITY_NOTIFY,
NULL, FALSE);
event->visibility.state = new_visibility;
}
@@ -811,14 +789,14 @@ gdk_window_update_visibility (GdkWindowObject *private)
}
static void
-gdk_window_update_visibility_recursively (GdkWindowObject *private,
- GdkWindowObject *only_for_impl)
+gdk_window_update_visibility_recursively (GdkWindow *window,
+ GdkWindow *only_for_impl)
{
- GdkWindowObject *child;
+ GdkWindow *child;
GList *l;
- gdk_window_update_visibility (private);
- for (l = private->children; l != NULL; l = l->next)
+ gdk_window_update_visibility (window);
+ for (l = window->children; l != NULL; l = l->next)
{
child = l->data;
if ((only_for_impl == NULL) ||
@@ -828,39 +806,39 @@ gdk_window_update_visibility_recursively (GdkWindowObject *private,
}
static gboolean
-should_apply_clip_as_shape (GdkWindowObject *private)
+should_apply_clip_as_shape (GdkWindow *window)
{
return
- gdk_window_has_impl (private) &&
+ gdk_window_has_impl (window) &&
/* Not for offscreens */
- !gdk_window_is_offscreen (private) &&
+ !gdk_window_is_offscreen (window) &&
/* or for toplevels */
- !gdk_window_is_toplevel (private) &&
+ !gdk_window_is_toplevel (window) &&
/* or for foreign windows */
- private->window_type != GDK_WINDOW_FOREIGN &&
+ window->window_type != GDK_WINDOW_FOREIGN &&
/* or for the root window */
- private->window_type != GDK_WINDOW_ROOT;
+ window->window_type != GDK_WINDOW_ROOT;
}
static void
-apply_shape (GdkWindowObject *private,
+apply_shape (GdkWindow *window,
cairo_region_t *region)
{
- GdkWindowImplIface *impl_iface;
+ GdkWindowImplClass *impl_class;
/* We trash whether we applied a shape so that
we can avoid unsetting it many times, which
could happen in e.g. apply_clip_as_shape as
windows get resized */
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
if (region)
- impl_iface->shape_combine_region ((GdkWindow *)private,
+ impl_class->shape_combine_region (window,
region, 0, 0);
- else if (private->applied_shape)
- impl_iface->shape_combine_region ((GdkWindow *)private,
+ else if (window->applied_shape)
+ impl_class->shape_combine_region (window,
NULL, 0, 0);
- private->applied_shape = region != NULL;
+ window->applied_shape = region != NULL;
}
static gboolean
@@ -881,33 +859,33 @@ region_rect_equal (const cairo_region_t *region,
}
static void
-apply_clip_as_shape (GdkWindowObject *private)
+apply_clip_as_shape (GdkWindow *window)
{
GdkRectangle r;
r.x = r.y = 0;
- r.width = private->width;
- r.height = private->height;
+ r.width = window->width;
+ r.height = window->height;
/* We only apply the clip region if would differ
from the actual clip region implied by the size
of the window. This is to avoid unneccessarily
adding meaningless shapes to all native subwindows */
- if (!region_rect_equal (private->clip_region, &r))
- apply_shape (private, private->clip_region);
+ if (!region_rect_equal (window->clip_region, &r))
+ apply_shape (window, window->clip_region);
else
- apply_shape (private, NULL);
+ apply_shape (window, NULL);
}
static void
-recompute_visible_regions_internal (GdkWindowObject *private,
- gboolean recalculate_clip,
- gboolean recalculate_siblings,
- gboolean recalculate_children)
+recompute_visible_regions_internal (GdkWindow *private,
+ gboolean recalculate_clip,
+ gboolean recalculate_siblings,
+ gboolean recalculate_children)
{
GdkRectangle r;
GList *l;
- GdkWindowObject *child;
+ GdkWindow *child;
cairo_region_t *new_clip, *old_clip_region_with_children;
gboolean clip_region_changed;
gboolean abs_pos_changed;
@@ -1071,9 +1049,9 @@ recompute_visible_regions_internal (GdkWindowObject *private,
if (private->cairo_surface && gdk_window_has_impl (private))
{
- GdkWindowImplIface *iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
+ GdkWindowImplClass *iface = GDK_WINDOW_IMPL_GET_CLASS (private->impl);
- private->cairo_surface = iface->resize_cairo_surface (private->impl,
+ private->cairo_surface = iface->resize_cairo_surface (private,
private->cairo_surface,
private->width,
private->height);
@@ -1098,7 +1076,7 @@ recompute_visible_regions_internal (GdkWindowObject *private,
* recompute_visible_regions), pass in TRUE for recalculate_children on the parent
*/
static void
-recompute_visible_regions (GdkWindowObject *private,
+recompute_visible_regions (GdkWindow *private,
gboolean recalculate_siblings,
gboolean recalculate_children)
{
@@ -1111,7 +1089,7 @@ recompute_visible_regions (GdkWindowObject *private,
void
_gdk_window_update_size (GdkWindow *window)
{
- recompute_visible_regions ((GdkWindowObject *)window, TRUE, FALSE);
+ recompute_visible_regions (window, TRUE, FALSE);
}
/* Find the native window that would be just above "child"
@@ -1120,11 +1098,11 @@ _gdk_window_update_size (GdkWindow *window)
* window inside this native parent then NULL is returned.
* If child is NULL, find lowest native window in parent.
*/
-static GdkWindowObject *
-find_native_sibling_above_helper (GdkWindowObject *parent,
- GdkWindowObject *child)
+static GdkWindow *
+find_native_sibling_above_helper (GdkWindow *parent,
+ GdkWindow *child)
{
- GdkWindowObject *w;
+ GdkWindow *w;
GList *l;
if (child)
@@ -1153,11 +1131,11 @@ find_native_sibling_above_helper (GdkWindowObject *parent,
}
-static GdkWindowObject *
-find_native_sibling_above (GdkWindowObject *parent,
- GdkWindowObject *child)
+static GdkWindow *
+find_native_sibling_above (GdkWindow *parent,
+ GdkWindow *child)
{
- GdkWindowObject *w;
+ GdkWindow *w;
w = find_native_sibling_above_helper (parent, child);
if (w)
@@ -1170,8 +1148,8 @@ find_native_sibling_above (GdkWindowObject *parent,
}
static GdkEventMask
-get_native_device_event_mask (GdkWindowObject *private,
- GdkDevice *device)
+get_native_device_event_mask (GdkWindow *private,
+ GdkDevice *device)
{
GdkEventMask event_mask;
@@ -1246,7 +1224,7 @@ get_native_grab_event_mask (GdkEventMask grab_mask)
}
static GdkEventMask
-get_native_event_mask (GdkWindowObject *private)
+get_native_event_mask (GdkWindow *private)
{
return get_native_device_event_mask (private, NULL);
}
@@ -1259,20 +1237,17 @@ get_native_event_mask (GdkWindowObject *private)
static void
sync_native_window_stack_position (GdkWindow *window)
{
- GdkWindowObject *above;
- GdkWindowObject *private;
- GdkWindowImplIface *impl_iface;
+ GdkWindow *above;
+ GdkWindowImplClass *impl_class;
GList listhead = {0};
- private = (GdkWindowObject *) window;
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
- above = find_native_sibling_above (private->parent, private);
+ above = find_native_sibling_above (window->parent, window);
if (above)
{
listhead.data = window;
- impl_iface->restack_under ((GdkWindow *)above,
- &listhead);
+ impl_class->restack_under (above, &listhead);
}
}
@@ -1296,7 +1271,6 @@ gdk_window_new (GdkWindow *parent,
gint attributes_mask)
{
GdkWindow *window;
- GdkWindowObject *private;
GdkScreen *screen;
int x, y;
gboolean native;
@@ -1333,7 +1307,6 @@ gdk_window_new (GdkWindow *parent,
}
window = g_object_new (GDK_TYPE_WINDOW, NULL);
- private = (GdkWindowObject *) window;
/* Windows with a foreign parent are treated as if they are children
* of the root window, except for actual creation.
@@ -1342,10 +1315,10 @@ gdk_window_new (GdkWindow *parent,
if (GDK_WINDOW_TYPE (parent) == GDK_WINDOW_FOREIGN)
parent = gdk_screen_get_root_window (screen);
- private->parent = (GdkWindowObject *)parent;
+ window->parent = parent;
- private->accept_focus = TRUE;
- private->focus_on_map = TRUE;
+ window->accept_focus = TRUE;
+ window->focus_on_map = TRUE;
if (attributes_mask & GDK_WA_X)
x = attributes->x;
@@ -1357,17 +1330,17 @@ gdk_window_new (GdkWindow *parent,
else
y = 0;
- private->x = x;
- private->y = y;
- private->width = (attributes->width > 1) ? (attributes->width) : (1);
- private->height = (attributes->height > 1) ? (attributes->height) : (1);
+ window->x = x;
+ window->y = y;
+ window->width = (attributes->width > 1) ? (attributes->width) : (1);
+ window->height = (attributes->height > 1) ? (attributes->height) : (1);
#ifdef GDK_WINDOWING_X11
/* Work around a bug where Xorg refuses to map toplevel InputOnly windows
* from an untrusted client: http://bugs.freedesktop.org/show_bug.cgi?id=6988
*/
if (attributes->wclass == GDK_INPUT_ONLY &&
- private->parent->window_type == GDK_WINDOW_ROOT &&
+ window->parent->window_type == GDK_WINDOW_ROOT &&
!G_LIKELY (GDK_DISPLAY_X11 (GDK_WINDOW_DISPLAY (parent))->trusted_client))
{
g_warning ("Coercing GDK_INPUT_ONLY toplevel window to GDK_INPUT_OUTPUT to work around bug in Xorg server");
@@ -1382,15 +1355,15 @@ gdk_window_new (GdkWindow *parent,
* before
*/
if (GDK_WINDOW_TYPE (parent) == GDK_WINDOW_ROOT)
- private->window_type = GDK_WINDOW_TEMP;
+ window->window_type = GDK_WINDOW_TEMP;
else
- private->window_type = GDK_WINDOW_CHILD;
+ window->window_type = GDK_WINDOW_CHILD;
}
else
- private->window_type = attributes->window_type;
+ window->window_type = attributes->window_type;
/* Sanity checks */
- switch (private->window_type)
+ switch (window->window_type)
{
case GDK_WINDOW_TOPLEVEL:
case GDK_WINDOW_TEMP:
@@ -1402,57 +1375,57 @@ gdk_window_new (GdkWindow *parent,
break;
break;
default:
- g_warning (G_STRLOC "cannot make windows of type %d", private->window_type);
+ g_warning (G_STRLOC "cannot make windows of type %d", window->window_type);
return NULL;
}
if (attributes_mask & GDK_WA_VISUAL)
- private->visual = attributes->visual;
+ window->visual = attributes->visual;
else
- private->visual = gdk_screen_get_system_visual (screen);
+ window->visual = gdk_screen_get_system_visual (screen);
- private->event_mask = attributes->event_mask;
+ window->event_mask = attributes->event_mask;
if (attributes->wclass == GDK_INPUT_OUTPUT)
{
- private->input_only = FALSE;
- private->depth = private->visual->depth;
+ window->input_only = FALSE;
+ window->depth = window->visual->depth;
/* XXX: Cache this somehow? */
- private->background = cairo_pattern_create_rgb (0, 0, 0);
+ window->background = cairo_pattern_create_rgb (0, 0, 0);
}
else
{
- private->depth = 0;
- private->input_only = TRUE;
+ window->depth = 0;
+ window->input_only = TRUE;
}
- if (private->parent)
- private->parent->children = g_list_prepend (private->parent->children, window);
+ if (window->parent)
+ window->parent->children = g_list_prepend (window->parent->children, window);
- private->device_cursor = g_hash_table_new_full (NULL, NULL, NULL,
- (GDestroyNotify) gdk_cursor_unref);
+ window->device_cursor = g_hash_table_new_full (NULL, NULL, NULL,
+ (GDestroyNotify) gdk_cursor_unref);
native = _gdk_native_windows; /* Default */
- if (private->parent->window_type == GDK_WINDOW_ROOT)
+ if (window->parent->window_type == GDK_WINDOW_ROOT)
native = TRUE; /* Always use native windows for toplevels */
- else if (!private->input_only &&
+ else if (!window->input_only &&
(attributes_mask & GDK_WA_VISUAL &&
- attributes->visual != gdk_window_get_visual (GDK_WINDOW (private->parent))))
+ attributes->visual != gdk_window_get_visual (window->parent)))
native = TRUE; /* InputOutput window with different visual than parent, needs native window */
- if (gdk_window_is_offscreen (private))
+ if (gdk_window_is_offscreen (window))
{
_gdk_offscreen_window_new (window, attributes, attributes_mask);
- private->impl_window = private;
+ window->impl_window = window;
}
else if (native)
{
- event_mask = get_native_event_mask (private);
+ event_mask = get_native_event_mask (window);
/* Create the impl */
_gdk_window_impl_new (window, real_parent, screen, event_mask, attributes, attributes_mask);
- private->impl_window = private;
+ window->impl_window = window;
/* This will put the native window topmost in the native parent, which may
* be wrong wrt other native windows in the non-native hierarchy, so restack */
@@ -1461,11 +1434,11 @@ gdk_window_new (GdkWindow *parent,
}
else
{
- private->impl_window = g_object_ref (private->parent->impl_window);
- private->impl = g_object_ref (private->impl_window->impl);
+ window->impl_window = g_object_ref (window->parent->impl_window);
+ window->impl = g_object_ref (window->impl_window->impl);
}
- recompute_visible_regions (private, TRUE, FALSE);
+ recompute_visible_regions (window, TRUE, FALSE);
gdk_window_set_cursor (window, ((attributes_mask & GDK_WA_CURSOR) ?
(attributes->cursor) :
@@ -1497,14 +1470,14 @@ is_parent_of (GdkWindow *parent,
}
static void
-change_impl (GdkWindowObject *private,
- GdkWindowObject *impl_window,
- GdkDrawable *new)
+change_impl (GdkWindow *private,
+ GdkWindow *impl_window,
+ GdkWindowImpl *new)
{
GList *l;
- GdkWindowObject *child;
- GdkDrawable *old_impl;
- GdkWindowObject *old_impl_window;
+ GdkWindow *child;
+ GdkWindowImpl *old_impl;
+ GdkWindow *old_impl_window;
old_impl = private->impl;
old_impl_window = private->impl_window;
@@ -1527,14 +1500,14 @@ change_impl (GdkWindowObject *private,
}
static void
-reparent_to_impl (GdkWindowObject *private)
+reparent_to_impl (GdkWindow *private)
{
GList *l;
- GdkWindowObject *child;
+ GdkWindow *child;
gboolean show;
- GdkWindowImplIface *impl_iface;
+ GdkWindowImplClass *impl_class;
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (private->impl);
/* Enumerate in reverse order so we get the right order for the native
windows (first in childrens list is topmost, and reparent places on top) */
@@ -1546,7 +1519,7 @@ reparent_to_impl (GdkWindowObject *private)
reparent_to_impl (child);
else
{
- show = impl_iface->reparent ((GdkWindow *)child,
+ show = impl_class->reparent ((GdkWindow *)child,
(GdkWindow *)private,
child->x, child->y);
if (show)
@@ -1573,14 +1546,12 @@ gdk_window_reparent (GdkWindow *window,
gint x,
gint y)
{
- GdkWindowObject *private;
- GdkWindowObject *new_parent_private;
- GdkWindowObject *old_parent;
+ GdkWindow *old_parent;
GdkScreen *screen;
gboolean show, was_mapped, applied_clip_as_shape;
gboolean do_reparent_to_impl;
GdkEventMask old_native_event_mask;
- GdkWindowImplIface *impl_iface;
+ GdkWindowImplClass *impl_class;
g_return_if_fail (GDK_IS_WINDOW (window));
g_return_if_fail (new_parent == NULL || GDK_IS_WINDOW (new_parent));
@@ -1594,11 +1565,8 @@ gdk_window_reparent (GdkWindow *window,
if (!new_parent)
new_parent = gdk_screen_get_root_window (screen);
- private = (GdkWindowObject *) window;
- new_parent_private = (GdkWindowObject *)new_parent;
-
/* No input-output children of input-only windows */
- if (new_parent_private->input_only && !private->input_only)
+ if (new_parent->input_only && !window->input_only)
return;
/* Don't create loops in hierarchy */
@@ -1607,42 +1575,42 @@ gdk_window_reparent (GdkWindow *window,
/* This might be wrong in the new parent, e.g. for non-native surfaces.
To make sure we're ok, just wipe it. */
- gdk_window_drop_cairo_surface (private);
+ gdk_window_drop_cairo_surface (window);
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
- old_parent = private->parent;
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
+ old_parent = window->parent;
was_mapped = GDK_WINDOW_IS_MAPPED (window);
show = FALSE;
/* Reparenting to toplevel. Ensure we have a native window so this can work */
- if (new_parent_private->window_type == GDK_WINDOW_ROOT ||
- new_parent_private->window_type == GDK_WINDOW_FOREIGN)
+ if (new_parent->window_type == GDK_WINDOW_ROOT ||
+ new_parent->window_type == GDK_WINDOW_FOREIGN)
gdk_window_ensure_native (window);
- applied_clip_as_shape = should_apply_clip_as_shape (private);
+ applied_clip_as_shape = should_apply_clip_as_shape (window);
old_native_event_mask = 0;
do_reparent_to_impl = FALSE;
- if (gdk_window_has_impl (private))
+ if (gdk_window_has_impl (window))
{
- old_native_event_mask = get_native_event_mask (private);
+ old_native_event_mask = get_native_event_mask (window);
/* Native window */
- show = impl_iface->reparent (window, new_parent, x, y);
+ show = impl_class->reparent (window, new_parent, x, y);
}
else
{
/* This shouldn't happen, as we created a native in this case, check anyway to see if that ever fails */
- g_assert (new_parent_private->window_type != GDK_WINDOW_ROOT &&
- new_parent_private->window_type != GDK_WINDOW_FOREIGN);
+ g_assert (new_parent->window_type != GDK_WINDOW_ROOT &&
+ new_parent->window_type != GDK_WINDOW_FOREIGN);
show = was_mapped;
gdk_window_hide (window);
do_reparent_to_impl = TRUE;
- change_impl (private,
- new_parent_private->impl_window,
- new_parent_private->impl);
+ change_impl (window,
+ new_parent->impl_window,
+ new_parent->impl);
}
/* From here on, we treat parents of type GDK_WINDOW_FOREIGN like
@@ -1651,17 +1619,16 @@ gdk_window_reparent (GdkWindow *window,
if (GDK_WINDOW_TYPE (new_parent) == GDK_WINDOW_FOREIGN)
{
new_parent = gdk_screen_get_root_window (screen);
- new_parent_private = (GdkWindowObject *)new_parent;
}
if (old_parent)
old_parent->children = g_list_remove (old_parent->children, window);
- private->parent = new_parent_private;
- private->x = x;
- private->y = y;
+ window->parent = new_parent;
+ window->x = x;
+ window->y = y;
- new_parent_private->children = g_list_prepend (new_parent_private->children, window);
+ new_parent->children = g_list_prepend (new_parent->children, window);
/* Switch the window type as appropriate */
@@ -1669,8 +1636,8 @@ gdk_window_reparent (GdkWindow *window,
{
case GDK_WINDOW_ROOT:
case GDK_WINDOW_FOREIGN:
- if (private->toplevel_window_type != -1)
- GDK_WINDOW_TYPE (window) = private->toplevel_window_type;
+ if (window->toplevel_window_type != -1)
+ GDK_WINDOW_TYPE (window) = window->toplevel_window_type;
else if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD)
GDK_WINDOW_TYPE (window) = GDK_WINDOW_TOPLEVEL;
break;
@@ -1684,42 +1651,42 @@ gdk_window_reparent (GdkWindow *window,
/* Save the original window type so we can restore it if the
* window is reparented back to be a toplevel
*/
- private->toplevel_window_type = GDK_WINDOW_TYPE (window);
+ window->toplevel_window_type = GDK_WINDOW_TYPE (window);
GDK_WINDOW_TYPE (window) = GDK_WINDOW_CHILD;
}
}
/* We might have changed window type for a native windows, so we
need to change the event mask too. */
- if (gdk_window_has_impl (private))
+ if (gdk_window_has_impl (window))
{
- GdkEventMask native_event_mask = get_native_event_mask (private);
+ GdkEventMask native_event_mask = get_native_event_mask (window);
if (native_event_mask != old_native_event_mask)
- impl_iface->set_events (window, native_event_mask);
+ impl_class->set_events (window, native_event_mask);
}
_gdk_window_update_viewable (window);
- recompute_visible_regions (private, TRUE, FALSE);
+ recompute_visible_regions (window, TRUE, FALSE);
if (old_parent && GDK_WINDOW_TYPE (old_parent) != GDK_WINDOW_ROOT)
recompute_visible_regions (old_parent, FALSE, TRUE);
/* We used to apply the clip as the shape, but no more.
Reset this to the real shape */
- if (gdk_window_has_impl (private) &&
+ if (gdk_window_has_impl (window) &&
applied_clip_as_shape &&
- !should_apply_clip_as_shape (private))
- apply_shape (private, private->shape);
+ !should_apply_clip_as_shape (window))
+ apply_shape (window, window->shape);
if (do_reparent_to_impl)
- reparent_to_impl (private);
+ reparent_to_impl (window);
else
{
/* The reparent will have put the native window topmost in the native parent,
* which may be wrong wrt other native windows in the non-native hierarchy,
* so restack */
- if (!gdk_window_has_impl (new_parent_private))
+ if (!gdk_window_has_impl (new_parent))
sync_native_window_stack_position (window);
}
@@ -1730,9 +1697,9 @@ gdk_window_reparent (GdkWindow *window,
}
static gboolean
-temporary_disable_extension_events (GdkWindowObject *window)
+temporary_disable_extension_events (GdkWindow*window)
{
- GdkWindowObject *child;
+ GdkWindow*child;
GList *l;
gboolean res;
@@ -1759,9 +1726,9 @@ temporary_disable_extension_events (GdkWindowObject *window)
}
static void
-reenable_extension_events (GdkWindowObject *window)
+reenable_extension_events (GdkWindow *window)
{
- GdkWindowObject *child;
+ GdkWindow *child;
GList *l;
int mask;
@@ -1808,13 +1775,12 @@ reenable_extension_events (GdkWindowObject *window)
gboolean
gdk_window_ensure_native (GdkWindow *window)
{
- GdkWindowObject *private;
- GdkWindowObject *impl_window;
- GdkDrawable *new_impl, *old_impl;
+ GdkWindow *impl_window;
+ GdkWindowImpl *new_impl, *old_impl;
GdkScreen *screen;
- GdkWindowObject *above;
+ GdkWindow *above;
GList listhead;
- GdkWindowImplIface *impl_iface;
+ GdkWindowImplClass *impl_class;
gboolean disabled_extension_events;
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
@@ -1823,14 +1789,12 @@ gdk_window_ensure_native (GdkWindow *window)
GDK_WINDOW_DESTROYED (window))
return FALSE;
- private = (GdkWindowObject *) window;
-
- impl_window = gdk_window_get_impl_window (private);
+ impl_window = gdk_window_get_impl_window (window);
if (gdk_window_is_offscreen (impl_window))
return FALSE; /* native in offscreens not supported */
- if (impl_window == private)
+ if (impl_window == window)
/* Already has an impl, and its not offscreen . */
return TRUE;
@@ -1840,60 +1804,60 @@ gdk_window_ensure_native (GdkWindow *window)
descendants to handle the native input window moving */
disabled_extension_events = FALSE;
if (impl_window->input_window)
- disabled_extension_events = temporary_disable_extension_events (private);
+ disabled_extension_events = temporary_disable_extension_events (window);
- gdk_window_drop_cairo_surface (private);
+ gdk_window_drop_cairo_surface (window);
screen = gdk_window_get_screen (window);
- old_impl = private->impl;
- _gdk_window_impl_new (window, (GdkWindow *)private->parent,
+ old_impl = window->impl;
+ _gdk_window_impl_new (window, window->parent,
screen,
- get_native_event_mask (private),
+ get_native_event_mask (window),
NULL, 0);
- new_impl = private->impl;
+ new_impl = window->impl;
- private->impl = old_impl;
- change_impl (private, private, new_impl);
+ window->impl = old_impl;
+ change_impl (window, window, new_impl);
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
/* Native window creation will put the native window topmost in the
* native parent, which may be wrong wrt the position of the previous
* non-native window wrt to the other non-native children, so correct this.
*/
- above = find_native_sibling_above (private->parent, private);
+ above = find_native_sibling_above (window->parent, window);
if (above)
{
listhead.data = window;
listhead.prev = NULL;
listhead.next = NULL;
- impl_iface->restack_under ((GdkWindow *)above, &listhead);
+ impl_class->restack_under ((GdkWindow *)above, &listhead);
}
- recompute_visible_regions (private, FALSE, FALSE);
+ recompute_visible_regions (window, FALSE, FALSE);
/* The shape may not have been set, as the clip region doesn't actually
change, so do it here manually */
- if (should_apply_clip_as_shape (private))
- apply_clip_as_shape (private);
+ if (should_apply_clip_as_shape (window))
+ apply_clip_as_shape (window);
- reparent_to_impl (private);
+ reparent_to_impl (window);
- if (!private->input_only)
+ if (!window->input_only)
{
- impl_iface->set_background (window, private->background);
+ impl_class->set_background (window, window->background);
}
- impl_iface->input_shape_combine_region (window,
- private->input_shape,
+ impl_class->input_shape_combine_region (window,
+ window->input_shape,
0, 0);
if (gdk_window_is_viewable (window))
- impl_iface->show (window, FALSE);
+ impl_class->show (window, FALSE);
if (disabled_extension_events)
- reenable_extension_events (private);
+ reenable_extension_events (window);
return TRUE;
}
@@ -1901,17 +1865,15 @@ gdk_window_ensure_native (GdkWindow *window)
static void
window_remove_filters (GdkWindow *window)
{
- GdkWindowObject *obj = (GdkWindowObject*) window;
-
- if (obj->filters)
+ if (window->filters)
{
GList *tmp_list;
- for (tmp_list = obj->filters; tmp_list; tmp_list = tmp_list->next)
+ for (tmp_list = window->filters; tmp_list; tmp_list = tmp_list->next)
g_free (tmp_list->data);
- g_list_free (obj->filters);
- obj->filters = NULL;
+ g_list_free (window->filters);
+ window->filters = NULL;
}
}
@@ -1963,9 +1925,7 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
gboolean recursing_native,
gboolean foreign_destroy)
{
- GdkWindowObject *private;
- GdkWindowObject *temp_private;
- GdkWindowImplIface *impl_iface;
+ GdkWindowImplClass *impl_class;
GdkWindow *temp_window;
GdkScreen *screen;
GdkDisplay *display;
@@ -1974,8 +1934,6 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowObject*) window;
-
if (GDK_WINDOW_DESTROYED (window))
return;
@@ -1986,7 +1944,7 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
g_object_set_qdata (G_OBJECT (screen), quark_pointer_window, NULL);
- switch (private->window_type)
+ switch (window->window_type)
{
case GDK_WINDOW_ROOT:
if (!screen->closed)
@@ -2000,7 +1958,7 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
case GDK_WINDOW_TEMP:
case GDK_WINDOW_FOREIGN:
case GDK_WINDOW_OFFSCREEN:
- if (private->window_type == GDK_WINDOW_FOREIGN && !foreign_destroy)
+ if (window->window_type == GDK_WINDOW_FOREIGN && !foreign_destroy)
{
/* Logically, it probably makes more sense to send
* a "destroy yourself" message to the foreign window
@@ -2008,7 +1966,7 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
* reasons, we only send "destroy yourself" messages to
* foreign windows in our hierarchy.
*/
- if (private->parent)
+ if (window->parent)
_gdk_windowing_window_destroy_foreign (window);
/* Also for historical reasons, we remove any filters
@@ -2020,46 +1978,43 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
}
else
{
- if (private->parent)
+ if (window->parent)
{
- GdkWindowObject *parent_private = (GdkWindowObject *)private->parent;
-
- if (parent_private->children)
- parent_private->children = g_list_remove (parent_private->children, window);
+ if (window->parent->children)
+ window->parent->children = g_list_remove (window->parent->children, window);
if (!recursing &&
GDK_WINDOW_IS_MAPPED (window))
{
- recompute_visible_regions (private, TRUE, FALSE);
- gdk_window_invalidate_in_parent (private);
+ recompute_visible_regions (window, TRUE, FALSE);
+ gdk_window_invalidate_in_parent (window);
}
}
gdk_window_free_paint_stack (window);
- if (private->background)
+ if (window->background)
{
- cairo_pattern_destroy (private->background);
- private->background = NULL;
+ cairo_pattern_destroy (window->background);
+ window->background = NULL;
}
- if (private->window_type == GDK_WINDOW_FOREIGN)
- g_assert (private->children == NULL);
+ if (window->window_type == GDK_WINDOW_FOREIGN)
+ g_assert (window->children == NULL);
else
{
- children = tmp = private->children;
- private->children = NULL;
+ children = tmp = window->children;
+ window->children = NULL;
while (tmp)
{
temp_window = tmp->data;
tmp = tmp->next;
- temp_private = (GdkWindowObject*) temp_window;
- if (temp_private)
+ if (temp_window)
_gdk_window_destroy_hierarchy (temp_window,
TRUE,
- recursing_native || gdk_window_has_impl (private),
+ recursing_native || gdk_window_has_impl (window),
foreign_destroy);
}
@@ -2068,12 +2023,12 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
_gdk_window_clear_update_area (window);
- gdk_window_drop_cairo_surface (private);
+ gdk_window_drop_cairo_surface (window);
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
- if (gdk_window_has_impl (private))
- impl_iface->destroy (window, recursing_native,
+ if (gdk_window_has_impl (window))
+ impl_class->destroy (window, recursing_native,
foreign_destroy);
else
{
@@ -2081,31 +2036,31 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
gdk_window_hide (window);
}
- private->state |= GDK_WINDOW_STATE_WITHDRAWN;
- private->parent = NULL;
- private->destroyed = TRUE;
+ window->state |= GDK_WINDOW_STATE_WITHDRAWN;
+ window->parent = NULL;
+ window->destroyed = TRUE;
window_remove_filters (window);
window_remove_from_pointer_info (window, display);
- if (private->clip_region)
+ if (window->clip_region)
{
- cairo_region_destroy (private->clip_region);
- private->clip_region = NULL;
+ cairo_region_destroy (window->clip_region);
+ window->clip_region = NULL;
}
- if (private->clip_region_with_children)
+ if (window->clip_region_with_children)
{
- cairo_region_destroy (private->clip_region_with_children);
- private->clip_region_with_children = NULL;
+ cairo_region_destroy (window->clip_region_with_children);
+ window->clip_region_with_children = NULL;
}
- if (private->outstanding_moves)
+ if (window->outstanding_moves)
{
- g_list_foreach (private->outstanding_moves, (GFunc)gdk_window_region_move_free, NULL);
- g_list_free (private->outstanding_moves);
- private->outstanding_moves = NULL;
+ g_list_foreach (window->outstanding_moves, (GFunc)gdk_window_region_move_free, NULL);
+ g_list_free (window->outstanding_moves);
+ window->outstanding_moves = NULL;
}
}
break;
@@ -2169,7 +2124,7 @@ gdk_window_set_user_data (GdkWindow *window,
{
g_return_if_fail (GDK_IS_WINDOW (window));
- ((GdkWindowObject*)window)->user_data = user_data;
+ window->user_data = user_data;
}
/**
@@ -2187,7 +2142,7 @@ gdk_window_get_user_data (GdkWindow *window,
{
g_return_if_fail (GDK_IS_WINDOW (window));
- *data = ((GdkWindowObject*)window)->user_data;
+ *data = window->user_data;
}
/**
@@ -2219,13 +2174,9 @@ gdk_window_get_window_type (GdkWindow *window)
GdkVisual*
gdk_window_get_visual (GdkWindow *window)
{
- GdkWindowObject *private;
-
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
- private = (GdkWindowObject *) window;
-
- return private->visual;
+ return window->visual;
}
/**
@@ -2241,13 +2192,9 @@ gdk_window_get_visual (GdkWindow *window)
GdkScreen*
gdk_window_get_screen (GdkWindow *window)
{
- GdkWindowObject *private;
-
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
- private = (GdkWindowObject *) window;
-
- return gdk_visual_get_screen (private->visual);
+ return gdk_visual_get_screen (window->visual);
}
/**
@@ -2263,13 +2210,9 @@ gdk_window_get_screen (GdkWindow *window)
GdkDisplay *
gdk_window_get_display (GdkWindow *window)
{
- GdkWindowObject *private;
-
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
- private = (GdkWindowObject *) window;
-
- return gdk_screen_get_display (gdk_visual_get_screen (private->visual));
+ return gdk_screen_get_display (gdk_visual_get_screen (window->visual));
}
/**
* gdk_window_is_destroyed:
@@ -2288,11 +2231,11 @@ gdk_window_is_destroyed (GdkWindow *window)
}
static void
-to_embedder (GdkWindowObject *window,
- gdouble offscreen_x,
- gdouble offscreen_y,
- gdouble *embedder_x,
- gdouble *embedder_y)
+to_embedder (GdkWindow *window,
+ gdouble offscreen_x,
+ gdouble offscreen_y,
+ gdouble *embedder_x,
+ gdouble *embedder_y)
{
g_signal_emit (window, signals[TO_EMBEDDER], 0,
offscreen_x, offscreen_y,
@@ -2300,11 +2243,11 @@ to_embedder (GdkWindowObject *window,
}
static void
-from_embedder (GdkWindowObject *window,
- gdouble embedder_x,
- gdouble embedder_y,
- gdouble *offscreen_x,
- gdouble *offscreen_y)
+from_embedder (GdkWindow *window,
+ gdouble embedder_x,
+ gdouble embedder_y,
+ gdouble *offscreen_x,
+ gdouble *offscreen_y)
{
g_signal_emit (window, signals[FROM_EMBEDDER], 0,
embedder_x, embedder_y,
@@ -2325,20 +2268,16 @@ from_embedder (GdkWindowObject *window,
gboolean
gdk_window_has_native (GdkWindow *window)
{
- GdkWindowObject *w;
-
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
- w = GDK_WINDOW_OBJECT (window);
-
- return w->parent == NULL || w->parent->impl != w->impl;
+ return window->parent == NULL || window->parent->impl != window->impl;
}
/**
* gdk_window_get_position:
* @window: a #GdkWindow
- * @x: X coordinate of window
- * @y: Y coordinate of window
+ * @x: (out) (allow-none): X coordinate of window
+ * @y: (out) (allow-none): Y coordinate of window
*
* Obtains the position of the window as reported in the
* most-recently-processed #GdkEventConfigure. Contrast with
@@ -2354,16 +2293,12 @@ gdk_window_get_position (GdkWindow *window,
gint *x,
gint *y)
{
- GdkWindowObject *obj;
-
g_return_if_fail (GDK_IS_WINDOW (window));
- obj = (GdkWindowObject*) window;
-
if (x)
- *x = obj->x;
+ *x = window->x;
if (y)
- *y = obj->y;
+ *y = window->y;
}
/**
@@ -2389,7 +2324,7 @@ gdk_window_get_parent (GdkWindow *window)
{
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
- return (GdkWindow*) ((GdkWindowObject*) window)->parent;
+ return window->parent;
}
/**
@@ -2409,16 +2344,12 @@ gdk_window_get_parent (GdkWindow *window)
GdkWindow *
gdk_window_get_effective_parent (GdkWindow *window)
{
- GdkWindowObject *obj;
-
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
- obj = (GdkWindowObject *)window;
-
- if (gdk_window_is_offscreen (obj))
+ if (gdk_window_is_offscreen (window))
return gdk_offscreen_window_get_embedder (window);
else
- return (GdkWindow *) obj->parent;
+ return window->parent;
}
/**
@@ -2441,20 +2372,16 @@ gdk_window_get_effective_parent (GdkWindow *window)
GdkWindow *
gdk_window_get_toplevel (GdkWindow *window)
{
- GdkWindowObject *obj;
-
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
- obj = (GdkWindowObject *)window;
-
- while (obj->window_type == GDK_WINDOW_CHILD)
+ while (window->window_type == GDK_WINDOW_CHILD)
{
- if (gdk_window_is_toplevel (obj))
+ if (gdk_window_is_toplevel (window))
break;
- obj = obj->parent;
+ window = window->parent;
}
- return GDK_WINDOW (obj);
+ return window;
}
/**
@@ -2509,7 +2436,7 @@ gdk_window_get_children (GdkWindow *window)
if (GDK_WINDOW_DESTROYED (window))
return NULL;
- return g_list_copy (GDK_WINDOW_OBJECT (window)->children);
+ return g_list_copy (window->children);
}
/**
@@ -2530,7 +2457,7 @@ gdk_window_peek_children (GdkWindow *window)
if (GDK_WINDOW_DESTROYED (window))
return NULL;
- return GDK_WINDOW_OBJECT (window)->children;
+ return window->children;
}
/**
@@ -2553,14 +2480,12 @@ gdk_window_add_filter (GdkWindow *window,
GdkFilterFunc function,
gpointer data)
{
- GdkWindowObject *private;
GList *tmp_list;
GdkEventFilter *filter;
g_return_if_fail (window == NULL || GDK_IS_WINDOW (window));
- private = (GdkWindowObject*) window;
- if (private && GDK_WINDOW_DESTROYED (window))
+ if (window && GDK_WINDOW_DESTROYED (window))
return;
/* Filters are for the native events on the native window, so
@@ -2568,8 +2493,8 @@ gdk_window_add_filter (GdkWindow *window,
if (window)
gdk_window_ensure_native (window);
- if (private)
- tmp_list = private->filters;
+ if (window)
+ tmp_list = window->filters;
else
tmp_list = _gdk_default_filters;
@@ -2590,8 +2515,8 @@ gdk_window_add_filter (GdkWindow *window,
filter->ref_count = 1;
filter->flags = 0;
- if (private)
- private->filters = g_list_append (private->filters, filter);
+ if (window)
+ window->filters = g_list_append (window->filters, filter);
else
_gdk_default_filters = g_list_append (_gdk_default_filters, filter);
}
@@ -2610,16 +2535,13 @@ gdk_window_remove_filter (GdkWindow *window,
GdkFilterFunc function,
gpointer data)
{
- GdkWindowObject *private;
GList *tmp_list, *node;
GdkEventFilter *filter;
g_return_if_fail (window == NULL || GDK_IS_WINDOW (window));
- private = (GdkWindowObject*) window;
-
- if (private)
- tmp_list = private->filters;
+ if (window)
+ tmp_list = window->filters;
else
tmp_list = _gdk_default_filters;
@@ -2636,8 +2558,8 @@ gdk_window_remove_filter (GdkWindow *window,
if (filter->ref_count != 0)
return;
- if (private)
- private->filters = g_list_remove_link (private->filters, node);
+ if (window)
+ window->filters = g_list_remove_link (window->filters, node);
else
_gdk_default_filters = g_list_remove_link (_gdk_default_filters, node);
g_list_free_1 (node);
@@ -2675,10 +2597,10 @@ gdk_screen_get_toplevel_windows (GdkScreen *screen)
root_window = gdk_screen_get_root_window (screen);
- tmp_list = ((GdkWindowObject *)root_window)->children;
+ tmp_list = root_window->children;
while (tmp_list)
{
- GdkWindowObject *w = tmp_list->data;
+ GdkWindow *w = tmp_list->data;
if (w->window_type != GDK_WINDOW_FOREIGN)
new_list = g_list_prepend (new_list, w);
@@ -2719,14 +2641,12 @@ gdk_window_is_visible (GdkWindow *window)
gboolean
gdk_window_is_viewable (GdkWindow *window)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
-
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
- if (private->destroyed)
+ if (window->destroyed)
return FALSE;
- return private->viewable;
+ return window->viewable;
}
/**
@@ -2741,11 +2661,9 @@ gdk_window_is_viewable (GdkWindow *window)
GdkWindowState
gdk_window_get_state (GdkWindow *window)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
-
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
- return private->state;
+ return window->state;
}
static cairo_content_t
@@ -2756,7 +2674,7 @@ gdk_window_get_content (GdkWindow *window)
g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
- surface = _gdk_drawable_ref_cairo_surface (window);
+ surface = _gdk_window_ref_cairo_surface (window);
content = cairo_surface_get_content (surface);
cairo_surface_destroy (surface);
@@ -2777,30 +2695,26 @@ gdk_window_get_content (GdkWindow *window)
static gboolean
gdk_window_begin_implicit_paint (GdkWindow *window, GdkRectangle *rect)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
GdkWindowPaint *paint;
- g_assert (gdk_window_has_impl (private));
+ g_assert (gdk_window_has_impl (window));
if (_gdk_native_windows)
return FALSE; /* No need for implicit paints since we can't merge draws anyway */
- if (GDK_IS_PAINTABLE (private->impl))
+ if (GDK_IS_PAINTABLE (window->impl))
return FALSE; /* Implementation does double buffering */
- if (private->paint_stack != NULL ||
- private->implicit_paint != NULL)
+ if (window->paint_stack != NULL ||
+ window->implicit_paint != NULL)
return FALSE; /* Don't stack implicit paints */
- if (private->outstanding_surfaces != 0)
- return FALSE; /* May conflict with direct drawing to cairo surface */
-
/* Never do implicit paints for foreign windows, they don't need
* double buffer combination since they have no client side children,
* and creating surfaces for them is risky since they could disappear
* at any time
*/
- if (private->window_type == GDK_WINDOW_FOREIGN)
+ if (window->window_type == GDK_WINDOW_FOREIGN)
return FALSE;
paint = g_new (GdkWindowPaint, 1);
@@ -2813,41 +2727,60 @@ gdk_window_begin_implicit_paint (GdkWindow *window, GdkRectangle *rect)
MAX (rect->height, 1));
cairo_surface_set_device_offset (paint->surface, -rect->x, -rect->y);
- private->implicit_paint = paint;
+ window->implicit_paint = paint;
return TRUE;
}
+static cairo_surface_t *
+gdk_window_ref_impl_surface (GdkWindow *window)
+{
+ return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->ref_cairo_surface (window);
+}
+
+static cairo_t *
+gdk_cairo_create_for_impl (GdkWindow *window)
+{
+ cairo_surface_t *surface;
+ cairo_t *cr;
+
+ surface = gdk_window_ref_impl_surface (window);
+ cr = cairo_create (surface);
+
+ cairo_surface_destroy (surface);
+
+ return cr;
+}
+
/* Ensure that all content related to this (sub)window is pushed to the
native region. If there is an active paint then that area is not
pushed, in order to not show partially finished double buffers. */
static void
gdk_window_flush_implicit_paint (GdkWindow *window)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
- GdkWindowObject *impl_window;
+ GdkWindow *impl_window;
GdkWindowPaint *paint;
cairo_region_t *region;
GSList *list;
- impl_window = gdk_window_get_impl_window (private);
+ impl_window = gdk_window_get_impl_window (window);
if (impl_window->implicit_paint == NULL)
return;
paint = impl_window->implicit_paint;
paint->flushed = TRUE;
- region = cairo_region_copy (private->clip_region_with_children);
+ region = cairo_region_copy (window->clip_region_with_children);
/* Don't flush active double buffers, as that may show partially done
* rendering */
- for (list = private->paint_stack; list != NULL; list = list->next)
+ for (list = window->paint_stack; list != NULL; list = list->next)
{
GdkWindowPaint *tmp_paint = list->data;
cairo_region_subtract (region, tmp_paint->region);
}
- cairo_region_translate (region, -private->abs_x, -private->abs_y);
+ cairo_region_translate (region, -window->abs_x, -window->abs_y);
cairo_region_intersect (region, paint->region);
if (!GDK_WINDOW_DESTROYED (window) && !cairo_region_is_empty (region))
@@ -2858,7 +2791,7 @@ gdk_window_flush_implicit_paint (GdkWindow *window)
cairo_region_subtract (paint->region, region);
/* Some regions are valid, push these to window now */
- cr = gdk_cairo_create (private->impl);
+ cr = gdk_cairo_create_for_impl (window);
gdk_cairo_region (cr, region);
cairo_clip (cr);
cairo_set_source_surface (cr, paint->surface, 0, 0);
@@ -2874,23 +2807,22 @@ gdk_window_flush_implicit_paint (GdkWindow *window)
static void
gdk_window_end_implicit_paint (GdkWindow *window)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
GdkWindowPaint *paint;
- g_assert (gdk_window_has_impl (private));
+ g_assert (gdk_window_has_impl (window));
- g_assert (private->implicit_paint != NULL);
+ g_assert (window->implicit_paint != NULL);
- paint = private->implicit_paint;
+ paint = window->implicit_paint;
- private->implicit_paint = NULL;
+ window->implicit_paint = NULL;
if (!GDK_WINDOW_DESTROYED (window) && !cairo_region_is_empty (paint->region))
{
cairo_t *cr;
/* Some regions are valid, push these to window now */
- cr = gdk_cairo_create (private->impl);
+ cr = gdk_cairo_create_for_impl (window);
gdk_cairo_region (cr, paint->region);
cairo_clip (cr);
cairo_set_source_surface (cr, paint->surface, 0, 0);
@@ -2978,10 +2910,9 @@ gdk_window_begin_paint_region (GdkWindow *window,
const cairo_region_t *region)
{
#ifdef USE_BACKING_STORE
- GdkWindowObject *private = (GdkWindowObject *)window;
GdkRectangle clip_box;
GdkWindowPaint *paint, *implicit_paint;
- GdkWindowObject *impl_window;
+ GdkWindow *impl_window;
GSList *list;
g_return_if_fail (GDK_IS_WINDOW (window));
@@ -2989,27 +2920,27 @@ gdk_window_begin_paint_region (GdkWindow *window,
if (GDK_WINDOW_DESTROYED (window))
return;
- if (GDK_IS_PAINTABLE (private->impl))
+ if (GDK_IS_PAINTABLE (window->impl))
{
- GdkPaintableIface *iface = GDK_PAINTABLE_GET_IFACE (private->impl);
+ GdkPaintableIface *iface = GDK_PAINTABLE_GET_IFACE (window->impl);
if (iface->begin_paint_region)
- iface->begin_paint_region ((GdkPaintable*)private->impl, window, region);
+ iface->begin_paint_region ((GdkPaintable*)window->impl, window, region);
return;
}
- impl_window = gdk_window_get_impl_window (private);
+ impl_window = gdk_window_get_impl_window (window);
implicit_paint = impl_window->implicit_paint;
paint = g_new (GdkWindowPaint, 1);
paint->region = cairo_region_copy (region);
paint->region_tag = new_region_tag ();
- cairo_region_intersect (paint->region, private->clip_region_with_children);
+ cairo_region_intersect (paint->region, window->clip_region_with_children);
cairo_region_get_extents (paint->region, &clip_box);
- cairo_region_translate (paint->region, private->abs_x, private->abs_y);
+ cairo_region_translate (paint->region, window->abs_x, window->abs_y);
/* Mark the region as valid on the implicit paint */
@@ -3017,14 +2948,14 @@ gdk_window_begin_paint_region (GdkWindow *window,
cairo_region_union (implicit_paint->region, paint->region);
/* Convert back to normal coords */
- cairo_region_translate (paint->region, -private->abs_x, -private->abs_y);
+ cairo_region_translate (paint->region, -window->abs_x, -window->abs_y);
if (implicit_paint)
{
paint->uses_implicit = TRUE;
paint->surface = cairo_surface_create_for_rectangle (implicit_paint->surface,
- private->abs_x + clip_box.x,
- private->abs_y + clip_box.y,
+ window->abs_x + clip_box.x,
+ window->abs_y + clip_box.y,
MAX (clip_box.width, 1),
MAX (clip_box.height, 1));
}
@@ -3038,14 +2969,14 @@ gdk_window_begin_paint_region (GdkWindow *window,
}
cairo_surface_set_device_offset (paint->surface, -clip_box.x, -clip_box.y);
- for (list = private->paint_stack; list != NULL; list = list->next)
+ for (list = window->paint_stack; list != NULL; list = list->next)
{
GdkWindowPaint *tmp_paint = list->data;
cairo_region_subtract (tmp_paint->region, paint->region);
}
- private->paint_stack = g_slist_prepend (private->paint_stack, paint);
+ window->paint_stack = g_slist_prepend (window->paint_stack, paint);
if (!cairo_region_is_empty (paint->region))
{
@@ -3073,8 +3004,7 @@ void
gdk_window_end_paint (GdkWindow *window)
{
#ifdef USE_BACKING_STORE
- GdkWindowObject *private = (GdkWindowObject *)window;
- GdkWindowObject *composited;
+ GdkWindow *composited;
GdkWindowPaint *paint;
GdkRectangle clip_box;
cairo_region_t *full_clip;
@@ -3084,25 +3014,25 @@ gdk_window_end_paint (GdkWindow *window)
if (GDK_WINDOW_DESTROYED (window))
return;
- if (GDK_IS_PAINTABLE (private->impl))
+ if (GDK_IS_PAINTABLE (window->impl))
{
- GdkPaintableIface *iface = GDK_PAINTABLE_GET_IFACE (private->impl);
+ GdkPaintableIface *iface = GDK_PAINTABLE_GET_IFACE (window->impl);
if (iface->end_paint)
- iface->end_paint ((GdkPaintable*)private->impl);
+ iface->end_paint ((GdkPaintable*)window->impl);
return;
}
- if (private->paint_stack == NULL)
+ if (window->paint_stack == NULL)
{
g_warning (G_STRLOC": no preceding call to gdk_window_begin_paint_region(), see documentation");
return;
}
- paint = private->paint_stack->data;
+ paint = window->paint_stack->data;
- private->paint_stack = g_slist_delete_link (private->paint_stack,
- private->paint_stack);
+ window->paint_stack = g_slist_delete_link (window->paint_stack,
+ window->paint_stack);
cairo_region_get_extents (paint->region, &clip_box);
@@ -3112,7 +3042,7 @@ gdk_window_end_paint (GdkWindow *window)
gdk_window_flush_outstanding_moves (window);
- full_clip = cairo_region_copy (private->clip_region_with_children);
+ full_clip = cairo_region_copy (window->clip_region_with_children);
cairo_region_intersect (full_clip, paint->region);
cr = gdk_cairo_create (window);
@@ -3134,7 +3064,7 @@ gdk_window_end_paint (GdkWindow *window)
* stop if parent becomes NULL since then we'd have nowhere
* to draw (ie: 'composited' will always be non-NULL here).
*/
- for (composited = private;
+ for (composited = window;
composited->parent;
composited = composited->parent)
{
@@ -3156,17 +3086,15 @@ gdk_window_end_paint (GdkWindow *window)
static void
gdk_window_free_paint_stack (GdkWindow *window)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
-
- if (private->paint_stack)
+ if (window->paint_stack)
{
- GSList *tmp_list = private->paint_stack;
+ GSList *tmp_list = window->paint_stack;
while (tmp_list)
{
GdkWindowPaint *paint = tmp_list->data;
- if (tmp_list == private->paint_stack)
+ if (tmp_list == window->paint_stack)
cairo_surface_destroy (paint->surface);
cairo_region_destroy (paint->region);
@@ -3175,21 +3103,21 @@ gdk_window_free_paint_stack (GdkWindow *window)
tmp_list = tmp_list->next;
}
- g_slist_free (private->paint_stack);
- private->paint_stack = NULL;
+ g_slist_free (window->paint_stack);
+ window->paint_stack = NULL;
}
}
static void
-do_move_region_bits_on_impl (GdkWindowObject *impl_window,
+do_move_region_bits_on_impl (GdkWindow *impl_window,
cairo_region_t *dest_region, /* In impl window coords */
int dx, int dy)
{
- GdkWindowImplIface *impl_iface;
+ GdkWindowImplClass *impl_class;
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (impl_window->impl);
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (impl_window->impl);
- impl_iface->translate ((GdkWindow *) impl_window, dest_region, dx, dy);
+ impl_class->translate (impl_window, dest_region, dx, dy);
}
static GdkWindowRegionMove *
@@ -3214,7 +3142,7 @@ gdk_window_region_move_free (GdkWindowRegionMove *move)
}
static void
-append_move_region (GdkWindowObject *impl_window,
+append_move_region (GdkWindow *impl_window,
cairo_region_t *new_dest_region,
int dx, int dy)
{
@@ -3329,7 +3257,7 @@ append_move_region (GdkWindowObject *impl_window,
/* Moves bits and update area by dx/dy in impl window.
Takes ownership of region to avoid copy (because we may change it) */
static void
-move_region_on_impl (GdkWindowObject *impl_window,
+move_region_on_impl (GdkWindow *impl_window,
cairo_region_t *region, /* In impl window coords */
int dx, int dy)
{
@@ -3384,11 +3312,7 @@ move_region_on_impl (GdkWindowObject *impl_window,
cairo_region_destroy (exposing);
}
- if (impl_window->outstanding_surfaces == 0) /* Enable flicker free handling of moves. */
- append_move_region (impl_window, region, dx, dy);
- else
- do_move_region_bits_on_impl (impl_window,
- region, dx, dy);
+ append_move_region (impl_window, region, dx, dy);
cairo_region_destroy (region);
}
@@ -3399,14 +3323,11 @@ move_region_on_impl (GdkWindowObject *impl_window,
static void
gdk_window_flush_outstanding_moves (GdkWindow *window)
{
- GdkWindowObject *private;
- GdkWindowObject *impl_window;
+ GdkWindow *impl_window;
GList *l, *outstanding;
GdkWindowRegionMove *move;
- private = (GdkWindowObject *) window;
-
- impl_window = gdk_window_get_impl_window (private);
+ impl_window = gdk_window_get_impl_window (window);
outstanding = impl_window->outstanding_moves;
impl_window->outstanding_moves = NULL;
@@ -3463,11 +3384,9 @@ gdk_window_flush (GdkWindow *window)
static void
gdk_window_flush_if_exposing (GdkWindow *window)
{
- GdkWindowObject *private;
- GdkWindowObject *impl_window;
+ GdkWindow *impl_window;
- private = (GdkWindowObject *) window;
- impl_window = gdk_window_get_impl_window (private);
+ impl_window = gdk_window_get_impl_window (window);
/* If we're in an implicit paint (i.e. in an expose handler, flush
all the already finished exposes to get things to an uptodate state. */
@@ -3477,10 +3396,10 @@ gdk_window_flush_if_exposing (GdkWindow *window)
static void
-gdk_window_flush_recursive_helper (GdkWindowObject *window,
- GdkWindow *impl)
+gdk_window_flush_recursive_helper (GdkWindow *window,
+ GdkWindowImpl *impl)
{
- GdkWindowObject *child;
+ GdkWindow *child;
GList *l;
for (l = window->children; l != NULL; l = l->next)
@@ -3496,24 +3415,38 @@ gdk_window_flush_recursive_helper (GdkWindowObject *window,
}
static void
-gdk_window_flush_recursive (GdkWindowObject *window)
+gdk_window_flush_recursive (GdkWindow *window)
{
- gdk_window_flush ((GdkWindow *)window);
+ gdk_window_flush (window);
gdk_window_flush_recursive_helper (window, window->impl);
}
-static cairo_region_t*
-gdk_window_get_clip_region (GdkDrawable *drawable)
+/**
+ * gdk_window_get_clip_region:
+ * @window: a #GdkWindow
+ *
+ * Computes the region of a window that potentially can be written
+ * to by drawing primitives. This region may not take into account
+ * other factors such as if the window is obscured by other windows,
+ * but no area outside of this region will be affected by drawing
+ * primitives.
+ *
+ * Returns: a #cairo_region_t. This must be freed with cairo_region_destroy()
+ * when you are done.
+ **/
+cairo_region_t*
+gdk_window_get_clip_region (GdkWindow *window)
{
- GdkWindowObject *private = (GdkWindowObject *)drawable;
cairo_region_t *result;
- result = cairo_region_copy (private->clip_region);
+ g_return_val_if_fail (GDK_WINDOW (window), NULL);
+
+ result = cairo_region_copy (window->clip_region);
- if (private->paint_stack)
+ if (window->paint_stack)
{
cairo_region_t *paint_region = cairo_region_create ();
- GSList *tmp_list = private->paint_stack;
+ GSList *tmp_list = window->paint_stack;
while (tmp_list)
{
@@ -3531,33 +3464,44 @@ gdk_window_get_clip_region (GdkDrawable *drawable)
return result;
}
-static cairo_region_t*
-gdk_window_get_visible_region (GdkDrawable *drawable)
+/**
+ * gdk_window_get_visible_region:
+ * @window: a #GdkWindow
+ *
+ * Computes the region of the @window that is potentially visible.
+ * This does not necessarily take into account if the window is
+ * obscured by other windows, but no area outside of this region
+ * is visible.
+ *
+ * Returns: a #cairo_region_t. This must be freed with cairo_region_destroy()
+ * when you are done.
+ **/
+cairo_region_t *
+gdk_window_get_visible_region (GdkWindow *window)
{
- GdkWindowObject *private = (GdkWindowObject*) drawable;
+ g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
- return cairo_region_copy (private->clip_region);
+ return cairo_region_copy (window->clip_region);
}
static cairo_t *
setup_backing_rect (GdkWindow *window, GdkWindowPaint *paint, int x_offset_cairo, int y_offset_cairo)
{
- GdkWindowObject *private = (GdkWindowObject *) window;
- GdkWindowObject *bg_private;
+ GdkWindow *bg_window;
cairo_pattern_t *pattern = NULL;
int x_offset = 0, y_offset = 0;
cairo_t *cr;
cr = cairo_create (paint->surface);
- for (bg_private = private; bg_private; bg_private = bg_private->parent)
+ for (bg_window = window; bg_window; bg_window = bg_window->parent)
{
- pattern = gdk_window_get_background_pattern ((GdkWindow *) bg_private);
+ pattern = gdk_window_get_background_pattern (bg_window);
if (pattern)
break;
- x_offset += bg_private->x;
- y_offset += bg_private->y;
+ x_offset += bg_window->x;
+ y_offset += bg_window->y;
}
if (pattern)
@@ -3576,8 +3520,7 @@ static void
gdk_window_clear_backing_region (GdkWindow *window,
cairo_region_t *region)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
- GdkWindowPaint *paint = private->paint_stack->data;
+ GdkWindowPaint *paint = window->paint_stack->data;
cairo_region_t *clip;
GdkRectangle clipbox;
cairo_t *cr;
@@ -3603,7 +3546,6 @@ static void
gdk_window_clear_backing_region_direct (GdkWindow *window,
cairo_region_t *region)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
GdkWindowPaint paint;
cairo_region_t *clip;
GdkRectangle clipbox;
@@ -3612,11 +3554,11 @@ gdk_window_clear_backing_region_direct (GdkWindow *window,
if (GDK_WINDOW_DESTROYED (window))
return;
- paint.surface = _gdk_drawable_ref_cairo_surface (window);
+ paint.surface = _gdk_window_ref_cairo_surface (window);
cr = setup_backing_rect (window, &paint, 0, 0);
- clip = cairo_region_copy (private->clip_region_with_children);
+ clip = cairo_region_copy (window->clip_region_with_children);
cairo_region_intersect (clip, region);
cairo_region_get_extents (clip, &clipbox);
@@ -3634,50 +3576,46 @@ static void
gdk_window_clear_region_internal (GdkWindow *window,
cairo_region_t *region)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
-
- if (private->paint_stack)
+ if (window->paint_stack)
gdk_window_clear_backing_region (window, region);
else
gdk_window_clear_backing_region_direct (window, region);
}
static void
-gdk_window_drop_cairo_surface (GdkWindowObject *private)
+gdk_window_drop_cairo_surface (GdkWindow *window)
{
- if (private->cairo_surface)
+ if (window->cairo_surface)
{
- cairo_surface_finish (private->cairo_surface);
- cairo_surface_set_user_data (private->cairo_surface, &gdk_window_cairo_key,
+ cairo_surface_finish (window->cairo_surface);
+ cairo_surface_set_user_data (window->cairo_surface, &gdk_window_cairo_key,
NULL, NULL);
- private->cairo_surface = NULL;
+ window->cairo_surface = NULL;
}
}
static void
gdk_window_cairo_surface_destroy (void *data)
{
- GdkWindowObject *private = (GdkWindowObject*) data;
+ GdkWindow *window = data;
- private->cairo_surface = NULL;
- private->impl_window->outstanding_surfaces--;
+ window->cairo_surface = NULL;
}
static cairo_surface_t *
-gdk_window_create_cairo_surface (GdkDrawable *drawable,
+gdk_window_create_cairo_surface (GdkWindow *window,
int width,
int height)
{
- GdkWindowObject *private = GDK_WINDOW_OBJECT(drawable);
cairo_surface_t *surface, *subsurface;
- surface =_gdk_drawable_ref_cairo_surface (private->impl);
- if (gdk_window_has_impl (private))
+ surface = gdk_window_ref_impl_surface (window);
+ if (gdk_window_has_impl (window))
return surface;
subsurface = cairo_surface_create_for_rectangle (surface,
- private->abs_x,
- private->abs_y,
+ window->abs_x,
+ window->abs_y,
width,
height);
cairo_surface_destroy (surface);
@@ -3685,15 +3623,16 @@ gdk_window_create_cairo_surface (GdkDrawable *drawable,
}
-static cairo_surface_t *
-gdk_window_ref_cairo_surface (GdkDrawable *drawable)
+cairo_surface_t *
+_gdk_window_ref_cairo_surface (GdkWindow *window)
{
- GdkWindowObject *private = (GdkWindowObject*) drawable;
cairo_surface_t *surface;
- if (private->paint_stack)
+ g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
+
+ if (window->paint_stack)
{
- GdkWindowPaint *paint = private->paint_stack->data;
+ GdkWindowPaint *paint = window->paint_stack->data;
surface = paint->surface;
cairo_surface_reference (surface);
@@ -3702,69 +3641,77 @@ gdk_window_ref_cairo_surface (GdkDrawable *drawable)
{
/* This will be drawing directly to the window, so flush implicit paint */
- gdk_window_flush ((GdkWindow *)drawable);
+ gdk_window_flush (window);
- if (!private->cairo_surface)
+ if (!window->cairo_surface)
{
- private->cairo_surface = _gdk_drawable_create_cairo_surface (drawable,
- private->width,
- private->height);
+ window->cairo_surface = gdk_window_create_cairo_surface (window,
+ window->width,
+ window->height);
- if (private->cairo_surface)
+ if (window->cairo_surface)
{
- private->impl_window->outstanding_surfaces++;
-
- cairo_surface_set_user_data (private->cairo_surface, &gdk_window_cairo_key,
- drawable, gdk_window_cairo_surface_destroy);
+ cairo_surface_set_user_data (window->cairo_surface, &gdk_window_cairo_key,
+ window, gdk_window_cairo_surface_destroy);
}
}
else
- cairo_surface_reference (private->cairo_surface);
+ cairo_surface_reference (window->cairo_surface);
- surface = private->cairo_surface;
+ surface = window->cairo_surface;
}
return surface;
}
-static void
-gdk_window_set_cairo_clip (GdkDrawable *drawable,
- cairo_t *cr)
+/**
+ * gdk_cairo_create:
+ * @window: a #GdkWindow
+ *
+ * Creates a Cairo context for drawing to @window.
+ *
+ * <note><warning>
+ * Note that calling cairo_reset_clip() on the resulting #cairo_t will
+ * produce undefined results, so avoid it at all costs.
+ * </warning></note>
+ *
+ * Return value: A newly created Cairo context. Free with
+ * cairo_destroy() when you are done drawing.
+ *
+ * Since: 2.8
+ **/
+cairo_t *
+gdk_cairo_create (GdkWindow *window)
{
- GdkWindowObject *private = (GdkWindowObject*) drawable;
-
- if (!private->paint_stack)
- {
- cairo_reset_clip (cr);
-
- cairo_save (cr);
- cairo_identity_matrix (cr);
+ cairo_surface_t *surface;
+ cairo_t *cr;
+
+ g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
- cairo_new_path (cr);
- gdk_cairo_region (cr, private->clip_region_with_children);
+ surface = _gdk_window_ref_cairo_surface (window);
+ cr = cairo_create (surface);
- cairo_restore (cr);
+ if (!window->paint_stack)
+ {
+ gdk_cairo_region (cr, window->clip_region_with_children);
cairo_clip (cr);
}
else
{
- GdkWindowPaint *paint = private->paint_stack->data;
+ GdkWindowPaint *paint = window->paint_stack->data;
/* Only needs to clip to region if piggybacking
on an implicit paint */
- cairo_reset_clip (cr);
if (paint->uses_implicit)
{
- cairo_save (cr);
- cairo_identity_matrix (cr);
-
- cairo_new_path (cr);
gdk_cairo_region (cr, paint->region);
- cairo_restore (cr);
-
cairo_clip (cr);
}
}
+
+ cairo_surface_destroy (surface);
+
+ return cr;
}
/* Code for dirty-region queueing
@@ -3779,7 +3726,7 @@ gdk_window_is_ancestor (GdkWindow *window,
{
while (window)
{
- GdkWindow *parent = (GdkWindow*) ((GdkWindowObject*) window)->parent;
+ GdkWindow *parent = window->parent;
if (parent == ancestor)
return TRUE;
@@ -3799,7 +3746,7 @@ gdk_window_add_update_window (GdkWindow *window)
for (tmp = update_windows; tmp; tmp = tmp->next)
{
- GdkWindowObject *parent = GDK_WINDOW_OBJECT (window)->parent;
+ GdkWindow *parent = window->parent;
/* check if tmp is an ancestor of "window"; if it is, set a
* flag indicating that all following windows are either
@@ -3811,10 +3758,10 @@ gdk_window_add_update_window (GdkWindow *window)
/* insert in reverse stacking order when adding around siblings,
* so processing updates properly paints over lower stacked windows
*/
- if (parent == GDK_WINDOW_OBJECT (tmp->data)->parent)
+ if (parent == GDK_WINDOW (tmp->data)->parent)
{
gint index = g_list_index (parent->children, window);
- for (; tmp && parent == GDK_WINDOW_OBJECT (tmp->data)->parent; tmp = tmp->next)
+ for (; tmp && parent == GDK_WINDOW (tmp->data)->parent; tmp = tmp->next)
{
gint sibling_index = g_list_index (parent->children, tmp->data);
if (index > sibling_index)
@@ -3880,9 +3827,9 @@ gdk_window_update_idle (gpointer data)
static gboolean
gdk_window_is_toplevel_frozen (GdkWindow *window)
{
- GdkWindowObject *toplevel;
+ GdkWindow *toplevel;
- toplevel = (GdkWindowObject *)gdk_window_get_toplevel (window);
+ toplevel = gdk_window_get_toplevel (window);
return toplevel->update_and_descendants_freeze_count > 0;
}
@@ -3891,7 +3838,7 @@ static void
gdk_window_schedule_update (GdkWindow *window)
{
if (window &&
- (GDK_WINDOW_OBJECT (window)->update_freeze_count ||
+ (window->update_freeze_count ||
gdk_window_is_toplevel_frozen (window)))
return;
@@ -3906,8 +3853,7 @@ void
_gdk_window_process_updates_recurse (GdkWindow *window,
cairo_region_t *expose_region)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
- GdkWindowObject *child;
+ GdkWindow *child;
cairo_region_t *child_region;
GdkRectangle r;
GList *l, *children;
@@ -3915,12 +3861,12 @@ _gdk_window_process_updates_recurse (GdkWindow *window,
if (cairo_region_is_empty (expose_region))
return;
- if (gdk_window_is_offscreen (private->impl_window) &&
- private == private->impl_window)
- _gdk_window_add_damage ((GdkWindow *) private->impl_window, expose_region);
+ if (gdk_window_is_offscreen (window->impl_window) &&
+ window == window->impl_window)
+ _gdk_window_add_damage ((GdkWindow *) window->impl_window, expose_region);
/* Make this reentrancy safe for expose handlers freeing windows */
- children = g_list_copy (private->children);
+ children = g_list_copy (window->children);
g_list_foreach (children, (GFunc)g_object_ref, NULL);
/* Iterate over children, starting at topmost */
@@ -3950,7 +3896,7 @@ _gdk_window_process_updates_recurse (GdkWindow *window,
cairo_region_translate (child->shape, -child->x, -child->y);
}
- if (child->impl == private->impl)
+ if (child->impl == window->impl)
{
/* Client side child, expose */
cairo_region_intersect (child_region, expose_region);
@@ -3970,9 +3916,9 @@ _gdk_window_process_updates_recurse (GdkWindow *window,
g_list_free (children);
if (!cairo_region_is_empty (expose_region) &&
- !private->destroyed)
+ !window->destroyed)
{
- if (private->event_mask & GDK_EXPOSURE_MASK)
+ if (window->event_mask & GDK_EXPOSURE_MASK)
{
GdkEvent event;
@@ -3983,11 +3929,11 @@ _gdk_window_process_updates_recurse (GdkWindow *window,
event.expose.region = expose_region;
cairo_region_get_extents (expose_region, &event.expose.area);
- (*_gdk_event_func) (&event, _gdk_event_data);
+ _gdk_event_emit (&event);
g_object_unref (window);
}
- else if (private->window_type != GDK_WINDOW_FOREIGN)
+ else if (window->window_type != GDK_WINDOW_FOREIGN)
{
/* No exposure mask set, so nothing will be drawn, the
* app relies on the background being what it specified
@@ -4017,8 +3963,7 @@ _gdk_window_process_updates_recurse (GdkWindow *window,
static void
gdk_window_process_updates_internal (GdkWindow *window)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
- GdkWindowImplIface *impl_iface;
+ GdkWindowImplClass *impl_class;
gboolean save_region = FALSE;
GdkRectangle clip_box;
@@ -4029,18 +3974,18 @@ gdk_window_process_updates_internal (GdkWindow *window)
* window in the update queue that has an empty update_area.
* just ignore it.
*/
- if (private->update_area)
+ if (window->update_area)
{
- cairo_region_t *update_area = private->update_area;
- private->update_area = NULL;
+ cairo_region_t *update_area = window->update_area;
+ window->update_area = NULL;
- if (_gdk_event_func && gdk_window_is_viewable (window))
+ if (gdk_window_is_viewable (window))
{
cairo_region_t *expose_region;
gboolean end_implicit;
/* Clip to part visible in toplevel */
- cairo_region_intersect (update_area, private->clip_region);
+ cairo_region_intersect (update_area, window->clip_region);
if (debug_updates)
{
@@ -4055,7 +4000,7 @@ gdk_window_process_updates_internal (GdkWindow *window)
* be overdrawn by the expose anyway. So, in order to copy less data
* we remove these areas from the outstanding moves.
*/
- if (private->outstanding_moves)
+ if (window->outstanding_moves)
{
GdkWindowRegionMove *move;
cairo_region_t *remove;
@@ -4064,7 +4009,7 @@ gdk_window_process_updates_internal (GdkWindow *window)
remove = cairo_region_copy (update_area);
/* We iterate backwards, starting from the state that would be
if we had applied all the moves. */
- for (l = g_list_last (private->outstanding_moves); l != NULL; l = prev)
+ for (l = g_list_last (window->outstanding_moves); l != NULL; l = prev)
{
prev = l->prev;
move = l->data;
@@ -4081,8 +4026,8 @@ gdk_window_process_updates_internal (GdkWindow *window)
if (cairo_region_is_empty (move->dest_region))
{
gdk_window_region_move_free (move);
- private->outstanding_moves =
- g_list_delete_link (private->outstanding_moves, l);
+ window->outstanding_moves =
+ g_list_delete_link (window->outstanding_moves, l);
}
else /* move back */
cairo_region_translate (move->dest_region, move->dx, move->dy);
@@ -4135,8 +4080,8 @@ gdk_window_process_updates_internal (GdkWindow *window)
* moves and queue antiexposure immediately. No need to do
* any tricks */
gdk_window_flush_outstanding_moves (window);
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
- save_region = impl_iface->queue_antiexpose (window, update_area);
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
+ save_region = impl_class->queue_antiexpose (window, update_area);
}
/* Render the invalid areas to the implicit paint, by sending exposes.
@@ -4155,11 +4100,11 @@ gdk_window_process_updates_internal (GdkWindow *window)
* be to late to anti-expose now. Since this is merely an
* optimization we just avoid doing it at all in that case.
*/
- if (private->implicit_paint != NULL &&
- !private->implicit_paint->flushed)
+ if (window->implicit_paint != NULL &&
+ !window->implicit_paint->flushed)
{
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
- save_region = impl_iface->queue_antiexpose (window, update_area);
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
+ save_region = impl_class->queue_antiexpose (window, update_area);
}
gdk_window_end_implicit_paint (window);
@@ -4170,7 +4115,7 @@ gdk_window_process_updates_internal (GdkWindow *window)
cairo_region_destroy (update_area);
}
- if (private->outstanding_moves)
+ if (window->outstanding_moves)
{
/* Flush any outstanding moves, may happen if we moved a window but got
no actual invalid area */
@@ -4241,18 +4186,18 @@ gdk_window_process_all_updates (void)
while (tmp_list)
{
- GdkWindowObject *private = (GdkWindowObject *)tmp_list->data;
+ GdkWindow *window = tmp_list->data;
- if (!GDK_WINDOW_DESTROYED (tmp_list->data))
+ if (!GDK_WINDOW_DESTROYED (window))
{
- if (private->update_freeze_count ||
- gdk_window_is_toplevel_frozen (tmp_list->data))
- gdk_window_add_update_window ((GdkWindow *) private);
+ if (window->update_freeze_count ||
+ gdk_window_is_toplevel_frozen (window))
+ gdk_window_add_update_window (window);
else
- gdk_window_process_updates_internal (tmp_list->data);
+ gdk_window_process_updates_internal (window);
}
- g_object_unref (tmp_list->data);
+ g_object_unref (window);
tmp_list = tmp_list->next;
}
@@ -4294,8 +4239,7 @@ void
gdk_window_process_updates (GdkWindow *window,
gboolean update_children)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
- GdkWindowObject *impl_window;
+ GdkWindow *impl_window;
g_return_if_fail (GDK_IS_WINDOW (window));
@@ -4305,7 +4249,7 @@ gdk_window_process_updates (GdkWindow *window,
/* Make sure the window lives during the expose callouts */
g_object_ref (window);
- impl_window = gdk_window_get_impl_window (private);
+ impl_window = gdk_window_get_impl_window (window);
if ((impl_window->update_area ||
impl_window->outstanding_moves) &&
!impl_window->update_freeze_count &&
@@ -4326,7 +4270,7 @@ gdk_window_process_updates (GdkWindow *window,
*/
GList *node, *children;
- children = g_list_copy (private->children);
+ children = g_list_copy (window->children);
g_list_foreach (children, (GFunc)g_object_ref, NULL);
for (node = g_list_last (children); node; node = node->prev)
@@ -4349,22 +4293,21 @@ gdk_window_invalidate_rect_full (GdkWindow *window,
{
GdkRectangle window_rect;
cairo_region_t *region;
- GdkWindowObject *private = (GdkWindowObject *)window;
g_return_if_fail (GDK_IS_WINDOW (window));
if (GDK_WINDOW_DESTROYED (window))
return;
- if (private->input_only || !private->viewable)
+ if (window->input_only || !window->viewable)
return;
if (!rect)
{
window_rect.x = 0;
window_rect.y = 0;
- window_rect.width = private->width;
- window_rect.height = private->height;
+ window_rect.width = window->width;
+ window_rect.height = window->height;
rect = &window_rect;
}
@@ -4408,16 +4351,16 @@ draw_ugly_color (GdkWindow *window,
}
static void
-impl_window_add_update_area (GdkWindowObject *impl_window,
+impl_window_add_update_area (GdkWindow *impl_window,
cairo_region_t *region)
{
if (impl_window->update_area)
cairo_region_union (impl_window->update_area, region);
else
{
- gdk_window_add_update_window ((GdkWindow *)impl_window);
+ gdk_window_add_update_window (impl_window);
impl_window->update_area = cairo_region_copy (region);
- gdk_window_schedule_update ((GdkWindow *)impl_window);
+ gdk_window_schedule_update (impl_window);
}
}
@@ -4438,8 +4381,7 @@ gdk_window_invalidate_maybe_recurse_full (GdkWindow *window,
GdkWindowChildFunc child_func,
gpointer user_data)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
- GdkWindowObject *impl_window;
+ GdkWindow *impl_window;
cairo_region_t *visible_region;
GList *tmp_list;
@@ -4448,19 +4390,19 @@ gdk_window_invalidate_maybe_recurse_full (GdkWindow *window,
if (GDK_WINDOW_DESTROYED (window))
return;
- if (private->input_only ||
- !private->viewable ||
+ if (window->input_only ||
+ !window->viewable ||
cairo_region_is_empty (region) ||
- private->window_type == GDK_WINDOW_ROOT)
+ window->window_type == GDK_WINDOW_ROOT)
return;
- visible_region = gdk_drawable_get_visible_region (window);
+ visible_region = gdk_window_get_visible_region (window);
cairo_region_intersect (visible_region, region);
- tmp_list = private->children;
+ tmp_list = window->children;
while (tmp_list)
{
- GdkWindowObject *child = tmp_list->data;
+ GdkWindow *child = tmp_list->data;
if (!child->input_only)
{
@@ -4499,7 +4441,7 @@ gdk_window_invalidate_maybe_recurse_full (GdkWindow *window,
tmp_list = tmp_list->next;
}
- impl_window = gdk_window_get_impl_window (private);
+ impl_window = gdk_window_get_impl_window (window);
if (!cairo_region_is_empty (visible_region) ||
/* Even if we're not exposing anything, make sure we process
@@ -4511,13 +4453,13 @@ gdk_window_invalidate_maybe_recurse_full (GdkWindow *window,
draw_ugly_color (window, region);
/* Convert to impl coords */
- cairo_region_translate (visible_region, private->abs_x, private->abs_y);
+ cairo_region_translate (visible_region, window->abs_x, window->abs_y);
/* Only invalidate area if app requested expose events or if
we need to clear the area (by request or to emulate background
clearing for non-native windows or native windows with no support
for window backgrounds */
- if (private->event_mask & GDK_EXPOSURE_MASK ||
+ if (window->event_mask & GDK_EXPOSURE_MASK ||
clear_bg == CLEAR_BG_ALL ||
clear_bg == CLEAR_BG_WINCLEARED)
impl_window_add_update_area (impl_window, visible_region);
@@ -4641,7 +4583,6 @@ void
_gdk_window_invalidate_for_expose (GdkWindow *window,
cairo_region_t *region)
{
- GdkWindowObject *private = (GdkWindowObject *) window;
GdkWindowRegionMove *move;
cairo_region_t *move_region;
GList *l;
@@ -4652,7 +4593,7 @@ _gdk_window_invalidate_for_expose (GdkWindow *window,
otherwise we would expose in the wrong place, as the
outstanding moves will be copied before we draw the
exposes. */
- for (l = private->outstanding_moves; l != NULL; l = l->next)
+ for (l = window->outstanding_moves; l != NULL; l = l->next)
{
move = l->data;
@@ -4692,19 +4633,18 @@ _gdk_window_invalidate_for_expose (GdkWindow *window,
cairo_region_t *
gdk_window_get_update_area (GdkWindow *window)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
- GdkWindowObject *impl_window;
+ GdkWindow *impl_window;
cairo_region_t *tmp_region;
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
- impl_window = gdk_window_get_impl_window (private);
+ impl_window = gdk_window_get_impl_window (window);
if (impl_window->update_area)
{
- tmp_region = cairo_region_copy (private->clip_region_with_children);
+ tmp_region = cairo_region_copy (window->clip_region_with_children);
/* Convert to impl coords */
- cairo_region_translate (tmp_region, private->abs_x, private->abs_y);
+ cairo_region_translate (tmp_region, window->abs_x, window->abs_y);
cairo_region_intersect (tmp_region, impl_window->update_area);
if (cairo_region_is_empty (tmp_region))
@@ -4726,7 +4666,7 @@ gdk_window_get_update_area (GdkWindow *window)
}
/* Convert from impl coords */
- cairo_region_translate (tmp_region, -private->abs_x, -private->abs_y);
+ cairo_region_translate (tmp_region, -window->abs_x, -window->abs_y);
return tmp_region;
}
@@ -4745,16 +4685,14 @@ gdk_window_get_update_area (GdkWindow *window)
void
_gdk_window_clear_update_area (GdkWindow *window)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
-
g_return_if_fail (GDK_IS_WINDOW (window));
- if (private->update_area)
+ if (window->update_area)
{
gdk_window_remove_update_window (window);
- cairo_region_destroy (private->update_area);
- private->update_area = NULL;
+ cairo_region_destroy (window->update_area);
+ window->update_area = NULL;
}
}
@@ -4771,12 +4709,11 @@ _gdk_window_clear_update_area (GdkWindow *window)
void
gdk_window_freeze_updates (GdkWindow *window)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
- GdkWindowObject *impl_window;
+ GdkWindow *impl_window;
g_return_if_fail (GDK_IS_WINDOW (window));
- impl_window = gdk_window_get_impl_window (private);
+ impl_window = gdk_window_get_impl_window (window);
impl_window->update_freeze_count++;
}
@@ -4789,12 +4726,11 @@ gdk_window_freeze_updates (GdkWindow *window)
void
gdk_window_thaw_updates (GdkWindow *window)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
- GdkWindowObject *impl_window;
+ GdkWindow *impl_window;
g_return_if_fail (GDK_IS_WINDOW (window));
- impl_window = gdk_window_get_impl_window (private);
+ impl_window = gdk_window_get_impl_window (window);
g_return_if_fail (impl_window->update_freeze_count > 0);
@@ -4820,12 +4756,10 @@ gdk_window_thaw_updates (GdkWindow *window)
void
gdk_window_freeze_toplevel_updates_libgtk_only (GdkWindow *window)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
-
g_return_if_fail (GDK_IS_WINDOW (window));
- g_return_if_fail (private->window_type != GDK_WINDOW_CHILD);
+ g_return_if_fail (window->window_type != GDK_WINDOW_CHILD);
- private->update_and_descendants_freeze_count++;
+ window->update_and_descendants_freeze_count++;
}
/**
@@ -4841,13 +4775,11 @@ gdk_window_freeze_toplevel_updates_libgtk_only (GdkWindow *window)
void
gdk_window_thaw_toplevel_updates_libgtk_only (GdkWindow *window)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
-
g_return_if_fail (GDK_IS_WINDOW (window));
- g_return_if_fail (private->window_type != GDK_WINDOW_CHILD);
- g_return_if_fail (private->update_and_descendants_freeze_count > 0);
+ g_return_if_fail (window->window_type != GDK_WINDOW_CHILD);
+ g_return_if_fail (window->update_and_descendants_freeze_count > 0);
- private->update_and_descendants_freeze_count--;
+ window->update_and_descendants_freeze_count--;
gdk_window_schedule_update (window);
}
@@ -5158,13 +5090,13 @@ gdk_window_foreign_new (GdkNativeWindow anid)
}
static void
-get_all_native_children (GdkWindowObject *private,
+get_all_native_children (GdkWindow *window,
GList **native)
{
- GdkWindowObject *child;
+ GdkWindow *child;
GList *l;
- for (l = private->children; l != NULL; l = l->next)
+ for (l = window->children; l != NULL; l = l->next)
{
child = l->data;
@@ -5179,12 +5111,11 @@ get_all_native_children (GdkWindowObject *private,
static inline void
gdk_window_raise_internal (GdkWindow *window)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
- GdkWindowObject *parent = private->parent;
- GdkWindowObject *above;
+ GdkWindow *parent = window->parent;
+ GdkWindow *above;
GList *native_children;
GList *l, listhead;
- GdkWindowImplIface *impl_iface;
+ GdkWindowImplClass *impl_class;
if (parent)
{
@@ -5192,48 +5123,47 @@ gdk_window_raise_internal (GdkWindow *window)
parent->children = g_list_prepend (parent->children, window);
}
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
/* Just do native raise for toplevels */
- if (gdk_window_is_toplevel (private) ||
+ if (gdk_window_is_toplevel (window) ||
/* The restack_under codepath should work correctly even if the parent
is native, but it relies on the order of ->children to be correct,
and some apps like SWT reorder the x windows without gdks knowledge,
so we use raise directly in order to make these behave as before
when using native windows */
- (gdk_window_has_impl (private) && gdk_window_has_impl (parent)))
+ (gdk_window_has_impl (window) && gdk_window_has_impl (parent)))
{
- impl_iface->raise (window);
+ impl_class->raise (window);
}
- else if (gdk_window_has_impl (private))
+ else if (gdk_window_has_impl (window))
{
- above = find_native_sibling_above (parent, private);
+ above = find_native_sibling_above (parent, window);
if (above)
{
listhead.data = window;
listhead.next = NULL;
listhead.prev = NULL;
- impl_iface->restack_under ((GdkWindow *)above,
+ impl_class->restack_under ((GdkWindow *)above,
&listhead);
}
else
- impl_iface->raise (window);
+ impl_class->raise (window);
}
else
{
native_children = NULL;
- get_all_native_children (private, &native_children);
+ get_all_native_children (window, &native_children);
if (native_children != NULL)
{
- above = find_native_sibling_above (parent, private);
+ above = find_native_sibling_above (parent, window);
if (above)
- impl_iface->restack_under ((GdkWindow *)above,
- native_children);
+ impl_class->restack_under (above, native_children);
else
{
/* Right order, since native_children is bottom-topmost first */
for (l = native_children; l != NULL; l = l->next)
- impl_iface->raise (l->data);
+ impl_class->raise (l->data);
}
g_list_free (native_children);
@@ -5244,11 +5174,11 @@ gdk_window_raise_internal (GdkWindow *window)
/* Returns TRUE If the native window was mapped or unmapped */
static gboolean
-set_viewable (GdkWindowObject *w,
+set_viewable (GdkWindow *w,
gboolean val)
{
- GdkWindowObject *child;
- GdkWindowImplIface *impl_iface;
+ GdkWindow *child;
+ GdkWindowImplClass *impl_class;
GList *l;
if (w->viewable == val)
@@ -5299,11 +5229,11 @@ set_viewable (GdkWindowObject *w,
* like this, so we just always show/hide directly.
*/
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (w->impl);
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (w->impl);
if (val)
- impl_iface->show ((GdkWindow *)w, FALSE);
+ impl_class->show ((GdkWindow *)w, FALSE);
else
- impl_iface->hide ((GdkWindow *)w);
+ impl_class->hide ((GdkWindow *)w);
return TRUE;
}
@@ -5315,43 +5245,40 @@ set_viewable (GdkWindowObject *w,
gboolean
_gdk_window_update_viewable (GdkWindow *window)
{
- GdkWindowObject *priv = (GdkWindowObject *)window;
gboolean viewable;
- if (priv->window_type == GDK_WINDOW_FOREIGN ||
- priv->window_type == GDK_WINDOW_ROOT)
+ if (window->window_type == GDK_WINDOW_FOREIGN ||
+ window->window_type == GDK_WINDOW_ROOT)
viewable = TRUE;
- else if (gdk_window_is_toplevel (priv) ||
- priv->parent->viewable)
- viewable = GDK_WINDOW_IS_MAPPED (priv);
+ else if (gdk_window_is_toplevel (window) ||
+ window->parent->viewable)
+ viewable = GDK_WINDOW_IS_MAPPED (window);
else
viewable = FALSE;
- return set_viewable (priv, viewable);
+ return set_viewable (window, viewable);
}
static void
gdk_window_show_internal (GdkWindow *window, gboolean raise)
{
- GdkWindowObject *private;
- GdkWindowImplIface *impl_iface;
+ GdkWindowImplClass *impl_class;
gboolean was_mapped, was_viewable;
gboolean did_show;
g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowObject *) window;
- if (private->destroyed)
+ if (window->destroyed)
return;
was_mapped = GDK_WINDOW_IS_MAPPED (window);
- was_viewable = private->viewable;
+ was_viewable = window->viewable;
if (raise)
/* Keep children in (reverse) stacking order */
gdk_window_raise_internal (window);
- if (gdk_window_has_impl (private))
+ if (gdk_window_has_impl (window))
{
if (!was_mapped)
gdk_synthesize_window_state (window,
@@ -5360,7 +5287,7 @@ gdk_window_show_internal (GdkWindow *window, gboolean raise)
}
else
{
- private->state = 0;
+ window->state = 0;
}
did_show = _gdk_window_update_viewable (window);
@@ -5370,28 +5297,27 @@ gdk_window_show_internal (GdkWindow *window, gboolean raise)
for e.g. a foreign window.
Dunno if this is strictly needed but its what happened pre-csw.
Also show if not done by gdk_window_update_viewable. */
- if (gdk_window_has_impl (private) && (was_viewable || !did_show))
+ if (gdk_window_has_impl (window) && (was_viewable || !did_show))
{
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
- impl_iface->show ((GdkWindow *)private,
- !did_show ? was_mapped : TRUE);
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
+ impl_class->show (window, !did_show ? was_mapped : TRUE);
}
- if (!was_mapped && !gdk_window_has_impl (private))
+ if (!was_mapped && !gdk_window_has_impl (window))
{
- if (private->event_mask & GDK_STRUCTURE_MASK)
- _gdk_make_event (GDK_WINDOW (private), GDK_MAP, NULL, FALSE);
+ if (window->event_mask & GDK_STRUCTURE_MASK)
+ _gdk_make_event (window, GDK_MAP, NULL, FALSE);
- if (private->parent && private->parent->event_mask & GDK_SUBSTRUCTURE_MASK)
- _gdk_make_event (GDK_WINDOW (private), GDK_MAP, NULL, FALSE);
+ if (window->parent && window->parent->event_mask & GDK_SUBSTRUCTURE_MASK)
+ _gdk_make_event (window, GDK_MAP, NULL, FALSE);
}
if (!was_mapped || raise)
{
- recompute_visible_regions (private, TRUE, FALSE);
+ recompute_visible_regions (window, TRUE, FALSE);
/* If any decendants became visible we need to send visibility notify */
- gdk_window_update_visibility_recursively (private, NULL);
+ gdk_window_update_visibility_recursively (window, NULL);
if (gdk_window_is_viewable (window))
{
@@ -5434,30 +5360,28 @@ gdk_window_show_unraised (GdkWindow *window)
void
gdk_window_raise (GdkWindow *window)
{
- GdkWindowObject *private;
cairo_region_t *old_region, *new_region;
g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowObject *) window;
- if (private->destroyed)
+ if (window->destroyed)
return;
gdk_window_flush_if_exposing (window);
old_region = NULL;
if (gdk_window_is_viewable (window) &&
- !private->input_only)
- old_region = cairo_region_copy (private->clip_region);
+ !window->input_only)
+ old_region = cairo_region_copy (window->clip_region);
/* Keep children in (reverse) stacking order */
gdk_window_raise_internal (window);
- recompute_visible_regions (private, TRUE, FALSE);
+ recompute_visible_regions (window, TRUE, FALSE);
if (old_region)
{
- new_region = cairo_region_copy (private->clip_region);
+ new_region = cairo_region_copy (window->clip_region);
cairo_region_subtract (new_region, old_region);
gdk_window_invalidate_region_full (window, new_region, TRUE, CLEAR_BG_ALL);
@@ -5470,10 +5394,9 @@ gdk_window_raise (GdkWindow *window)
static void
gdk_window_lower_internal (GdkWindow *window)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
- GdkWindowObject *parent = private->parent;
- GdkWindowImplIface *impl_iface;
- GdkWindowObject *above;
+ GdkWindow *parent = window->parent;
+ GdkWindowImplClass *impl_class;
+ GdkWindow *above;
GList *native_children;
GList *l, listhead;
@@ -5483,47 +5406,47 @@ gdk_window_lower_internal (GdkWindow *window)
parent->children = g_list_append (parent->children, window);
}
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
/* Just do native lower for toplevels */
- if (gdk_window_is_toplevel (private) ||
+ if (gdk_window_is_toplevel (window) ||
/* The restack_under codepath should work correctly even if the parent
is native, but it relies on the order of ->children to be correct,
and some apps like SWT reorder the x windows without gdks knowledge,
so we use lower directly in order to make these behave as before
when using native windows */
- (gdk_window_has_impl (private) && gdk_window_has_impl (parent)))
+ (gdk_window_has_impl (window) && gdk_window_has_impl (parent)))
{
- impl_iface->lower (window);
+ impl_class->lower (window);
}
- else if (gdk_window_has_impl (private))
+ else if (gdk_window_has_impl (window))
{
- above = find_native_sibling_above (parent, private);
+ above = find_native_sibling_above (parent, window);
if (above)
{
listhead.data = window;
listhead.next = NULL;
listhead.prev = NULL;
- impl_iface->restack_under ((GdkWindow *)above, &listhead);
+ impl_class->restack_under ((GdkWindow *)above, &listhead);
}
else
- impl_iface->raise (window);
+ impl_class->raise (window);
}
else
{
native_children = NULL;
- get_all_native_children (private, &native_children);
+ get_all_native_children (window, &native_children);
if (native_children != NULL)
{
- above = find_native_sibling_above (parent, private);
+ above = find_native_sibling_above (parent, window);
if (above)
- impl_iface->restack_under ((GdkWindow *)above,
+ impl_class->restack_under ((GdkWindow *)above,
native_children);
else
{
/* Right order, since native_children is bottom-topmost first */
for (l = native_children; l != NULL; l = l->next)
- impl_iface->raise (l->data);
+ impl_class->raise (l->data);
}
g_list_free (native_children);
@@ -5533,7 +5456,7 @@ gdk_window_lower_internal (GdkWindow *window)
}
static void
-gdk_window_invalidate_in_parent (GdkWindowObject *private)
+gdk_window_invalidate_in_parent (GdkWindow *private)
{
GdkRectangle r, child;
@@ -5551,7 +5474,7 @@ gdk_window_invalidate_in_parent (GdkWindowObject *private)
child.height = private->height;
gdk_rectangle_intersect (&r, &child, &r);
- gdk_window_invalidate_rect_full (GDK_WINDOW (private->parent), &r, TRUE, CLEAR_BG_ALL);
+ gdk_window_invalidate_rect_full (private->parent, &r, TRUE, CLEAR_BG_ALL);
}
@@ -5573,12 +5496,9 @@ gdk_window_invalidate_in_parent (GdkWindowObject *private)
void
gdk_window_lower (GdkWindow *window)
{
- GdkWindowObject *private;
-
g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowObject *) window;
- if (private->destroyed)
+ if (window->destroyed)
return;
gdk_window_flush_if_exposing (window);
@@ -5586,10 +5506,10 @@ gdk_window_lower (GdkWindow *window)
/* Keep children in (reverse) stacking order */
gdk_window_lower_internal (window);
- recompute_visible_regions (private, TRUE, FALSE);
+ recompute_visible_regions (window, TRUE, FALSE);
_gdk_synthesize_crossing_events_for_geometry_change (window);
- gdk_window_invalidate_in_parent (private);
+ gdk_window_invalidate_in_parent (window);
}
/**
@@ -5616,10 +5536,9 @@ gdk_window_restack (GdkWindow *window,
GdkWindow *sibling,
gboolean above)
{
- GdkWindowObject *private;
- GdkWindowImplIface *impl_iface;
- GdkWindowObject *parent;
- GdkWindowObject *above_native;
+ GdkWindowImplClass *impl_class;
+ GdkWindow *parent;
+ GdkWindow *above_native;
GList *sibling_link;
GList *native_children;
GList *l, listhead;
@@ -5627,8 +5546,7 @@ gdk_window_restack (GdkWindow *window,
g_return_if_fail (GDK_IS_WINDOW (window));
g_return_if_fail (sibling == NULL || GDK_IS_WINDOW (sibling));
- private = (GdkWindowObject *) window;
- if (private->destroyed)
+ if (window->destroyed)
return;
if (sibling == NULL)
@@ -5642,15 +5560,15 @@ gdk_window_restack (GdkWindow *window,
gdk_window_flush_if_exposing (window);
- if (gdk_window_is_toplevel (private))
+ if (gdk_window_is_toplevel (window))
{
- g_return_if_fail (gdk_window_is_toplevel (GDK_WINDOW_OBJECT (sibling)));
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
- impl_iface->restack_toplevel (window, sibling, above);
+ g_return_if_fail (gdk_window_is_toplevel (sibling));
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
+ impl_class->restack_toplevel (window, sibling, above);
return;
}
- parent = private->parent;
+ parent = window->parent;
if (parent)
{
sibling_link = g_list_find (parent->children, sibling);
@@ -5668,35 +5586,35 @@ gdk_window_restack (GdkWindow *window,
sibling_link->next,
window);
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
- if (gdk_window_has_impl (private))
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
+ if (gdk_window_has_impl (window))
{
- above_native = find_native_sibling_above (parent, private);
+ above_native = find_native_sibling_above (parent, window);
if (above_native)
{
listhead.data = window;
listhead.next = NULL;
listhead.prev = NULL;
- impl_iface->restack_under ((GdkWindow *)above_native, &listhead);
+ impl_class->restack_under (above_native, &listhead);
}
else
- impl_iface->raise (window);
+ impl_class->raise (window);
}
else
{
native_children = NULL;
- get_all_native_children (private, &native_children);
+ get_all_native_children (window, &native_children);
if (native_children != NULL)
{
- above_native = find_native_sibling_above (parent, private);
+ above_native = find_native_sibling_above (parent, window);
if (above_native)
- impl_iface->restack_under ((GdkWindow *)above_native,
+ impl_class->restack_under (above_native,
native_children);
else
{
/* Right order, since native_children is bottom-topmost first */
for (l = native_children; l != NULL; l = l->next)
- impl_iface->raise (l->data);
+ impl_class->raise (l->data);
}
g_list_free (native_children);
@@ -5704,10 +5622,10 @@ gdk_window_restack (GdkWindow *window,
}
}
- recompute_visible_regions (private, TRUE, FALSE);
+ recompute_visible_regions (window, TRUE, FALSE);
_gdk_synthesize_crossing_events_for_geometry_change (window);
- gdk_window_invalidate_in_parent (private);
+ gdk_window_invalidate_in_parent (window);
}
@@ -5743,19 +5661,17 @@ gdk_window_show (GdkWindow *window)
void
gdk_window_hide (GdkWindow *window)
{
- GdkWindowObject *private;
- GdkWindowImplIface *impl_iface;
+ GdkWindowImplClass *impl_class;
gboolean was_mapped, did_hide;
g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowObject *) window;
- if (private->destroyed)
+ if (window->destroyed)
return;
- was_mapped = GDK_WINDOW_IS_MAPPED (private);
+ was_mapped = GDK_WINDOW_IS_MAPPED (window);
- if (gdk_window_has_impl (private))
+ if (gdk_window_has_impl (window))
{
if (GDK_WINDOW_IS_MAPPED (window))
@@ -5789,38 +5705,38 @@ gdk_window_hide (GdkWindow *window)
gdk_device_ungrab (device, GDK_CURRENT_TIME);
}
- private->state = GDK_WINDOW_STATE_WITHDRAWN;
+ window->state = GDK_WINDOW_STATE_WITHDRAWN;
g_list_free (devices);
}
did_hide = _gdk_window_update_viewable (window);
/* Hide foreign window as those are not handled by update_viewable. */
- if (gdk_window_has_impl (private) && (!did_hide))
+ if (gdk_window_has_impl (window) && (!did_hide))
{
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
- impl_iface->hide (window);
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
+ impl_class->hide (window);
}
- recompute_visible_regions (private, TRUE, FALSE);
+ recompute_visible_regions (window, TRUE, FALSE);
/* all decendants became non-visible, we need to send visibility notify */
- gdk_window_update_visibility_recursively (private, NULL);
+ gdk_window_update_visibility_recursively (window, NULL);
- if (was_mapped && !gdk_window_has_impl (private))
+ if (was_mapped && !gdk_window_has_impl (window))
{
- if (private->event_mask & GDK_STRUCTURE_MASK)
- _gdk_make_event (GDK_WINDOW (private), GDK_UNMAP, NULL, FALSE);
+ if (window->event_mask & GDK_STRUCTURE_MASK)
+ _gdk_make_event (window, GDK_UNMAP, NULL, FALSE);
- if (private->parent && private->parent->event_mask & GDK_SUBSTRUCTURE_MASK)
- _gdk_make_event (GDK_WINDOW (private), GDK_UNMAP, NULL, FALSE);
+ if (window->parent && window->parent->event_mask & GDK_SUBSTRUCTURE_MASK)
+ _gdk_make_event (window, GDK_UNMAP, NULL, FALSE);
- _gdk_synthesize_crossing_events_for_geometry_change (GDK_WINDOW (private->parent));
+ _gdk_synthesize_crossing_events_for_geometry_change (window->parent);
}
/* Invalidate the rect */
if (was_mapped)
- gdk_window_invalidate_in_parent (private);
+ gdk_window_invalidate_in_parent (window);
}
/**
@@ -5834,35 +5750,33 @@ gdk_window_hide (GdkWindow *window)
void
gdk_window_withdraw (GdkWindow *window)
{
- GdkWindowObject *private;
- GdkWindowImplIface *impl_iface;
+ GdkWindowImplClass *impl_class;
gboolean was_mapped;
g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowObject *) window;
- if (private->destroyed)
+ if (window->destroyed)
return;
- was_mapped = GDK_WINDOW_IS_MAPPED (private);
+ was_mapped = GDK_WINDOW_IS_MAPPED (window);
- if (gdk_window_has_impl (private))
+ if (gdk_window_has_impl (window))
{
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
- impl_iface->withdraw (window);
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
+ impl_class->withdraw (window);
if (was_mapped)
{
- if (private->event_mask & GDK_STRUCTURE_MASK)
- _gdk_make_event (GDK_WINDOW (private), GDK_UNMAP, NULL, FALSE);
+ if (window->event_mask & GDK_STRUCTURE_MASK)
+ _gdk_make_event (window, GDK_UNMAP, NULL, FALSE);
- if (private->parent && private->parent->event_mask & GDK_SUBSTRUCTURE_MASK)
- _gdk_make_event (GDK_WINDOW (private), GDK_UNMAP, NULL, FALSE);
+ if (window->parent && window->parent->event_mask & GDK_SUBSTRUCTURE_MASK)
+ _gdk_make_event (window, GDK_UNMAP, NULL, FALSE);
- _gdk_synthesize_crossing_events_for_geometry_change (GDK_WINDOW (private->parent));
+ _gdk_synthesize_crossing_events_for_geometry_change (window->parent);
}
- recompute_visible_regions (private, TRUE, FALSE);
+ recompute_visible_regions (window, TRUE, FALSE);
}
}
@@ -5881,22 +5795,20 @@ void
gdk_window_set_events (GdkWindow *window,
GdkEventMask event_mask)
{
- GdkWindowObject *private;
- GdkWindowImplIface *impl_iface;
+ GdkWindowImplClass *impl_class;
GdkDisplay *display;
g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowObject *) window;
- if (private->destroyed)
+ if (window->destroyed)
return;
/* If motion hint is disabled, enable motion events again */
display = gdk_window_get_display (window);
- if ((private->event_mask & GDK_POINTER_MOTION_HINT_MASK) &&
+ if ((window->event_mask & GDK_POINTER_MOTION_HINT_MASK) &&
!(event_mask & GDK_POINTER_MOTION_HINT_MASK))
{
- GList *devices = private->devices_inside;
+ GList *devices = window->devices_inside;
while (devices)
{
@@ -5905,13 +5817,13 @@ gdk_window_set_events (GdkWindow *window,
}
}
- private->event_mask = event_mask;
+ window->event_mask = event_mask;
- if (gdk_window_has_impl (private))
+ if (gdk_window_has_impl (window))
{
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
- impl_iface->set_events (window,
- get_native_event_mask (private));
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
+ impl_class->set_events (window,
+ get_native_event_mask (window));
}
}
@@ -5928,15 +5840,12 @@ gdk_window_set_events (GdkWindow *window,
GdkEventMask
gdk_window_get_events (GdkWindow *window)
{
- GdkWindowObject *private;
-
g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
- private = (GdkWindowObject *) window;
- if (private->destroyed)
+ if (window->destroyed)
return 0;
- return private->event_mask;
+ return window->event_mask;
}
/**
@@ -5959,7 +5868,6 @@ gdk_window_set_device_events (GdkWindow *window,
GdkEventMask event_mask)
{
GdkEventMask device_mask;
- GdkWindowObject *private;
GdkDisplay *display;
GdkWindow *native;
@@ -5969,26 +5877,24 @@ gdk_window_set_device_events (GdkWindow *window,
if (GDK_WINDOW_DESTROYED (window))
return;
- private = (GdkWindowObject *) window;
-
/* If motion hint is disabled, enable motion events again */
display = gdk_window_get_display (window);
- if ((private->event_mask & GDK_POINTER_MOTION_HINT_MASK) &&
+ if ((window->event_mask & GDK_POINTER_MOTION_HINT_MASK) &&
!(event_mask & GDK_POINTER_MOTION_HINT_MASK))
_gdk_display_enable_motion_hints (display, device);
- if (G_UNLIKELY (!private->device_events))
- private->device_events = g_hash_table_new (NULL, NULL);
+ if (G_UNLIKELY (!window->device_events))
+ window->device_events = g_hash_table_new (NULL, NULL);
if (event_mask == 0)
{
/* FIXME: unsetting events on a master device
- * would restore private->event_mask
+ * would restore window->event_mask
*/
- g_hash_table_remove (private->device_events, device);
+ g_hash_table_remove (window->device_events, device);
}
else
- g_hash_table_insert (private->device_events, device,
+ g_hash_table_insert (window->device_events, device,
GINT_TO_POINTER (event_mask));
if (_gdk_native_windows)
@@ -5996,7 +5902,7 @@ gdk_window_set_device_events (GdkWindow *window,
else
native = gdk_window_get_toplevel (window);
- while (gdk_window_is_offscreen ((GdkWindowObject *)native))
+ while (gdk_window_is_offscreen (native))
{
native = gdk_offscreen_window_get_embedder (native);
@@ -6008,7 +5914,7 @@ gdk_window_set_device_events (GdkWindow *window,
native = gdk_window_get_toplevel (native);
}
- device_mask = get_native_device_event_mask (private, device);
+ device_mask = get_native_device_event_mask (window, device);
GDK_DEVICE_GET_CLASS (device)->select_window_events (device, native, device_mask);
}
@@ -6027,7 +5933,6 @@ GdkEventMask
gdk_window_get_device_events (GdkWindow *window,
GdkDevice *device)
{
- GdkWindowObject *private;
GdkEventMask mask;
g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
@@ -6036,14 +5941,12 @@ gdk_window_get_device_events (GdkWindow *window,
if (GDK_WINDOW_DESTROYED (window))
return 0;
- private = (GdkWindowObject *) window;
-
- if (!private->device_events)
+ if (!window->device_events)
return 0;
- mask = GPOINTER_TO_INT (g_hash_table_lookup (private->device_events, device));
+ mask = GPOINTER_TO_INT (g_hash_table_lookup (window->device_events, device));
- /* FIXME: device could be controlled by private->event_mask */
+ /* FIXME: device could be controlled by window->event_mask */
return mask;
}
@@ -6056,47 +5959,44 @@ gdk_window_move_resize_toplevel (GdkWindow *window,
gint width,
gint height)
{
- GdkWindowObject *private;
cairo_region_t *old_region, *new_region;
- GdkWindowImplIface *impl_iface;
+ GdkWindowImplClass *impl_class;
gboolean expose;
int old_x, old_y, old_abs_x, old_abs_y;
int dx, dy;
gboolean is_resize;
- private = (GdkWindowObject *) window;
-
expose = FALSE;
old_region = NULL;
- old_x = private->x;
- old_y = private->y;
+ old_x = window->x;
+ old_y = window->y;
is_resize = (width != -1) || (height != -1);
if (gdk_window_is_viewable (window) &&
- !private->input_only)
+ !window->input_only)
{
expose = TRUE;
- old_region = cairo_region_copy (private->clip_region);
+ old_region = cairo_region_copy (window->clip_region);
}
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
- impl_iface->move_resize (window, with_move, x, y, width, height);
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
+ impl_class->move_resize (window, with_move, x, y, width, height);
- dx = private->x - old_x;
- dy = private->y - old_y;
+ dx = window->x - old_x;
+ dy = window->y - old_y;
- old_abs_x = private->abs_x;
- old_abs_y = private->abs_y;
+ old_abs_x = window->abs_x;
+ old_abs_y = window->abs_y;
/* Avoid recomputing for pure toplevel moves, for performance reasons */
if (is_resize)
- recompute_visible_regions (private, TRUE, FALSE);
+ recompute_visible_regions (window, TRUE, FALSE);
if (expose)
{
- new_region = cairo_region_copy (private->clip_region);
+ new_region = cairo_region_copy (window->clip_region);
/* This is the newly exposed area (due to any resize),
* X will expose it, but lets do that without the
@@ -6114,11 +6014,11 @@ gdk_window_move_resize_toplevel (GdkWindow *window,
static void
-move_native_children (GdkWindowObject *private)
+move_native_children (GdkWindow *private)
{
GList *l;
- GdkWindowObject *child;
- GdkWindowImplIface *impl_iface;
+ GdkWindow *child;
+ GdkWindowImplClass *impl_class;
for (l = private->children; l; l = l->next)
{
@@ -6126,8 +6026,8 @@ move_native_children (GdkWindowObject *private)
if (child->impl != private->impl)
{
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (child->impl);
- impl_iface->move_resize ((GdkWindow *)child, TRUE,
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (child->impl);
+ impl_class->move_resize (child, TRUE,
child->x, child->y,
child->width, child->height);
}
@@ -6137,13 +6037,13 @@ move_native_children (GdkWindowObject *private)
}
static gboolean
-collect_native_child_region_helper (GdkWindowObject *window,
- GdkWindow *impl,
+collect_native_child_region_helper (GdkWindow *window,
+ GdkWindowImpl *impl,
cairo_region_t **region,
int x_offset,
int y_offset)
{
- GdkWindowObject *child;
+ GdkWindow *child;
cairo_region_t *tmp;
GList *l;
@@ -6178,7 +6078,7 @@ collect_native_child_region_helper (GdkWindowObject *window,
}
static cairo_region_t *
-collect_native_child_region (GdkWindowObject *window,
+collect_native_child_region (GdkWindow *window,
gboolean include_this)
{
cairo_region_t *region;
@@ -6202,33 +6102,31 @@ gdk_window_move_resize_internal (GdkWindow *window,
gint width,
gint height)
{
- GdkWindowObject *private;
cairo_region_t *old_region, *new_region, *copy_area;
cairo_region_t *old_native_child_region, *new_native_child_region;
- GdkWindowObject *impl_window;
- GdkWindowImplIface *impl_iface;
+ GdkWindow *impl_window;
+ GdkWindowImplClass *impl_class;
gboolean expose;
int old_x, old_y, old_abs_x, old_abs_y;
int dx, dy;
g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowObject *) window;
- if (private->destroyed)
+ if (window->destroyed)
return;
- if (gdk_window_is_toplevel (private))
+ if (gdk_window_is_toplevel (window))
{
gdk_window_move_resize_toplevel (window, with_move, x, y, width, height);
return;
}
/* Bail early if no change */
- if (private->width == width &&
- private->height == height &&
+ if (window->width == width &&
+ window->height == height &&
(!with_move ||
- (private->x == x &&
- private->y == y)))
+ (window->x == x &&
+ window->y == y)))
return;
gdk_window_flush_if_exposing (window);
@@ -6238,26 +6136,26 @@ gdk_window_move_resize_internal (GdkWindow *window,
expose = FALSE;
old_region = NULL;
- impl_window = gdk_window_get_impl_window (private);
+ impl_window = gdk_window_get_impl_window (window);
- old_x = private->x;
- old_y = private->y;
+ old_x = window->x;
+ old_y = window->y;
old_native_child_region = NULL;
if (gdk_window_is_viewable (window) &&
- !private->input_only)
+ !window->input_only)
{
expose = TRUE;
- old_region = cairo_region_copy (private->clip_region);
+ old_region = cairo_region_copy (window->clip_region);
/* Adjust region to parent window coords */
- cairo_region_translate (old_region, private->x, private->y);
+ cairo_region_translate (old_region, window->x, window->y);
- old_native_child_region = collect_native_child_region (private, TRUE);
+ old_native_child_region = collect_native_child_region (window, TRUE);
if (old_native_child_region)
{
/* Adjust region to parent window coords */
- cairo_region_translate (old_native_child_region, private->x, private->y);
+ cairo_region_translate (old_native_child_region, window->x, window->y);
/* Any native window move will immediately copy stuff to the destination, which may overwrite a
* source or destination for a delayed GdkWindowRegionMove. So, we need
@@ -6265,61 +6163,61 @@ gdk_window_move_resize_internal (GdkWindow *window,
* of it. And we need to do this before setting the new clips as those will be
* affecting this.
*/
- gdk_window_flush_recursive (private->parent);
+ gdk_window_flush_recursive (window->parent);
}
}
/* Set the new position and size */
if (with_move)
{
- private->x = x;
- private->y = y;
+ window->x = x;
+ window->y = y;
}
if (!(width < 0 && height < 0))
{
if (width < 1)
width = 1;
- private->width = width;
+ window->width = width;
if (height < 1)
height = 1;
- private->height = height;
+ window->height = height;
}
- dx = private->x - old_x;
- dy = private->y - old_y;
+ dx = window->x - old_x;
+ dy = window->y - old_y;
- old_abs_x = private->abs_x;
- old_abs_y = private->abs_y;
+ old_abs_x = window->abs_x;
+ old_abs_y = window->abs_y;
- recompute_visible_regions (private, TRUE, FALSE);
+ recompute_visible_regions (window, TRUE, FALSE);
new_native_child_region = NULL;
if (old_native_child_region)
{
- new_native_child_region = collect_native_child_region (private, TRUE);
+ new_native_child_region = collect_native_child_region (window, TRUE);
/* Adjust region to parent window coords */
- cairo_region_translate (new_native_child_region, private->x, private->y);
+ cairo_region_translate (new_native_child_region, window->x, window->y);
}
- if (gdk_window_has_impl (private))
+ if (gdk_window_has_impl (window))
{
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
/* Do the actual move after recomputing things, as this will have set the shape to
the now correct one, thus avoiding copying regions that should not be copied. */
- impl_iface->move_resize (window, TRUE,
- private->x, private->y,
- private->width, private->height);
+ impl_class->move_resize (window, TRUE,
+ window->x, window->y,
+ window->width, window->height);
}
- else if (old_abs_x != private->abs_x ||
- old_abs_y != private->abs_y)
- move_native_children (private);
+ else if (old_abs_x != window->abs_x ||
+ old_abs_y != window->abs_y)
+ move_native_children (window);
if (expose)
{
- new_region = cairo_region_copy (private->clip_region);
+ new_region = cairo_region_copy (window->clip_region);
/* Adjust region to parent window coords */
- cairo_region_translate (new_region, private->x, private->y);
+ cairo_region_translate (new_region, window->x, window->y);
/* copy_area:
* Part of the data at the new location can be copied from the
@@ -6358,10 +6256,10 @@ gdk_window_move_resize_internal (GdkWindow *window,
cairo_region_subtract (new_region, copy_area);
/* Convert old region to impl coords */
- cairo_region_translate (old_region, -dx + private->abs_x - private->x, -dy + private->abs_y - private->y);
+ cairo_region_translate (old_region, -dx + window->abs_x - window->x, -dy + window->abs_y - window->y);
/* convert from parent coords to impl */
- cairo_region_translate (copy_area, private->abs_x - private->x, private->abs_y - private->y);
+ cairo_region_translate (copy_area, window->abs_x - window->x, window->abs_y - window->y);
move_region_on_impl (impl_window, copy_area, dx, dy); /* takes ownership of copy_area */
@@ -6377,7 +6275,7 @@ gdk_window_move_resize_internal (GdkWindow *window,
cairo_region_intersect (old_native_child_region, new_native_child_region);
cairo_region_subtract (new_region, old_native_child_region);
}
- gdk_window_invalidate_region_full (GDK_WINDOW (private->parent), new_region, TRUE, CLEAR_BG_ALL);
+ gdk_window_invalidate_region_full (window->parent, new_region, TRUE, CLEAR_BG_ALL);
cairo_region_destroy (old_region);
cairo_region_destroy (new_region);
@@ -6488,8 +6386,7 @@ gdk_window_scroll (GdkWindow *window,
gint dx,
gint dy)
{
- GdkWindowObject *private = (GdkWindowObject *) window;
- GdkWindowObject *impl_window;
+ GdkWindow *impl_window;
cairo_region_t *copy_area, *noncopy_area;
cairo_region_t *old_native_child_region, *new_native_child_region;
GList *tmp_list;
@@ -6499,12 +6396,12 @@ gdk_window_scroll (GdkWindow *window,
if (dx == 0 && dy == 0)
return;
- if (private->destroyed)
+ if (window->destroyed)
return;
gdk_window_flush_if_exposing (window);
- old_native_child_region = collect_native_child_region (private, FALSE);
+ old_native_child_region = collect_native_child_region (window, FALSE);
if (old_native_child_region)
{
/* Any native window move will immediately copy stuff to the destination, which may overwrite a
@@ -6513,39 +6410,38 @@ gdk_window_scroll (GdkWindow *window,
* of it. And we need to do this before setting the new clips as those will be
* affecting this.
*/
- gdk_window_flush_recursive (private);
+ gdk_window_flush_recursive (window);
}
/* First move all child windows, without causing invalidation */
- tmp_list = private->children;
+ tmp_list = window->children;
while (tmp_list)
{
GdkWindow *child = GDK_WINDOW (tmp_list->data);
- GdkWindowObject *child_obj = GDK_WINDOW_OBJECT (child);
/* Just update the positions, the bits will move with the copy */
- child_obj->x += dx;
- child_obj->y += dy;
+ child->x += dx;
+ child->y += dy;
tmp_list = tmp_list->next;
}
- recompute_visible_regions (private, FALSE, TRUE);
+ recompute_visible_regions (window, FALSE, TRUE);
new_native_child_region = NULL;
if (old_native_child_region)
- new_native_child_region = collect_native_child_region (private, FALSE);
+ new_native_child_region = collect_native_child_region (window, FALSE);
- move_native_children (private);
+ move_native_children (window);
/* Then copy the actual bits of the window w/ child windows */
- impl_window = gdk_window_get_impl_window (private);
+ impl_window = gdk_window_get_impl_window (window);
/* Calculate the area that can be gotten by copying the old area */
- copy_area = cairo_region_copy (private->clip_region);
+ copy_area = cairo_region_copy (window->clip_region);
if (old_native_child_region)
{
/* Don't copy from inside native children, as this is copied by
@@ -6558,14 +6454,14 @@ gdk_window_scroll (GdkWindow *window,
cairo_region_subtract (copy_area, new_native_child_region);
}
cairo_region_translate (copy_area, dx, dy);
- cairo_region_intersect (copy_area, private->clip_region);
+ cairo_region_intersect (copy_area, window->clip_region);
/* And the rest need to be invalidated */
- noncopy_area = cairo_region_copy (private->clip_region);
+ noncopy_area = cairo_region_copy (window->clip_region);
cairo_region_subtract (noncopy_area, copy_area);
/* convert from window coords to impl */
- cairo_region_translate (copy_area, private->abs_x, private->abs_y);
+ cairo_region_translate (copy_area, window->abs_x, window->abs_y);
move_region_on_impl (impl_window, copy_area, dx, dy); /* takes ownership of copy_area */
@@ -6611,8 +6507,7 @@ gdk_window_move_region (GdkWindow *window,
gint dx,
gint dy)
{
- GdkWindowObject *private = (GdkWindowObject *) window;
- GdkWindowObject *impl_window;
+ GdkWindow *impl_window;
cairo_region_t *nocopy_area;
cairo_region_t *copy_area;
@@ -6622,18 +6517,18 @@ gdk_window_move_region (GdkWindow *window,
if (dx == 0 && dy == 0)
return;
- if (private->destroyed)
+ if (window->destroyed)
return;
- impl_window = gdk_window_get_impl_window (private);
+ impl_window = gdk_window_get_impl_window (window);
/* compute source regions */
copy_area = cairo_region_copy (region);
- cairo_region_intersect (copy_area, private->clip_region_with_children);
+ cairo_region_intersect (copy_area, window->clip_region_with_children);
/* compute destination regions */
cairo_region_translate (copy_area, dx, dy);
- cairo_region_intersect (copy_area, private->clip_region_with_children);
+ cairo_region_intersect (copy_area, window->clip_region_with_children);
/* Invalidate parts of the region (source and dest) not covered
by the copy */
@@ -6643,7 +6538,7 @@ gdk_window_move_region (GdkWindow *window,
cairo_region_subtract (nocopy_area, copy_area);
/* convert from window coords to impl */
- cairo_region_translate (copy_area, private->abs_x, private->abs_y);
+ cairo_region_translate (copy_area, window->abs_x, window->abs_y);
move_region_on_impl (impl_window, copy_area, dx, dy); /* Takes ownership of copy_area */
gdk_window_invalidate_region_full (window, nocopy_area, FALSE, CLEAR_BG_ALL);
@@ -6722,23 +6617,19 @@ void
gdk_window_set_background_pattern (GdkWindow *window,
cairo_pattern_t *pattern)
{
- GdkWindowObject *private;
-
g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowObject *) window;
-
if (pattern)
cairo_pattern_reference (pattern);
- if (private->background)
- cairo_pattern_destroy (private->background);
- private->background = pattern;
+ if (window->background)
+ cairo_pattern_destroy (window->background);
+ window->background = pattern;
- if (gdk_window_has_impl (private) &&
- !private->input_only)
+ if (gdk_window_has_impl (window) &&
+ !window->input_only)
{
- GdkWindowImplIface *impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
- impl_iface->set_background (window, pattern);
+ GdkWindowImplClass *impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
+ impl_class->set_background (window, pattern);
}
}
@@ -6758,11 +6649,9 @@ gdk_window_set_background_pattern (GdkWindow *window,
cairo_pattern_t *
gdk_window_get_background_pattern (GdkWindow *window)
{
- GdkWindowObject *private = (GdkWindowObject *) window;
-
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
- return private->background;
+ return window->background;
}
static void
@@ -6772,12 +6661,11 @@ update_cursor_foreach (GdkDisplay *display,
gpointer user_data)
{
GdkWindow *window = user_data;
- GdkWindowObject *private = (GdkWindowObject *) window;
if (_gdk_native_windows ||
- private->window_type == GDK_WINDOW_ROOT ||
- private->window_type == GDK_WINDOW_FOREIGN)
- GDK_WINDOW_IMPL_GET_IFACE (private->impl)->set_device_cursor (window, device, private->cursor);
+ window->window_type == GDK_WINDOW_ROOT ||
+ window->window_type == GDK_WINDOW_FOREIGN)
+ GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_device_cursor (window, device, window->cursor);
else if (_gdk_window_event_parent_of (window, pointer_info->window_under_pointer))
update_cursor (display, device);
}
@@ -6800,13 +6688,9 @@ update_cursor_foreach (GdkDisplay *display,
GdkCursor *
gdk_window_get_cursor (GdkWindow *window)
{
- GdkWindowObject *private;
-
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
- private = (GdkWindowObject *) window;
-
- return private->cursor;
+ return window->cursor;
}
/**
@@ -6824,24 +6708,22 @@ void
gdk_window_set_cursor (GdkWindow *window,
GdkCursor *cursor)
{
- GdkWindowObject *private;
GdkDisplay *display;
g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowObject *) window;
display = gdk_window_get_display (window);
- if (private->cursor)
+ if (window->cursor)
{
- gdk_cursor_unref (private->cursor);
- private->cursor = NULL;
+ gdk_cursor_unref (window->cursor);
+ window->cursor = NULL;
}
if (!GDK_WINDOW_DESTROYED (window))
{
if (cursor)
- private->cursor = gdk_cursor_ref (cursor);
+ window->cursor = gdk_cursor_ref (cursor);
_gdk_display_pointer_info_foreach (display,
update_cursor_foreach,
@@ -6871,14 +6753,10 @@ GdkCursor *
gdk_window_get_device_cursor (GdkWindow *window,
GdkDevice *device)
{
- GdkWindowObject *private;
-
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
- private = (GdkWindowObject *) window;
-
- return g_hash_table_lookup (private->device_cursor, device);
+ return g_hash_table_lookup (window->device_cursor, device);
}
/**
@@ -6901,19 +6779,17 @@ gdk_window_set_device_cursor (GdkWindow *window,
GdkDevice *device,
GdkCursor *cursor)
{
- GdkWindowObject *private;
GdkDisplay *display;
g_return_if_fail (GDK_IS_WINDOW (window));
g_return_if_fail (GDK_IS_DEVICE (device));
- private = (GdkWindowObject *) window;
display = gdk_window_get_display (window);
if (!cursor)
- g_hash_table_remove (private->device_cursor, device);
+ g_hash_table_remove (window->device_cursor, device);
else
- g_hash_table_replace (private->device_cursor, device, gdk_cursor_ref (cursor));
+ g_hash_table_replace (window->device_cursor, device, gdk_cursor_ref (cursor));
if (!GDK_WINDOW_DESTROYED (window))
{
@@ -6929,11 +6805,11 @@ gdk_window_set_device_cursor (GdkWindow *window,
/**
* gdk_window_get_geometry:
* @window: a #GdkWindow
- * @x: return location for X coordinate of window (relative to its parent)
- * @y: return location for Y coordinate of window (relative to its parent)
- * @width: return location for width of window
- * @height: return location for height of window
- * @depth: return location for bit depth of window
+ * @x: (out) (allow-none): return location for X coordinate of window (relative to its parent)
+ * @y: (out) (allow-none): return location for Y coordinate of window (relative to its parent)
+ * @width: (out) (allow-none): return location for width of window
+ * @height: (out) (allow-none): return location for height of window
+ * @depth: (out) (allow-none): return location for bit depth of window
*
* Any of the return location arguments to this function may be %NULL,
* if you aren't interested in getting the value of that field.
@@ -6966,8 +6842,8 @@ gdk_window_get_geometry (GdkWindow *window,
gint *height,
gint *depth)
{
- GdkWindowObject *private, *parent;
- GdkWindowImplIface *impl_iface;
+ GdkWindow *parent;
+ GdkWindowImplClass *impl_class;
if (!window)
{
@@ -6979,19 +6855,17 @@ gdk_window_get_geometry (GdkWindow *window,
g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowObject *) window;
-
if (!GDK_WINDOW_DESTROYED (window))
{
- if (gdk_window_has_impl (private))
+ if (gdk_window_has_impl (window))
{
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
- impl_iface->get_geometry (window, x, y,
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
+ impl_class->get_geometry (window, x, y,
width, height,
depth);
/* This reports the position wrt to the native parent, we need to convert
it to be relative to the client side parent */
- parent = private->parent;
+ parent = window->parent;
if (parent && !gdk_window_has_impl (parent))
{
if (x)
@@ -7003,15 +6877,15 @@ gdk_window_get_geometry (GdkWindow *window,
else
{
if (x)
- *x = private->x;
+ *x = window->x;
if (y)
- *y = private->y;
+ *y = window->y;
if (width)
- *width = private->width;
+ *width = window->width;
if (height)
- *height = private->height;
+ *height = window->height;
if (depth)
- *depth = private->depth;
+ *depth = window->depth;
}
}
}
@@ -7033,13 +6907,9 @@ gdk_window_get_geometry (GdkWindow *window,
int
gdk_window_get_width (GdkWindow *window)
{
- GdkWindowObject *private;
-
g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
- private = (GdkWindowObject *) window;
-
- return private->width;
+ return window->width;
}
/**
@@ -7059,20 +6929,16 @@ gdk_window_get_width (GdkWindow *window)
int
gdk_window_get_height (GdkWindow *window)
{
- GdkWindowObject *private;
-
g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
- private = (GdkWindowObject *) window;
-
- return private->height;
+ return window->height;
}
/**
* gdk_window_get_origin:
* @window: a #GdkWindow
- * @x: return location for X coordinate
- * @y: return location for Y coordinate
+ * @x: (out) (allow-none): return location for X coordinate
+ * @y: (out) (allow-none): return location for Y coordinate
*
* Obtains the position of a window in root window coordinates.
* (Compare with gdk_window_get_position() and
@@ -7086,8 +6952,7 @@ gdk_window_get_origin (GdkWindow *window,
gint *x,
gint *y)
{
- GdkWindowObject *private;
- GdkWindowImplIface *impl_iface;
+ GdkWindowImplClass *impl_class;
g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
@@ -7099,13 +6964,11 @@ gdk_window_get_origin (GdkWindow *window,
*y = 0;
return 0;
}
-
- private = (GdkWindowObject *) window;
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
- impl_iface->get_root_coords (window,
- private->abs_x,
- private->abs_y,
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
+ impl_class->get_root_coords (window,
+ window->abs_x,
+ window->abs_y,
x, y);
return TRUE;
@@ -7133,13 +6996,10 @@ gdk_window_get_root_coords (GdkWindow *window,
gint *root_x,
gint *root_y)
{
- GdkWindowObject *private;
- GdkWindowImplIface *impl_iface;
+ GdkWindowImplClass *impl_class;
g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowObject *) window;
-
if (GDK_WINDOW_DESTROYED (window))
{
if (x)
@@ -7149,10 +7009,10 @@ gdk_window_get_root_coords (GdkWindow *window,
return;
}
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
- impl_iface->get_root_coords (window,
- x + private->abs_x,
- y + private->abs_y,
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
+ impl_class->get_root_coords (window,
+ x + window->abs_x,
+ y + window->abs_y,
root_x, root_y);
}
@@ -7192,17 +7052,13 @@ gdk_window_coords_to_parent (GdkWindow *window,
gdouble *parent_x,
gdouble *parent_y)
{
- GdkWindowObject *obj;
-
g_return_if_fail (GDK_IS_WINDOW (window));
- obj = (GdkWindowObject *) window;
-
- if (gdk_window_is_offscreen (obj))
+ if (gdk_window_is_offscreen (window))
{
gdouble px, py;
- to_embedder (obj, x, y, &px, &py);
+ to_embedder (window, x, y, &px, &py);
if (parent_x)
*parent_x = px;
@@ -7213,10 +7069,10 @@ gdk_window_coords_to_parent (GdkWindow *window,
else
{
if (parent_x)
- *parent_x = x + obj->x;
+ *parent_x = x + window->x;
if (parent_y)
- *parent_y = y + obj->y;
+ *parent_y = y + window->y;
}
}
@@ -7254,17 +7110,13 @@ gdk_window_coords_from_parent (GdkWindow *window,
gdouble *x,
gdouble *y)
{
- GdkWindowObject *obj;
-
g_return_if_fail (GDK_IS_WINDOW (window));
- obj = (GdkWindowObject *) window;
-
- if (gdk_window_is_offscreen (obj))
+ if (gdk_window_is_offscreen (window))
{
gdouble cx, cy;
- from_embedder (obj, parent_x, parent_y, &cx, &cy);
+ from_embedder (window, parent_x, parent_y, &cx, &cy);
if (x)
*x = cx;
@@ -7275,10 +7127,10 @@ gdk_window_coords_from_parent (GdkWindow *window,
else
{
if (x)
- *x = parent_x - obj->x;
+ *x = parent_x - window->x;
if (y)
- *y = parent_y - obj->y;
+ *y = parent_y - window->y;
}
}
@@ -7310,42 +7162,39 @@ gdk_window_shape_combine_region (GdkWindow *window,
gint offset_x,
gint offset_y)
{
- GdkWindowObject *private;
cairo_region_t *old_region, *new_region, *diff;
g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowObject *) window;
-
if (GDK_WINDOW_DESTROYED (window))
return;
- private->shaped = (shape_region != NULL);
+ window->shaped = (shape_region != NULL);
- if (private->shape)
- cairo_region_destroy (private->shape);
+ if (window->shape)
+ cairo_region_destroy (window->shape);
old_region = NULL;
if (GDK_WINDOW_IS_MAPPED (window))
- old_region = cairo_region_copy (private->clip_region);
+ old_region = cairo_region_copy (window->clip_region);
if (shape_region)
{
- private->shape = cairo_region_copy (shape_region);
- cairo_region_translate (private->shape, offset_x, offset_y);
+ window->shape = cairo_region_copy (shape_region);
+ cairo_region_translate (window->shape, offset_x, offset_y);
}
else
- private->shape = NULL;
+ window->shape = NULL;
- recompute_visible_regions (private, TRUE, FALSE);
+ recompute_visible_regions (window, TRUE, FALSE);
- if (gdk_window_has_impl (private) &&
- !should_apply_clip_as_shape (private))
- apply_shape (private, private->shape);
+ if (gdk_window_has_impl (window) &&
+ !should_apply_clip_as_shape (window))
+ apply_shape (window, window->shape);
if (old_region)
{
- new_region = cairo_region_copy (private->clip_region);
+ new_region = cairo_region_copy (window->clip_region);
/* New area in the window, needs invalidation */
diff = cairo_region_copy (new_region);
@@ -7355,16 +7204,16 @@ gdk_window_shape_combine_region (GdkWindow *window,
cairo_region_destroy (diff);
- if (!gdk_window_is_toplevel (private))
+ if (!gdk_window_is_toplevel (window))
{
/* New area in the non-root parent window, needs invalidation */
diff = cairo_region_copy (old_region);
cairo_region_subtract (diff, new_region);
/* Adjust region to parent window coords */
- cairo_region_translate (diff, private->x, private->y);
+ cairo_region_translate (diff, window->x, window->y);
- gdk_window_invalidate_region_full (GDK_WINDOW (private->parent), diff, TRUE, CLEAR_BG_ALL);
+ gdk_window_invalidate_region_full (window->parent, diff, TRUE, CLEAR_BG_ALL);
cairo_region_destroy (diff);
}
@@ -7378,22 +7227,19 @@ static void
do_child_shapes (GdkWindow *window,
gboolean merge)
{
- GdkWindowObject *private;
GdkRectangle r;
cairo_region_t *region;
- private = (GdkWindowObject *) window;
-
r.x = 0;
r.y = 0;
- r.width = private->width;
- r.height = private->height;
+ r.width = window->width;
+ r.height = window->height;
region = cairo_region_create_rectangle (&r);
- remove_child_area (private, NULL, FALSE, region);
+ remove_child_area (window, NULL, FALSE, region);
- if (merge && private->shape)
- cairo_region_subtract (region, private->shape);
+ if (merge && window->shape)
+ cairo_region_subtract (region, window->shape);
gdk_window_shape_combine_region (window, region, 0, 0);
}
@@ -7468,31 +7314,28 @@ gdk_window_input_shape_combine_region (GdkWindow *window,
gint offset_x,
gint offset_y)
{
- GdkWindowObject *private;
- GdkWindowImplIface *impl_iface;
+ GdkWindowImplClass *impl_class;
g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowObject *) window;
-
if (GDK_WINDOW_DESTROYED (window))
return;
- if (private->input_shape)
- cairo_region_destroy (private->input_shape);
+ if (window->input_shape)
+ cairo_region_destroy (window->input_shape);
if (shape_region)
{
- private->input_shape = cairo_region_copy (shape_region);
- cairo_region_translate (private->input_shape, offset_x, offset_y);
+ window->input_shape = cairo_region_copy (shape_region);
+ cairo_region_translate (window->input_shape, offset_x, offset_y);
}
else
- private->input_shape = NULL;
+ window->input_shape = NULL;
- if (gdk_window_has_impl (private))
+ if (gdk_window_has_impl (window))
{
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
- impl_iface->input_shape_combine_region (window, private->input_shape, 0, 0);
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
+ impl_class->input_shape_combine_region (window, window->input_shape, 0, 0);
}
/* Pointer may have e.g. moved outside window due to the input mask change */
@@ -7503,24 +7346,21 @@ static void
do_child_input_shapes (GdkWindow *window,
gboolean merge)
{
- GdkWindowObject *private;
GdkRectangle r;
cairo_region_t *region;
- private = (GdkWindowObject *) window;
-
r.x = 0;
r.y = 0;
- r.width = private->width;
- r.height = private->height;
+ r.width = window->width;
+ r.height = window->height;
region = cairo_region_create_rectangle (&r);
- remove_child_area (private, NULL, TRUE, region);
+ remove_child_area (window, NULL, TRUE, region);
- if (merge && private->shape)
- cairo_region_subtract (region, private->shape);
- if (merge && private->input_shape)
- cairo_region_subtract (region, private->input_shape);
+ if (merge && window->shape)
+ cairo_region_subtract (region, window->shape);
+ if (merge && window->input_shape)
+ cairo_region_subtract (region, window->input_shape);
gdk_window_input_shape_combine_region (window, region, 0, 0);
}
@@ -7585,17 +7425,14 @@ gboolean
gdk_window_set_static_gravities (GdkWindow *window,
gboolean use_static)
{
- GdkWindowObject *private;
- GdkWindowImplIface *impl_iface;
+ GdkWindowImplClass *impl_class;
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
- private = (GdkWindowObject *) window;
-
- if (gdk_window_has_impl (private))
+ if (gdk_window_has_impl (window))
{
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
- return impl_iface->set_static_gravities (window, use_static);
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
+ return impl_class->set_static_gravities (window, use_static);
}
return FALSE;
@@ -7616,13 +7453,9 @@ gdk_window_set_static_gravities (GdkWindow *window,
gboolean
gdk_window_get_composited (GdkWindow *window)
{
- GdkWindowObject *private;
-
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
- private = (GdkWindowObject *)window;
-
- return private->composited;
+ return window->composited;
}
/**
@@ -7660,14 +7493,13 @@ void
gdk_window_set_composited (GdkWindow *window,
gboolean composited)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
GdkDisplay *display;
g_return_if_fail (GDK_IS_WINDOW (window));
composited = composited != FALSE;
- if (private->composited == composited)
+ if (window->composited == composited)
return;
if (composited)
@@ -7684,12 +7516,12 @@ gdk_window_set_composited (GdkWindow *window,
_gdk_windowing_window_set_composited (window, composited);
- recompute_visible_regions (private, TRUE, FALSE);
+ recompute_visible_regions (window, TRUE, FALSE);
if (GDK_WINDOW_IS_MAPPED (window))
- gdk_window_invalidate_in_parent (private);
+ gdk_window_invalidate_in_parent (window);
- private->composited = composited;
+ window->composited = composited;
}
/**
@@ -7706,13 +7538,9 @@ gdk_window_set_composited (GdkWindow *window,
gboolean
gdk_window_get_modal_hint (GdkWindow *window)
{
- GdkWindowObject *private;
-
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
- private = (GdkWindowObject*) window;
-
- return private->modal_hint;
+ return window->modal_hint;
}
/**
@@ -7729,13 +7557,9 @@ gdk_window_get_modal_hint (GdkWindow *window)
gboolean
gdk_window_get_accept_focus (GdkWindow *window)
{
- GdkWindowObject *private;
-
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
- private = (GdkWindowObject *)window;
-
- return private->accept_focus;
+ return window->accept_focus;
}
/**
@@ -7753,13 +7577,9 @@ gdk_window_get_accept_focus (GdkWindow *window)
gboolean
gdk_window_get_focus_on_map (GdkWindow *window)
{
- GdkWindowObject *private;
-
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
- private = (GdkWindowObject *)window;
-
- return private->focus_on_map;
+ return window->focus_on_map;
}
/**
@@ -7775,13 +7595,9 @@ gdk_window_get_focus_on_map (GdkWindow *window)
gboolean
gdk_window_is_input_only (GdkWindow *window)
{
- GdkWindowObject *private;
-
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
- private = (GdkWindowObject *)window;
-
- return private->input_only;
+ return window->input_only;
}
/**
@@ -7797,24 +7613,18 @@ gdk_window_is_input_only (GdkWindow *window)
gboolean
gdk_window_is_shaped (GdkWindow *window)
{
- GdkWindowObject *private;
-
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
- private = (GdkWindowObject *)window;
-
- return private->shaped;
+ return window->shaped;
}
static void
window_get_size_rectangle (GdkWindow *window,
GdkRectangle *rect)
{
- GdkWindowObject *private = (GdkWindowObject *) window;
-
rect->x = rect->y = 0;
- rect->width = private->width;
- rect->height = private->height;
+ rect->width = window->width;
+ rect->height = window->height;
}
/* Calculates the real clipping region for a window, in window coordinates,
@@ -7827,18 +7637,17 @@ _gdk_window_calculate_full_clip_region (GdkWindow *window,
gint *base_x_offset,
gint *base_y_offset)
{
- GdkWindowObject *private = GDK_WINDOW_OBJECT (window);
GdkRectangle visible_rect;
cairo_region_t *real_clip_region;
gint x_offset, y_offset;
- GdkWindowObject *parentwin, *lastwin;
+ GdkWindow *parentwin, *lastwin;
if (base_x_offset)
*base_x_offset = 0;
if (base_y_offset)
*base_y_offset = 0;
- if (!private->viewable || private->input_only)
+ if (!window->viewable || window->input_only)
return cairo_region_create ();
window_get_size_rectangle (window, &visible_rect);
@@ -7848,7 +7657,7 @@ _gdk_window_calculate_full_clip_region (GdkWindow *window,
x_offset = y_offset = 0;
- lastwin = private;
+ lastwin = window;
if (do_children)
parentwin = lastwin;
else
@@ -7856,16 +7665,16 @@ _gdk_window_calculate_full_clip_region (GdkWindow *window,
/* Remove the areas of all overlapping windows above parentwin in the hiearachy */
for (; parentwin != NULL &&
- (parentwin == private || lastwin != (GdkWindowObject*) base_window);
+ (parentwin == window || lastwin != base_window);
lastwin = parentwin, parentwin = lastwin->parent)
{
GList *cur;
GdkRectangle real_clip_rect;
- if (parentwin != private)
+ if (parentwin != window)
{
- x_offset += GDK_WINDOW_OBJECT (lastwin)->x;
- y_offset += GDK_WINDOW_OBJECT (lastwin)->y;
+ x_offset += lastwin->x;
+ y_offset += lastwin->y;
}
/* children is ordered in reverse stack order */
@@ -7874,21 +7683,20 @@ _gdk_window_calculate_full_clip_region (GdkWindow *window,
cur = cur->next)
{
GdkWindow *child = cur->data;
- GdkWindowObject *child_private = (GdkWindowObject *)child;
- if (!GDK_WINDOW_IS_MAPPED (child) || child_private->input_only)
+ if (!GDK_WINDOW_IS_MAPPED (child) || child->input_only)
continue;
/* Ignore offscreen children, as they don't draw in their parent and
* don't take part in the clipping */
- if (gdk_window_is_offscreen (child_private))
+ if (gdk_window_is_offscreen (child))
continue;
window_get_size_rectangle (child, &visible_rect);
/* Convert rect to "window" coords */
- visible_rect.x += child_private->x - x_offset;
- visible_rect.y += child_private->y - y_offset;
+ visible_rect.x += child->x - x_offset;
+ visible_rect.y += child->y - y_offset;
/* This shortcut is really necessary for performance when there are a lot of windows */
cairo_region_get_extents (real_clip_region, &real_clip_rect);
@@ -7935,11 +7743,11 @@ _gdk_window_add_damage (GdkWindow *toplevel,
/* Gets the toplevel for a window as used for events,
i.e. including offscreen parents */
-static GdkWindowObject *
-get_event_parent (GdkWindowObject *window)
+static GdkWindow *
+get_event_parent (GdkWindow *window)
{
if (gdk_window_is_offscreen (window))
- return (GdkWindowObject *)gdk_offscreen_window_get_embedder ((GdkWindow *)window);
+ return gdk_offscreen_window_get_embedder ((GdkWindow *)window);
else
return window->parent;
}
@@ -7948,16 +7756,15 @@ get_event_parent (GdkWindowObject *window)
i.e. including offscreen parents going up to the native
toplevel */
static GdkWindow *
-get_event_toplevel (GdkWindow *w)
+get_event_toplevel (GdkWindow *window)
{
- GdkWindowObject *private = GDK_WINDOW_OBJECT (w);
- GdkWindowObject *parent;
+ GdkWindow *parent;
- while ((parent = get_event_parent (private)) != NULL &&
+ while ((parent = get_event_parent (window)) != NULL &&
(parent->window_type != GDK_WINDOW_ROOT))
- private = parent;
+ window = parent;
- return GDK_WINDOW (private);
+ return window;
}
gboolean
@@ -7972,7 +7779,7 @@ _gdk_window_event_parent_of (GdkWindow *parent,
if (w == parent)
return TRUE;
- w = (GdkWindow *)get_event_parent ((GdkWindowObject *)w);
+ w = get_event_parent (w);
}
return FALSE;
@@ -7982,9 +7789,9 @@ static void
update_cursor (GdkDisplay *display,
GdkDevice *device)
{
- GdkWindowObject *cursor_window, *parent, *toplevel;
+ GdkWindow *cursor_window, *parent, *toplevel;
GdkWindow *pointer_window;
- GdkWindowImplIface *impl_iface;
+ GdkWindowImplClass *impl_class;
GdkPointerWindowInfo *pointer_info;
GdkDeviceGrabInfo *grab;
GdkCursor *cursor;
@@ -8001,12 +7808,12 @@ update_cursor (GdkDisplay *display,
!_gdk_window_event_parent_of (grab->window, pointer_window))
{
/* use the cursor from the grab window */
- cursor_window = (GdkWindowObject *) grab->window;
+ cursor_window = grab->window;
}
else
{
/* otherwise use the cursor from the pointer window */
- cursor_window = (GdkWindowObject *) pointer_window;
+ cursor_window = pointer_window;
}
/* Find the first window with the cursor actually set, as
@@ -8023,15 +7830,15 @@ update_cursor (GdkDisplay *display,
/* Set all cursors on toplevel, otherwise its tricky to keep track of
* which native window has what cursor set. */
- toplevel = (GdkWindowObject *) get_event_toplevel (pointer_window);
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (toplevel->impl);
- impl_iface->set_device_cursor ((GdkWindow *) toplevel, device, cursor);
+ toplevel = get_event_toplevel (pointer_window);
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (toplevel->impl);
+ impl_class->set_device_cursor (toplevel, device, cursor);
}
static gboolean
-point_in_window (GdkWindowObject *window,
- gdouble x,
- gdouble y)
+point_in_window (GdkWindow *window,
+ gdouble x,
+ gdouble y)
{
return
x >= 0 && x < window->width &&
@@ -8051,23 +7858,22 @@ convert_native_coords_to_toplevel (GdkWindow *window,
gdouble *toplevel_x,
gdouble *toplevel_y)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
gdouble x, y;
x = child_x;
y = child_y;
- while (!gdk_window_is_toplevel (private))
+ while (!gdk_window_is_toplevel (window))
{
- x += private->x;
- y += private->y;
- private = private->parent;
+ x += window->x;
+ y += window->y;
+ window = window->parent;
}
*toplevel_x = x;
*toplevel_y = y;
- return (GdkWindow *)private;
+ return window;
}
static void
@@ -8077,22 +7883,19 @@ convert_toplevel_coords_to_window (GdkWindow *window,
gdouble *window_x,
gdouble *window_y)
{
- GdkWindowObject *private;
- GdkWindowObject *parent;
+ GdkWindow *parent;
gdouble x, y;
GList *children, *l;
- private = GDK_WINDOW_OBJECT (window);
-
x = toplevel_x;
y = toplevel_y;
children = NULL;
- while ((parent = get_event_parent (private)) != NULL &&
+ while ((parent = get_event_parent (window)) != NULL &&
(parent->window_type != GDK_WINDOW_ROOT))
{
- children = g_list_prepend (children, private);
- private = parent;
+ children = g_list_prepend (children, window);
+ window = parent;
}
for (l = children; l != NULL; l = l->next)
@@ -8104,12 +7907,12 @@ convert_toplevel_coords_to_window (GdkWindow *window,
*window_y = y;
}
-static GdkWindowObject *
-pick_embedded_child (GdkWindowObject *window,
- gdouble x,
- gdouble y)
+static GdkWindow *
+pick_embedded_child (GdkWindow *window,
+ gdouble x,
+ gdouble y)
{
- GdkWindowObject *res;
+ GdkWindow *res;
res = NULL;
g_signal_emit (window,
@@ -8124,16 +7927,14 @@ _gdk_window_find_child_at (GdkWindow *window,
int x,
int y)
{
- GdkWindowObject *private, *sub;
+ GdkWindow *sub;
double child_x, child_y;
GList *l;
- private = (GdkWindowObject *)window;
-
- if (point_in_window (private, x, y))
+ if (point_in_window (window, x, y))
{
/* Children is ordered in reverse stack order, i.e. first is topmost */
- for (l = private->children; l != NULL; l = l->next)
+ for (l = window->children; l != NULL; l = l->next)
{
sub = l->data;
@@ -8147,9 +7948,9 @@ _gdk_window_find_child_at (GdkWindow *window,
return (GdkWindow *)sub;
}
- if (private->num_offscreen_children > 0)
+ if (window->num_offscreen_children > 0)
{
- sub = pick_embedded_child (private,
+ sub = pick_embedded_child (window,
x, y);
if (sub)
return (GdkWindow *)sub;
@@ -8160,26 +7961,24 @@ _gdk_window_find_child_at (GdkWindow *window,
}
GdkWindow *
-_gdk_window_find_descendant_at (GdkWindow *toplevel,
+_gdk_window_find_descendant_at (GdkWindow *window,
gdouble x,
gdouble y,
gdouble *found_x,
gdouble *found_y)
{
- GdkWindowObject *private, *sub;
+ GdkWindow *sub;
gdouble child_x, child_y;
GList *l;
gboolean found;
- private = (GdkWindowObject *)toplevel;
-
- if (point_in_window (private, x, y))
+ if (point_in_window (window, x, y))
{
do
{
found = FALSE;
/* Children is ordered in reverse stack order, i.e. first is topmost */
- for (l = private->children; l != NULL; l = l->next)
+ for (l = window->children; l != NULL; l = l->next)
{
sub = l->data;
@@ -8193,20 +7992,20 @@ _gdk_window_find_descendant_at (GdkWindow *toplevel,
{
x = child_x;
y = child_y;
- private = sub;
+ window = sub;
found = TRUE;
break;
}
}
if (!found &&
- private->num_offscreen_children > 0)
+ window->num_offscreen_children > 0)
{
- sub = pick_embedded_child (private,
+ sub = pick_embedded_child (window,
x, y);
if (sub)
{
found = TRUE;
- private = sub;
+ window = sub;
from_embedder (sub, x, y, &x, &y);
}
}
@@ -8216,7 +8015,7 @@ _gdk_window_find_descendant_at (GdkWindow *toplevel,
else
{
/* Not in window at all */
- private = NULL;
+ window = NULL;
}
if (found_x)
@@ -8224,7 +8023,7 @@ _gdk_window_find_descendant_at (GdkWindow *toplevel,
if (found_y)
*found_y = y;
- return (GdkWindow *)private;
+ return window;
}
/**
@@ -8251,10 +8050,14 @@ gdk_window_beep (GdkWindow *window)
toplevel = get_event_toplevel (window);
display = gdk_window_get_display (window);
- if (toplevel && !gdk_window_is_offscreen ((GdkWindowObject *)toplevel))
- _gdk_windowing_window_beep (toplevel);
- else
- gdk_display_beep (display);
+ if (toplevel)
+ {
+ if (GDK_WINDOW_IMPL_CLASS (toplevel)->beep (window))
+ return;
+ }
+
+ /* If windows fail to beep, we beep the display. */
+ gdk_display_beep (display);
}
/**
@@ -8273,17 +8076,15 @@ void
gdk_window_set_support_multidevice (GdkWindow *window,
gboolean support_multidevice)
{
- GdkWindowObject *private = (GdkWindowObject *) window;
-
g_return_if_fail (GDK_IS_WINDOW (window));
if (GDK_WINDOW_DESTROYED (window))
return;
- if (private->support_multidevice == support_multidevice)
+ if (window->support_multidevice == support_multidevice)
return;
- private->support_multidevice = support_multidevice;
+ window->support_multidevice = support_multidevice;
/* FIXME: What to do if called when some pointers are inside the window ? */
}
@@ -8302,14 +8103,12 @@ gdk_window_set_support_multidevice (GdkWindow *window,
gboolean
gdk_window_get_support_multidevice (GdkWindow *window)
{
- GdkWindowObject *private = (GdkWindowObject *) window;
-
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
if (GDK_WINDOW_DESTROYED (window))
return FALSE;
- return private->support_multidevice;
+ return window->support_multidevice;
}
static const guint type_masks[] = {
@@ -8392,11 +8191,11 @@ is_motion_type (GdkEventType type)
type == GDK_LEAVE_NOTIFY;
}
-static GdkWindowObject *
-find_common_ancestor (GdkWindowObject *win1,
- GdkWindowObject *win2)
+static GdkWindow *
+find_common_ancestor (GdkWindow *win1,
+ GdkWindow *win2)
{
- GdkWindowObject *tmp;
+ GdkWindow *tmp;
GList *path1 = NULL, *path2 = NULL;
GList *list1, *list2;
@@ -8419,7 +8218,7 @@ find_common_ancestor (GdkWindowObject *win1,
tmp = NULL;
while (list1 && list2 && (list1->data == list2->data))
{
- tmp = (GdkWindowObject *)list1->data;
+ tmp = list1->data;
list1 = g_list_next (list1);
list2 = g_list_next (list2);
}
@@ -8512,7 +8311,6 @@ _gdk_make_event (GdkWindow *window,
case GDK_UNMAP:
case GDK_CLIENT_EVENT:
case GDK_VISIBILITY_NOTIFY:
- case GDK_NO_EXPOSE:
case GDK_DELETE:
case GDK_DESTROY:
case GDK_EXPOSE:
@@ -8535,8 +8333,8 @@ _gdk_make_event (GdkWindow *window,
static void
send_crossing_event (GdkDisplay *display,
- GdkWindowObject *toplevel,
- GdkWindowObject *window,
+ GdkWindow *toplevel,
+ GdkWindow *window,
GdkEventType type,
GdkCrossingMode mode,
GdkNotifyType notify_type,
@@ -8637,19 +8435,19 @@ _gdk_synthesize_crossing_events (GdkDisplay *display,
gulong serial,
gboolean non_linear)
{
- GdkWindowObject *c;
- GdkWindowObject *win, *last, *next;
+ GdkWindow *c;
+ GdkWindow *win, *last, *next;
GList *path, *list;
- GdkWindowObject *a;
- GdkWindowObject *b;
- GdkWindowObject *toplevel;
+ GdkWindow *a;
+ GdkWindow *b;
+ GdkWindow *toplevel;
GdkNotifyType notify_type;
/* TODO: Don't send events to toplevel, as we get those from the windowing system */
- a = (GdkWindowObject *)src;
- b = (GdkWindowObject *)dest;
- if (a == b)
+ a = src;
+ b = dest;
+ if (src == dest)
return; /* No crossings generated between src and dest */
if (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_MASTER)
@@ -8670,7 +8468,7 @@ _gdk_synthesize_crossing_events (GdkDisplay *display,
if (a) /* There might not be a source (i.e. if no previous pointer_in_window) */
{
- toplevel = (GdkWindowObject *)gdk_window_get_toplevel ((GdkWindow *)a);
+ toplevel = gdk_window_get_toplevel (a);
/* Traverse up from a to (excluding) c sending leave events */
if (non_linear)
@@ -8719,7 +8517,7 @@ _gdk_synthesize_crossing_events (GdkDisplay *display,
if (b) /* Might not be a dest, e.g. if we're moving out of the window */
{
- toplevel = (GdkWindowObject *)gdk_window_get_toplevel ((GdkWindow *)b);
+ toplevel = gdk_window_get_toplevel ((GdkWindow *)b);
/* Traverse down from c to b */
if (c != b)
@@ -8740,10 +8538,10 @@ _gdk_synthesize_crossing_events (GdkDisplay *display,
list = path;
while (list)
{
- win = (GdkWindowObject *)list->data;
+ win = list->data;
list = g_list_next (list);
if (list)
- next = (GdkWindowObject *)list->data;
+ next = list->data;
else
next = b;
@@ -8931,7 +8729,7 @@ gdk_pointer_grab (GdkWindow * window,
native = window;
else
native = gdk_window_get_toplevel (window);
- while (gdk_window_is_offscreen ((GdkWindowObject *)native))
+ while (gdk_window_is_offscreen (native))
{
native = gdk_offscreen_window_get_embedder (native);
@@ -9036,7 +8834,7 @@ gdk_keyboard_grab (GdkWindow *window,
else
native = gdk_window_get_toplevel (window);
- while (gdk_window_is_offscreen ((GdkWindowObject *)native))
+ while (gdk_window_is_offscreen (native))
{
native = gdk_offscreen_window_get_embedder (native);
@@ -9112,15 +8910,13 @@ do_synthesize_crossing_event (gpointer data)
{
GdkDisplay *display;
GdkWindow *changed_toplevel;
- GdkWindowObject *changed_toplevel_priv;
GHashTableIter iter;
gpointer key, value;
gulong serial;
changed_toplevel = data;
- changed_toplevel_priv = (GdkWindowObject *)changed_toplevel;
- changed_toplevel_priv->synthesize_crossing_event_queued = FALSE;
+ changed_toplevel->synthesize_crossing_event_queued = FALSE;
if (GDK_WINDOW_DESTROYED (changed_toplevel))
return FALSE;
@@ -9170,7 +8966,6 @@ _gdk_synthesize_crossing_events_for_geometry_change (GdkWindow *changed_window)
{
GdkDisplay *display;
GdkWindow *toplevel;
- GdkWindowObject *toplevel_priv;
if (_gdk_native_windows)
return; /* We use the native crossing events if all native */
@@ -9178,11 +8973,10 @@ _gdk_synthesize_crossing_events_for_geometry_change (GdkWindow *changed_window)
display = gdk_window_get_display (changed_window);
toplevel = get_event_toplevel (changed_window);
- toplevel_priv = (GdkWindowObject *) toplevel;
- if (!toplevel_priv->synthesize_crossing_event_queued)
+ if (!toplevel->synthesize_crossing_event_queued)
{
- toplevel_priv->synthesize_crossing_event_queued = TRUE;
+ toplevel->synthesize_crossing_event_queued = TRUE;
gdk_threads_add_idle_full (GDK_PRIORITY_EVENTS - 1,
do_synthesize_crossing_event,
@@ -9203,7 +8997,6 @@ get_event_window (GdkDisplay *display,
{
guint evmask;
GdkWindow *grab_window;
- GdkWindowObject *w;
GdkDeviceGrabInfo *grab;
grab = _gdk_display_has_device_grab (display, device, serial);
@@ -9225,20 +9018,19 @@ get_event_window (GdkDisplay *display,
return NULL;
}
- w = (GdkWindowObject *)pointer_window;
- while (w != NULL)
+ while (pointer_window != NULL)
{
- evmask = w->event_mask;
+ evmask = pointer_window->event_mask;
evmask = update_evmask_for_button_motion (evmask, mask);
if (evmask & type_masks[type])
{
if (evmask_out)
*evmask_out = evmask;
- return (GdkWindow *)w;
+ return pointer_window;
}
- w = get_event_parent (w);
+ pointer_window = get_event_parent (pointer_window);
}
if (grab != NULL &&
@@ -9323,8 +9115,8 @@ proxy_pointer_event (GdkDisplay *display,
/* Send subwindow == NULL event */
send_crossing_event (display,
- (GdkWindowObject *)toplevel_window,
- (GdkWindowObject *)event_window,
+ toplevel_window,
+ event_window,
source_event->type,
source_event->crossing.mode,
source_event->crossing.detail,
@@ -9353,8 +9145,8 @@ proxy_pointer_event (GdkDisplay *display,
/* Send subwindow == NULL event */
send_crossing_event (display,
- (GdkWindowObject *)toplevel_window,
- (GdkWindowObject *)event_window,
+ toplevel_window,
+ event_window,
source_event->type,
source_event->crossing.mode,
source_event->crossing.detail,
@@ -9470,14 +9262,14 @@ proxy_button_event (GdkEvent *source_event,
GdkWindow *toplevel_window, *event_window;
GdkWindow *event_win;
GdkWindow *pointer_window;
- GdkWindowObject *parent;
+ GdkWindow *parent;
GdkEvent *event;
guint state;
guint32 time_;
GdkEventType type;
gdouble toplevel_x, toplevel_y;
GdkDisplay *display;
- GdkWindowObject *w;
+ GdkWindow *w;
GdkDevice *device;
type = source_event->any.type;
@@ -9501,7 +9293,7 @@ proxy_button_event (GdkEvent *source_event,
NULL, NULL);
/* Find the event window, that gets the grab */
- w = (GdkWindowObject *)pointer_window;
+ w = pointer_window;
while (w != NULL &&
(parent = get_event_parent (w)) != NULL &&
parent->window_type != GDK_WINDOW_ROOT)
@@ -9583,7 +9375,7 @@ proxy_button_event (GdkEvent *source_event,
#ifdef DEBUG_WINDOW_PRINTING
static void
-gdk_window_print (GdkWindowObject *window,
+gdk_window_print (GdkWindow *window,
int indent)
{
GdkRectangle r;
@@ -9606,7 +9398,7 @@ gdk_window_print (GdkWindowObject *window,
if (gdk_window_has_impl (window))
{
#ifdef GDK_WINDOWING_X11
- g_print (" impl(0x%lx)", gdk_x11_drawable_get_xid (GDK_DRAWABLE (window)));
+ g_print (" impl(0x%lx)", gdk_x11_window_get_xid (window));
#endif
}
@@ -9640,17 +9432,14 @@ gdk_window_print_tree (GdkWindow *window,
int indent,
gboolean include_input_only)
{
- GdkWindowObject *private;
GList *l;
- private = (GdkWindowObject *)window;
-
- if (private->input_only && !include_input_only)
+ if (window->input_only && !include_input_only)
return;
- gdk_window_print (private, indent);
+ gdk_window_print (window, indent);
- for (l = private->children; l != NULL; l = l->next)
+ for (l = window->children; l != NULL; l = l->next)
gdk_window_print_tree (l->data, indent + 4, include_input_only);
}
@@ -9663,7 +9452,6 @@ _gdk_windowing_got_event (GdkDisplay *display,
gulong serial)
{
GdkWindow *event_window;
- GdkWindowObject *event_private;
gdouble x, y;
gboolean unlink_event;
guint old_state, old_button;
@@ -9700,7 +9488,6 @@ _gdk_windowing_got_event (GdkDisplay *display,
return;
pointer_info = _gdk_display_get_pointer_info (display, device);
- event_private = GDK_WINDOW_OBJECT (event_window);
#ifdef DEBUG_WINDOW_PRINTING
if (event->type == GDK_KEY_PRESS &&
@@ -9753,18 +9540,18 @@ _gdk_windowing_got_event (GdkDisplay *display,
if (event->type == GDK_VISIBILITY_NOTIFY)
{
- event_private->native_visibility = event->visibility.state;
- gdk_window_update_visibility_recursively (event_private,
- event_private);
+ event_window->native_visibility = event->visibility.state;
+ gdk_window_update_visibility_recursively (event_window,
+ event_window);
return;
}
if (!(is_button_type (event->type) ||
is_motion_type (event->type)) ||
- event_private->window_type == GDK_WINDOW_ROOT)
+ event_window->window_type == GDK_WINDOW_ROOT)
return;
- is_toplevel = gdk_window_is_toplevel (event_private);
+ is_toplevel = gdk_window_is_toplevel (event_window);
if ((event->type == GDK_ENTER_NOTIFY ||
event->type == GDK_LEAVE_NOTIFY) &&
@@ -9884,8 +9671,7 @@ get_extension_event_window (GdkDisplay *display,
gulong serial)
{
guint evmask;
- GdkWindow *grab_window;
- GdkWindowObject *w;
+ GdkWindow *w, *grab_window;
GdkDeviceGrabInfo *grab;
/* FIXME: which device? */
@@ -9903,13 +9689,13 @@ get_extension_event_window (GdkDisplay *display,
return NULL;
}
- w = (GdkWindowObject *)pointer_window;
+ w = pointer_window;
while (w != NULL)
{
evmask = w->extension_events;
if (evmask & type_masks[type])
- return (GdkWindow *)w;
+ return w;
w = get_event_parent (w);
}
@@ -9996,7 +9782,7 @@ gdk_window_create_similar_surface (GdkWindow * window,
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
- window_surface = _gdk_drawable_ref_cairo_surface (window);
+ window_surface = _gdk_window_ref_cairo_surface (window);
surface = cairo_surface_create_similar (window_surface,
content,
diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h
index 8a2fd4ba0e..936e69af20 100644
--- a/gdk/gdkwindow.h
+++ b/gdk/gdkwindow.h
@@ -31,7 +31,6 @@
#ifndef __GDK_WINDOW_H__
#define __GDK_WINDOW_H__
-#include <gdk/gdkdrawable.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkevents.h>
@@ -43,7 +42,7 @@ typedef struct _GdkPointerHooks GdkPointerHooks;
typedef struct _GdkWindowRedirect GdkWindowRedirect;
/**
- * GdkWindowClass:
+ * GdkWindowWindowClass:
* @GDK_INPUT_OUTPUT: window for graphics and events
* @GDK_INPUT_ONLY: window for events only
*
@@ -57,7 +56,7 @@ typedef enum
{
GDK_INPUT_OUTPUT,
GDK_INPUT_ONLY
-} GdkWindowClass;
+} GdkWindowWindowClass;
/**
* GdkWindowType:
@@ -346,7 +345,7 @@ struct _GdkWindowAttr
gint x, y;
gint width;
gint height;
- GdkWindowClass wclass;
+ GdkWindowWindowClass wclass;
GdkVisual *visual;
GdkWindowType window_type;
GdkCursor *cursor;
@@ -476,19 +475,19 @@ struct _GdkPointerHooks
};
typedef struct _GdkWindowObject GdkWindowObject;
-typedef struct _GdkWindowObjectClass GdkWindowObjectClass;
+typedef struct _GdkWindowClass GdkWindowClass;
-#define GDK_TYPE_WINDOW (gdk_window_object_get_type ())
+#define GDK_TYPE_WINDOW (gdk_window_get_type ())
#define GDK_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW, GdkWindow))
-#define GDK_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW, GdkWindowObjectClass))
+#define GDK_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW, GdkWindowClass))
#define GDK_IS_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW))
#define GDK_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW))
-#define GDK_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW, GdkWindowObjectClass))
+#define GDK_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW, GdkWindowClass))
-struct _GdkWindowObjectClass
+struct _GdkWindowClass
{
- GdkDrawableClass parent_class;
+ GObjectClass parent_class;
GdkWindow * (* pick_embedded_child) (GdkWindow *window,
gdouble x,
@@ -522,7 +521,7 @@ struct _GdkWindowObjectClass
/* Windows
*/
-GType gdk_window_object_get_type (void) G_GNUC_CONST;
+GType gdk_window_get_type (void) G_GNUC_CONST;
GdkWindow* gdk_window_new (GdkWindow *parent,
GdkWindowAttr *attributes,
gint attributes_mask);
@@ -680,6 +679,10 @@ void gdk_window_set_geometry_hints (GdkWindow *window,
GdkWindowHints geom_mask);
void gdk_set_sm_client_id (const gchar *sm_client_id);
+cairo_region_t *gdk_window_get_clip_region (GdkWindow *window);
+cairo_region_t *gdk_window_get_visible_region(GdkWindow *window);
+
+
void gdk_window_begin_paint_rect (GdkWindow *window,
const GdkRectangle *rectangle);
void gdk_window_begin_paint_region (GdkWindow *window,
diff --git a/gdk/gdkwindowimpl.c b/gdk/gdkwindowimpl.c
index 5658373b11..ef81fcffd0 100644
--- a/gdk/gdkwindowimpl.c
+++ b/gdk/gdkwindowimpl.c
@@ -31,11 +31,23 @@
#include "gdkinternals.h"
-typedef GdkWindowImplIface GdkWindowImplInterface;
-G_DEFINE_INTERFACE (GdkWindowImpl, gdk_window_impl, G_TYPE_OBJECT);
+G_DEFINE_TYPE (GdkWindowImpl, gdk_window_impl, G_TYPE_OBJECT);
+static gboolean
+gdk_window_impl_beep (GdkWindow *window)
+{
+ /* FALSE means windows can't beep, so the display will be
+ * made to beep instead. */
+ return FALSE;
+}
+
+static void
+gdk_window_impl_class_init (GdkWindowImplClass *impl_class)
+{
+ impl_class->beep = gdk_window_impl_beep;
+}
static void
-gdk_window_impl_default_init (GdkWindowImplInterface *iface)
+gdk_window_impl_init (GdkWindowImpl *impl)
{
}
diff --git a/gdk/gdkwindowimpl.h b/gdk/gdkwindowimpl.h
index 1c9d81980b..0332a31b71 100644
--- a/gdk/gdkwindowimpl.h
+++ b/gdk/gdkwindowimpl.h
@@ -32,16 +32,26 @@
G_BEGIN_DECLS
#define GDK_TYPE_WINDOW_IMPL (gdk_window_impl_get_type ())
-#define GDK_WINDOW_IMPL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_WINDOW_IMPL, GdkWindowImpl))
-#define GDK_IS_WINDOW_IMPL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_WINDOW_IMPL))
-#define GDK_WINDOW_IMPL_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GDK_TYPE_WINDOW_IMPL, GdkWindowImplIface))
+#define GDK_WINDOW_IMPL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW_IMPL, GdkWindowImpl))
+#define GDK_WINDOW_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW_IMPL, GdkWindowImplClass))
+#define GDK_IS_WINDOW_IMPL(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW_IMPL))
+#define GDK_IS_WINDOW_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW_IMPL))
+#define GDK_WINDOW_IMPL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW_IMPL, GdkWindowImplClass))
-typedef struct _GdkWindowImpl GdkWindowImpl; /* dummy */
-typedef struct _GdkWindowImplIface GdkWindowImplIface;
+typedef struct _GdkWindowImpl GdkWindowImpl;
+typedef struct _GdkWindowImplClass GdkWindowImplClass;
-struct _GdkWindowImplIface
+struct _GdkWindowImpl
{
- GTypeInterface g_iface;
+ GObject parent;
+};
+
+struct _GdkWindowImplClass
+{
+ GObjectClass parent_class;
+
+ cairo_surface_t *
+ (* ref_cairo_surface) (GdkWindow *window);
void (* show) (GdkWindow *window,
gboolean already_mapped);
@@ -94,6 +104,8 @@ struct _GdkWindowImplIface
gint *y,
GdkModifierType *mask);
+ cairo_region_t * (* get_shape) (GdkWindow *window);
+ cairo_region_t * (* get_input_shape) (GdkWindow *window);
void (* shape_combine_region) (GdkWindow *window,
const cairo_region_t *shape_region,
gint offset_x,
@@ -146,6 +158,9 @@ struct _GdkWindowImplIface
cairo_surface_t *surface,
gint width,
gint height);
+
+ /* optional */
+ gboolean (* beep) (GdkWindow *window);
};
/* Interface Functions */
diff --git a/gdk/quartz/GdkQuartzWindow.c b/gdk/quartz/GdkQuartzWindow.c
index cbd54937e3..eb3cce8947 100644
--- a/gdk/quartz/GdkQuartzWindow.c
+++ b/gdk/quartz/GdkQuartzWindow.c
@@ -478,7 +478,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
gdk_event_set_device (event, gdk_drag_context_get_device (current_context));
- (*_gdk_event_func) (event, _gdk_event_data);
+ _gdk_event_emit (event);
gdk_event_free (event);
@@ -508,7 +508,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
gdk_event_set_device (event, gdk_drag_context_get_device (current_context));
- (*_gdk_event_func) (event, _gdk_event_data);
+ _gdk_event_emit (event);
gdk_event_free (event);
@@ -536,7 +536,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
gdk_event_set_device (event, gdk_drag_context_get_device (current_context));
- (*_gdk_event_func) (event, _gdk_event_data);
+ _gdk_event_emit (event);
gdk_event_free (event);
@@ -563,7 +563,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
gdk_event_set_device (event, gdk_drag_context_get_device (current_context));
- (*_gdk_event_func) (event, _gdk_event_data);
+ _gdk_event_emit (event);
gdk_event_free (event);
@@ -592,7 +592,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
gdk_event_set_device (event,
gdk_drag_context_get_device (_gdk_quartz_drag_source_context));
- (*_gdk_event_func) (event, _gdk_event_data);
+ _gdk_event_emit (event);
gdk_event_free (event);
diff --git a/gdk/quartz/gdkeventloop-quartz.c b/gdk/quartz/gdkeventloop-quartz.c
index f11d4d88e7..71c15b8a95 100644
--- a/gdk/quartz/gdkeventloop-quartz.c
+++ b/gdk/quartz/gdkeventloop-quartz.c
@@ -670,8 +670,7 @@ gdk_event_dispatch (GSource *source,
if (event)
{
- if (_gdk_event_func)
- (*_gdk_event_func) (event, _gdk_event_data);
+ _gdk_event_emit (event);
gdk_event_free (event);
}
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index 11d140fd91..40b9dbb854 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -473,12 +473,6 @@ _gdk_window_impl_quartz_get_type (void)
return object_type;
}
-GType
-_gdk_window_impl_get_type (void)
-{
- return _gdk_window_impl_quartz_get_type ();
-}
-
static const gchar *
get_default_title (void)
{
@@ -834,7 +828,7 @@ _gdk_window_impl_new (GdkWindow *window,
private = (GdkWindowObject *)window;
- impl = g_object_new (_gdk_window_impl_get_type (), NULL);
+ impl = g_object_new (GDK_TYPE_WINDOW_IMPL_QUARTZ, NULL);
private->impl = (GdkDrawable *)impl;
draw_impl = GDK_DRAWABLE_IMPL_QUARTZ (impl);
draw_impl->wrapper = GDK_DRAWABLE (window);
@@ -2925,14 +2919,6 @@ gdk_window_destroy_notify (GdkWindow *window)
check_grab_destroy (window);
}
-void
-_gdk_windowing_window_beep (GdkWindow *window)
-{
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- gdk_display_beep (_gdk_display);
-}
-
void
gdk_window_set_opacity (GdkWindow *window,
gdouble opacity)
@@ -2960,15 +2946,15 @@ _gdk_windowing_window_set_composited (GdkWindow *window, gboolean composited)
{
}
-cairo_region_t *
-_gdk_windowing_window_get_shape (GdkWindow *window)
+static cairo_region_t *
+gdk_quartz_window_get_shape (GdkWindow *window)
{
/* FIXME: implement */
return NULL;
}
-cairo_region_t *
-_gdk_windowing_window_get_input_shape (GdkWindow *window)
+static cairo_region_t *
+gdk_quartz_window_get_input_shape (GdkWindow *window)
{
/* FIXME: implement */
return NULL;
@@ -2999,6 +2985,8 @@ gdk_window_impl_iface_init (GdkWindowImplIface *iface)
iface->translate = _gdk_quartz_window_translate;
iface->destroy = _gdk_quartz_window_destroy;
iface->resize_cairo_surface = gdk_window_quartz_resize_cairo_surface;
+ iface->get_shape = gdk_quartz_window_get_shape;
+ iface->get_input_shape = gdk_quartz_window_get_input_shape;
}
diff --git a/gdk/tests/gdk-color.c b/gdk/tests/gdk-color.c
index 008f425e28..3c3955a3cc 100644
--- a/gdk/tests/gdk-color.c
+++ b/gdk/tests/gdk-color.c
@@ -94,7 +94,6 @@ int
main (int argc, char *argv[])
{
g_test_init (&argc, &argv, NULL);
- gdk_init (&argc, &argv);
g_test_add_func ("/color/parse", test_color_parse);
g_test_add_func ("/color/to-string", test_color_to_string);
diff --git a/gdk/win32/gdkdrawable-win32.c b/gdk/win32/gdkdrawable-win32.c
index c6c8b61741..051569b138 100644
--- a/gdk/win32/gdkdrawable-win32.c
+++ b/gdk/win32/gdkdrawable-win32.c
@@ -34,20 +34,8 @@
#include <pango/pangowin32.h>
#include <cairo-win32.h>
-#include "gdkscreen.h" /* gdk_screen_get_default() */
#include "gdkprivate-win32.h"
-#define ROP3_D 0x00AA0029
-#define ROP3_DSna 0x00220326
-#define ROP3_DSPDxax 0x00E20746
-
-#define LINE_ATTRIBUTES (GDK_GC_LINE_WIDTH|GDK_GC_LINE_STYLE| \
- GDK_GC_CAP_STYLE|GDK_GC_JOIN_STYLE)
-
-#define MUST_RENDER_DASHES_MANUALLY(gcwin32) \
- (gcwin32->line_style == GDK_LINE_DOUBLE_DASH || \
- (gcwin32->line_style == GDK_LINE_ON_OFF_DASH && gcwin32->pen_dash_offset))
-
static cairo_surface_t *gdk_win32_ref_cairo_surface (GdkDrawable *drawable);
static cairo_surface_t *gdk_win32_create_cairo_surface (GdkDrawable *drawable,
int width,
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index bea28a8b7e..e29df5538f 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -756,7 +756,6 @@ _gdk_win32_print_event (const GdkEvent *event)
CASE (GDK_DROP_FINISHED);
CASE (GDK_CLIENT_EVENT);
CASE (GDK_VISIBILITY_NOTIFY);
- CASE (GDK_NO_EXPOSE);
CASE (GDK_SCROLL);
CASE (GDK_WINDOW_STATE);
CASE (GDK_SETTING);
@@ -3019,54 +3018,51 @@ gdk_event_translate (MSG *msg,
/* We need to render to clipboard immediately, don't call
* append_event()
*/
- if (_gdk_event_func)
- {
- event = gdk_event_new (GDK_SELECTION_REQUEST);
- event->selection.window = window;
- event->selection.send_event = FALSE;
- event->selection.selection = GDK_SELECTION_CLIPBOARD;
- event->selection.target = target;
- event->selection.property = _gdk_selection;
- event->selection.requestor = msg->hwnd;
- event->selection.time = msg->time;
+ event = gdk_event_new (GDK_SELECTION_REQUEST);
+ event->selection.window = window;
+ event->selection.send_event = FALSE;
+ event->selection.selection = GDK_SELECTION_CLIPBOARD;
+ event->selection.target = target;
+ event->selection.property = _gdk_selection;
+ event->selection.requestor = msg->hwnd;
+ event->selection.time = msg->time;
- fixup_event (event);
- GDK_NOTE (EVENTS, g_print (" (calling gdk_event_func)"));
- GDK_NOTE (EVENTS, _gdk_win32_print_event (event));
- (*_gdk_event_func) (event, _gdk_event_data);
- gdk_event_free (event);
-
- /* Now the clipboard owner should have rendered */
- if (!_delayed_rendering_data)
- {
- GDK_NOTE (EVENTS, g_print (" (no _delayed_rendering_data?)"));
- }
- else
- {
- if (msg->wParam == CF_DIB)
- {
- _delayed_rendering_data =
- _gdk_win32_selection_convert_to_dib (_delayed_rendering_data,
- target);
- if (!_delayed_rendering_data)
- {
- g_warning ("Cannot convert to DIB from delayed rendered image");
- break;
- }
- }
-
- /* The requestor is holding the clipboard, no
- * OpenClipboard() is required/possible
- */
- GDK_NOTE (DND,
- g_print (" SetClipboardData(%s,%p)",
- _gdk_win32_cf_to_string (msg->wParam),
- _delayed_rendering_data));
+ fixup_event (event);
+ GDK_NOTE (EVENTS, g_print (" (calling _gdk_event_emit)"));
+ GDK_NOTE (EVENTS, _gdk_win32_print_event (event));
+ _gdk_event_emit (event);
+ gdk_event_free (event);
- API_CALL (SetClipboardData, (msg->wParam, _delayed_rendering_data));
- _delayed_rendering_data = NULL;
- }
- }
+ /* Now the clipboard owner should have rendered */
+ if (!_delayed_rendering_data)
+ {
+ GDK_NOTE (EVENTS, g_print (" (no _delayed_rendering_data?)"));
+ }
+ else
+ {
+ if (msg->wParam == CF_DIB)
+ {
+ _delayed_rendering_data =
+ _gdk_win32_selection_convert_to_dib (_delayed_rendering_data,
+ target);
+ if (!_delayed_rendering_data)
+ {
+ g_warning ("Cannot convert to DIB from delayed rendered image");
+ break;
+ }
+ }
+
+ /* The requestor is holding the clipboard, no
+ * OpenClipboard() is required/possible
+ */
+ GDK_NOTE (DND,
+ g_print (" SetClipboardData(%s,%p)",
+ _gdk_win32_cf_to_string (msg->wParam),
+ _delayed_rendering_data));
+
+ API_CALL (SetClipboardData, (msg->wParam, _delayed_rendering_data));
+ _delayed_rendering_data = NULL;
+ }
break;
case WM_ACTIVATE:
@@ -3223,8 +3219,7 @@ gdk_event_dispatch (GSource *source,
if (event)
{
- if (_gdk_event_func)
- (*_gdk_event_func) (event, _gdk_event_data);
+ _gdk_event_emit (event);
gdk_event_free (event);
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index 398be8dcb1..bcbdca33a1 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -99,12 +99,6 @@ _gdk_window_impl_win32_get_type (void)
return object_type;
}
-GType
-_gdk_window_impl_get_type (void)
-{
- return _gdk_window_impl_win32_get_type ();
-}
-
static void
gdk_window_impl_win32_init (GdkWindowImplWin32 *impl)
{
@@ -211,7 +205,7 @@ _gdk_windowing_window_init (GdkScreen *screen)
_gdk_root = g_object_new (GDK_TYPE_WINDOW, NULL);
private = (GdkWindowObject *)_gdk_root;
- private->impl = g_object_new (_gdk_window_impl_get_type (), NULL);
+ private->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_WIN32, NULL);
private->impl_window = private;
private->visual = gdk_screen_get_system_visual (screen);
@@ -435,7 +429,7 @@ _gdk_window_impl_new (GdkWindow *window,
hparent = GDK_WINDOW_HWND (real_parent);
- impl = g_object_new (_gdk_window_impl_get_type (), NULL);
+ impl = g_object_new (GDK_TYPE_WINDOW_IMPL_WIN32, NULL);
private->impl = (GdkDrawable *)impl;
draw_impl = GDK_DRAWABLE_IMPL_WIN32 (impl);
draw_impl->wrapper = GDK_DRAWABLE (window);
@@ -641,7 +635,7 @@ gdk_window_foreign_new_for_display (GdkDisplay *display,
window = g_object_new (GDK_TYPE_WINDOW, NULL);
private = (GdkWindowObject *)window;
private->visual = gdk_screen_get_system_visual (_gdk_screen);
- private->impl = g_object_new (_gdk_window_impl_get_type (), NULL);
+ private->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_WIN32, NULL);
impl = GDK_WINDOW_IMPL_WIN32 (private->impl);
draw_impl = GDK_DRAWABLE_IMPL_WIN32 (private->impl);
draw_impl->wrapper = GDK_DRAWABLE (window);
@@ -3128,12 +3122,6 @@ gdk_window_configure_finished (GdkWindow *window)
}
void
-_gdk_windowing_window_beep (GdkWindow *window)
-{
- gdk_display_beep (_gdk_display);
-}
-
-void
gdk_window_set_opacity (GdkWindow *window,
gdouble opacity)
{
@@ -3176,8 +3164,8 @@ _gdk_windowing_window_set_composited (GdkWindow *window, gboolean composited)
{
}
-cairo_region_t *
-_gdk_windowing_window_get_shape (GdkWindow *window)
+static cairo_region_t *
+gdk_win32_window_get_shape (GdkWindow *window)
{
HRGN hrgn = CreateRectRgn (0, 0, 0, 0);
int type = GetWindowRgn (GDK_WINDOW_HWND (window), hrgn);
@@ -3193,8 +3181,8 @@ _gdk_windowing_window_get_shape (GdkWindow *window)
return NULL;
}
-cairo_region_t *
-_gdk_windowing_window_get_input_shape (GdkWindow *window)
+static cairo_region_t *
+_gdk_win32_window_get_input_shape (GdkWindow *window)
{
/* CHECK: are these really supposed to be the same? */
return _gdk_windowing_window_get_shape (window);
@@ -3312,6 +3300,8 @@ gdk_window_impl_iface_init (GdkWindowImplIface *iface)
iface->translate = _gdk_win32_window_translate;
iface->destroy = _gdk_win32_window_destroy;
iface->resize_cairo_surface = gdk_win32_window_resize_cairo_surface;
+ iface->get_shape = gdk_win32_window_get_shape;
+ iface->get_input_shape = gdk_win32_window_get_input_shape;
}
gboolean
diff --git a/gdk/x11/Makefile.am b/gdk/x11/Makefile.am
index 6344754597..b6a4751b32 100644
--- a/gdk/x11/Makefile.am
+++ b/gdk/x11/Makefile.am
@@ -30,8 +30,6 @@ libgdk_x11_la_SOURCES = \
gdkdisplay-x11.c \
gdkdisplay-x11.h \
gdkdnd-x11.c \
- gdkdrawable-x11.c \
- gdkdrawable-x11.h \
gdkeventsource.c \
gdkeventsource.h \
gdkeventtranslator.c \
diff --git a/gdk/x11/gdkcursor-x11.c b/gdk/x11/gdkcursor-x11.c
index 60380672c2..6169cc1d89 100644
--- a/gdk/x11/gdkcursor-x11.c
+++ b/gdk/x11/gdkcursor-x11.c
@@ -1035,6 +1035,6 @@ gdk_display_get_maximal_cursor_size (GdkDisplay *display,
screen = gdk_display_get_default_screen (display);
window = gdk_screen_get_root_window (screen);
XQueryBestCursor (GDK_DISPLAY_XDISPLAY (display),
- GDK_WINDOW_XWINDOW (window),
+ GDK_WINDOW_XID (window),
128, 128, width, height);
}
diff --git a/gdk/x11/gdkdevice-core.c b/gdk/x11/gdkdevice-core.c
index a399713b55..008e339b01 100644
--- a/gdk/x11/gdkdevice-core.c
+++ b/gdk/x11/gdkdevice-core.c
@@ -21,6 +21,7 @@
#include "gdkdevice-core.h"
+#include "gdkinternals.h"
#include "gdkwindow.h"
#include "gdkprivate-x11.h"
#include "gdkx.h"
@@ -104,14 +105,12 @@ impl_coord_in_window (GdkWindow *window,
int impl_x,
int impl_y)
{
- GdkWindowObject *priv = (GdkWindowObject *) window;
-
- if (impl_x < priv->abs_x ||
- impl_x > priv->abs_x + priv->width)
+ if (impl_x < window->abs_x ||
+ impl_x >= window->abs_x + window->width)
return FALSE;
- if (impl_y < priv->abs_y ||
- impl_y > priv->abs_y + priv->height)
+ if (impl_y < window->abs_y ||
+ impl_y >= window->abs_y + window->height)
return FALSE;
return TRUE;
@@ -125,7 +124,6 @@ gdk_device_core_get_history (GdkDevice *device,
GdkTimeCoord ***events,
gint *n_events)
{
- GdkWindowObject *priv;
XTimeCoord *xcoords;
GdkTimeCoord **coords;
GdkWindow *impl_window;
@@ -133,13 +131,12 @@ gdk_device_core_get_history (GdkDevice *device,
int i, j;
impl_window = _gdk_window_get_impl_window (window);
- xcoords = XGetMotionEvents (GDK_DRAWABLE_XDISPLAY (window),
- GDK_DRAWABLE_XID (impl_window),
+ xcoords = XGetMotionEvents (GDK_WINDOW_XDISPLAY (window),
+ GDK_WINDOW_XID (impl_window),
start, stop, &tmp_n_events);
if (!xcoords)
return FALSE;
- priv = (GdkWindowObject *) window;
coords = _gdk_device_allocate_history (device, tmp_n_events);
for (i = 0, j = 0; i < tmp_n_events; i++)
@@ -147,8 +144,8 @@ gdk_device_core_get_history (GdkDevice *device,
if (impl_coord_in_window (window, xcoords[i].x, xcoords[i].y))
{
coords[j]->time = xcoords[i].time;
- coords[j]->axes[0] = xcoords[i].x - priv->abs_x;
- coords[j]->axes[1] = xcoords[i].y - priv->abs_y;
+ coords[j]->axes[0] = xcoords[i].x - window->abs_x;
+ coords[j]->axes[1] = xcoords[i].y - window->abs_y;
j++;
}
}
@@ -228,7 +225,7 @@ gdk_device_core_warp (GdkDevice *device,
Window dest;
xdisplay = GDK_DISPLAY_XDISPLAY (gdk_device_get_display (device));
- dest = GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (screen));
+ dest = GDK_WINDOW_XID (gdk_screen_get_root_window (screen));
XWarpPointer (xdisplay, None, dest, 0, 0, 0, 0, x, y);
}
@@ -428,7 +425,7 @@ gdk_device_core_window_at_position (GdkDevice *device,
if (get_toplevel && last != root &&
(window = gdk_window_lookup_for_display (display, last)) != NULL &&
- GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
+ window->window_type != GDK_WINDOW_FOREIGN)
{
xwindow = last;
break;
@@ -497,6 +494,6 @@ gdk_device_core_select_window_events (GdkDevice *device,
xmask |= StructureNotifyMask | PropertyChangeMask;
XSelectInput (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XWINDOW (window),
+ GDK_WINDOW_XID (window),
xmask);
}
diff --git a/gdk/x11/gdkdevice-xi.c b/gdk/x11/gdkdevice-xi.c
index 8bebf075d3..8ffd8dfa06 100644
--- a/gdk/x11/gdkdevice-xi.c
+++ b/gdk/x11/gdkdevice-xi.c
@@ -443,7 +443,7 @@ gdk_device_xi_grab (GdkDevice *device,
status = XGrabDevice (GDK_WINDOW_XDISPLAY (window),
device_xi->xdevice,
- GDK_WINDOW_XWINDOW (window),
+ GDK_WINDOW_XID (window),
owner_events,
num_classes, event_classes,
GrabModeAsync, GrabModeAsync,
@@ -492,7 +492,7 @@ gdk_device_xi_select_window_events (GdkDevice *device,
find_events (device, event_mask, event_classes, &num_classes);
XSelectExtensionEvent (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XWINDOW (window),
+ GDK_WINDOW_XID (window),
event_classes, num_classes);
if (event_mask)
diff --git a/gdk/x11/gdkdevice-xi2.c b/gdk/x11/gdkdevice-xi2.c
index 41142e2097..7c91cd3f82 100644
--- a/gdk/x11/gdkdevice-xi2.c
+++ b/gdk/x11/gdkdevice-xi2.c
@@ -258,13 +258,13 @@ gdk_device_xi2_set_window_cursor (GdkDevice *device,
XIDefineCursor (GDK_WINDOW_XDISPLAY (window),
priv->device_id,
- GDK_WINDOW_XWINDOW (window),
+ GDK_WINDOW_XID (window),
cursor_private->xcursor);
}
else
XIUndefineCursor (GDK_WINDOW_XDISPLAY (window),
priv->device_id,
- GDK_WINDOW_XWINDOW (window));
+ GDK_WINDOW_XID (window));
}
static void
@@ -277,7 +277,7 @@ gdk_device_xi2_warp (GdkDevice *device,
Window dest;
priv = GDK_DEVICE_XI2 (device)->priv;
- dest = GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (screen));
+ dest = GDK_WINDOW_XID (gdk_screen_get_root_window (screen));
XIWarpPointer (GDK_SCREEN_XDISPLAY (screen),
priv->device_id,
@@ -512,7 +512,7 @@ gdk_device_xi2_select_window_events (GdkDevice *device,
evmask.mask = gdk_device_xi2_translate_event_mask (event_mask, &evmask.mask_len);
XISelectEvents (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XWINDOW (window),
+ GDK_WINDOW_XID (window),
&evmask, 1);
g_free (evmask.mask);
diff --git a/gdk/x11/gdkdevicemanager-core.c b/gdk/x11/gdkdevicemanager-core.c
index e355eec6d7..5d592b6d99 100644
--- a/gdk/x11/gdkdevicemanager-core.c
+++ b/gdk/x11/gdkdevicemanager-core.c
@@ -415,7 +415,6 @@ gdk_device_manager_core_translate_event (GdkEventTranslator *translator,
{
GdkDeviceManagerCore *device_manager;
GdkWindow *window;
- GdkWindowObject *window_private;
GdkWindowImplX11 *window_impl = NULL;
gboolean return_val;
GdkToplevelX11 *toplevel = NULL;
@@ -425,7 +424,6 @@ gdk_device_manager_core_translate_event (GdkEventTranslator *translator,
return_val = FALSE;
window = get_event_window (translator, xevent);
- window_private = (GdkWindowObject *) window;
if (window)
{
@@ -433,14 +431,14 @@ gdk_device_manager_core_translate_event (GdkEventTranslator *translator,
return FALSE;
toplevel = _gdk_x11_window_get_toplevel (window);
- window_impl = GDK_WINDOW_IMPL_X11 (window_private->impl);
+ window_impl = GDK_WINDOW_IMPL_X11 (window->impl);
g_object_ref (window);
}
event->any.window = window;
event->any.send_event = xevent->xany.send_event ? TRUE : FALSE;
- if (window_private && GDK_WINDOW_DESTROYED (window))
+ if (window && GDK_WINDOW_DESTROYED (window))
{
if (xevent->type != DestroyNotify)
{
@@ -472,7 +470,7 @@ gdk_device_manager_core_translate_event (GdkEventTranslator *translator,
switch (xevent->type)
{
case KeyPress:
- if (window_private == NULL)
+ if (window == NULL)
{
return_val = FALSE;
break;
@@ -482,7 +480,7 @@ gdk_device_manager_core_translate_event (GdkEventTranslator *translator,
break;
case KeyRelease:
- if (window_private == NULL)
+ if (window == NULL)
{
return_val = FALSE;
break;
@@ -518,7 +516,7 @@ gdk_device_manager_core_translate_event (GdkEventTranslator *translator,
xevent->xbutton.x, xevent->xbutton.y,
xevent->xbutton.button));
- if (window_private == NULL)
+ if (window == NULL)
{
return_val = FALSE;
break;
@@ -590,7 +588,7 @@ gdk_device_manager_core_translate_event (GdkEventTranslator *translator,
xevent->xbutton.x, xevent->xbutton.y,
xevent->xbutton.button));
- if (window_private == NULL)
+ if (window == NULL)
{
return_val = FALSE;
break;
@@ -628,7 +626,7 @@ gdk_device_manager_core_translate_event (GdkEventTranslator *translator,
xevent->xmotion.x, xevent->xmotion.y,
(xevent->xmotion.is_hint) ? "true" : "false"));
- if (window_private == NULL)
+ if (window == NULL)
{
return_val = FALSE;
break;
@@ -661,7 +659,7 @@ gdk_device_manager_core_translate_event (GdkEventTranslator *translator,
xevent->xcrossing.detail,
xevent->xcrossing.subwindow));
- if (window_private == NULL)
+ if (window == NULL)
{
return_val = FALSE;
break;
@@ -705,7 +703,7 @@ gdk_device_manager_core_translate_event (GdkEventTranslator *translator,
xevent->xcrossing.window,
xevent->xcrossing.detail, xevent->xcrossing.subwindow));
- if (window_private == NULL)
+ if (window == NULL)
{
return_val = FALSE;
break;
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index f97717d522..25d7a841a6 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -369,7 +369,7 @@ gdk_device_manager_xi2_constructed (GObject *object)
event_mask.mask = mask;
_gdk_device_manager_xi2_select_events (GDK_DEVICE_MANAGER (object),
- GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (screen)),
+ GDK_WINDOW_XID (gdk_screen_get_root_window (screen)),
&event_mask);
}
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 0ced13753b..bfcc358cce 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -31,6 +31,7 @@
#include "gdkdisplay.h"
#include "gdkeventsource.h"
#include "gdkeventtranslator.h"
+#include "gdkinternals.h"
#include "gdkscreen.h"
#include "gdkscreen-x11.h"
#include "gdkinternals.h"
@@ -382,7 +383,6 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator,
XEvent *xevent)
{
GdkWindow *window;
- GdkWindowObject *window_private;
GdkWindowImplX11 *window_impl = NULL;
GdkScreen *screen = NULL;
GdkScreenX11 *screen_x11 = NULL;
@@ -396,7 +396,6 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator,
* are reported same as structure events
*/
window = get_event_window (translator, xevent);
- window_private = (GdkWindowObject *) window;
if (window)
{
@@ -409,7 +408,7 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator,
screen = GDK_WINDOW_SCREEN (window);
screen_x11 = GDK_SCREEN_X11 (screen);
toplevel = _gdk_x11_window_get_toplevel (window);
- window_impl = GDK_WINDOW_IMPL_X11 (window_private->impl);
+ window_impl = GDK_WINDOW_IMPL_X11 (window->impl);
xwindow = GDK_WINDOW_XID (window);
g_object_ref (window);
@@ -418,7 +417,7 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator,
event->any.window = window;
event->any.send_event = xevent->xany.send_event ? TRUE : FALSE;
- if (window_private && GDK_WINDOW_DESTROYED (window))
+ if (window && GDK_WINDOW_DESTROYED (window))
{
if (xevent->type != DestroyNotify)
{
@@ -480,7 +479,7 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator,
xevent->xexpose.width, xevent->xexpose.height,
event->any.send_event ? " (send)" : ""));
- if (window_private == NULL)
+ if (window == NULL)
{
return_val = FALSE;
break;
@@ -508,7 +507,7 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator,
g_message ("graphics expose:\tdrawable: %ld",
xevent->xgraphicsexpose.drawable));
- if (window_private == NULL)
+ if (window == NULL)
{
return_val = FALSE;
break;
@@ -524,16 +523,6 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator,
}
break;
- case NoExpose:
- GDK_NOTE (EVENTS,
- g_message ("no expose:\t\tdrawable: %ld",
- xevent->xnoexpose.drawable));
-
- event->no_expose.type = GDK_NO_EXPOSE;
- event->no_expose.window = window;
-
- break;
-
case VisibilityNotify:
#ifdef G_ENABLE_DEBUG
if (_gdk_debug_flags & GDK_DEBUG_EVENTS)
@@ -554,7 +543,7 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator,
}
#endif /* G_ENABLE_DEBUG */
- if (window_private == NULL)
+ if (window == NULL)
{
return_val = FALSE;
break;
@@ -605,7 +594,7 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator,
event->any.type = GDK_DESTROY;
event->any.window = window;
- return_val = window_private && !GDK_WINDOW_DESTROYED (window);
+ return_val = window && !GDK_WINDOW_DESTROYED (window);
if (window && GDK_WINDOW_XID (window) != screen_x11->xroot_window)
gdk_window_destroy_notify (window);
@@ -649,7 +638,7 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator,
event->any.window = window;
/* Unset iconified if it was set */
- if (window && (((GdkWindowObject*)window)->state & GDK_WINDOW_STATE_ICONIFIED))
+ if (window && (window->state & GDK_WINDOW_STATE_ICONIFIED))
gdk_synthesize_window_state (window,
GDK_WINDOW_STATE_ICONIFIED,
0);
@@ -682,18 +671,18 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator,
xevent->xconfigure.override_redirect,
!window
? " (discarding)"
- : GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD
+ : window->window_type == GDK_WINDOW_CHILD
? " (discarding child)"
: xevent->xconfigure.event != xevent->xconfigure.window
? " (discarding substructure)"
: ""));
if (window && GDK_WINDOW_TYPE (window) == GDK_WINDOW_ROOT)
{
- window_private->width = xevent->xconfigure.width;
- window_private->height = xevent->xconfigure.height;
+ window->width = xevent->xconfigure.width;
+ window->height = xevent->xconfigure.height;
_gdk_window_update_size (window);
- _gdk_x11_drawable_update_size (window_private->impl);
+ _gdk_x11_window_update_size (GDK_WINDOW_IMPL_X11 (window->impl));
_gdk_x11_screen_size_changed (screen, xevent);
}
@@ -726,8 +715,8 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator,
Window child_window = 0;
gdk_error_trap_push ();
- if (XTranslateCoordinates (GDK_DRAWABLE_XDISPLAY (window),
- GDK_DRAWABLE_XID (window),
+ if (XTranslateCoordinates (GDK_WINDOW_XDISPLAY (window),
+ GDK_WINDOW_XID (window),
screen_x11->xroot_window,
0, 0,
&tx, &ty,
@@ -743,19 +732,19 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator,
event->configure.x = xevent->xconfigure.x;
event->configure.y = xevent->xconfigure.y;
}
- window_private->x = event->configure.x;
- window_private->y = event->configure.y;
- window_private->width = xevent->xconfigure.width;
- window_private->height = xevent->xconfigure.height;
+ window->x = event->configure.x;
+ window->y = event->configure.y;
+ window->width = xevent->xconfigure.width;
+ window->height = xevent->xconfigure.height;
_gdk_window_update_size (window);
- _gdk_x11_drawable_update_size (window_private->impl);
+ _gdk_x11_window_update_size (GDK_WINDOW_IMPL_X11 (window->impl));
- if (window_private->resize_count >= 1)
+ if (window->resize_count >= 1)
{
- window_private->resize_count -= 1;
+ window->resize_count -= 1;
- if (window_private->resize_count == 0)
+ if (window->resize_count == 0)
_gdk_moveresize_configure_done (display, window);
}
}
@@ -770,7 +759,7 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator,
gdk_x11_get_xatom_name_for_display (display, xevent->xproperty.atom),
"\""));
- if (window_private == NULL)
+ if (window == NULL)
{
return_val = FALSE;
break;
@@ -789,7 +778,7 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator,
gdk_check_wm_desktop_changed (window);
}
- if (window_private->event_mask & GDK_PROPERTY_CHANGE_MASK)
+ if (window->event_mask & GDK_PROPERTY_CHANGE_MASK)
{
event->property.type = GDK_PROPERTY_NOTIFY;
event->property.window = window;
@@ -894,7 +883,7 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator,
break;
case GDK_FILTER_CONTINUE:
/* Send unknown ClientMessage's on to Gtk for it to use */
- if (window_private == NULL)
+ if (window == NULL)
{
return_val = FALSE;
}
@@ -956,7 +945,7 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator,
else
#endif
#if defined(HAVE_XCOMPOSITE) && defined (HAVE_XDAMAGE) && defined (HAVE_XFIXES)
- if (display_x11->have_xdamage && window_private && window_private->composited &&
+ if (display_x11->have_xdamage && window && window->composited &&
xevent->type == display_x11->xdamage_event_base + XDamageNotify &&
((XDamageNotifyEvent *) xevent)->damage == window_impl->damage)
{
@@ -964,8 +953,8 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator,
XserverRegion repair;
GdkRectangle rect;
- rect.x = window_private->x + damage_event->area.x;
- rect.y = window_private->y + damage_event->area.y;
+ rect.x = window->x + damage_event->area.x;
+ rect.y = window->y + damage_event->area.y;
rect.width = damage_event->area.width;
rect.height = damage_event->area.height;
@@ -976,8 +965,8 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator,
repair, None);
XFixesDestroyRegion (display_x11->xdisplay, repair);
- if (window_private->parent != NULL)
- _gdk_window_process_expose (GDK_WINDOW (window_private->parent),
+ if (window->parent != NULL)
+ _gdk_window_process_expose (window->parent,
damage_event->serial, &rect);
return_val = TRUE;
@@ -1066,12 +1055,11 @@ gdk_wm_protocols_filter (GdkXEvent *xev,
else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "WM_TAKE_FOCUS"))
{
GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (event->any.window);
- GdkWindowObject *private = (GdkWindowObject *)win;
/* There is no way of knowing reliably whether we are viewable;
* _gdk_x11_set_input_focus_safe() traps errors asynchronously.
*/
- if (toplevel && private->accept_focus)
+ if (toplevel && win->accept_focus)
_gdk_x11_set_input_focus_safe (display, toplevel->focus_window,
RevertToParent,
xevent->xclient.data.l[1]);
diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c
index e4d8cffc91..0c94a6456b 100644
--- a/gdk/x11/gdkdnd-x11.c
+++ b/gdk/x11/gdkdnd-x11.c
@@ -294,12 +294,12 @@ gdk_drag_context_find (GdkDisplay *display,
context_dest_xid = context->dest_window ?
(private->drop_xid ?
private->drop_xid :
- GDK_DRAWABLE_XID (context->dest_window)) :
+ GDK_WINDOW_XID (context->dest_window)) :
None;
if ((!context->is_source == !is_source) &&
((source_xid == None) || (context->source_window &&
- (GDK_DRAWABLE_XID (context->source_window) == source_xid))) &&
+ (GDK_WINDOW_XID (context->source_window) == source_xid))) &&
((dest_xid == None) || (context_dest_xid == dest_xid)))
return context;
@@ -547,7 +547,7 @@ gdk_window_cache_new (GdkScreen *screen)
result->child_hash = g_hash_table_new (g_direct_hash, NULL);
result->screen = screen;
- XGetWindowAttributes (xdisplay, GDK_WINDOW_XWINDOW (root_window), &xwa);
+ XGetWindowAttributes (xdisplay, GDK_WINDOW_XID (root_window), &xwa);
result->old_event_mask = xwa.your_event_mask;
if (G_UNLIKELY (!GDK_DISPLAY_X11 (GDK_SCREEN_X11 (screen)->display)->trusted_client))
@@ -568,13 +568,13 @@ gdk_window_cache_new (GdkScreen *screen)
return result;
}
- XSelectInput (xdisplay, GDK_WINDOW_XWINDOW (root_window),
+ XSelectInput (xdisplay, GDK_WINDOW_XID (root_window),
result->old_event_mask | SubstructureNotifyMask);
gdk_window_add_filter (root_window, gdk_window_cache_filter, result);
gdk_window_add_filter (NULL, gdk_window_cache_shape_filter, result);
if (!_gdk_x11_get_window_child_info (gdk_screen_get_display (screen),
- GDK_WINDOW_XWINDOW (root_window),
+ GDK_WINDOW_XID (root_window),
FALSE, NULL,
&children, &nchildren))
return result;
@@ -598,9 +598,9 @@ gdk_window_cache_new (GdkScreen *screen)
*/
if (gdk_screen_is_composited (screen))
{
- cow = XCompositeGetOverlayWindow (xdisplay, GDK_WINDOW_XWINDOW (root_window));
+ cow = XCompositeGetOverlayWindow (xdisplay, GDK_WINDOW_XID (root_window));
gdk_window_cache_add (result, cow, 0, 0, gdk_screen_get_width (screen), gdk_screen_get_height (screen), TRUE);
- XCompositeReleaseOverlayWindow (xdisplay, GDK_WINDOW_XWINDOW (root_window));
+ XCompositeReleaseOverlayWindow (xdisplay, GDK_WINDOW_XID (root_window));
}
#endif
@@ -613,7 +613,7 @@ gdk_window_cache_destroy (GdkWindowCache *cache)
GdkWindow *root_window = gdk_screen_get_root_window (cache->screen);
XSelectInput (GDK_WINDOW_XDISPLAY (root_window),
- GDK_WINDOW_XWINDOW (root_window),
+ GDK_WINDOW_XID (root_window),
cache->old_event_mask);
gdk_window_remove_filter (root_window, gdk_window_cache_filter, cache);
gdk_window_remove_filter (NULL, gdk_window_cache_shape_filter, cache);
@@ -774,7 +774,7 @@ get_client_window_at_coords (GdkWindowCache *cache,
if (retval)
return retval;
else
- return GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (cache->screen));
+ return GDK_WINDOW_XID (gdk_screen_get_root_window (cache->screen));
}
/*************************************************************
@@ -1405,8 +1405,8 @@ motif_set_targets (GdkDragContext *context)
info.selection_atom = private->motif_selection;
- XChangeProperty (GDK_DRAWABLE_XDISPLAY (context->source_window),
- GDK_DRAWABLE_XID (context->source_window),
+ XChangeProperty (GDK_WINDOW_XDISPLAY (context->source_window),
+ GDK_WINDOW_XID (context->source_window),
private->motif_selection,
gdk_x11_get_xatom_by_name_for_display (display, "_MOTIF_DRAG_INITIATOR_INFO"),
8, PropModeReplace,
@@ -1475,13 +1475,13 @@ motif_send_enter (GdkDragContext *context,
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_MOTIF_DRAG_AND_DROP_MESSAGE");
xev.xclient.format = 8;
- xev.xclient.window = GDK_DRAWABLE_XID (context->dest_window);
+ xev.xclient.window = GDK_WINDOW_XID (context->dest_window);
MOTIF_XCLIENT_BYTE (&xev, 0) = XmTOP_LEVEL_ENTER;
MOTIF_XCLIENT_BYTE (&xev, 1) = local_byte_order;
MOTIF_XCLIENT_SHORT (&xev, 1) = 0;
MOTIF_XCLIENT_LONG (&xev, 1) = time;
- MOTIF_XCLIENT_LONG (&xev, 2) = GDK_DRAWABLE_XID (context->source_window);
+ MOTIF_XCLIENT_LONG (&xev, 2) = GDK_WINDOW_XID (context->source_window);
if (!private->motif_targets_set)
motif_set_targets (context);
@@ -1490,11 +1490,11 @@ motif_send_enter (GdkDragContext *context,
MOTIF_XCLIENT_LONG (&xev, 4) = 0;
if (!_gdk_send_xevent (display,
- GDK_DRAWABLE_XID (context->dest_window),
+ GDK_WINDOW_XID (context->dest_window),
FALSE, 0, &xev))
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
- GDK_DRAWABLE_XID (context->dest_window)));
+ GDK_WINDOW_XID (context->dest_window)));
}
static void
@@ -1507,7 +1507,7 @@ motif_send_leave (GdkDragContext *context,
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_MOTIF_DRAG_AND_DROP_MESSAGE");
xev.xclient.format = 8;
- xev.xclient.window = GDK_DRAWABLE_XID (context->dest_window);
+ xev.xclient.window = GDK_WINDOW_XID (context->dest_window);
MOTIF_XCLIENT_BYTE (&xev, 0) = XmTOP_LEVEL_LEAVE;
MOTIF_XCLIENT_BYTE (&xev, 1) = local_byte_order;
@@ -1518,11 +1518,11 @@ motif_send_leave (GdkDragContext *context,
MOTIF_XCLIENT_LONG (&xev, 4) = 0;
if (!_gdk_send_xevent (display,
- GDK_DRAWABLE_XID (context->dest_window),
+ GDK_WINDOW_XID (context->dest_window),
FALSE, 0, &xev))
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
- GDK_DRAWABLE_XID (context->dest_window)));
+ GDK_WINDOW_XID (context->dest_window)));
}
static gboolean
@@ -1540,7 +1540,7 @@ motif_send_motion (GdkDragContext *context,
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_MOTIF_DRAG_AND_DROP_MESSAGE");
xev.xclient.format = 8;
- xev.xclient.window = GDK_DRAWABLE_XID (context->dest_window);
+ xev.xclient.window = GDK_WINDOW_XID (context->dest_window);
MOTIF_XCLIENT_BYTE (&xev, 1) = local_byte_order;
MOTIF_XCLIENT_SHORT (&xev, 1) = motif_dnd_get_flags (context);
@@ -1568,11 +1568,11 @@ motif_send_motion (GdkDragContext *context,
}
if (!_gdk_send_xevent (display,
- GDK_DRAWABLE_XID (context->dest_window),
+ GDK_WINDOW_XID (context->dest_window),
FALSE, 0, &xev))
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
- GDK_DRAWABLE_XID (context->dest_window)));
+ GDK_WINDOW_XID (context->dest_window)));
return retval;
}
@@ -1587,7 +1587,7 @@ motif_send_drop (GdkDragContext *context, guint32 time)
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_MOTIF_DRAG_AND_DROP_MESSAGE");
xev.xclient.format = 8;
- xev.xclient.window = GDK_DRAWABLE_XID (context->dest_window);
+ xev.xclient.window = GDK_WINDOW_XID (context->dest_window);
MOTIF_XCLIENT_BYTE (&xev, 0) = XmDROP_START;
MOTIF_XCLIENT_BYTE (&xev, 1) = local_byte_order;
@@ -1598,14 +1598,14 @@ motif_send_drop (GdkDragContext *context, guint32 time)
MOTIF_XCLIENT_SHORT (&xev, 5) = private->last_y;
MOTIF_XCLIENT_LONG (&xev, 3) = private->motif_selection;
- MOTIF_XCLIENT_LONG (&xev, 4) = GDK_DRAWABLE_XID (context->source_window);
+ MOTIF_XCLIENT_LONG (&xev, 4) = GDK_WINDOW_XID (context->source_window);
if (!_gdk_send_xevent (display,
- GDK_DRAWABLE_XID (context->dest_window),
+ GDK_WINDOW_XID (context->dest_window),
FALSE, 0, &xev))
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
- GDK_DRAWABLE_XID (context->dest_window)));
+ GDK_WINDOW_XID (context->dest_window)));
}
/* Target Side */
@@ -1924,7 +1924,7 @@ motif_drag_status (GdkEvent *event,
if (!display)
return GDK_FILTER_REMOVE;
- context = gdk_drag_context_find (display, TRUE, GDK_DRAWABLE_XID (event->any.window), None);
+ context = gdk_drag_context_find (display, TRUE, GDK_WINDOW_XID (event->any.window), None);
if (context)
{
@@ -2228,8 +2228,8 @@ xdnd_set_targets (GdkDragContext *context)
i++;
}
- XChangeProperty (GDK_DRAWABLE_XDISPLAY (context->source_window),
- GDK_DRAWABLE_XID (context->source_window),
+ XChangeProperty (GDK_WINDOW_XDISPLAY (context->source_window),
+ GDK_WINDOW_XID (context->source_window),
gdk_x11_get_xatom_by_name_for_display (display, "XdndTypeList"),
XA_ATOM, 32, PropModeReplace,
(guchar *)atomlist, n_atoms);
@@ -2277,8 +2277,8 @@ xdnd_set_actions (GdkDragContext *context)
}
}
- XChangeProperty (GDK_DRAWABLE_XDISPLAY (context->source_window),
- GDK_DRAWABLE_XID (context->source_window),
+ XChangeProperty (GDK_WINDOW_XDISPLAY (context->source_window),
+ GDK_WINDOW_XID (context->source_window),
gdk_x11_get_xatom_by_name_for_display (display, "XdndActionList"),
XA_ATOM, 32, PropModeReplace,
(guchar *)atomlist, n_atoms);
@@ -2397,7 +2397,7 @@ xdnd_send_xevent (GdkDragContext *context,
}
}
- xwindow = GDK_WINDOW_XWINDOW (window);
+ xwindow = GDK_WINDOW_XID (window);
if (_gdk_x11_display_is_root_window (display, xwindow))
event_mask = ButtonPressMask;
@@ -2422,8 +2422,8 @@ xdnd_send_enter (GdkDragContext *context)
xev.xclient.format = 32;
xev.xclient.window = private->drop_xid ?
private->drop_xid :
- GDK_DRAWABLE_XID (context->dest_window);
- xev.xclient.data.l[0] = GDK_DRAWABLE_XID (context->source_window);
+ GDK_WINDOW_XID (context->dest_window);
+ xev.xclient.data.l[0] = GDK_WINDOW_XID (context->source_window);
xev.xclient.data.l[1] = (private->version << 24); /* version */
xev.xclient.data.l[2] = 0;
xev.xclient.data.l[3] = 0;
@@ -2431,7 +2431,7 @@ xdnd_send_enter (GdkDragContext *context)
GDK_NOTE(DND,
g_message ("Sending enter source window %#lx XDND protocol version %d\n",
- GDK_DRAWABLE_XID (context->source_window), private->version));
+ GDK_WINDOW_XID (context->source_window), private->version));
if (g_list_length (context->targets) > 3)
{
if (!private->xdnd_targets_set)
@@ -2457,7 +2457,7 @@ xdnd_send_enter (GdkDragContext *context)
{
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
- GDK_DRAWABLE_XID (context->dest_window)));
+ GDK_WINDOW_XID (context->dest_window)));
g_object_unref (context->dest_window);
context->dest_window = NULL;
}
@@ -2476,8 +2476,8 @@ xdnd_send_leave (GdkDragContext *context)
xev.xclient.format = 32;
xev.xclient.window = private->drop_xid ?
private->drop_xid :
- GDK_DRAWABLE_XID (context->dest_window);
- xev.xclient.data.l[0] = GDK_DRAWABLE_XID (context->source_window);
+ GDK_WINDOW_XID (context->dest_window);
+ xev.xclient.data.l[0] = GDK_WINDOW_XID (context->source_window);
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = 0;
xev.xclient.data.l[3] = 0;
@@ -2488,7 +2488,7 @@ xdnd_send_leave (GdkDragContext *context)
{
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
- GDK_DRAWABLE_XID (context->dest_window)));
+ GDK_WINDOW_XID (context->dest_window)));
g_object_unref (context->dest_window);
context->dest_window = NULL;
}
@@ -2506,8 +2506,8 @@ xdnd_send_drop (GdkDragContext *context, guint32 time)
xev.xclient.format = 32;
xev.xclient.window = private->drop_xid ?
private->drop_xid :
- GDK_DRAWABLE_XID (context->dest_window);
- xev.xclient.data.l[0] = GDK_DRAWABLE_XID (context->source_window);
+ GDK_WINDOW_XID (context->dest_window);
+ xev.xclient.data.l[0] = GDK_WINDOW_XID (context->source_window);
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = time;
xev.xclient.data.l[3] = 0;
@@ -2518,7 +2518,7 @@ xdnd_send_drop (GdkDragContext *context, guint32 time)
{
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
- GDK_DRAWABLE_XID (context->dest_window)));
+ GDK_WINDOW_XID (context->dest_window)));
g_object_unref (context->dest_window);
context->dest_window = NULL;
}
@@ -2540,8 +2540,8 @@ xdnd_send_motion (GdkDragContext *context,
xev.xclient.format = 32;
xev.xclient.window = private->drop_xid ?
private->drop_xid :
- GDK_DRAWABLE_XID (context->dest_window);
- xev.xclient.data.l[0] = GDK_DRAWABLE_XID (context->source_window);
+ GDK_WINDOW_XID (context->dest_window);
+ xev.xclient.data.l[0] = GDK_WINDOW_XID (context->source_window);
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = (x_root << 16) | y_root;
xev.xclient.data.l[3] = time;
@@ -2552,7 +2552,7 @@ xdnd_send_motion (GdkDragContext *context,
{
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
- GDK_DRAWABLE_XID (context->dest_window)));
+ GDK_WINDOW_XID (context->dest_window)));
g_object_unref (context->dest_window);
context->dest_window = NULL;
}
@@ -2654,7 +2654,7 @@ xdnd_read_actions (GdkDragContext *context)
gdk_error_trap_push ();
if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_DRAWABLE_XID (context->source_window),
+ GDK_WINDOW_XID (context->source_window),
gdk_x11_get_xatom_by_name_for_display (display, "XdndActionList"),
0, 65536,
False, XA_ATOM, &type, &format, &nitems,
@@ -2702,8 +2702,8 @@ xdnd_read_actions (GdkDragContext *context)
GdkDragContext *source_context;
source_context = gdk_drag_context_find (display, TRUE,
- GDK_DRAWABLE_XID (context->source_window),
- GDK_DRAWABLE_XID (context->dest_window));
+ GDK_WINDOW_XID (context->source_window),
+ GDK_WINDOW_XID (context->dest_window));
if (source_context)
{
@@ -2903,7 +2903,7 @@ xdnd_enter_filter (GdkXEvent *xev,
if (get_types)
{
gdk_error_trap_push ();
- XGetWindowProperty (GDK_DRAWABLE_XDISPLAY (event->any.window),
+ XGetWindowProperty (GDK_WINDOW_XDISPLAY (event->any.window),
source_window,
gdk_x11_get_xatom_by_name_for_display (display, "XdndTypeList"),
0, 65536,
@@ -2983,7 +2983,7 @@ xdnd_leave_filter (GdkXEvent *xev,
if ((display_x11->current_dest_drag != NULL) &&
(display_x11->current_dest_drag->protocol == GDK_DRAG_PROTO_XDND) &&
- (GDK_DRAWABLE_XID (display_x11->current_dest_drag->source_window) == source_window))
+ (GDK_WINDOW_XID (display_x11->current_dest_drag->source_window) == source_window))
{
event->dnd.type = GDK_DRAG_LEAVE;
/* Pass ownership of context to the event */
@@ -3028,7 +3028,7 @@ xdnd_position_filter (GdkXEvent *xev,
if ((display_x11->current_dest_drag != NULL) &&
(display_x11->current_dest_drag->protocol == GDK_DRAG_PROTO_XDND) &&
- (GDK_DRAWABLE_XID (display_x11->current_dest_drag->source_window) == source_window))
+ (GDK_WINDOW_XID (display_x11->current_dest_drag->source_window) == source_window))
{
event->dnd.type = GDK_DRAG_MOTION;
event->dnd.context = display_x11->current_dest_drag;
@@ -3080,7 +3080,7 @@ xdnd_drop_filter (GdkXEvent *xev,
if ((display_x11->current_dest_drag != NULL) &&
(display_x11->current_dest_drag->protocol == GDK_DRAG_PROTO_XDND) &&
- (GDK_DRAWABLE_XID (display_x11->current_dest_drag->source_window) == source_window))
+ (GDK_WINDOW_XID (display_x11->current_dest_drag->source_window) == source_window))
{
GdkDragContextPrivateX11 *private;
private = PRIVATE_DATA (display_x11->current_dest_drag);
@@ -3386,7 +3386,7 @@ gdk_drag_find_window_for_screen (GdkDragContext *context,
dest = get_client_window_at_coords (window_cache,
drag_window && GDK_WINDOW_IS_X11 (drag_window) ?
- GDK_DRAWABLE_XID (drag_window) : None,
+ GDK_WINDOW_XID (drag_window) : None,
x_root, y_root);
if (private->dest_xid != dest)
@@ -3478,7 +3478,7 @@ gdk_drag_motion (GdkDragContext *context,
GdkDisplay *display = GDK_WINDOW_DISPLAY (dest_window);
xdnd_check_dest (display,
- GDK_DRAWABLE_XID (dest_window),
+ GDK_WINDOW_XID (dest_window),
&private->version);
}
}
@@ -3498,8 +3498,8 @@ gdk_drag_motion (GdkDragContext *context,
GdkDragContext *dest_context;
dest_context = gdk_drag_context_find (display, FALSE,
- GDK_DRAWABLE_XID (context->source_window),
- GDK_DRAWABLE_XID (dest_window));
+ GDK_WINDOW_XID (context->source_window),
+ GDK_WINDOW_XID (dest_window));
if (dest_context)
{
@@ -3733,7 +3733,7 @@ gdk_drag_status (GdkDragContext *context,
xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display,
"_MOTIF_DRAG_AND_DROP_MESSAGE");
xev.xclient.format = 8;
- xev.xclient.window = GDK_DRAWABLE_XID (context->source_window);
+ xev.xclient.window = GDK_WINDOW_XID (context->source_window);
if (private->drag_status == GDK_DRAG_STATUS_ACTION_WAIT)
{
@@ -3795,20 +3795,20 @@ gdk_drag_status (GdkDragContext *context,
MOTIF_XCLIENT_LONG (&xev, 4) = 0;
if (!_gdk_send_xevent (display,
- GDK_DRAWABLE_XID (context->source_window),
+ GDK_WINDOW_XID (context->source_window),
FALSE, 0, &xev))
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
- GDK_DRAWABLE_XID (context->source_window)));
+ GDK_WINDOW_XID (context->source_window)));
}
else if (context->protocol == GDK_DRAG_PROTO_XDND)
{
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "XdndStatus");
xev.xclient.format = 32;
- xev.xclient.window = GDK_DRAWABLE_XID (context->source_window);
+ xev.xclient.window = GDK_WINDOW_XID (context->source_window);
- xev.xclient.data.l[0] = GDK_DRAWABLE_XID (context->dest_window);
+ xev.xclient.data.l[0] = GDK_WINDOW_XID (context->dest_window);
xev.xclient.data.l[1] = (action != 0) ? (2 | 1) : 0;
xev.xclient.data.l[2] = 0;
xev.xclient.data.l[3] = 0;
@@ -3818,7 +3818,7 @@ gdk_drag_status (GdkDragContext *context,
FALSE, &xev))
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
- GDK_DRAWABLE_XID (context->source_window)));
+ GDK_WINDOW_XID (context->source_window)));
}
private->old_action = action;
@@ -3875,7 +3875,7 @@ gdk_drop_reply (GdkDragContext *context,
MOTIF_XCLIENT_LONG (&xev, 4) = 0;
_gdk_send_xevent (display,
- GDK_DRAWABLE_XID (context->source_window),
+ GDK_WINDOW_XID (context->source_window),
FALSE, 0, &xev);
}
}
@@ -3905,9 +3905,9 @@ gdk_drop_finish (GdkDragContext *context,
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "XdndFinished");
xev.xclient.format = 32;
- xev.xclient.window = GDK_DRAWABLE_XID (context->source_window);
+ xev.xclient.window = GDK_WINDOW_XID (context->source_window);
- xev.xclient.data.l[0] = GDK_DRAWABLE_XID (context->dest_window);
+ xev.xclient.data.l[0] = GDK_WINDOW_XID (context->dest_window);
if (success)
{
xev.xclient.data.l[1] = 1;
@@ -3926,7 +3926,7 @@ gdk_drop_finish (GdkDragContext *context,
FALSE, &xev))
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
- GDK_DRAWABLE_XID (context->source_window)));
+ GDK_WINDOW_XID (context->source_window)));
}
}
@@ -3970,7 +3970,7 @@ gdk_window_register_dnd (GdkWindow *window)
info.num_drop_sites = 0;
info.total_size = sizeof(info);
- XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_DRAWABLE_XID (window),
+ XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window),
motif_drag_receiver_info_atom,
motif_drag_receiver_info_atom,
8, PropModeReplace,
@@ -3981,7 +3981,7 @@ gdk_window_register_dnd (GdkWindow *window)
/* The property needs to be of type XA_ATOM, not XA_INTEGER. Blech */
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_DRAWABLE_XID (window),
+ GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "XdndAware"),
XA_ATOM, 32, PropModeReplace,
(guchar *)&xdnd_version, 1);
diff --git a/gdk/x11/gdkdrawable-x11.c b/gdk/x11/gdkdrawable-x11.c
deleted file mode 100644
index a35a54b40e..0000000000
--- a/gdk/x11/gdkdrawable-x11.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/* GIMP Drawing Kit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
- * file for a list of people on the GTK+ Team. See the ChangeLog
- * files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
- */
-
-#include "config.h"
-
-#include "gdkdrawable-x11.h"
-
-#include "gdkx.h"
-#include "gdkprivate-x11.h"
-#include "gdkscreen-x11.h"
-#include "gdkdisplay-x11.h"
-
-#include <cairo-xlib.h>
-
-#include <stdlib.h>
-#include <string.h>
-
-
-static cairo_surface_t *gdk_x11_ref_cairo_surface (GdkDrawable *drawable);
-static cairo_surface_t *gdk_x11_create_cairo_surface (GdkDrawable *drawable,
- int width,
- int height);
-
-static const cairo_user_data_key_t gdk_x11_cairo_key;
-
-G_DEFINE_TYPE (GdkDrawableImplX11, _gdk_drawable_impl_x11, GDK_TYPE_DRAWABLE)
-
-static void
-_gdk_drawable_impl_x11_class_init (GdkDrawableImplX11Class *klass)
-{
- GdkDrawableClass *drawable_class = GDK_DRAWABLE_CLASS (klass);
-
- drawable_class->ref_cairo_surface = gdk_x11_ref_cairo_surface;
- drawable_class->create_cairo_surface = gdk_x11_create_cairo_surface;
-}
-
-static void
-_gdk_drawable_impl_x11_init (GdkDrawableImplX11 *impl)
-{
-}
-
-/**
- * _gdk_x11_drawable_finish:
- * @drawable: a #GdkDrawableImplX11.
- *
- * Performs necessary cleanup prior to destroying a window.
- **/
-void
-_gdk_x11_drawable_finish (GdkDrawable *drawable)
-{
- GdkDrawableImplX11 *impl = GDK_DRAWABLE_IMPL_X11 (drawable);
-
- if (impl->cairo_surface)
- {
- cairo_surface_finish (impl->cairo_surface);
- cairo_surface_set_user_data (impl->cairo_surface, &gdk_x11_cairo_key,
- NULL, NULL);
- }
-}
-
-/**
- * _gdk_x11_drawable_update_size:
- * @drawable: a #GdkDrawableImplX11.
- *
- * Updates the state of the drawable (in particular the drawable's
- * cairo surface) when its size has changed.
- **/
-void
-_gdk_x11_drawable_update_size (GdkDrawable *drawable)
-{
- GdkDrawableImplX11 *impl = GDK_DRAWABLE_IMPL_X11 (drawable);
-
- if (impl->cairo_surface)
- {
- cairo_xlib_surface_set_size (impl->cairo_surface,
- gdk_window_get_width (impl->wrapper),
- gdk_window_get_height (impl->wrapper));
- }
-}
-
-/*****************************************************
- * X11 specific implementations of generic functions *
- *****************************************************/
-
-static GdkDrawable *
-get_impl_drawable (GdkDrawable *drawable)
-{
- if (GDK_IS_WINDOW (drawable))
- return ((GdkWindowObject *)drawable)->impl;
- else
- {
- g_warning (G_STRLOC " drawable is not a window");
- return NULL;
- }
-}
-
-/**
- * gdk_x11_drawable_get_xdisplay:
- * @drawable: a #GdkDrawable.
- *
- * Returns the display of a #GdkDrawable.
- *
- * Return value: an Xlib <type>Display*</type>.
- **/
-Display *
-gdk_x11_drawable_get_xdisplay (GdkDrawable *drawable)
-{
- if (GDK_IS_DRAWABLE_IMPL_X11 (drawable))
- return GDK_SCREEN_XDISPLAY (GDK_DRAWABLE_IMPL_X11 (drawable)->screen);
- else
- return GDK_SCREEN_XDISPLAY (GDK_DRAWABLE_IMPL_X11 (get_impl_drawable (drawable))->screen);
-}
-
-/**
- * gdk_x11_drawable_get_xid:
- * @drawable: a #GdkDrawable.
- *
- * Returns the X resource (window) belonging to a #GdkDrawable.
- *
- * Return value: the ID of @drawable's X resource.
- **/
-XID
-gdk_x11_drawable_get_xid (GdkDrawable *drawable)
-{
- GdkDrawable *impl;
-
- if (GDK_IS_WINDOW (drawable))
- {
- GdkWindow *window = (GdkWindow *)drawable;
-
- /* Try to ensure the window has a native window */
- if (!_gdk_window_has_impl (window))
- {
- gdk_window_ensure_native (window);
-
- /* We sync here to ensure the window is created in the Xserver when
- * this function returns. This is required because the returned XID
- * for this window must be valid immediately, even with another
- * connection to the Xserver */
- gdk_display_sync (gdk_window_get_display (window));
- }
-
- if (!GDK_WINDOW_IS_X11 (window))
- {
- g_warning (G_STRLOC " drawable is not a native X11 window");
- return None;
- }
-
- impl = ((GdkWindowObject *)drawable)->impl;
- }
- else
- {
- g_warning (G_STRLOC " drawable is not a window");
- return None;
- }
-
- return ((GdkDrawableImplX11 *)impl)->xid;
-}
-
-GdkDrawable *
-gdk_x11_window_get_drawable_impl (GdkWindow *window)
-{
- return ((GdkWindowObject *)window)->impl;
-}
-
-static void
-gdk_x11_cairo_surface_destroy (void *data)
-{
- GdkDrawableImplX11 *impl = data;
-
- impl->cairo_surface = NULL;
-}
-
-static cairo_surface_t *
-gdk_x11_create_cairo_surface (GdkDrawable *drawable,
- int width,
- int height)
-{
- GdkDrawableImplX11 *impl = GDK_DRAWABLE_IMPL_X11 (drawable);
- GdkVisual *visual;
-
- visual = gdk_window_get_visual (impl->wrapper);
- return cairo_xlib_surface_create (GDK_SCREEN_XDISPLAY (impl->screen),
- impl->xid,
- GDK_VISUAL_XVISUAL (visual),
- width, height);
-}
-
-static cairo_surface_t *
-gdk_x11_ref_cairo_surface (GdkDrawable *drawable)
-{
- GdkDrawableImplX11 *impl = GDK_DRAWABLE_IMPL_X11 (drawable);
-
- if (GDK_IS_WINDOW_IMPL_X11 (drawable) &&
- GDK_WINDOW_DESTROYED (impl->wrapper))
- return NULL;
-
- if (!impl->cairo_surface)
- {
- impl->cairo_surface = gdk_x11_create_cairo_surface (drawable,
- gdk_window_get_width (impl->wrapper),
- gdk_window_get_height (impl->wrapper));
-
- if (impl->cairo_surface)
- cairo_surface_set_user_data (impl->cairo_surface, &gdk_x11_cairo_key,
- drawable, gdk_x11_cairo_surface_destroy);
- }
- else
- cairo_surface_reference (impl->cairo_surface);
-
- return impl->cairo_surface;
-}
diff --git a/gdk/x11/gdkdrawable-x11.h b/gdk/x11/gdkdrawable-x11.h
deleted file mode 100644
index e197766cba..0000000000
--- a/gdk/x11/gdkdrawable-x11.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* GDK - The GIMP Drawing Kit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
- * file for a list of people on the GTK+ Team. See the ChangeLog
- * files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
- */
-
-#ifndef __GDK_DRAWABLE_X11_H__
-#define __GDK_DRAWABLE_X11_H__
-
-#include <gdk/gdkdrawable.h>
-#include <X11/Xlib.h>
-
-G_BEGIN_DECLS
-
-/* Drawable implementation for X11
- */
-
-typedef struct _GdkDrawableImplX11 GdkDrawableImplX11;
-typedef struct _GdkDrawableImplX11Class GdkDrawableImplX11Class;
-
-#define GDK_TYPE_DRAWABLE_IMPL_X11 (_gdk_drawable_impl_x11_get_type ())
-#define GDK_DRAWABLE_IMPL_X11(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DRAWABLE_IMPL_X11, GdkDrawableImplX11))
-#define GDK_DRAWABLE_IMPL_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAWABLE_IMPL_X11, GdkDrawableImplX11Class))
-#define GDK_IS_DRAWABLE_IMPL_X11(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DRAWABLE_IMPL_X11))
-#define GDK_IS_DRAWABLE_IMPL_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAWABLE_IMPL_X11))
-#define GDK_DRAWABLE_IMPL_X11_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAWABLE_IMPL_X11, GdkDrawableImplX11Class))
-
-struct _GdkDrawableImplX11
-{
- GdkDrawable parent_instance;
-
- GdkDrawable *wrapper;
-
- Window xid;
- GdkScreen *screen;
-
- cairo_surface_t *cairo_surface;
-};
-
-struct _GdkDrawableImplX11Class
-{
- GdkDrawableClass parent_class;
-
-};
-
-GType _gdk_drawable_impl_x11_get_type (void);
-
-/* Note that the following take GdkDrawableImplX11, not the wrapper drawable */
-void _gdk_x11_drawable_finish (GdkDrawable *drawable);
-void _gdk_x11_drawable_update_size (GdkDrawable *drawable);
-GdkDrawable *gdk_x11_window_get_drawable_impl (GdkWindow *window);
-
-G_END_DECLS
-
-#endif /* __GDK_DRAWABLE_X11_H__ */
diff --git a/gdk/x11/gdkeventsource.c b/gdk/x11/gdkeventsource.c
index 7a23b59b2c..5f0c3a79e6 100644
--- a/gdk/x11/gdkeventsource.c
+++ b/gdk/x11/gdkeventsource.c
@@ -179,15 +179,14 @@ gdk_event_source_translate_event (GdkEventSource *event_source,
if (filter_window)
{
/* Apply per-window filters */
- GdkWindowObject *filter_private = (GdkWindowObject *) filter_window;
GdkFilterReturn result;
event->any.window = g_object_ref (filter_window);
- if (filter_private->filters)
+ if (filter_window->filters)
{
result = gdk_event_apply_filters (xevent, event,
- &filter_private->filters);
+ &filter_window->filters);
if (result == GDK_FILTER_REMOVE)
{
@@ -319,8 +318,7 @@ gdk_event_source_dispatch (GSource *source,
if (event)
{
- if (_gdk_event_func)
- (*_gdk_event_func) (event, _gdk_event_data);
+ _gdk_event_emit (event);
gdk_event_free (event);
}
diff --git a/gdk/x11/gdkgeometry-x11.c b/gdk/x11/gdkgeometry-x11.c
index a4b706273f..8ad8c24279 100644
--- a/gdk/x11/gdkgeometry-x11.c
+++ b/gdk/x11/gdkgeometry-x11.c
@@ -60,13 +60,9 @@ _gdk_window_move_resize_child (GdkWindow *window,
gint width,
gint height)
{
- GdkWindowObject *obj;
-
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
- obj = GDK_WINDOW_OBJECT (window);
-
if (width > 65535 ||
height > 65535)
{
@@ -78,10 +74,10 @@ _gdk_window_move_resize_child (GdkWindow *window,
height = 65535;
}
- obj->x = x;
- obj->y = y;
- obj->width = width;
- obj->height = height;
+ window->x = x;
+ window->y = y;
+ window->width = width;
+ window->height = height;
/* We don't really care about origin overflow, because on overflow
the window won't be visible anyway and thus it will be shaped
@@ -91,8 +87,8 @@ _gdk_window_move_resize_child (GdkWindow *window,
_gdk_x11_window_tmp_unset_bg (window, TRUE);
XMoveResizeWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
- obj->x + obj->parent->abs_x,
- obj->y + obj->parent->abs_y,
+ window->x + window->parent->abs_x,
+ window->y + window->parent->abs_y,
width, height);
_gdk_x11_window_tmp_reset_parent_bg (window);
_gdk_x11_window_tmp_reset_bg (window, TRUE);
@@ -227,15 +223,15 @@ gdk_window_queue (GdkWindow *window,
}
static GC
-_get_scratch_gc (GdkWindowObject *window, cairo_region_t *clip_region)
+_get_scratch_gc (GdkWindow *window, cairo_region_t *clip_region)
{
GdkScreenX11 *screen;
XRectangle *rectangles;
gint n_rects;
gint depth;
- screen = GDK_SCREEN_X11 (gdk_window_get_screen (GDK_WINDOW (window)));
- depth = gdk_visual_get_depth (gdk_window_get_visual (GDK_WINDOW (window))) - 1;
+ screen = GDK_SCREEN_X11 (gdk_window_get_screen (window));
+ depth = gdk_visual_get_depth (gdk_window_get_visual (window)) - 1;
if (!screen->subwindow_gcs[depth])
{
@@ -276,7 +272,7 @@ _gdk_x11_window_translate (GdkWindow *window,
GdkWindowQueueItem *item;
GC xgc;
GdkRectangle extents;
- GdkWindowObject *private, *impl;
+ GdkWindow *parent;
int px, py;
/* We need to get data from subwindows here, because we might have
@@ -285,19 +281,19 @@ _gdk_x11_window_translate (GdkWindow *window,
* from overlapping native window that are not children of this window,
* so we copy from the toplevel with INCLUDE_INFERIORS.
*/
- private = impl = (GdkWindowObject *) window;
+ parent = window;
px = py = 0;
- while (private->parent != NULL &&
- private->parent->window_type != GDK_WINDOW_ROOT)
+ while (parent->parent != NULL &&
+ parent->parent->window_type != GDK_WINDOW_ROOT)
{
- dx -= private->parent->abs_x + private->x;
- dy -= private->parent->abs_y + private->y;
- private = (GdkWindowObject *) _gdk_window_get_impl_window ((GdkWindow *) private->parent);
+ dx -= parent->parent->abs_x + parent->x;
+ dy -= parent->parent->abs_y + parent->y;
+ parent = _gdk_window_get_impl_window (parent->parent);
}
cairo_region_get_extents (area, &extents);
- xgc = _get_scratch_gc (impl, area);
+ xgc = _get_scratch_gc (window, area);
cairo_region_translate (area, -dx, -dy); /* Move to source region */
@@ -308,9 +304,9 @@ _gdk_x11_window_translate (GdkWindow *window,
item->u.translate.dy = dy;
gdk_window_queue (window, item);
- XCopyArea (GDK_WINDOW_XDISPLAY (impl),
- GDK_DRAWABLE_IMPL_X11 (private->impl)->xid,
- GDK_DRAWABLE_IMPL_X11 (impl->impl)->xid,
+ XCopyArea (GDK_WINDOW_XDISPLAY (window),
+ GDK_WINDOW_XID (parent),
+ GDK_WINDOW_XID (window),
xgc,
extents.x - dx, extents.y - dy,
extents.width, extents.height,
diff --git a/gdk/x11/gdkinput.c b/gdk/x11/gdkinput.c
index 559caaece4..bd41a428ea 100644
--- a/gdk/x11/gdkinput.c
+++ b/gdk/x11/gdkinput.c
@@ -66,7 +66,7 @@ _gdk_input_select_device_events (GdkWindow *impl_window,
GdkDevice *device)
{
guint event_mask;
- GdkWindowObject *w;
+ GdkWindow *w;
GdkInputWindow *iw;
GdkInputMode mode;
gboolean has_cursor;
@@ -74,7 +74,7 @@ _gdk_input_select_device_events (GdkWindow *impl_window,
GList *l;
event_mask = 0;
- iw = ((GdkWindowObject *)impl_window)->input_window;
+ iw = impl_window->input_window;
g_object_get (device,
"type", &type,
@@ -98,7 +98,7 @@ _gdk_input_select_device_events (GdkWindow *impl_window,
if (event_mask)
event_mask |= GDK_PROXIMITY_OUT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK;
- gdk_window_set_device_events ((GdkWindow *) w, device, event_mask);
+ gdk_window_set_device_events (w, device, event_mask);
}
}
}
@@ -106,18 +106,16 @@ _gdk_input_select_device_events (GdkWindow *impl_window,
static void
unset_extension_events (GdkWindow *window)
{
- GdkWindowObject *window_private;
- GdkWindowObject *impl_window;
+ GdkWindow *impl_window;
GdkDisplayX11 *display_x11;
GdkInputWindow *iw;
- window_private = (GdkWindowObject*) window;
- impl_window = (GdkWindowObject *)_gdk_window_get_impl_window (window);
+ impl_window = _gdk_window_get_impl_window (window);
iw = impl_window->input_window;
display_x11 = GDK_DISPLAY_X11 (GDK_WINDOW_DISPLAY (window));
- if (window_private->extension_events != 0)
+ if (window->extension_events != 0)
{
g_assert (iw != NULL);
g_assert (g_list_find (iw->windows, window) != NULL);
@@ -131,7 +129,7 @@ unset_extension_events (GdkWindow *window)
}
}
- window_private->extension_events = 0;
+ window->extension_events = 0;
}
/**
@@ -150,8 +148,7 @@ gdk_input_set_extension_events (GdkWindow *window,
gint mask,
GdkExtensionMode mode)
{
- GdkWindowObject *window_private;
- GdkWindowObject *impl_window;
+ GdkWindow *impl_window;
GdkInputWindow *iw;
GdkDisplayX11 *display_x11;
#ifndef XINPUT_NONE
@@ -161,12 +158,11 @@ gdk_input_set_extension_events (GdkWindow *window,
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_WINDOW_IS_X11 (window));
- window_private = (GdkWindowObject*) window;
display_x11 = GDK_DISPLAY_X11 (GDK_WINDOW_DISPLAY (window));
if (GDK_WINDOW_DESTROYED (window))
return;
- impl_window = (GdkWindowObject *)_gdk_window_get_impl_window (window);
+ impl_window = _gdk_window_get_impl_window (window);
if (mode == GDK_EXTENSION_EVENTS_ALL && mask != 0)
mask |= GDK_ALL_DEVICES_MASK;
@@ -190,9 +186,9 @@ gdk_input_set_extension_events (GdkWindow *window,
impl_window->input_window = iw;
}
- if (window_private->extension_events == 0)
+ if (window->extension_events == 0)
iw->windows = g_list_append (iw->windows, window);
- window_private->extension_events = mask;
+ window->extension_events = mask;
}
else
{
diff --git a/gdk/x11/gdkkeys-x11.c b/gdk/x11/gdkkeys-x11.c
index 20bb6ee4ef..1de8400fb3 100644
--- a/gdk/x11/gdkkeys-x11.c
+++ b/gdk/x11/gdkkeys-x11.c
@@ -1609,14 +1609,13 @@ gdk_keymap_translate_keyboard_state (GdkKeymap *keymap,
/* Key handling not part of the keymap */
/**
* gdk_keyval_name:
+ * @keyval: a key value.
*
* Converts a key value into a symbolic name.
- * The names are the same as those in the
+ * The names are the same as those in the
* <filename>&lt;gdk/gdkkeysyms.h&gt;</filename> header file
* but without the leading "GDK_KEY_".
*
- * @keyval: a key value.
- *
* Return value: (transfer none): a string containing the name of the key, or
* %NULL if @keyval is not a valid key. The string should not be modified.
**/
diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h
index bfcf1e38f8..ee5e1a76d9 100644
--- a/gdk/x11/gdkprivate-x11.h
+++ b/gdk/x11/gdkprivate-x11.h
@@ -143,20 +143,18 @@ cairo_surface_t * _gdk_x11_window_create_bitmap_surface (GdkWindow *window,
int width,
int height);
-extern GdkDrawableClass _gdk_x11_drawable_class;
extern gboolean _gdk_use_xshm;
extern const int _gdk_nenvent_masks;
extern const int _gdk_event_mask_table[];
extern GdkAtom _gdk_selection_property;
extern gboolean _gdk_synchronize;
-#define GDK_DRAWABLE_XROOTWIN(win) (GDK_WINDOW_XROOTWIN (win))
#define GDK_SCREEN_DISPLAY(screen) (GDK_SCREEN_X11 (screen)->display)
#define GDK_SCREEN_XROOTWIN(screen) (GDK_SCREEN_X11 (screen)->xroot_window)
-#define GDK_WINDOW_SCREEN(win) (GDK_DRAWABLE_IMPL_X11 (((GdkWindowObject *)win)->impl)->screen)
+#define GDK_WINDOW_SCREEN(win) (gdk_window_get_screen (win))
#define GDK_WINDOW_DISPLAY(win) (GDK_SCREEN_X11 (GDK_WINDOW_SCREEN (win))->display)
#define GDK_WINDOW_XROOTWIN(win) (GDK_SCREEN_X11 (GDK_WINDOW_SCREEN (win))->xroot_window)
#define GDK_GC_DISPLAY(gc) (GDK_SCREEN_DISPLAY (GDK_GC_X11(gc)->screen))
-#define GDK_WINDOW_IS_X11(win) (GDK_IS_WINDOW_IMPL_X11 (((GdkWindowObject *)win)->impl))
+#define GDK_WINDOW_IS_X11(win) (GDK_IS_WINDOW_IMPL_X11 ((win)->impl))
#endif /* __GDK_PRIVATE_X11_H__ */
diff --git a/gdk/x11/gdkproperty-x11.c b/gdk/x11/gdkproperty-x11.c
index b55cd42e5f..00132b29e1 100644
--- a/gdk/x11/gdkproperty-x11.c
+++ b/gdk/x11/gdkproperty-x11.c
@@ -703,7 +703,7 @@ gdk_property_get (GdkWindow *window,
}
res = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_WINDOW_XWINDOW (window), xproperty,
+ GDK_WINDOW_XID (window), xproperty,
offset, get_length, pdelete,
xtype, &ret_prop_type, &ret_format,
&ret_nitems, &ret_bytes_after,
@@ -892,7 +892,7 @@ gdk_property_delete (GdkWindow *window,
if (GDK_WINDOW_DESTROYED (window))
return;
- XDeleteProperty (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XWINDOW (window),
+ XDeleteProperty (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window),
gdk_x11_atom_to_xatom_for_display (GDK_WINDOW_DISPLAY (window),
property));
}
diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c
index 90d35dc5d8..5927378839 100644
--- a/gdk/x11/gdkscreen-x11.c
+++ b/gdk/x11/gdkscreen-x11.c
@@ -450,7 +450,7 @@ gdk_x11_screen_get_monitor_output (GdkScreen *screen,
* gdk_screen_get_monitor_geometry:
* @screen: a #GdkScreen
* @monitor_num: the monitor number, between 0 and gdk_screen_get_n_monitors (screen)
- * @dest: a #GdkRectangle to be filled with the monitor geometry
+ * @dest: (out) (allow-none): a #GdkRectangle to be filled with the monitor geometry
*
* Retrieves the #GdkRectangle representing the size and position of
* the individual monitor within the entire screen area.
diff --git a/gdk/x11/gdkselection-x11.c b/gdk/x11/gdkselection-x11.c
index 41be49ed93..00390aa34f 100644
--- a/gdk/x11/gdkselection-x11.c
+++ b/gdk/x11/gdkselection-x11.c
@@ -88,7 +88,7 @@ _gdk_selection_filter_clear_event (XSelectionClearEvent *event)
if (gdk_window_get_display (info->owner) == display &&
info->selection == gdk_x11_xatom_to_atom_for_display (display, event->selection))
{
- if ((GDK_DRAWABLE_XID (info->owner) == event->window &&
+ if ((GDK_WINDOW_XID (info->owner) == event->window &&
event->serial >= info->serial))
{
owner_list = g_slist_remove (owner_list, info);
@@ -296,8 +296,8 @@ gdk_selection_property_get (GdkWindow *requestor,
protocol, in which case the client has to make sure they'll be
notified of PropertyChange events _before_ the property is deleted.
Otherwise there's no guarantee we'll win the race ... */
- if (XGetWindowProperty (GDK_DRAWABLE_XDISPLAY (requestor),
- GDK_DRAWABLE_XID (requestor),
+ if (XGetWindowProperty (GDK_WINDOW_XDISPLAY (requestor),
+ GDK_WINDOW_XID (requestor),
gdk_x11_atom_to_xatom_for_display (display, _gdk_selection_property),
0, 0x1FFFFFFF /* MAXINT32 / 4 */, False,
AnyPropertyType, &prop_type, &prop_format,
diff --git a/gdk/x11/gdktestutils-x11.c b/gdk/x11/gdktestutils-x11.c
index d4d47fbad7..960301b1e3 100644
--- a/gdk/x11/gdktestutils-x11.c
+++ b/gdk/x11/gdktestutils-x11.c
@@ -41,7 +41,7 @@
void
gdk_test_render_sync (GdkWindow *window)
{
- Display *display = gdk_x11_drawable_get_xdisplay (window);
+ Display *display = GDK_WINDOW_XDISPLAY (window);
XImage *ximage;
/* syncronize to X drawing queue, see:
@@ -94,7 +94,6 @@ gdk_test_simulate_key (GdkWindow *window,
{
GdkScreen *screen;
GdkKeymapKey *keys = NULL;
- GdkWindowObject *priv;
gboolean success;
gint n_keys = 0;
XKeyEvent xev = {
@@ -108,20 +107,19 @@ gdk_test_simulate_key (GdkWindow *window,
return FALSE;
screen = gdk_window_get_screen (window);
- priv = (GdkWindowObject *)window;
if (x < 0 && y < 0)
{
- x = priv->width / 2;
- y = priv->height / 2;
+ x = window->width / 2;
+ y = window->height / 2;
}
/* Convert to impl coordinates */
- x = x + priv->abs_x;
- y = y + priv->abs_y;
+ x = x + window->abs_x;
+ y = y + window->abs_y;
xev.type = key_pressrelease == GDK_KEY_PRESS ? KeyPress : KeyRelease;
- xev.display = GDK_DRAWABLE_XDISPLAY (window);
+ xev.display = GDK_WINDOW_XDISPLAY (window);
xev.window = GDK_WINDOW_XID (window);
xev.root = RootWindow (xev.display, GDK_SCREEN_XNUMBER (screen));
xev.subwindow = 0;
@@ -206,7 +204,6 @@ gdk_test_simulate_button (GdkWindow *window,
1, /* send_event */
};
gboolean success;
- GdkWindowObject *priv;
g_return_val_if_fail (button_pressrelease == GDK_BUTTON_PRESS || button_pressrelease == GDK_BUTTON_RELEASE, FALSE);
g_return_val_if_fail (window != NULL, FALSE);
@@ -215,20 +212,19 @@ gdk_test_simulate_button (GdkWindow *window,
return FALSE;
screen = gdk_window_get_screen (window);
- priv = (GdkWindowObject *)window;
if (x < 0 && y < 0)
{
- x = priv->width / 2;
- y = priv->height / 2;
+ x = window->width / 2;
+ y = window->height / 2;
}
/* Convert to impl coordinates */
- x = x + priv->abs_x;
- y = y + priv->abs_y;
+ x = x + window->abs_x;
+ y = y + window->abs_y;
xev.type = button_pressrelease == GDK_BUTTON_PRESS ? ButtonPress : ButtonRelease;
- xev.display = GDK_DRAWABLE_XDISPLAY (window);
+ xev.display = GDK_WINDOW_XDISPLAY (window);
xev.window = GDK_WINDOW_XID (window);
xev.root = RootWindow (xev.display, GDK_SCREEN_XNUMBER (screen));
xev.subwindow = 0;
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index ec9071077e..725f77a61b 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -109,7 +109,6 @@ static void gdk_window_x11_set_background (GdkWindow *window,
cairo_pattern_t *pattern);
static void gdk_window_impl_x11_finalize (GObject *object);
-static void gdk_window_impl_iface_init (GdkWindowImplIface *iface);
#define WINDOW_IS_TOPLEVEL_OR_FOREIGN(window) \
(GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD && \
@@ -128,17 +127,7 @@ static void gdk_window_impl_iface_init (GdkWindowImplIface *iface);
(( time1 < time2 ) && ( time2 - time1 > ((guint32)-1)/2 )) \
)
-G_DEFINE_TYPE_WITH_CODE (GdkWindowImplX11,
- gdk_window_impl_x11,
- GDK_TYPE_DRAWABLE_IMPL_X11,
- G_IMPLEMENT_INTERFACE (GDK_TYPE_WINDOW_IMPL,
- gdk_window_impl_iface_init));
-
-GType
-_gdk_window_impl_get_type (void)
-{
- return gdk_window_impl_x11_get_type ();
-}
+G_DEFINE_TYPE (GdkWindowImplX11, gdk_window_impl_x11, GDK_TYPE_WINDOW_IMPL)
static void
gdk_window_impl_x11_init (GdkWindowImplX11 *impl)
@@ -151,7 +140,6 @@ gdk_window_impl_x11_init (GdkWindowImplX11 *impl)
GdkToplevelX11 *
_gdk_x11_window_get_toplevel (GdkWindow *window)
{
- GdkWindowObject *private;
GdkWindowImplX11 *impl;
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
@@ -159,8 +147,7 @@ _gdk_x11_window_get_toplevel (GdkWindow *window)
if (!WINDOW_IS_TOPLEVEL (window))
return NULL;
- private = (GdkWindowObject *)window;
- impl = GDK_WINDOW_IMPL_X11 (private->impl);
+ impl = GDK_WINDOW_IMPL_X11 (window->impl);
if (!impl->toplevel)
impl->toplevel = g_new0 (GdkToplevelX11, 1);
@@ -168,45 +155,105 @@ _gdk_x11_window_get_toplevel (GdkWindow *window)
return impl->toplevel;
}
+static const cairo_user_data_key_t gdk_x11_cairo_key;
+
+/**
+ * _gdk_x11_window_update_size:
+ * @impl: a #GdkWindowImplX11.
+ *
+ * Updates the state of the window (in particular the drawable's
+ * cairo surface) when its size has changed.
+ **/
+void
+_gdk_x11_window_update_size (GdkWindowImplX11 *impl)
+{
+ if (impl->cairo_surface)
+ {
+ cairo_xlib_surface_set_size (impl->cairo_surface,
+ gdk_window_get_width (impl->wrapper),
+ gdk_window_get_height (impl->wrapper));
+ }
+}
+
+/*****************************************************
+ * X11 specific implementations of generic functions *
+ *****************************************************/
+
static void
-gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass)
+gdk_x11_cairo_surface_destroy (void *data)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- object_class->finalize = gdk_window_impl_x11_finalize;
+ GdkWindowImplX11 *impl = data;
+
+ impl->cairo_surface = NULL;
+}
+
+static cairo_surface_t *
+gdk_x11_create_cairo_surface (GdkWindowImplX11 *impl,
+ int width,
+ int height)
+{
+ GdkVisual *visual;
+
+ visual = gdk_window_get_visual (impl->wrapper);
+ return cairo_xlib_surface_create (GDK_WINDOW_XDISPLAY (impl->wrapper),
+ GDK_WINDOW_IMPL_X11 (impl)->xid,
+ GDK_VISUAL_XVISUAL (visual),
+ width, height);
+}
+
+static cairo_surface_t *
+gdk_x11_ref_cairo_surface (GdkWindow *window)
+{
+ GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
+
+ if (GDK_WINDOW_DESTROYED (window))
+ return NULL;
+
+ if (!impl->cairo_surface)
+ {
+ impl->cairo_surface = gdk_x11_create_cairo_surface (impl,
+ gdk_window_get_width (window),
+ gdk_window_get_height (window));
+
+ if (impl->cairo_surface)
+ cairo_surface_set_user_data (impl->cairo_surface, &gdk_x11_cairo_key,
+ impl, gdk_x11_cairo_surface_destroy);
+ }
+ else
+ cairo_surface_reference (impl->cairo_surface);
+
+ return impl->cairo_surface;
}
static void
gdk_window_impl_x11_finalize (GObject *object)
{
- GdkWindowObject *wrapper;
- GdkDrawableImplX11 *draw_impl;
- GdkWindowImplX11 *window_impl;
+ GdkWindow *wrapper;
+ GdkWindowImplX11 *impl;
g_return_if_fail (GDK_IS_WINDOW_IMPL_X11 (object));
- draw_impl = GDK_DRAWABLE_IMPL_X11 (object);
- window_impl = GDK_WINDOW_IMPL_X11 (object);
+ impl = GDK_WINDOW_IMPL_X11 (object);
- wrapper = (GdkWindowObject*) draw_impl->wrapper;
+ wrapper = impl->wrapper;
- _gdk_xgrab_check_destroy (GDK_WINDOW (wrapper));
+ _gdk_xgrab_check_destroy (wrapper);
if (!GDK_WINDOW_DESTROYED (wrapper))
{
GdkDisplay *display = GDK_WINDOW_DISPLAY (wrapper);
- _gdk_xid_table_remove (display, draw_impl->xid);
- if (window_impl->toplevel && window_impl->toplevel->focus_window)
- _gdk_xid_table_remove (display, window_impl->toplevel->focus_window);
+ _gdk_xid_table_remove (display, impl->xid);
+ if (impl->toplevel && impl->toplevel->focus_window)
+ _gdk_xid_table_remove (display, impl->toplevel->focus_window);
}
- g_free (window_impl->toplevel);
+ g_free (impl->toplevel);
- if (window_impl->cursor)
- gdk_cursor_unref (window_impl->cursor);
+ if (impl->cursor)
+ gdk_cursor_unref (impl->cursor);
- g_hash_table_destroy (window_impl->device_cursor);
+ g_hash_table_destroy (impl->device_cursor);
G_OBJECT_CLASS (gdk_window_impl_x11_parent_class)->finalize (object);
}
@@ -299,29 +346,25 @@ static void
tmp_unset_bg (GdkWindow *window)
{
GdkWindowImplX11 *impl;
- GdkWindowObject *obj;
- obj = (GdkWindowObject *) window;
- impl = GDK_WINDOW_IMPL_X11 (obj->impl);
+ impl = GDK_WINDOW_IMPL_X11 (window->impl);
impl->no_bg = TRUE;
- XSetWindowBackgroundPixmap (GDK_DRAWABLE_XDISPLAY (window),
- GDK_DRAWABLE_XID (window), None);
+ XSetWindowBackgroundPixmap (GDK_WINDOW_XDISPLAY (window),
+ GDK_WINDOW_XID (window), None);
}
static void
tmp_reset_bg (GdkWindow *window)
{
GdkWindowImplX11 *impl;
- GdkWindowObject *obj;
- obj = (GdkWindowObject *) window;
- impl = GDK_WINDOW_IMPL_X11 (obj->impl);
+ impl = GDK_WINDOW_IMPL_X11 (window->impl);
impl->no_bg = FALSE;
- gdk_window_x11_set_background (window, obj->background);
+ gdk_window_x11_set_background (window, window->background);
}
/* Unsetting and resetting window backgrounds.
@@ -335,28 +378,24 @@ void
_gdk_x11_window_tmp_unset_bg (GdkWindow *window,
gboolean recurse)
{
- GdkWindowObject *private;
-
g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowObject *)window;
-
- if (private->input_only || private->destroyed ||
- (private->window_type != GDK_WINDOW_ROOT &&
+ if (window->input_only || window->destroyed ||
+ (window->window_type != GDK_WINDOW_ROOT &&
!GDK_WINDOW_IS_MAPPED (window)))
return;
if (_gdk_window_has_impl (window) &&
GDK_WINDOW_IS_X11 (window) &&
- private->window_type != GDK_WINDOW_ROOT &&
- private->window_type != GDK_WINDOW_FOREIGN)
+ window->window_type != GDK_WINDOW_ROOT &&
+ window->window_type != GDK_WINDOW_FOREIGN)
tmp_unset_bg (window);
if (recurse)
{
GList *l;
- for (l = private->children; l != NULL; l = l->next)
+ for (l = window->children; l != NULL; l = l->next)
_gdk_x11_window_tmp_unset_bg (l->data, TRUE);
}
}
@@ -364,13 +403,10 @@ _gdk_x11_window_tmp_unset_bg (GdkWindow *window,
void
_gdk_x11_window_tmp_unset_parent_bg (GdkWindow *window)
{
- GdkWindowObject *private;
- private = (GdkWindowObject*) window;
-
- if (GDK_WINDOW_TYPE (private->parent) == GDK_WINDOW_ROOT)
+ if (GDK_WINDOW_TYPE (window->parent) == GDK_WINDOW_ROOT)
return;
- window = _gdk_window_get_impl_window ((GdkWindow *)private->parent);
+ window = _gdk_window_get_impl_window (window->parent);
_gdk_x11_window_tmp_unset_bg (window, FALSE);
}
@@ -378,29 +414,25 @@ void
_gdk_x11_window_tmp_reset_bg (GdkWindow *window,
gboolean recurse)
{
- GdkWindowObject *private;
-
g_return_if_fail (GDK_IS_WINDOW (window));
- private = (GdkWindowObject *)window;
-
- if (private->input_only || private->destroyed ||
- (private->window_type != GDK_WINDOW_ROOT &&
+ if (window->input_only || window->destroyed ||
+ (window->window_type != GDK_WINDOW_ROOT &&
!GDK_WINDOW_IS_MAPPED (window)))
return;
if (_gdk_window_has_impl (window) &&
GDK_WINDOW_IS_X11 (window) &&
- private->window_type != GDK_WINDOW_ROOT &&
- private->window_type != GDK_WINDOW_FOREIGN)
+ window->window_type != GDK_WINDOW_ROOT &&
+ window->window_type != GDK_WINDOW_FOREIGN)
tmp_reset_bg (window);
if (recurse)
{
GList *l;
- for (l = private->children; l != NULL; l = l->next)
+ for (l = window->children; l != NULL; l = l->next)
_gdk_x11_window_tmp_reset_bg (l->data, TRUE);
}
}
@@ -408,13 +440,10 @@ _gdk_x11_window_tmp_reset_bg (GdkWindow *window,
void
_gdk_x11_window_tmp_reset_parent_bg (GdkWindow *window)
{
- GdkWindowObject *private;
- private = (GdkWindowObject*) window;
-
- if (GDK_WINDOW_TYPE (private->parent) == GDK_WINDOW_ROOT)
+ if (GDK_WINDOW_TYPE (window->parent) == GDK_WINDOW_ROOT)
return;
- window = _gdk_window_get_impl_window ((GdkWindow *)private->parent);
+ window = _gdk_window_get_impl_window (window->parent);
_gdk_x11_window_tmp_reset_bg (window, FALSE);
}
@@ -422,40 +451,38 @@ _gdk_x11_window_tmp_reset_parent_bg (GdkWindow *window)
void
_gdk_windowing_window_init (GdkScreen * screen)
{
- GdkWindowObject *private;
- GdkDrawableImplX11 *draw_impl;
+ GdkWindow *window;
+ GdkWindowImplX11 *impl;
GdkScreenX11 *screen_x11;
screen_x11 = GDK_SCREEN_X11 (screen);
g_assert (screen_x11->root_window == NULL);
- screen_x11->root_window = g_object_new (GDK_TYPE_WINDOW, NULL);
+ window = screen_x11->root_window = g_object_new (GDK_TYPE_WINDOW, NULL);
- private = (GdkWindowObject *) screen_x11->root_window;
- private->impl = g_object_new (_gdk_window_impl_get_type (), NULL);
- private->impl_window = private;
- private->visual = gdk_screen_get_system_visual (screen);
+ window->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_X11, NULL);
+ window->impl_window = window;
+ window->visual = gdk_screen_get_system_visual (screen);
- draw_impl = GDK_DRAWABLE_IMPL_X11 (private->impl);
+ impl = GDK_WINDOW_IMPL_X11 (window->impl);
- draw_impl->screen = screen;
- draw_impl->xid = screen_x11->xroot_window;
- draw_impl->wrapper = GDK_DRAWABLE (private);
+ impl->xid = screen_x11->xroot_window;
+ impl->wrapper = window;
- private->window_type = GDK_WINDOW_ROOT;
- private->depth = DefaultDepthOfScreen (screen_x11->xscreen);
+ window->window_type = GDK_WINDOW_ROOT;
+ window->depth = DefaultDepthOfScreen (screen_x11->xscreen);
- private->x = 0;
- private->y = 0;
- private->abs_x = 0;
- private->abs_y = 0;
- private->width = WidthOfScreen (screen_x11->xscreen);
- private->height = HeightOfScreen (screen_x11->xscreen);
- private->viewable = TRUE;
+ window->x = 0;
+ window->y = 0;
+ window->abs_x = 0;
+ window->abs_y = 0;
+ window->width = WidthOfScreen (screen_x11->xscreen);
+ window->height = HeightOfScreen (screen_x11->xscreen);
+ window->viewable = TRUE;
/* see init_randr_support() in gdkscreen-x11.c */
- private->event_mask = GDK_STRUCTURE_MASK;
+ window->event_mask = GDK_STRUCTURE_MASK;
_gdk_window_update_size (screen_x11->root_window);
@@ -551,8 +578,7 @@ ensure_sync_counter (GdkWindow *window)
{
GdkDisplay *display = GDK_WINDOW_DISPLAY (window);
GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window);
- GdkWindowObject *private = (GdkWindowObject *)window;
- GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (private->impl);
+ GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
if (toplevel && impl->use_synchronized_configure &&
toplevel->update_counter == None &&
@@ -584,7 +610,6 @@ static void
setup_toplevel_window (GdkWindow *window,
GdkWindow *parent)
{
- GdkWindowObject *obj = (GdkWindowObject *)window;
GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window);
GdkDisplay *display = gdk_window_get_display (window);
Display *xdisplay = GDK_WINDOW_XDISPLAY (window);
@@ -596,7 +621,7 @@ setup_toplevel_window (GdkWindow *window,
set_wm_protocols (window);
- if (!obj->input_only)
+ if (!window->input_only)
{
/* The focus window is off the visible area, and serves to receive key
* press events so they don't get sent to child windows.
@@ -612,8 +637,8 @@ setup_toplevel_window (GdkWindow *window,
* correct value???
*/
size_hints.flags = PSize;
- size_hints.width = obj->width;
- size_hints.height = obj->height;
+ size_hints.width = window->width;
+ size_hints.height = window->height;
XSetWMNormalHints (xdisplay, xid, &size_hints);
@@ -641,7 +666,7 @@ setup_toplevel_window (GdkWindow *window,
XA_WINDOW, 32, PropModeReplace,
(guchar *) &toplevel->focus_window, 1);
- if (!obj->focus_on_map)
+ if (!window->focus_on_map)
gdk_x11_window_set_user_time (window, 0);
else if (GDK_DISPLAY_X11 (screen_x11->display)->user_time != 0)
gdk_x11_window_set_user_time (window, GDK_DISPLAY_X11 (screen_x11->display)->user_time);
@@ -657,16 +682,13 @@ _gdk_window_impl_new (GdkWindow *window,
GdkWindowAttr *attributes,
gint attributes_mask)
{
- GdkWindowObject *private;
GdkWindowImplX11 *impl;
- GdkDrawableImplX11 *draw_impl;
GdkScreenX11 *screen_x11;
GdkDisplayX11 *display_x11;
Window xparent;
Visual *xvisual;
Display *xdisplay;
- Window xid;
XSetWindowAttributes xattributes;
long xattributes_mask;
@@ -675,23 +697,19 @@ _gdk_window_impl_new (GdkWindow *window,
unsigned int class;
const char *title;
- private = (GdkWindowObject *) window;
-
screen_x11 = GDK_SCREEN_X11 (screen);
xparent = GDK_WINDOW_XID (real_parent);
display_x11 = GDK_DISPLAY_X11 (GDK_SCREEN_DISPLAY (screen));
- impl = g_object_new (_gdk_window_impl_get_type (), NULL);
- private->impl = (GdkDrawable *)impl;
- draw_impl = GDK_DRAWABLE_IMPL_X11 (impl);
- draw_impl->wrapper = GDK_DRAWABLE (window);
+ impl = g_object_new (GDK_TYPE_WINDOW_IMPL_X11, NULL);
+ window->impl = GDK_WINDOW_IMPL (impl);
+ impl->wrapper = GDK_WINDOW (window);
- draw_impl->screen = screen;
xdisplay = screen_x11->xdisplay;
xattributes_mask = 0;
- xvisual = gdk_x11_visual_get_xvisual (private->visual);
+ xvisual = gdk_x11_visual_get_xvisual (window->visual);
if (attributes_mask & GDK_WA_NOREDIR)
{
@@ -704,25 +722,25 @@ _gdk_window_impl_new (GdkWindow *window,
impl->override_redirect = xattributes.override_redirect;
- if (private->parent && private->parent->guffaw_gravity)
+ if (window->parent && window->parent->guffaw_gravity)
{
xattributes.win_gravity = StaticGravity;
xattributes_mask |= CWWinGravity;
}
/* Sanity checks */
- switch (private->window_type)
+ switch (window->window_type)
{
case GDK_WINDOW_TOPLEVEL:
case GDK_WINDOW_TEMP:
- if (GDK_WINDOW_TYPE (private->parent) != GDK_WINDOW_ROOT)
+ if (GDK_WINDOW_TYPE (window->parent) != GDK_WINDOW_ROOT)
{
/* The common code warns for this case */
xparent = GDK_SCREEN_XROOTWIN (screen);
}
}
- if (!private->input_only)
+ if (!window->input_only)
{
class = InputOutput;
@@ -731,17 +749,17 @@ _gdk_window_impl_new (GdkWindow *window,
xattributes.border_pixel = BlackPixel (xdisplay, screen_x11->screen_num);
xattributes_mask |= CWBorderPixel | CWBackPixel;
- if (private->guffaw_gravity)
+ if (window->guffaw_gravity)
xattributes.bit_gravity = StaticGravity;
else
xattributes.bit_gravity = NorthWestGravity;
xattributes_mask |= CWBitGravity;
- xattributes.colormap = _gdk_visual_get_x11_colormap (private->visual);
+ xattributes.colormap = _gdk_visual_get_x11_colormap (window->visual);
xattributes_mask |= CWColormap;
- if (private->window_type == GDK_WINDOW_TEMP)
+ if (window->window_type == GDK_WINDOW_TEMP)
{
xattributes.save_under = True;
xattributes.override_redirect = True;
@@ -756,28 +774,28 @@ _gdk_window_impl_new (GdkWindow *window,
class = InputOnly;
}
- if (private->width > 65535 ||
- private->height > 65535)
+ if (window->width > 65535 ||
+ window->height > 65535)
{
g_warning ("Native Windows wider or taller than 65535 pixels are not supported");
- if (private->width > 65535)
- private->width = 65535;
- if (private->height > 65535)
- private->height = 65535;
+ if (window->width > 65535)
+ window->width = 65535;
+ if (window->height > 65535)
+ window->height = 65535;
}
- xid = draw_impl->xid = XCreateWindow (xdisplay, xparent,
- private->x + private->parent->abs_x,
- private->y + private->parent->abs_y,
- private->width, private->height,
- 0, private->depth, class, xvisual,
- xattributes_mask, &xattributes);
+ impl->xid = XCreateWindow (xdisplay, xparent,
+ window->x + window->parent->abs_x,
+ window->y + window->parent->abs_y,
+ window->width, window->height,
+ 0, window->depth, class, xvisual,
+ xattributes_mask, &xattributes);
g_object_ref (window);
- _gdk_xid_table_insert (screen_x11->display, &draw_impl->xid, window);
+ _gdk_xid_table_insert (screen_x11->display, &impl->xid, window);
- switch (GDK_WINDOW_TYPE (private))
+ switch (GDK_WINDOW_TYPE (window))
{
case GDK_WINDOW_TOPLEVEL:
case GDK_WINDOW_TEMP:
@@ -793,11 +811,11 @@ _gdk_window_impl_new (GdkWindow *window,
class_hint = XAllocClassHint ();
class_hint->res_name = attributes->wmclass_name;
class_hint->res_class = attributes->wmclass_class;
- XSetClassHint (xdisplay, xid, class_hint);
+ XSetClassHint (xdisplay, impl->xid, class_hint);
XFree (class_hint);
}
- setup_toplevel_window (window, (GdkWindow *)private->parent);
+ setup_toplevel_window (window, window->parent);
break;
case GDK_WINDOW_CHILD:
@@ -809,7 +827,7 @@ _gdk_window_impl_new (GdkWindow *window,
gdk_window_set_type_hint (window, attributes->type_hint);
gdk_event_source_select_events ((GdkEventSource *) display_x11->event_source,
- GDK_WINDOW_XWINDOW (window), event_mask,
+ GDK_WINDOW_XID (window), event_mask,
StructureNotifyMask | PropertyChangeMask);
}
@@ -853,9 +871,7 @@ gdk_window_foreign_new_for_display (GdkDisplay *display,
{
GdkScreen *screen;
GdkWindow *window;
- GdkWindowObject *private;
GdkWindowImplX11 *impl;
- GdkDrawableImplX11 *draw_impl;
GdkDisplayX11 *display_x11;
XWindowAttributes attrs;
Window root, parent;
@@ -889,42 +905,39 @@ gdk_window_foreign_new_for_display (GdkDisplay *display,
window = g_object_new (GDK_TYPE_WINDOW, NULL);
- private = (GdkWindowObject *) window;
- private->impl = g_object_new (_gdk_window_impl_get_type (), NULL);
- private->impl_window = private;
- private->visual = gdk_x11_screen_lookup_visual (screen,
+ window->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_X11, NULL);
+ window->impl_window = window;
+ window->visual = gdk_x11_screen_lookup_visual (screen,
XVisualIDFromVisual (attrs.visual));
- impl = GDK_WINDOW_IMPL_X11 (private->impl);
- draw_impl = GDK_DRAWABLE_IMPL_X11 (private->impl);
- draw_impl->wrapper = GDK_DRAWABLE (window);
- draw_impl->screen = screen;
+ impl = GDK_WINDOW_IMPL_X11 (window->impl);
+ impl->wrapper = window;
- private->parent = gdk_xid_table_lookup_for_display (display, parent);
+ window->parent = gdk_xid_table_lookup_for_display (display, parent);
- if (!private->parent || GDK_WINDOW_TYPE (private->parent) == GDK_WINDOW_FOREIGN)
- private->parent = (GdkWindowObject *) gdk_screen_get_root_window (draw_impl->screen);
+ if (!window->parent || GDK_WINDOW_TYPE (window->parent) == GDK_WINDOW_FOREIGN)
+ window->parent = gdk_screen_get_root_window (screen);
- private->parent->children = g_list_prepend (private->parent->children, window);
+ window->parent->children = g_list_prepend (window->parent->children, window);
- draw_impl->xid = anid;
+ impl->xid = anid;
- private->x = attrs.x;
- private->y = attrs.y;
- private->width = attrs.width;
- private->height = attrs.height;
- private->window_type = GDK_WINDOW_FOREIGN;
- private->destroyed = FALSE;
+ window->x = attrs.x;
+ window->y = attrs.y;
+ window->width = attrs.width;
+ window->height = attrs.height;
+ window->window_type = GDK_WINDOW_FOREIGN;
+ window->destroyed = FALSE;
- private->event_mask = x_event_mask_to_gdk_event_mask (attrs.your_event_mask);
+ window->event_mask = x_event_mask_to_gdk_event_mask (attrs.your_event_mask);
if (attrs.map_state == IsUnmapped)
- private->state = GDK_WINDOW_STATE_WITHDRAWN;
+ window->state = GDK_WINDOW_STATE_WITHDRAWN;
else
- private->state = 0;
- private->viewable = TRUE;
+ window->state = 0;
+ window->viewable = TRUE;
- private->depth = attrs.depth;
+ window->depth = attrs.depth;
g_object_ref (window);
_gdk_xid_table_insert (display, &GDK_WINDOW_XID (window), window);
@@ -1010,7 +1023,7 @@ _gdk_x11_window_destroy (GdkWindow *window,
gboolean recursing,
gboolean foreign_destroy)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
+ GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
GdkToplevelX11 *toplevel;
g_return_if_fail (GDK_IS_WINDOW (window));
@@ -1021,7 +1034,12 @@ _gdk_x11_window_destroy (GdkWindow *window,
if (toplevel)
gdk_toplevel_x11_free_contents (GDK_WINDOW_DISPLAY (window), toplevel);
- _gdk_x11_drawable_finish (private->impl);
+ if (impl->cairo_surface)
+ {
+ cairo_surface_finish (impl->cairo_surface);
+ cairo_surface_set_user_data (impl->cairo_surface, &gdk_x11_cairo_key,
+ NULL, NULL);
+ }
if (!recursing && !foreign_destroy)
{
@@ -1087,7 +1105,7 @@ gdk_window_destroy_notify (GdkWindow *window)
{
GdkWindowImplX11 *window_impl;
- window_impl = GDK_WINDOW_IMPL_X11 (((GdkWindowObject *)window)->impl);
+ window_impl = GDK_WINDOW_IMPL_X11 ((window)->impl);
if (!GDK_WINDOW_DESTROYED (window))
{
@@ -1111,20 +1129,19 @@ update_wm_hints (GdkWindow *window,
gboolean force)
{
GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window);
- GdkWindowObject *private = (GdkWindowObject *)window;
GdkDisplay *display = GDK_WINDOW_DISPLAY (window);
XWMHints wm_hints;
if (!force &&
!toplevel->is_leader &&
- private->state & GDK_WINDOW_STATE_WITHDRAWN)
+ window->state & GDK_WINDOW_STATE_WITHDRAWN)
return;
wm_hints.flags = StateHint | InputHint;
- wm_hints.input = private->accept_focus ? True : False;
+ wm_hints.input = window->accept_focus ? True : False;
wm_hints.initial_state = NormalState;
- if (private->state & GDK_WINDOW_STATE_ICONIFIED)
+ if (window->state & GDK_WINDOW_STATE_ICONIFIED)
{
wm_hints.flags |= StateHint;
wm_hints.initial_state = IconicState;
@@ -1165,12 +1182,10 @@ set_initial_hints (GdkWindow *window)
GdkDisplay *display = GDK_WINDOW_DISPLAY (window);
Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
Window xwindow = GDK_WINDOW_XID (window);
- GdkWindowObject *private;
GdkToplevelX11 *toplevel;
Atom atoms[9];
gint i;
- private = (GdkWindowObject*) window;
toplevel = _gdk_x11_window_get_toplevel (window);
if (!toplevel)
@@ -1185,7 +1200,7 @@ set_initial_hints (GdkWindow *window)
i = 0;
- if (private->state & GDK_WINDOW_STATE_MAXIMIZED)
+ if (window->state & GDK_WINDOW_STATE_MAXIMIZED)
{
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_WM_STATE_MAXIMIZED_VERT");
@@ -1196,21 +1211,21 @@ set_initial_hints (GdkWindow *window)
toplevel->have_maxhorz = toplevel->have_maxvert = TRUE;
}
- if (private->state & GDK_WINDOW_STATE_ABOVE)
+ if (window->state & GDK_WINDOW_STATE_ABOVE)
{
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_WM_STATE_ABOVE");
++i;
}
- if (private->state & GDK_WINDOW_STATE_BELOW)
+ if (window->state & GDK_WINDOW_STATE_BELOW)
{
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_WM_STATE_BELOW");
++i;
}
- if (private->state & GDK_WINDOW_STATE_STICKY)
+ if (window->state & GDK_WINDOW_STATE_STICKY)
{
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_WM_STATE_STICKY");
@@ -1218,7 +1233,7 @@ set_initial_hints (GdkWindow *window)
toplevel->have_sticky = TRUE;
}
- if (private->state & GDK_WINDOW_STATE_FULLSCREEN)
+ if (window->state & GDK_WINDOW_STATE_FULLSCREEN)
{
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_WM_STATE_FULLSCREEN");
@@ -1226,7 +1241,7 @@ set_initial_hints (GdkWindow *window)
toplevel->have_fullscreen = TRUE;
}
- if (private->modal_hint)
+ if (window->modal_hint)
{
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_WM_STATE_MODAL");
@@ -1262,7 +1277,7 @@ set_initial_hints (GdkWindow *window)
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE"));
}
- if (private->state & GDK_WINDOW_STATE_STICKY)
+ if (window->state & GDK_WINDOW_STATE_STICKY)
{
atoms[0] = 0xFFFFFFFF;
XChangeProperty (xdisplay,
@@ -1285,11 +1300,10 @@ set_initial_hints (GdkWindow *window)
static void
gdk_window_x11_show (GdkWindow *window, gboolean already_mapped)
{
- GdkWindowObject *private = (GdkWindowObject*) window;
GdkDisplay *display;
GdkDisplayX11 *display_x11;
GdkToplevelX11 *toplevel;
- GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (private->impl);
+ GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
Display *xdisplay = GDK_WINDOW_XDISPLAY (window);
Window xwindow = GDK_WINDOW_XID (window);
gboolean unset_bg;
@@ -1309,8 +1323,8 @@ gdk_window_x11_show (GdkWindow *window, gboolean already_mapped)
gdk_x11_window_set_user_time (window, display_x11->user_time);
}
- unset_bg = !private->input_only &&
- (private->window_type == GDK_WINDOW_CHILD ||
+ unset_bg = !window->input_only &&
+ (window->window_type == GDK_WINDOW_CHILD ||
impl->override_redirect) &&
gdk_window_is_viewable (window);
@@ -1327,14 +1341,13 @@ static void
pre_unmap (GdkWindow *window)
{
GdkWindow *start_window = NULL;
- GdkWindowObject *private = (GdkWindowObject *)window;
- if (private->input_only)
+ if (window->input_only)
return;
- if (private->window_type == GDK_WINDOW_CHILD)
- start_window = _gdk_window_get_impl_window ((GdkWindow *)private->parent);
- else if (private->window_type == GDK_WINDOW_TEMP)
+ if (window->window_type == GDK_WINDOW_CHILD)
+ start_window = _gdk_window_get_impl_window ((GdkWindow *)window->parent);
+ else if (window->window_type == GDK_WINDOW_TEMP)
start_window = get_root (window);
if (start_window)
@@ -1345,28 +1358,27 @@ static void
post_unmap (GdkWindow *window)
{
GdkWindow *start_window = NULL;
- GdkWindowObject *private = (GdkWindowObject *)window;
- if (private->input_only)
+ if (window->input_only)
return;
- if (private->window_type == GDK_WINDOW_CHILD)
- start_window = _gdk_window_get_impl_window ((GdkWindow *)private->parent);
- else if (private->window_type == GDK_WINDOW_TEMP)
+ if (window->window_type == GDK_WINDOW_CHILD)
+ start_window = _gdk_window_get_impl_window ((GdkWindow *)window->parent);
+ else if (window->window_type == GDK_WINDOW_TEMP)
start_window = get_root (window);
if (start_window)
{
_gdk_x11_window_tmp_reset_bg (start_window, TRUE);
- if (private->window_type == GDK_WINDOW_CHILD && private->parent)
+ if (window->window_type == GDK_WINDOW_CHILD && window->parent)
{
GdkRectangle invalid_rect;
gdk_window_get_position (window, &invalid_rect.x, &invalid_rect.y);
invalid_rect.width = gdk_window_get_width (window);
invalid_rect.height = gdk_window_get_height (window);
- gdk_window_invalidate_rect ((GdkWindow *)private->parent,
+ gdk_window_invalidate_rect ((GdkWindow *)window->parent,
&invalid_rect, TRUE);
}
}
@@ -1375,10 +1387,6 @@ post_unmap (GdkWindow *window)
static void
gdk_window_x11_hide (GdkWindow *window)
{
- GdkWindowObject *private;
-
- private = (GdkWindowObject*) window;
-
/* We'll get the unmap notify eventually, and handle it then,
* but checking here makes things more consistent if we are
* just doing stuff ourself.
@@ -1387,7 +1395,7 @@ gdk_window_x11_hide (GdkWindow *window)
NextRequest (GDK_WINDOW_XDISPLAY (window)));
/* You can't simply unmap toplevel windows. */
- switch (private->window_type)
+ switch (window->window_type)
{
case GDK_WINDOW_TOPLEVEL:
case GDK_WINDOW_TEMP: /* ? */
@@ -1411,10 +1419,7 @@ gdk_window_x11_hide (GdkWindow *window)
static void
gdk_window_x11_withdraw (GdkWindow *window)
{
- GdkWindowObject *private;
-
- private = (GdkWindowObject*) window;
- if (!private->destroyed)
+ if (!window->destroyed)
{
if (GDK_WINDOW_IS_MAPPED (window))
gdk_synthesize_window_state (window,
@@ -1437,14 +1442,13 @@ window_x11_move (GdkWindow *window,
gint x,
gint y)
{
- GdkWindowObject *private = (GdkWindowObject *) window;
- GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (private->impl);
+ GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
- if (GDK_WINDOW_TYPE (private) == GDK_WINDOW_CHILD)
+ if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD)
{
_gdk_window_move_resize_child (window,
x, y,
- private->width, private->height);
+ window->width, window->height);
}
else
{
@@ -1454,8 +1458,8 @@ window_x11_move (GdkWindow *window,
if (impl->override_redirect)
{
- private->x = x;
- private->y = y;
+ window->x = x;
+ window->y = y;
}
}
}
@@ -1465,23 +1469,21 @@ window_x11_resize (GdkWindow *window,
gint width,
gint height)
{
- GdkWindowObject *private = (GdkWindowObject *) window;
-
if (width < 1)
width = 1;
if (height < 1)
height = 1;
- if (GDK_WINDOW_TYPE (private) == GDK_WINDOW_CHILD)
+ if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD)
{
_gdk_window_move_resize_child (window,
- private->x, private->y,
+ window->x, window->y,
width, height);
}
else
{
- GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (private->impl);
+ GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
XResizeWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
@@ -1489,18 +1491,18 @@ window_x11_resize (GdkWindow *window,
if (impl->override_redirect)
{
- private->width = width;
- private->height = height;
- _gdk_x11_drawable_update_size (private->impl);
+ window->width = width;
+ window->height = height;
+ _gdk_x11_window_update_size (GDK_WINDOW_IMPL_X11 (window->impl));
}
else
{
- if (width != private->width || height != private->height)
- private->resize_count += 1;
+ if (width != window->width || height != window->height)
+ window->resize_count += 1;
}
}
- _gdk_x11_drawable_update_size (private->impl);
+ _gdk_x11_window_update_size (GDK_WINDOW_IMPL_X11 (window->impl));
}
static inline void
@@ -1510,22 +1512,20 @@ window_x11_move_resize (GdkWindow *window,
gint width,
gint height)
{
- GdkWindowObject *private = (GdkWindowObject *) window;;
-
if (width < 1)
width = 1;
if (height < 1)
height = 1;
- if (GDK_WINDOW_TYPE (private) == GDK_WINDOW_CHILD)
+ if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD)
{
_gdk_window_move_resize_child (window, x, y, width, height);
- _gdk_x11_drawable_update_size (private->impl);
+ _gdk_x11_window_update_size (GDK_WINDOW_IMPL_X11 (window->impl));
}
else
{
- GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (private->impl);
+ GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
XMoveResizeWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
@@ -1533,18 +1533,18 @@ window_x11_move_resize (GdkWindow *window,
if (impl->override_redirect)
{
- private->x = x;
- private->y = y;
+ window->x = x;
+ window->y = y;
- private->width = width;
- private->height = height;
+ window->width = width;
+ window->height = height;
- _gdk_x11_drawable_update_size (private->impl);
+ _gdk_x11_window_update_size (GDK_WINDOW_IMPL_X11 (window->impl));
}
else
{
- if (width != private->width || height != private->height)
- private->resize_count += 1;
+ if (width != window->width || height != window->height)
+ window->resize_count += 1;
}
}
}
@@ -1574,27 +1574,23 @@ gdk_window_x11_reparent (GdkWindow *window,
gint x,
gint y)
{
- GdkWindowObject *window_private;
- GdkWindowObject *parent_private;
GdkWindowImplX11 *impl;
- window_private = (GdkWindowObject*) window;
- parent_private = (GdkWindowObject*) new_parent;
- impl = GDK_WINDOW_IMPL_X11 (window_private->impl);
+ impl = GDK_WINDOW_IMPL_X11 (window->impl);
_gdk_x11_window_tmp_unset_bg (window, TRUE);
_gdk_x11_window_tmp_unset_parent_bg (window);
XReparentWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
GDK_WINDOW_XID (new_parent),
- parent_private->abs_x + x, parent_private->abs_y + y);
+ new_parent->abs_x + x, new_parent->abs_y + y);
_gdk_x11_window_tmp_reset_parent_bg (window);
_gdk_x11_window_tmp_reset_bg (window, TRUE);
if (GDK_WINDOW_TYPE (new_parent) == GDK_WINDOW_FOREIGN)
new_parent = gdk_screen_get_root_window (GDK_WINDOW_SCREEN (window));
- window_private->parent = parent_private;
+ window->parent = new_parent;
/* Switch the window type as appropriate */
@@ -1609,8 +1605,8 @@ gdk_window_x11_reparent (GdkWindow *window,
{
/* This is also done in common code at a later stage, but we
need it in setup_toplevel, so do it here too */
- if (window_private->toplevel_window_type != -1)
- GDK_WINDOW_TYPE (window) = window_private->toplevel_window_type;
+ if (window->toplevel_window_type != -1)
+ GDK_WINDOW_TYPE (window) = window->toplevel_window_type;
else if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD)
GDK_WINDOW_TYPE (window) = GDK_WINDOW_TOPLEVEL;
@@ -1754,7 +1750,7 @@ move_to_current_desktop (GdkWindow *window)
xclient.type = ClientMessage;
xclient.serial = 0;
xclient.send_event = True;
- xclient.window = GDK_WINDOW_XWINDOW (window);
+ xclient.window = GDK_WINDOW_XID (window);
xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP");
xclient.format = 32;
@@ -1805,7 +1801,7 @@ gdk_window_focus (GdkWindow *window,
memset (&xclient, 0, sizeof (xclient));
xclient.type = ClientMessage;
- xclient.window = GDK_WINDOW_XWINDOW (window);
+ xclient.window = GDK_WINDOW_XID (window);
xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_ACTIVE_WINDOW");
xclient.format = 32;
@@ -2035,15 +2031,11 @@ void
gdk_window_set_modal_hint (GdkWindow *window,
gboolean modal)
{
- GdkWindowObject *private;
-
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
return;
- private = (GdkWindowObject*) window;
-
- private->modal_hint = modal;
+ window->modal_hint = modal;
if (GDK_WINDOW_IS_MAPPED (window))
gdk_wmspec_change_state (modal, window,
@@ -2710,14 +2702,12 @@ gdk_window_x11_set_device_cursor (GdkWindow *window,
GdkDevice *device,
GdkCursor *cursor)
{
- GdkWindowObject *private;
GdkWindowImplX11 *impl;
g_return_if_fail (GDK_IS_WINDOW (window));
g_return_if_fail (GDK_IS_DEVICE (device));
- private = (GdkWindowObject *) window;
- impl = GDK_WINDOW_IMPL_X11 (private->impl);
+ impl = GDK_WINDOW_IMPL_X11 (window->impl);
if (!cursor)
g_hash_table_remove (impl->device_cursor, device);
@@ -2735,13 +2725,11 @@ gdk_window_x11_set_device_cursor (GdkWindow *window,
GdkCursor *
_gdk_x11_window_get_cursor (GdkWindow *window)
{
- GdkWindowObject *private;
GdkWindowImplX11 *impl;
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
- private = (GdkWindowObject *)window;
- impl = GDK_WINDOW_IMPL_X11 (private->impl);
+ impl = GDK_WINDOW_IMPL_X11 (window->impl);
return impl->cursor;
}
@@ -2849,7 +2837,6 @@ gdk_window_get_frame_extents (GdkWindow *window,
GdkRectangle *rect)
{
GdkDisplay *display;
- GdkWindowObject *private;
GdkWindowImplX11 *impl;
Window xwindow;
Window xparent;
@@ -2871,24 +2858,22 @@ gdk_window_get_frame_extents (GdkWindow *window,
g_return_if_fail (rect != NULL);
- private = (GdkWindowObject*) window;
-
rect->x = 0;
rect->y = 0;
rect->width = 1;
rect->height = 1;
- while (private->parent && ((GdkWindowObject*) private->parent)->parent)
- private = (GdkWindowObject*) private->parent;
+ while (window->parent && (window->parent)->parent)
+ window = window->parent;
/* Refine our fallback answer a bit using local information */
- rect->x = private->x;
- rect->y = private->y;
- rect->width = private->width;
- rect->height = private->height;
+ rect->x = window->x;
+ rect->y = window->y;
+ rect->width = window->width;
+ rect->height = window->height;
- impl = GDK_WINDOW_IMPL_X11 (private->impl);
- if (GDK_WINDOW_DESTROYED (private) || impl->override_redirect)
+ impl = GDK_WINDOW_IMPL_X11 (window->impl);
+ if (GDK_WINDOW_DESTROYED (window) || impl->override_redirect)
return;
nvroots = 0;
@@ -3233,7 +3218,7 @@ _gdk_windowing_window_at_device_position (GdkDisplay *display,
toplevels = gdk_screen_get_toplevel_windows (screen);
for (list = toplevels; list != NULL; list = g_list_next (list)) {
window = GDK_WINDOW (list->data);
- xwindow = GDK_WINDOW_XWINDOW (window);
+ xwindow = GDK_WINDOW_XID (window);
gdk_error_trap_push ();
XQueryPointer (xdisplay, xwindow,
&root, &child, &rootx, &rooty, &winx, &winy, &xmask);
@@ -3315,7 +3300,7 @@ gdk_window_x11_get_events (GdkWindow *window)
event_mask = x_event_mask_to_gdk_event_mask (attrs.your_event_mask);
/* if property change was filtered out before, keep it filtered out */
filtered = GDK_STRUCTURE_MASK | GDK_PROPERTY_CHANGE_MASK;
- GDK_WINDOW_OBJECT (window)->event_mask = event_mask & ((GDK_WINDOW_OBJECT (window)->event_mask & filtered) | ~filtered);
+ window->event_mask = event_mask & ((window->event_mask & filtered) | ~filtered);
return event_mask;
}
@@ -3335,7 +3320,7 @@ gdk_window_x11_set_events (GdkWindow *window,
display_x11 = GDK_DISPLAY_X11 (gdk_window_get_display (window));
gdk_event_source_select_events ((GdkEventSource *) display_x11->event_source,
- GDK_WINDOW_XWINDOW (window), event_mask,
+ GDK_WINDOW_XID (window), event_mask,
xevent_mask);
}
}
@@ -3456,8 +3441,7 @@ gdk_window_set_override_redirect (GdkWindow *window,
if (!GDK_WINDOW_DESTROYED (window) &&
WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
{
- GdkWindowObject *private = (GdkWindowObject *)window;
- GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (private->impl);
+ GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
attr.override_redirect = (override_redirect? True : False);
XChangeWindowAttributes (GDK_WINDOW_XDISPLAY (window),
@@ -3486,15 +3470,11 @@ void
gdk_window_set_accept_focus (GdkWindow *window,
gboolean accept_focus)
{
- GdkWindowObject *private;
-
- private = (GdkWindowObject *)window;
-
accept_focus = accept_focus != FALSE;
- if (private->accept_focus != accept_focus)
+ if (window->accept_focus != accept_focus)
{
- private->accept_focus = accept_focus;
+ window->accept_focus = accept_focus;
if (!GDK_WINDOW_DESTROYED (window) &&
WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
@@ -3522,18 +3502,14 @@ void
gdk_window_set_focus_on_map (GdkWindow *window,
gboolean focus_on_map)
{
- GdkWindowObject *private;
-
- private = (GdkWindowObject *)window;
-
focus_on_map = focus_on_map != FALSE;
- if (private->focus_on_map != focus_on_map)
+ if (window->focus_on_map != focus_on_map)
{
- private->focus_on_map = focus_on_map;
+ window->focus_on_map = focus_on_map;
if ((!GDK_WINDOW_DESTROYED (window)) &&
- (!private->focus_on_map) &&
+ (!window->focus_on_map) &&
WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
gdk_x11_window_set_user_time (window, 0);
}
@@ -3914,7 +3890,7 @@ gdk_window_iconify (GdkWindow *window)
if (GDK_WINDOW_IS_MAPPED (window))
{
XIconifyWindow (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XWINDOW (window),
+ GDK_WINDOW_XID (window),
gdk_screen_get_number (GDK_WINDOW_SCREEN (window)));
}
else
@@ -3995,7 +3971,7 @@ gdk_window_stick (GdkWindow *window)
/* Request desktop 0xFFFFFFFF */
memset (&xclient, 0, sizeof (xclient));
xclient.type = ClientMessage;
- xclient.window = GDK_WINDOW_XWINDOW (window);
+ xclient.window = GDK_WINDOW_XID (window);
xclient.display = GDK_WINDOW_XDISPLAY (window);
xclient.message_type = gdk_x11_get_xatom_by_name_for_display (GDK_WINDOW_DISPLAY (window),
"_NET_WM_DESKTOP");
@@ -4594,8 +4570,8 @@ _xwindow_get_shape (Display *xdisplay,
}
-cairo_region_t *
-_gdk_windowing_window_get_shape (GdkWindow *window)
+static cairo_region_t *
+gdk_x11_window_get_shape (GdkWindow *window)
{
if (!GDK_WINDOW_DESTROYED (window) &&
gdk_display_supports_shapes (GDK_WINDOW_DISPLAY (window)))
@@ -4605,8 +4581,8 @@ _gdk_windowing_window_get_shape (GdkWindow *window)
return NULL;
}
-cairo_region_t *
-_gdk_windowing_window_get_input_shape (GdkWindow *window)
+static cairo_region_t *
+gdk_x11_window_get_input_shape (GdkWindow *window)
{
#if defined(ShapeInput)
if (!GDK_WINDOW_DESTROYED (window) &&
@@ -4624,13 +4600,11 @@ gdk_window_set_static_bit_gravity (GdkWindow *window,
gboolean on)
{
XSetWindowAttributes xattributes;
- GdkWindowObject *private;
guint xattributes_mask = 0;
g_return_if_fail (GDK_IS_WINDOW (window));
- private = GDK_WINDOW_OBJECT (window);
- if (private->input_only)
+ if (window->input_only)
return;
xattributes.bit_gravity = StaticGravity;
@@ -4660,19 +4634,18 @@ static gboolean
gdk_window_x11_set_static_gravities (GdkWindow *window,
gboolean use_static)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
GList *tmp_list;
- if (!use_static == !private->guffaw_gravity)
+ if (!use_static == !window->guffaw_gravity)
return TRUE;
- private->guffaw_gravity = use_static;
+ window->guffaw_gravity = use_static;
if (!GDK_WINDOW_DESTROYED (window))
{
gdk_window_set_static_bit_gravity (window, use_static);
- tmp_list = private->children;
+ tmp_list = window->children;
while (tmp_list)
{
gdk_window_set_static_win_gravity (tmp_list->data, use_static);
@@ -4981,21 +4954,18 @@ gboolean
_gdk_moveresize_handle_event (XEvent *event)
{
guint button_mask = 0;
- GdkWindowObject *window_private;
GdkDisplay *display = gdk_x11_lookup_xdisplay (event->xany.display);
MoveResizeData *mv_resize = get_move_resize_data (display, FALSE);
if (!mv_resize || !mv_resize->moveresize_window)
return FALSE;
- window_private = (GdkWindowObject *) mv_resize->moveresize_window;
-
button_mask = GDK_BUTTON1_MASK << (mv_resize->moveresize_button - 1);
switch (event->xany.type)
{
case MotionNotify:
- if (window_private->resize_count > 0)
+ if (mv_resize->moveresize_window->resize_count > 0)
{
if (mv_resize->moveresize_pending_event)
*mv_resize->moveresize_pending_event = *event;
@@ -5315,13 +5285,12 @@ gdk_window_begin_move_drag (GdkWindow *window,
void
gdk_window_enable_synchronized_configure (GdkWindow *window)
{
- GdkWindowObject *private = (GdkWindowObject *)window;
GdkWindowImplX11 *impl;
- if (!GDK_IS_WINDOW_IMPL_X11 (private->impl))
+ if (!GDK_IS_WINDOW_IMPL_X11 (window->impl))
return;
- impl = GDK_WINDOW_IMPL_X11 (private->impl);
+ impl = GDK_WINDOW_IMPL_X11 (window->impl);
if (!impl->use_synchronized_configure)
{
@@ -5357,7 +5326,7 @@ gdk_window_configure_finished (GdkWindow *window)
if (!WINDOW_IS_TOPLEVEL (window))
return;
- impl = GDK_WINDOW_IMPL_X11 (((GdkWindowObject *)window)->impl);
+ impl = GDK_WINDOW_IMPL_X11 (window->impl);
if (!impl->use_synchronized_configure)
return;
@@ -5381,24 +5350,25 @@ gdk_window_configure_finished (GdkWindow *window)
#endif
}
-void
-_gdk_windowing_window_beep (GdkWindow *window)
+static gboolean
+gdk_x11_window_beep (GdkWindow *window)
{
GdkDisplay *display;
- g_return_if_fail (GDK_IS_WINDOW (window));
-
display = GDK_WINDOW_DISPLAY (window);
#ifdef HAVE_XKB
if (GDK_DISPLAY_X11 (display)->use_xkb)
- XkbBell (GDK_DISPLAY_XDISPLAY (display),
- GDK_WINDOW_XID (window),
- 0,
- None);
- else
+ {
+ XkbBell (GDK_DISPLAY_XDISPLAY (display),
+ GDK_WINDOW_XID (window),
+ 0,
+ None);
+ return TRUE;
+ }
#endif
- gdk_display_beep (display);
+
+ return FALSE;
}
/**
@@ -5459,17 +5429,16 @@ _gdk_windowing_window_set_composited (GdkWindow *window,
gboolean composited)
{
#if defined(HAVE_XCOMPOSITE) && defined(HAVE_XDAMAGE) && defined (HAVE_XFIXES)
- GdkWindowObject *private = (GdkWindowObject *) window;
GdkWindowImplX11 *impl;
GdkDisplay *display;
Display *dpy;
Window xid;
- impl = GDK_WINDOW_IMPL_X11 (private->impl);
+ impl = GDK_WINDOW_IMPL_X11 (window->impl);
- display = gdk_screen_get_display (GDK_DRAWABLE_IMPL_X11 (impl)->screen);
+ display = gdk_window_get_display (window);
dpy = GDK_DISPLAY_XDISPLAY (display);
- xid = GDK_WINDOW_XWINDOW (private);
+ xid = GDK_WINDOW_XID (window);
if (composited)
{
@@ -5502,34 +5471,6 @@ _gdk_windowing_after_process_all_updates (void)
{
}
-static void
-gdk_window_impl_iface_init (GdkWindowImplIface *iface)
-{
- iface->show = gdk_window_x11_show;
- iface->hide = gdk_window_x11_hide;
- iface->withdraw = gdk_window_x11_withdraw;
- iface->set_events = gdk_window_x11_set_events;
- iface->get_events = gdk_window_x11_get_events;
- iface->raise = gdk_window_x11_raise;
- iface->lower = gdk_window_x11_lower;
- iface->restack_under = gdk_window_x11_restack_under;
- iface->restack_toplevel = gdk_window_x11_restack_toplevel;
- iface->move_resize = gdk_window_x11_move_resize;
- iface->set_background = gdk_window_x11_set_background;
- iface->reparent = gdk_window_x11_reparent;
- iface->set_device_cursor = gdk_window_x11_set_device_cursor;
- iface->get_geometry = gdk_window_x11_get_geometry;
- iface->get_root_coords = gdk_window_x11_get_root_coords;
- iface->get_device_state = gdk_window_x11_get_device_state;
- iface->shape_combine_region = gdk_window_x11_shape_combine_region;
- iface->input_shape_combine_region = gdk_window_x11_input_shape_combine_region;
- iface->set_static_gravities = gdk_window_x11_set_static_gravities;
- iface->queue_antiexpose = _gdk_x11_window_queue_antiexpose;
- iface->translate = _gdk_x11_window_translate;
- iface->destroy = _gdk_x11_window_destroy;
- iface->resize_cairo_surface = gdk_window_x11_resize_cairo_surface;
-}
-
static Bool
timestamp_predicate (Display *display,
XEvent *xevent,
@@ -5570,7 +5511,7 @@ gdk_x11_get_server_time (GdkWindow *window)
g_return_val_if_fail (!GDK_WINDOW_DESTROYED (window), 0);
xdisplay = GDK_WINDOW_XDISPLAY (window);
- xwindow = GDK_WINDOW_XWINDOW (window);
+ xwindow = GDK_WINDOW_XID (window);
timestamp_prop_atom =
gdk_x11_get_xatom_by_name_for_display (GDK_WINDOW_DISPLAY (window),
"GDK_TIMESTAMP_PROP");
@@ -5584,3 +5525,73 @@ gdk_x11_get_server_time (GdkWindow *window)
return xevent.xproperty.time;
}
+
+/**
+ * gdk_x11_window_get_xid:
+ * @window: a native #GdkWindow.
+ *
+ * Returns the X resource (window) belonging to a #GdkWindow.
+ *
+ * Return value: the ID of @drawable's X resource.
+ **/
+XID
+gdk_x11_window_get_xid (GdkWindow *window)
+{
+ /* Try to ensure the window has a native window */
+ if (!_gdk_window_has_impl (window))
+ {
+ gdk_window_ensure_native (window);
+
+ /* We sync here to ensure the window is created in the Xserver when
+ * this function returns. This is required because the returned XID
+ * for this window must be valid immediately, even with another
+ * connection to the Xserver */
+ gdk_display_sync (gdk_window_get_display (window));
+ }
+
+ if (!GDK_WINDOW_IS_X11 (window))
+ {
+ g_warning (G_STRLOC " drawable is not a native X11 window");
+ return None;
+ }
+
+ return GDK_WINDOW_IMPL_X11 (window->impl)->xid;
+}
+
+static void
+gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GdkWindowImplClass *impl_class = GDK_WINDOW_IMPL_CLASS (klass);
+
+ object_class->finalize = gdk_window_impl_x11_finalize;
+
+ impl_class->ref_cairo_surface = gdk_x11_ref_cairo_surface;
+ impl_class->show = gdk_window_x11_show;
+ impl_class->hide = gdk_window_x11_hide;
+ impl_class->withdraw = gdk_window_x11_withdraw;
+ impl_class->set_events = gdk_window_x11_set_events;
+ impl_class->get_events = gdk_window_x11_get_events;
+ impl_class->raise = gdk_window_x11_raise;
+ impl_class->lower = gdk_window_x11_lower;
+ impl_class->restack_under = gdk_window_x11_restack_under;
+ impl_class->restack_toplevel = gdk_window_x11_restack_toplevel;
+ impl_class->move_resize = gdk_window_x11_move_resize;
+ impl_class->set_background = gdk_window_x11_set_background;
+ impl_class->reparent = gdk_window_x11_reparent;
+ impl_class->set_device_cursor = gdk_window_x11_set_device_cursor;
+ impl_class->get_geometry = gdk_window_x11_get_geometry;
+ impl_class->get_root_coords = gdk_window_x11_get_root_coords;
+ impl_class->get_device_state = gdk_window_x11_get_device_state;
+ impl_class->shape_combine_region = gdk_window_x11_shape_combine_region;
+ impl_class->input_shape_combine_region = gdk_window_x11_input_shape_combine_region;
+ impl_class->set_static_gravities = gdk_window_x11_set_static_gravities;
+ impl_class->queue_antiexpose = _gdk_x11_window_queue_antiexpose;
+ impl_class->translate = _gdk_x11_window_translate;
+ impl_class->destroy = _gdk_x11_window_destroy;
+ impl_class->resize_cairo_surface = gdk_window_x11_resize_cairo_surface;
+ impl_class->get_shape = gdk_x11_window_get_shape;
+ impl_class->get_input_shape = gdk_x11_window_get_input_shape;
+ impl_class->beep = gdk_x11_window_beep;
+}
+
diff --git a/gdk/x11/gdkwindow-x11.h b/gdk/x11/gdkwindow-x11.h
index d9c617f928..fd63e8b462 100644
--- a/gdk/x11/gdkwindow-x11.h
+++ b/gdk/x11/gdkwindow-x11.h
@@ -27,7 +27,8 @@
#ifndef __GDK_WINDOW_X11_H__
#define __GDK_WINDOW_X11_H__
-#include <gdk/x11/gdkdrawable-x11.h>
+#include "gdk/x11/gdkprivate-x11.h"
+#include "gdk/gdkwindowimpl.h"
#ifdef HAVE_XDAMAGE
#include <X11/extensions/Xdamage.h>
@@ -56,7 +57,11 @@ typedef struct _GdkXPositionInfo GdkXPositionInfo;
struct _GdkWindowImplX11
{
- GdkDrawableImplX11 parent_instance;
+ GdkWindowImpl parent_instance;
+
+ GdkWindow *wrapper;
+
+ Window xid;
GdkToplevelX11 *toplevel; /* Toplevel-specific information */
GdkCursor *cursor;
@@ -67,6 +72,8 @@ struct _GdkWindowImplX11
* unset during resizing and scaling */
guint override_redirect : 1;
guint use_synchronized_configure : 1;
+
+ cairo_surface_t *cairo_surface;
#if defined (HAVE_XCOMPOSITE) && defined(HAVE_XDAMAGE) && defined (HAVE_XFIXES)
Damage damage;
@@ -75,7 +82,7 @@ struct _GdkWindowImplX11
struct _GdkWindowImplX11Class
{
- GdkDrawableImplX11Class parent_class;
+ GdkWindowImplClass parent_class;
};
struct _GdkToplevelX11
@@ -152,10 +159,12 @@ void _gdk_x11_window_tmp_reset_bg (GdkWindow *window,
void _gdk_x11_window_tmp_unset_parent_bg (GdkWindow *window);
void _gdk_x11_window_tmp_reset_parent_bg (GdkWindow *window);
-GdkCursor *_gdk_x11_window_get_cursor (GdkWindow *window);
-void _gdk_x11_window_get_offsets (GdkWindow *window,
- gint *x_offset,
- gint *y_offset);
+GdkCursor *_gdk_x11_window_get_cursor (GdkWindow *window);
+void _gdk_x11_window_get_offsets (GdkWindow *window,
+ gint *x_offset,
+ gint *y_offset);
+
+void _gdk_x11_window_update_size (GdkWindowImplX11 *impl);
G_END_DECLS
diff --git a/gdk/x11/gdkx.h b/gdk/x11/gdkx.h
index 7fc0227348..51aae0dad1 100644
--- a/gdk/x11/gdkx.h
+++ b/gdk/x11/gdkx.h
@@ -27,7 +27,8 @@
#ifndef __GDK_X_H__
#define __GDK_X_H__
-#include <gdk/gdkprivate.h>
+#include <gdk/gdk.h>
+
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@@ -55,9 +56,7 @@ G_BEGIN_DECLS
*/
-Display *gdk_x11_drawable_get_xdisplay (GdkDrawable *drawable);
-XID gdk_x11_drawable_get_xid (GdkDrawable *drawable);
-GdkDrawable *gdk_x11_window_get_drawable_impl (GdkWindow *window);
+Window gdk_x11_window_get_xid (GdkWindow *window);
Display *gdk_x11_cursor_get_xdisplay (GdkCursor *cursor);
Cursor gdk_x11_cursor_get_xcursor (GdkCursor *cursor);
Display *gdk_x11_display_get_xdisplay (GdkDisplay *display);
@@ -107,6 +106,8 @@ gint gdk_x11_get_default_screen (void);
* @display: a #GdkDisplay.
*
* Returns the display of a #GdkDisplay.
+ *
+ * Returns: an Xlib <type>Display*</type>
*/
#define GDK_DISPLAY_XDISPLAY(display) (GDK_DISPLAY_X11(display)->xdisplay)
@@ -119,36 +120,8 @@ gint gdk_x11_get_default_screen (void);
* Returns: an Xlib <type>Display*</type>.
*/
#define GDK_WINDOW_XDISPLAY(win) (GDK_SCREEN_X11 (GDK_WINDOW_SCREEN (win))->xdisplay)
-#define GDK_WINDOW_XID(win) (GDK_DRAWABLE_IMPL_X11(((GdkWindowObject *)win)->impl)->xid)
+#define GDK_WINDOW_XID(win) (GDK_WINDOW_IMPL_X11(GDK_WINDOW (win)->impl)->xid)
-/**
- * GDK_DRAWABLE_XDISPLAY:
- * @win: a #GdkDrawable.
- *
- * Returns the display of a #GdkDrawable.
- *
- * Returns: an Xlib <type>Display*</type>.
- */
-#define GDK_DRAWABLE_XDISPLAY(win) (GDK_WINDOW_XDISPLAY (win))
-
-/**
- * GDK_DRAWABLE_XID:
- * @win: a #GdkDrawable.
- *
- * Returns the X resource (window or pixmap) belonging to a #GdkDrawable.
- *
- * Returns: the ID of @win's X resource.
- */
-#define GDK_DRAWABLE_XID(win) (GDK_WINDOW_XID (win))
-
-/**
- * GDK_SCREEN_XDISPLAY:
- * @screen: a #GdkScreen.
- *
- * Returns the display of a #GdkScreen.
- *
- * Returns: an Xlib <type>Display*</type>.
- */
#define GDK_SCREEN_XDISPLAY(screen) (GDK_SCREEN_X11 (screen)->xdisplay)
/**
@@ -161,7 +134,6 @@ gint gdk_x11_get_default_screen (void);
*/
#define GDK_SCREEN_XSCREEN(screen) (GDK_SCREEN_X11 (screen)->xscreen)
#define GDK_SCREEN_XNUMBER(screen) (GDK_SCREEN_X11 (screen)->screen_num)
-#define GDK_WINDOW_XWINDOW GDK_DRAWABLE_XID
#else /* GDK_COMPILATION */
@@ -176,7 +148,7 @@ gint gdk_x11_get_default_screen (void);
#define GDK_DISPLAY_XDISPLAY(display) (gdk_x11_display_get_xdisplay (display))
-#define GDK_WINDOW_XDISPLAY(win) (gdk_x11_drawable_get_xdisplay (gdk_x11_window_get_drawable_impl (win)))
+#define GDK_WINDOW_XDISPLAY(win) (GDK_DISPLAY_XDISPLAY (gdk_window_get_display (win)))
/**
* GDK_WINDOW_XID:
@@ -186,16 +158,8 @@ gint gdk_x11_get_default_screen (void);
*
* Returns: the Xlib <type>Window</type> of @win.
*/
-#define GDK_WINDOW_XID(win) (gdk_x11_drawable_get_xid (win))
+#define GDK_WINDOW_XID(win) (gdk_x11_window_get_xid (win))
-/**
- * GDK_WINDOW_XWINDOW:
- *
- * Another name for GDK_DRAWABLE_XID().
- */
-#define GDK_WINDOW_XWINDOW(win) (gdk_x11_drawable_get_xid (win))
-#define GDK_DRAWABLE_XDISPLAY(win) (gdk_x11_drawable_get_xdisplay (win))
-#define GDK_DRAWABLE_XID(win) (gdk_x11_drawable_get_xid (win))
#define GDK_SCREEN_XDISPLAY(screen) (gdk_x11_display_get_xdisplay (gdk_screen_get_display (screen)))
#define GDK_SCREEN_XSCREEN(screen) (gdk_x11_screen_get_xscreen (screen))
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index b3d6e61198..75fe3fbca4 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -167,6 +167,7 @@ gtk_public_h_sources = \
gtkbbox.h \
gtkbin.h \
gtkbindings.h \
+ gtkborder.h \
gtkbox.h \
gtkbuilder.h \
gtkbuildable.h \
@@ -183,7 +184,7 @@ gtk_public_h_sources = \
gtkcellrenderercombo.h \
gtkcellrendererpixbuf.h \
gtkcellrendererprogress.h \
- gtkcellrendererspin.h \
+ gtkcellrendererspin.h \
gtkcellrendererspinner.h\
gtkcellrenderertext.h \
gtkcellrenderertoggle.h \
@@ -197,26 +198,28 @@ gtk_public_h_sources = \
gtkcombobox.h \
gtkcomboboxtext.h \
gtkcontainer.h \
- gtkdebug.h \
+ gtkcssprovider.h \
+ gtkdebug.h \
gtkdialog.h \
gtkdnd.h \
gtkdrawingarea.h \
- gtkeditable.h \
+ gtkeditable.h \
gtkentry.h \
gtkentrybuffer.h \
gtkentrycompletion.h \
gtkenums.h \
gtkeventbox.h \
gtkexpander.h \
- gtkfilechooser.h \
- gtkfilechooserbutton.h \
- gtkfilechooserdialog.h \
- gtkfilechooserwidget.h \
+ gtkfilechooser.h \
+ gtkfilechooserbutton.h \
+ gtkfilechooserdialog.h \
+ gtkfilechooserwidget.h \
gtkfilefilter.h \
gtkfixed.h \
gtkfontbutton.h \
gtkfontsel.h \
gtkframe.h \
+ gtkgradient.h \
gtkgrid.h \
gtkhandlebox.h \
gtkhbbox.h \
@@ -238,7 +241,7 @@ gtk_public_h_sources = \
gtkinfobar.h \
gtkinvisible.h \
gtklabel.h \
- gtklayout.h \
+ gtklayout.h \
gtklinkbutton.h \
gtkliststore.h \
gtkmain.h \
@@ -250,7 +253,7 @@ gtk_public_h_sources = \
gtkmessagedialog.h \
gtkmisc.h \
gtkmodules.h \
- gtkmountoperation.h \
+ gtkmountoperation.h \
gtknotebook.h \
gtkoffscreenwindow.h \
gtkorientable.h \
@@ -260,7 +263,7 @@ gtk_public_h_sources = \
gtkplug.h \
gtkprintcontext.h \
gtkprintoperation.h \
- gtkprintoperationpreview.h \
+ gtkprintoperationpreview.h \
gtkprintsettings.h \
gtkprogressbar.h \
gtkradioaction.h \
@@ -272,13 +275,13 @@ gtk_public_h_sources = \
gtkrecentaction.h \
gtkrecentchooser.h \
gtkrecentchooserdialog.h \
- gtkrecentchoosermenu.h \
+ gtkrecentchoosermenu.h \
gtkrecentchooserwidget.h \
- gtkrecentfilter.h \
+ gtkrecentfilter.h \
gtkrecentmanager.h \
gtkscale.h \
gtkscalebutton.h \
- gtkscrollable.h \
+ gtkscrollable.h \
gtkscrollbar.h \
gtkscrolledwindow.h \
gtkselection.h \
@@ -295,10 +298,14 @@ gtk_public_h_sources = \
gtkstatusbar.h \
gtkstatusicon.h \
gtkstock.h \
+ gtkstylecontext.h \
+ gtkstyleproperties.h \
+ gtkstyleprovider.h \
gtkstyle.h \
gtkswitch.h \
+ gtksymboliccolor.h \
gtktable.h \
- gtktearoffmenuitem.h \
+ gtktearoffmenuitem.h \
gtktestutils.h \
gtktextbuffer.h \
gtktextbufferrichtext.h \
@@ -309,6 +316,7 @@ gtk_public_h_sources = \
gtktexttag.h \
gtktexttagtable.h \
gtktextview.h \
+ gtkthemingengine.h \
gtktoggleaction.h \
gtktogglebutton.h \
gtktoggletoolbutton.h \
@@ -339,6 +347,7 @@ gtk_public_h_sources = \
gtkvscrollbar.h \
gtkvseparator.h \
gtkwidget.h \
+ gtkwidgetpath.h \
gtkwindow.h
if OS_UNIX
@@ -369,12 +378,14 @@ endif
# GTK+ header files that don't get installed
gtk_private_h_sources = \
+ gtk9slice.h \
gtkbuttonprivate.h \
gtkquery.h \
gtksearchengine.h \
gtksearchenginesimple.h \
gtkdndcursors.h \
gtkentryprivate.h \
+ gtkanimationdescription.h \
gtkbuilderprivate.h \
gtkcustompaperunixdialog.h\
gtkfilechooserdefault.h \
@@ -390,6 +401,7 @@ gtk_private_h_sources = \
gtkkeyhash.h \
gtkmenuprivate.h \
gtkmnemonichash.h \
+ gtkmodifierstyle.h \
gtkmountoperationprivate.h \
gtkappchooserprivate.h \
gtkappchoosermodule.h \
@@ -415,6 +427,7 @@ gtk_private_h_sources = \
gtktexttagprivate.h \
gtktexttypes.h \
gtktextutil.h \
+ gtktimeline.h \
gtkthemes.h \
gtktoolpaletteprivate.h \
gtktreedatalist.h \
@@ -426,6 +439,7 @@ gtk_private_h_sources = \
# GTK+ C sources to build the library from
gtk_base_c_sources = \
+ gtk9slice.c \
gtkquery.c \
gtksearchengine.c \
gtksearchenginesimple.c \
@@ -447,12 +461,14 @@ gtk_base_c_sources = \
gtkappchoosermodule.c \
gtkappchooseronline.c \
gtkapplication.c \
+ gtkanimationdescription.c \
gtkarrow.c \
gtkaspectframe.c \
gtkassistant.c \
gtkbbox.c \
gtkbin.c \
gtkbindings.c \
+ gtkborder.c \
gtkbox.c \
gtkbuildable.c \
gtkbuilder.c \
@@ -483,9 +499,10 @@ gtk_base_c_sources = \
gtkcombobox.c \
gtkcomboboxtext.c \
gtkcontainer.c \
+ gtkcssprovider.c \
gtkdialog.c \
gtkdrawingarea.c \
- gtkeditable.c \
+ gtkeditable.c \
gtkentry.c \
gtkentrybuffer.c \
gtkentrycompletion.c \
@@ -503,9 +520,10 @@ gtk_base_c_sources = \
gtkfilesystem.c \
gtkfilesystemmodel.c \
gtkfixed.c \
- gtkfontbutton.c \
- gtkfontsel.c \
+ gtkfontbutton.c \
+ gtkfontsel.c \
gtkframe.c \
+ gtkgradient.c \
gtkgrid.c \
gtkhandlebox.c \
gtkhbbox.c \
@@ -543,8 +561,9 @@ gtk_base_c_sources = \
gtkmessagedialog.c \
gtkmisc.c \
gtkmnemonichash.c \
+ gtkmodifierstyle.c \
gtkmodules.c \
- gtkmountoperation.c \
+ gtkmountoperation.c \
gtknotebook.c \
gtkoffscreenwindow.c \
gtkorientable.c \
@@ -556,7 +575,7 @@ gtk_base_c_sources = \
gtkplug.c \
gtkprintcontext.c \
gtkprintoperation.c \
- gtkprintoperationpreview.c \
+ gtkprintoperationpreview.c \
gtkprintsettings.c \
gtkprintutils.c \
gtkprogressbar.c \
@@ -565,20 +584,20 @@ gtk_base_c_sources = \
gtkradiomenuitem.c \
gtkradiotoolbutton.c \
gtkrange.c \
- gtkrbtree.c \
+ gtkrbtree.c \
gtkrc.c \
gtkrecentaction.c \
gtkrecentchooserdefault.c \
- gtkrecentchooserdialog.c \
- gtkrecentchoosermenu.c \
- gtkrecentchooserwidget.c \
+ gtkrecentchooserdialog.c\
+ gtkrecentchoosermenu.c \
+ gtkrecentchooserwidget.c\
gtkrecentchooserutils.c \
gtkrecentchooser.c \
gtkrecentfilter.c \
gtkrecentmanager.c \
gtkscale.c \
gtkscalebutton.c \
- gtkscrollable.c \
+ gtkscrollable.c \
gtkscrollbar.c \
gtkscrolledwindow.c \
gtkselection.c \
@@ -595,10 +614,14 @@ gtk_base_c_sources = \
gtkstatusbar.c \
gtkstatusicon.c \
gtkstock.c \
+ gtkstylecontext.c \
+ gtkstyleproperties.c \
+ gtkstyleprovider.c \
gtkstyle.c \
gtkswitch.c \
+ gtksymboliccolor.c \
gtktable.c \
- gtktearoffmenuitem.c \
+ gtktearoffmenuitem.c \
gtktestutils.c \
gtktextbtree.c \
gtktextbuffer.c \
@@ -616,13 +639,15 @@ gtk_base_c_sources = \
gtktextutil.c \
gtktextview.c \
gtkthemes.c \
+ gtkthemingengine.c \
+ gtktimeline.c \
gtktoggleaction.c \
gtktogglebutton.c \
gtktoggletoolbutton.c \
gtktoolbar.c \
gtktoolbutton.c \
gtktoolitem.c \
- gtktoolitemgroup.c \
+ gtktoolitemgroup.c \
gtktoolpalette.c \
gtktoolshell.c \
gtktooltip.c \
@@ -648,7 +673,8 @@ gtk_base_c_sources = \
gtkvscrollbar.c \
gtkvseparator.c \
gtkwidget.c \
- gtkwindow-decorate.c \
+ gtkwidgetpath.c \
+ gtkwindow-decorate.c \
gtkwindow.c \
$(gtk_clipboard_dnd_c_sources) \
$(gtk_appchooser_impl_c_sources)
diff --git a/gtk/gtk.h b/gtk/gtk.h
index 38889aef1b..0d85793a3c 100644
--- a/gtk/gtk.h
+++ b/gtk/gtk.h
@@ -51,6 +51,7 @@
#include <gtk/gtkbbox.h>
#include <gtk/gtkbin.h>
#include <gtk/gtkbindings.h>
+#include <gtk/gtkborder.h>
#include <gtk/gtkbox.h>
#include <gtk/gtkbuildable.h>
#include <gtk/gtkbuilder.h>
@@ -80,6 +81,7 @@
#include <gtk/gtkcombobox.h>
#include <gtk/gtkcomboboxtext.h>
#include <gtk/gtkcontainer.h>
+#include <gtk/gtkcssprovider.h>
#include <gtk/gtkdebug.h>
#include <gtk/gtkdialog.h>
#include <gtk/gtkdnd.h>
@@ -100,6 +102,7 @@
#include <gtk/gtkfontbutton.h>
#include <gtk/gtkfontsel.h>
#include <gtk/gtkframe.h>
+#include <gtk/gtkgradient.h>
#include <gtk/gtkgrid.h>
#include <gtk/gtkhandlebox.h>
#include <gtk/gtkhbbox.h>
@@ -177,8 +180,12 @@
#include <gtk/gtkstatusbar.h>
#include <gtk/gtkstatusicon.h>
#include <gtk/gtkstock.h>
+#include <gtk/gtkstylecontext.h>
+#include <gtk/gtkstyleproperties.h>
+#include <gtk/gtkstyleprovider.h>
#include <gtk/gtkstyle.h>
#include <gtk/gtkswitch.h>
+#include <gtk/gtksymboliccolor.h>
#include <gtk/gtktable.h>
#include <gtk/gtktearoffmenuitem.h>
#include <gtk/gtktextbuffer.h>
@@ -189,6 +196,7 @@
#include <gtk/gtktexttag.h>
#include <gtk/gtktexttagtable.h>
#include <gtk/gtktextview.h>
+#include <gtk/gtkthemingengine.h>
#include <gtk/gtktoggleaction.h>
#include <gtk/gtktogglebutton.h>
#include <gtk/gtktoggletoolbutton.h>
@@ -221,6 +229,7 @@
#include <gtk/gtkvscrollbar.h>
#include <gtk/gtkvseparator.h>
#include <gtk/gtkwidget.h>
+#include <gtk/gtkwidgetpath.h>
#include <gtk/gtkwindow.h>
#undef __GTK_H_INSIDE__
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols
index 89f52525e6..0974cae0b5 100644
--- a/gtk/gtk.symbols
+++ b/gtk/gtk.symbols
@@ -1109,6 +1109,7 @@ gtk_icon_set_new
gtk_icon_set_new_from_pixbuf
gtk_icon_set_ref
gtk_icon_set_render_icon
+gtk_icon_set_render_icon_pixbuf
gtk_icon_set_unref
gtk_icon_size_from_name
gtk_icon_size_get_name
@@ -3336,9 +3337,12 @@ gtk_widget_modify_cursor
gtk_widget_modify_fg
gtk_widget_modify_font
gtk_widget_modify_style
-gtk_widget_modify_symbolic_color
gtk_widget_modify_text
gtk_widget_new
+gtk_widget_override_background_color
+gtk_widget_override_color
+gtk_widget_override_font
+gtk_widget_override_symbolic_color
gtk_widget_path
gtk_widget_pop_composite_child
gtk_widget_push_composite_child
@@ -3353,6 +3357,7 @@ gtk_widget_region_intersect
gtk_widget_remove_accelerator
gtk_widget_remove_mnemonic_label
gtk_widget_render_icon
+gtk_widget_render_icon_pixbuf
gtk_widget_reparent
gtk_widget_reset_rc_styles
gtk_widget_reset_shapes
diff --git a/gtk/gtk9slice.c b/gtk/gtk9slice.c
new file mode 100644
index 0000000000..c3e824b4d5
--- /dev/null
+++ b/gtk/gtk9slice.c
@@ -0,0 +1,375 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+#include "gtk9slice.h"
+
+enum {
+ BORDER_LEFT,
+ BORDER_MIDDLE,
+ BORDER_RIGHT,
+ BORDER_LAST,
+ BORDER_TOP = BORDER_LEFT,
+ BORDER_BOTTOM = BORDER_RIGHT
+};
+
+enum {
+ SIDE_TOP,
+ SIDE_RIGHT,
+ SIDE_BOTTOM,
+ SIDE_LEFT
+};
+
+struct Gtk9Slice
+{
+ cairo_surface_t *surfaces[BORDER_LAST][BORDER_LAST];
+ GtkSliceSideModifier modifiers[4];
+ gdouble distances[4];
+ gint ref_count;
+};
+
+G_DEFINE_BOXED_TYPE (Gtk9Slice, gtk_9slice,
+ gtk_9slice_ref, gtk_9slice_unref)
+
+
+Gtk9Slice *
+gtk_9slice_new (GdkPixbuf *pixbuf,
+ gdouble distance_top,
+ gdouble distance_bottom,
+ gdouble distance_left,
+ gdouble distance_right,
+ GtkSliceSideModifier horizontal_modifier,
+ GtkSliceSideModifier vertical_modifier)
+{
+ Gtk9Slice *slice;
+ cairo_surface_t *surface;
+ gint width, height;
+ cairo_t *cr;
+
+ g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
+
+ slice = g_slice_new0 (Gtk9Slice);
+ slice->ref_count = 1;
+
+ slice->distances[SIDE_TOP] = distance_top;
+ slice->distances[SIDE_BOTTOM] = distance_bottom;
+ slice->distances[SIDE_LEFT] = distance_left;
+ slice->distances[SIDE_RIGHT] = distance_right;
+
+ slice->modifiers[SIDE_TOP] = slice->modifiers[SIDE_BOTTOM] = horizontal_modifier;
+ slice->modifiers[SIDE_LEFT] = slice->modifiers[SIDE_RIGHT] = vertical_modifier;
+
+ width = gdk_pixbuf_get_width (pixbuf);
+ height = gdk_pixbuf_get_height (pixbuf);
+
+ /* Get an image surface from the pixbuf */
+ surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
+ cr = cairo_create (surface);
+
+ gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0);
+ cairo_paint (cr);
+
+ cairo_destroy (cr);
+
+ /* Top /left corner */
+ slice->surfaces[BORDER_LEFT][BORDER_TOP] = cairo_surface_create_similar (surface, CAIRO_CONTENT_COLOR_ALPHA,
+ distance_left, distance_top);
+ cr = cairo_create (slice->surfaces[BORDER_LEFT][BORDER_TOP]);
+
+ cairo_set_source_surface (cr, surface, 0, 0);
+ cairo_paint (cr);
+
+ cairo_destroy (cr);
+
+ /* Top/right corner */
+ slice->surfaces[BORDER_RIGHT][BORDER_TOP] = cairo_surface_create_similar (surface, CAIRO_CONTENT_COLOR_ALPHA,
+ distance_right, distance_top);
+ cr = cairo_create (slice->surfaces[BORDER_RIGHT][BORDER_TOP]);
+
+ cairo_set_source_surface (cr, surface, - width + distance_right, 0);
+ cairo_paint (cr);
+
+ cairo_destroy (cr);
+
+ /* Bottom/left corner */
+ slice->surfaces[BORDER_LEFT][BORDER_BOTTOM] = cairo_surface_create_similar (surface, CAIRO_CONTENT_COLOR_ALPHA,
+ distance_left, distance_bottom);
+ cr = cairo_create (slice->surfaces[BORDER_LEFT][BORDER_BOTTOM]);
+
+ cairo_set_source_surface (cr, surface, 0, - height + distance_bottom);
+ cairo_paint (cr);
+
+ cairo_destroy (cr);
+
+ /* Bottom/right corner */
+ slice->surfaces[BORDER_RIGHT][BORDER_BOTTOM] = cairo_surface_create_similar (surface, CAIRO_CONTENT_COLOR_ALPHA,
+ distance_right, distance_bottom);
+ cr = cairo_create (slice->surfaces[BORDER_RIGHT][BORDER_BOTTOM]);
+
+ cairo_set_source_surface (cr, surface, - width + distance_right, - height + distance_bottom);
+ cairo_paint (cr);
+
+ cairo_destroy (cr);
+
+ /* Top side */
+ slice->surfaces[BORDER_MIDDLE][BORDER_TOP] = cairo_surface_create_similar (surface,
+ CAIRO_CONTENT_COLOR_ALPHA,
+ width - distance_left - distance_right,
+ distance_top);
+ cr = cairo_create (slice->surfaces[BORDER_MIDDLE][BORDER_TOP]);
+ cairo_set_source_surface (cr, surface, - distance_left, 0);
+ cairo_paint (cr);
+ cairo_destroy (cr);
+
+ /* Bottom side */
+ slice->surfaces[BORDER_MIDDLE][BORDER_BOTTOM] = cairo_surface_create_similar (surface,
+ CAIRO_CONTENT_COLOR_ALPHA,
+ width - distance_left - distance_right,
+ distance_bottom);
+ cr = cairo_create (slice->surfaces[BORDER_MIDDLE][BORDER_BOTTOM]);
+ cairo_set_source_surface (cr, surface, - distance_left, - height + distance_bottom);
+ cairo_paint (cr);
+ cairo_destroy (cr);
+
+ /* Left side */
+ slice->surfaces[BORDER_LEFT][BORDER_MIDDLE] = cairo_surface_create_similar (surface,
+ CAIRO_CONTENT_COLOR_ALPHA,
+ distance_left,
+ height - distance_top - distance_bottom);
+ cr = cairo_create (slice->surfaces[BORDER_LEFT][BORDER_MIDDLE]);
+ cairo_set_source_surface (cr, surface, 0, - distance_top);
+ cairo_paint (cr);
+ cairo_destroy (cr);
+
+ /* Right side */
+ slice->surfaces[BORDER_RIGHT][BORDER_MIDDLE] = cairo_surface_create_similar (surface,
+ CAIRO_CONTENT_COLOR_ALPHA,
+ distance_right,
+ height - distance_top - distance_bottom);
+ cr = cairo_create (slice->surfaces[BORDER_RIGHT][BORDER_MIDDLE]);
+ cairo_set_source_surface (cr, surface, - width + distance_right, - distance_top);
+ cairo_paint (cr);
+ cairo_destroy (cr);
+
+ /* Center */
+ slice->surfaces[BORDER_MIDDLE][BORDER_MIDDLE] = cairo_surface_create_similar (surface,
+ CAIRO_CONTENT_COLOR_ALPHA,
+ width - distance_left - distance_right,
+ height - distance_top - distance_bottom);
+ cr = cairo_create (slice->surfaces[BORDER_MIDDLE][BORDER_MIDDLE]);
+ cairo_set_source_surface (cr, surface, - distance_left, - distance_top);
+ cairo_paint (cr);
+ cairo_destroy (cr);
+
+ cairo_surface_destroy (surface);
+
+ return slice;
+}
+
+static void
+render_border (cairo_t *cr,
+ cairo_surface_t *surface,
+ guint side,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height,
+ GtkSliceSideModifier modifier)
+{
+ cairo_pattern_t *pattern;
+ cairo_matrix_t matrix;
+
+ cairo_save (cr);
+
+ cairo_rectangle (cr, x, y, width, height);
+ cairo_clip (cr);
+
+ pattern = cairo_pattern_create_for_surface (surface);
+
+ if (modifier == GTK_SLICE_REPEAT)
+ {
+ cairo_matrix_init_translate (&matrix, - x, - y);
+ cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
+
+ cairo_pattern_set_matrix (pattern, &matrix);
+ cairo_set_source (cr, pattern);
+
+ cairo_rectangle (cr, x, y, width, height);
+ cairo_fill (cr);
+ }
+ else
+ {
+ /* Use nearest filter so borders aren't blurred */
+ cairo_pattern_set_filter (pattern, CAIRO_FILTER_NEAREST);
+
+ if (side == SIDE_TOP || side == SIDE_BOTTOM)
+ {
+ gint w = cairo_image_surface_get_width (surface);
+
+ cairo_translate (cr, x, y);
+ cairo_scale (cr, width / w, 1.0);
+ }
+ else
+ {
+ gint h = cairo_image_surface_get_height (surface);
+
+ cairo_translate (cr, x, y);
+ cairo_scale (cr, 1.0, height / h);
+ }
+
+ cairo_set_source (cr, pattern);
+ cairo_rectangle (cr, x, y, width, height);
+ cairo_paint (cr);
+ }
+
+ cairo_restore (cr);
+
+ cairo_pattern_destroy (pattern);
+}
+
+static void
+render_corner (cairo_t *cr,
+ cairo_surface_t *surface,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height)
+{
+ cairo_save (cr);
+
+ cairo_rectangle (cr, x, y, width, height);
+ cairo_clip (cr);
+
+ cairo_set_source_surface (cr, surface, x, y);
+ cairo_rectangle (cr, x, y, width, height);
+ cairo_fill (cr);
+
+ cairo_restore (cr);
+}
+
+void
+gtk_9slice_render (Gtk9Slice *slice,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height)
+{
+ int img_width, img_height;
+ cairo_surface_t *surface;
+
+ cairo_save (cr);
+
+ /* Top side */
+ surface = slice->surfaces[BORDER_MIDDLE][BORDER_TOP];
+ img_height = cairo_image_surface_get_height (surface);
+
+ render_border (cr, surface, SIDE_TOP,
+ x + slice->distances[SIDE_LEFT], y,
+ width - slice->distances[SIDE_LEFT] - slice->distances[SIDE_RIGHT],
+ (gdouble) img_height,
+ slice->modifiers[SIDE_TOP]);
+
+ /* Bottom side */
+ surface = slice->surfaces[BORDER_MIDDLE][BORDER_BOTTOM];
+ img_height = cairo_image_surface_get_height (surface);
+
+ render_border (cr, surface, SIDE_BOTTOM,
+ x + slice->distances[SIDE_LEFT], y + height - img_height,
+ width - slice->distances[SIDE_LEFT] - slice->distances[SIDE_RIGHT],
+ (gdouble) img_height,
+ slice->modifiers[SIDE_BOTTOM]);
+
+ /* Left side */
+ surface = slice->surfaces[BORDER_LEFT][BORDER_MIDDLE];
+ img_width = cairo_image_surface_get_width (surface);
+
+ render_border (cr, surface, SIDE_LEFT,
+ x, y + slice->distances[SIDE_TOP],
+ (gdouble) img_width,
+ height - slice->distances[SIDE_TOP] - slice->distances[SIDE_BOTTOM],
+ slice->modifiers[SIDE_LEFT]);
+
+ /* Right side */
+ surface = slice->surfaces[BORDER_RIGHT][BORDER_MIDDLE];
+ img_width = cairo_image_surface_get_width (surface);
+
+ render_border (cr, surface, SIDE_RIGHT,
+ x + width - img_width, y + slice->distances[SIDE_TOP],
+ (gdouble) img_width,
+ height - slice->distances[SIDE_TOP] - slice->distances[SIDE_BOTTOM],
+ slice->modifiers[SIDE_RIGHT]);
+
+ /* Top/Left corner */
+ surface = slice->surfaces[BORDER_LEFT][BORDER_TOP];
+ img_width = cairo_image_surface_get_width (surface);
+ img_height = cairo_image_surface_get_height (surface);
+ render_corner (cr, surface, x, y, (gdouble) img_width, (gdouble) img_height);
+
+ /* Top/right corner */
+ surface = slice->surfaces[BORDER_RIGHT][BORDER_TOP];
+ img_width = cairo_image_surface_get_width (surface);
+ img_height = cairo_image_surface_get_height (surface);
+ render_corner (cr, surface, x + width - img_width, y,
+ (gdouble) img_width, (gdouble) img_height);
+
+ /* Bottom/left corner */
+ surface = slice->surfaces[BORDER_LEFT][BORDER_BOTTOM];
+ img_width = cairo_image_surface_get_width (surface);
+ img_height = cairo_image_surface_get_height (surface);
+ render_corner (cr, surface, x, y + height - img_height,
+ (gdouble) img_width, (gdouble) img_height);
+
+ /* Bottom/right corner */
+ surface = slice->surfaces[BORDER_RIGHT][BORDER_BOTTOM];
+ img_width = cairo_image_surface_get_width (surface);
+ img_height = cairo_image_surface_get_height (surface);
+ render_corner (cr, surface, x + width - img_width, y + height - img_height,
+ (gdouble) img_width, (gdouble) img_height);
+
+ cairo_restore (cr);
+}
+
+Gtk9Slice *
+gtk_9slice_ref (Gtk9Slice *slice)
+{
+ g_return_val_if_fail (slice != NULL, NULL);
+
+ slice->ref_count++;
+ return slice;
+}
+
+void
+gtk_9slice_unref (Gtk9Slice *slice)
+{
+ g_return_if_fail (slice != NULL);
+
+ slice->ref_count--;
+
+ if (slice->ref_count == 0)
+ {
+ gint i, j;
+
+ for (i = 0; i < BORDER_LAST; i++)
+ for (j = 0; j < BORDER_LAST; j++)
+ cairo_surface_destroy (slice->surfaces[i][j]);
+
+ g_slice_free (Gtk9Slice, slice);
+ }
+}
diff --git a/gtk/gtk9slice.h b/gtk/gtk9slice.h
new file mode 100644
index 0000000000..10e3df079d
--- /dev/null
+++ b/gtk/gtk9slice.h
@@ -0,0 +1,59 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GTK_9SLICE_H__
+#define __GTK_9SLICE_H__
+
+#include "gtktimeline.h"
+
+G_BEGIN_DECLS
+
+/* Dummy typedefs */
+typedef struct Gtk9Slice Gtk9Slice;
+
+#define GTK_TYPE_9SLICE (gtk_9slice_get_type ())
+
+typedef enum {
+ GTK_SLICE_REPEAT,
+ GTK_SLICE_STRETCH
+} GtkSliceSideModifier;
+
+GType gtk_9slice_get_type (void) G_GNUC_CONST;
+
+Gtk9Slice * gtk_9slice_new (GdkPixbuf *pixbuf,
+ gdouble distance_top,
+ gdouble distance_bottom,
+ gdouble distance_left,
+ gdouble distance_right,
+ GtkSliceSideModifier horizontal_modifier,
+ GtkSliceSideModifier vertical_modifier);
+
+Gtk9Slice * gtk_9slice_ref (Gtk9Slice *slice);
+void gtk_9slice_unref (Gtk9Slice *slice);
+
+void gtk_9slice_render (Gtk9Slice *slice,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height);
+
+G_END_DECLS
+
+#endif /* __GTK_9SLICE_H__ */
diff --git a/gtk/gtkanimationdescription.c b/gtk/gtkanimationdescription.c
new file mode 100644
index 0000000000..785018ad37
--- /dev/null
+++ b/gtk/gtkanimationdescription.c
@@ -0,0 +1,137 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+#include "gtkanimationdescription.h"
+#include "gtkintl.h"
+
+struct GtkAnimationDescription
+{
+ GtkTimelineProgressType progress_type;
+ gdouble duration;
+ guint loop : 1;
+ guint ref_count;
+};
+
+GtkAnimationDescription *
+gtk_animation_description_new (gdouble duration,
+ GtkTimelineProgressType progress_type,
+ gboolean loop)
+{
+ GtkAnimationDescription *desc;
+
+ desc = g_slice_new (GtkAnimationDescription);
+ desc->duration = duration;
+ desc->progress_type = progress_type;
+ desc->loop = loop;
+ desc->ref_count = 1;
+
+ return desc;
+}
+
+gdouble
+gtk_animation_description_get_duration (GtkAnimationDescription *desc)
+{
+ return desc->duration;
+}
+
+GtkTimelineProgressType
+gtk_animation_description_get_progress_type (GtkAnimationDescription *desc)
+{
+ return desc->progress_type;
+}
+
+gboolean
+gtk_animation_description_get_loop (GtkAnimationDescription *desc)
+{
+ return (desc->loop != 0);
+}
+
+GtkAnimationDescription *
+gtk_animation_description_ref (GtkAnimationDescription *desc)
+{
+ desc->ref_count++;
+ return desc;
+}
+
+void
+gtk_animation_description_unref (GtkAnimationDescription *desc)
+{
+ desc->ref_count--;
+
+ if (desc->ref_count == 0)
+ g_slice_free (GtkAnimationDescription, desc);
+}
+
+GtkAnimationDescription *
+gtk_animation_description_from_string (const gchar *str)
+{
+ gchar timing_function[16] = { 0, };
+ gchar duration_unit[3] = { 0, };
+ gchar loop_str[5] = { 0, };
+ GtkTimelineProgressType progress_type;
+ guint duration = 0;
+ gboolean loop;
+
+ if (sscanf (str, "%d%2s %15s %5s", &duration, duration_unit, timing_function, loop_str) == 4)
+ loop = TRUE;
+ else if (sscanf (str, "%d%2s %15s", &duration, duration_unit, timing_function) == 3)
+ loop = FALSE;
+ else
+ return NULL;
+
+ if (strcmp (duration_unit, "s") == 0)
+ duration *= 1000;
+ else if (strcmp (duration_unit, "ms") != 0)
+ {
+ g_warning ("Unknown duration unit: %s\n", duration_unit);
+ return NULL;
+ }
+
+ if (strcmp (timing_function, "linear") == 0)
+ progress_type = GTK_TIMELINE_PROGRESS_LINEAR;
+ else if (strcmp (timing_function, "ease") == 0)
+ progress_type = GTK_TIMELINE_PROGRESS_EASE;
+ else if (strcmp (timing_function, "ease-in") == 0)
+ progress_type = GTK_TIMELINE_PROGRESS_EASE_IN;
+ else if (strcmp (timing_function, "ease-out") == 0)
+ progress_type = GTK_TIMELINE_PROGRESS_EASE_OUT;
+ else if (strcmp (timing_function, "ease-in-out") == 0)
+ progress_type = GTK_TIMELINE_PROGRESS_EASE_IN_OUT;
+ else
+ {
+ g_warning ("Unknown timing function: %s\n", timing_function);
+ return NULL;
+ }
+
+ return gtk_animation_description_new ((gdouble) duration, progress_type, loop);
+}
+
+GType
+gtk_animation_description_get_type (void)
+{
+ static GType type = 0;
+
+ if (G_UNLIKELY (!type))
+ type = g_boxed_type_register_static (I_("GtkAnimationDescription"),
+ (GBoxedCopyFunc) gtk_animation_description_ref,
+ (GBoxedFreeFunc) gtk_animation_description_unref);
+
+ return type;
+}
diff --git a/gtk/gtkanimationdescription.h b/gtk/gtkanimationdescription.h
new file mode 100644
index 0000000000..34fc8fcb95
--- /dev/null
+++ b/gtk/gtkanimationdescription.h
@@ -0,0 +1,49 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GTK_ANIMATION_DESCRIPTION_H__
+#define __GTK_ANIMATION_DESCRIPTION_H__
+
+#include "gtktimeline.h"
+
+G_BEGIN_DECLS
+
+/* Dummy typedefs */
+typedef struct GtkAnimationDescription GtkAnimationDescription;
+
+#define GTK_TYPE_ANIMATION_DESCRIPTION (gtk_animation_description_get_type ())
+
+GType gtk_animation_description_get_type (void) G_GNUC_CONST;
+
+GtkAnimationDescription * gtk_animation_description_new (gdouble duration,
+ GtkTimelineProgressType progress_type,
+ gboolean loop);
+
+gdouble gtk_animation_description_get_duration (GtkAnimationDescription *desc);
+GtkTimelineProgressType gtk_animation_description_get_progress_type (GtkAnimationDescription *desc);
+gboolean gtk_animation_description_get_loop (GtkAnimationDescription *desc);
+
+GtkAnimationDescription * gtk_animation_description_ref (GtkAnimationDescription *desc);
+void gtk_animation_description_unref (GtkAnimationDescription *desc);
+
+GtkAnimationDescription * gtk_animation_description_from_string (const gchar *str);
+
+G_END_DECLS
+
+#endif /* __GTK_ANIMATION_DESCRIPTION_H__ */
diff --git a/gtk/gtkborder.c b/gtk/gtkborder.c
new file mode 100644
index 0000000000..6ea466a405
--- /dev/null
+++ b/gtk/gtkborder.c
@@ -0,0 +1,76 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GTK+ Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#include "config.h"
+
+#include "gtkborder.h"
+
+/**
+ * gtk_border_new:
+ *
+ * Allocates a new #GtkBorder structure and initializes its elements to zero.
+ *
+ * Returns: a newly allocated #GtkBorder. Free with gtk_border_free()
+ *
+ * Since: 2.14
+ */
+GtkBorder *
+gtk_border_new (void)
+{
+ return g_slice_new0 (GtkBorder);
+}
+
+/**
+ * gtk_border_copy:
+ * @border_: a #GtkBorder
+ *
+ * Copies a #GtkBorder structure.
+ *
+ * Returns: a copy of @border_.
+ */
+GtkBorder *
+gtk_border_copy (const GtkBorder *border_)
+{
+ g_return_val_if_fail (border_ != NULL, NULL);
+
+ return g_slice_dup (GtkBorder, border_);
+}
+
+/**
+ * gtk_border_free:
+ * @border_: a #GtkBorder
+ *
+ * Frees a #GtkBorder structure.
+ */
+void
+gtk_border_free (GtkBorder *border_)
+{
+ g_slice_free (GtkBorder, border_);
+}
+
+G_DEFINE_BOXED_TYPE (GtkBorder, gtk_border,
+ gtk_border_copy,
+ gtk_border_free)
diff --git a/gtk/gtkborder.h b/gtk/gtkborder.h
new file mode 100644
index 0000000000..51a5b7bfd6
--- /dev/null
+++ b/gtk/gtkborder.h
@@ -0,0 +1,68 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GTK+ Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
+#error "Only <gtk/gtk.h> can be included directly."
+#endif
+
+#ifndef __GTK_BORDER_H__
+#define __GTK_BORDER_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GtkBorder GtkBorder;
+
+#define GTK_TYPE_BORDER (gtk_border_get_type ())
+
+/**
+ * GtkBorder:
+ * @left: The width of the left border.
+ * @right: The width of the right border.
+ * @top: The width of the top border.
+ * @bottom: The width of the bottom border.
+ *
+ * A struct that specifies a border around a rectangular area that can
+ * be of different width on each side.
+ */
+struct _GtkBorder
+{
+ gint16 left;
+ gint16 right;
+ gint16 top;
+ gint16 bottom;
+};
+
+GType gtk_border_get_type (void) G_GNUC_CONST;
+GtkBorder *gtk_border_new (void) G_GNUC_MALLOC;
+GtkBorder *gtk_border_copy (const GtkBorder *border_);
+void gtk_border_free (GtkBorder *border_);
+
+
+G_END_DECLS
+
+#endif /* __GTK_BORDER_H__ */
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 71fb865f43..f0e00dadef 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -113,7 +113,7 @@ static void gtk_button_realize (GtkWidget * widget);
static void gtk_button_unrealize (GtkWidget * widget);
static void gtk_button_map (GtkWidget * widget);
static void gtk_button_unmap (GtkWidget * widget);
-static void gtk_button_style_set (GtkWidget * widget, GtkStyle * prev_style);
+static void gtk_button_style_updated (GtkWidget * widget);
static void gtk_button_size_allocate (GtkWidget * widget,
GtkAllocation * allocation);
static gint gtk_button_draw (GtkWidget * widget, cairo_t *cr);
@@ -197,7 +197,7 @@ gtk_button_class_init (GtkButtonClass *klass)
widget_class->unrealize = gtk_button_unrealize;
widget_class->map = gtk_button_map;
widget_class->unmap = gtk_button_unmap;
- widget_class->style_set = gtk_button_style_set;
+ widget_class->style_updated = gtk_button_style_updated;
widget_class->size_allocate = gtk_button_size_allocate;
widget_class->draw = gtk_button_draw;
widget_class->button_press_event = gtk_button_button_press;
@@ -533,6 +533,7 @@ static void
gtk_button_init (GtkButton *button)
{
GtkButtonPrivate *priv;
+ GtkStyleContext *context;
button->priv = G_TYPE_INSTANCE_GET_PRIVATE (button,
GTK_TYPE_BUTTON,
@@ -561,6 +562,9 @@ gtk_button_init (GtkButton *button)
priv->image_is_stock = TRUE;
priv->image_position = GTK_POS_LEFT;
priv->use_action_appearance = TRUE;
+
+ context = gtk_widget_get_style_context (GTK_WIDGET (button));
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_BUTTON);
}
static void
@@ -1375,8 +1379,7 @@ gtk_button_update_image_spacing (GtkButton *button)
}
static void
-gtk_button_style_set (GtkWidget *widget,
- GtkStyle *prev_style)
+gtk_button_style_updated (GtkWidget *widget)
{
gtk_button_update_image_spacing (GTK_BUTTON (widget));
}
@@ -1441,18 +1444,21 @@ gtk_button_size_allocate (GtkWidget *widget,
GtkButton *button = GTK_BUTTON (widget);
GtkButtonPrivate *priv = button->priv;
GtkAllocation child_allocation;
- GtkStyle *style;
+ GtkStyleContext *context;
+ GtkStateFlags state;
GtkWidget *child;
- gint xthickness, ythickness;
GtkBorder default_border;
- GtkBorder inner_border;
+ GtkBorder inner_border, *border;
gint focus_width;
gint focus_pad;
- style = gtk_widget_get_style (widget);
- xthickness = style->xthickness;
- ythickness = style->ythickness;
+ context = gtk_widget_get_style_context (widget);
+ state = gtk_widget_get_state_flags (widget);
+
+ gtk_style_context_get (context, state,
+ "border-width", &border,
+ NULL);
gtk_button_get_props (button, &default_border, NULL, &inner_border, NULL);
gtk_widget_style_get (GTK_WIDGET (widget),
@@ -1472,18 +1478,18 @@ gtk_button_size_allocate (GtkWidget *widget,
child = gtk_bin_get_child (GTK_BIN (button));
if (child && gtk_widget_get_visible (child))
{
- child_allocation.x = allocation->x + inner_border.left + xthickness;
- child_allocation.y = allocation->y + inner_border.top + ythickness;
+ child_allocation.x = allocation->x + inner_border.left + border->left;
+ child_allocation.y = allocation->y + inner_border.top + border->top;
child_allocation.width =
allocation->width -
- xthickness * 2 -
+ (border->left + border->right) -
inner_border.left -
inner_border.right;
child_allocation.height =
allocation->height -
- ythickness * 2 -
+ (border->top + border->bottom) -
inner_border.top -
inner_border.bottom;
@@ -1521,6 +1527,8 @@ gtk_button_size_allocate (GtkWidget *widget,
gtk_widget_size_allocate (child, &child_allocation);
}
+
+ gtk_border_free (border);
}
void
@@ -1543,7 +1551,8 @@ _gtk_button_paint (GtkButton *button,
gint focus_pad;
GtkAllocation allocation;
GdkWindow *window;
- GtkStyle *style;
+ GtkStyleContext *context;
+ GtkStateFlags state;
widget = GTK_WIDGET (button);
@@ -1554,7 +1563,7 @@ _gtk_button_paint (GtkButton *button,
NULL);
gtk_widget_get_allocation (widget, &allocation);
- style = gtk_widget_get_style (widget);
+ context = gtk_widget_get_style_context (widget);
window = gtk_widget_get_window (widget);
x = 0;
@@ -1563,15 +1572,12 @@ _gtk_button_paint (GtkButton *button,
if (gtk_widget_has_default (widget) &&
priv->relief == GTK_RELIEF_NORMAL)
{
- gtk_paint_box (style, cr,
- GTK_STATE_NORMAL, GTK_SHADOW_IN,
- widget, "buttondefault",
- x, y, width, height);
-
x += default_border.left;
y += default_border.top;
width -= default_border.left + default_border.right;
height -= default_border.top + default_border.bottom;
+
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_DEFAULT);
}
else if (gtk_widget_get_can_default (widget))
{
@@ -1589,31 +1595,41 @@ _gtk_button_paint (GtkButton *button,
height -= 2 * (focus_width + focus_pad);
}
+ state = gtk_widget_get_state_flags (widget);
+ gtk_style_context_set_state (context, state);
+
if (priv->relief != GTK_RELIEF_NONE || priv->depressed ||
- gtk_widget_get_state(widget) == GTK_STATE_PRELIGHT)
- gtk_paint_box (style, cr,
- state_type,
- shadow_type, widget, "button",
- x, y, width, height);
-
+ state & GTK_STATE_FLAG_PRELIGHT)
+ {
+ gtk_render_background (context, cr,
+ x, y, width, height);
+ gtk_render_frame (context, cr,
+ x, y, width, height);
+ }
+
if (gtk_widget_has_focus (widget))
{
gint child_displacement_x;
gint child_displacement_y;
gboolean displace_focus;
-
+ GtkBorder *border;
+
gtk_widget_style_get (widget,
"child-displacement-y", &child_displacement_y,
"child-displacement-x", &child_displacement_x,
"displace-focus", &displace_focus,
NULL);
+ gtk_style_context_get (context, state,
+ "border-width", &border,
+ NULL);
+
if (interior_focus)
{
- x += style->xthickness + focus_pad;
- y += style->ythickness + focus_pad;
- width -= 2 * (style->xthickness + focus_pad);
- height -= 2 * (style->ythickness + focus_pad);
+ x += border->left + focus_pad;
+ y += border->top + focus_pad;
+ width -= (2 * focus_pad) + border->left + border->right;
+ height -= (2 * focus_pad) + border->top + border->bottom;
}
else
{
@@ -1629,10 +1645,10 @@ _gtk_button_paint (GtkButton *button,
y += child_displacement_y;
}
- gtk_paint_focus (style, cr,
- gtk_widget_get_state (widget),
- widget, "button",
- x, y, width, height);
+ gtk_render_focus (context, cr,
+ x, y, width, height);
+
+ gtk_border_free (border);
}
}
@@ -1889,10 +1905,12 @@ gtk_button_get_size (GtkWidget *widget,
gint *natural_size)
{
GtkButton *button = GTK_BUTTON (widget);
- GtkStyle *style;
+ GtkStyleContext *context;
GtkWidget *child;
GtkBorder default_border;
GtkBorder inner_border;
+ GtkStateFlags state;
+ GtkBorder *border;
gint focus_width;
gint focus_pad;
gint minimum, natural;
@@ -1903,11 +1921,16 @@ gtk_button_get_size (GtkWidget *widget,
"focus-padding", &focus_pad,
NULL);
- style = gtk_widget_get_style (GTK_WIDGET (widget));
+ context = gtk_widget_get_style_context (GTK_WIDGET (widget));
+ state = gtk_widget_get_state_flags (GTK_WIDGET (widget));
+
+ gtk_style_context_get (context, state,
+ "border-width", &border,
+ NULL);
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
- minimum = (style->xthickness * 2 +
+ minimum = (border->left + border->right +
inner_border.left + inner_border.right);
if (gtk_widget_get_can_default (GTK_WIDGET (widget)))
@@ -1915,7 +1938,7 @@ gtk_button_get_size (GtkWidget *widget,
}
else
{
- minimum = (style->ythickness * 2 +
+ minimum = (border->top + border->bottom +
inner_border.top + inner_border.bottom);
if (gtk_widget_get_can_default (GTK_WIDGET (widget)))
@@ -1944,6 +1967,8 @@ gtk_button_get_size (GtkWidget *widget,
if (natural_size)
*natural_size = natural;
+
+ gtk_border_free (border);
}
static void
@@ -2255,7 +2280,7 @@ static void
gtk_button_update_state (GtkButton *button)
{
GtkButtonPrivate *priv = button->priv;
- GtkStateType new_state;
+ GtkStateFlags new_state = 0;
gboolean depressed;
if (priv->activate_timeout)
@@ -2263,13 +2288,14 @@ gtk_button_update_state (GtkButton *button)
else
depressed = priv->in_button && priv->button_down;
- if (priv->in_button && (!priv->button_down || !depressed))
- new_state = GTK_STATE_PRELIGHT;
- else
- new_state = depressed ? GTK_STATE_ACTIVE : GTK_STATE_NORMAL;
+ if (priv->in_button)
+ new_state |= GTK_STATE_FLAG_PRELIGHT;
+
+ if (priv->button_down || depressed)
+ new_state |= GTK_STATE_FLAG_ACTIVE;
- _gtk_button_set_depressed (button, depressed);
- gtk_widget_set_state (GTK_WIDGET (button), new_state);
+ _gtk_button_set_depressed (button, depressed);
+ gtk_widget_set_state_flags (GTK_WIDGET (button), new_state, TRUE);
}
static void
diff --git a/gtk/gtkcellrenderer.c b/gtk/gtkcellrenderer.c
index 96465a84dc..a60b8885cc 100644
--- a/gtk/gtkcellrenderer.c
+++ b/gtk/gtkcellrenderer.c
@@ -27,18 +27,18 @@
/**
* SECTION:gtkcellrenderer
- * @Short_description: An object for rendering a single cell on a GdkDrawable
+ * @Short_description: An object for rendering a single cell
* @Title: GtkCellRenderer
* @See_also: #GtkCellRendererText, #GtkCellRendererPixbuf, #GtkCellRendererToggle
*
* The #GtkCellRenderer is a base class of a set of objects used for
- * rendering a cell to a #GdkDrawable. These objects are used primarily by
+ * rendering a cell to a #cairo_t. These objects are used primarily by
* the #GtkTreeView widget, though they aren't tied to them in any
* specific way. It is worth noting that #GtkCellRenderer is not a
* #GtkWidget and cannot be treated as such.
*
* The primary use of a #GtkCellRenderer is for drawing a certain graphical
- * elements on a #GdkDrawable. Typically, one cell renderer is used to
+ * elements on a #cairo_t. Typically, one cell renderer is used to
* draw many cells on the screen. To this extent, it isn't expected that a
* CellRenderer keep any permanent state around. Instead, any state is set
* just prior to use using #GObject<!-- -->s property system. Then, the
diff --git a/gtk/gtkcellrendererpixbuf.c b/gtk/gtkcellrendererpixbuf.c
index 52b4ec98e5..729d08a89d 100644
--- a/gtk/gtkcellrendererpixbuf.c
+++ b/gtk/gtkcellrendererpixbuf.c
@@ -533,14 +533,13 @@ gtk_cell_renderer_pixbuf_create_themed_pixbuf (GtkCellRendererPixbuf *cellpixbuf
if (info)
{
- GtkStyle *style;
-
- style = gtk_widget_get_style (GTK_WIDGET (widget));
- priv->pixbuf = gtk_icon_info_load_symbolic_for_style (info,
- style,
- GTK_STATE_NORMAL,
- NULL,
- NULL);
+ GtkStyleContext *context;
+
+ context = gtk_widget_get_style_context (GTK_WIDGET (widget));
+ priv->pixbuf = gtk_icon_info_load_symbolic_for_context (info,
+ context,
+ NULL,
+ NULL);
gtk_icon_info_free (info);
}
@@ -603,12 +602,13 @@ create_symbolic_pixbuf (GtkCellRendererPixbuf *cellpixbuf,
if (info)
{
- GtkStyle *style;
+ GtkStyleContext *context;
- style = gtk_widget_get_style (GTK_WIDGET (widget));
- pixbuf = gtk_icon_info_load_symbolic_for_style (info,
- style, state,
- NULL, NULL);
+ context = gtk_widget_get_style_context (GTK_WIDGET (widget));
+ pixbuf = gtk_icon_info_load_symbolic_for_context (info,
+ context,
+ NULL,
+ NULL);
gtk_icon_info_free (info);
return pixbuf;
}
diff --git a/gtk/gtkcheckbutton.c b/gtk/gtkcheckbutton.c
index f07ecf1282..91b92f0f70 100644
--- a/gtk/gtkcheckbutton.c
+++ b/gtk/gtkcheckbutton.c
@@ -155,34 +155,33 @@ gtk_check_button_paint (GtkWidget *widget,
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
if (gtk_widget_has_focus (widget))
{
- GtkStateType state = gtk_widget_get_state (widget);
- GtkStyle *style = gtk_widget_get_style (widget);
GtkWidget *child = gtk_bin_get_child (GTK_BIN (widget));
+ GtkStyleContext *context;
+ GtkStateFlags state;
GtkAllocation allocation;
gtk_widget_get_allocation (widget, &allocation);
+ context = gtk_widget_get_style_context (widget);
+ state = gtk_widget_get_state_flags (widget);
+
+ gtk_style_context_set_state (context, state);
if (interior_focus && child && gtk_widget_get_visible (child))
{
GtkAllocation child_allocation;
gtk_widget_get_allocation (child, &child_allocation);
- gtk_paint_focus (style, cr, state,
- widget, "checkbutton",
- child_allocation.x - allocation.x - focus_width - focus_pad,
- child_allocation.y - allocation.y - focus_width - focus_pad,
- child_allocation.width + 2 * (focus_width + focus_pad),
- child_allocation.height + 2 * (focus_width + focus_pad));
+ gtk_render_focus (context, cr,
+ child_allocation.x - allocation.x - focus_width - focus_pad,
+ child_allocation.y - allocation.y - focus_width - focus_pad,
+ child_allocation.width + 2 * (focus_width + focus_pad),
+ child_allocation.height + 2 * (focus_width + focus_pad));
}
else
- {
- gtk_paint_focus (style, cr, state,
- widget, "checkbutton",
- border_width,
- border_width,
- allocation.width - 2 * border_width,
- allocation.height - 2 * border_width);
- }
+ gtk_render_focus (context, cr,
+ border_width, border_width,
+ allocation.width - 2 * border_width,
+ allocation.height - 2 * border_width);
}
}
@@ -408,8 +407,7 @@ gtk_real_check_button_draw_indicator (GtkCheckButton *check_button,
GtkWidget *child;
GtkButton *button;
GtkToggleButton *toggle_button;
- GtkStateType state_type;
- GtkShadowType shadow_type;
+ GtkStateFlags state = 0;
gint x, y;
gint indicator_size;
gint indicator_spacing;
@@ -418,16 +416,14 @@ gtk_real_check_button_draw_indicator (GtkCheckButton *check_button,
guint border_width;
gboolean interior_focus;
GtkAllocation allocation;
- GtkStyle *style;
- GdkWindow *window;
+ GtkStyleContext *context;
widget = GTK_WIDGET (check_button);
button = GTK_BUTTON (check_button);
toggle_button = GTK_TOGGLE_BUTTON (check_button);
gtk_widget_get_allocation (widget, &allocation);
- style = gtk_widget_get_style (widget);
- window = gtk_widget_get_window (widget);
+ context = gtk_widget_get_style_context (widget);
gtk_widget_style_get (widget,
"interior-focus", &interior_focus,
@@ -447,37 +443,35 @@ gtk_real_check_button_draw_indicator (GtkCheckButton *check_button,
x += focus_width + focus_pad;
if (gtk_toggle_button_get_inconsistent (toggle_button))
- shadow_type = GTK_SHADOW_ETCHED_IN;
- else if (gtk_toggle_button_get_active (toggle_button))
- shadow_type = GTK_SHADOW_IN;
- else
- shadow_type = GTK_SHADOW_OUT;
+ state |= GTK_STATE_FLAG_INCONSISTENT;
+ else if (gtk_toggle_button_get_active (toggle_button) ||
+ (button->priv->button_down && button->priv->in_button))
+ state |= GTK_STATE_FLAG_ACTIVE;
if (button->priv->activate_timeout || (button->priv->button_down && button->priv->in_button))
- state_type = GTK_STATE_ACTIVE;
- else if (button->priv->in_button)
- state_type = GTK_STATE_PRELIGHT;
+ state |= GTK_STATE_FLAG_SELECTED;
+
+ if (button->priv->in_button)
+ state |= GTK_STATE_FLAG_PRELIGHT;
else if (!gtk_widget_is_sensitive (widget))
- state_type = GTK_STATE_INSENSITIVE;
- else
- state_type = GTK_STATE_NORMAL;
-
+ state |= GTK_STATE_FLAG_INSENSITIVE;
+
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
x = allocation.width - (indicator_size + x);
- if (gtk_widget_get_state (widget) == GTK_STATE_PRELIGHT)
- {
+ gtk_style_context_set_state (context, state);
- gtk_paint_flat_box (style, cr, GTK_STATE_PRELIGHT,
- GTK_SHADOW_ETCHED_OUT,
- widget, "checkbutton",
- border_width, border_width,
- allocation.width - (2 * border_width),
- allocation.height - (2 * border_width));
- }
+ if (state & GTK_STATE_FLAG_PRELIGHT)
+ gtk_render_background (context, cr,
+ border_width, border_width,
+ allocation.width - (2 * border_width),
+ allocation.height - (2 * border_width));
+
+ gtk_style_context_save (context);
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_CHECK);
+
+ gtk_render_check (context, cr,
+ x, y, indicator_size, indicator_size);
- gtk_paint_check (style, cr,
- state_type, shadow_type,
- widget, "checkbutton",
- x, y, indicator_size, indicator_size);
+ gtk_style_context_restore (context);
}
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index ebdd7f5e1d..0cf07377b0 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -280,13 +280,12 @@ static void gtk_combo_box_get_property (GObject *object,
static void gtk_combo_box_state_changed (GtkWidget *widget,
GtkStateType previous);
static void gtk_combo_box_grab_focus (GtkWidget *widget);
-static void gtk_combo_box_style_set (GtkWidget *widget,
- GtkStyle *previous);
+static void gtk_combo_box_style_updated (GtkWidget *widget);
static void gtk_combo_box_button_toggled (GtkWidget *widget,
gpointer data);
-static void gtk_combo_box_button_state_changed (GtkWidget *widget,
- GtkStateType previous,
- gpointer data);
+static void gtk_combo_box_button_state_flags_changed (GtkWidget *widget,
+ GtkStateFlags previous,
+ gpointer data);
static void gtk_combo_box_add (GtkContainer *container,
GtkWidget *widget);
static void gtk_combo_box_remove (GtkContainer *container,
@@ -566,7 +565,7 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass)
widget_class->scroll_event = gtk_combo_box_scroll_event;
widget_class->mnemonic_activate = gtk_combo_box_mnemonic_activate;
widget_class->grab_focus = gtk_combo_box_grab_focus;
- widget_class->style_set = gtk_combo_box_style_set;
+ widget_class->style_updated = gtk_combo_box_style_updated;
widget_class->state_changed = gtk_combo_box_state_changed;
widget_class->get_preferred_width = gtk_combo_box_get_preferred_width;
widget_class->get_preferred_height = gtk_combo_box_get_preferred_height;
@@ -1079,6 +1078,7 @@ static void
gtk_combo_box_init (GtkComboBox *combo_box)
{
GtkComboBoxPrivate *priv;
+ GtkStyleContext *context;
combo_box->priv = G_TYPE_INSTANCE_GET_PRIVATE (combo_box,
GTK_TYPE_COMBO_BOX,
@@ -1116,6 +1116,9 @@ gtk_combo_box_init (GtkComboBox *combo_box)
priv->id_column = -1;
gtk_combo_box_check_appearance (combo_box);
+
+ context = gtk_widget_get_style_context (GTK_WIDGET (combo_box));
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_BUTTON);
}
static void
@@ -1314,17 +1317,30 @@ gtk_combo_box_state_changed (GtkWidget *widget,
if (gtk_widget_get_realized (widget))
{
if (priv->tree_view && priv->cell_view)
- gtk_cell_view_set_background_color (GTK_CELL_VIEW (priv->cell_view),
- &gtk_widget_get_style (widget)->base[gtk_widget_get_state (widget)]);
+ {
+ GtkStyleContext *context;
+ GtkStateFlags state;
+ GdkRGBA *color;
+
+ context = gtk_widget_get_style_context (widget);
+ state = gtk_widget_get_state_flags (widget);
+
+ gtk_style_context_get (context, state,
+ "background-color", &color,
+ NULL);
+
+ gtk_cell_view_set_background_rgba (GTK_CELL_VIEW (priv->cell_view), color);
+ gdk_rgba_free (color);
+ }
}
gtk_widget_queue_draw (widget);
}
static void
-gtk_combo_box_button_state_changed (GtkWidget *widget,
- GtkStateType previous,
- gpointer data)
+gtk_combo_box_button_state_flags_changed (GtkWidget *widget,
+ GtkStateFlags previous,
+ gpointer data)
{
GtkComboBox *combo_box = GTK_COMBO_BOX (data);
GtkComboBoxPrivate *priv = combo_box->priv;
@@ -1332,14 +1348,9 @@ gtk_combo_box_button_state_changed (GtkWidget *widget,
if (gtk_widget_get_realized (widget))
{
if (!priv->tree_view && priv->cell_view)
- {
- if ((gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE) !=
- (gtk_widget_get_state (priv->cell_view) == GTK_STATE_INSENSITIVE))
- gtk_widget_set_sensitive (priv->cell_view, gtk_widget_get_sensitive (widget));
-
- gtk_widget_set_state (priv->cell_view,
- gtk_widget_get_state (widget));
- }
+ gtk_widget_set_state_flags (priv->cell_view,
+ gtk_widget_get_state_flags (widget),
+ TRUE);
}
gtk_widget_queue_draw (widget);
@@ -1388,8 +1399,7 @@ gtk_combo_box_check_appearance (GtkComboBox *combo_box)
}
static void
-gtk_combo_box_style_set (GtkWidget *widget,
- GtkStyle *previous)
+gtk_combo_box_style_updated (GtkWidget *widget)
{
GtkComboBox *combo_box = GTK_COMBO_BOX (widget);
GtkComboBoxPrivate *priv = combo_box->priv;
@@ -1398,8 +1408,20 @@ gtk_combo_box_style_set (GtkWidget *widget,
gtk_combo_box_check_appearance (combo_box);
if (priv->tree_view && priv->cell_view)
- gtk_cell_view_set_background_color (GTK_CELL_VIEW (priv->cell_view),
- &gtk_widget_get_style (widget)->base[gtk_widget_get_state (widget)]);
+ {
+ GtkStyleContext *context;
+ GdkRGBA *color;
+
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_get (context, 0,
+ "background-color", &color,
+ NULL);
+
+ gtk_cell_view_set_background_rgba (GTK_CELL_VIEW (priv->cell_view),
+ color);
+
+ gdk_rgba_free (color);
+ }
child = gtk_bin_get_child (GTK_BIN (combo_box));
if (GTK_IS_ENTRY (child))
@@ -1718,6 +1740,24 @@ gtk_combo_box_set_popup_widget (GtkComboBox *combo_box,
}
static void
+get_widget_border (GtkWidget *widget,
+ GtkBorder *border)
+{
+ GtkStyleContext *context;
+ GtkBorder *border_width;
+
+ context = gtk_widget_get_style_context (widget);
+
+ gtk_style_context_get (context,
+ gtk_widget_get_state_flags (widget),
+ "border-width", &border_width,
+ NULL);
+
+ *border = *border_width;
+ gtk_border_free (border_width);
+}
+
+static void
gtk_combo_box_menu_position_below (GtkMenu *menu,
gint *x,
gint *y,
@@ -1732,7 +1772,8 @@ gtk_combo_box_menu_position_below (GtkMenu *menu,
GdkScreen *screen;
gint monitor_num;
GdkRectangle monitor;
-
+ GtkBorder border;
+
/* FIXME: is using the size request here broken? */
child = gtk_bin_get_child (GTK_BIN (combo_box));
@@ -1748,9 +1789,8 @@ gtk_combo_box_menu_position_below (GtkMenu *menu,
gdk_window_get_root_coords (gtk_widget_get_window (child),
sx, sy, &sx, &sy);
-
- if (GTK_SHADOW_NONE != combo_box->priv->shadow_type)
- sx -= gtk_widget_get_style (GTK_WIDGET (combo_box))->xthickness;
+ get_widget_border (GTK_WIDGET (combo_box), &border);
+ sx -= border.left;
if (combo_box->priv->popup_fixed_width)
gtk_widget_get_preferred_size (GTK_WIDGET (menu), &req, NULL);
@@ -2440,13 +2480,13 @@ gtk_combo_box_update_requested_width (GtkComboBox *combo_box,
&req, NULL); \
\
if (is_rtl) \
- child.x = allocation->x + shadow_width; \
+ child.x = allocation->x + border.right; \
else \
- child.x = allocation->x + allocation->width - req.width - shadow_width; \
+ child.x = allocation->x + allocation->width - req.width - border.left; \
\
- child.y = allocation->y + shadow_height; \
+ child.y = allocation->y + border.top; \
child.width = req.width; \
- child.height = allocation->height - 2 * shadow_height; \
+ child.height = allocation->height - (border.top + border.bottom); \
child.width = MAX (1, child.width); \
child.height = MAX (1, child.height); \
\
@@ -2459,54 +2499,40 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
GtkComboBox *combo_box = GTK_COMBO_BOX (widget);
GtkComboBoxPrivate *priv = combo_box->priv;
GtkWidget *child_widget;
- gint shadow_width, shadow_height;
gint focus_width, focus_pad;
GtkAllocation child;
GtkRequisition req;
- GtkStyle *style;
+ GtkBorder border;
gboolean is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
gtk_widget_set_allocation (widget, allocation);
child_widget = gtk_bin_get_child (GTK_BIN (widget));
+ get_widget_border (widget, &border);
- style = gtk_widget_get_style (widget);
gtk_widget_style_get (widget,
"focus-line-width", &focus_width,
"focus-padding", &focus_pad,
NULL);
- if (GTK_SHADOW_NONE != priv->shadow_type)
- {
- shadow_width = style->xthickness;
- shadow_height = style->ythickness;
- }
- else
- {
- shadow_width = 0;
- shadow_height = 0;
- }
-
if (!priv->tree_view)
{
if (priv->cell_view)
{
- gint xthickness, ythickness;
+ GtkBorder button_border;
gint width;
guint border_width;
/* menu mode */
- allocation->x += shadow_width;
- allocation->y += shadow_height;
- allocation->width -= 2 * shadow_width;
- allocation->height -= 2 * shadow_height;
+ allocation->x += border.left;
+ allocation->y += border.top;
+ allocation->width -= border.left + border.right;
+ allocation->height -= border.top + border.bottom;
gtk_widget_size_allocate (priv->button, allocation);
/* set some things ready */
border_width = gtk_container_get_border_width (GTK_CONTAINER (priv->button));
- style = gtk_widget_get_style (priv->button);
- xthickness = style->xthickness;
- ythickness = style->ythickness;
+ get_widget_border (priv->button, &button_border);
child.x = allocation->x;
child.y = allocation->y;
@@ -2515,10 +2541,12 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
if (!priv->is_cell_renderer)
{
- child.x += border_width + xthickness + focus_width + focus_pad;
- child.y += border_width + ythickness + focus_width + focus_pad;
- width -= 2 * (child.x - allocation->x);
- child.height -= 2 * (child.y - allocation->y);
+ child.x += border_width + button_border.left + focus_width + focus_pad;
+ child.y += border_width + button_border.top + focus_width + focus_pad;
+ width -= (2 * (border_width + focus_width + focus_pad)) +
+ button_border.left + button_border.right;
+ child.height -= (2 * (border_width + focus_width + focus_pad)) +
+ button_border.top + button_border.bottom;
}
@@ -2544,14 +2572,14 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
{
child.x += req.width;
child.width = allocation->x + allocation->width
- - (border_width + xthickness + focus_width + focus_pad)
+ - (border_width + button_border.right + focus_width + focus_pad)
- child.x;
}
else
{
child.width = child.x;
child.x = allocation->x
- + border_width + xthickness + focus_width + focus_pad;
+ + border_width + button_border.left + focus_width + focus_pad;
child.width -= child.x;
}
@@ -2589,11 +2617,11 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
GTK_COMBO_BOX_SIZE_ALLOCATE_BUTTON
if (is_rtl)
- child.x = allocation->x + req.width + shadow_width;
+ child.x = allocation->x + req.width + border.right;
else
- child.x = allocation->x + shadow_width;
- child.y = allocation->y + shadow_height;
- child.width = allocation->width - req.width - 2 * shadow_width;
+ child.x = allocation->x + border.left;
+ child.y = allocation->y + border.top;
+ child.width = allocation->width - req.width - (border.left + border.right);
child.width = MAX (1, child.width);
child.height = MAX (1, child.height);
gtk_widget_size_allocate (child_widget, &child);
@@ -2602,11 +2630,7 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
else
{
/* list mode */
-
- /* Combobox thickness + border-width */
guint border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
- int delta_x = shadow_width + border_width;
- int delta_y = shadow_height + border_width;
/* button */
GTK_COMBO_BOX_SIZE_ALLOCATE_BUTTON
@@ -2623,32 +2647,32 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
if (priv->cell_view_frame)
{
- child.x += delta_x;
- child.y += delta_y;
- child.width = MAX (1, child.width - delta_x * 2);
- child.height = MAX (1, child.height - delta_y * 2);
+ child.x += border.left + border_width;
+ child.y += border.top + border_width;
+ child.width = MAX (1, child.width - (2 * border_width) - (border.left + border.right));
+ child.height = MAX (1, child.height - (2 * border_width) - (border.top + border.bottom));
gtk_widget_size_allocate (priv->cell_view_frame, &child);
/* the sample */
if (priv->has_frame)
{
+ GtkBorder frame_border;
+
border_width = gtk_container_get_border_width (GTK_CONTAINER (priv->cell_view_frame));
- style = gtk_widget_get_style (priv->cell_view_frame);
- delta_x = border_width + style->xthickness;
- delta_y = border_width + style->ythickness;
-
- child.x += delta_x;
- child.y += delta_y;
- child.width -= delta_x * 2;
- child.height -= delta_y * 2;
+ get_widget_border (priv->cell_view_frame, &frame_border);
+
+ child.x += border_width + frame_border.left;
+ child.y += border_width + frame_border.right;
+ child.width -= (2 * border_width) + frame_border.left + frame_border.right;
+ child.height -= (2 * border_width) + frame_border.top + frame_border.bottom;
}
}
else
{
- child.x += delta_x;
- child.y += delta_y;
- child.width -= delta_x * 2;
- child.height -= delta_y * 2;
+ child.x += border.left + border_width;
+ child.y += border.top + border_width;
+ child.width -= (2 * border_width) - (border.left + border.right);
+ child.height -= (2 * border_width) - (border.top + border.bottom);
}
if (gtk_widget_get_visible (priv->popup_window))
@@ -2762,11 +2786,17 @@ gtk_combo_box_draw (GtkWidget *widget,
if (priv->shadow_type != GTK_SHADOW_NONE)
{
- gtk_paint_shadow (gtk_widget_get_style (widget),
- cr,
- GTK_STATE_NORMAL, priv->shadow_type,
- widget, "combobox",
- 0, 0,
+ GtkStyleContext *context;
+ GtkStateFlags state;
+
+ context = gtk_widget_get_style_context (widget);
+ state = gtk_widget_get_state_flags (widget);
+ gtk_style_context_set_state (context, state);
+
+ gtk_render_background (context, cr, 0, 0,
+ gtk_widget_get_allocated_width (widget),
+ gtk_widget_get_allocated_height (widget));
+ gtk_render_frame (context, cr, 0, 0,
gtk_widget_get_allocated_width (widget),
gtk_widget_get_allocated_height (widget));
}
@@ -3108,8 +3138,8 @@ gtk_combo_box_menu_setup (GtkComboBox *combo_box,
g_signal_connect (priv->button, "button-press-event",
G_CALLBACK (gtk_combo_box_menu_button_press),
combo_box);
- g_signal_connect (priv->button, "state-changed",
- G_CALLBACK (gtk_combo_box_button_state_changed),
+ g_signal_connect (priv->button, "state-flags-changed",
+ G_CALLBACK (gtk_combo_box_button_state_flags_changed),
combo_box);
/* create our funky menu */
@@ -3274,7 +3304,7 @@ gtk_combo_box_menu_destroy (GtkComboBox *combo_box)
g_signal_handlers_disconnect_matched (priv->button,
G_SIGNAL_MATCH_DATA,
0, 0, NULL,
- gtk_combo_box_button_state_changed, combo_box);
+ gtk_combo_box_button_state_flags_changed, combo_box);
/* unparent will remove our latest ref */
gtk_widget_unparent (priv->button);
@@ -3920,7 +3950,6 @@ gtk_combo_box_list_setup (GtkComboBox *combo_box)
{
GtkComboBoxPrivate *priv = combo_box->priv;
GtkTreeSelection *sel;
- GtkStyle *style;
GtkWidget *child;
GtkWidget *widget = GTK_WIDGET (combo_box);
@@ -3940,9 +3969,19 @@ gtk_combo_box_list_setup (GtkComboBox *combo_box)
if (priv->cell_view)
{
- style = gtk_widget_get_style (widget);
- gtk_cell_view_set_background_color (GTK_CELL_VIEW (priv->cell_view),
- &style->base[gtk_widget_get_state (widget)]);
+ GtkStyleContext *context;
+ GtkStateFlags state;
+ GdkRGBA *color;
+
+ context = gtk_widget_get_style_context (widget);
+ state = gtk_widget_get_state_flags (widget);
+
+ gtk_style_context_get (context, state,
+ "background-color", &color,
+ NULL);
+
+ gtk_cell_view_set_background_rgba (GTK_CELL_VIEW (priv->cell_view), color);
+ gdk_rgba_free (color);
priv->box = gtk_event_box_new ();
gtk_event_box_set_visible_window (GTK_EVENT_BOX (priv->box),
@@ -6377,7 +6416,6 @@ gtk_combo_box_get_preferred_width (GtkWidget *widget,
{
GtkComboBox *combo_box = GTK_COMBO_BOX (widget);
GtkComboBoxPrivate *priv = combo_box->priv;
- GtkStyle *style;
gint focus_width, focus_pad;
gint font_size, arrow_size;
PangoContext *context;
@@ -6386,6 +6424,9 @@ gtk_combo_box_get_preferred_width (GtkWidget *widget,
GtkWidget *child;
gint minimum_width, natural_width;
gint child_min, child_nat;
+ GtkStyleContext *style_context;
+ GtkStateFlags state;
+ GtkBorder *border;
child = gtk_bin_get_child (GTK_BIN (widget));
@@ -6402,13 +6443,21 @@ gtk_combo_box_get_preferred_width (GtkWidget *widget,
"arrow-size", &arrow_size,
NULL);
- font_desc = gtk_widget_get_style (child)->font_desc;
+ style_context = gtk_widget_get_style_context (widget);
+ state = gtk_widget_get_state_flags (widget);
+
+ gtk_style_context_get (style_context, state,
+ "font", &font_desc,
+ "border-width", &border,
+ NULL);
+
context = gtk_widget_get_pango_context (GTK_WIDGET (widget));
metrics = pango_context_get_metrics (context, font_desc,
pango_context_get_language (context));
font_size = PANGO_PIXELS (pango_font_metrics_get_ascent (metrics) +
pango_font_metrics_get_descent (metrics));
pango_font_metrics_unref (metrics);
+ pango_font_description_free (font_desc);
arrow_size = MAX (arrow_size, font_size);
@@ -6421,15 +6470,17 @@ gtk_combo_box_get_preferred_width (GtkWidget *widget,
if (priv->cell_view)
{
gint sep_width, arrow_width;
- gint border_width, xthickness, xpad;
+ gint border_width, xpad;
+ GtkBorder button_border;
border_width = gtk_container_get_border_width (GTK_CONTAINER (combo_box));
- xthickness = gtk_widget_get_style (priv->button)->xthickness;
+ get_widget_border (priv->button, &button_border);
gtk_widget_get_preferred_width (priv->separator, &sep_width, NULL);
gtk_widget_get_preferred_width (priv->arrow, &arrow_width, NULL);
- xpad = 2*(border_width + xthickness + focus_width + focus_pad);
+ xpad = 2 * (border_width + focus_width + focus_pad) +
+ button_border.left + button_border.right;
minimum_width = child_min + sep_width + arrow_width + xpad;
natural_width = child_nat + sep_width + arrow_width + xpad;
@@ -6461,8 +6512,12 @@ gtk_combo_box_get_preferred_width (GtkWidget *widget,
{
if (priv->has_frame)
{
- gint border_width = gtk_container_get_border_width (GTK_CONTAINER (priv->cell_view_frame));
- gint xpad = 2 * (border_width + gtk_widget_get_style (GTK_WIDGET (priv->cell_view_frame))->xthickness);
+ gint border_width, xpad;
+ GtkBorder frame_border;
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (priv->cell_view_frame));
+ get_widget_border (priv->cell_view_frame, &frame_border);
+ xpad = (2 * border_width) + frame_border.left + frame_border.right;
minimum_width += xpad;
natural_width += xpad;
@@ -6477,13 +6532,9 @@ gtk_combo_box_get_preferred_width (GtkWidget *widget,
natural_width += button_nat_width;
}
- if (GTK_SHADOW_NONE != priv->shadow_type)
- {
- style = gtk_widget_get_style (GTK_WIDGET (widget));
-
- minimum_width += 2 * style->xthickness;
- natural_width += 2 * style->xthickness;
- }
+ minimum_width += border->left + border->right;
+ natural_width += border->left + border->right;
+ gtk_border_free (border);
if (minimum_size)
*minimum_size = minimum_width;
@@ -6525,36 +6576,31 @@ gtk_combo_box_get_preferred_height_for_width (GtkWidget *widget,
{
GtkComboBox *combo_box = GTK_COMBO_BOX (widget);
GtkComboBoxPrivate *priv = combo_box->priv;
- GtkStyle *style;
gint focus_width, focus_pad;
gint min_height, nat_height;
gint size;
+ GtkBorder border;
gtk_widget_style_get (GTK_WIDGET (widget),
"focus-line-width", &focus_width,
"focus-padding", &focus_pad,
NULL);
- size = avail_size;
-
- if (GTK_SHADOW_NONE != priv->shadow_type)
- size -= gtk_widget_get_style (GTK_WIDGET (widget))->xthickness;
+ get_widget_border (widget, &border);
+ size = avail_size - border.left;
if (!priv->tree_view)
{
/* menu mode */
if (priv->cell_view)
{
- GtkStyle *button_style;
/* calculate x/y padding and separator/arrow size */
gint sep_width, arrow_width, sep_height, arrow_height;
- gint border_width, xthickness, ythickness, xpad, ypad;
+ gint border_width, xpad, ypad;
+ GtkBorder button_border;
border_width = gtk_container_get_border_width (GTK_CONTAINER (combo_box));
- button_style = gtk_widget_get_style (priv->button);
-
- xthickness = button_style->xthickness;
- ythickness = button_style->ythickness;
+ get_widget_border (priv->button, &button_border);
gtk_widget_get_preferred_width (priv->separator, &sep_width, NULL);
gtk_widget_get_preferred_width (priv->arrow, &arrow_width, NULL);
@@ -6563,8 +6609,10 @@ gtk_combo_box_get_preferred_height_for_width (GtkWidget *widget,
gtk_widget_get_preferred_height_for_width (priv->arrow,
arrow_width, &arrow_height, NULL);
- xpad = 2*(border_width + xthickness + focus_width + focus_pad);
- ypad = 2*(border_width + ythickness + focus_width + focus_pad);
+ xpad = 2 * (border_width + focus_width + focus_pad) +
+ button_border.left + button_border.right;
+ ypad = 2 * (border_width + focus_width + focus_pad) +
+ button_border.top + button_border.bottom;
size -= sep_width + arrow_width + xpad;
@@ -6606,14 +6654,14 @@ gtk_combo_box_get_preferred_height_for_width (GtkWidget *widget,
if (priv->cell_view_frame && priv->has_frame)
{
- GtkStyle *cell_style;
+ GtkBorder frame_border;
gint border_width;
border_width = gtk_container_get_border_width (GTK_CONTAINER (priv->cell_view_frame));
- cell_style = gtk_widget_get_style (GTK_WIDGET (priv->cell_view_frame));
+ get_widget_border (GTK_WIDGET (priv->cell_view_frame), &frame_border);
- xpad = 2 * (border_width + cell_style->xthickness);
- ypad = 2 * (border_width + cell_style->ythickness);
+ xpad = (2 * border_width) + border.left + frame_border.right;
+ ypad = (2 * border_width) + border.top + frame_border.bottom;
}
size -= but_width;
@@ -6629,13 +6677,8 @@ gtk_combo_box_get_preferred_height_for_width (GtkWidget *widget,
nat_height += ypad;
}
- if (GTK_SHADOW_NONE != priv->shadow_type)
- {
- style = gtk_widget_get_style (GTK_WIDGET (widget));
-
- min_height += 2 * style->ythickness;
- nat_height += 2 * style->ythickness;
- }
+ min_height += border.top + border.bottom;
+ nat_height += border.top + border.bottom;
if (minimum_size)
*minimum_size = min_height;
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index a37e361d65..5433766c25 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -334,6 +334,9 @@ static void gtk_container_adjust_size_allocation (GtkWidget *widget,
static gchar* gtk_container_child_default_composite_name (GtkContainer *container,
GtkWidget *child);
+static GtkWidgetPath * gtk_container_real_get_path_for_child (GtkContainer *container,
+ GtkWidget *child);
+
/* GtkBuildable */
static void gtk_container_buildable_init (GtkBuildableIface *iface);
static void gtk_container_buildable_add_child (GtkBuildable *buildable,
@@ -465,6 +468,7 @@ gtk_container_class_init (GtkContainerClass *class)
class->set_focus_child = gtk_container_real_set_focus_child;
class->child_type = NULL;
class->composite_name = gtk_container_child_default_composite_name;
+ class->get_path_for_child = gtk_container_real_get_path_for_child;
g_object_class_install_property (gobject_class,
PROP_RESIZE_MODE,
@@ -2207,6 +2211,34 @@ gtk_container_get_all_children (GtkContainer *container)
return children;
}
+static GtkWidgetPath *
+gtk_container_real_get_path_for_child (GtkContainer *container,
+ GtkWidget *child)
+{
+ GtkStyleContext *context;
+ GtkWidgetPath *path;
+ GList *classes;
+
+ context = gtk_widget_get_style_context (GTK_WIDGET (container));
+ path = gtk_widget_path_copy (gtk_widget_get_path (GTK_WIDGET (container)));
+
+ /* Copy any permanent classes to the path */
+ classes = gtk_style_context_list_classes (context);
+
+ while (classes)
+ {
+ GList *cur;
+
+ cur = classes;
+ classes = classes->next;
+
+ gtk_widget_path_iter_add_class (path, -1, cur->data);
+ g_list_free_1 (cur);
+ }
+
+ return path;
+}
+
static gboolean
gtk_container_focus (GtkWidget *widget,
GtkDirectionType direction)
@@ -3220,3 +3252,24 @@ _gtk_container_get_reallocate_redraws (GtkContainer *container)
{
return container->priv->reallocate_redraws;
}
+
+/**
+ * gtk_container_get_path_for_child:
+ * @container: a #GtkContainer
+ * @child: a child of @container
+ *
+ * Returns a newly created widget path representing all the widget hierarchy
+ * from the toplevel down to @child (this one not being included).
+ *
+ * Returns: A newly created #GtkWidgetPath
+ **/
+GtkWidgetPath *
+gtk_container_get_path_for_child (GtkContainer *container,
+ GtkWidget *child)
+{
+ g_return_val_if_fail (GTK_IS_CONTAINER (container), NULL);
+ g_return_val_if_fail (GTK_IS_WIDGET (child), NULL);
+ g_return_val_if_fail (container == (GtkContainer *) gtk_widget_get_parent (child), NULL);
+
+ return GTK_CONTAINER_GET_CLASS (container)->get_path_for_child (container, child);
+}
diff --git a/gtk/gtkcontainer.h b/gtk/gtkcontainer.h
index f469d89eba..94a8502c8f 100644
--- a/gtk/gtkcontainer.h
+++ b/gtk/gtkcontainer.h
@@ -88,6 +88,8 @@ struct _GtkContainerClass
guint property_id,
GValue *value,
GParamSpec *pspec);
+ GtkWidgetPath * (*get_path_for_child) (GtkContainer *container,
+ GtkWidget *child);
/* Padding for future expansion */
void (*_gtk_reserved1) (void);
@@ -228,6 +230,9 @@ void _gtk_container_set_need_resize (GtkContainer *container,
gboolean need_resize);
gboolean _gtk_container_get_reallocate_redraws (GtkContainer *container);
+GtkWidgetPath * gtk_container_get_path_for_child (GtkContainer *container,
+ GtkWidget *child);
+
G_END_DECLS
#endif /* __GTK_CONTAINER_H__ */
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
new file mode 100644
index 0000000000..5ab102a85e
--- /dev/null
+++ b/gtk/gtkcssprovider.c
@@ -0,0 +1,3847 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include <string.h>
+#include <stdlib.h>
+#include <gtk/gtk.h>
+#include <gtkstyleprovider.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <cairo-gobject.h>
+
+#include "gtkanimationdescription.h"
+#include "gtk9slice.h"
+#include "gtkcssprovider.h"
+
+/**
+ * SECTION:gtkcssprovider
+ * @Short_description: CSS-like styling for widgets
+ * @Title: GtkCssProvider
+ * @See_also: #GtkStyleContext, #GtkStyleProvider
+ *
+ * GtkCssProvider is an object implementing the #GtkStyleProvider interface.
+ * It is able to parse <ulink url="http://www.w3.org/TR/CSS2">CSS</ulink>-like
+ * input in order to style widgets.
+ *
+ * <refsect2 id="gtkcssprovider-files">
+ * <title>Default files</title>
+ * <para>
+ * An application can cause GTK+ to parse a specific CSS style sheet by
+ * calling gtk_css_provider_load_from_file() and adding the provider with
+ * gtk_style_context_add_provider() or gtk_style_context_add_provider_for_screen().
+ * In addition, certain files will be read when GTK+ is initialized. First,
+ * the file <filename><replaceable>XDG_CONFIG_HOME</replaceable>/gtk-3.0/gtk.css</filename>
+ * is loaded if it exists. Then, GTK+ tries to load
+ * <filename><replaceable>HOME</replaceable>/.themes/<replaceable>theme-name</replaceable>/gtk-3.0/gtk.css</filename>,
+ * falling back to
+ * <filename><replaceable>GTK_DATA_PREFIX</replaceable>/share/themes/<replaceable>theme-name</replaceable>/gtk-3.0/gtk.css</filename>,
+ * where <replaceable>theme-name</replaceable> is the name of the current theme
+ * (see the #GtkSettings:gtk-theme-name setting) and <replaceable>GTK_DATA_PREFIX</replaceable>
+ * is the prefix configured when GTK+ was compiled, unless overridden by the
+ * <envar>GTK_DATA_PREFIX</envar> environment variable.
+ * </para>
+ * </refsect2>
+ * <refsect2 id="gtkcssprovider-stylesheets">
+ * <title>Style sheets</title>
+ * <para>
+ * The basic structure of the style sheets understood by this provider is
+ * a series of statements, which are either rule sets or '@-rules', separated
+ * by whitespace.
+ * </para>
+ * <para>
+ * A rule set consists of a selector and a declaration block, which is
+ * a series of declarations enclosed in curly braces ({ and }). The
+ * declarations are separated by semicolons (;). Multiple selectors can
+ * share the same declaration block, by putting all the separators in
+ * front of the block, separated by commas.
+ * </para>
+ * <example><title>A rule set with two selectors</title>
+ * <programlisting language="text">
+ * GtkButton, GtkEntry {
+ * color: &num;ff00ea;
+ * font: Comic Sans 12
+ * }
+ * </programlisting>
+ * </example>
+ * </refsect2>
+ * <refsect2 id="gtkcssprovider-selectors">
+ * <title>Selectors</title>
+ * <para>
+ * Selectors work very similar to the way they do in CSS, with widget class
+ * names taking the role of element names, and widget names taking the role
+ * of IDs. When used in a selector, widget names must be prefixed with a
+ * '&num;' character. The '*' character represents the so-called universal
+ * selector, which matches any widget.
+ * </para>
+ * <para>
+ * To express more complicated situations, selectors can be combined in
+ * various ways:
+ * <itemizedlist>
+ * <listitem><para>To require that a widget satisfies several conditions,
+ * combine several selectors into one by concatenating them. E.g.
+ * <literal>GtkButton&num;button1</literal> matches a GtkButton widget
+ * with the name button1.</para></listitem>
+ * <listitem><para>To only match a widget when it occurs inside some other
+ * widget, write the two selectors after each other, separated by whitespace.
+ * E.g. <literal>GtkToolBar GtkButton</literal> matches GtkButton widgets
+ * that occur inside a GtkToolBar.</para></listitem>
+ * <listitem><para>In the previous example, the GtkButton is matched even
+ * if it occurs deeply nested inside the toolbar. To restrict the match
+ * to direct children of the parent widget, insert a '>' character between
+ * the two selectors. E.g. <literal>GtkNotebook > GtkLabel</literal> matches
+ * GtkLabel widgets that are direct children of a GtkNotebook.</para></listitem>
+ * </itemizedlist>
+ * </para>
+ * <example>
+ * <title>Widget classes and names in selectors</title>
+ * <programlisting language="text">
+ * /&ast; Theme labels that are descendants of a window &ast;/
+ * GtkWindow GtkLabel {
+ * background-color: &num;898989
+ * }
+ *
+ * /&ast; Theme notebooks, and anything that's within these &ast;/
+ * GtkNotebook {
+ * background-color: &num;a939f0
+ * }
+ *
+ * /&ast; Theme combo boxes, and entries that
+ * are direct children of a notebook &ast;/
+ * GtkComboBox,
+ * GtkNotebook > GtkEntry {
+ * color: @fg_color;
+ * background-color: &num;1209a2
+ * }
+ *
+ * /&ast; Theme any widget within a GtkBin &ast;/
+ * GtkBin * {
+ * font-name: Sans 20
+ * }
+ *
+ * /&ast; Theme a label named title-label &ast;/
+ * GtkLabel&num;title-label {
+ * font-name: Sans 15
+ * }
+ *
+ * /&ast; Theme any widget named main-entry &ast;/
+ * &num;main-entry {
+ * background-color: &num;f0a810
+ * }
+ * </programlisting>
+ * </example>
+ * <para>
+ * Widgets may also define style classes, which can be used for matching.
+ * When used in a selector, style classes must be prefixed with a '.'
+ * character.
+ * </para>
+ * <para>
+ * Refer to the documentation of individual widgets to learn which
+ * style classes they define and see <xref linkend="gtkstylecontext-classes"/>
+ * for a list of all style classes used by GTK+ widgets.
+ * </para>
+ * <example>
+ * <title>Style classes in selectors</title>
+ * <programlisting language="text">
+ * /&ast; Theme all widgets defining the class entry &ast;/
+ * .entry {
+ * color: &num;39f1f9;
+ * }
+ *
+ * /&ast; Theme spinbuttons' entry &ast;/
+ * GtkSpinButton.entry {
+ * color: &num;900185
+ * }
+ * </programlisting>
+ * </example>
+ * <para>
+ * In complicated widgets like e.g. a GtkNotebook, it may be desirable
+ * to style different parts of the widget differently. To make this
+ * possible, container widgets may define regions, whose names
+ * may be used for matching in selectors.
+ * </para>
+ * <para>
+ * Some containers allow to further differentiate between regions by
+ * applying so-called pseudo-classes to the region. For example, the
+ * tab region in GtkNotebook allows to single out the first or last
+ * tab by using the :first-child or :last-child pseudo-class.
+ * When used in selectors, pseudo-classes must be prefixed with a
+ * ':' character.
+ * </para>
+ * <para>
+ * Refer to the documentation of individual widgets to learn which
+ * regions and pseudo-classes they define and see
+ * <xref linkend="gtkstylecontext-classes"/> for a list of all regions
+ * used by GTK+ widgets.
+ * </para>
+ * <example>
+ * <title>Regions in selectors</title>
+ * <programlisting language="text">
+ * /&ast; Theme any label within a notebook &ast;/
+ * GtkNotebook GtkLabel {
+ * color: &num;f90192;
+ * }
+ *
+ * /&ast; Theme labels within notebook tabs &ast;/
+ * GtkNotebook tab GtkLabel {
+ * color: &num;703910;
+ * }
+ *
+ * /&ast; Theme labels in the any first notebook
+ * tab, both selectors are equivalent &ast;/
+ * GtkNotebook tab:nth-child(first) GtkLabel,
+ * GtkNotebook tab:first-child GtkLabel {
+ * color: &num;89d012;
+ * }
+ * </programlisting>
+ * </example>
+ * <para>
+ * Another use of pseudo-classes is to match widgets depending on their
+ * state. This is conceptually similar to the :hover, :active or :focus
+ * pseudo-classes in CSS. The available pseudo-classes for widget states
+ * are :active, :prelight (or :hover), :insensitive, :selected, :focused
+ * and :inconsistent.
+ * </para>
+ * <example>
+ * <title>Styling specific widget states</title>
+ * <programlisting language="text">
+ * /&ast; Theme active (pressed) buttons &ast;/
+ * GtkButton:active {
+ * background-color: &num;0274d9;
+ * }
+ *
+ * /&ast; Theme buttons with the mouse pointer on it,
+ * both are equivalent &ast;/
+ * GtkButton:hover,
+ * GtkButton:prelight {
+ * background-color: &num;3085a9;
+ * }
+ *
+ * /&ast; Theme insensitive widgets, both are equivalent &ast;/
+ * :insensitive,
+ * *:insensitive {
+ * background-color: &num;320a91;
+ * }
+ *
+ * /&ast; Theme selection colors in entries &ast;/
+ * GtkEntry:selected {
+ * background-color: &num;56f9a0;
+ * }
+ *
+ * /&ast; Theme focused labels &ast;/
+ * GtkLabel:focused {
+ * background-color: &num;b4940f;
+ * }
+ *
+ * /&ast; Theme inconsistent checkbuttons &ast;/
+ * GtkCheckButton:inconsistent {
+ * background-color: &num;20395a;
+ * }
+ * </programlisting>
+ * </example>
+ * <para>
+ * Widget state pseudoclasses may only apply to the last element
+ * in a selector.
+ * </para>
+ * <para>
+ * To determine the effective style for a widget, all the matching rule
+ * sets are merged. As in CSS, rules apply by specificity, so the rules
+ * whose selectors more closely match a widget path will take precedence
+ * over the others.
+ * </para>
+ * </refsect2>
+ * <refsect2 id="gtkcssprovider-rules">
+ * <title>&commat; Rules</title>
+ * <para>
+ * GTK+'s CSS supports the &commat;import rule, in order to load another
+ * CSS style sheet in addition to the currently parsed one.
+ * </para>
+ * <example>
+ * <title>Using the &commat;import rule</title>
+ * <programlisting language="text">
+ * &commat;import url ("path/to/common.css");
+ * </programlisting>
+ * </example>
+ * <para>
+ * GTK+ also supports an additional &commat;define-color rule, in order
+ * to define a color name which may be used instead of color numeric
+ * representations. Also see the #GtkSettings:gtk-color-scheme setting
+ * for a way to override the values of these named colors.
+ * </para>
+ * <example>
+ * <title>Defining colors</title>
+ * <programlisting language="text">
+ * &commat;define-color bg_color &num;f9a039;
+ *
+ * &ast; {
+ * background-color: &commat;bg_color;
+ * }
+ * </programlisting>
+ * </example>
+ * </refsect2>
+ * <refsect2 id="gtkcssprovider-symbolic-colors">
+ * <title>Symbolic colors</title>
+ * <para>
+ * Besides being able to define color names, the CSS parser is also able
+ * to read different color expressions, which can also be nested, providing
+ * a rich language to define colors which are derived from a set of base
+ * colors.
+ * </para>
+ * <example>
+ * <title>Using symbolic colors</title>
+ * <programlisting language="text">
+ * &commat;define-color entry-color shade (&commat;bg_color, 0.7);
+ *
+ * GtkEntry {
+ * background-color: @entry-color;
+ * }
+ *
+ * GtkEntry:focused {
+ * background-color: mix (&commat;entry-color,
+ * shade (&num;fff, 0.5),
+ * 0.8);
+ * }
+ * </programlisting>
+ * </example>
+ * <para>
+ * The various ways to express colors in GTK+ CSS are:
+ * </para>
+ * <informaltable>
+ * <tgroup cols="3">
+ * <thead>
+ * <row>
+ * <entry>Syntax</entry>
+ * <entry>Explanation</entry>
+ * <entry>Examples</entry>
+ * </row>
+ * </thead>
+ * <tbody>
+ * <row>
+ * <entry>rgb(@r, @g, @b)</entry>
+ * <entry>An opaque color; @r, @g, @b can be either integers between
+ * 0 and 255 or percentages</entry>
+ * <entry><literallayout>rgb(128, 10, 54)
+ * rgb(20%, 30%, 0%)</literallayout></entry>
+ * </row>
+ * <row>
+ * <entry>rgba(@r, @g, @b, @a)</entry>
+ * <entry>A translucent color; @r, @g, @b are as in the previous row,
+ * @a is a floating point number between 0 and 1</entry>
+ * <entry><literallayout>rgba(255, 255, 0, 0.5)</literallayout></entry>
+ * </row>
+ * <row>
+ * <entry>&num;@xxyyzz</entry>
+ * <entry>An opaque color; @xx, @yy, @zz are hexadecimal numbers
+ * specifying @r, @g, @b variants with between 1 and 4
+ * hexadecimal digits per component are allowed</entry>
+ * <entry><literallayout>&num;ff12ab
+ * &num;f0c</literallayout></entry>
+ * </row>
+ * <row>
+ * <entry>&commat;name</entry>
+ * <entry>Reference to a color that has been defined with
+ * &commat;define-color
+ * </entry>
+ * <entry>&commat;bg_color</entry>
+ * </row>
+ * <row>
+ * <entry>mix(@color1, @color2, @f)</entry>
+ * <entry>A linear combination of @color1 and @color2. @f is a
+ * floating point number between 0 and 1.</entry>
+ * <entry><literallayout>mix(&num;ff1e0a, &commat;bg_color, 0.8)</literallayout></entry>
+ * </row>
+ * <row>
+ * <entry>shade(@color, @f)</entry>
+ * <entry>A lighter or darker variant of @color. @f is a
+ * floating point number.
+ * </entry>
+ * <entry>shade(&commat;fg_color, 0.5)</entry>
+ * </row>
+ * <row>
+ * <entry>lighter(@color)</entry>
+ * <entry>A lighter variant of @color</entry>
+ * </row>
+ * <row>
+ * <entry>darker(@color)</entry>
+ * <entry>A darker variant of @color</entry>
+ * </row>
+ * </tbody>
+ * </tgroup>
+ * </informaltable>
+ * </refsect2>
+ * <refsect2 id="gtkcssprovider-gradients">
+ * <title>Gradients</title>
+ * <para>
+ * Linear or radial Gradients can be used as background images.
+ * </para>
+ * <para>
+ * A linear gradient along the line from (@start_x, @start_y) to
+ * (@end_x, @end_y) is specified using the syntax
+ * <literallayout>-gtk-gradient (linear,
+ * @start_x @start_y, @end_x @end_y,
+ * color-stop (@position, @color),
+ * ...)</literallayout>
+ * where @start_x and @end_x can be either a floating point number between
+ * 0 and 1 or one of the special values 'left', 'right' or 'center', @start_y
+ * and @end_y can be either a floating point number between 0 and 1 or one
+ * of the special values 'top', 'bottom' or 'center', @position is a floating
+ * point number between 0 and 1 and @color is a color expression (see above).
+ * The color-stop can be repeated multiple times to add more than one color
+ * stop. 'from (@color)' and 'to (@color)' can be used as abbreviations for
+ * color stops with position 0 and 1, respectively.
+ * </para>
+ * <example>
+ * <title>A linear gradient</title>
+ * <inlinegraphic fileref="gradient1.png" format="PNG"/>
+ * <para>This gradient was specified with
+ * <literallayout>-gtk-gradient (linear,
+ * left top, right bottom,
+ * from(&commat;yellow), to(&commat;blue))</literallayout></para>
+ * </example>
+ * <example>
+ * <title>Another linear gradient</title>
+ * <inlinegraphic fileref="gradient2.png" format="PNG"/>
+ * <para>This gradient was specified with
+ * <literallayout>-gtk-gradient (linear,
+ * 0 0, 0 1,
+ * color-stop(0, &commat;yellow),
+ * color-stop(0.2, &commat;blue),
+ * color-stop(1, &num;0f0))</literallayout></para>
+ * </example>
+ * <para>
+ * A radial gradient along the two circles defined by (@start_x, @start_y,
+ * @start_radius) and (@end_x, @end_y, @end_radius) is specified using the
+ * syntax
+ * <literallayout>-gtk-gradient (radial,
+ * @start_x @start_y, @start_radius,
+ * @end_x @end_y, @end_radius,
+ * color-stop (@position, @color),
+ * ...)</literallayout>
+ * where @start_radius and @end_radius are floating point numbers and
+ * the other parameters are as before.
+ * </para>
+ * <example>
+ * <title>A radial gradient</title>
+ * <inlinegraphic fileref="gradient3.png" format="PNG"/>
+ * <para>This gradient was specified with
+ * <literallayout>-gtk-gradient (radial,
+ * center center, 0,
+ * center center, 1,
+ * from(&commat;yellow), to(&commat;green))</literallayout></para>
+ * </example>
+ * <example>
+ * <title>Another radial gradient</title>
+ * <inlinegraphic fileref="gradient4.png" format="PNG"/>
+ * <para>This gradient was specified with
+ * <literallayout>-gtk-gradient (radial,
+ * 0.4 0.4, 0.1,
+ * 0.6 0.6, 0.7,
+ * color-stop (0, &num;f00),
+ * color-stop (0.1, &num;a0f),
+ * color-stop (0.2, &commat;yellow),
+ * color-stop (1, &commat;green))</literallayout></para>
+ * </example>
+ * </refsect2>
+ * <refsect2 id="gtkcssprovider-slices">
+ * <title>Border images</title>
+ * <para>
+ * Images can be used in 'slices' for the purpose of creating scalable
+ * borders.
+ * </para>
+ * <inlinegraphic fileref="slices.png" format="PNG"/>
+ * <para>
+ * The syntax for specifying border images of this kind is:
+ * <literallayout>url(@path) @top @right @bottom @left [repeat|stretch]? [repeat|stretch]?</literallayout>
+ * The sizes of the 'cut off' portions are specified
+ * with the @top, @right, @bottom and @left parameters.
+ * The 'middle' sections can be repeated or stretched to create
+ * the desired effect, by adding the 'repeat' or 'stretch' options after
+ * the dimensions. If two options are specified, the first one affects
+ * the horizontal behaviour and the second one the vertical behaviour.
+ * If only one option is specified, it affects both.
+ * </para>
+ * <example>
+ * <title>A border image</title>
+ * <inlinegraphic fileref="border1.png" format="PNG"/>
+ * <para>This border image was specified with
+ * <literallayout>url("gradient1.png") 10 10 10 10</literallayout>
+ * </para>
+ * </example>
+ * <example>
+ * <title>A repeating border image</title>
+ * <inlinegraphic fileref="border2.png" format="PNG"/>
+ * <para>This border image was specified with
+ * <literallayout>url("gradient1.png") 10 10 10 10 repeat</literallayout>
+ * </para>
+ * </example>
+ * <example>
+ * <title>A stretched border image</title>
+ * <inlinegraphic fileref="border3.png" format="PNG"/>
+ * <para>This border image was specified with
+ * <literallayout>url("gradient1.png") 10 10 10 10 stretch</literallayout>
+ * </para>
+ * </example>
+ * </refsect2>
+ * <refsect2 id="gtkcssprovider-transitions">
+ * <para>Styles can specify transitions that will be used to create a gradual
+ * change in the appearance when a widget state changes. The following
+ * syntax is used to specify transitions:
+ * <literallayout>@duration [s|ms] [linear|ease|ease-in|ease-out|ease-in-out] [loop]?</literallayout>
+ * The @duration is the amount of time that the animation will take for
+ * a complete cycle from start to end. If the loop option is given, the
+ * animation will be repated until the state changes again.
+ * The option after the duration determines the transition function from a
+ * small set of predefined functions.
+ * <figure><title>Linear transition</title>
+ * <graphic fileref="linear.png" format="PNG"/>
+ * </figure>
+ * <figure><title>Ease transition</title>
+ * <graphic fileref="ease.png" format="PNG"/>
+ * </figure>
+ * <figure><title>Ease-in-out transition</title>
+ * <graphic fileref="ease-in-out.png" format="PNG"/>
+ * </figure>
+ * <figure><title>Ease-in transition</title>
+ * <graphic fileref="ease-in.png" format="PNG"/>
+ * </figure>
+ * <figure><title>Ease-out transition</title>
+ * <graphic fileref="ease-out.png" format="PNG"/>
+ * </figure>
+ * </para>
+ * </refsect2>
+ * <refsect2 id="gtkcssprovider-properties">
+ * <title>Supported properties</title>
+ * <para>
+ * Properties are the part that differ the most to common CSS,
+ * not all properties are supported (some are planned to be
+ * supported eventually, some others are meaningless or don't
+ * map intuitively in a widget based environment).
+ * </para>
+ * <para>
+ * There is also a difference in shorthand properties, for
+ * example in common CSS it is fine to define a font through
+ * the different @font-family, @font-style, @font-size
+ * properties, meanwhile in GTK+'s CSS only the canonical
+ * @font property is supported.
+ * </para>
+ * <para>
+ * The currently supported properties are:
+ * </para>
+ * <informaltable>
+ * <tgroup cols="4">
+ * <thead>
+ * <row>
+ * <entry>Property name</entry>
+ * <entry>Syntax</entry>
+ * <entry>Maps to</entry>
+ * <entry>Examples</entry>
+ * </row>
+ * </thead>
+ * <tbody>
+ * <row>
+ * <entry>engine</entry>
+ * <entry>engine-name</entry>
+ * <entry>#GtkThemingEngine</entry>
+ * <entry>engine: clearlooks;</entry>
+ * </row>
+ * <row>
+ * <entry>background-color</entry>
+ * <entry morerows="2">color (see above)</entry>
+ * <entry morerows="2">#GdkRGBA</entry>
+ * <entry morerows="2"><literallayout>background-color: &num;fff;
+ * color: &amp;color1;
+ * background-color: shade (&amp;color1, 0.5);
+ * color: mix (&amp;color1, &num;f0f, 0.8);</literallayout>
+ * </entry>
+ * </row>
+ * <row>
+ * <entry>color</entry>
+ * </row>
+ * <row>
+ * <entry>border-color</entry>
+ * </row>
+ * <row>
+ * <entry>font</entry>
+ * <entry>@family [@style] [@size]</entry>
+ * <entry>#PangoFontDescription</entry>
+ * <entry>font: Sans 15;</entry>
+ * </row>
+ * <row>
+ * <entry>margin</entry>
+ * <entry morerows="1"><literallayout>@width
+ * @vertical_width @horizontal_width
+ * @top_width @horizontal_width @bottom_width
+ * @top_width @right_width @bottom_width @left_width</literallayout>
+ * </entry>
+ * <entry morerows="1">#GtkBorder</entry>
+ * <entry morerows="1"><literallayout>margin: 5;
+ * margin: 5 10;
+ * margin: 5 10 3;
+ * margin: 5 10 3 5;</literallayout>
+ * </entry>
+ * </row>
+ * <row>
+ * <entry>padding</entry>
+ * </row>
+ * <row>
+ * <entry>background-image</entry>
+ * <entry><literallayout>gradient (see above) or
+ * url(@path)</literallayout></entry>
+ * <entry>#cairo_pattern_t</entry>
+ * <entry><literallayout>-gtk-gradient (linear,
+ * left top, right top,
+ * from (&num;fff), to (&num;000));
+ * -gtk-gradient (linear, 0.0 0.5, 0.5 1.0,
+ * from (&num;fff),
+ * color-stop (0.5, &num;f00),
+ * to (&num;000));
+ * -gtk-gradient (radial,
+ * center center, 0.2,
+ * center center, 0.8,
+ * color-stop (0.0, &num;fff),
+ * color-stop (1.0, &num;000));
+ * url ('background.png');</literallayout>
+ * </entry>
+ * </row>
+ * <row>
+ * <entry>border-width</entry>
+ * <entry>integer</entry>
+ * <entry>#gint</entry>
+ * <entry>border-width: 5;</entry>
+ * </row>
+ * <row>
+ * <entry>border-radius</entry>
+ * <entry>integer</entry>
+ * <entry>#gint</entry>
+ * <entry>border-radius: 5;</entry>
+ * </row>
+ * <row>
+ * <entry>border-style</entry>
+ * <entry>[none|solid|inset|outset]</entry>
+ * <entry>#GtkBorderStyle</entry>
+ * <entry>border-style: solid;</entry>
+ * </row>
+ * <row>
+ * <entry>border-image</entry>
+ * <entry><literallayout>border image (see above)</literallayout></entry>
+ * <entry>internal use only</entry>
+ * <entry><literallayout>border-image: url("/path/to/image.png") 3 4 3 4 stretch;
+ * border-image: url("/path/to/image.png") 3 4 4 3 repeat stretch;</literallayout>
+ * </entry>
+ * </row>
+ * <row>
+ * <entry>transition</entry>
+ * <entry>transition (see above)</entry>
+ * <entry>internal use only</entry>
+ * <entry><literallayout>transition: 150ms ease-in-out;
+ * transition: 1s linear loop;</literallayout>
+ * </entry>
+ * </row>
+ * </tbody>
+ * </tgroup>
+ * </informaltable>
+ * <para>
+ * GtkThemingEngines can register their own, engine-specific style properties
+ * with the function gtk_theming_engine_register_property(). These properties
+ * can be set in CSS like other properties, using a name of the form
+ * <literallayout>-<replaceable>namespace</replaceable>-<replaceable>name</replaceable></literallayout>, where <replaceable>namespace</replaceable> is typically
+ * the name of the theming engine, and <replaceable>name</replaceable> is the
+ * name of the property. Style properties that have been registered by widgets
+ * using gtk_widget_class_install_style_property() can also be set in this
+ * way, using the widget class name for <replaceable>namespace</replaceable>.
+ * </para>
+ * <example>
+ * <title>Using engine-specific style properties</title>
+ * <programlisting>
+ * * {
+ * engine: clearlooks;
+ * border-radius: 4;
+ * -GtkPaned-handle-size: 6;
+ * -clearlooks-colorize-scrollbar: false;
+ * }
+ * </programlisting>
+ * </example>
+ * </refsect2>
+ */
+
+typedef struct GtkCssProviderPrivate GtkCssProviderPrivate;
+typedef struct SelectorElement SelectorElement;
+typedef struct SelectorPath SelectorPath;
+typedef struct SelectorStyleInfo SelectorStyleInfo;
+typedef enum SelectorElementType SelectorElementType;
+typedef enum CombinatorType CombinatorType;
+typedef enum ParserScope ParserScope;
+typedef enum ParserSymbol ParserSymbol;
+
+enum SelectorElementType {
+ SELECTOR_TYPE_NAME,
+ SELECTOR_NAME,
+ SELECTOR_GTYPE,
+ SELECTOR_REGION,
+ SELECTOR_CLASS,
+ SELECTOR_GLOB
+};
+
+enum CombinatorType {
+ COMBINATOR_DESCENDANT, /* No direct relation needed */
+ COMBINATOR_CHILD /* Direct child */
+};
+
+struct SelectorElement
+{
+ SelectorElementType elem_type;
+ CombinatorType combinator;
+
+ union
+ {
+ GQuark name;
+ GType type;
+
+ struct
+ {
+ GQuark name;
+ GtkRegionFlags flags;
+ } region;
+ };
+};
+
+struct SelectorPath
+{
+ GSList *elements;
+ GtkStateFlags state;
+ guint ref_count;
+};
+
+struct SelectorStyleInfo
+{
+ SelectorPath *path;
+ GHashTable *style;
+};
+
+struct GtkCssProviderPrivate
+{
+ GScanner *scanner;
+ gchar *filename;
+
+ const gchar *buffer;
+ const gchar *value_pos;
+
+ GHashTable *symbolic_colors;
+
+ GPtrArray *selectors_info;
+
+ /* Current parser state */
+ GSList *state;
+ GSList *cur_selectors;
+ GHashTable *cur_properties;
+};
+
+enum ParserScope {
+ SCOPE_SELECTOR,
+ SCOPE_PSEUDO_CLASS,
+ SCOPE_NTH_CHILD,
+ SCOPE_DECLARATION,
+ SCOPE_VALUE
+};
+
+/* Extend GtkStateType, since these
+ * values are also used as symbols
+ */
+enum ParserSymbol {
+ /* Scope: pseudo-class */
+ SYMBOL_NTH_CHILD = GTK_STATE_FOCUSED + 1,
+ SYMBOL_FIRST_CHILD,
+ SYMBOL_LAST_CHILD,
+ SYMBOL_SORTED_CHILD,
+
+ /* Scope: nth-child */
+ SYMBOL_NTH_CHILD_EVEN,
+ SYMBOL_NTH_CHILD_ODD,
+ SYMBOL_NTH_CHILD_FIRST,
+ SYMBOL_NTH_CHILD_LAST
+};
+
+static void gtk_css_provider_finalize (GObject *object);
+static void gtk_css_style_provider_iface_init (GtkStyleProviderIface *iface);
+
+static void scanner_apply_scope (GScanner *scanner,
+ ParserScope scope);
+static gboolean css_provider_parse_value (GtkCssProvider *css_provider,
+ const gchar *value_str,
+ GValue *value,
+ GError **error);
+static gboolean gtk_css_provider_load_from_path_internal (GtkCssProvider *css_provider,
+ const gchar *path,
+ gboolean reset,
+ GError **error);
+
+enum {
+ CSS_PROVIDER_PARSE_ERROR
+};
+
+
+GQuark
+gtk_css_provider_error_quark (void)
+{
+ return g_quark_from_static_string ("gtk-css-provider-error-quark");
+}
+
+G_DEFINE_TYPE_EXTENDED (GtkCssProvider, gtk_css_provider, G_TYPE_OBJECT, 0,
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_STYLE_PROVIDER,
+ gtk_css_style_provider_iface_init));
+
+static void
+gtk_css_provider_class_init (GtkCssProviderClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->finalize = gtk_css_provider_finalize;
+
+ g_type_class_add_private (object_class, sizeof (GtkCssProviderPrivate));
+}
+
+static SelectorPath *
+selector_path_new (void)
+{
+ SelectorPath *path;
+
+ path = g_slice_new0 (SelectorPath);
+ path->ref_count = 1;
+
+ return path;
+}
+
+static SelectorPath *
+selector_path_ref (SelectorPath *path)
+{
+ path->ref_count++;
+ return path;
+}
+
+static void
+selector_path_unref (SelectorPath *path)
+{
+ path->ref_count--;
+
+ if (path->ref_count > 0)
+ return;
+
+ while (path->elements)
+ {
+ g_slice_free (SelectorElement, path->elements->data);
+ path->elements = g_slist_delete_link (path->elements, path->elements);
+ }
+
+ g_slice_free (SelectorPath, path);
+}
+
+static void
+selector_path_prepend_type (SelectorPath *path,
+ const gchar *type_name)
+{
+ SelectorElement *elem;
+ GType type;
+
+ elem = g_slice_new (SelectorElement);
+ elem->combinator = COMBINATOR_DESCENDANT;
+ type = g_type_from_name (type_name);
+
+ if (type == G_TYPE_INVALID)
+ {
+ elem->elem_type = SELECTOR_TYPE_NAME;
+ elem->name = g_quark_from_string (type_name);
+ }
+ else
+ {
+ elem->elem_type = SELECTOR_GTYPE;
+ elem->type = type;
+ }
+
+ path->elements = g_slist_prepend (path->elements, elem);
+}
+
+static void
+selector_path_prepend_glob (SelectorPath *path)
+{
+ SelectorElement *elem;
+
+ elem = g_slice_new (SelectorElement);
+ elem->elem_type = SELECTOR_GLOB;
+ elem->combinator = COMBINATOR_DESCENDANT;
+
+ path->elements = g_slist_prepend (path->elements, elem);
+}
+
+static void
+selector_path_prepend_region (SelectorPath *path,
+ const gchar *name,
+ GtkRegionFlags flags)
+{
+ SelectorElement *elem;
+
+ elem = g_slice_new (SelectorElement);
+ elem->combinator = COMBINATOR_DESCENDANT;
+ elem->elem_type = SELECTOR_REGION;
+
+ elem->region.name = g_quark_from_string (name);
+ elem->region.flags = flags;
+
+ path->elements = g_slist_prepend (path->elements, elem);
+}
+
+static void
+selector_path_prepend_name (SelectorPath *path,
+ const gchar *name)
+{
+ SelectorElement *elem;
+
+ elem = g_slice_new (SelectorElement);
+ elem->combinator = COMBINATOR_DESCENDANT;
+ elem->elem_type = SELECTOR_NAME;
+
+ elem->name = g_quark_from_string (name);
+
+ path->elements = g_slist_prepend (path->elements, elem);
+}
+
+static void
+selector_path_prepend_class (SelectorPath *path,
+ const gchar *name)
+{
+ SelectorElement *elem;
+
+ elem = g_slice_new (SelectorElement);
+ elem->combinator = COMBINATOR_DESCENDANT;
+ elem->elem_type = SELECTOR_CLASS;
+
+ elem->name = g_quark_from_string (name);
+
+ path->elements = g_slist_prepend (path->elements, elem);
+}
+
+static void
+selector_path_prepend_combinator (SelectorPath *path,
+ CombinatorType combinator)
+{
+ SelectorElement *elem;
+
+ g_assert (path->elements != NULL);
+
+ /* It is actually stored in the last element */
+ elem = path->elements->data;
+ elem->combinator = combinator;
+}
+
+static gint
+selector_path_depth (SelectorPath *path)
+{
+ return g_slist_length (path->elements);
+}
+
+static SelectorStyleInfo *
+selector_style_info_new (SelectorPath *path)
+{
+ SelectorStyleInfo *info;
+
+ info = g_slice_new0 (SelectorStyleInfo);
+ info->path = selector_path_ref (path);
+
+ return info;
+}
+
+static void
+selector_style_info_free (SelectorStyleInfo *info)
+{
+ if (info->style)
+ g_hash_table_unref (info->style);
+
+ if (info->path)
+ selector_path_unref (info->path);
+}
+
+static void
+selector_style_info_set_style (SelectorStyleInfo *info,
+ GHashTable *style)
+{
+ if (info->style)
+ g_hash_table_unref (info->style);
+
+ if (style)
+ info->style = g_hash_table_ref (style);
+ else
+ info->style = NULL;
+}
+
+static GScanner *
+create_scanner (void)
+{
+ GScanner *scanner;
+
+ scanner = g_scanner_new (NULL);
+
+ g_scanner_scope_add_symbol (scanner, SCOPE_PSEUDO_CLASS, "active", GUINT_TO_POINTER (GTK_STATE_ACTIVE));
+ g_scanner_scope_add_symbol (scanner, SCOPE_PSEUDO_CLASS, "prelight", GUINT_TO_POINTER (GTK_STATE_PRELIGHT));
+ g_scanner_scope_add_symbol (scanner, SCOPE_PSEUDO_CLASS, "hover", GUINT_TO_POINTER (GTK_STATE_PRELIGHT));
+ g_scanner_scope_add_symbol (scanner, SCOPE_PSEUDO_CLASS, "selected", GUINT_TO_POINTER (GTK_STATE_SELECTED));
+ g_scanner_scope_add_symbol (scanner, SCOPE_PSEUDO_CLASS, "insensitive", GUINT_TO_POINTER (GTK_STATE_INSENSITIVE));
+ g_scanner_scope_add_symbol (scanner, SCOPE_PSEUDO_CLASS, "inconsistent", GUINT_TO_POINTER (GTK_STATE_INCONSISTENT));
+ g_scanner_scope_add_symbol (scanner, SCOPE_PSEUDO_CLASS, "focused", GUINT_TO_POINTER (GTK_STATE_FOCUSED));
+ g_scanner_scope_add_symbol (scanner, SCOPE_PSEUDO_CLASS, "focus", GUINT_TO_POINTER (GTK_STATE_FOCUSED));
+
+ g_scanner_scope_add_symbol (scanner, SCOPE_PSEUDO_CLASS, "nth-child", GUINT_TO_POINTER (SYMBOL_NTH_CHILD));
+ g_scanner_scope_add_symbol (scanner, SCOPE_PSEUDO_CLASS, "first-child", GUINT_TO_POINTER (SYMBOL_FIRST_CHILD));
+ g_scanner_scope_add_symbol (scanner, SCOPE_PSEUDO_CLASS, "last-child", GUINT_TO_POINTER (SYMBOL_LAST_CHILD));
+ g_scanner_scope_add_symbol (scanner, SCOPE_PSEUDO_CLASS, "sorted", GUINT_TO_POINTER (SYMBOL_SORTED_CHILD));
+
+ g_scanner_scope_add_symbol (scanner, SCOPE_NTH_CHILD, "even", GUINT_TO_POINTER (SYMBOL_NTH_CHILD_EVEN));
+ g_scanner_scope_add_symbol (scanner, SCOPE_NTH_CHILD, "odd", GUINT_TO_POINTER (SYMBOL_NTH_CHILD_ODD));
+ g_scanner_scope_add_symbol (scanner, SCOPE_NTH_CHILD, "first", GUINT_TO_POINTER (SYMBOL_NTH_CHILD_FIRST));
+ g_scanner_scope_add_symbol (scanner, SCOPE_NTH_CHILD, "last", GUINT_TO_POINTER (SYMBOL_NTH_CHILD_LAST));
+
+ scanner_apply_scope (scanner, SCOPE_SELECTOR);
+
+ return scanner;
+}
+
+static void
+gtk_css_provider_init (GtkCssProvider *css_provider)
+{
+ GtkCssProviderPrivate *priv;
+
+ priv = css_provider->priv = G_TYPE_INSTANCE_GET_PRIVATE (css_provider,
+ GTK_TYPE_CSS_PROVIDER,
+ GtkCssProviderPrivate);
+
+ priv->selectors_info = g_ptr_array_new_with_free_func ((GDestroyNotify) selector_style_info_free);
+ priv->scanner = create_scanner ();
+
+ priv->symbolic_colors = g_hash_table_new_full (g_str_hash, g_str_equal,
+ (GDestroyNotify) g_free,
+ (GDestroyNotify) gtk_symbolic_color_unref);
+}
+
+typedef struct ComparePathData ComparePathData;
+
+struct ComparePathData
+{
+ guint64 score;
+ SelectorPath *path;
+ GSList *iter;
+};
+
+static gboolean
+compare_selector_element (GtkWidgetPath *path,
+ guint index,
+ SelectorElement *elem,
+ guint8 *score)
+{
+ *score = 0;
+
+ if (elem->elem_type == SELECTOR_TYPE_NAME)
+ {
+ const gchar *type_name;
+ GType resolved_type;
+
+ /* Resolve the type name */
+ type_name = g_quark_to_string (elem->name);
+ resolved_type = g_type_from_name (type_name);
+
+ if (resolved_type == G_TYPE_INVALID)
+ {
+ /* Type couldn't be resolved, so the selector
+ * clearly doesn't affect the given widget path
+ */
+ return FALSE;
+ }
+
+ elem->elem_type = SELECTOR_GTYPE;
+ elem->type = resolved_type;
+ }
+
+ if (elem->elem_type == SELECTOR_GTYPE)
+ {
+ GType type;
+
+ type = gtk_widget_path_iter_get_widget_type (path, index);
+
+ if (!g_type_is_a (type, elem->type))
+ return FALSE;
+
+ if (type == elem->type)
+ *score |= 0xF;
+ else
+ {
+ GType parent = type;
+
+ *score = 0xE;
+
+ while ((parent = g_type_parent (parent)) != G_TYPE_INVALID)
+ {
+ if (parent == elem->type)
+ break;
+
+ *score -= 1;
+
+ if (*score == 1)
+ {
+ g_warning ("Hierarchy is higher than expected.");
+ break;
+ }
+ }
+ }
+
+ return TRUE;
+ }
+ else if (elem->elem_type == SELECTOR_REGION)
+ {
+ GtkRegionFlags flags;
+
+ if (!gtk_widget_path_iter_has_qregion (path, index,
+ elem->region.name,
+ &flags))
+ return FALSE;
+
+ if (elem->region.flags != 0 &&
+ (flags & elem->region.flags) == 0)
+ return FALSE;
+
+ *score = 0xF;
+ return TRUE;
+ }
+ else if (elem->elem_type == SELECTOR_GLOB)
+ {
+ /* Treat as lowest matching type */
+ *score = 1;
+ return TRUE;
+ }
+ else if (elem->elem_type == SELECTOR_NAME)
+ {
+ if (!gtk_widget_path_iter_has_qname (path, index, elem->name))
+ return FALSE;
+
+ *score = 0xF;
+ return TRUE;
+ }
+ else if (elem->elem_type == SELECTOR_CLASS)
+ {
+ if (!gtk_widget_path_iter_has_qclass (path, index, elem->name))
+ return FALSE;
+
+ *score = 0xF;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static guint64
+compare_selector (GtkWidgetPath *path,
+ SelectorPath *selector)
+{
+ GSList *elements = selector->elements;
+ gboolean match = TRUE;
+ guint64 score = 0;
+ gint i;
+
+ i = gtk_widget_path_length (path) - 1;
+
+ while (elements && match && i >= 0)
+ {
+ SelectorElement *elem;
+ guint8 elem_score;
+
+ elem = elements->data;
+
+ match = compare_selector_element (path, i, elem, &elem_score);
+
+ /* Only move on to the next index if there is no match
+ * with the current element (whether to continue or not
+ * handled right after in the combinator check), or a
+ * GType or glob has just been matched.
+ *
+ * Region and widget names do not trigger this because
+ * the next element in the selector path could also be
+ * related to the same index.
+ */
+ if (!match ||
+ (elem->elem_type == SELECTOR_GTYPE ||
+ elem->elem_type == SELECTOR_GLOB))
+ i--;
+
+ if (!match &&
+ elem->elem_type != SELECTOR_TYPE_NAME &&
+ elem->combinator == COMBINATOR_DESCENDANT)
+ {
+ /* With descendant combinators there may
+ * be intermediate chidren in the hierarchy
+ */
+ match = TRUE;
+ }
+ else if (match)
+ elements = elements->next;
+
+ if (match)
+ {
+ /* Only 4 bits are actually used */
+ score <<= 4;
+ score |= elem_score;
+ }
+ }
+
+ /* If there are pending selector
+ * elements to compare, it's not
+ * a match.
+ */
+ if (elements)
+ match = FALSE;
+
+ if (!match)
+ score = 0;
+
+ return score;
+}
+
+typedef struct StylePriorityInfo StylePriorityInfo;
+
+struct StylePriorityInfo
+{
+ guint64 score;
+ GHashTable *style;
+ GtkStateFlags state;
+};
+
+static GArray *
+css_provider_get_selectors (GtkCssProvider *css_provider,
+ GtkWidgetPath *path)
+{
+ GtkCssProviderPrivate *priv;
+ GArray *priority_info;
+ guint i, j;
+
+ priv = css_provider->priv;
+ priority_info = g_array_new (FALSE, FALSE, sizeof (StylePriorityInfo));
+
+ for (i = 0; i < priv->selectors_info->len; i++)
+ {
+ SelectorStyleInfo *info;
+ StylePriorityInfo new;
+ gboolean added = FALSE;
+ guint64 score;
+
+ info = g_ptr_array_index (priv->selectors_info, i);
+ score = compare_selector (path, info->path);
+
+ if (score <= 0)
+ continue;
+
+ new.score = score;
+ new.style = info->style;
+ new.state = info->path->state;
+
+ for (j = 0; j < priority_info->len; j++)
+ {
+ StylePriorityInfo *cur;
+
+ cur = &g_array_index (priority_info, StylePriorityInfo, j);
+
+ if (cur->score > new.score)
+ {
+ g_array_insert_val (priority_info, j, new);
+ added = TRUE;
+ break;
+ }
+ }
+
+ if (!added)
+ g_array_append_val (priority_info, new);
+ }
+
+ return priority_info;
+}
+
+static void
+css_provider_dump_symbolic_colors (GtkCssProvider *css_provider,
+ GtkStyleProperties *props)
+{
+ GtkCssProviderPrivate *priv;
+ GHashTableIter iter;
+ gpointer key, value;
+
+ priv = css_provider->priv;
+ g_hash_table_iter_init (&iter, priv->symbolic_colors);
+
+ while (g_hash_table_iter_next (&iter, &key, &value))
+ {
+ const gchar *name;
+ GtkSymbolicColor *color;
+
+ name = key;
+ color = value;
+
+ gtk_style_properties_map_color (props, name, color);
+ }
+}
+
+static GtkStyleProperties *
+gtk_css_provider_get_style (GtkStyleProvider *provider,
+ GtkWidgetPath *path)
+{
+ GtkCssProvider *css_provider;
+ GtkCssProviderPrivate *priv;
+ GtkStyleProperties *props;
+ GArray *priority_info;
+ guint i;
+
+ css_provider = GTK_CSS_PROVIDER (provider);
+ props = gtk_style_properties_new ();
+ priv = css_provider->priv;
+
+ css_provider_dump_symbolic_colors (css_provider, props);
+ priority_info = css_provider_get_selectors (css_provider, path);
+
+ for (i = 0; i < priority_info->len; i++)
+ {
+ StylePriorityInfo *info;
+ GHashTableIter iter;
+ gpointer key, value;
+
+ info = &g_array_index (priority_info, StylePriorityInfo, i);
+ g_hash_table_iter_init (&iter, info->style);
+
+ while (g_hash_table_iter_next (&iter, &key, &value))
+ {
+ gchar *prop = key;
+
+ /* Properties starting with '-' may be both widget style properties
+ * or custom properties from the theming engine, so check whether
+ * the type is registered or not.
+ */
+ if (prop[0] == '-' &&
+ !gtk_style_properties_lookup_property (prop, NULL, NULL))
+ continue;
+
+ gtk_style_properties_set_property (props, key, info->state, value);
+ }
+ }
+
+ g_array_free (priority_info, TRUE);
+
+ return props;
+}
+
+static gboolean
+gtk_css_provider_get_style_property (GtkStyleProvider *provider,
+ GtkWidgetPath *path,
+ GtkStateFlags state,
+ GParamSpec *pspec,
+ GValue *value)
+{
+ GArray *priority_info;
+ gboolean found = FALSE;
+ gchar *prop_name;
+ gint i;
+
+ prop_name = g_strdup_printf ("-%s-%s",
+ g_type_name (pspec->owner_type),
+ pspec->name);
+
+ priority_info = css_provider_get_selectors (GTK_CSS_PROVIDER (provider), path);
+
+ for (i = priority_info->len - 1; i >= 0; i--)
+ {
+ StylePriorityInfo *info;
+ GValue *val;
+
+ info = &g_array_index (priority_info, StylePriorityInfo, i);
+ val = g_hash_table_lookup (info->style, prop_name);
+
+ if (val &&
+ (info->state == 0 ||
+ info->state == state ||
+ ((info->state & state) != 0 &&
+ (info->state & ~(state)) == 0)))
+ {
+ const gchar *val_str;
+
+ val_str = g_value_get_string (val);
+ found = TRUE;
+
+ css_provider_parse_value (GTK_CSS_PROVIDER (provider), val_str, value, NULL);
+ break;
+ }
+ }
+
+ g_array_free (priority_info, TRUE);
+ g_free (prop_name);
+
+ return found;
+}
+
+static void
+gtk_css_style_provider_iface_init (GtkStyleProviderIface *iface)
+{
+ iface->get_style = gtk_css_provider_get_style;
+ iface->get_style_property = gtk_css_provider_get_style_property;
+}
+
+static void
+gtk_css_provider_finalize (GObject *object)
+{
+ GtkCssProvider *css_provider;
+ GtkCssProviderPrivate *priv;
+
+ css_provider = GTK_CSS_PROVIDER (object);
+ priv = css_provider->priv;
+
+ g_scanner_destroy (priv->scanner);
+ g_free (priv->filename);
+
+ g_ptr_array_free (priv->selectors_info, TRUE);
+
+ g_slist_foreach (priv->cur_selectors, (GFunc) selector_path_unref, NULL);
+ g_slist_free (priv->cur_selectors);
+
+ if (priv->cur_properties)
+ g_hash_table_unref (priv->cur_properties);
+ if (priv->symbolic_colors)
+ g_hash_table_destroy (priv->symbolic_colors);
+
+ G_OBJECT_CLASS (gtk_css_provider_parent_class)->finalize (object);
+}
+
+/**
+ * gtk_css_provider_new:
+ *
+ * Returns a newly created #GtkCssProvider.
+ *
+ * Returns: A new #GtkCssProvider
+ **/
+GtkCssProvider *
+gtk_css_provider_new (void)
+{
+ return g_object_new (GTK_TYPE_CSS_PROVIDER, NULL);
+}
+
+static void
+property_value_free (GValue *value)
+{
+ if (G_IS_VALUE (value))
+ g_value_unset (value);
+
+ g_slice_free (GValue, value);
+}
+
+static void
+scanner_apply_scope (GScanner *scanner,
+ ParserScope scope)
+{
+ g_scanner_set_scope (scanner, scope);
+
+ if (scope == SCOPE_VALUE)
+ {
+ scanner->config->cset_identifier_first = G_CSET_a_2_z G_CSET_A_2_Z G_CSET_DIGITS "@#-_";
+ scanner->config->cset_identifier_nth = G_CSET_a_2_z G_CSET_A_2_Z G_CSET_DIGITS "@#-_ (),.%\t\n'/\"";
+ scanner->config->scan_identifier_1char = TRUE;
+ }
+ else if (scope == SCOPE_SELECTOR)
+ {
+ scanner->config->cset_identifier_first = G_CSET_a_2_z G_CSET_A_2_Z "*@";
+ scanner->config->cset_identifier_nth = G_CSET_a_2_z G_CSET_A_2_Z G_CSET_DIGITS "-_#.";
+ scanner->config->scan_identifier_1char = TRUE;
+ }
+ else if (scope == SCOPE_PSEUDO_CLASS ||
+ scope == SCOPE_NTH_CHILD ||
+ scope == SCOPE_DECLARATION)
+ {
+ scanner->config->cset_identifier_first = G_CSET_a_2_z G_CSET_A_2_Z "-_";
+ scanner->config->cset_identifier_nth = G_CSET_a_2_z G_CSET_A_2_Z G_CSET_DIGITS "-_";
+ scanner->config->scan_identifier_1char = FALSE;
+ }
+ else
+ g_assert_not_reached ();
+
+ scanner->config->scan_float = FALSE;
+ scanner->config->cpair_comment_single = NULL;
+}
+
+static void
+css_provider_push_scope (GtkCssProvider *css_provider,
+ ParserScope scope)
+{
+ GtkCssProviderPrivate *priv;
+
+ priv = css_provider->priv;
+ priv->state = g_slist_prepend (priv->state, GUINT_TO_POINTER (scope));
+
+ scanner_apply_scope (priv->scanner, scope);
+}
+
+static ParserScope
+css_provider_pop_scope (GtkCssProvider *css_provider)
+{
+ GtkCssProviderPrivate *priv;
+ ParserScope scope = SCOPE_SELECTOR;
+
+ priv = css_provider->priv;
+
+ if (!priv->state)
+ {
+ g_warning ("Push/pop calls to parser scope aren't paired");
+ scanner_apply_scope (priv->scanner, SCOPE_SELECTOR);
+ return SCOPE_SELECTOR;
+ }
+
+ priv->state = g_slist_delete_link (priv->state, priv->state);
+
+ /* Fetch new scope */
+ if (priv->state)
+ scope = GPOINTER_TO_INT (priv->state->data);
+
+ scanner_apply_scope (priv->scanner, scope);
+
+ return scope;
+}
+
+static void
+css_provider_reset_parser (GtkCssProvider *css_provider)
+{
+ GtkCssProviderPrivate *priv;
+
+ priv = css_provider->priv;
+
+ g_slist_free (priv->state);
+ priv->state = NULL;
+
+ scanner_apply_scope (priv->scanner, SCOPE_SELECTOR);
+ priv->scanner->user_data = NULL;
+ priv->value_pos = NULL;
+
+ g_slist_foreach (priv->cur_selectors, (GFunc) selector_path_unref, NULL);
+ g_slist_free (priv->cur_selectors);
+ priv->cur_selectors = NULL;
+
+ if (priv->cur_properties)
+ g_hash_table_unref (priv->cur_properties);
+
+ priv->cur_properties = g_hash_table_new_full (g_str_hash,
+ g_str_equal,
+ (GDestroyNotify) g_free,
+ (GDestroyNotify) property_value_free);
+}
+
+static void
+css_provider_commit (GtkCssProvider *css_provider)
+{
+ GtkCssProviderPrivate *priv;
+ GSList *l;
+
+ priv = css_provider->priv;
+ l = priv->cur_selectors;
+
+ while (l)
+ {
+ SelectorPath *path = l->data;
+ SelectorStyleInfo *info;
+
+ info = selector_style_info_new (path);
+ selector_style_info_set_style (info, priv->cur_properties);
+
+ g_ptr_array_add (priv->selectors_info, info);
+ l = l->next;
+ }
+}
+
+static GTokenType
+parse_nth_child (GtkCssProvider *css_provider,
+ GScanner *scanner,
+ GtkRegionFlags *flags)
+{
+ ParserSymbol symbol;
+
+ g_scanner_get_next_token (scanner);
+
+ if (scanner->token != G_TOKEN_SYMBOL)
+ return G_TOKEN_SYMBOL;
+
+ symbol = GPOINTER_TO_INT (scanner->value.v_symbol);
+
+ if (symbol == SYMBOL_NTH_CHILD)
+ {
+ g_scanner_get_next_token (scanner);
+
+ if (scanner->token != G_TOKEN_LEFT_PAREN)
+ return G_TOKEN_LEFT_PAREN;
+
+ css_provider_push_scope (css_provider, SCOPE_NTH_CHILD);
+ g_scanner_get_next_token (scanner);
+
+ if (scanner->token != G_TOKEN_SYMBOL)
+ return G_TOKEN_SYMBOL;
+
+ symbol = GPOINTER_TO_INT (scanner->value.v_symbol);
+
+ switch (symbol)
+ {
+ case SYMBOL_NTH_CHILD_EVEN:
+ *flags = GTK_REGION_EVEN;
+ break;
+ case SYMBOL_NTH_CHILD_ODD:
+ *flags = GTK_REGION_ODD;
+ break;
+ case SYMBOL_NTH_CHILD_FIRST:
+ *flags = GTK_REGION_FIRST;
+ break;
+ case SYMBOL_NTH_CHILD_LAST:
+ *flags = GTK_REGION_LAST;
+ break;
+ default:
+ break;
+ }
+
+ g_scanner_get_next_token (scanner);
+
+ if (scanner->token != G_TOKEN_RIGHT_PAREN)
+ return G_TOKEN_RIGHT_PAREN;
+
+ css_provider_pop_scope (css_provider);
+ }
+ else if (symbol == SYMBOL_FIRST_CHILD)
+ *flags = GTK_REGION_FIRST;
+ else if (symbol == SYMBOL_LAST_CHILD)
+ *flags = GTK_REGION_LAST;
+ else if (symbol == SYMBOL_SORTED_CHILD)
+ *flags = GTK_REGION_SORTED;
+ else
+ {
+ *flags = 0;
+ return G_TOKEN_SYMBOL;
+ }
+
+ return G_TOKEN_NONE;
+}
+
+static GTokenType
+parse_pseudo_class (GtkCssProvider *css_provider,
+ GScanner *scanner,
+ SelectorPath *selector)
+{
+ GtkStateType state;
+
+ g_scanner_get_next_token (scanner);
+
+ if (scanner->token != G_TOKEN_SYMBOL)
+ return G_TOKEN_SYMBOL;
+
+ state = GPOINTER_TO_INT (scanner->value.v_symbol);
+
+ switch (state)
+ {
+ case GTK_STATE_ACTIVE:
+ selector->state |= GTK_STATE_FLAG_ACTIVE;
+ break;
+ case GTK_STATE_PRELIGHT:
+ selector->state |= GTK_STATE_FLAG_PRELIGHT;
+ break;
+ case GTK_STATE_SELECTED:
+ selector->state |= GTK_STATE_FLAG_SELECTED;
+ break;
+ case GTK_STATE_INSENSITIVE:
+ selector->state |= GTK_STATE_FLAG_INSENSITIVE;
+ break;
+ case GTK_STATE_INCONSISTENT:
+ selector->state |= GTK_STATE_FLAG_INCONSISTENT;
+ break;
+ case GTK_STATE_FOCUSED:
+ selector->state |= GTK_STATE_FLAG_FOCUSED;
+ break;
+ default:
+ return G_TOKEN_SYMBOL;
+ }
+
+ return G_TOKEN_NONE;
+}
+
+/* Parses a number of concatenated classes */
+static void
+parse_classes (SelectorPath *path,
+ const gchar *str)
+{
+ gchar *pos;
+
+ if ((pos = strchr (str, '.')) != NULL)
+ {
+ /* Leave the last class to the call after the loop */
+ while (pos)
+ {
+ *pos = '\0';
+ selector_path_prepend_class (path, str);
+
+ str = pos + 1;
+ pos = strchr (str, '.');
+ }
+ }
+
+ selector_path_prepend_class (path, str);
+}
+
+static GTokenType
+parse_selector (GtkCssProvider *css_provider,
+ GScanner *scanner,
+ SelectorPath **selector_out)
+{
+ SelectorPath *path;
+
+ path = selector_path_new ();
+ *selector_out = path;
+
+ if (scanner->token != ':' &&
+ scanner->token != '#' &&
+ scanner->token != '.' &&
+ scanner->token != G_TOKEN_IDENTIFIER)
+ return G_TOKEN_IDENTIFIER;
+
+ while (scanner->token == '#' ||
+ scanner->token == '.' ||
+ scanner->token == G_TOKEN_IDENTIFIER)
+ {
+ if (scanner->token == '#' ||
+ scanner->token == '.')
+ {
+ gboolean is_class;
+ gchar *pos;
+
+ is_class = (scanner->token == '.');
+
+ g_scanner_get_next_token (scanner);
+
+ if (scanner->token != G_TOKEN_IDENTIFIER)
+ return G_TOKEN_IDENTIFIER;
+
+ selector_path_prepend_glob (path);
+ selector_path_prepend_combinator (path, COMBINATOR_CHILD);
+
+ if (is_class)
+ parse_classes (path, scanner->value.v_identifier);
+ else
+ {
+ if ((pos = strchr (scanner->value.v_identifier, '.')) != NULL)
+ *pos = '\0';
+
+ selector_path_prepend_name (path, scanner->value.v_identifier);
+
+ /* Parse any remaining classes */
+ if (pos)
+ parse_classes (path, pos + 1);
+ }
+ }
+ else if (g_ascii_isupper (scanner->value.v_identifier[0]))
+ {
+ gchar *pos;
+
+ if ((pos = strchr (scanner->value.v_identifier, '#')) != NULL ||
+ (pos = strchr (scanner->value.v_identifier, '.')) != NULL)
+ {
+ gchar *type_name, *name;
+ gboolean is_class;
+
+ is_class = (*pos == '.');
+
+ /* Widget type and name/class put together */
+ name = pos + 1;
+ *pos = '\0';
+ type_name = scanner->value.v_identifier;
+
+ selector_path_prepend_type (path, type_name);
+
+ /* This is only so there is a direct relationship
+ * between widget type and its name.
+ */
+ selector_path_prepend_combinator (path, COMBINATOR_CHILD);
+
+ if (is_class)
+ parse_classes (path, name);
+ else
+ {
+ if ((pos = strchr (name, '.')) != NULL)
+ *pos = '\0';
+
+ selector_path_prepend_name (path, name);
+
+ /* Parse any remaining classes */
+ if (pos)
+ parse_classes (path, pos + 1);
+ }
+ }
+ else
+ selector_path_prepend_type (path, scanner->value.v_identifier);
+ }
+ else if (g_ascii_islower (scanner->value.v_identifier[0]))
+ {
+ GtkRegionFlags flags = 0;
+ gchar *region_name;
+
+ region_name = g_strdup (scanner->value.v_identifier);
+
+ if (g_scanner_peek_next_token (scanner) == ':')
+ {
+ ParserSymbol symbol;
+
+ g_scanner_get_next_token (scanner);
+ css_provider_push_scope (css_provider, SCOPE_PSEUDO_CLASS);
+
+ /* Check for the next token being nth-child, parse in that
+ * case, and fallback into common state parsing if not.
+ */
+ if (g_scanner_peek_next_token (scanner) != G_TOKEN_SYMBOL)
+ return G_TOKEN_SYMBOL;
+
+ symbol = GPOINTER_TO_INT (scanner->next_value.v_symbol);
+
+ if (symbol == SYMBOL_FIRST_CHILD ||
+ symbol == SYMBOL_LAST_CHILD ||
+ symbol == SYMBOL_NTH_CHILD ||
+ symbol == SYMBOL_SORTED_CHILD)
+ {
+ GTokenType token;
+
+ if ((token = parse_nth_child (css_provider, scanner, &flags)) != G_TOKEN_NONE)
+ return token;
+
+ css_provider_pop_scope (css_provider);
+ }
+ else
+ {
+ css_provider_pop_scope (css_provider);
+ selector_path_prepend_region (path, region_name, 0);
+ g_free (region_name);
+ break;
+ }
+ }
+
+ selector_path_prepend_region (path, region_name, flags);
+ g_free (region_name);
+ }
+ else if (scanner->value.v_identifier[0] == '*')
+ selector_path_prepend_glob (path);
+ else
+ return G_TOKEN_IDENTIFIER;
+
+ g_scanner_get_next_token (scanner);
+
+ if (scanner->token == '>')
+ {
+ selector_path_prepend_combinator (path, COMBINATOR_CHILD);
+ g_scanner_get_next_token (scanner);
+ }
+ }
+
+ if (scanner->token == ':')
+ {
+ /* Add glob selector if path is empty */
+ if (selector_path_depth (path) == 0)
+ selector_path_prepend_glob (path);
+
+ css_provider_push_scope (css_provider, SCOPE_PSEUDO_CLASS);
+
+ while (scanner->token == ':')
+ {
+ GTokenType token;
+
+ if ((token = parse_pseudo_class (css_provider, scanner, path)) != G_TOKEN_NONE)
+ return token;
+
+ g_scanner_get_next_token (scanner);
+ }
+
+ css_provider_pop_scope (css_provider);
+ }
+
+ return G_TOKEN_NONE;
+}
+
+#define SKIP_SPACES(s) while (s[0] == ' ' || s[0] == '\t' || s[0] == '\n') s++;
+#define SKIP_SPACES_BACK(s) while (s[0] == ' ' || s[0] == '\t' || s[0] == '\n') s--;
+
+static GtkSymbolicColor *
+symbolic_color_parse_str (const gchar *string,
+ gchar **end_ptr)
+{
+ GtkSymbolicColor *symbolic_color = NULL;
+ gchar *str;
+
+ str = (gchar *) string;
+ *end_ptr = str;
+
+ if (str[0] == '@')
+ {
+ const gchar *end;
+ gchar *name;
+
+ str++;
+ end = str;
+
+ while (*end == '-' || *end == '_' || g_ascii_isalpha (*end))
+ end++;
+
+ name = g_strndup (str, end - str);
+ symbolic_color = gtk_symbolic_color_new_name (name);
+ g_free (name);
+
+ *end_ptr = (gchar *) end;
+ }
+ else if (g_str_has_prefix (str, "lighter") ||
+ g_str_has_prefix (str, "darker"))
+ {
+ GtkSymbolicColor *param_color;
+ gboolean is_lighter = FALSE;
+
+ is_lighter = g_str_has_prefix (str, "lighter");
+
+ if (is_lighter)
+ str += strlen ("lighter");
+ else
+ str += strlen ("darker");
+
+ SKIP_SPACES (str);
+
+ if (*str != '(')
+ {
+ *end_ptr = (gchar *) str;
+ return NULL;
+ }
+
+ str++;
+ SKIP_SPACES (str);
+ param_color = symbolic_color_parse_str (str, end_ptr);
+
+ if (!param_color)
+ return NULL;
+
+ str = *end_ptr;
+ SKIP_SPACES (str);
+ *end_ptr = (gchar *) str;
+
+ if (*str != ')')
+ {
+ gtk_symbolic_color_unref (param_color);
+ return NULL;
+ }
+
+ if (is_lighter)
+ symbolic_color = gtk_symbolic_color_new_shade (param_color, 1.3);
+ else
+ symbolic_color = gtk_symbolic_color_new_shade (param_color, 0.7);
+
+ gtk_symbolic_color_unref (param_color);
+ (*end_ptr)++;
+ }
+ else if (g_str_has_prefix (str, "shade") ||
+ g_str_has_prefix (str, "alpha"))
+ {
+ GtkSymbolicColor *param_color;
+ gboolean is_shade = FALSE;
+ gdouble factor;
+
+ is_shade = g_str_has_prefix (str, "shade");
+
+ if (is_shade)
+ str += strlen ("shade");
+ else
+ str += strlen ("alpha");
+
+ SKIP_SPACES (str);
+
+ if (*str != '(')
+ {
+ *end_ptr = (gchar *) str;
+ return NULL;
+ }
+
+ str++;
+ SKIP_SPACES (str);
+ param_color = symbolic_color_parse_str (str, end_ptr);
+
+ if (!param_color)
+ return NULL;
+
+ str = *end_ptr;
+ SKIP_SPACES (str);
+
+ if (str[0] != ',')
+ {
+ gtk_symbolic_color_unref (param_color);
+ *end_ptr = (gchar *) str;
+ return NULL;
+ }
+
+ str++;
+ SKIP_SPACES (str);
+ factor = g_ascii_strtod (str, end_ptr);
+
+ str = *end_ptr;
+ SKIP_SPACES (str);
+ *end_ptr = (gchar *) str;
+
+ if (str[0] != ')')
+ {
+ gtk_symbolic_color_unref (param_color);
+ return NULL;
+ }
+
+ if (is_shade)
+ symbolic_color = gtk_symbolic_color_new_shade (param_color, factor);
+ else
+ symbolic_color = gtk_symbolic_color_new_alpha (param_color, factor);
+
+ gtk_symbolic_color_unref (param_color);
+ (*end_ptr)++;
+ }
+ else if (g_str_has_prefix (str, "mix"))
+ {
+ GtkSymbolicColor *color1, *color2;
+ gdouble factor;
+
+ str += strlen ("mix");
+ SKIP_SPACES (str);
+
+ if (*str != '(')
+ {
+ *end_ptr = (gchar *) str;
+ return NULL;
+ }
+
+ str++;
+ SKIP_SPACES (str);
+ color1 = symbolic_color_parse_str (str, end_ptr);
+
+ if (!color1)
+ return NULL;
+
+ str = *end_ptr;
+ SKIP_SPACES (str);
+
+ if (str[0] != ',')
+ {
+ gtk_symbolic_color_unref (color1);
+ *end_ptr = (gchar *) str;
+ return NULL;
+ }
+
+ str++;
+ SKIP_SPACES (str);
+ color2 = symbolic_color_parse_str (str, end_ptr);
+
+ if (!color2 || *end_ptr[0] != ',')
+ {
+ gtk_symbolic_color_unref (color1);
+ return NULL;
+ }
+
+ str = *end_ptr;
+ SKIP_SPACES (str);
+
+ if (str[0] != ',')
+ {
+ gtk_symbolic_color_unref (color1);
+ gtk_symbolic_color_unref (color2);
+ *end_ptr = (gchar *) str;
+ return NULL;
+ }
+
+ str++;
+ SKIP_SPACES (str);
+ factor = g_ascii_strtod (str, end_ptr);
+
+ str = *end_ptr;
+ SKIP_SPACES (str);
+ *end_ptr = (gchar *) str;
+
+ if (str[0] != ')')
+ {
+ gtk_symbolic_color_unref (color1);
+ gtk_symbolic_color_unref (color2);
+ return NULL;
+ }
+
+ symbolic_color = gtk_symbolic_color_new_mix (color1, color2, factor);
+ gtk_symbolic_color_unref (color1);
+ gtk_symbolic_color_unref (color2);
+ (*end_ptr)++;
+ }
+ else
+ {
+ GdkRGBA color;
+ gchar *color_str;
+ const gchar *end;
+
+ end = str + 1;
+
+ if (str[0] == '#')
+ {
+ /* Color in hex format */
+ while (g_ascii_isxdigit (*end))
+ end++;
+ }
+ else if (g_str_has_prefix (str, "rgb"))
+ {
+ /* color in rgb/rgba format */
+ while (*end != ')' && *end != '\0')
+ end++;
+
+ if (*end == ')')
+ end++;
+ }
+ else
+ {
+ /* color name? parse until first whitespace */
+ while (*end != ' ' && *end != '\0')
+ end++;
+ }
+
+ color_str = g_strndup (str, end - str);
+ *end_ptr = (gchar *) end;
+
+ if (!gdk_rgba_parse (&color, color_str))
+ {
+ g_free (color_str);
+ return NULL;
+ }
+
+ symbolic_color = gtk_symbolic_color_new_literal (&color);
+ g_free (color_str);
+ }
+
+ return symbolic_color;
+}
+
+static GtkSymbolicColor *
+symbolic_color_parse (const gchar *str,
+ GError **error)
+{
+ GtkSymbolicColor *color;
+ gchar *end;
+
+ color = symbolic_color_parse_str (str, &end);
+
+ if (*end != '\0')
+ {
+ g_set_error_literal (error,
+ gtk_css_provider_error_quark (),
+ CSS_PROVIDER_PARSE_ERROR,
+ "Could not parse symbolic color");
+
+ if (color)
+ {
+ gtk_symbolic_color_unref (color);
+ color = NULL;
+ }
+ }
+
+ return color;
+}
+
+static GtkGradient *
+gradient_parse_str (const gchar *str,
+ gchar **end_ptr)
+{
+ GtkGradient *gradient = NULL;
+ gdouble coords[6];
+ gchar *end;
+ guint i;
+
+ if (g_str_has_prefix (str, "-gtk-gradient"))
+ {
+ cairo_pattern_type_t type;
+
+ str += strlen ("-gtk-gradient");
+ SKIP_SPACES (str);
+
+ if (*str != '(')
+ {
+ *end_ptr = (gchar *) str;
+ return NULL;
+ }
+
+ str++;
+ SKIP_SPACES (str);
+
+ /* Parse gradient type */
+ if (g_str_has_prefix (str, "linear"))
+ {
+ type = CAIRO_PATTERN_TYPE_LINEAR;
+ str += strlen ("linear");
+ }
+ else if (g_str_has_prefix (str, "radial"))
+ {
+ type = CAIRO_PATTERN_TYPE_RADIAL;
+ str += strlen ("radial");
+ }
+ else
+ {
+ *end_ptr = (gchar *) str;
+ return NULL;
+ }
+
+ SKIP_SPACES (str);
+
+ /* Parse start/stop position parameters */
+ for (i = 0; i < 2; i++)
+ {
+ if (*str != ',')
+ {
+ *end_ptr = (gchar *) str;
+ return NULL;
+ }
+
+ str++;
+ SKIP_SPACES (str);
+
+ if (strncmp (str, "left", 4) == 0)
+ {
+ coords[i * 3] = 0;
+ str += strlen ("left");
+ }
+ else if (strncmp (str, "right", 5) == 0)
+ {
+ coords[i * 3] = 1;
+ str += strlen ("right");
+ }
+ else if (strncmp (str, "center", 6) == 0)
+ {
+ coords[i * 3] = 0.5;
+ str += strlen ("center");
+ }
+ else
+ {
+ coords[i * 3] = g_ascii_strtod (str, &end);
+
+ if (str == end)
+ {
+ *end_ptr = (gchar *) str;
+ return NULL;
+ }
+
+ str = end;
+ }
+
+ SKIP_SPACES (str);
+
+ if (strncmp (str, "top", 3) == 0)
+ {
+ coords[(i * 3) + 1] = 0;
+ str += strlen ("top");
+ }
+ else if (strncmp (str, "bottom", 6) == 0)
+ {
+ coords[(i * 3) + 1] = 1;
+ str += strlen ("bottom");
+ }
+ else if (strncmp (str, "center", 6) == 0)
+ {
+ coords[(i * 3) + 1] = 0.5;
+ str += strlen ("center");
+ }
+ else
+ {
+ coords[(i * 3) + 1] = g_ascii_strtod (str, &end);
+
+ if (str == end)
+ {
+ *end_ptr = (gchar *) str;
+ return NULL;
+ }
+
+ str = end;
+ }
+
+ SKIP_SPACES (str);
+
+ if (type == CAIRO_PATTERN_TYPE_RADIAL)
+ {
+ /* Parse radius */
+ if (*str != ',')
+ {
+ *end_ptr = (gchar *) str;
+ return NULL;
+ }
+
+ str++;
+ SKIP_SPACES (str);
+
+ coords[(i * 3) + 2] = g_ascii_strtod (str, &end);
+ str = end;
+
+ SKIP_SPACES (str);
+ }
+ }
+
+ if (type == CAIRO_PATTERN_TYPE_LINEAR)
+ gradient = gtk_gradient_new_linear (coords[0], coords[1], coords[3], coords[4]);
+ else
+ gradient = gtk_gradient_new_radial (coords[0], coords[1], coords[2],
+ coords[3], coords[4], coords[5]);
+
+ while (*str == ',')
+ {
+ GtkSymbolicColor *color;
+ gdouble position;
+
+ if (*str != ',')
+ {
+ *end_ptr = (gchar *) str;
+ return gradient;
+ }
+
+ str++;
+ SKIP_SPACES (str);
+
+ if (g_str_has_prefix (str, "from"))
+ {
+ position = 0;
+ str += strlen ("from");
+ SKIP_SPACES (str);
+
+ if (*str != '(')
+ {
+ *end_ptr = (gchar *) str;
+ return gradient;
+ }
+ }
+ else if (g_str_has_prefix (str, "to"))
+ {
+ position = 1;
+ str += strlen ("to");
+ SKIP_SPACES (str);
+
+ if (*str != '(')
+ {
+ *end_ptr = (gchar *) str;
+ return gradient;
+ }
+ }
+ else if (g_str_has_prefix (str, "color-stop"))
+ {
+ str += strlen ("color-stop");
+ SKIP_SPACES (str);
+
+ if (*str != '(')
+ {
+ *end_ptr = (gchar *) str;
+ return gradient;
+ }
+
+ str++;
+ SKIP_SPACES (str);
+
+ position = g_ascii_strtod (str, &end);
+
+ str = end;
+ SKIP_SPACES (str);
+
+ if (*str != ',')
+ {
+ *end_ptr = (gchar *) str;
+ return gradient;
+ }
+ }
+ else
+ {
+ *end_ptr = (gchar *) str;
+ return gradient;
+ }
+
+ str++;
+ SKIP_SPACES (str);
+
+ color = symbolic_color_parse_str (str, &end);
+
+ str = end;
+ SKIP_SPACES (str);
+
+ if (*str != ')')
+ {
+ *end_ptr = (gchar *) str;
+ return gradient;
+ }
+
+ str++;
+ SKIP_SPACES (str);
+
+ if (color)
+ {
+ gtk_gradient_add_color_stop (gradient, position, color);
+ gtk_symbolic_color_unref (color);
+ }
+ }
+
+ if (*str != ')')
+ {
+ *end_ptr = (gchar *) str;
+ return gradient;
+ }
+
+ str++;
+ }
+
+ *end_ptr = (gchar *) str;
+
+ return gradient;
+}
+
+static gchar *
+path_parse_str (GtkCssProvider *css_provider,
+ const gchar *str,
+ gchar **end_ptr,
+ GError **error)
+{
+ gchar *path, *chr;
+ const gchar *start, *end;
+
+ start = str;
+
+ if (g_str_has_prefix (str, "url"))
+ {
+ str += strlen ("url");
+ SKIP_SPACES (str);
+
+ if (*str != '(')
+ {
+ *end_ptr = (gchar *) str;
+ return NULL;
+ }
+
+ chr = strchr (str, ')');
+ if (!chr)
+ {
+ *end_ptr = (gchar *) str;
+ return NULL;
+ }
+
+ end = chr + 1;
+
+ str++;
+ SKIP_SPACES (str);
+
+ if (*str == '"' || *str == '\'')
+ {
+ const gchar *p;
+ p = str;
+ str++;
+
+ chr--;
+ SKIP_SPACES_BACK (chr);
+
+ if (*chr != *p || chr == p)
+ {
+ *end_ptr = (gchar *)str;
+ return NULL;
+ }
+ }
+ else
+ {
+ *end_ptr = (gchar *)str;
+ return NULL;
+ }
+
+ path = g_strndup (str, chr - str);
+ g_strstrip (path);
+
+ *end_ptr = (gchar *)end;
+ }
+ else
+ {
+ path = g_strdup (str);
+ *end_ptr = (gchar *)str + strlen (str);
+ }
+
+ /* Always return an absolute path */
+ if (!g_path_is_absolute (path))
+ {
+ GtkCssProviderPrivate *priv;
+ gchar *dirname, *full_path;
+
+ priv = css_provider->priv;
+
+ /* Use relative path to the current CSS file path, if any */
+ if (priv->filename)
+ dirname = g_path_get_dirname (priv->filename);
+ else
+ dirname = g_get_current_dir ();
+
+ full_path = g_build_filename (dirname, path, NULL);
+ g_free (path);
+ g_free (dirname);
+
+ path = full_path;
+ }
+
+ if (!g_file_test (path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR))
+ {
+ g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_EXIST,
+ "File doesn't exist: %s", path);
+ g_free (path);
+ path = NULL;
+ *end_ptr = (gchar *)start;
+ }
+
+ return path;
+}
+
+static gchar *
+path_parse (GtkCssProvider *css_provider,
+ const gchar *str,
+ GError **error)
+{
+ gchar *path;
+ gchar *end;
+
+ path = path_parse_str (css_provider, str, &end, error);
+
+ if (!path)
+ return NULL;
+
+ if (*end != '\0')
+ {
+ g_set_error_literal (error,
+ gtk_css_provider_error_quark (),
+ CSS_PROVIDER_PARSE_ERROR,
+ "Error parsing path");
+ g_free (path);
+ path = NULL;
+ }
+
+ return path;
+}
+
+static Gtk9Slice *
+slice_parse_str (GtkCssProvider *css_provider,
+ const gchar *str,
+ gchar **end_ptr,
+ GError **error)
+{
+ gdouble distance_top, distance_bottom;
+ gdouble distance_left, distance_right;
+ GtkSliceSideModifier mods[2];
+ GdkPixbuf *pixbuf;
+ Gtk9Slice *slice;
+ gchar *path;
+ gint i = 0;
+
+ SKIP_SPACES (str);
+
+ /* Parse image url */
+ path = path_parse_str (css_provider, str, end_ptr, error);
+
+ if (!path)
+ return NULL;
+
+ str = *end_ptr;
+ SKIP_SPACES (str);
+
+ /* Parse top/left/bottom/right distances */
+ distance_top = g_ascii_strtod (str, end_ptr);
+
+ str = *end_ptr;
+ SKIP_SPACES (str);
+
+ distance_right = g_ascii_strtod (str, end_ptr);
+
+ str = *end_ptr;
+ SKIP_SPACES (str);
+
+ distance_bottom = g_ascii_strtod (str, end_ptr);
+
+ str = *end_ptr;
+ SKIP_SPACES (str);
+
+ distance_left = g_ascii_strtod (str, end_ptr);
+
+ str = *end_ptr;
+ SKIP_SPACES (str);
+
+ while (*str && i < 2)
+ {
+ if (g_str_has_prefix (str, "stretch"))
+ {
+ str += strlen ("stretch");
+ mods[i] = GTK_SLICE_STRETCH;
+ }
+ else if (g_str_has_prefix (str, "repeat"))
+ {
+ str += strlen ("repeat");
+ mods[i] = GTK_SLICE_REPEAT;
+ }
+ else
+ {
+ g_free (path);
+ *end_ptr = (gchar *) str;
+ return NULL;
+ }
+
+ SKIP_SPACES (str);
+ i++;
+ }
+
+ *end_ptr = (gchar *) str;
+
+ if (*str != '\0')
+ {
+ g_free (path);
+ return NULL;
+ }
+
+ if (i != 2)
+ {
+ /* Fill in second modifier, same as the first */
+ mods[1] = mods[0];
+ }
+
+ pixbuf = gdk_pixbuf_new_from_file (path, error);
+ g_free (path);
+
+ if (!pixbuf)
+ {
+ *end_ptr = (gchar *) str;
+ return NULL;
+ }
+
+ slice = gtk_9slice_new (pixbuf,
+ distance_top, distance_bottom,
+ distance_left, distance_right,
+ mods[0], mods[1]);
+ g_object_unref (pixbuf);
+
+ return slice;
+}
+
+static gdouble
+unit_parse_str (const gchar *str,
+ gchar **end_str)
+{
+ gdouble unit;
+
+ SKIP_SPACES (str);
+ unit = g_ascii_strtod (str, end_str);
+ str = *end_str;
+
+ /* Now parse the unit type, if any. We
+ * don't admit spaces between these.
+ */
+ if (*str != ' ' && *str != '\0')
+ {
+ while (**end_str != ' ' && **end_str != '\0')
+ (*end_str)++;
+
+ /* Only handle pixels at the moment */
+ if (strncmp (str, "px", 2) != 0)
+ {
+ gchar *type;
+
+ type = g_strndup (str, *end_str - str);
+ g_warning ("Unknown unit '%s', only pixel units are "
+ "currently supported in CSS style", type);
+ g_free (type);
+ }
+ }
+
+ return unit;
+}
+
+static GtkBorder *
+border_parse_str (const gchar *str,
+ gchar **end_str)
+{
+ gdouble first, second, third, fourth;
+ GtkBorder *border;
+
+ border = gtk_border_new ();
+
+ SKIP_SPACES (str);
+ if (!g_ascii_isdigit (*str))
+ return border;
+
+ first = unit_parse_str (str, end_str);
+ str = *end_str;
+ SKIP_SPACES (str);
+
+ if (!g_ascii_isdigit (*str))
+ {
+ border->left = border->right = border->top = border->bottom = (gint) first;
+ *end_str = (gchar *) str;
+ return border;
+ }
+
+ second = unit_parse_str (str, end_str);
+ str = *end_str;
+ SKIP_SPACES (str);
+
+ if (!g_ascii_isdigit (*str))
+ {
+ border->top = border->bottom = (gint) first;
+ border->left = border->right = (gint) second;
+ *end_str = (gchar *) str;
+ return border;
+ }
+
+ third = unit_parse_str (str, end_str);
+ str = *end_str;
+ SKIP_SPACES (str);
+
+ if (!g_ascii_isdigit (*str))
+ {
+ border->top = (gint) first;
+ border->left = border->right = (gint) second;
+ border->bottom = (gint) third;
+ *end_str = (gchar *) str;
+ return border;
+ }
+
+ fourth = unit_parse_str (str, end_str);
+
+ border->top = (gint) first;
+ border->right = (gint) second;
+ border->bottom = (gint) third;
+ border->left = (gint) fourth;
+
+ return border;
+}
+
+static gboolean
+css_provider_parse_value (GtkCssProvider *css_provider,
+ const gchar *value_str,
+ GValue *value,
+ GError **error)
+{
+ GtkCssProviderPrivate *priv;
+ GType type;
+ gboolean parsed = TRUE;
+ gchar *end = NULL;
+
+ priv = css_provider->priv;
+ type = G_VALUE_TYPE (value);
+
+ if (type == GDK_TYPE_RGBA ||
+ type == GDK_TYPE_COLOR)
+ {
+ GdkRGBA color;
+ GdkColor rgb;
+
+ if (type == GDK_TYPE_RGBA &&
+ gdk_rgba_parse (&color, value_str))
+ g_value_set_boxed (value, &color);
+ else if (type == GDK_TYPE_COLOR &&
+ gdk_color_parse (value_str, &rgb))
+ g_value_set_boxed (value, &rgb);
+ else
+ {
+ GtkSymbolicColor *symbolic_color;
+
+ symbolic_color = symbolic_color_parse_str (value_str, &end);
+
+ if (!symbolic_color)
+ return FALSE;
+
+ g_value_unset (value);
+ g_value_init (value, GTK_TYPE_SYMBOLIC_COLOR);
+ g_value_take_boxed (value, symbolic_color);
+ }
+ }
+ else if (type == PANGO_TYPE_FONT_DESCRIPTION)
+ {
+ PangoFontDescription *font_desc;
+
+ font_desc = pango_font_description_from_string (value_str);
+ g_value_take_boxed (value, font_desc);
+ }
+ else if (type == G_TYPE_BOOLEAN)
+ {
+ if (value_str[0] == '1' ||
+ g_ascii_strcasecmp (value_str, "true") == 0)
+ g_value_set_boolean (value, TRUE);
+ else
+ g_value_set_boolean (value, FALSE);
+ }
+ else if (type == G_TYPE_INT)
+ g_value_set_int (value, atoi (value_str));
+ else if (type == G_TYPE_UINT)
+ g_value_set_uint (value, (guint) atoi (value_str));
+ else if (type == G_TYPE_DOUBLE)
+ g_value_set_double (value, g_ascii_strtod (value_str, NULL));
+ else if (type == G_TYPE_FLOAT)
+ g_value_set_float (value, (gfloat) g_ascii_strtod (value_str, NULL));
+ else if (type == GTK_TYPE_THEMING_ENGINE)
+ {
+ GtkThemingEngine *engine;
+
+ engine = gtk_theming_engine_load (value_str);
+ g_value_set_object (value, engine);
+ }
+ else if (type == GTK_TYPE_ANIMATION_DESCRIPTION)
+ {
+ GtkAnimationDescription *desc;
+
+ desc = gtk_animation_description_from_string (value_str);
+
+ if (desc)
+ g_value_take_boxed (value, desc);
+ else
+ parsed = FALSE;
+ }
+ else if (type == GTK_TYPE_BORDER)
+ {
+ GtkBorder *border;
+
+ border = border_parse_str (value_str, &end);
+ g_value_take_boxed (value, border);
+ }
+ else if (type == CAIRO_GOBJECT_TYPE_PATTERN)
+ {
+ GtkGradient *gradient;
+
+ gradient = gradient_parse_str (value_str, &end);
+
+ if (gradient)
+ {
+ g_value_unset (value);
+ g_value_init (value, GTK_TYPE_GRADIENT);
+ g_value_take_boxed (value, gradient);
+ }
+ else
+ {
+ gchar *path;
+ GdkPixbuf *pixbuf;
+
+ g_clear_error (error);
+ path = path_parse_str (css_provider, value_str, &end, error);
+
+ if (path)
+ {
+ pixbuf = gdk_pixbuf_new_from_file (path, NULL);
+ g_free (path);
+
+ if (pixbuf)
+ {
+ cairo_surface_t *surface;
+ cairo_pattern_t *pattern;
+ cairo_t *cr;
+ cairo_matrix_t matrix;
+
+ surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
+ gdk_pixbuf_get_width (pixbuf),
+ gdk_pixbuf_get_height (pixbuf));
+ cr = cairo_create (surface);
+ gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0);
+ cairo_paint (cr);
+ pattern = cairo_pattern_create_for_surface (surface);
+
+ cairo_matrix_init_scale (&matrix,
+ gdk_pixbuf_get_width (pixbuf),
+ gdk_pixbuf_get_height (pixbuf));
+ cairo_pattern_set_matrix (pattern, &matrix);
+
+ cairo_surface_destroy (surface);
+ cairo_destroy (cr);
+ g_object_unref (pixbuf);
+
+ g_value_take_boxed (value, pattern);
+ }
+ else
+ parsed = FALSE;
+ }
+ else
+ parsed = FALSE;
+ }
+ }
+ else if (G_TYPE_IS_ENUM (type))
+ {
+ GEnumClass *enum_class;
+ GEnumValue *enum_value;
+
+ enum_class = g_type_class_ref (type);
+ enum_value = g_enum_get_value_by_nick (enum_class, value_str);
+
+ if (!enum_value)
+ {
+ g_warning ("Unknown value '%s' for enum type '%s'",
+ value_str, g_type_name (type));
+ parsed = FALSE;
+ }
+ else
+ g_value_set_enum (value, enum_value->value);
+
+ g_type_class_unref (enum_class);
+ }
+ else if (G_TYPE_IS_FLAGS (type))
+ {
+ GFlagsClass *flags_class;
+ GFlagsValue *flag_value;
+ guint flags = 0;
+ gchar *ptr;
+
+ flags_class = g_type_class_ref (type);
+
+ /* Parse comma separated values */
+ ptr = strchr (value_str, ',');
+
+ while (ptr && parsed)
+ {
+ gchar *flag_str;
+
+ *ptr = '\0';
+ ptr++;
+
+ flag_str = (gchar *) value_str;
+ flag_value = g_flags_get_value_by_nick (flags_class,
+ g_strstrip (flag_str));
+
+ if (!flag_value)
+ {
+ g_warning ("Unknown flag '%s' for type '%s'",
+ value_str, g_type_name (type));
+ parsed = FALSE;
+ }
+ else
+ flags |= flag_value->value;
+
+ value_str = ptr;
+ ptr = strchr (value_str, ',');
+ }
+
+ /* Store last/only value */
+ flag_value = g_flags_get_value_by_nick (flags_class, value_str);
+
+ if (!flag_value)
+ {
+ g_warning ("Unknown flag '%s' for type '%s'",
+ value_str, g_type_name (type));
+ parsed = FALSE;
+ }
+ else
+ flags |= flag_value->value;
+
+ if (parsed)
+ g_value_set_enum (value, flags);
+
+ g_type_class_unref (flags_class);
+ }
+ else if (type == GTK_TYPE_9SLICE)
+ {
+ Gtk9Slice *slice;
+
+ slice = slice_parse_str (css_provider, value_str, &end, error);
+
+ if (slice)
+ g_value_take_boxed (value, slice);
+ else
+ parsed = FALSE;
+ }
+ else
+ {
+ g_warning ("Cannot parse string '%s' for type %s", value_str, g_type_name (type));
+ parsed = FALSE;
+ }
+
+ if (end && *end)
+ {
+ /* Set error position in the scanner
+ * according to what we've parsed so far
+ */
+ priv->value_pos += (end - value_str);
+
+ if (error && !*error)
+ g_set_error_literal (error,
+ gtk_css_provider_error_quark (),
+ CSS_PROVIDER_PARSE_ERROR,
+ "Failed to parse value");
+ }
+
+ return parsed;
+}
+
+static void
+scanner_report_warning (GtkCssProvider *css_provider,
+ GTokenType expected_token,
+ GError *error)
+{
+ GtkCssProviderPrivate *priv;
+ const gchar *line_end, *line_start;
+ const gchar *expected_str;
+ gchar buf[2], *line, *str;
+ guint pos;
+
+ priv = css_provider->priv;
+
+ if (error)
+ str = g_strdup (error->message);
+ else
+ {
+ if (priv->scanner->user_data)
+ expected_str = priv->scanner->user_data;
+ else
+ {
+ switch (expected_token)
+ {
+ case G_TOKEN_SYMBOL:
+ expected_str = "Symbol";
+ case G_TOKEN_IDENTIFIER:
+ expected_str = "Identifier";
+ default:
+ buf[0] = expected_token;
+ buf[1] = '\0';
+ expected_str = buf;
+ }
+ }
+
+ str = g_strdup_printf ("Parse error, expecting a %s '%s'",
+ (expected_str != buf) ? "valid" : "",
+ expected_str);
+ }
+
+ if (priv->value_pos)
+ line_start = priv->value_pos - 1;
+ else
+ line_start = priv->scanner->text - 1;
+
+ while (*line_start != '\n' &&
+ line_start != priv->buffer)
+ line_start--;
+
+ if (*line_start == '\n')
+ line_start++;
+
+ if (priv->value_pos)
+ pos = priv->value_pos - line_start + 1;
+ else
+ pos = priv->scanner->text - line_start - 1;
+
+ line_end = strchr (line_start, '\n');
+
+ if (line_end)
+ line = g_strndup (line_start, (line_end - line_start));
+ else
+ line = g_strdup (line_start);
+
+ g_message ("CSS: %s\n"
+ "%s, line %d, char %d:\n"
+ "%*c %s\n"
+ "%*c ^",
+ str, priv->scanner->input_name,
+ priv->scanner->line, priv->scanner->position,
+ 3, ' ', line,
+ 3 + pos, ' ');
+
+ g_free (line);
+ g_free (str);
+}
+
+static GTokenType
+parse_rule (GtkCssProvider *css_provider,
+ GScanner *scanner,
+ GError **error)
+{
+ GtkCssProviderPrivate *priv;
+ GTokenType expected_token;
+ SelectorPath *selector;
+
+ priv = css_provider->priv;
+
+ css_provider_push_scope (css_provider, SCOPE_SELECTOR);
+
+ /* Handle directives */
+ if (scanner->token == G_TOKEN_IDENTIFIER &&
+ scanner->value.v_identifier[0] == '@')
+ {
+ gchar *directive;
+
+ directive = &scanner->value.v_identifier[1];
+
+ if (strcmp (directive, "define-color") == 0)
+ {
+ GtkSymbolicColor *color;
+ gchar *color_name, *color_str;
+
+ /* Directive is a color mapping */
+ g_scanner_get_next_token (scanner);
+
+ if (scanner->token != G_TOKEN_IDENTIFIER)
+ {
+ scanner->user_data = "Color name";
+ return G_TOKEN_IDENTIFIER;
+ }
+
+ color_name = g_strdup (scanner->value.v_identifier);
+ css_provider_push_scope (css_provider, SCOPE_VALUE);
+ g_scanner_get_next_token (scanner);
+
+ if (scanner->token != G_TOKEN_IDENTIFIER)
+ {
+ scanner->user_data = "Color definition";
+ return G_TOKEN_IDENTIFIER;
+ }
+
+ color_str = g_strstrip (scanner->value.v_identifier);
+ color = symbolic_color_parse (color_str, error);
+
+ if (!color)
+ {
+ scanner->user_data = "Color definition";
+ return G_TOKEN_IDENTIFIER;
+ }
+
+ g_hash_table_insert (priv->symbolic_colors, color_name, color);
+
+ css_provider_pop_scope (css_provider);
+ g_scanner_get_next_token (scanner);
+
+ if (scanner->token != ';')
+ return ';';
+
+ return G_TOKEN_NONE;
+ }
+ else if (strcmp (directive, "import") == 0)
+ {
+ GScanner *scanner_backup;
+ GSList *state_backup;
+ gboolean loaded;
+ gchar *path = NULL;
+
+ css_provider_push_scope (css_provider, SCOPE_VALUE);
+ g_scanner_get_next_token (scanner);
+
+ if (scanner->token == G_TOKEN_IDENTIFIER &&
+ g_str_has_prefix (scanner->value.v_identifier, "url"))
+ path = path_parse (css_provider,
+ g_strstrip (scanner->value.v_identifier),
+ error);
+ else if (scanner->token == G_TOKEN_STRING)
+ path = path_parse (css_provider,
+ g_strstrip (scanner->value.v_string),
+ error);
+
+ if (path == NULL)
+ {
+ scanner->user_data = "File URL";
+ return G_TOKEN_IDENTIFIER;
+ }
+
+ css_provider_pop_scope (css_provider);
+ g_scanner_get_next_token (scanner);
+
+ if (scanner->token != ';')
+ {
+ g_free (path);
+ return ';';
+ }
+
+ /* Snapshot current parser state and scanner in order to restore after importing */
+ state_backup = priv->state;
+ scanner_backup = priv->scanner;
+
+ priv->state = NULL;
+ priv->scanner = create_scanner ();
+
+ /* FIXME: Avoid recursive importing */
+ loaded = gtk_css_provider_load_from_path_internal (css_provider, path,
+ FALSE, error);
+
+ /* Restore previous state */
+ css_provider_reset_parser (css_provider);
+ priv->state = state_backup;
+ g_scanner_destroy (priv->scanner);
+ priv->scanner = scanner_backup;
+
+ g_free (path);
+
+ if (!loaded)
+ {
+ scanner->user_data = "File URL";
+ return G_TOKEN_IDENTIFIER;
+ }
+ else
+ return G_TOKEN_NONE;
+ }
+ else
+ {
+ scanner->user_data = "Directive";
+ return G_TOKEN_IDENTIFIER;
+ }
+ }
+
+ expected_token = parse_selector (css_provider, scanner, &selector);
+
+ if (expected_token != G_TOKEN_NONE)
+ {
+ selector_path_unref (selector);
+ scanner->user_data = "Selector";
+ return expected_token;
+ }
+
+ priv->cur_selectors = g_slist_prepend (priv->cur_selectors, selector);
+
+ while (scanner->token == ',')
+ {
+ g_scanner_get_next_token (scanner);
+
+ expected_token = parse_selector (css_provider, scanner, &selector);
+
+ if (expected_token != G_TOKEN_NONE)
+ {
+ selector_path_unref (selector);
+ scanner->user_data = "Selector";
+ return expected_token;
+ }
+
+ priv->cur_selectors = g_slist_prepend (priv->cur_selectors, selector);
+ }
+
+ css_provider_pop_scope (css_provider);
+
+ if (scanner->token != G_TOKEN_LEFT_CURLY)
+ return G_TOKEN_LEFT_CURLY;
+
+ /* Declarations parsing */
+ css_provider_push_scope (css_provider, SCOPE_DECLARATION);
+ g_scanner_get_next_token (scanner);
+
+ while (scanner->token == G_TOKEN_IDENTIFIER)
+ {
+ gchar *value_str = NULL;
+ GtkStylePropertyParser parse_func = NULL;
+ GParamSpec *pspec;
+ gchar *prop;
+
+ prop = g_strdup (scanner->value.v_identifier);
+ g_scanner_get_next_token (scanner);
+
+ if (scanner->token != ':')
+ {
+ g_free (prop);
+ return ':';
+ }
+
+ priv->value_pos = priv->scanner->text;
+
+ css_provider_push_scope (css_provider, SCOPE_VALUE);
+ g_scanner_get_next_token (scanner);
+
+ if (scanner->token != G_TOKEN_IDENTIFIER)
+ {
+ g_free (prop);
+ scanner->user_data = "Property value";
+ return G_TOKEN_IDENTIFIER;
+ }
+
+ value_str = scanner->value.v_identifier;
+ SKIP_SPACES (value_str);
+ g_strchomp (value_str);
+
+ if (gtk_style_properties_lookup_property (prop, &parse_func, &pspec))
+ {
+ GValue *val;
+
+ val = g_slice_new0 (GValue);
+ g_value_init (val, pspec->value_type);
+
+ if (strcmp (value_str, "none") == 0)
+ {
+ /* Insert the default value, so it has an opportunity
+ * to override other style providers when merged
+ */
+ g_param_value_set_default (pspec, val);
+ g_hash_table_insert (priv->cur_properties, prop, val);
+ }
+ else if (pspec->value_type == G_TYPE_STRING)
+ {
+ g_value_set_string (val, value_str);
+ g_hash_table_insert (priv->cur_properties, prop, val);
+ }
+ else if ((parse_func && (parse_func) (value_str, val, error)) ||
+ (!parse_func && css_provider_parse_value (css_provider, value_str, val, error)))
+ g_hash_table_insert (priv->cur_properties, prop, val);
+ else
+ {
+ g_value_unset (val);
+ g_slice_free (GValue, val);
+ g_free (prop);
+
+ scanner->user_data = "Property value";
+ return G_TOKEN_IDENTIFIER;
+ }
+ }
+ else if (prop[0] == '-' &&
+ g_ascii_isupper (prop[1]))
+ {
+ GValue *val;
+
+ val = g_slice_new0 (GValue);
+ g_value_init (val, G_TYPE_STRING);
+ g_value_set_string (val, value_str);
+
+ g_hash_table_insert (priv->cur_properties, prop, val);
+ }
+ else
+ g_free (prop);
+
+ css_provider_pop_scope (css_provider);
+ g_scanner_get_next_token (scanner);
+
+ if (scanner->token != ';')
+ break;
+
+ g_scanner_get_next_token (scanner);
+ }
+
+ if (scanner->token != G_TOKEN_RIGHT_CURLY)
+ return G_TOKEN_RIGHT_CURLY;
+
+ css_provider_pop_scope (css_provider);
+
+ return G_TOKEN_NONE;
+}
+
+static gboolean
+parse_stylesheet (GtkCssProvider *css_provider,
+ GError **error)
+{
+ GtkCssProviderPrivate *priv;
+
+ priv = css_provider->priv;
+ g_scanner_get_next_token (priv->scanner);
+
+ while (!g_scanner_eof (priv->scanner))
+ {
+ GTokenType expected_token;
+ GError *err = NULL;
+
+ css_provider_reset_parser (css_provider);
+ expected_token = parse_rule (css_provider, priv->scanner, &err);
+
+ if (expected_token != G_TOKEN_NONE)
+ {
+ scanner_report_warning (css_provider, expected_token, err);
+
+ while (!g_scanner_eof (priv->scanner) &&
+ priv->scanner->token != G_TOKEN_RIGHT_CURLY)
+ g_scanner_get_next_token (priv->scanner);
+ }
+ else
+ css_provider_commit (css_provider);
+
+ g_clear_error (&err);
+ g_scanner_get_next_token (priv->scanner);
+ }
+
+ return TRUE;
+}
+
+/**
+ * gtk_css_provider_load_from_data:
+ * @css_provider: a #GtkCssProvider
+ * @data: CSS data loaded in memory
+ * @length: the length of @data in bytes, or -1 for NUL terminated strings
+ * @error: (out) (allow-none): return location for a #GError, or %NULL
+ *
+ * Loads @data into @css_provider, making it clear any previously loaded
+ * information.
+ *
+ * Returns: %TRUE if the data could be loaded.
+ **/
+gboolean
+gtk_css_provider_load_from_data (GtkCssProvider *css_provider,
+ const gchar *data,
+ gssize length,
+ GError **error)
+{
+ GtkCssProviderPrivate *priv;
+
+ g_return_val_if_fail (GTK_IS_CSS_PROVIDER (css_provider), FALSE);
+ g_return_val_if_fail (data != NULL, FALSE);
+
+ priv = css_provider->priv;
+
+ if (length < 0)
+ length = strlen (data);
+
+ if (priv->selectors_info->len > 0)
+ g_ptr_array_remove_range (priv->selectors_info, 0, priv->selectors_info->len);
+
+ priv->scanner->input_name = "-";
+ priv->buffer = data;
+ g_scanner_input_text (priv->scanner, data, (guint) length);
+
+ g_free (priv->filename);
+ priv->filename = NULL;
+ priv->buffer = NULL;
+
+ return parse_stylesheet (css_provider, error);
+}
+
+/**
+ * gtk_css_provider_load_from_file:
+ * @css_provider: a #GtkCssProvider
+ * @file: #GFile pointing to a file to load
+ * @error: (out) (allow-none): return location for a #GError, or %NULL
+ *
+ * Loads the data contained in @file into @css_provider, making it
+ * clear any previously loaded information.
+ *
+ * Returns: %TRUE if the data could be loaded.
+ **/
+gboolean
+gtk_css_provider_load_from_file (GtkCssProvider *css_provider,
+ GFile *file,
+ GError **error)
+{
+ GtkCssProviderPrivate *priv;
+ GError *internal_error = NULL;
+ gchar *data;
+ gsize length;
+ gboolean ret;
+
+ g_return_val_if_fail (GTK_IS_CSS_PROVIDER (css_provider), FALSE);
+ g_return_val_if_fail (G_IS_FILE (file), FALSE);
+
+ priv = css_provider->priv;
+
+ if (!g_file_load_contents (file, NULL,
+ &data, &length,
+ NULL, &internal_error))
+ {
+ g_propagate_error (error, internal_error);
+ return FALSE;
+ }
+
+ if (priv->selectors_info->len > 0)
+ g_ptr_array_remove_range (priv->selectors_info, 0, priv->selectors_info->len);
+
+ g_free (priv->filename);
+ priv->filename = g_file_get_path (file);
+
+ priv->scanner->input_name = priv->filename;
+ priv->buffer = data;
+ g_scanner_input_text (priv->scanner, data, (guint) length);
+
+ ret = parse_stylesheet (css_provider, error);
+
+ priv->buffer = NULL;
+ g_free (data);
+
+ return ret;
+}
+
+static gboolean
+gtk_css_provider_load_from_path_internal (GtkCssProvider *css_provider,
+ const gchar *path,
+ gboolean reset,
+ GError **error)
+{
+ GtkCssProviderPrivate *priv;
+ GError *internal_error = NULL;
+ GMappedFile *mapped_file;
+ const gchar *data;
+ gsize length;
+ gboolean ret;
+
+ priv = css_provider->priv;
+
+ mapped_file = g_mapped_file_new (path, FALSE, &internal_error);
+
+ if (internal_error)
+ {
+ g_propagate_error (error, internal_error);
+ return FALSE;
+ }
+
+ length = g_mapped_file_get_length (mapped_file);
+ data = g_mapped_file_get_contents (mapped_file);
+
+ if (!data)
+ data = "";
+
+ if (reset)
+ {
+ if (priv->selectors_info->len > 0)
+ g_ptr_array_remove_range (priv->selectors_info, 0, priv->selectors_info->len);
+
+ g_free (priv->filename);
+ priv->filename = g_strdup (path);
+ }
+
+ priv->scanner->input_name = priv->filename;
+ priv->buffer = data;
+ g_scanner_input_text (priv->scanner, data, (guint) length);
+
+ ret = parse_stylesheet (css_provider, error);
+
+ priv->buffer = NULL;
+ g_mapped_file_unref (mapped_file);
+
+ return ret;
+}
+
+/**
+ * gtk_css_provider_load_from_path:
+ * @css_provider: a #GtkCssProvider
+ * @path: the path of a filename to load, in the GLib filename encoding
+ * @error: (out) (allow-none): return location for a #GError, or %NULL
+ *
+ * Loads the data contained in @path into @css_provider, making it clear
+ * any previously loaded information.
+ *
+ * Returns: %TRUE if the data could be loaded.
+ **/
+gboolean
+gtk_css_provider_load_from_path (GtkCssProvider *css_provider,
+ const gchar *path,
+ GError **error)
+{
+ g_return_val_if_fail (GTK_IS_CSS_PROVIDER (css_provider), FALSE);
+ g_return_val_if_fail (path != NULL, FALSE);
+
+ return gtk_css_provider_load_from_path_internal (css_provider, path,
+ TRUE, error);
+}
+
+/**
+ * gtk_css_provider_get_default:
+ *
+ * Returns the provider containing the style settings used as a
+ * fallback for all widgets.
+ *
+ * Returns: (transfer none): The provider used for fallback styling.
+ * This memory is owned by GTK+, and you must not free it.
+ **/
+GtkCssProvider *
+gtk_css_provider_get_default (void)
+{
+ static GtkCssProvider *provider;
+
+ if (G_UNLIKELY (!provider))
+ {
+ const gchar *str =
+ "@define-color fg_color #000; \n"
+ "@define-color bg_color #dcdad5; \n"
+ "@define-color text_color #000; \n"
+ "@define-color base_color #fff; \n"
+ "@define-color selected_bg_color #4b6983; \n"
+ "@define-color selected_fg_color #fff; \n"
+ "@define-color tooltip_bg_color #eee1b3; \n"
+ "@define-color tooltip_fg_color #000; \n"
+ "\n"
+ "*,\n"
+ "GtkTreeView > GtkButton {\n"
+ " background-color: @bg_color;\n"
+ " color: @fg_color;\n"
+ " border-color: shade (@bg_color, 0.6);\n"
+ " padding: 2;\n"
+ " border-width: 0;\n"
+ "}\n"
+ "\n"
+ "*:prelight {\n"
+ " background-color: shade (@bg_color, 1.05);\n"
+ " color: shade (@fg_color, 1.3);\n"
+ "}\n"
+ "\n"
+ "*:selected {\n"
+ " background-color: @selected_bg_color;\n"
+ " color: @selected_fg_color;\n"
+ "}\n"
+ "\n"
+ ".expander:prelight {\n"
+ " color: @selected_fg_color\n"
+ "}\n"
+ "\n"
+ "*:insensitive {\n"
+ " border-color: shade (@bg_color, 0.7);\n"
+ " background-color: shade (@bg_color, 0.9);\n"
+ " color: shade (@bg_color, 0.7);\n"
+ "}\n"
+ "\n"
+ "GtkTreeView, GtkIconView, GtkTextView {\n"
+ " background-color: @base_color;\n"
+ " color: @text_color;\n"
+ "}\n"
+ "\n"
+ "GtkTreeView > row {\n"
+ " background-color: @base_color;\n"
+ " color: @text_color;\n"
+ "}\n"
+ "\n"
+ "GtkTreeView > row:nth-child(odd) { \n"
+ " background-color: shade (@base_color, 0.93); \n"
+ "}\n"
+ "\n"
+ ".tooltip {\n"
+ " background-color: @tooltip_bg_color; \n"
+ " color: @tooltip_fg_color; \n"
+ "}\n"
+ "\n"
+ ".button,\n"
+ ".slider {\n"
+ " border-style: outset; \n"
+ " border-width: 2; \n"
+ "}\n"
+ "\n"
+ ".button:active {\n"
+ " background-color: shade (@bg_color, 0.7);\n"
+ " border-style: inset; \n"
+ "}\n"
+ "\n"
+ ".button:prelight,\n"
+ ".slider:prelight {\n"
+ " background-color: @selected_bg_color;\n"
+ " color: @selected_fg_color;\n"
+ " border-color: shade (@selected_bg_color, 0.7);\n"
+ "}\n"
+ "\n"
+ ".trough {\n"
+ " border-style: inset;\n"
+ " border-width: 1;\n"
+ "}\n"
+ "\n"
+ ".entry {\n"
+ " border-style: inset;\n"
+ " border-width: 2;\n"
+ " background-color: @base_color;\n"
+ " color: @text_color;\n"
+ "}\n"
+ "\n"
+ ".entry:insensitive {\n"
+ " background-color: shade (@base_color, 0.9);\n"
+ " color: shade (@base_color, 0.7);\n"
+ "}\n"
+ ".entry:active {\n"
+ " background-color: #c4c2bd;\n"
+ " color: #000;\n"
+ "}\n"
+ "\n"
+ ".progressbar:prelight,\n"
+ ".entry.progressbar {\n"
+ " background-color: @selected_bg_color;\n"
+ " border-color: shade (@selected_bg_color, 0.7);\n"
+ " color: @selected_fg_color;\n"
+ "}\n"
+ "\n"
+ "GtkCheckButton:hover,\n"
+ "GtkCheckButton:selected,\n"
+ "GtkRadioButton:hover,\n"
+ "GtkRadioButton:selected {\n"
+ " background-color: shade (@bg_color, 1.05);\n"
+ "}\n"
+ "\n"
+ ".check, .radio,\n"
+ ".check:active, .radio:active,\n"
+ ".check:hover, .radio:hover {\n"
+ " background-color: @base_color;\n"
+ " border-color: @fg_color;\n"
+ " color: @text_color;\n"
+ " border-style: solid;\n"
+ " border-width: 1;\n"
+ "}\n"
+ "\n"
+ ".check:selected, .radio:selected {\n"
+ " background-color: @selected_bg_color;\n"
+ " color: @selected_fg_color;\n"
+ "}\n"
+ "\n"
+ ".menu.check, .menu.radio {\n"
+ " color: @fg_color;\n"
+ "}\n"
+ "\n"
+ ".menu:hover {\n"
+ " background-color: @selected_bg_color;\n"
+ " border-style: none;\n"
+ "}\n"
+ "\n"
+ ".popup {\n"
+ " border-style: outset;\n"
+ " border-width: 1;\n"
+ "}\n"
+ "\n"
+ ".viewport {\n"
+ " border-style: inset;\n"
+ " border-width: 2;\n"
+ "}\n"
+ "\n"
+ ".notebook {\n"
+ " border-style: outset;\n"
+ " border-width: 1;\n"
+ "}\n"
+ "\n"
+ ".frame {\n"
+ " border-style: inset;\n"
+ " border-width: 1;\n"
+ "}\n"
+ "\n"
+ ".menu,\n"
+ ".menubar,\n"
+ ".toolbar {\n"
+ " border-style: outset;\n"
+ " border-width: 1;\n"
+ "}\n"
+ "\n"
+ ".menu:hover,\n"
+ ".menubar:hover {\n"
+ " background-color: @selected_bg_color;\n"
+ " color: @selected_fg_color;\n"
+ "}\n"
+ "\n"
+ ".menu .check,\n"
+ ".menu .radio,\n"
+ ".menu .check:active,\n"
+ ".menu .radio:active {\n"
+ " border-style: none;\n"
+ "}\n"
+ "\n"
+ "GtkSpinButton.button {\n"
+ " border-width: 1;\n"
+ "}\n"
+ "\n"
+ ".scale.slider:hover,\n"
+ "GtkSpinButton.button:hover {\n"
+ " background-color: shade (@bg_color, 1.05);\n"
+ " border-color: shade (@bg_color, 0.8);\n"
+ "}\n"
+ "\n"
+ "GtkToggleButton.button:inconsistent {\n"
+ " border-style: outset;\n"
+ " border-width: 1px;\n"
+ " background-color: shade (@bg_color, 0.9);\n"
+ " border-color: shade (@bg_color, 0.7);\n"
+ "}\n"
+ "\n"
+ "GtkLabel:selected {\n"
+ " background-color: shade (@bg_color, 0.9);\n"
+ " color: @fg_color;\n"
+ "}\n"
+ "\n"
+ "GtkLabel:selected:focused {\n"
+ " background-color: @selected_bg_color;\n"
+ " color: @selected_fg_color;\n"
+ "}\n"
+ "\n"
+ ".spinner:active {\n"
+ " transition: 750ms linear loop;\n"
+ "}\n"
+ "\n";
+
+ provider = gtk_css_provider_new ();
+ gtk_css_provider_load_from_data (provider, str, -1, NULL);
+ }
+
+ return provider;
+}
+
+static gchar *
+css_provider_get_theme_dir (void)
+{
+ const gchar *var;
+ gchar *path;
+
+ var = g_getenv ("GTK_DATA_PREFIX");
+
+ if (var)
+ path = g_build_filename (var, "share", "themes", NULL);
+ else
+ path = g_build_filename (GTK_DATA_PREFIX, "share", "themes", NULL);
+
+ return path;
+}
+
+/**
+ * gtk_css_provider_get_named:
+ * @name: A theme name
+ * @variant: variant to load, for example, "dark", or %NULL for the default
+ *
+ * Loads a theme from the usual theme paths
+ *
+ * Returns: (transfer none): a #GtkCssProvider with the theme loaded.
+ * This memory is owned by GTK+, and you must not free it.
+ **/
+GtkCssProvider *
+gtk_css_provider_get_named (const gchar *name,
+ const gchar *variant)
+{
+ static GHashTable *themes = NULL;
+ GtkCssProvider *provider;
+
+ if (G_UNLIKELY (!themes))
+ themes = g_hash_table_new (g_str_hash, g_str_equal);
+
+ provider = g_hash_table_lookup (themes, name);
+
+ if (!provider)
+ {
+ const gchar *home_dir;
+ gchar *subpath, *path = NULL;
+
+ if (variant)
+ subpath = g_strdup_printf ("gtk-3.0" G_DIR_SEPARATOR_S "gtk-%s.css", variant);
+ else
+ subpath = g_strdup ("gtk-3.0" G_DIR_SEPARATOR_S "gtk.css");
+
+ /* First look in the users home directory
+ */
+ home_dir = g_get_home_dir ();
+ if (home_dir)
+ {
+ path = g_build_filename (home_dir, ".themes", name, subpath, NULL);
+
+ if (!g_file_test (path, G_FILE_TEST_EXISTS))
+ {
+ g_free (path);
+ path = NULL;
+ }
+ }
+
+ if (!path)
+ {
+ gchar *theme_dir = css_provider_get_theme_dir ();
+ path = g_build_filename (theme_dir, name, subpath, NULL);
+ g_free (theme_dir);
+
+ if (!g_file_test (path, G_FILE_TEST_EXISTS))
+ {
+ g_free (path);
+ path = NULL;
+ }
+ }
+
+ if (path)
+ {
+ GError *error = NULL;
+
+ provider = gtk_css_provider_new ();
+ gtk_css_provider_load_from_path (provider, path, &error);
+
+ if (error)
+ {
+ g_warning ("Could not load named theme \"%s\": %s", name, error->message);
+ g_error_free (error);
+
+ g_object_unref (provider);
+ provider = NULL;
+ }
+ else
+ g_hash_table_insert (themes, g_strdup (name), provider);
+ }
+ }
+
+ return provider;
+}
diff --git a/gtk/gtkcssprovider.h b/gtk/gtkcssprovider.h
new file mode 100644
index 0000000000..836abb01df
--- /dev/null
+++ b/gtk/gtkcssprovider.h
@@ -0,0 +1,79 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GTK_CSS_PROVIDER_H__
+#define __GTK_CSS_PROVIDER_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_CSS_PROVIDER (gtk_css_provider_get_type ())
+#define GTK_CSS_PROVIDER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_CSS_PROVIDER, GtkCssProvider))
+#define GTK_CSS_PROVIDER_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GTK_TYPE_CSS_PROVIDER, GtkCssProviderClass))
+#define GTK_IS_CSS_PROVIDER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_CSS_PROVIDER))
+#define GTK_IS_CSS_PROVIDER_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GTK_TYPE_CSS_PROVIDER))
+#define GTK_CSS_PROVIDER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_CSS_PROVIDER, GtkCssProviderClass))
+
+#define GTK_CSS_PROVIDER_ERROR (gtk_css_provider_error_quark ())
+
+typedef enum
+{
+ GTK_CSS_PROVIDER_ERROR_FAILED
+} GtkCssProviderError;
+
+GQuark gtk_css_provider_error_quark (void);
+
+typedef struct _GtkCssProvider GtkCssProvider;
+typedef struct _GtkCssProviderClass GtkCssProviderClass;
+
+struct _GtkCssProvider
+{
+ GObject parent_instance;
+ gpointer priv;
+};
+
+struct _GtkCssProviderClass
+{
+ GObjectClass parent_class;
+};
+
+GType gtk_css_provider_get_type (void) G_GNUC_CONST;
+
+GtkCssProvider * gtk_css_provider_new (void);
+
+gboolean gtk_css_provider_load_from_data (GtkCssProvider *css_provider,
+ const gchar *data,
+ gssize length,
+ GError **error);
+gboolean gtk_css_provider_load_from_file (GtkCssProvider *css_provider,
+ GFile *file,
+ GError **error);
+gboolean gtk_css_provider_load_from_path (GtkCssProvider *css_provider,
+ const gchar *path,
+ GError **error);
+
+GtkCssProvider * gtk_css_provider_get_default (void);
+
+GtkCssProvider * gtk_css_provider_get_named (const gchar *name,
+ const gchar *variant);
+
+G_END_DECLS
+
+#endif /* __GTK_CSS_PROVIDER_H__ */
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index cd70918e1e..2e584762e0 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -3419,8 +3419,7 @@ gtk_entry_draw_frame (GtkWidget *widget,
}
style = gtk_widget_get_style (widget);
- state = gtk_widget_has_focus (widget) ?
- GTK_STATE_ACTIVE : gtk_widget_get_state (widget);
+ state = gtk_widget_get_state (widget);
gtk_paint_flat_box (style, cr,
state, GTK_SHADOW_NONE,
@@ -6617,7 +6616,7 @@ gtk_entry_ensure_pixbuf (GtkEntry *entry,
GtkIconInfo *info;
GtkIconTheme *icon_theme;
GtkSettings *settings;
- GtkStateType state;
+ GtkStateFlags state;
GtkWidget *widget;
GdkScreen *screen;
gint width, height;
@@ -6633,8 +6632,8 @@ gtk_entry_ensure_pixbuf (GtkEntry *entry,
case GTK_IMAGE_PIXBUF:
break;
case GTK_IMAGE_STOCK:
- state = gtk_widget_get_state (widget);
- gtk_widget_set_state (widget, GTK_STATE_NORMAL);
+ state = gtk_widget_get_state_flags (widget);
+ gtk_widget_set_state_flags (widget, 0, TRUE);
icon_info->pixbuf = gtk_widget_render_icon (widget,
icon_info->stock_id,
GTK_ICON_SIZE_MENU,
@@ -6644,7 +6643,7 @@ gtk_entry_ensure_pixbuf (GtkEntry *entry,
GTK_STOCK_MISSING_IMAGE,
GTK_ICON_SIZE_MENU,
NULL);
- gtk_widget_set_state (widget, state);
+ gtk_widget_set_state_flags (widget, state, TRUE);
break;
case GTK_IMAGE_ICON_NAME:
@@ -6665,13 +6664,13 @@ gtk_entry_ensure_pixbuf (GtkEntry *entry,
if (icon_info->pixbuf == NULL)
{
- state = gtk_widget_get_state (widget);
- gtk_widget_set_state (widget, GTK_STATE_NORMAL);
+ state = gtk_widget_get_state_flags (widget);
+ gtk_widget_set_state_flags (widget, 0, TRUE);
icon_info->pixbuf = gtk_widget_render_icon (widget,
GTK_STOCK_MISSING_IMAGE,
GTK_ICON_SIZE_MENU,
NULL);
- gtk_widget_set_state (widget, state);
+ gtk_widget_set_state_flags (widget, state, TRUE);
}
}
break;
@@ -6699,13 +6698,13 @@ gtk_entry_ensure_pixbuf (GtkEntry *entry,
if (icon_info->pixbuf == NULL)
{
- state = gtk_widget_get_state (widget);
- gtk_widget_set_state (widget, GTK_STATE_NORMAL);
+ state = gtk_widget_get_state_flags (widget);
+ gtk_widget_set_state_flags (widget, 0, TRUE);
icon_info->pixbuf = gtk_widget_render_icon (widget,
GTK_STOCK_MISSING_IMAGE,
GTK_ICON_SIZE_MENU,
NULL);
- gtk_widget_set_state (widget, state);
+ gtk_widget_set_state_flags (widget, state, TRUE);
}
}
break;
diff --git a/gtk/gtkenums.h b/gtk/gtkenums.h
index e7dd7f56c9..8a100aad0f 100644
--- a/gtk/gtkenums.h
+++ b/gtk/gtkenums.h
@@ -361,13 +361,36 @@ typedef enum
} GtkShadowType;
/* Widget states */
+
+/**
+ * GtkStateType:
+ *
+ * This type indicates the current state of a widget; the state determines how
+ * the widget is drawn. The #GtkStateType enumeration is also used to
+ * identify different colors in a #GtkStyle for drawing, so states can be
+ * used for subparts of a widget as well as entire widgets.
+ *
+ * @GTK_STATE_NORMAL: State during normal operation.
+ * @GTK_STATE_ACTIVE: State of a currently active widget, such as a depressed button.
+ * @GTK_STATE_PRELIGHT: State indicating that the mouse pointer is over
+ * the widget and the widget will respond to mouse clicks.
+ * @GTK_STATE_SELECTED: State of a selected item, such the selected row in a list.
+ * @GTK_STATE_INSENSITIVE: State indicating that the widget is
+ * unresponsive to user actions.
+ * @GTK_STATE_INCONSISTENT: The widget is inconsistent, such as checkbuttons
+ * or radiobuttons that aren't either set to %TRUE nor %FALSE,
+ * or buttons requiring the user attention.
+ * @GTK_STATE_FOCUSED: The widget has the keyboard focus.
+ */
typedef enum
{
GTK_STATE_NORMAL,
GTK_STATE_ACTIVE,
GTK_STATE_PRELIGHT,
GTK_STATE_SELECTED,
- GTK_STATE_INSENSITIVE
+ GTK_STATE_INSENSITIVE,
+ GTK_STATE_INCONSISTENT,
+ GTK_STATE_FOCUSED
} GtkStateType;
/* Style for toolbars */
@@ -557,6 +580,87 @@ typedef enum
GTK_SCROLL_NATURAL
} GtkScrollablePolicy;
+/**
+ * GtkStateFlags:
+ * @GTK_STATE_FLAG_ACTIVE: Widget is active.
+ * @GTK_STATE_FLAG_PRELIGHT: Widget has a mouse pointer over it.
+ * @GTK_STATE_FLAG_SELECTED: Widget is selected.
+ * @GTK_STATE_FLAG_INSENSITIVE: Widget is insensitive.
+ * @GTK_STATE_FLAG_INCONSISTENT: Widget is inconsistent.
+ * @GTK_STATE_FLAG_FOCUSED: Widget has the keyboard focus.
+ *
+ * Describes a widget state.
+ */
+typedef enum
+{
+ GTK_STATE_FLAG_ACTIVE = 1 << 0,
+ GTK_STATE_FLAG_PRELIGHT = 1 << 1,
+ GTK_STATE_FLAG_SELECTED = 1 << 2,
+ GTK_STATE_FLAG_INSENSITIVE = 1 << 3,
+ GTK_STATE_FLAG_INCONSISTENT = 1 << 4,
+ GTK_STATE_FLAG_FOCUSED = 1 << 5
+} GtkStateFlags;
+
+/**
+ * GtkRegionFlags:
+ * @GTK_REGION_EVEN: Region has an even number within a set.
+ * @GTK_REGION_ODD: Region has an odd number within a set.
+ * @GTK_REGION_FIRST: Region is the first one within a set.
+ * @GTK_REGION_LAST: Region is the last one within a set.
+ * @GTK_REGION_SORTED: Region is part of a sorted area.
+ *
+ * Describes a region within a widget.
+ */
+typedef enum {
+ GTK_REGION_EVEN = 1 << 0,
+ GTK_REGION_ODD = 1 << 1,
+ GTK_REGION_FIRST = 1 << 2,
+ GTK_REGION_LAST = 1 << 3,
+ GTK_REGION_SORTED = 1 << 5
+} GtkRegionFlags;
+
+/**
+ * GtkJunctionSides:
+ * @GTK_JUNCTION_NONE: No junctions.
+ * @GTK_JUNCTION_CORNER_TOPLEFT: Element connects on the top-left corner.
+ * @GTK_JUNCTION_CORNER_TOPRIGHT: Element connects on the top-right corner.
+ * @GTK_JUNCTION_CORNER_BOTTOMLEFT: Element connects on the bottom-left corner.
+ * @GTK_JUNCTION_CORNER_BOTTOMRIGHT: Element connects on the bottom-right corner.
+ * @GTK_JUNCTION_TOP: Element connects on the top side.
+ * @GTK_JUNCTION_BOTTOM: Element connects on the bottom side.
+ * @GTK_JUNCTION_LEFT: Element connects on the left side.
+ * @GTK_JUNCTION_RIGHT: Element connects on the right side.
+ *
+ * Describes how a rendered element connects to adjacent elements.
+ */
+typedef enum {
+ GTK_JUNCTION_NONE = 0,
+ GTK_JUNCTION_CORNER_TOPLEFT = 1 << 0,
+ GTK_JUNCTION_CORNER_TOPRIGHT = 1 << 1,
+ GTK_JUNCTION_CORNER_BOTTOMLEFT = 1 << 2,
+ GTK_JUNCTION_CORNER_BOTTOMRIGHT = 1 << 3,
+ GTK_JUNCTION_TOP = (GTK_JUNCTION_CORNER_TOPLEFT | GTK_JUNCTION_CORNER_TOPRIGHT),
+ GTK_JUNCTION_BOTTOM = (GTK_JUNCTION_CORNER_BOTTOMLEFT | GTK_JUNCTION_CORNER_BOTTOMRIGHT),
+ GTK_JUNCTION_LEFT = (GTK_JUNCTION_CORNER_TOPLEFT | GTK_JUNCTION_CORNER_BOTTOMLEFT),
+ GTK_JUNCTION_RIGHT = (GTK_JUNCTION_CORNER_TOPRIGHT | GTK_JUNCTION_CORNER_BOTTOMRIGHT)
+} GtkJunctionSides;
+
+/**
+ * GtkBorderStyle:
+ * @GTK_BORDER_STYLE_NONE: No visible border
+ * @GTK_BORDER_STYLE_SOLID: A solid border
+ * @GTK_BORDER_STYLE_INSET: An inset border
+ * @GTK_BORDER_STYLE_OUTSET: An outset border
+ *
+ * Describes how the border of a UI element should be rendered.
+ */
+typedef enum {
+ GTK_BORDER_STYLE_NONE,
+ GTK_BORDER_STYLE_SOLID,
+ GTK_BORDER_STYLE_INSET,
+ GTK_BORDER_STYLE_OUTSET
+} GtkBorderStyle;
+
G_END_DECLS
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c
index 53eae8cfaa..236ff279f6 100644
--- a/gtk/gtkexpander.c
+++ b/gtk/gtkexpander.c
@@ -977,7 +977,9 @@ gtk_expander_enter_notify (GtkWidget *widget,
expander->priv->prelight = TRUE;
if (expander->priv->label_widget)
- gtk_widget_set_state (expander->priv->label_widget, GTK_STATE_PRELIGHT);
+ gtk_widget_set_state_flags (expander->priv->label_widget,
+ GTK_STATE_FLAG_PRELIGHT,
+ FALSE);
gtk_expander_redraw_expander (expander);
}
@@ -997,7 +999,8 @@ gtk_expander_leave_notify (GtkWidget *widget,
expander->priv->prelight = FALSE;
if (expander->priv->label_widget)
- gtk_widget_set_state (expander->priv->label_widget, GTK_STATE_NORMAL);
+ gtk_widget_unset_state_flags (expander->priv->label_widget,
+ GTK_STATE_FLAG_PRELIGHT);
gtk_expander_redraw_expander (expander);
}
@@ -1913,7 +1916,7 @@ gtk_expander_set_label_widget (GtkExpander *expander,
if (priv->label_widget)
{
- gtk_widget_set_state (priv->label_widget, GTK_STATE_NORMAL);
+ gtk_widget_set_state_flags (priv->label_widget, 0, TRUE);
gtk_widget_unparent (priv->label_widget);
}
@@ -1927,7 +1930,9 @@ gtk_expander_set_label_widget (GtkExpander *expander,
gtk_widget_set_parent (label_widget, widget);
if (priv->prelight)
- gtk_widget_set_state (label_widget, GTK_STATE_PRELIGHT);
+ gtk_widget_set_state_flags (label_widget,
+ GTK_STATE_FLAG_PRELIGHT,
+ FALSE);
}
if (gtk_widget_get_visible (widget))
diff --git a/gtk/gtkgradient.c b/gtk/gtkgradient.c
new file mode 100644
index 0000000000..a19b8fe583
--- /dev/null
+++ b/gtk/gtkgradient.c
@@ -0,0 +1,282 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+#include "gtkgradient.h"
+#include "gtkstyleproperties.h"
+#include "gtkintl.h"
+
+/**
+ * SECTION:gtkgradient
+ * @Short_description: Gradients
+ * @Title: GtkGradient
+ *
+ * GtkGradient is a boxed type that represents a gradient.
+ * It is the result of parsing a
+ * <link linkend="gtkcssprovider-gradients">gradient expression</link>.
+ * To obtain the gradient represented by a GtkGradient, it has to
+ * be resolved with gtk_gradient_resolve(), which replaces all
+ * symbolic color references by the colors they refer to (in a given
+ * context) and constructs a #cairo_pattern_t value.
+ *
+ * It is not normally necessary to deal directly with #GtkGradients,
+ * since they are mostly used behind the scenes by #GtkStyleContext and
+ * #GtkCssProvider.
+ */
+
+G_DEFINE_BOXED_TYPE (GtkGradient, gtk_gradient,
+ gtk_gradient_ref, gtk_gradient_unref)
+
+typedef struct ColorStop ColorStop;
+
+struct ColorStop
+{
+ gdouble offset;
+ GtkSymbolicColor *color;
+};
+
+struct _GtkGradient
+{
+ gdouble x0;
+ gdouble y0;
+ gdouble x1;
+ gdouble y1;
+ gdouble radius0;
+ gdouble radius1;
+
+ GArray *stops;
+
+ guint ref_count;
+};
+
+/**
+ * gtk_gradient_new_linear:
+ * @x0: X coordinate of the starting point
+ * @y0: Y coordinate of the starting point
+ * @x1: X coordinate of the end point
+ * @y1: Y coordinate of the end point
+ *
+ * Creates a new linear gradient along the line defined by (x0, y0) and (x1, y1). Before using the gradient
+ * a number of stop colors must be added through gtk_gradient_add_color_stop().
+ *
+ * Returns: A newly created #GtkGradient
+ *
+ * Since: 3.0
+ **/
+GtkGradient *
+gtk_gradient_new_linear (gdouble x0,
+ gdouble y0,
+ gdouble x1,
+ gdouble y1)
+{
+ GtkGradient *gradient;
+
+ gradient = g_slice_new (GtkGradient);
+ gradient->stops = g_array_new (FALSE, FALSE, sizeof (ColorStop));
+
+ gradient->x0 = x0;
+ gradient->y0 = y0;
+ gradient->x1 = x1;
+ gradient->y1 = y1;
+ gradient->radius0 = 0;
+ gradient->radius1 = 0;
+
+ gradient->ref_count = 1;
+
+ return gradient;
+}
+
+/**
+ * gtk_gradient_new_radial:
+ * @x0: X coordinate of the start circle
+ * @y0: Y coordinate of the start circle
+ * @radius0: radius of the start circle
+ * @x1: X coordinate of the end circle
+ * @y1: Y coordinate of the end circle
+ * @radius1: radius of the end circle
+ *
+ * Creates a new radial gradient along the two circles defined by (x0, y0, radius0) and
+ * (x1, y1, radius1). Before using the gradient a number of stop colors must be added
+ * through gtk_gradient_add_color_stop().
+ *
+ * Returns: A newly created #GtkGradient
+ *
+ * Since: 3.0
+ **/
+GtkGradient *
+gtk_gradient_new_radial (gdouble x0,
+ gdouble y0,
+ gdouble radius0,
+ gdouble x1,
+ gdouble y1,
+ gdouble radius1)
+{
+ GtkGradient *gradient;
+
+ gradient = g_slice_new (GtkGradient);
+ gradient->stops = g_array_new (FALSE, FALSE, sizeof (ColorStop));
+
+ gradient->x0 = x0;
+ gradient->y0 = y0;
+ gradient->x1 = x1;
+ gradient->y1 = y1;
+ gradient->radius0 = radius0;
+ gradient->radius1 = radius1;
+
+ gradient->ref_count = 1;
+
+ return gradient;
+}
+
+/**
+ * gtk_gradient_add_color_stop:
+ * @gradient: a #GtkGradient
+ * @offset: offset for the color stop
+ * @color: color to use
+ *
+ * Adds a stop color to @gradient.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_gradient_add_color_stop (GtkGradient *gradient,
+ gdouble offset,
+ GtkSymbolicColor *color)
+{
+ ColorStop stop;
+
+ g_return_if_fail (gradient != NULL);
+
+ stop.offset = offset;
+ stop.color = gtk_symbolic_color_ref (color);
+
+ g_array_append_val (gradient->stops, stop);
+}
+
+/**
+ * gtk_gradient_ref:
+ * @gradient: a #GtkGradient
+ *
+ * Increases the reference count of @gradient.
+ *
+ * Returns: The same @gradient
+ *
+ * Since: 3.0
+ **/
+GtkGradient *
+gtk_gradient_ref (GtkGradient *gradient)
+{
+ g_return_val_if_fail (gradient != NULL, NULL);
+
+ gradient->ref_count++;
+
+ return gradient;
+}
+
+/**
+ * gtk_gradient_unref:
+ * @gradient: a #GtkGradient
+ *
+ * Decreases the reference count of @gradient, freeing its memory
+ * if the reference count reaches 0.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_gradient_unref (GtkGradient *gradient)
+{
+ g_return_if_fail (gradient != NULL);
+
+ gradient->ref_count--;
+
+ if (gradient->ref_count == 0)
+ {
+ guint i;
+
+ for (i = 0; i < gradient->stops->len; i++)
+ {
+ ColorStop *stop;
+
+ stop = &g_array_index (gradient->stops, ColorStop, i);
+ gtk_symbolic_color_unref (stop->color);
+ }
+
+ g_array_free (gradient->stops, TRUE);
+ g_slice_free (GtkGradient, gradient);
+ }
+}
+
+/**
+ * gtk_gradient_resolve:
+ * @gradient: a #GtkGradient
+ * @props: #GtkStyleProperties to use when resolving named colors
+ * @resolved_gradient: (out): return location for the resolved pattern
+ *
+ * If @gradient is resolvable, @resolved_gradient will be filled in
+ * with the resolved gradient as a cairo_pattern_t, and %TRUE will
+ * be returned. Generally, if @gradient can't be resolved, it is
+ * due to it being defined on top of a named color that doesn't
+ * exist in @props.
+ *
+ * Returns: %TRUE if the gradient has been resolved
+ *
+ * Since: 3.0
+ **/
+gboolean
+gtk_gradient_resolve (GtkGradient *gradient,
+ GtkStyleProperties *props,
+ cairo_pattern_t **resolved_gradient)
+{
+ cairo_pattern_t *pattern;
+ guint i;
+
+ g_return_val_if_fail (gradient != NULL, FALSE);
+ g_return_val_if_fail (GTK_IS_STYLE_PROPERTIES (props), FALSE);
+ g_return_val_if_fail (resolved_gradient != NULL, FALSE);
+
+ if (gradient->radius0 == 0 && gradient->radius1 == 0)
+ pattern = cairo_pattern_create_linear (gradient->x0, gradient->y0,
+ gradient->x1, gradient->y1);
+ else
+ pattern = cairo_pattern_create_radial (gradient->x0, gradient->y0,
+ gradient->radius0,
+ gradient->x1, gradient->y1,
+ gradient->radius1);
+
+ for (i = 0; i < gradient->stops->len; i++)
+ {
+ ColorStop *stop;
+ GdkRGBA color;
+
+ stop = &g_array_index (gradient->stops, ColorStop, i);
+
+ if (!gtk_symbolic_color_resolve (stop->color, props, &color))
+ {
+ cairo_pattern_destroy (pattern);
+ return FALSE;
+ }
+
+ cairo_pattern_add_color_stop_rgba (pattern, stop->offset,
+ color.red, color.green,
+ color.blue, color.alpha);
+ }
+
+ *resolved_gradient = pattern;
+ return TRUE;
+}
diff --git a/gtk/gtkgradient.h b/gtk/gtkgradient.h
new file mode 100644
index 0000000000..f097c40fd0
--- /dev/null
+++ b/gtk/gtkgradient.h
@@ -0,0 +1,61 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
+#error "Only <gtk/gtk.h> can be included directly."
+#endif
+
+#ifndef __GTK_GRADIENT_H__
+#define __GTK_GRADIENT_H__
+
+#include <gdk/gdk.h>
+#include <gtk/gtkstyleproperties.h>
+#include <gtk/gtksymboliccolor.h>
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_GRADIENT (gtk_gradient_get_type ())
+
+GType gtk_gradient_get_type (void) G_GNUC_CONST;
+
+GtkGradient * gtk_gradient_new_linear (gdouble x0,
+ gdouble y0,
+ gdouble x1,
+ gdouble y1);
+GtkGradient * gtk_gradient_new_radial (gdouble x0,
+ gdouble y0,
+ gdouble radius0,
+ gdouble x1,
+ gdouble y1,
+ gdouble radius1);
+
+void gtk_gradient_add_color_stop (GtkGradient *gradient,
+ gdouble offset,
+ GtkSymbolicColor *color);
+
+GtkGradient * gtk_gradient_ref (GtkGradient *gradient);
+void gtk_gradient_unref (GtkGradient *gradient);
+
+gboolean gtk_gradient_resolve (GtkGradient *gradient,
+ GtkStyleProperties *props,
+ cairo_pattern_t **resolved_gradient);
+
+G_END_DECLS
+
+#endif /* __GTK_GRADIENT_H__ */
diff --git a/gtk/gtkiconfactory.c b/gtk/gtkiconfactory.c
index 92fea10119..5b21c62fd6 100644
--- a/gtk/gtkiconfactory.c
+++ b/gtk/gtkiconfactory.c
@@ -796,7 +796,7 @@ icon_size_settings_changed (GtkSettings *settings,
{
icon_size_set_all_from_settings (settings);
- gtk_rc_reset_styles (settings);
+ gtk_style_context_reset_widgets (_gtk_settings_get_screen (settings));
}
static void
@@ -1083,12 +1083,12 @@ gtk_icon_size_get_name (GtkIconSize size)
static GdkPixbuf *find_in_cache (GtkIconSet *icon_set,
- GtkStyle *style,
+ GtkStyleContext *style_context,
GtkTextDirection direction,
GtkStateType state,
GtkIconSize size);
static void add_to_cache (GtkIconSet *icon_set,
- GtkStyle *style,
+ GtkStyleContext *style_context,
GtkTextDirection direction,
GtkStateType state,
GtkIconSize size,
@@ -1102,9 +1102,9 @@ static void clear_cache (GtkIconSet *icon_set,
static GSList* copy_cache (GtkIconSet *icon_set,
GtkIconSet *copy_recipient);
static void attach_to_style (GtkIconSet *icon_set,
- GtkStyle *style);
+ GtkStyleContext *style_context);
static void detach_from_style (GtkIconSet *icon_set,
- GtkStyle *style);
+ GtkStyleContext *style_context);
static void style_dnotify (gpointer data);
struct _GtkIconSet
@@ -1369,12 +1369,8 @@ ensure_filename_pixbuf (GtkIconSet *icon_set,
static GdkPixbuf *
render_icon_name_pixbuf (GtkIconSource *icon_source,
- GtkStyle *style,
- GtkTextDirection direction,
- GtkStateType state,
- GtkIconSize size,
- GtkWidget *widget,
- const char *detail)
+ GtkStyleContext *context,
+ GtkIconSize size)
{
GdkPixbuf *pixbuf;
GdkPixbuf *tmp_pixbuf;
@@ -1386,17 +1382,7 @@ render_icon_name_pixbuf (GtkIconSource *icon_source,
gint *sizes, *s, dist;
GError *error = NULL;
- if (widget && gtk_widget_has_screen (widget))
- screen = gtk_widget_get_screen (widget);
- else if (style && style->visual)
- screen = gdk_visual_get_screen (style->visual);
- else
- {
- screen = gdk_screen_get_default ();
- GTK_NOTE (MULTIHEAD,
- g_warning ("Using the default screen for gtk_icon_source_render_icon()"));
- }
-
+ screen = gtk_style_context_get_screen (context);
icon_theme = gtk_icon_theme_get_for_screen (screen);
settings = gtk_settings_get_for_screen (screen);
@@ -1487,9 +1473,7 @@ render_icon_name_pixbuf (GtkIconSource *icon_source,
tmp_source.type = GTK_ICON_SOURCE_PIXBUF;
tmp_source.source.pixbuf = tmp_pixbuf;
- pixbuf = gtk_style_render_icon (style, &tmp_source,
- direction, state, -1,
- widget, detail);
+ pixbuf = gtk_render_icon_pixbuf (context, &tmp_source, -1);
if (!pixbuf)
g_warning ("Failed to render icon");
@@ -1501,12 +1485,10 @@ render_icon_name_pixbuf (GtkIconSource *icon_source,
static GdkPixbuf *
find_and_render_icon_source (GtkIconSet *icon_set,
- GtkStyle *style,
+ GtkStyleContext *context,
GtkTextDirection direction,
GtkStateType state,
- GtkIconSize size,
- GtkWidget *widget,
- const char *detail)
+ GtkIconSize size)
{
GSList *failed = NULL;
GdkPixbuf *pixbuf = NULL;
@@ -1535,9 +1517,7 @@ find_and_render_icon_source (GtkIconSet *icon_set,
break;
/* Fall through */
case GTK_ICON_SOURCE_PIXBUF:
- pixbuf = gtk_style_render_icon (style, source,
- direction, state, size,
- widget, detail);
+ pixbuf = gtk_render_icon_pixbuf (context, source, size);
if (!pixbuf)
{
g_warning ("Failed to render icon");
@@ -1546,9 +1526,7 @@ find_and_render_icon_source (GtkIconSet *icon_set,
break;
case GTK_ICON_SOURCE_ICON_NAME:
case GTK_ICON_SOURCE_STATIC_ICON_NAME:
- pixbuf = render_icon_name_pixbuf (source, style,
- direction, state, size,
- widget, detail);
+ pixbuf = render_icon_name_pixbuf (source, context, size);
if (!pixbuf)
failed = g_slist_prepend (failed, source);
break;
@@ -1565,12 +1543,10 @@ find_and_render_icon_source (GtkIconSet *icon_set,
extern GtkIconCache *_builtin_cache;
static GdkPixbuf*
-render_fallback_image (GtkStyle *style,
+render_fallback_image (GtkStyleContext *context,
GtkTextDirection direction,
GtkStateType state,
- GtkIconSize size,
- GtkWidget *widget,
- const char *detail)
+ GtkIconSize size)
{
/* This icon can be used for any direction/state/size */
static GtkIconSource fallback_source = GTK_ICON_SOURCE_INIT (TRUE, TRUE, TRUE);
@@ -1590,13 +1566,69 @@ render_fallback_image (GtkStyle *style,
g_object_unref (pixbuf);
}
- return gtk_style_render_icon (style,
- &fallback_source,
- direction,
- state,
- size,
- widget,
- detail);
+ return gtk_render_icon_pixbuf (context, &fallback_source, size);
+}
+
+/**
+ * gtk_icon_set_render_icon_pixbuf:
+ * @icon_set: a #GtkIconSet
+ * @context: a #GtkStyleContext
+ * @size: (type int): icon size. A size of (GtkIconSize)-1
+ * means render at the size of the source and don't scale.
+ *
+ * Renders an icon using gtk_render_icon_pixbuf(). In most cases,
+ * gtk_widget_render_icon() is better, since it automatically provides
+ * most of the arguments from the current widget settings. This
+ * function never returns %NULL; if the icon can't be rendered
+ * (perhaps because an image file fails to load), a default "missing
+ * image" icon will be returned instead.
+ *
+ * Return value: (transfer full): a #GdkPixbuf to be displayed
+ *
+ * Since: 3.0
+ */
+GdkPixbuf *
+gtk_icon_set_render_icon_pixbuf (GtkIconSet *icon_set,
+ GtkStyleContext *context,
+ GtkIconSize size)
+{
+ GdkPixbuf *icon = NULL;
+ GtkStateFlags flags = 0;
+ GtkStateType state;
+ GtkTextDirection direction;
+
+ g_return_val_if_fail (icon_set != NULL, NULL);
+ g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), NULL);
+
+ flags = gtk_style_context_get_state (context);
+ if (flags & GTK_STATE_FLAG_INSENSITIVE)
+ state = GTK_STATE_INSENSITIVE;
+ else if (flags & GTK_STATE_FLAG_PRELIGHT)
+ state = GTK_STATE_PRELIGHT;
+ else
+ state = GTK_STATE_NORMAL;
+
+ direction = gtk_style_context_get_direction (context);
+
+ if (icon_set->sources)
+ {
+ icon = find_in_cache (icon_set, context, direction, state, size);
+ if (icon)
+ {
+ g_object_ref (icon);
+ return icon;
+ }
+ }
+
+ if (icon_set->sources)
+ icon = find_and_render_icon_source (icon_set, context, direction, state, size);
+
+ if (icon == NULL)
+ icon = render_fallback_image (context, direction, state, size);
+
+ add_to_cache (icon_set, context, direction, state, size, icon);
+
+ return icon;
}
/**
@@ -1622,6 +1654,8 @@ render_fallback_image (GtkStyle *style,
* image" icon will be returned instead.
*
* Return value: (transfer full): a #GdkPixbuf to be displayed
+ *
+ * Deprecated: 3.0: Use gtk_icon_set_render_icon_pixbuf() instead
*/
GdkPixbuf*
gtk_icon_set_render_icon (GtkIconSet *icon_set,
@@ -1633,34 +1667,47 @@ gtk_icon_set_render_icon (GtkIconSet *icon_set,
const char *detail)
{
GdkPixbuf *icon;
+ GtkStyleContext *context = NULL;
+ GtkStateFlags flags = 0;
g_return_val_if_fail (icon_set != NULL, NULL);
g_return_val_if_fail (style == NULL || GTK_IS_STYLE (style), NULL);
- if (icon_set->sources == NULL)
- return render_fallback_image (style, direction, state, size, widget, detail);
-
- if (detail == NULL)
+ if (style && gtk_style_has_context (style))
{
- icon = find_in_cache (icon_set, style, direction,
- state, size);
-
- if (icon)
- {
- g_object_ref (icon);
- return icon;
- }
+ g_object_get (style, "context", &context, NULL);
+ /* g_object_get returns a refed object */
+ if (context)
+ g_object_unref (context);
+ }
+ else if (widget)
+ {
+ context = gtk_widget_get_style_context (widget);
}
+ if (!context)
+ return render_fallback_image (context, direction, state, size);
- icon = find_and_render_icon_source (icon_set, style, direction, state, size,
- widget, detail);
+ gtk_style_context_save (context);
- if (icon == NULL)
- icon = render_fallback_image (style, direction, state, size, widget, detail);
+ switch (state)
+ {
+ case GTK_STATE_PRELIGHT:
+ flags |= GTK_STATE_FLAG_PRELIGHT;
+ break;
+ case GTK_STATE_INSENSITIVE:
+ flags |= GTK_STATE_FLAG_INSENSITIVE;
+ break;
+ default:
+ break;
+ }
+
+ gtk_style_context_set_state (context, flags);
+ gtk_style_context_set_direction (context, direction);
- if (detail == NULL)
- add_to_cache (icon_set, style, direction, state, size, icon);
+ icon = gtk_icon_set_render_icon_pixbuf (icon_set, context, size);
+
+ gtk_style_context_restore (context);
return icon;
}
@@ -2376,7 +2423,7 @@ struct _CachedIcon
/* These must all match to use the cached pixbuf.
* If any don't match, we must re-render the pixbuf.
*/
- GtkStyle *style;
+ GtkStyleContext *style;
GtkTextDirection direction;
GtkStateType state;
GtkIconSize size;
@@ -2398,16 +2445,14 @@ static void
cached_icon_free (CachedIcon *icon)
{
g_object_unref (icon->pixbuf);
-
- if (icon->style)
- g_object_unref (icon->style);
+ g_object_unref (icon->style);
g_free (icon);
}
static GdkPixbuf *
find_in_cache (GtkIconSet *icon_set,
- GtkStyle *style,
+ GtkStyleContext *style_context,
GtkTextDirection direction,
GtkStateType state,
GtkIconSize size)
@@ -2423,7 +2468,7 @@ find_in_cache (GtkIconSet *icon_set,
{
CachedIcon *icon = tmp_list->data;
- if (icon->style == style &&
+ if (icon->style == style_context &&
icon->direction == direction &&
icon->state == state &&
(size == (GtkIconSize)-1 || icon->size == size))
@@ -2448,7 +2493,7 @@ find_in_cache (GtkIconSet *icon_set,
static void
add_to_cache (GtkIconSet *icon_set,
- GtkStyle *style,
+ GtkStyleContext *style_context,
GtkTextDirection direction,
GtkStateType state,
GtkIconSize size,
@@ -2460,26 +2505,16 @@ add_to_cache (GtkIconSet *icon_set,
g_object_ref (pixbuf);
- /* We have to ref the style, since if the style was finalized
- * its address could be reused by another style, creating a
- * really weird bug
- */
-
- if (style)
- g_object_ref (style);
-
icon = g_new (CachedIcon, 1);
icon_set->cache = g_slist_prepend (icon_set->cache, icon);
icon_set->cache_size++;
- icon->style = style;
+ icon->style = g_object_ref (style_context);
icon->direction = direction;
icon->state = state;
icon->size = size;
icon->pixbuf = pixbuf;
-
- if (icon->style)
- attach_to_style (icon_set, icon->style);
+ attach_to_style (icon_set, icon->style);
if (icon_set->cache_size >= NUM_CACHED_ICONS)
{
@@ -2512,7 +2547,7 @@ clear_cache (GtkIconSet *icon_set,
gboolean style_detach)
{
GSList *cache, *tmp_list;
- GtkStyle *last_style = NULL;
+ GtkStyleContext *last_style = NULL;
cache = icon_set->cache;
icon_set->cache = NULL;
@@ -2561,11 +2596,8 @@ copy_cache (GtkIconSet *icon_set,
*icon_copy = *icon;
- if (icon_copy->style)
- {
- attach_to_style (copy_recipient, icon_copy->style);
- g_object_ref (icon_copy->style);
- }
+ attach_to_style (copy_recipient, icon_copy->style);
+ g_object_ref (icon_copy->style);
g_object_ref (icon_copy->pixbuf);
@@ -2580,18 +2612,18 @@ copy_cache (GtkIconSet *icon_set,
}
static void
-attach_to_style (GtkIconSet *icon_set,
- GtkStyle *style)
+attach_to_style (GtkIconSet *icon_set,
+ GtkStyleContext *style_context)
{
GHashTable *table;
- table = g_object_get_qdata (G_OBJECT (style),
+ table = g_object_get_qdata (G_OBJECT (style_context),
g_quark_try_string ("gtk-style-icon-sets"));
if (table == NULL)
{
table = g_hash_table_new (NULL, NULL);
- g_object_set_qdata_full (G_OBJECT (style),
+ g_object_set_qdata_full (G_OBJECT (style_context),
g_quark_from_static_string ("gtk-style-icon-sets"),
table,
style_dnotify);
@@ -2601,12 +2633,12 @@ attach_to_style (GtkIconSet *icon_set,
}
static void
-detach_from_style (GtkIconSet *icon_set,
- GtkStyle *style)
+detach_from_style (GtkIconSet *icon_set,
+ GtkStyleContext *style_context)
{
GHashTable *table;
- table = g_object_get_qdata (G_OBJECT (style),
+ table = g_object_get_qdata (G_OBJECT (style_context),
g_quark_try_string ("gtk-style-icon-sets"));
if (table != NULL)
diff --git a/gtk/gtkiconfactory.h b/gtk/gtkiconfactory.h
index 1019cf6b41..69ab250b0e 100644
--- a/gtk/gtkiconfactory.h
+++ b/gtk/gtkiconfactory.h
@@ -132,7 +132,6 @@ GdkPixbuf* gtk_icon_set_render_icon (GtkIconSet *icon_set,
GtkWidget *widget,
const char *detail);
-
void gtk_icon_set_add_source (GtkIconSet *icon_set,
const GtkIconSource *source);
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index cd55c3f140..2f41849967 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -606,10 +606,7 @@ reset_styles_idle (gpointer user_data)
priv = icon_theme->priv;
if (priv->screen && priv->is_screen_singleton)
- {
- GtkSettings *settings = gtk_settings_get_for_screen (priv->screen);
- gtk_rc_reset_styles (settings);
- }
+ gtk_style_context_reset_widgets (priv->screen);
priv->reset_styles_idle = 0;
@@ -3071,6 +3068,16 @@ gdk_color_to_css (GdkColor *color)
color->blue >> 8);
}
+static gchar *
+gdk_rgba_to_css (GdkRGBA *color)
+{
+ return g_strdup_printf ("rgba(%d,%d,%d,%f)",
+ (gint)(color->red * 255),
+ (gint)(color->green * 255),
+ (gint)(color->blue * 255),
+ color->alpha);
+}
+
static GdkPixbuf *
_gtk_icon_info_load_symbolic_internal (GtkIconInfo *icon_info,
const gchar *css_fg,
@@ -3236,6 +3243,83 @@ gtk_icon_info_load_symbolic (GtkIconInfo *icon_info,
}
/**
+ * gtk_icon_info_load_symbolic_for_context:
+ * @icon_info: a #GtkIconInfo
+ * context: a #GtkStyleContext
+ * @was_symbolic: (allow-none): a #gboolean, returns whether the loaded icon
+ * was a symbolic one and whether the @fg color was applied to it.
+ * @error: (allow-none): location to store error information on failure,
+ * or %NULL.
+ *
+ * Loads an icon, modifying it to match the system colors for the foreground,
+ * success, warning and error colors provided. If the icon is not a symbolic
+ * one, the function will return the result from gtk_icon_info_load_icon().
+ *
+ * This allows loading symbolic icons that will match the system theme.
+ *
+ * See gtk_icon_info_load_symbolic() for more details.
+ *
+ * Return value: (transfer full): a #GdkPixbuf representing the loaded icon
+ *
+ * Since: 3.0
+ **/
+GdkPixbuf *
+gtk_icon_info_load_symbolic_for_context (GtkIconInfo *icon_info,
+ GtkStyleContext *context,
+ gboolean *was_symbolic,
+ GError **error)
+{
+ GdkPixbuf *pixbuf;
+ GdkRGBA *color = NULL;
+ GdkRGBA rgba;
+ gchar *css_fg = NULL, *css_success;
+ gchar *css_warning, *css_error;
+ GtkStateFlags state;
+
+ if (!icon_info->filename ||
+ !g_str_has_suffix (icon_info->filename, "-symbolic.svg"))
+ {
+ if (was_symbolic)
+ *was_symbolic = FALSE;
+ return gtk_icon_info_load_icon (icon_info, error);
+ }
+
+ if (was_symbolic)
+ *was_symbolic = TRUE;
+
+ state = gtk_style_context_get_state (context);
+ gtk_style_context_get (context, state, "color", &color, NULL);
+ if (color)
+ {
+ css_fg = gdk_rgba_to_css (color);
+ gdk_rgba_free (color);
+ }
+
+ css_success = css_warning = css_error = NULL;
+
+ if (gtk_style_context_lookup_color (context, "success_color", &rgba))
+ css_success = gdk_rgba_to_css (&rgba);
+
+ if (gtk_style_context_lookup_color (context, "warning_color", &rgba))
+ css_warning = gdk_rgba_to_css (&rgba);
+
+ if (gtk_style_context_lookup_color (context, "error_color", &rgba))
+ css_error = gdk_rgba_to_css (&rgba);
+
+ pixbuf = _gtk_icon_info_load_symbolic_internal (icon_info,
+ css_fg, css_success,
+ css_warning, css_error,
+ error);
+
+ g_free (css_fg);
+ g_free (css_success);
+ g_free (css_warning);
+ g_free (css_error);
+
+ return pixbuf;
+}
+
+/**
* gtk_icon_info_load_symbolic_for_style:
* @icon_info: a #GtkIconInfo
* @style: a #GtkStyle to take the colors from
@@ -3256,6 +3340,8 @@ gtk_icon_info_load_symbolic (GtkIconInfo *icon_info,
* Return value: (transfer full): a #GdkPixbuf representing the loaded icon
*
* Since: 3.0
+ *
+ * Deprecated: 3.0: Use gtk_icon_info_load_symbolic_for_context() instead
**/
GdkPixbuf *
gtk_icon_info_load_symbolic_for_style (GtkIconInfo *icon_info,
diff --git a/gtk/gtkicontheme.h b/gtk/gtkicontheme.h
index f493ba98a0..9ee87e16f1 100644
--- a/gtk/gtkicontheme.h
+++ b/gtk/gtkicontheme.h
@@ -27,6 +27,7 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk/gdk.h>
#include <gtk/gtkstyle.h>
+#include <gtk/gtkstylecontext.h>
G_BEGIN_DECLS
@@ -178,11 +179,17 @@ GdkPixbuf * gtk_icon_info_load_symbolic (GtkIconInfo *icon_info
GdkRGBA *error_color,
gboolean *was_symbolic,
GError **error);
+GdkPixbuf * gtk_icon_info_load_symbolic_for_context (GtkIconInfo *icon_info,
+ GtkStyleContext *context,
+ gboolean *was_symbolic,
+ GError **error);
+#ifndef GTK_DISABLE_DEPRECATED
GdkPixbuf * gtk_icon_info_load_symbolic_for_style (GtkIconInfo *icon_info,
GtkStyle *style,
GtkStateType state,
gboolean *was_symbolic,
GError **error);
+#endif
void gtk_icon_info_set_raw_coordinates (GtkIconInfo *icon_info,
gboolean raw_coordinates);
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index 8a3defdb80..17ce6af25b 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -5618,7 +5618,7 @@ update_text_cell (GtkIconView *icon_view)
g_object_set (info->cell,
"alignment", PANGO_ALIGN_CENTER,
"wrap-mode", PANGO_WRAP_WORD_CHAR,
- "xalign", 0.0,
+ "xalign", 0.5,
"yalign", 0.0,
NULL);
else
@@ -5626,7 +5626,7 @@ update_text_cell (GtkIconView *icon_view)
"alignment", PANGO_ALIGN_LEFT,
"wrap-mode", PANGO_WRAP_WORD_CHAR,
"xalign", 0.0,
- "yalign", 0.0,
+ "yalign", 0.5,
NULL);
}
}
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index ce0fcbef6a..184451ef23 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -1469,15 +1469,15 @@ ensure_pixbuf_for_icon_name (GtkImage *image,
MIN (width, height), flags);
if (info)
{
- GtkStyle *style;
+ GtkStyleContext *context;
gboolean was_symbolic;
- style = gtk_widget_get_style (GTK_WIDGET (image));
+ context = gtk_widget_get_style_context (GTK_WIDGET (image));
priv->data.name.pixbuf =
- gtk_icon_info_load_symbolic_for_style (info,
- style, state,
- &was_symbolic,
- NULL);
+ gtk_icon_info_load_symbolic_for_context (info,
+ context,
+ &was_symbolic,
+ NULL);
priv->was_symbolic = was_symbolic;
gtk_icon_info_free (info);
}
@@ -1544,15 +1544,15 @@ ensure_pixbuf_for_gicon (GtkImage *image,
MIN (width, height), flags);
if (info)
{
- GtkStyle *style;
+ GtkStyleContext *context;
gboolean was_symbolic;
- style = gtk_widget_get_style (GTK_WIDGET (image));
+ context = gtk_widget_get_style_context (GTK_WIDGET (image));
priv->data.gicon.pixbuf =
- gtk_icon_info_load_symbolic_for_style (info,
- style, state,
- &was_symbolic,
- NULL);
+ gtk_icon_info_load_symbolic_for_context (info,
+ context,
+ &was_symbolic,
+ NULL);
priv->was_symbolic = was_symbolic;
gtk_icon_info_free (info);
}
diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c
index d9c70e5b67..1270bb0563 100644
--- a/gtk/gtkimcontextsimple.c
+++ b/gtk/gtkimcontextsimple.c
@@ -692,7 +692,7 @@ check_hex (GtkIMContextSimple *context_simple,
static void
beep_window (GdkWindow *window)
{
- GdkScreen *screen = gdk_window_get_screen (GDK_DRAWABLE (window));
+ GdkScreen *screen = gdk_window_get_screen (window);
gboolean beep;
g_object_get (gtk_settings_get_for_screen (screen),
diff --git a/gtk/gtkimmodule.c b/gtk/gtkimmodule.c
index 788631d2ee..868cfe17c2 100644
--- a/gtk/gtkimmodule.c
+++ b/gtk/gtkimmodule.c
@@ -681,9 +681,9 @@ _gtk_im_module_get_default_context_id (GdkWindow *client_window)
/* Check if the certain immodule is set in XSETTINGS.
*/
- if (GDK_IS_DRAWABLE (client_window))
+ if (GDK_IS_WINDOW (client_window))
{
- screen = gdk_window_get_screen (GDK_DRAWABLE (client_window));
+ screen = gdk_window_get_screen (client_window);
settings = gtk_settings_get_for_screen (screen);
g_object_get (G_OBJECT (settings), "gtk-im-module", &tmp, NULL);
if (tmp)
diff --git a/gtk/gtkimmulticontext.c b/gtk/gtkimmulticontext.c
index a8357babfe..f2454fcb4a 100644
--- a/gtk/gtkimmulticontext.c
+++ b/gtk/gtkimmulticontext.c
@@ -297,7 +297,7 @@ gtk_im_multicontext_set_client_window (GtkIMContext *context,
if (window)
{
- screen = gdk_window_get_screen (GDK_DRAWABLE (window));
+ screen = gdk_window_get_screen (window);
settings = gtk_settings_get_for_screen (screen);
connected = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (settings),
diff --git a/gtk/gtkinfobar.c b/gtk/gtkinfobar.c
index 86859786e0..a7879606b4 100644
--- a/gtk/gtkinfobar.c
+++ b/gtk/gtkinfobar.c
@@ -495,19 +495,21 @@ gtk_info_bar_update_colors (GtkInfoBar *info_bar)
{
GtkWidget *widget = GTK_WIDGET (info_bar);
GtkInfoBarPrivate *priv = info_bar->priv;
- GdkColor info_default_border_color = { 0, 0xb800, 0xad00, 0x9d00 };
- GdkColor info_default_fill_color = { 0, 0xff00, 0xff00, 0xbf00 };
- GdkColor warning_default_border_color = { 0, 0xb000, 0x7a00, 0x2b00 };
- GdkColor warning_default_fill_color = { 0, 0xfc00, 0xaf00, 0x3e00 };
- GdkColor question_default_border_color = { 0, 0x6200, 0x7b00, 0xd960 };
- GdkColor question_default_fill_color = { 0, 0x8c00, 0xb000, 0xd700 };
- GdkColor error_default_border_color = { 0, 0xa800, 0x2700, 0x2700 };
- GdkColor error_default_fill_color = { 0, 0xf000, 0x3800, 0x3800 };
- GdkColor other_default_border_color = { 0, 0xb800, 0xad00, 0x9d00 };
- GdkColor other_default_fill_color = { 0, 0xff00, 0xff00, 0xbf00 };
- GdkColor *fg, *bg;
- GdkColor sym_fg, sym_bg;
- GtkStyle *style;
+ GdkRGBA info_default_border_color = { 0.71, 0.67, 0.61, 1.0 };
+ GdkRGBA info_default_fill_color = { 0.99, 0.99, 0.74, 1.0 };
+ GdkRGBA warning_default_border_color = { 0.68, 0.47, 0.16, 1.0 };
+ GdkRGBA warning_default_fill_color = { 0.98, 0.68, 0.24, 1.0 };
+ GdkRGBA question_default_border_color = { 0.38, 0.48, 0.84, 1.0 };
+ GdkRGBA question_default_fill_color = { 0.54, 0.68, 0.83, 1.0 };
+ GdkRGBA error_default_border_color = { 0.65, 0.15, 0.15, 1.0 };
+ GdkRGBA error_default_fill_color = { 0.93, 0.21, 0.21, 1.0 };
+ GdkRGBA other_default_border_color = { 0.71, 0.67, 0.61, 1.0 };
+ GdkRGBA other_default_fill_color = { 0.99, 0.99, 0.74, 1.0 };
+ GdkRGBA *fg, *bg;
+ GdkRGBA sym_fg, sym_bg;
+ GdkRGBA *color, *bg_color;
+ GtkStyleContext *context;
+
const char* fg_color_name[] = {
"info_fg_color",
"warning_fg_color",
@@ -523,10 +525,10 @@ gtk_info_bar_update_colors (GtkInfoBar *info_bar)
"other_bg_color"
};
- style = gtk_widget_get_style (widget);
+ context = gtk_widget_get_style_context (widget);
- if (gtk_style_lookup_color (style, fg_color_name[priv->message_type], &sym_fg) &&
- gtk_style_lookup_color (style, bg_color_name[priv->message_type], &sym_bg))
+ if (gtk_style_context_lookup_color (context, fg_color_name[priv->message_type], &sym_fg) &&
+ gtk_style_context_lookup_color (context, bg_color_name[priv->message_type], &sym_bg))
{
fg = &sym_fg;
bg = &sym_bg;
@@ -567,10 +569,17 @@ gtk_info_bar_update_colors (GtkInfoBar *info_bar)
}
}
- if (!gdk_color_equal (bg, &style->bg[GTK_STATE_NORMAL]))
- gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, bg);
- if (!gdk_color_equal (fg, &style->fg[GTK_STATE_NORMAL]))
- gtk_widget_modify_fg (widget, GTK_STATE_NORMAL, fg);
+ gtk_style_context_get (context, 0,
+ "color", &color,
+ "background-color", &bg_color,
+ NULL);
+ if (!gdk_rgba_equal (bg_color, bg))
+ gtk_widget_override_background_color (widget, 0, bg);
+ if (!gdk_rgba_equal (color, fg))
+ gtk_widget_override_color (widget, 0, fg);
+
+ gdk_rgba_free (color);
+ gdk_rgba_free (bg_color);
}
static void
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 39655b8518..55bc6c335e 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -221,8 +221,7 @@ static void gtk_label_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void gtk_label_state_changed (GtkWidget *widget,
GtkStateType state);
-static void gtk_label_style_set (GtkWidget *widget,
- GtkStyle *previous_style);
+static void gtk_label_style_updated (GtkWidget *widget);
static void gtk_label_direction_changed (GtkWidget *widget,
GtkTextDirection previous_dir);
static gint gtk_label_draw (GtkWidget *widget,
@@ -407,7 +406,7 @@ gtk_label_class_init (GtkLabelClass *class)
widget_class->destroy = gtk_label_destroy;
widget_class->size_allocate = gtk_label_size_allocate;
widget_class->state_changed = gtk_label_state_changed;
- widget_class->style_set = gtk_label_style_set;
+ widget_class->style_updated = gtk_label_style_updated;
widget_class->query_tooltip = gtk_label_query_tooltip;
widget_class->direction_changed = gtk_label_direction_changed;
widget_class->draw = gtk_label_draw;
@@ -3806,8 +3805,7 @@ gtk_label_state_changed (GtkWidget *widget,
}
static void
-gtk_label_style_set (GtkWidget *widget,
- GtkStyle *previous_style)
+gtk_label_style_updated (GtkWidget *widget)
{
GtkLabel *label = GTK_LABEL (widget);
@@ -4065,7 +4063,8 @@ gtk_label_draw (GtkWidget *widget,
GtkLabelPrivate *priv = label->priv;
GtkLabelSelectionInfo *info = priv->select_info;
GtkAllocation allocation;
- GtkStyle *style;
+ GtkStyleContext *context;
+ GtkStateFlags state;
GdkWindow *window;
gint x, y;
@@ -4073,22 +4072,22 @@ gtk_label_draw (GtkWidget *widget,
if (priv->text && (*priv->text != '\0'))
{
+ GdkRGBA *bg_color, *fg_color;
+
get_layout_location (label, &x, &y);
- style = gtk_widget_get_style (widget);
+ context = gtk_widget_get_style_context (widget);
window = gtk_widget_get_window (widget);
gtk_widget_get_allocation (widget, &allocation);
cairo_translate (cr, -allocation.x, -allocation.y);
- gtk_paint_layout (style,
- cr,
- gtk_widget_get_state (widget),
- FALSE,
- widget,
- "label",
- x, y,
- priv->layout);
+ state = gtk_widget_get_state_flags (widget);
+ gtk_style_context_set_state (context, state);
+
+ gtk_render_layout (context, cr,
+ x, y,
+ priv->layout);
if (info &&
(info->selection_anchor != info->selection_end))
@@ -4121,19 +4120,28 @@ gtk_label_draw (GtkWidget *widget,
gdk_cairo_region (cr, clip);
cairo_clip (cr);
- state = GTK_STATE_SELECTED;
- if (!gtk_widget_has_focus (widget))
- state = GTK_STATE_ACTIVE;
+ state = GTK_STATE_FLAG_SELECTED;
+
+ if (gtk_widget_has_focus (widget))
+ state |= GTK_STATE_FLAG_FOCUSED;
- gdk_cairo_set_source_color (cr, &style->base[state]);
+ gtk_style_context_get (context, state,
+ "background-color", &bg_color,
+ "color", &fg_color,
+ NULL);
+
+ gdk_cairo_set_source_rgba (cr, bg_color);
cairo_paint (cr);
- gdk_cairo_set_source_color (cr, &style->text[state]);
+ gdk_cairo_set_source_rgba (cr, fg_color);
cairo_move_to (cr, x, y);
_gtk_pango_fill_layout (cr, priv->layout);
cairo_restore (cr);
cairo_region_destroy (clip);
+
+ gdk_rgba_free (bg_color);
+ gdk_rgba_free (fg_color);
}
else if (info)
{
@@ -4143,7 +4151,6 @@ gtk_label_draw (GtkWidget *widget,
cairo_region_t *clip;
GdkRectangle rect;
GdkColor *text_color;
- GdkColor *base_color;
GdkColor *link_color;
GdkColor *visited_link_color;
@@ -4156,6 +4163,8 @@ gtk_label_draw (GtkWidget *widget,
if (active_link)
{
+ GdkRGBA *bg_color;
+
range[0] = active_link->start;
range[1] = active_link->end;
@@ -4174,12 +4183,17 @@ gtk_label_draw (GtkWidget *widget,
text_color = visited_link_color;
else
text_color = link_color;
+
if (info->link_clicked)
- base_color = &style->base[GTK_STATE_ACTIVE];
+ state = GTK_STATE_FLAG_ACTIVE;
else
- base_color = &style->base[GTK_STATE_PRELIGHT];
+ state = GTK_STATE_FLAG_PRELIGHT;
- gdk_cairo_set_source_color (cr, base_color);
+ gtk_style_context_get (context, state,
+ "background-color", &bg_color,
+ NULL);
+
+ gdk_cairo_set_source_rgba (cr, bg_color);
cairo_paint (cr);
gdk_cairo_set_source_color (cr, text_color);
@@ -4188,6 +4202,7 @@ gtk_label_draw (GtkWidget *widget,
gdk_color_free (link_color);
gdk_color_free (visited_link_color);
+ gdk_rgba_free (bg_color);
cairo_restore (cr);
}
@@ -4203,9 +4218,12 @@ gtk_label_draw (GtkWidget *widget,
1);
cairo_region_get_extents (clip, &rect);
- gtk_paint_focus (style, cr, gtk_widget_get_state (widget),
- widget, "label",
- rect.x, rect.y, rect.width, rect.height);
+ state = gtk_widget_get_state_flags (widget);
+ gtk_style_context_set_state (context, state);
+
+ gtk_render_focus (context, cr,
+ rect.x, rect.y,
+ rect.width, rect.height);
cairo_region_destroy (clip);
}
@@ -5509,8 +5527,9 @@ gtk_label_get_selection_bounds (GtkLabel *label,
* Gets the #PangoLayout used to display the label.
* The layout is useful to e.g. convert text positions to
* pixel positions, in combination with gtk_label_get_layout_offsets().
- * The returned layout is owned by the label so need not be
- * freed by the caller.
+ * The returned layout is owned by the @label so need not be
+ * freed by the caller. The @label is free to recreate its layout at
+ * any time, so it should be considered read-only.
*
* Return value: (transfer none): the #PangoLayout for this label
**/
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 1ba0ae767a..ac2bbd05ad 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -66,8 +66,6 @@
#include "gtkmenu.h"
#include "gdk/gdkkeysyms.h"
-#include "gdk/gdkprivate.h" /* for GDK_WINDOW_DESTROYED */
-
#ifdef G_OS_WIN32
static HMODULE gtk_dll;
@@ -798,7 +796,6 @@ do_post_parse_initialization (int *argc,
g_type_init ();
_gtk_accel_map_init ();
- _gtk_rc_init ();
/* Set the 'initialized' flag.
*/
@@ -1658,7 +1655,7 @@ gtk_main_do_event (GdkEvent *event)
{
/* The app may paint with a previously allocated cairo_t,
which will draw directly to the window. We can't catch cairo
- drap operatoins to automatically flush the window, thus we
+ draw operations to automatically flush the window, thus we
need to explicitly flush any outstanding moves or double
buffering */
gdk_window_flush (event->any.window);
@@ -1667,7 +1664,6 @@ gtk_main_do_event (GdkEvent *event)
break;
case GDK_PROPERTY_NOTIFY:
- case GDK_NO_EXPOSE:
case GDK_FOCUS_CHANGE:
case GDK_CONFIGURE:
case GDK_MAP:
@@ -2384,7 +2380,7 @@ gtk_get_event_widget (GdkEvent *event)
widget = NULL;
if (event && event->any.window &&
- (event->type == GDK_DESTROY || !GDK_WINDOW_DESTROYED (event->any.window)))
+ (event->type == GDK_DESTROY || !gdk_window_is_destroyed (event->any.window)))
{
gdk_window_get_user_data (event->any.window, &widget_ptr);
widget = widget_ptr;
diff --git a/gtk/gtkmarshalers.list b/gtk/gtkmarshalers.list
index 9279037c7c..fa60a7c91d 100644
--- a/gtk/gtkmarshalers.list
+++ b/gtk/gtkmarshalers.list
@@ -70,6 +70,7 @@ VOID:ENUM,INT
VOID:ENUM,INT,BOOLEAN
VOID:ENUM,BOXED
VOID:ENUM,STRING
+VOID:FLAGS
VOID:INT
VOID:INT,BOOLEAN
VOID:INT,INT
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 13998ee1b9..e678198a39 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -91,8 +91,8 @@ struct _GtkMenuPrivate
gchar *title;
/* Arrow states */
- GtkStateType lower_arrow_state;
- GtkStateType upper_arrow_state;
+ GtkStateFlags lower_arrow_state;
+ GtkStateFlags upper_arrow_state;
/* navigation region */
int navigation_x;
@@ -217,8 +217,7 @@ static void gtk_menu_handle_scrolling (GtkMenu *menu,
gboolean motion);
static void gtk_menu_set_tearoff_hints (GtkMenu *menu,
gint width);
-static void gtk_menu_style_set (GtkWidget *widget,
- GtkStyle *previous_style);
+static void gtk_menu_style_updated (GtkWidget *widget);
static gboolean gtk_menu_focus (GtkWidget *widget,
GtkDirectionType direction);
static gint gtk_menu_get_popup_delay (GtkMenuShell *menu_shell);
@@ -478,7 +477,7 @@ gtk_menu_class_init (GtkMenuClass *class)
widget_class->show_all = gtk_menu_show_all;
widget_class->enter_notify_event = gtk_menu_enter_notify;
widget_class->leave_notify_event = gtk_menu_leave_notify;
- widget_class->style_set = gtk_menu_style_set;
+ widget_class->style_updated = gtk_menu_style_updated;
widget_class->focus = gtk_menu_focus;
widget_class->can_activate_accel = gtk_menu_real_can_activate_accel;
widget_class->grab_notify = gtk_menu_grab_notify;
@@ -1002,6 +1001,7 @@ static void
gtk_menu_init (GtkMenu *menu)
{
GtkMenuPrivate *priv = gtk_menu_get_private (menu);
+ GtkStyleContext *context;
menu->parent_menu_item = NULL;
menu->old_active_menu_item = NULL;
@@ -1046,11 +1046,11 @@ gtk_menu_init (GtkMenu *menu)
menu->upper_arrow_prelight = FALSE;
menu->lower_arrow_prelight = FALSE;
- priv->upper_arrow_state = GTK_STATE_NORMAL;
- priv->lower_arrow_state = GTK_STATE_NORMAL;
-
priv->have_layout = FALSE;
priv->monitor_num = -1;
+
+ context = gtk_widget_get_style_context (GTK_WIDGET (menu));
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_MENU);
}
static void
@@ -1192,9 +1192,9 @@ gtk_menu_attach_to_widget (GtkMenu *menu,
g_object_set_data_full (G_OBJECT (attach_widget), I_(ATTACHED_MENUS), list,
(GDestroyNotify) g_list_free);
- if (gtk_widget_get_state (GTK_WIDGET (menu)) != GTK_STATE_NORMAL)
- gtk_widget_set_state (GTK_WIDGET (menu), GTK_STATE_NORMAL);
-
+ if (gtk_widget_get_state_flags (GTK_WIDGET (menu)) != 0)
+ gtk_widget_set_state_flags (GTK_WIDGET (menu), 0, TRUE);
+
/* we don't need to set the style here, since
* we are a toplevel widget.
*/
@@ -2313,19 +2313,18 @@ gtk_menu_reorder_child (GtkMenu *menu,
}
static void
-gtk_menu_style_set (GtkWidget *widget,
- GtkStyle *previous_style)
+gtk_menu_style_updated (GtkWidget *widget)
{
if (gtk_widget_get_realized (widget))
{
GtkMenu *menu = GTK_MENU (widget);
- GtkStyle *style;
+ GtkStyleContext *context;
- style = gtk_widget_get_style (widget);
+ context = gtk_widget_get_style_context (widget);
- gtk_style_set_background (style, menu->bin_window, GTK_STATE_NORMAL);
- gtk_style_set_background (style, menu->view_window, GTK_STATE_NORMAL);
- gtk_style_set_background (style, gtk_widget_get_window (widget), GTK_STATE_NORMAL);
+ gtk_style_context_set_background (context, menu->bin_window);
+ gtk_style_context_set_background (context, menu->view_window);
+ gtk_style_context_set_background (context, gtk_widget_get_window (widget));
}
}
@@ -2365,10 +2364,29 @@ get_arrows_border (GtkMenu *menu,
}
static void
+get_menu_border (GtkWidget *widget,
+ GtkBorder *border)
+{
+ GtkStyleContext *context;
+ GtkStateFlags state;
+ GtkBorder *border_width;
+
+ context = gtk_widget_get_style_context (widget);
+ state = gtk_widget_get_state_flags (widget);
+
+ gtk_style_context_get (context, state,
+ "border-width", &border_width,
+ NULL);
+
+ *border = *border_width;
+ gtk_border_free (border_width);
+}
+
+static void
gtk_menu_realize (GtkWidget *widget)
{
GtkAllocation allocation;
- GtkStyle *style;
+ GtkStyleContext *context;
GdkWindow *window;
GdkWindowAttr attributes;
gint attributes_mask;
@@ -2379,7 +2397,7 @@ gtk_menu_realize (GtkWidget *widget)
GList *children;
guint vertical_padding;
guint horizontal_padding;
- GtkBorder arrow_border;
+ GtkBorder arrow_border, border;
g_return_if_fail (GTK_IS_MENU (widget));
@@ -2408,9 +2426,10 @@ gtk_menu_realize (GtkWidget *widget)
gtk_widget_set_window (widget, window);
gdk_window_set_user_data (window, widget);
+ get_menu_border (widget, &border);
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+ context = gtk_widget_get_style_context (widget);
- style = gtk_widget_get_style (widget);
gtk_widget_style_get (GTK_WIDGET (menu),
"vertical-padding", &vertical_padding,
"horizontal-padding", &horizontal_padding,
@@ -2418,16 +2437,21 @@ gtk_menu_realize (GtkWidget *widget)
gtk_widget_get_allocation (widget, &allocation);
- attributes.x = border_width + style->xthickness + horizontal_padding;
- attributes.y = border_width + style->ythickness + vertical_padding;
- attributes.width = MAX (1, allocation.width - attributes.x * 2);
- attributes.height = MAX (1, allocation.height - attributes.y * 2);
+ attributes.x = border_width + border.left + horizontal_padding;
+ attributes.y = border_width + border.top + vertical_padding;
+ attributes.width = allocation.width -
+ (2 * (border_width + horizontal_padding)) - border.left - border.right;
+ attributes.height = allocation.height -
+ (2 * (border_width + vertical_padding)) - border.top - border.bottom;
get_arrows_border (menu, &arrow_border);
attributes.y += arrow_border.top;
attributes.height -= arrow_border.top;
attributes.height -= arrow_border.bottom;
+ attributes.width = MAX (1, attributes.width);
+ attributes.height = MAX (1, attributes.height);
+
menu->view_window = gdk_window_new (window,
&attributes, attributes_mask);
gdk_window_set_user_data (menu->view_window, menu);
@@ -2436,8 +2460,13 @@ gtk_menu_realize (GtkWidget *widget)
attributes.x = 0;
attributes.y = 0;
- attributes.width = MAX (1, allocation.width - (border_width + style->xthickness + horizontal_padding) * 2);
- attributes.height = MAX (1, priv->requested_height - (border_width + style->ythickness + vertical_padding) * 2);
+ attributes.width = allocation.width + (2 * (border_width + horizontal_padding)) +
+ border.left + border.right;
+ attributes.height = priv->requested_height - (2 * (border_width + vertical_padding)) +
+ border.top + border.bottom;
+
+ attributes.width = MAX (1, attributes.width);
+ attributes.height = MAX (1, attributes.height);
menu->bin_window = gdk_window_new (menu->view_window,
&attributes, attributes_mask);
@@ -2452,10 +2481,9 @@ gtk_menu_realize (GtkWidget *widget)
gtk_widget_set_parent_window (child, menu->bin_window);
}
- gtk_widget_style_attach (widget);
- gtk_style_set_background (style, menu->bin_window, GTK_STATE_NORMAL);
- gtk_style_set_background (style, menu->view_window, GTK_STATE_NORMAL);
- gtk_style_set_background (style, window, GTK_STATE_NORMAL);
+ gtk_style_context_set_background (context, menu->bin_window);
+ gtk_style_context_set_background (context, menu->view_window);
+ gtk_style_context_set_background (context, window);
if (GTK_MENU_SHELL (widget)->active_menu_item)
gtk_menu_scroll_item_visible (GTK_MENU_SHELL (widget),
@@ -2625,14 +2653,14 @@ gtk_menu_size_allocate (GtkWidget *widget,
GtkWidget *child;
GtkAllocation child_allocation;
GtkMenuPrivate *priv;
- GtkStyle *style;
GList *children;
gint x, y, i;
gint width, height;
guint border_width;
guint vertical_padding;
guint horizontal_padding;
-
+ GtkBorder border;
+
g_return_if_fail (GTK_IS_MENU (widget));
g_return_if_fail (allocation != NULL);
@@ -2642,12 +2670,12 @@ gtk_menu_size_allocate (GtkWidget *widget,
gtk_widget_set_allocation (widget, allocation);
- style = gtk_widget_get_style (widget);
-
gtk_widget_style_get (GTK_WIDGET (menu),
"vertical-padding", &vertical_padding,
"horizontal-padding", &horizontal_padding,
NULL);
+
+ get_menu_border (widget, &border);
border_width = gtk_container_get_border_width (GTK_CONTAINER (menu));
g_free (priv->heights);
@@ -2658,15 +2686,17 @@ gtk_menu_size_allocate (GtkWidget *widget,
NULL);
/* refresh our cached height request */
- priv->requested_height = (border_width + vertical_padding + style->ythickness) * 2;
+ priv->requested_height = (2 * (border_width + vertical_padding)) +
+ border.top + border.bottom;
for (i = 0; i < priv->heights_length; i++)
priv->requested_height += priv->heights[i];
- x = border_width + style->xthickness + horizontal_padding;
- y = border_width + style->ythickness + vertical_padding;
-
- width = MAX (1, allocation->width - x * 2);
- height = MAX (1, allocation->height - y * 2);
+ x = border_width + border.left + horizontal_padding;
+ y = border_width + border.top + vertical_padding;
+ width = allocation->width - (2 * (border_width + horizontal_padding)) -
+ border.left - border.right;
+ height = allocation->height - (2 * (border_width + vertical_padding)) -
+ border.top - border.bottom;
if (menu_shell->active)
gtk_menu_scroll_to (menu, menu->scroll_offset);
@@ -2681,6 +2711,9 @@ gtk_menu_size_allocate (GtkWidget *widget,
height -= arrow_border.bottom;
}
+ width = MAX (1, width);
+ height = MAX (1, height);
+
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (gtk_widget_get_window (widget),
@@ -2801,14 +2834,12 @@ get_arrows_visible_area (GtkMenu *menu,
gint *arrow_space)
{
GtkArrowPlacement arrow_placement;
- GtkStyle *style;
GtkWidget *widget = GTK_WIDGET (menu);
guint border_width;
guint vertical_padding;
guint horizontal_padding;
gint scroll_arrow_height;
-
- style = gtk_widget_get_style (widget);
+ GtkBorder menu_border;
gtk_widget_style_get (widget,
"vertical-padding", &vertical_padding,
@@ -2817,9 +2848,10 @@ get_arrows_visible_area (GtkMenu *menu,
"arrow-placement", &arrow_placement,
NULL);
+ get_menu_border (widget, &menu_border);
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
- border->x = border_width + style->xthickness + horizontal_padding;
- border->y = border_width + style->ythickness + vertical_padding;
+ border->x = border_width + menu_border.left + horizontal_padding;
+ border->y = border_width + menu_border.top + vertical_padding;
border->width = gdk_window_get_width (gtk_widget_get_window (widget));
border->height = gdk_window_get_height (gtk_widget_get_window (widget));
@@ -2867,7 +2899,7 @@ get_arrows_visible_area (GtkMenu *menu,
lower->x = lower->y = lower->width = lower->height = 0;
}
- *arrow_space = scroll_arrow_height - 2 * style->ythickness;
+ *arrow_space = scroll_arrow_height - menu_border.top - menu_border.bottom;
}
static gboolean
@@ -2876,20 +2908,23 @@ gtk_menu_draw (GtkWidget *widget,
{
GtkMenu *menu;
GtkMenuPrivate *priv;
- GtkStyle *style;
+ GtkStyleContext *context;
GdkRectangle border;
GdkRectangle upper;
GdkRectangle lower;
GdkWindow *window;
gint arrow_space;
-
+ GtkStateFlags state;
+ GtkBorder menu_border;
+
menu = GTK_MENU (widget);
priv = gtk_menu_get_private (menu);
-
- style = gtk_widget_get_style (widget);
+ context = gtk_widget_get_style_context (widget);
window = gtk_widget_get_window (widget);
+ state = gtk_widget_get_state_flags (widget);
get_arrows_visible_area (menu, &border, &upper, &lower, &arrow_space);
+ get_menu_border (widget, &menu_border);
if (gtk_cairo_should_draw_window (cr, gtk_widget_get_window (widget)))
{
@@ -2899,62 +2934,57 @@ gtk_menu_draw (GtkWidget *widget,
gtk_widget_style_get (widget, "arrow-scaling", &arrow_scaling, NULL);
arrow_size = arrow_scaling * arrow_space;
- gtk_paint_box (style,
- cr,
- GTK_STATE_NORMAL,
- GTK_SHADOW_OUT,
- widget, "menu",
- 0, 0,
- gtk_widget_get_allocated_width (widget),
- gtk_widget_get_allocated_height (widget));
+ gtk_render_background (context, cr, 0, 0,
+ gtk_widget_get_allocated_width (widget),
+ gtk_widget_get_allocated_height (widget));
+ gtk_render_frame (context, cr, 0, 0,
+ gtk_widget_get_allocated_width (widget),
+ gtk_widget_get_allocated_height (widget));
+
+ gtk_style_context_save (context);
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_BUTTON);
if (menu->upper_arrow_visible && !menu->tearoff_active)
{
- gtk_paint_box (style,
- cr,
- priv->upper_arrow_state,
- GTK_SHADOW_OUT,
- widget, "menu_scroll_arrow_up",
- upper.x,
- upper.y,
- upper.width,
- upper.height);
-
- gtk_paint_arrow (style,
- cr,
- priv->upper_arrow_state,
- GTK_SHADOW_OUT,
- widget, "menu_scroll_arrow_up",
- GTK_ARROW_UP,
- TRUE,
+ gtk_style_context_save (context);
+ gtk_style_context_set_state (context, priv->upper_arrow_state);
+
+ gtk_render_background (context, cr,
+ upper.x, upper.y,
+ upper.width, upper.height);
+ gtk_render_frame (context, cr,
+ upper.x, upper.y,
+ upper.width, upper.height);
+
+ gtk_render_arrow (context, cr, 0,
upper.x + (upper.width - arrow_size) / 2,
- upper.y + style->ythickness + (arrow_space - arrow_size) / 2,
- arrow_size, arrow_size);
+ upper.y + menu_border.top + (arrow_space - arrow_size) / 2,
+ arrow_size);
+
+ gtk_style_context_restore (context);
}
if (menu->lower_arrow_visible && !menu->tearoff_active)
{
- gtk_paint_box (style,
- cr,
- priv->lower_arrow_state,
- GTK_SHADOW_OUT,
- widget, "menu_scroll_arrow_down",
- lower.x,
- lower.y,
- lower.width,
- lower.height);
-
- gtk_paint_arrow (style,
- cr,
- priv->lower_arrow_state,
- GTK_SHADOW_OUT,
- widget, "menu_scroll_arrow_down",
- GTK_ARROW_DOWN,
- TRUE,
- lower.x + (lower.width - arrow_size) / 2,
- lower.y + style->ythickness + (arrow_space - arrow_size) / 2,
- arrow_size, arrow_size);
+ gtk_style_context_save (context);
+ gtk_style_context_set_state (context, priv->lower_arrow_state);
+
+ gtk_render_background (context, cr,
+ lower.x, lower.y,
+ lower.width, lower.height);
+ gtk_render_frame (context, cr,
+ lower.x, lower.y,
+ lower.width, lower.height);
+
+ gtk_render_arrow (context, cr, G_PI,
+ lower.x + (lower.width - arrow_size) / 2,
+ lower.y + menu_border.top + (arrow_space - arrow_size) / 2,
+ arrow_size);
+
+ gtk_style_context_restore (context);
}
+
+ gtk_style_context_restore (context);
}
if (gtk_cairo_should_draw_window (cr, menu->bin_window))
@@ -2972,13 +3002,12 @@ gtk_menu_draw (GtkWidget *widget,
y -= arrow_border.top;
}
- gtk_paint_box (style,
- cr,
- GTK_STATE_NORMAL,
- GTK_SHADOW_OUT,
- widget, "menu",
- - border.x, y,
- border.width, border.height);
+ gtk_render_background (context, cr,
+ - border.x, y,
+ border.width, border.height);
+ gtk_render_frame (context, cr,
+ - border.x, y,
+ border.width, border.height);
cairo_restore (cr);
}
@@ -3007,7 +3036,6 @@ gtk_menu_get_preferred_width (GtkWidget *widget,
GtkMenu *menu;
GtkMenuShell *menu_shell;
GtkMenuPrivate *priv;
- GtkStyle *style;
GtkWidget *child;
GList *children;
guint max_toggle_size;
@@ -3016,13 +3044,12 @@ gtk_menu_get_preferred_width (GtkWidget *widget,
guint border_width;
gint child_min, child_nat;
gint min_width, nat_width;
+ GtkBorder border;
menu = GTK_MENU (widget);
menu_shell = GTK_MENU_SHELL (widget);
priv = gtk_menu_get_private (menu);
- style = gtk_widget_get_style (GTK_WIDGET (widget));
-
min_width = nat_width = 0;
max_toggle_size = 0;
@@ -3073,16 +3100,31 @@ gtk_menu_get_preferred_width (GtkWidget *widget,
gtk_menu_get_n_columns (menu) == 1 &&
!priv->no_toggle_size)
{
+ GtkStyleContext *context;
+ GtkWidgetPath *menu_path, *check_path;
guint toggle_spacing;
guint indicator_size;
- gtk_style_get (style,
- GTK_TYPE_CHECK_MENU_ITEM,
- "toggle-spacing", &toggle_spacing,
- "indicator-size", &indicator_size,
- NULL);
+ context = gtk_widget_get_style_context (widget);
+ menu_path = gtk_widget_path_copy (gtk_style_context_get_path (context));
+
+ /* Create a GtkCheckMenuItem path, only to query indicator spacing */
+ check_path = gtk_widget_path_copy (menu_path);
+ gtk_widget_path_append_type (check_path, GTK_TYPE_CHECK_MENU_ITEM);
+
+ gtk_style_context_set_path (context, check_path);
+ gtk_widget_path_free (check_path);
+
+ gtk_style_context_get_style (context,
+ "toggle-spacing", &toggle_spacing,
+ "indicator-size", &indicator_size,
+ NULL);
max_toggle_size = indicator_size + toggle_spacing;
+
+ /* Restore real widget path */
+ gtk_style_context_set_path (context, menu_path);
+ gtk_widget_path_free (menu_path);
}
min_width += 2 * max_toggle_size + max_accel_width;
@@ -3095,10 +3137,13 @@ gtk_menu_get_preferred_width (GtkWidget *widget,
"horizontal-padding", &horizontal_padding,
NULL);
+ get_menu_border (widget, &border);
border_width = gtk_container_get_border_width (GTK_CONTAINER (menu));
- min_width += (border_width + horizontal_padding + style->xthickness) * 2;
- nat_width += (border_width + horizontal_padding + style->xthickness) * 2;
-
+ min_width += (2 * (border_width + horizontal_padding)) +
+ border.left + border.right;
+ nat_width += (2 * (border_width + horizontal_padding)) +
+ border.top + border.bottom;
+
menu->toggle_size = max_toggle_size;
priv->accel_size = max_accel_width;
@@ -3934,7 +3979,7 @@ gtk_menu_handle_scrolling (GtkMenu *menu,
if (touchscreen_mode)
menu->upper_arrow_prelight = in_arrow;
- if (priv->upper_arrow_state != GTK_STATE_INSENSITIVE)
+ if ((priv->upper_arrow_state & GTK_STATE_FLAG_INSENSITIVE) == 0)
{
gboolean arrow_pressed = FALSE;
@@ -4008,14 +4053,15 @@ gtk_menu_handle_scrolling (GtkMenu *menu,
* menu, so check if the button isn't insensitive before
* changing it to something else.
*/
- if (priv->upper_arrow_state != GTK_STATE_INSENSITIVE)
+ if ((priv->upper_arrow_state & GTK_STATE_FLAG_INSENSITIVE) == 0)
{
- GtkStateType arrow_state = GTK_STATE_NORMAL;
+ GtkStateFlags arrow_state = 0;
if (arrow_pressed)
- arrow_state = GTK_STATE_ACTIVE;
- else if (menu->upper_arrow_prelight)
- arrow_state = GTK_STATE_PRELIGHT;
+ arrow_state |= GTK_STATE_FLAG_ACTIVE;
+
+ if (menu->upper_arrow_prelight)
+ arrow_state |= GTK_STATE_FLAG_PRELIGHT;
if (arrow_state != priv->upper_arrow_state)
{
@@ -4042,7 +4088,7 @@ gtk_menu_handle_scrolling (GtkMenu *menu,
if (touchscreen_mode)
menu->lower_arrow_prelight = in_arrow;
- if (priv->lower_arrow_state != GTK_STATE_INSENSITIVE)
+ if ((priv->lower_arrow_state & GTK_STATE_FLAG_INSENSITIVE) == 0)
{
gboolean arrow_pressed = FALSE;
@@ -4116,14 +4162,15 @@ gtk_menu_handle_scrolling (GtkMenu *menu,
* menu, so check if the button isn't insensitive before
* changing it to something else.
*/
- if (priv->lower_arrow_state != GTK_STATE_INSENSITIVE)
+ if ((priv->lower_arrow_state & GTK_STATE_FLAG_INSENSITIVE) == 0)
{
- GtkStateType arrow_state = GTK_STATE_NORMAL;
+ GtkStateFlags arrow_state = 0;
if (arrow_pressed)
- arrow_state = GTK_STATE_ACTIVE;
- else if (menu->lower_arrow_prelight)
- arrow_state = GTK_STATE_PRELIGHT;
+ arrow_state |= GTK_STATE_FLAG_ACTIVE;
+
+ if (menu->lower_arrow_prelight)
+ arrow_state |= GTK_STATE_FLAG_PRELIGHT;
if (arrow_state != priv->lower_arrow_state)
{
@@ -4536,14 +4583,14 @@ gtk_menu_position (GtkMenu *menu,
}
else
{
- GtkStyle *style = gtk_widget_get_style (widget);
gint space_left, space_right, space_above, space_below;
gint needed_width;
gint needed_height;
- gint xthickness = style->xthickness;
- gint ythickness = style->ythickness;
+ GtkBorder border;
gboolean rtl = (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL);
+ get_menu_border (widget, &border);
+
/* The placement of popup menus horizontally works like this (with
* RTL in parentheses)
*
@@ -4572,9 +4619,9 @@ gtk_menu_position (GtkMenu *menu,
/* position horizontally */
/* the amount of space we need to position the menu. Note the
- * menu is offset "xthickness" pixels
+ * menu is offset "thickness" pixels
*/
- needed_width = requisition.width - xthickness;
+ needed_width = requisition.width - border.left;
if (needed_width <= space_left ||
needed_width <= space_right)
@@ -4583,12 +4630,12 @@ gtk_menu_position (GtkMenu *menu,
(!rtl && needed_width > space_right))
{
/* position left */
- x = x + xthickness - requisition.width + 1;
+ x = x + border.left - requisition.width + 1;
}
else
{
/* position right */
- x = x - xthickness;
+ x = x - border.right;
}
/* x is clamped on-screen further down */
@@ -4627,15 +4674,15 @@ gtk_menu_position (GtkMenu *menu,
/* Position vertically. The algorithm is the same as above, but
* simpler because we don't have to take RTL into account.
*/
- needed_height = requisition.height - ythickness;
+ needed_height = requisition.height - border.top;
if (needed_height <= space_above ||
needed_height <= space_below)
{
if (needed_height <= space_below)
- y = y - ythickness;
+ y = y - border.top;
else
- y = y + ythickness - requisition.height + 1;
+ y = y + border.bottom - requisition.height + 1;
y = CLAMP (y, monitor.y,
monitor.y + monitor.height - requisition.height);
@@ -4747,8 +4794,7 @@ gtk_menu_scroll_to (GtkMenu *menu,
{
GtkMenuPrivate *priv;
GtkAllocation allocation;
- GtkBorder arrow_border;
- GtkStyle *style;
+ GtkBorder arrow_border, border;
GtkWidget *widget;
gint x, y;
gint view_width, view_height;
@@ -4776,23 +4822,23 @@ gtk_menu_scroll_to (GtkMenu *menu,
view_width = allocation.width;
view_height = allocation.height;
- style = gtk_widget_get_style (widget);
-
gtk_widget_style_get (GTK_WIDGET (menu),
"vertical-padding", &vertical_padding,
"horizontal-padding", &horizontal_padding,
NULL);
+ get_menu_border (widget, &border);
double_arrows = get_double_arrows (menu);
border_width = gtk_container_get_border_width (GTK_CONTAINER (menu));
- view_width -= (border_width + style->xthickness + horizontal_padding) * 2;
- view_height -= (border_width + style->ythickness + vertical_padding) * 2;
- menu_height = priv->requested_height - (border_width + style->ythickness + vertical_padding) * 2;
+ view_width -= (2 * (border_width + horizontal_padding)) + border.left + border.right;
+ view_height -= (2 * (border_width + vertical_padding)) + border.top + border.bottom;
+ menu_height = priv->requested_height - (2 * (border_width + vertical_padding)) -
+ border.top - border.bottom;
- x = border_width + style->xthickness + horizontal_padding;
- y = border_width + style->ythickness + vertical_padding;
+ x = border_width + border.left + horizontal_padding;
+ y = border_width + border.top + vertical_padding;
if (double_arrows && !menu->tearoff_active)
{
@@ -4801,8 +4847,8 @@ gtk_menu_scroll_to (GtkMenu *menu,
(offset < 0 && menu->scroll_offset < 0))
{
GtkMenuPrivate *priv = gtk_menu_get_private (menu);
- GtkStateType upper_arrow_previous_state = priv->upper_arrow_state;
- GtkStateType lower_arrow_previous_state = priv->lower_arrow_state;
+ GtkStateFlags upper_arrow_previous_state = priv->upper_arrow_state;
+ GtkStateFlags lower_arrow_previous_state = priv->lower_arrow_state;
if (!menu->upper_arrow_visible || !menu->lower_arrow_visible)
gtk_widget_queue_draw (GTK_WIDGET (menu));
@@ -4815,23 +4861,35 @@ gtk_menu_scroll_to (GtkMenu *menu,
view_height -= arrow_border.bottom;
if (offset <= 0)
- priv->upper_arrow_state = GTK_STATE_INSENSITIVE;
- else if (priv->upper_arrow_state == GTK_STATE_INSENSITIVE)
- priv->upper_arrow_state = menu->upper_arrow_prelight ?
- GTK_STATE_PRELIGHT : GTK_STATE_NORMAL;
+ priv->upper_arrow_state |= GTK_STATE_FLAG_INSENSITIVE;
+ else
+ {
+ priv->upper_arrow_state &= ~(GTK_STATE_FLAG_INSENSITIVE);
+
+ if (menu->upper_arrow_prelight)
+ priv->upper_arrow_state |= GTK_STATE_FLAG_PRELIGHT;
+ else
+ priv->upper_arrow_state &= ~(GTK_STATE_FLAG_PRELIGHT);
+ }
if (offset >= menu_height - view_height)
- priv->lower_arrow_state = GTK_STATE_INSENSITIVE;
- else if (priv->lower_arrow_state == GTK_STATE_INSENSITIVE)
- priv->lower_arrow_state = menu->lower_arrow_prelight ?
- GTK_STATE_PRELIGHT : GTK_STATE_NORMAL;
+ priv->lower_arrow_state |= GTK_STATE_FLAG_INSENSITIVE;
+ else
+ {
+ priv->lower_arrow_state &= ~(GTK_STATE_FLAG_INSENSITIVE);
+
+ if (menu->lower_arrow_prelight)
+ priv->lower_arrow_state |= GTK_STATE_FLAG_PRELIGHT;
+ else
+ priv->lower_arrow_state &= ~(GTK_STATE_FLAG_PRELIGHT);
+ }
if ((priv->upper_arrow_state != upper_arrow_previous_state) ||
(priv->lower_arrow_state != lower_arrow_previous_state))
gtk_widget_queue_draw (GTK_WIDGET (menu));
- if (upper_arrow_previous_state != GTK_STATE_INSENSITIVE &&
- priv->upper_arrow_state == GTK_STATE_INSENSITIVE)
+ if ((upper_arrow_previous_state & GTK_STATE_FLAG_INSENSITIVE) == 0 &&
+ (priv->upper_arrow_state & GTK_STATE_FLAG_INSENSITIVE) != 0)
{
/* At the upper border, possibly remove timeout */
if (menu->scroll_step < 0)
@@ -4841,8 +4899,8 @@ gtk_menu_scroll_to (GtkMenu *menu,
}
}
- if (lower_arrow_previous_state != GTK_STATE_INSENSITIVE &&
- priv->lower_arrow_state == GTK_STATE_INSENSITIVE)
+ if ((lower_arrow_previous_state & GTK_STATE_FLAG_INSENSITIVE) == 0 &&
+ (priv->lower_arrow_state & GTK_STATE_FLAG_INSENSITIVE) != 0)
{
/* At the lower border, possibly remove timeout */
if (menu->scroll_step > 0)
diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c
index a28622a65f..bb482844d7 100644
--- a/gtk/gtkmenubar.c
+++ b/gtk/gtkmenubar.c
@@ -214,9 +214,14 @@ gtk_menu_bar_class_init (GtkMenuBarClass *class)
static void
gtk_menu_bar_init (GtkMenuBar *menu_bar)
{
+ GtkStyleContext *context;
+
menu_bar->priv = G_TYPE_INSTANCE_GET_PRIVATE (menu_bar,
GTK_TYPE_MENU_BAR,
GtkMenuBarPrivate);
+
+ context = gtk_widget_get_style_context (GTK_WIDGET (menu_bar));
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_MENUBAR);
}
GtkWidget*
@@ -345,11 +350,18 @@ gtk_menu_bar_size_request (GtkWidget *widget,
if (get_shadow_type (menu_bar) != GTK_SHADOW_NONE)
{
- GtkStyle *style;
+ GtkStyleContext *context;
+ GtkBorder *border;
+
+ context = gtk_widget_get_style_context (widget);
+
+ gtk_style_context_get (context, 0,
+ "border-width", &border,
+ NULL);
- style = gtk_widget_get_style (widget);
- requisition->width += style->xthickness * 2;
- requisition->height += style->ythickness * 2;
+ requisition->width += border->left + border->right;
+ requisition->height += border->top + border->bottom;
+ gtk_border_free (border);
}
}
}
@@ -424,11 +436,18 @@ gtk_menu_bar_size_allocate (GtkWidget *widget,
if (get_shadow_type (menu_bar) != GTK_SHADOW_NONE)
{
- GtkStyle *style;
+ GtkStyleContext *context;
+ GtkBorder *border;
- style = gtk_widget_get_style (widget);
- child_allocation.x += style->xthickness;
- child_allocation.y += style->ythickness;
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_get (context, 0,
+ "border-width", &border,
+ NULL);
+
+ child_allocation.x += border->left;
+ child_allocation.y += border->top;
+
+ gtk_border_free (border);
}
if (priv->pack_direction == GTK_PACK_DIRECTION_LTR ||
@@ -539,18 +558,26 @@ static gint
gtk_menu_bar_draw (GtkWidget *widget,
cairo_t *cr)
{
+ GtkStyleContext *context;
+ GtkStateFlags state;
int border;
border = gtk_container_get_border_width (GTK_CONTAINER (widget));
+ context = gtk_widget_get_style_context (widget);
+
+ state = gtk_widget_get_state_flags (widget);
+ gtk_style_context_set_state (context, state);
+
+ if (get_shadow_type (GTK_MENU_BAR (widget)) != GTK_SHADOW_NONE)
+ gtk_render_background (context, cr,
+ border, border,
+ gtk_widget_get_allocated_width (widget) - border * 2,
+ gtk_widget_get_allocated_height (widget) - border * 2);
- gtk_paint_box (gtk_widget_get_style (widget),
- cr,
- gtk_widget_get_state (widget),
- get_shadow_type (GTK_MENU_BAR (widget)),
- widget, "menubar",
- border, border,
- gtk_widget_get_allocated_width (widget) - border * 2,
- gtk_widget_get_allocated_height (widget) - border * 2);
+ gtk_render_frame (context, cr,
+ border, border,
+ gtk_widget_get_allocated_width (widget) - border * 2,
+ gtk_widget_get_allocated_height (widget) - border * 2);
GTK_WIDGET_CLASS (gtk_menu_bar_parent_class)->draw (widget, cr);
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c
index d0dd5e9032..7a94bed278 100644
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -1626,7 +1626,8 @@ gtk_real_menu_item_select (GtkMenuItem *menu_item)
_gtk_menu_item_popup_submenu (GTK_WIDGET (menu_item), TRUE);
}
- gtk_widget_set_state (GTK_WIDGET (menu_item), GTK_STATE_PRELIGHT);
+ gtk_widget_set_state_flags (GTK_WIDGET (menu_item),
+ GTK_STATE_FLAG_PRELIGHT, FALSE);
gtk_widget_queue_draw (GTK_WIDGET (menu_item));
}
@@ -1636,7 +1637,8 @@ gtk_real_menu_item_deselect (GtkMenuItem *menu_item)
if (menu_item->submenu)
_gtk_menu_item_popdown_submenu (GTK_WIDGET (menu_item));
- gtk_widget_set_state (GTK_WIDGET (menu_item), GTK_STATE_NORMAL);
+ gtk_widget_unset_state_flags (GTK_WIDGET (menu_item),
+ GTK_STATE_FLAG_PRELIGHT);
gtk_widget_queue_draw (GTK_WIDGET (menu_item));
}
diff --git a/gtk/gtkmodifierstyle.c b/gtk/gtkmodifierstyle.c
new file mode 100644
index 0000000000..a8f4d3d729
--- /dev/null
+++ b/gtk/gtkmodifierstyle.c
@@ -0,0 +1,287 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+#include "gtkmodifierstyle.h"
+#include "gtkintl.h"
+
+typedef struct GtkModifierStylePrivate GtkModifierStylePrivate;
+typedef struct StylePropertyValue StylePropertyValue;
+
+struct GtkModifierStylePrivate
+{
+ GtkStyleProperties *style;
+ GHashTable *color_properties;
+};
+
+enum {
+ CHANGED,
+ LAST_SIGNAL
+};
+
+static guint signals [LAST_SIGNAL] = { 0 };
+
+static void gtk_modifier_style_provider_init (GtkStyleProviderIface *iface);
+static void gtk_modifier_style_finalize (GObject *object);
+
+G_DEFINE_TYPE_EXTENDED (GtkModifierStyle, gtk_modifier_style, G_TYPE_OBJECT, 0,
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_STYLE_PROVIDER,
+ gtk_modifier_style_provider_init));
+
+static void
+gtk_modifier_style_class_init (GtkModifierStyleClass *klass)
+{
+ GObjectClass *object_class;
+
+ object_class = G_OBJECT_CLASS (klass);
+
+ object_class->finalize = gtk_modifier_style_finalize;
+
+ signals[CHANGED] =
+ g_signal_new (I_("changed"),
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ 0, NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ g_type_class_add_private (object_class, sizeof (GtkModifierStylePrivate));
+}
+
+static void
+gtk_modifier_style_init (GtkModifierStyle *modifier_style)
+{
+ GtkModifierStylePrivate *priv;
+
+ priv = modifier_style->priv = G_TYPE_INSTANCE_GET_PRIVATE (modifier_style,
+ GTK_TYPE_MODIFIER_STYLE,
+ GtkModifierStylePrivate);
+
+ priv->color_properties = g_hash_table_new_full (g_str_hash,
+ g_str_equal,
+ (GDestroyNotify) g_free,
+ (GDestroyNotify) gdk_rgba_free);
+ priv->style = gtk_style_properties_new ();
+}
+
+static GtkStyleProperties *
+gtk_modifier_style_get_style (GtkStyleProvider *provider,
+ GtkWidgetPath *path)
+{
+ GtkModifierStylePrivate *priv;
+
+ priv = GTK_MODIFIER_STYLE (provider)->priv;
+ return g_object_ref (priv->style);
+}
+
+static gboolean
+gtk_modifier_style_get_style_property (GtkStyleProvider *provider,
+ GtkWidgetPath *path,
+ GtkStateFlags state,
+ GParamSpec *pspec,
+ GValue *value)
+{
+ GtkModifierStylePrivate *priv;
+ GdkColor *color;
+ gchar *str;
+
+ /* Reject non-color types for now */
+ if (pspec->value_type != GDK_TYPE_COLOR)
+ return FALSE;
+
+ priv = GTK_MODIFIER_STYLE (provider)->priv;
+ str = g_strdup_printf ("-%s-%s",
+ g_type_name (pspec->owner_type),
+ pspec->name);
+
+ color = g_hash_table_lookup (priv->color_properties, str);
+ g_free (str);
+
+ if (!color)
+ return FALSE;
+
+ g_value_set_boxed (value, color);
+ return TRUE;
+}
+
+static void
+gtk_modifier_style_provider_init (GtkStyleProviderIface *iface)
+{
+ iface->get_style = gtk_modifier_style_get_style;
+ iface->get_style_property = gtk_modifier_style_get_style_property;
+}
+
+static void
+gtk_modifier_style_finalize (GObject *object)
+{
+ GtkModifierStylePrivate *priv;
+
+ priv = GTK_MODIFIER_STYLE (object)->priv;
+ g_hash_table_destroy (priv->color_properties);
+ g_object_unref (priv->style);
+
+ G_OBJECT_CLASS (gtk_modifier_style_parent_class)->finalize (object);
+}
+
+GtkModifierStyle *
+gtk_modifier_style_new (void)
+{
+ return g_object_new (GTK_TYPE_MODIFIER_STYLE, NULL);
+}
+
+static void
+modifier_style_set_color (GtkModifierStyle *style,
+ const gchar *prop,
+ GtkStateFlags state,
+ const GdkRGBA *color)
+{
+ GtkModifierStylePrivate *priv;
+ GdkRGBA *old_color;
+
+ g_return_if_fail (GTK_IS_MODIFIER_STYLE (style));
+
+ priv = style->priv;
+ gtk_style_properties_get (priv->style, state,
+ prop, &old_color,
+ NULL);
+
+ if ((!color && !old_color) ||
+ (color && old_color && gdk_rgba_equal (color, old_color)))
+ {
+ gdk_rgba_free (old_color);
+ return;
+ }
+
+ if (color)
+ gtk_style_properties_set (priv->style, state,
+ prop, color,
+ NULL);
+ else
+ gtk_style_properties_unset_property (priv->style, prop, state);
+
+ g_signal_emit (style, signals[CHANGED], 0);
+ gdk_rgba_free (old_color);
+}
+
+void
+gtk_modifier_style_set_background_color (GtkModifierStyle *style,
+ GtkStateFlags state,
+ const GdkRGBA *color)
+{
+ g_return_if_fail (GTK_IS_MODIFIER_STYLE (style));
+
+ modifier_style_set_color (style, "background-color", state, color);
+}
+
+void
+gtk_modifier_style_set_color (GtkModifierStyle *style,
+ GtkStateFlags state,
+ const GdkRGBA *color)
+{
+ g_return_if_fail (GTK_IS_MODIFIER_STYLE (style));
+
+ modifier_style_set_color (style, "color", state, color);
+}
+
+void
+gtk_modifier_style_set_font (GtkModifierStyle *style,
+ const PangoFontDescription *font_desc)
+{
+ GtkModifierStylePrivate *priv;
+ PangoFontDescription *old_font;
+
+ g_return_if_fail (GTK_IS_MODIFIER_STYLE (style));
+
+ priv = style->priv;
+ gtk_style_properties_get (priv->style, 0,
+ "font", &old_font,
+ NULL);
+
+ if ((!old_font && !font_desc) ||
+ (old_font && font_desc &&
+ pango_font_description_equal (old_font, font_desc)))
+ return;
+
+ if (font_desc)
+ gtk_style_properties_set (priv->style, 0,
+ "font", font_desc,
+ NULL);
+ else
+ gtk_style_properties_unset_property (priv->style, "font", 0);
+
+ g_signal_emit (style, signals[CHANGED], 0);
+}
+
+void
+gtk_modifier_style_map_color (GtkModifierStyle *style,
+ const gchar *name,
+ const GdkRGBA *color)
+{
+ GtkModifierStylePrivate *priv;
+ GtkSymbolicColor *symbolic_color = NULL;
+
+ g_return_if_fail (GTK_IS_MODIFIER_STYLE (style));
+ g_return_if_fail (name != NULL);
+
+ priv = style->priv;
+
+ if (color)
+ symbolic_color = gtk_symbolic_color_new_literal (color);
+
+ gtk_style_properties_map_color (priv->style,
+ name, symbolic_color);
+
+ g_signal_emit (style, signals[CHANGED], 0);
+}
+
+void
+gtk_modifier_style_set_color_property (GtkModifierStyle *style,
+ GType widget_type,
+ const gchar *prop_name,
+ const GdkColor *color)
+{
+ GtkModifierStylePrivate *priv;
+ const GdkColor *old_color;
+ gchar *str;
+
+ g_return_if_fail (GTK_IS_MODIFIER_STYLE (style));
+ g_return_if_fail (g_type_is_a (widget_type, GTK_TYPE_WIDGET));
+ g_return_if_fail (prop_name != NULL);
+
+ priv = style->priv;
+ str = g_strdup_printf ("-%s-%s", g_type_name (widget_type), prop_name);
+
+ old_color = g_hash_table_lookup (priv->color_properties, str);
+
+ if ((!color && !old_color) ||
+ (color && old_color && gdk_color_equal (color, old_color)))
+ {
+ g_free (str);
+ return;
+ }
+
+ if (color)
+ g_hash_table_insert (priv->color_properties, str,
+ gdk_color_copy (color));
+ else
+ g_hash_table_remove (priv->color_properties, str);
+
+ g_signal_emit (style, signals[CHANGED], 0);
+ g_free (str);
+}
diff --git a/gtk/gtkmodifierstyle.h b/gtk/gtkmodifierstyle.h
new file mode 100644
index 0000000000..6275b7c657
--- /dev/null
+++ b/gtk/gtkmodifierstyle.h
@@ -0,0 +1,74 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GTK_MODIFIER_STYLE_H__
+#define __GTK_MODIFIER_STYLE_H__
+
+#include <glib-object.h>
+#include <gdk/gdk.h>
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_MODIFIER_STYLE (gtk_modifier_style_get_type ())
+#define GTK_MODIFIER_STYLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_MODIFIER_STYLE, GtkModifierStyle))
+#define GTK_MODIFIER_STYLE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GTK_TYPE_MODIFIER_STYLE, GtkModifierStyleClass))
+#define GTK_IS_MODIFIER_STYLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_MODIFIER_STYLE))
+#define GTK_IS_MODIFIER_STYLE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GTK_TYPE_MODIFIER_STYLE))
+#define GTK_MODIFIER_STYLE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_MODIFIER_STYLE, GtkModifierStyleClass))
+
+typedef struct _GtkModifierStyle GtkModifierStyle;
+typedef struct _GtkModifierStyleClass GtkModifierStyleClass;
+
+struct _GtkModifierStyle
+{
+ GObject parent_object;
+ gpointer priv;
+};
+
+struct _GtkModifierStyleClass
+{
+ GObjectClass parent_class;
+};
+
+GType gtk_modifier_style_get_type (void) G_GNUC_CONST;
+
+GtkModifierStyle * gtk_modifier_style_new (void);
+
+void gtk_modifier_style_set_background_color (GtkModifierStyle *style,
+ GtkStateFlags state,
+ const GdkRGBA *color);
+void gtk_modifier_style_set_color (GtkModifierStyle *style,
+ GtkStateFlags state,
+ const GdkRGBA *color);
+void gtk_modifier_style_set_font (GtkModifierStyle *style,
+ const PangoFontDescription *font_desc);
+
+void gtk_modifier_style_map_color (GtkModifierStyle *style,
+ const gchar *name,
+ const GdkRGBA *color);
+
+void gtk_modifier_style_set_color_property (GtkModifierStyle *style,
+ GType widget_type,
+ const gchar *prop_name,
+ const GdkColor *color);
+
+G_END_DECLS
+
+#endif /* __GTK_MODIFIER_STYLE_H__ */
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 5a765eaf6a..f5a4db5cc9 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -462,7 +462,9 @@ static void gtk_notebook_paint (GtkWidget *widget,
cairo_t *cr);
static void gtk_notebook_draw_tab (GtkNotebook *notebook,
GtkNotebookPage *page,
- cairo_t *cr);
+ cairo_t *cr,
+ guint position,
+ gboolean is_last);
static void gtk_notebook_draw_arrow (GtkNotebook *notebook,
cairo_t *cr,
GtkNotebookArrow arrow);
@@ -2447,7 +2449,7 @@ gtk_notebook_draw (GtkWidget *widget,
gtk_notebook_draw_tab (notebook,
priv->cur_page,
- cr);
+ cr, 0, FALSE);
cairo_restore (cr);
@@ -4649,7 +4651,7 @@ gtk_notebook_remove_tab_label (GtkNotebook *notebook,
page->mnemonic_activate_signal);
page->mnemonic_activate_signal = 0;
- gtk_widget_set_state (page->tab_label, GTK_STATE_NORMAL);
+ gtk_widget_set_state_flags (page->tab_label, 0, TRUE);
gtk_widget_unparent (page->tab_label);
page->tab_label = NULL;
}
@@ -4895,8 +4897,8 @@ gtk_notebook_paint (GtkWidget *widget,
gint x, y;
guint border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
gint gap_x = 0, gap_width = 0, step = STEP_PREV;
- gboolean is_rtl;
- gint tab_pos;
+ gboolean is_rtl, cur_page_end;
+ gint tab_pos, i, cur_page_pos;
notebook = GTK_NOTEBOOK (widget);
priv = notebook->priv;
@@ -4965,7 +4967,7 @@ gtk_notebook_paint (GtkWidget *widget,
gap_x = priv->cur_page->allocation.x - allocation.x - border_width;
gap_width = priv->cur_page->allocation.width;
- step = is_rtl ? STEP_NEXT : STEP_PREV;
+ step = is_rtl ? STEP_PREV : STEP_NEXT;
break;
case GTK_POS_LEFT:
case GTK_POS_RIGHT:
@@ -4987,6 +4989,8 @@ gtk_notebook_paint (GtkWidget *widget,
showarrow = FALSE;
children = gtk_notebook_search_page (notebook, NULL, step, TRUE);
+ i = 0;
+
while (children)
{
page = children->data;
@@ -4996,8 +5000,18 @@ gtk_notebook_paint (GtkWidget *widget,
continue;
if (!gtk_widget_get_mapped (page->tab_label))
showarrow = TRUE;
- else if (page != priv->cur_page)
- gtk_notebook_draw_tab (notebook, page, cr);
+ else
+ {
+ if (page != priv->cur_page)
+ gtk_notebook_draw_tab (notebook, page, cr, i, children != NULL);
+ else
+ {
+ cur_page_pos = i;
+ cur_page_end = (children != NULL);
+ }
+
+ i++;
+ }
}
if (showarrow && priv->scrollable)
@@ -5013,18 +5027,22 @@ gtk_notebook_paint (GtkWidget *widget,
}
if (priv->operation != DRAG_OPERATION_REORDER)
- gtk_notebook_draw_tab (notebook, priv->cur_page, cr);
+ gtk_notebook_draw_tab (notebook, priv->cur_page, cr, cur_page_pos, cur_page_end);
}
static void
gtk_notebook_draw_tab (GtkNotebook *notebook,
GtkNotebookPage *page,
- cairo_t *cr)
+ cairo_t *cr,
+ guint position,
+ gboolean is_last)
{
GtkNotebookPrivate *priv;
GtkStateType state_type;
GtkWidget *widget;
-
+ GtkStyleContext *context;
+ GtkRegionFlags flags = 0;
+
if (!NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page) ||
!gtk_widget_get_mapped (page->tab_label) ||
(page->allocation.width == 0) || (page->allocation.height == 0))
@@ -5038,6 +5056,20 @@ gtk_notebook_draw_tab (GtkNotebook *notebook,
else
state_type = GTK_STATE_ACTIVE;
+ if ((position + 1) % 2 == 0)
+ flags |= GTK_REGION_EVEN;
+ else
+ flags |= GTK_REGION_ODD;
+
+ if (position == 0)
+ flags |= GTK_REGION_FIRST;
+
+ if (is_last)
+ flags |= GTK_REGION_LAST;
+
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_add_region (context, "tab", flags);
+
gtk_paint_extension (gtk_widget_get_style (widget), cr,
state_type, GTK_SHADOW_OUT,
widget, "tab",
@@ -5063,6 +5095,8 @@ gtk_notebook_draw_tab (GtkNotebook *notebook,
allocation.width + 2 * focus_width,
allocation.height + 2 * focus_width);
}
+
+ gtk_style_context_remove_region (context, "tab");
}
static void
@@ -6171,9 +6205,9 @@ gtk_notebook_update_tab_states (GtkNotebook *notebook)
if (page->tab_label)
{
if (page == priv->cur_page)
- gtk_widget_set_state (page->tab_label, GTK_STATE_NORMAL);
- else
- gtk_widget_set_state (page->tab_label, GTK_STATE_ACTIVE);
+ gtk_widget_set_state_flags (page->tab_label, GTK_STATE_FLAG_ACTIVE, TRUE);
+ else
+ gtk_widget_set_state_flags (page->tab_label, 0, TRUE);
}
}
}
diff --git a/gtk/gtkplug-x11.c b/gtk/gtkplug-x11.c
index ca3af73c27..df98e93e29 100644
--- a/gtk/gtkplug-x11.c
+++ b/gtk/gtkplug-x11.c
@@ -57,7 +57,7 @@ static void xembed_set_info (GdkWindow *window,
GdkNativeWindow
_gtk_plug_windowing_get_id (GtkPlug *plug)
{
- return GDK_WINDOW_XWINDOW (gtk_widget_get_window (GTK_WIDGET (plug)));
+ return GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (plug)));
}
void
@@ -146,7 +146,7 @@ xembed_set_info (GdkWindow *window,
buffer[1] = flags;
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_WINDOW_XWINDOW (window),
+ GDK_WINDOW_XID (window),
xembed_info_atom, xembed_info_atom, 32,
PropModeReplace,
(unsigned char *)buffer, 2);
@@ -280,7 +280,7 @@ _gtk_plug_windowing_filter_func (GdkXEvent *gdk_xevent,
* Probably need check in _gtk_plug_add_to_socket
*/
- if (xre->parent != GDK_WINDOW_XWINDOW (priv->socket_window))
+ if (xre->parent != GDK_WINDOW_XID (priv->socket_window))
{
GtkWidget *widget = GTK_WIDGET (plug);
@@ -297,7 +297,7 @@ _gtk_plug_windowing_filter_func (GdkXEvent *gdk_xevent,
* be invisible to the app.
*/
- if (xre->parent == GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (screen)))
+ if (xre->parent == GDK_WINDOW_XID (gdk_screen_get_root_window (screen)))
{
GTK_NOTE (PLUGSOCKET, g_message ("GtkPlug: calling gtk_plug_send_delete_event()"));
_gtk_plug_send_delete_event (widget);
@@ -309,7 +309,7 @@ _gtk_plug_windowing_filter_func (GdkXEvent *gdk_xevent,
goto done;
}
- if (xre->parent != GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (screen)))
+ if (xre->parent != GDK_WINDOW_XID (gdk_screen_get_root_window (screen)))
{
/* Start of embedding protocol */
diff --git a/gtk/gtkradiobutton.c b/gtk/gtkradiobutton.c
index ff607cea56..424d8505f4 100644
--- a/gtk/gtkradiobutton.c
+++ b/gtk/gtkradiobutton.c
@@ -217,7 +217,7 @@ gtk_radio_button_init (GtkRadioButton *radio_button)
priv->group = g_slist_prepend (NULL, radio_button);
_gtk_button_set_depressed (GTK_BUTTON (radio_button), TRUE);
- gtk_widget_set_state (GTK_WIDGET (radio_button), GTK_STATE_ACTIVE);
+ gtk_widget_set_state_flags (GTK_WIDGET (radio_button), GTK_STATE_FLAG_ACTIVE, TRUE);
}
static void
@@ -790,7 +790,7 @@ gtk_radio_button_clicked (GtkButton *button)
GtkRadioButtonPrivate *priv = radio_button->priv;
GtkToggleButton *toggle_button = GTK_TOGGLE_BUTTON (button);
GtkToggleButton *tmp_button;
- GtkStateType new_state;
+ GtkStateFlags new_state = 0;
GSList *tmp_list;
gint toggled;
gboolean depressed;
@@ -818,14 +818,19 @@ gtk_radio_button_clicked (GtkButton *button)
if (!tmp_button)
{
- new_state = (button->priv->in_button ? GTK_STATE_PRELIGHT : GTK_STATE_ACTIVE);
+ if (button->priv->in_button)
+ new_state |= GTK_STATE_FLAG_PRELIGHT;
+
+ new_state |= GTK_STATE_FLAG_ACTIVE;
}
else
{
toggled = TRUE;
_gtk_toggle_button_set_active (toggle_button,
!gtk_toggle_button_get_active (toggle_button));
- new_state = (button->priv->in_button ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL);
+
+ if (button->priv->in_button)
+ new_state |= GTK_STATE_FLAG_PRELIGHT;
}
}
else
@@ -847,7 +852,10 @@ gtk_radio_button_clicked (GtkButton *button)
}
}
- new_state = (button->priv->in_button ? GTK_STATE_PRELIGHT : GTK_STATE_ACTIVE);
+ if (button->priv->in_button)
+ new_state |= GTK_STATE_FLAG_PRELIGHT;
+
+ new_state |= GTK_STATE_FLAG_ACTIVE;
}
if (gtk_toggle_button_get_inconsistent (toggle_button))
@@ -857,8 +865,8 @@ gtk_radio_button_clicked (GtkButton *button)
else
depressed = gtk_toggle_button_get_active (toggle_button);
- if (gtk_widget_get_state (GTK_WIDGET (button)) != new_state)
- gtk_widget_set_state (GTK_WIDGET (button), new_state);
+ if (gtk_widget_get_state_flags (GTK_WIDGET (button)) != new_state)
+ gtk_widget_set_state_flags (GTK_WIDGET (button), new_state, TRUE);
if (toggled)
{
@@ -883,9 +891,8 @@ gtk_radio_button_draw_indicator (GtkCheckButton *check_button,
GtkWidget *child;
GtkButton *button;
GtkToggleButton *toggle_button;
- GtkStateType state_type;
- GtkShadowType shadow_type;
- GtkStyle *style;
+ GtkStyleContext *context;
+ GtkStateFlags state = 0;
GdkWindow *window;
gint x, y;
gint indicator_size, indicator_spacing;
@@ -897,10 +904,10 @@ gtk_radio_button_draw_indicator (GtkCheckButton *check_button,
widget = GTK_WIDGET (check_button);
button = GTK_BUTTON (check_button);
toggle_button = GTK_TOGGLE_BUTTON (check_button);
+ context = gtk_widget_get_style_context (widget);
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
- style = gtk_widget_get_style (widget);
gtk_widget_style_get (widget,
"interior-focus", &interior_focus,
"focus-line-width", &focus_width,
@@ -921,37 +928,34 @@ gtk_radio_button_draw_indicator (GtkCheckButton *check_button,
x += focus_width + focus_pad;
if (gtk_toggle_button_get_inconsistent (toggle_button))
- shadow_type = GTK_SHADOW_ETCHED_IN;
+ state |= GTK_STATE_FLAG_INCONSISTENT;
else if (gtk_toggle_button_get_active (toggle_button))
- shadow_type = GTK_SHADOW_IN;
- else
- shadow_type = GTK_SHADOW_OUT;
+ state |= GTK_STATE_FLAG_ACTIVE;
if (button->priv->activate_timeout || (button->priv->button_down && button->priv->in_button))
- state_type = GTK_STATE_ACTIVE;
- else if (button->priv->in_button)
- state_type = GTK_STATE_PRELIGHT;
+ state |= GTK_STATE_FLAG_SELECTED;
+
+ if (button->priv->in_button)
+ state |= GTK_STATE_FLAG_PRELIGHT;
else if (!gtk_widget_is_sensitive (widget))
- state_type = GTK_STATE_INSENSITIVE;
- else
- state_type = GTK_STATE_NORMAL;
+ state |= GTK_STATE_FLAG_INSENSITIVE;
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
x = allocation.width - (indicator_size + x);
- if (gtk_widget_get_state (widget) == GTK_STATE_PRELIGHT)
- {
- gtk_paint_flat_box (style, cr,
- GTK_STATE_PRELIGHT,
- GTK_SHADOW_ETCHED_OUT,
- widget, "checkbutton",
- border_width, border_width,
- allocation.width - (2 * border_width),
- allocation.height - (2 * border_width));
- }
+ gtk_style_context_save (context);
+ gtk_style_context_set_state (context, state);
+
+ if (state & GTK_STATE_FLAG_PRELIGHT)
+ gtk_render_background (context, cr,
+ border_width, border_width,
+ allocation.width - (2 * border_width),
+ allocation.height - (2 * border_width));
+
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_CHECK);
+
+ gtk_render_option (context, cr,
+ x, y, indicator_size, indicator_size);
- gtk_paint_option (style, cr,
- state_type, shadow_type,
- widget, "radiobutton",
- x, y, indicator_size, indicator_size);
+ gtk_style_context_restore (context);
}
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index 27e8a7424e..3345e88a32 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -2956,7 +2956,9 @@ gtk_range_adjustment_value_changed (GtkAdjustment *adjustment,
gtk_widget_queue_draw (GTK_WIDGET (range));
/* setup a timer to ensure the range isn't lagging too much behind the scroll position */
if (!priv->repaint_id)
- priv->repaint_id = gdk_threads_add_timeout_full (GDK_PRIORITY_EVENTS, 181, force_repaint, range, NULL);
+ priv->repaint_id = gdk_threads_add_timeout_full (GDK_PRIORITY_EVENTS,
+ 181, force_repaint,
+ range, NULL);
}
/* Note that we don't round off to priv->round_digits here.
@@ -4076,8 +4078,8 @@ initial_timeout (gpointer data)
g_object_get (settings, "gtk-timeout-repeat", &timeout, NULL);
priv->timer->timeout_id = gdk_threads_add_timeout (timeout * SCROLL_DELAY_FACTOR,
- second_timeout,
- range);
+ second_timeout,
+ range);
/* remove self */
return FALSE;
}
@@ -4099,8 +4101,8 @@ gtk_range_add_step_timer (GtkRange *range,
priv->timer = g_new (GtkRangeStepTimer, 1);
priv->timer->timeout_id = gdk_threads_add_timeout (timeout,
- initial_timeout,
- range);
+ initial_timeout,
+ range);
priv->timer->step = step;
gtk_range_scroll (range, priv->timer->step);
@@ -4143,8 +4145,8 @@ gtk_range_reset_update_timer (GtkRange *range)
gtk_range_remove_update_timer (range);
priv->update_timeout_id = gdk_threads_add_timeout (UPDATE_DELAY,
- update_timeout,
- range);
+ update_timeout,
+ range);
}
static void
diff --git a/gtk/gtkrc.c b/gtk/gtkrc.c
index 84efc27a06..54cf2fcd76 100644
--- a/gtk/gtkrc.c
+++ b/gtk/gtkrc.c
@@ -541,9 +541,11 @@ gtk_rc_add_initial_default_files (void)
* gtk_rc_add_default_file:
* @filename: the pathname to the file. If @filename is not absolute, it
* is searched in the current directory.
- *
+ *
* Adds a file to the list of files to be parsed at the
* end of gtk_init().
+ *
+ * Deprecated:3.0: Use #GtkStyleContext with a custom #GtkStyleProvider instead
**/
void
gtk_rc_add_default_file (const gchar *filename)
@@ -571,9 +573,11 @@ gtk_rc_add_default_file (const gchar *filename)
/**
* gtk_rc_set_default_files:
* @filenames: A %NULL-terminated list of filenames.
- *
+ *
* Sets the list of files that GTK+ will read at the
* end of gtk_init().
+ *
+ * Deprecated:3.0: Use #GtkStyleContext with a custom #GtkStyleProvider instead
**/
void
gtk_rc_set_default_files (gchar **filenames)
@@ -608,6 +612,8 @@ gtk_rc_set_default_files (gchar **filenames)
* Return value: (transfer none): A %NULL-terminated array of filenames.
* This memory is owned by GTK+ and must not be freed by the application.
* If you want to store this information, you should make a copy.
+ *
+ * Deprecated:3.0: Use #GtkStyleContext instead
**/
gchar **
gtk_rc_get_default_files (void)
@@ -926,6 +932,7 @@ gtk_rc_parse_string (const gchar *rc_string)
g_return_if_fail (rc_string != NULL);
+#if 0
rc_file = g_new (GtkRcFile, 1);
rc_file->is_string = TRUE;
rc_file->name = g_strdup (rc_string);
@@ -938,6 +945,7 @@ gtk_rc_parse_string (const gchar *rc_string)
for (tmp_list = rc_contexts; tmp_list; tmp_list = tmp_list->next)
gtk_rc_context_parse_string (tmp_list->data, rc_string);
+#endif
}
static GtkRcFile *
@@ -1117,10 +1125,12 @@ gtk_rc_parse (const gchar *filename)
g_return_if_fail (filename != NULL);
+#if 0
add_to_rc_file_list (&global_rc_files, filename, TRUE);
for (tmp_list = rc_contexts; tmp_list; tmp_list = tmp_list->next)
gtk_rc_context_parse_file (tmp_list->data, filename, GTK_PATH_PRIO_RC, TRUE);
+#endif
}
/* Handling of RC styles */
@@ -1960,17 +1970,19 @@ sort_and_dereference_sets (GSList *styles)
/**
* gtk_rc_get_style:
* @widget: a #GtkWidget
- *
+ *
* Finds all matching RC styles for a given widget,
- * composites them together, and then creates a
+ * composites them together, and then creates a
* #GtkStyle representing the composite appearance.
- * (GTK+ actually keeps a cache of previously
+ * (GTK+ actually keeps a cache of previously
* created styles, so a new style may not be
* created.)
- *
+ *
* Returns: the resulting style. No refcount is added
* to the returned style, so if you want to save this
* style around, you should add a reference yourself.
+ *
+ * Deprecated:3.0: Use #GtkStyleContext instead
**/
GtkStyle *
gtk_rc_get_style (GtkWidget *widget)
@@ -2078,16 +2090,18 @@ gtk_rc_get_style (GtkWidget *widget)
* |[
* gtk_widget_path (widget, NULL, &path, NULL);
* gtk_widget_class_path (widget, NULL, &class_path, NULL);
- * gtk_rc_get_style_by_paths (gtk_widget_get_settings (widget),
+ * gtk_rc_get_style_by_paths (gtk_widget_get_settings (widget),
* path, class_path,
* G_OBJECT_TYPE (widget));
* ]|
- *
+ *
* Return value: (transfer none): A style created by matching with the
* supplied paths, or %NULL if nothing matching was specified and the
* default style should be used. The returned value is owned by GTK+
* as part of an internal cache, so you must call g_object_ref() on
* the returned value if you want to keep a reference to it.
+ *
+ * Deprecated:3.0: Use #GtkStyleContext instead
**/
GtkStyle *
gtk_rc_get_style_by_paths (GtkSettings *settings,
@@ -2167,6 +2181,11 @@ gtk_rc_get_style_by_paths (GtkSettings *settings,
return NULL;
}
+/**
+ * gtk_rc_scanner_new:
+ *
+ * Deprecated:3.0: Use #GtkCssProvider instead
+ */
GScanner*
gtk_rc_scanner_new (void)
{
@@ -2183,6 +2202,7 @@ gtk_rc_parse_any (GtkRcContext *context,
guint i;
gboolean done;
+#if 0
scanner = gtk_rc_scanner_new ();
if (input_fd >= 0)
@@ -2264,6 +2284,7 @@ gtk_rc_parse_any (GtkRcContext *context,
}
g_scanner_destroy (scanner);
+#endif
}
static guint
@@ -3705,6 +3726,13 @@ gtk_rc_parse_engine (GtkRcContext *context,
return result;
}
+/**
+ * gtk_rc_parse_state:
+ * @scanner:
+ * @state:
+ *
+ * Deprecated:3.0: Use #GtkCssProvider instead
+ */
guint
gtk_rc_parse_state (GScanner *scanner,
GtkStateType *state)
@@ -3756,6 +3784,13 @@ gtk_rc_parse_state (GScanner *scanner,
return G_TOKEN_NONE;
}
+/**
+ * gtk_rc_parse_priority:
+ * @scanner:
+ * @priority:
+ *
+ * Deprecated:3.0: Use #GtkCssProvider instead
+ */
guint
gtk_rc_parse_priority (GScanner *scanner,
GtkPathPriorityType *priority)
@@ -3819,6 +3854,8 @@ gtk_rc_parse_priority (GScanner *scanner,
*
* Returns: %G_TOKEN_NONE if parsing succeeded, otherwise the token
* that was expected but not found
+ *
+ * Deprecated:3.0: Use #GtkCssProvider instead
*/
guint
gtk_rc_parse_color (GScanner *scanner,
@@ -3841,6 +3878,8 @@ gtk_rc_parse_color (GScanner *scanner,
* that was expected but not found
*
* Since: 2.12
+ *
+ * Deprecated:3.0: Use #GtkCssProvider instead
*/
guint
gtk_rc_parse_color_full (GScanner *scanner,
diff --git a/gtk/gtkrc.h b/gtk/gtkrc.h
index 598906dd80..65635eebb9 100644
--- a/gtk/gtkrc.h
+++ b/gtk/gtkrc.h
@@ -131,6 +131,8 @@ gboolean _gtk_rc_match_widget_class (GSList *list,
gchar *path,
gchar *path_reversed);
+#if !defined(GTK_DISABLE_DEPRECATED) || defined(GTK_COMPILATION)
+
void gtk_rc_add_default_file (const gchar *filename);
void gtk_rc_set_default_files (gchar **filenames);
gchar** gtk_rc_get_default_files (void);
@@ -217,6 +219,8 @@ guint gtk_rc_parse_state (GScanner *scanner,
guint gtk_rc_parse_priority (GScanner *scanner,
GtkPathPriorityType *priority);
+#endif
+
/* rc properties
* (structure forward declared in gtkstyle.h)
*/
diff --git a/gtk/gtkscrollbar.c b/gtk/gtkscrollbar.c
index d04ed7c387..df4ad75b9c 100644
--- a/gtk/gtkscrollbar.c
+++ b/gtk/gtkscrollbar.c
@@ -118,6 +118,10 @@ gtk_scrollbar_class_init (GtkScrollbarClass *class)
static void
gtk_scrollbar_init (GtkScrollbar *scrollbar)
{
+ GtkStyleContext *context;
+
+ context = gtk_widget_get_style_context (GTK_WIDGET (scrollbar));
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_SCROLLBAR);
}
static void
diff --git a/gtk/gtkselection.c b/gtk/gtkselection.c
index 70b3c055c8..4148f37b23 100644
--- a/gtk/gtkselection.c
+++ b/gtk/gtkselection.c
@@ -2567,7 +2567,7 @@ _gtk_selection_incr_event (GdkWindow *window,
#ifdef DEBUG_SELECTION
g_message ("INCR: put %d bytes (offset = %d) into window 0x%lx , property %ld",
num_bytes, info->conversions[i].offset,
- GDK_WINDOW_XWINDOW(info->requestor), event->atom);
+ GDK_WINDOW_XID(info->requestor), event->atom);
#endif
bytes_per_item = gtk_selection_bytes_per_item (info->conversions[i].data.format);
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index 9b622254c2..f84bc9b283 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -30,6 +30,9 @@
#include "gtkwidget.h"
#include "gtktypeutils.h"
#include "gtkprivate.h"
+#include "gtkcssprovider.h"
+#include "gtksymboliccolor.h"
+#include "gtkversion.h"
#ifdef GDK_WINDOWING_X11
#include "x11/gdkx.h"
@@ -179,6 +182,8 @@ enum {
};
/* --- prototypes --- */
+static void gtk_settings_provider_iface_init (GtkStyleProviderIface *iface);
+
static void gtk_settings_finalize (GObject *object);
static void gtk_settings_get_property (GObject *object,
guint property_id,
@@ -203,6 +208,7 @@ static void settings_update_font_options (GtkSettings *setting
static gboolean settings_update_fontconfig (GtkSettings *settings);
#endif
static void settings_update_color_scheme (GtkSettings *settings);
+static void settings_update_theme (GtkSettings *settings);
static void merge_color_scheme (GtkSettings *settings,
const GValue *value,
@@ -221,7 +227,9 @@ static GSList *object_list = NULL;
static guint class_n_properties = 0;
-G_DEFINE_TYPE (GtkSettings, gtk_settings, G_TYPE_OBJECT)
+G_DEFINE_TYPE_EXTENDED (GtkSettings, gtk_settings, G_TYPE_OBJECT, 0,
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_STYLE_PROVIDER,
+ gtk_settings_provider_iface_init));
/* --- functions --- */
static void
@@ -1246,6 +1254,78 @@ gtk_settings_class_init (GtkSettingsClass *class)
g_assert (result == PROP_IM_STATUS_STYLE);
}
+static GtkStyleProperties *
+gtk_settings_get_style (GtkStyleProvider *provider,
+ GtkWidgetPath *path)
+{
+ PangoFontDescription *font_desc;
+ gchar *font_name, *color_scheme;
+ GtkSettings *settings;
+ GtkStyleProperties *props;
+ gchar **colors;
+ guint i;
+
+ settings = GTK_SETTINGS (provider);
+ props = gtk_style_properties_new ();
+
+ g_object_get (settings,
+ "gtk-font-name", &font_name,
+ "gtk-color-scheme", &color_scheme,
+ NULL);
+
+ colors = g_strsplit_set (color_scheme, "\n;", -1);
+
+ for (i = 0; colors[i]; i++)
+ {
+ GtkSymbolicColor *color;
+ gchar *name, *pos;
+ GdkRGBA col;
+
+ if (!*colors[i])
+ continue;
+
+ name = colors[i];
+ pos = strchr (colors[i], ':');
+
+ if (!pos)
+ continue;
+
+ /* Set NUL after color name */
+ *pos = '\0';
+ pos++;
+
+ /* Find start of color string */
+ while (*pos == ' ')
+ pos++;
+
+ if (!*pos || !gdk_rgba_parse (&col, pos))
+ continue;
+
+ color = gtk_symbolic_color_new_literal (&col);
+ gtk_style_properties_map_color (props, name, color);
+ gtk_symbolic_color_unref (color);
+ }
+
+ font_desc = pango_font_description_from_string (font_name);
+
+ gtk_style_properties_set (props, 0,
+ "font", font_desc,
+ NULL);
+
+ pango_font_description_free (font_desc);
+ g_strfreev (colors);
+ g_free (color_scheme);
+ g_free (font_name);
+
+ return props;
+}
+
+static void
+gtk_settings_provider_iface_init (GtkStyleProviderIface *iface)
+{
+ iface->get_style = gtk_settings_get_style;
+}
+
static void
gtk_settings_finalize (GObject *object)
{
@@ -1265,6 +1345,46 @@ gtk_settings_finalize (GObject *object)
G_OBJECT_CLASS (gtk_settings_parent_class)->finalize (object);
}
+static void
+settings_init_style (GtkSettings *settings)
+{
+ static GtkCssProvider *css_provider = NULL;
+ GtkCssProvider *default_provider;
+
+ /* Add provider for user file */
+ if (G_UNLIKELY (!css_provider))
+ {
+ gchar *css_path;
+
+ css_provider = gtk_css_provider_new ();
+ css_path = g_build_filename (g_get_user_config_dir (),
+ "gtk-3.0",
+ "gtk.css",
+ NULL);
+
+ if (g_file_test (css_path,
+ G_FILE_TEST_IS_REGULAR))
+ gtk_css_provider_load_from_path (css_provider, css_path, NULL);
+
+ g_free (css_path);
+ }
+
+ gtk_style_context_add_provider_for_screen (settings->screen,
+ GTK_STYLE_PROVIDER (css_provider),
+ GTK_STYLE_PROVIDER_PRIORITY_USER);
+
+ default_provider = gtk_css_provider_get_default ();
+ gtk_style_context_add_provider_for_screen (settings->screen,
+ GTK_STYLE_PROVIDER (default_provider),
+ GTK_STYLE_PROVIDER_PRIORITY_FALLBACK);
+
+ gtk_style_context_add_provider_for_screen (settings->screen,
+ GTK_STYLE_PROVIDER (settings),
+ GTK_STYLE_PROVIDER_PRIORITY_SETTINGS);
+
+ settings_update_theme (settings);
+}
+
/**
* gtk_settings_get_for_screen:
* @screen: a #GdkScreen.
@@ -1290,7 +1410,7 @@ gtk_settings_get_for_screen (GdkScreen *screen)
g_object_set_data_full (G_OBJECT (screen), I_("gtk-settings"),
settings, g_object_unref);
- gtk_rc_reparse_all_for_settings (settings, TRUE);
+ settings_init_style (settings);
settings_update_double_click (settings);
#ifdef GDK_WINDOWING_X11
settings_update_cursor_theme (settings);
@@ -1440,6 +1560,10 @@ gtk_settings_notify (GObject *object,
break;
case PROP_COLOR_SCHEME:
settings_update_color_scheme (settings);
+ gtk_style_context_reset_widgets (settings->screen);
+ break;
+ case PROP_THEME_NAME:
+ settings_update_theme (settings);
break;
#ifdef GDK_WINDOWING_X11
case PROP_XFT_DPI:
@@ -1448,18 +1572,18 @@ gtk_settings_notify (GObject *object,
* widgets with gtk_widget_style_set(), and also causes more
* recomputation than necessary.
*/
- gtk_rc_reset_styles (GTK_SETTINGS (object));
+ gtk_style_context_reset_widgets (settings->screen);
break;
case PROP_XFT_ANTIALIAS:
case PROP_XFT_HINTING:
case PROP_XFT_HINTSTYLE:
case PROP_XFT_RGBA:
settings_update_font_options (settings);
- gtk_rc_reset_styles (GTK_SETTINGS (object));
+ gtk_style_context_reset_widgets (settings->screen);
break;
case PROP_FONTCONFIG_TIMESTAMP:
if (settings_update_fontconfig (settings))
- gtk_rc_reset_styles (GTK_SETTINGS (object));
+ gtk_style_context_reset_widgets (settings->screen);
break;
case PROP_CURSOR_THEME_NAME:
case PROP_CURSOR_THEME_SIZE:
@@ -2478,6 +2602,54 @@ settings_update_color_scheme (GtkSettings *settings)
}
}
+static void
+settings_update_theme (GtkSettings *settings)
+{
+ static GQuark quark_theme_name = 0;
+ GtkCssProvider *provider, *new_provider = NULL;
+ gboolean prefer_dark_theme;
+ gchar *theme_name;
+
+ if (G_UNLIKELY (!quark_theme_name))
+ quark_theme_name = g_quark_from_static_string ("gtk-settings-theme-name");
+
+ provider = g_object_get_qdata (G_OBJECT (settings), quark_theme_name);
+
+ g_object_get (settings,
+ "gtk-theme-name", &theme_name,
+ "gtk-application-prefer-dark-theme", &prefer_dark_theme,
+ NULL);
+
+ if (theme_name && *theme_name)
+ {
+ gchar *variant = NULL;
+
+ if (prefer_dark_theme)
+ variant = "dark";
+
+ new_provider = gtk_css_provider_get_named (theme_name, variant);
+ g_free (theme_name);
+ }
+
+ if (new_provider != provider)
+ {
+ if (provider)
+ gtk_style_context_remove_provider_for_screen (settings->screen,
+ GTK_STYLE_PROVIDER (provider));
+
+ if (new_provider)
+ {
+ gtk_style_context_add_provider_for_screen (settings->screen,
+ GTK_STYLE_PROVIDER (new_provider),
+ GTK_STYLE_PROVIDER_PRIORITY_THEME);
+ g_object_ref (new_provider);
+ }
+
+ g_object_set_qdata_full (G_OBJECT (settings), quark_theme_name,
+ new_provider, (GDestroyNotify) g_object_unref);
+ }
+}
+
static gboolean
add_color_to_hash (gchar *name,
GdkColor *color,
@@ -2708,3 +2880,9 @@ get_color_scheme (GtkSettings *settings)
return g_string_free (string, FALSE);
}
+
+GdkScreen *
+_gtk_settings_get_screen (GtkSettings *settings)
+{
+ return settings->screen;
+}
diff --git a/gtk/gtksettings.h b/gtk/gtksettings.h
index 36fb9a5db9..6958db0f56 100644
--- a/gtk/gtksettings.h
+++ b/gtk/gtksettings.h
@@ -133,6 +133,8 @@ gboolean _gtk_settings_parse_convert (GtkRcPropertyParser parser,
GParamSpec *pspec,
GValue *dest_value);
+GdkScreen *_gtk_settings_get_screen (GtkSettings *settings);
+
G_END_DECLS
diff --git a/gtk/gtksocket-x11.c b/gtk/gtksocket-x11.c
index b408fa6bcb..963d832b85 100644
--- a/gtk/gtksocket-x11.c
+++ b/gtk/gtksocket-x11.c
@@ -39,7 +39,8 @@
#include "gtkdnd.h"
#include "gtkdebug.h"
-#include "x11/gdkx.h"
+#include "gdk/x11/gdkx.h"
+#include "gdk/gdkprivate.h"
#ifdef HAVE_XFIXES
#include <X11/extensions/Xfixes.h>
@@ -57,7 +58,7 @@ static gboolean xembed_get_info (GdkWindow *gdk_window,
GdkNativeWindow
_gtk_socket_windowing_get_id (GtkSocket *socket)
{
- return GDK_WINDOW_XWINDOW (gtk_widget_get_window (GTK_WIDGET (socket)));
+ return GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (socket)));
}
void
@@ -69,7 +70,7 @@ _gtk_socket_windowing_realize_window (GtkSocket *socket)
window = gtk_widget_get_window (GTK_WIDGET (socket));
XGetWindowAttributes (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XWINDOW (window),
+ GDK_WINDOW_XID (window),
&xattrs);
/* Sooooo, it turns out that mozilla, as per the gtk2xt code selects
@@ -81,7 +82,7 @@ _gtk_socket_windowing_realize_window (GtkSocket *socket)
this for GtkSocket, so we unselect it here, fixing the crashes in
firefox. */
XSelectInput (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XWINDOW (window),
+ GDK_WINDOW_XID (window),
(xattrs.your_event_mask & ~ButtonPressMask) |
SubstructureNotifyMask | SubstructureRedirectMask);
}
@@ -90,7 +91,7 @@ void
_gtk_socket_windowing_end_embedding_toplevel (GtkSocket *socket)
{
gtk_window_remove_embedded_xid (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (socket))),
- GDK_WINDOW_XWINDOW (socket->plug_window));
+ GDK_WINDOW_XID (socket->plug_window));
}
void
@@ -105,7 +106,7 @@ _gtk_socket_windowing_size_request (GtkSocket *socket)
socket->request_height = 1;
if (XGetWMNormalHints (GDK_WINDOW_XDISPLAY (socket->plug_window),
- GDK_WINDOW_XWINDOW (socket->plug_window),
+ GDK_WINDOW_XID (socket->plug_window),
&hints, &supplied))
{
if (hints.flags & PMinSize)
@@ -134,8 +135,8 @@ _gtk_socket_windowing_send_key_event (GtkSocket *socket,
memset (&xkey, 0, sizeof (xkey));
xkey.type = (gdk_event->type == GDK_KEY_PRESS) ? KeyPress : KeyRelease;
- xkey.window = GDK_WINDOW_XWINDOW (socket->plug_window);
- xkey.root = GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (screen));
+ xkey.window = GDK_WINDOW_XID (socket->plug_window);
+ xkey.root = GDK_WINDOW_XID (gdk_screen_get_root_window (screen));
xkey.subwindow = None;
xkey.time = gdk_event->key.time;
xkey.x = 0;
@@ -148,7 +149,7 @@ _gtk_socket_windowing_send_key_event (GtkSocket *socket,
gdk_error_trap_push ();
XSendEvent (GDK_WINDOW_XDISPLAY (socket->plug_window),
- GDK_WINDOW_XWINDOW (socket->plug_window),
+ GDK_WINDOW_XID (socket->plug_window),
False,
(mask_key_presses ? KeyPressMask : NoEventMask),
(XEvent *)&xkey);
@@ -220,8 +221,8 @@ _gtk_socket_windowing_send_configure_event (GtkSocket *socket)
memset (&xconfigure, 0, sizeof (xconfigure));
xconfigure.type = ConfigureNotify;
- xconfigure.event = GDK_WINDOW_XWINDOW (socket->plug_window);
- xconfigure.window = GDK_WINDOW_XWINDOW (socket->plug_window);
+ xconfigure.event = GDK_WINDOW_XID (socket->plug_window);
+ xconfigure.window = GDK_WINDOW_XID (socket->plug_window);
/* The ICCCM says that synthetic events should have root relative
* coordinates. We still aren't really ICCCM compliant, since
@@ -243,7 +244,7 @@ _gtk_socket_windowing_send_configure_event (GtkSocket *socket)
gdk_error_trap_push ();
XSendEvent (GDK_WINDOW_XDISPLAY (socket->plug_window),
- GDK_WINDOW_XWINDOW (socket->plug_window),
+ GDK_WINDOW_XID (socket->plug_window),
False, NoEventMask, (XEvent *)&xconfigure);
gdk_error_trap_pop_ignored ();
}
@@ -252,7 +253,7 @@ void
_gtk_socket_windowing_select_plug_window_input (GtkSocket *socket)
{
XSelectInput (GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (socket))),
- GDK_WINDOW_XWINDOW (socket->plug_window),
+ GDK_WINDOW_XID (socket->plug_window),
StructureNotifyMask | PropertyChangeMask);
}
@@ -283,13 +284,13 @@ _gtk_socket_windowing_embed_notify (GtkSocket *socket)
gdk_error_trap_push ();
XFixesChangeSaveSet (GDK_DISPLAY_XDISPLAY (display),
- GDK_WINDOW_XWINDOW (socket->plug_window),
+ GDK_WINDOW_XID (socket->plug_window),
SetModeInsert, SaveSetRoot, SaveSetUnmap);
gdk_error_trap_pop_ignored ();
#endif
_gtk_xembed_send_message (socket->plug_window,
XEMBED_EMBEDDED_NOTIFY, 0,
- GDK_WINDOW_XWINDOW (gtk_widget_get_window (GTK_WIDGET (socket))),
+ GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (socket))),
socket->xembed_version);
}
@@ -309,7 +310,7 @@ xembed_get_info (GdkWindow *window,
gdk_error_trap_push ();
status = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_WINDOW_XWINDOW (window),
+ GDK_WINDOW_XID (window),
xembed_info_atom,
0, 2, False,
xembed_info_atom, &type, &format,
@@ -508,7 +509,7 @@ _gtk_socket_windowing_filter_func (GdkXEvent *gdk_xevent,
/* Note that we get destroy notifies both from SubstructureNotify on
* our window and StructureNotify on socket->plug_window
*/
- if (socket->plug_window && (xdwe->window == GDK_WINDOW_XWINDOW (socket->plug_window)))
+ if (socket->plug_window && (xdwe->window == GDK_WINDOW_XID (socket->plug_window)))
{
gboolean result;
@@ -554,7 +555,7 @@ _gtk_socket_windowing_filter_func (GdkXEvent *gdk_xevent,
break;
case PropertyNotify:
if (socket->plug_window &&
- xevent->xproperty.window == GDK_WINDOW_XWINDOW (socket->plug_window))
+ xevent->xproperty.window == GDK_WINDOW_XID (socket->plug_window))
{
GdkDragProtocol protocol;
@@ -615,7 +616,7 @@ _gtk_socket_windowing_filter_func (GdkXEvent *gdk_xevent,
GTK_NOTE (PLUGSOCKET, g_message ("GtkSocket - ReparentNotify received"));
if (!socket->plug_window &&
- xre->parent == GDK_WINDOW_XWINDOW (window))
+ xre->parent == GDK_WINDOW_XID (window))
{
_gtk_socket_add_window (socket, xre->window, FALSE);
@@ -629,8 +630,8 @@ _gtk_socket_windowing_filter_func (GdkXEvent *gdk_xevent,
else
{
if (socket->plug_window &&
- xre->window == GDK_WINDOW_XWINDOW (socket->plug_window) &&
- xre->parent != GDK_WINDOW_XWINDOW (window))
+ xre->window == GDK_WINDOW_XID (socket->plug_window) &&
+ xre->parent != GDK_WINDOW_XID (window))
{
gboolean result;
@@ -650,7 +651,7 @@ _gtk_socket_windowing_filter_func (GdkXEvent *gdk_xevent,
}
case UnmapNotify:
if (socket->plug_window &&
- xevent->xunmap.window == GDK_WINDOW_XWINDOW (socket->plug_window))
+ xevent->xunmap.window == GDK_WINDOW_XID (socket->plug_window))
{
GTK_NOTE (PLUGSOCKET, g_message ("GtkSocket - Unmap notify"));
diff --git a/gtk/gtkspinner.c b/gtk/gtkspinner.c
index 2af87b061f..65bf7e2353 100644
--- a/gtk/gtkspinner.c
+++ b/gtk/gtkspinner.c
@@ -62,20 +62,11 @@ enum {
struct _GtkSpinnerPrivate
{
- guint current;
- guint num_steps;
- guint cycle_duration;
gboolean active;
- guint timeout;
};
-static void gtk_spinner_dispose (GObject *gobject);
-static void gtk_spinner_map (GtkWidget *widget);
-static void gtk_spinner_unmap (GtkWidget *widget);
static gboolean gtk_spinner_draw (GtkWidget *widget,
cairo_t *cr);
-static void gtk_spinner_style_set (GtkWidget *widget,
- GtkStyle *prev_style);
static void gtk_spinner_get_property (GObject *object,
guint param_id,
GValue *value,
@@ -106,15 +97,11 @@ gtk_spinner_class_init (GtkSpinnerClass *klass)
gobject_class = G_OBJECT_CLASS(klass);
g_type_class_add_private (gobject_class, sizeof (GtkSpinnerPrivate));
- gobject_class->dispose = gtk_spinner_dispose;
gobject_class->get_property = gtk_spinner_get_property;
gobject_class->set_property = gtk_spinner_set_property;
widget_class = GTK_WIDGET_CLASS(klass);
- widget_class->map = gtk_spinner_map;
- widget_class->unmap = gtk_spinner_unmap;
widget_class->draw = gtk_spinner_draw;
- widget_class->style_set = gtk_spinner_style_set;
widget_class->get_accessible = gtk_spinner_get_accessible;
widget_class->get_preferred_width = gtk_spinner_get_preferred_width;
widget_class->get_preferred_height = gtk_spinner_get_preferred_height;
@@ -140,6 +127,8 @@ gtk_spinner_class_init (GtkSpinnerClass *klass)
* (see the #GtkSpinner:cycle-duration style property).
*
* Since: 2.20
+ *
+ * Deprecated: 3.0
*/
gtk_widget_class_install_style_property (widget_class,
g_param_spec_uint ("num-steps",
@@ -156,6 +145,8 @@ gtk_spinner_class_init (GtkSpinnerClass *klass)
* The duration in milliseconds for the spinner to complete a full cycle.
*
* Since: 2.20
+ *
+ * Deprecated: 3.0
*/
gtk_widget_class_install_style_property (widget_class,
g_param_spec_uint ("cycle-duration",
@@ -207,16 +198,17 @@ static void
gtk_spinner_init (GtkSpinner *spinner)
{
GtkSpinnerPrivate *priv;
+ GtkStyleContext *context;
priv = G_TYPE_INSTANCE_GET_PRIVATE (spinner,
GTK_TYPE_SPINNER,
GtkSpinnerPrivate);
- priv->current = 0;
- priv->timeout = 0;
-
spinner->priv = priv;
gtk_widget_set_has_window (GTK_WIDGET (spinner), FALSE);
+
+ context = gtk_widget_get_style_context (GTK_WIDGET (spinner));
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_SPINNER);
}
static void
@@ -247,123 +239,22 @@ static gboolean
gtk_spinner_draw (GtkWidget *widget,
cairo_t *cr)
{
- GtkStateType state_type;
GtkSpinnerPrivate *priv;
+ GtkStyleContext *context;
+ GtkStateFlags state;
priv = GTK_SPINNER (widget)->priv;
+ context = gtk_widget_get_style_context (widget);
+ state = gtk_widget_get_state_flags (widget);
- state_type = GTK_STATE_NORMAL;
- if (!gtk_widget_is_sensitive (widget))
- state_type = GTK_STATE_INSENSITIVE;
-
- gtk_paint_spinner (gtk_widget_get_style (widget),
- cr,
- state_type,
- widget,
- "spinner",
- priv->current,
- 0, 0,
- gtk_widget_get_allocated_width (widget),
- gtk_widget_get_allocated_height (widget));
+ gtk_style_context_set_state (context, state);
+ gtk_render_activity (context, cr, 0, 0,
+ gtk_widget_get_allocated_width (widget),
+ gtk_widget_get_allocated_height (widget));
return FALSE;
}
-static gboolean
-gtk_spinner_timeout (gpointer data)
-{
- GtkSpinnerPrivate *priv;
-
- priv = GTK_SPINNER (data)->priv;
-
- if (priv->current + 1 >= priv->num_steps)
- priv->current = 0;
- else
- priv->current++;
-
- gtk_widget_queue_draw (GTK_WIDGET (data));
-
- return TRUE;
-}
-
-static void
-gtk_spinner_add_timeout (GtkSpinner *spinner)
-{
- GtkSpinnerPrivate *priv;
-
- priv = spinner->priv;
-
- g_assert (priv->timeout == 0);
- priv->timeout = gdk_threads_add_timeout ((guint) priv->cycle_duration / priv->num_steps, gtk_spinner_timeout, spinner);
-}
-
-static void
-gtk_spinner_remove_timeout (GtkSpinner *spinner)
-{
- GtkSpinnerPrivate *priv;
-
- priv = spinner->priv;
-
- g_source_remove (priv->timeout);
- priv->timeout = 0;
-}
-
-static void
-gtk_spinner_map (GtkWidget *widget)
-{
- GtkSpinner *spinner = GTK_SPINNER (widget);
- GtkSpinnerPrivate *priv = spinner->priv;
-
- GTK_WIDGET_CLASS (gtk_spinner_parent_class)->map (widget);
-
- if (priv->active && priv->timeout == 0)
- gtk_spinner_add_timeout (spinner);
-}
-
-static void
-gtk_spinner_unmap (GtkWidget *widget)
-{
- GtkSpinner *spinner = GTK_SPINNER (widget);
- GtkSpinnerPrivate *priv = spinner->priv;
-
- if (priv->timeout != 0)
- gtk_spinner_remove_timeout (spinner);
-
- GTK_WIDGET_CLASS (gtk_spinner_parent_class)->unmap (widget);
-}
-
-static void
-gtk_spinner_style_set (GtkWidget *widget,
- GtkStyle *prev_style)
-{
- GtkSpinnerPrivate *priv;
-
- priv = GTK_SPINNER (widget)->priv;
-
- gtk_widget_style_get (GTK_WIDGET (widget),
- "num-steps", &(priv->num_steps),
- "cycle-duration", &(priv->cycle_duration),
- NULL);
-
- if (priv->current > priv->num_steps)
- priv->current = 0;
-}
-
-static void
-gtk_spinner_dispose (GObject *gobject)
-{
- GtkSpinnerPrivate *priv;
-
- priv = GTK_SPINNER (gobject)->priv;
-
- if (priv->timeout != 0)
- {
- gtk_spinner_remove_timeout (GTK_SPINNER (gobject));
- }
-
- G_OBJECT_CLASS (gtk_spinner_parent_class)->dispose (gobject);
-}
-
static void
gtk_spinner_set_active (GtkSpinner *spinner,
gboolean active)
@@ -378,16 +269,12 @@ gtk_spinner_set_active (GtkSpinner *spinner,
g_object_notify (G_OBJECT (spinner), "active");
- if (active &&
- gtk_widget_get_realized (GTK_WIDGET (spinner)) &&
- priv->timeout == 0)
- {
- gtk_spinner_add_timeout (spinner);
- }
- else if (!active && priv->timeout != 0)
- {
- gtk_spinner_remove_timeout (spinner);
- }
+ if (active)
+ gtk_widget_set_state_flags (GTK_WIDGET (spinner),
+ GTK_STATE_FLAG_ACTIVE, FALSE);
+ else
+ gtk_widget_unset_state_flags (GTK_WIDGET (spinner),
+ GTK_STATE_FLAG_ACTIVE);
}
}
diff --git a/gtk/gtkstatusicon.c b/gtk/gtkstatusicon.c
index 678cb8caab..f3bf6383b4 100644
--- a/gtk/gtkstatusicon.c
+++ b/gtk/gtkstatusicon.c
@@ -1701,8 +1701,16 @@ gtk_status_icon_color_changed (GtkTrayIcon *tray,
if (name)
{
+ GdkRGBA rgba;
+
g_object_get (priv->tray_icon, pspec->name, &color, NULL);
- gtk_widget_modify_symbolic_color (priv->image, name, &color);
+
+ rgba.red = color.red / 65535.;
+ rgba.green = color.green / 65535.;
+ rgba.blue = color.blue / 65535.;
+ rgba.alpha = 1;
+
+ gtk_widget_override_symbolic_color (priv->image, name, &rgba);
}
}
diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c
index a5566e2984..ff7686a6ab 100644
--- a/gtk/gtkstyle.c
+++ b/gtk/gtkstyle.c
@@ -41,6 +41,7 @@
#include "gtkintl.h"
#include "gtkdebug.h"
#include "gtkspinner.h"
+#include "gtkborder.h"
/**
@@ -59,6 +60,10 @@
*
* Usually applications should not need to use or modify the #GtkStyle of their
* widgets.
+ *
+ * <warning>
+ * In GTK+ 3.0, GtkStyle has been deprecated and replaced by #GtkStyleContext.
+ * </warning>
*/
@@ -78,10 +83,27 @@ typedef struct _GtkStylePrivate GtkStylePrivate;
struct _GtkStylePrivate {
GSList *color_hashes;
+ GtkStyleContext *context;
+ gulong context_changed_id;
+};
+
+enum {
+ PROP_0,
+ PROP_CONTEXT
};
/* --- prototypes --- */
static void gtk_style_finalize (GObject *object);
+static void gtk_style_constructed (GObject *object);
+static void gtk_style_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec);
+static void gtk_style_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec);
+
static void gtk_style_realize (GtkStyle *style,
GdkVisual *visual);
static void gtk_style_real_realize (GtkStyle *style);
@@ -314,6 +336,9 @@ static void hls_to_rgb (gdouble *h,
static void style_unrealize_cursors (GtkStyle *style);
+static void transform_detail_string (const gchar *detail,
+ GtkStyleContext *context);
+
/*
* Data for default check and radio buttons
*/
@@ -450,6 +475,9 @@ gtk_style_class_init (GtkStyleClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gtk_style_finalize;
+ object_class->set_property = gtk_style_set_property;
+ object_class->get_property = gtk_style_get_property;
+ object_class->constructed = gtk_style_constructed;
klass->clone = gtk_style_real_clone;
klass->copy = gtk_style_real_copy;
@@ -482,6 +510,14 @@ gtk_style_class_init (GtkStyleClass *klass)
g_type_class_add_private (object_class, sizeof (GtkStylePrivate));
+ g_object_class_install_property (object_class,
+ PROP_CONTEXT,
+ g_param_spec_object ("context",
+ P_("Style context"),
+ P_("GtkStyleContext to get style from"),
+ GTK_TYPE_STYLE_CONTEXT,
+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+
/**
* GtkStyle::realize:
* @style: the object which received the signal
@@ -587,9 +623,199 @@ gtk_style_finalize (GObject *object)
if (style->rc_style)
g_object_unref (style->rc_style);
+ if (priv->context)
+ {
+ if (priv->context_changed_id)
+ g_signal_handler_disconnect (priv->context, priv->context_changed_id);
+
+ g_object_unref (priv->context);
+ }
+
G_OBJECT_CLASS (gtk_style_parent_class)->finalize (object);
}
+static void
+gtk_style_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ GtkStylePrivate *priv;
+
+ priv = GTK_STYLE_GET_PRIVATE (object);
+
+ switch (prop_id)
+ {
+ case PROP_CONTEXT:
+ priv->context = g_value_dup_object (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+gtk_style_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ GtkStylePrivate *priv;
+
+ priv = GTK_STYLE_GET_PRIVATE (object);
+
+ switch (prop_id)
+ {
+ case PROP_CONTEXT:
+ g_value_set_object (value, priv->context);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+set_color (GtkStyle *style,
+ GtkStyleContext *context,
+ GtkStateType state,
+ GtkRcFlags prop)
+{
+ GtkStateFlags flags;
+ GdkRGBA *color = NULL;
+ GdkColor *dest = { 0 }; /* Shut up gcc */
+
+ switch (state)
+ {
+ case GTK_STATE_ACTIVE:
+ flags = GTK_STATE_FLAG_ACTIVE;
+ break;
+ case GTK_STATE_PRELIGHT:
+ flags = GTK_STATE_FLAG_PRELIGHT;
+ break;
+ case GTK_STATE_SELECTED:
+ flags = GTK_STATE_FLAG_SELECTED;
+ break;
+ case GTK_STATE_INSENSITIVE:
+ flags = GTK_STATE_FLAG_INSENSITIVE;
+ break;
+ default:
+ flags = 0;
+ }
+
+ switch (prop)
+ {
+ case GTK_RC_BG:
+ gtk_style_context_get (context, flags,
+ "background-color", &color,
+ NULL);
+ dest = &style->bg[state];
+ break;
+ case GTK_RC_FG:
+ gtk_style_context_get (context, flags,
+ "color", &color,
+ NULL);
+ dest = &style->fg[state];
+ break;
+ case GTK_RC_TEXT:
+ gtk_style_context_get (context, flags,
+ "color", &color,
+ NULL);
+ dest = &style->text[state];
+ break;
+ case GTK_RC_BASE:
+ gtk_style_context_get (context, flags,
+ "background-color", &color,
+ NULL);
+ dest = &style->base[state];
+ break;
+ }
+
+ if (color)
+ {
+ dest->pixel = 0;
+ dest->red = CLAMP ((guint) (color->red * 65535), 0, 65535);
+ dest->green = CLAMP ((guint) (color->green * 65535), 0, 65535);
+ dest->blue = CLAMP ((guint) (color->blue * 65535), 0, 65535);
+ gdk_rgba_free (color);
+ }
+}
+
+static void
+gtk_style_update_from_context (GtkStyle *style)
+{
+ GtkStylePrivate *priv;
+ GtkStateType state;
+ GtkBorder *padding;
+
+ priv = GTK_STYLE_GET_PRIVATE (style);
+
+ for (state = GTK_STATE_NORMAL; state <= GTK_STATE_INSENSITIVE; state++)
+ {
+ if (gtk_style_context_has_class (priv->context, "entry"))
+ {
+ gtk_style_context_save (priv->context);
+ gtk_style_context_remove_class (priv->context, "entry");
+ set_color (style, priv->context, state, GTK_RC_BG);
+ set_color (style, priv->context, state, GTK_RC_FG);
+ gtk_style_context_restore (priv->context);
+
+ set_color (style, priv->context, state, GTK_RC_BASE);
+ set_color (style, priv->context, state, GTK_RC_TEXT);
+ }
+ else
+ {
+ gtk_style_context_save (priv->context);
+ gtk_style_context_add_class (priv->context, "entry");
+ set_color (style, priv->context, state, GTK_RC_BASE);
+ set_color (style, priv->context, state, GTK_RC_TEXT);
+ gtk_style_context_restore (priv->context);
+
+ set_color (style, priv->context, state, GTK_RC_BG);
+ set_color (style, priv->context, state, GTK_RC_FG);
+ }
+ }
+
+ if (style->font_desc)
+ pango_font_description_free (style->font_desc);
+
+ gtk_style_context_get (priv->context, 0,
+ "font", &style->font_desc,
+ "padding", &padding,
+ NULL);
+
+ if (padding)
+ {
+ style->xthickness = padding->left;
+ style->ythickness = padding->top;
+
+ gtk_border_free (padding);
+ }
+}
+
+static void
+style_context_changed (GtkStyleContext *context,
+ gpointer user_data)
+{
+ gtk_style_update_from_context (GTK_STYLE (user_data));
+}
+
+static void
+gtk_style_constructed (GObject *object)
+{
+ GtkStylePrivate *priv;
+
+ priv = GTK_STYLE_GET_PRIVATE (object);
+
+ if (priv->context)
+ {
+ gtk_style_update_from_context (GTK_STYLE (object));
+
+ priv->context_changed_id = g_signal_connect (priv->context, "changed",
+ G_CALLBACK (style_context_changed), object);
+ }
+}
/**
* gtk_style_copy:
@@ -598,6 +824,8 @@ gtk_style_finalize (GObject *object)
* Creates a copy of the passed in #GtkStyle object.
*
* Returns: (transfer full): a copy of @style
+ *
+ * Deprecated:3.0: Use #GtkStyleContext instead
*/
GtkStyle*
gtk_style_copy (GtkStyle *style)
@@ -637,6 +865,8 @@ gtk_style_duplicate (GtkStyle *style)
* @returns: a new #GtkStyle.
*
* Creates a new #GtkStyle.
+ *
+ * Deprecated: 3.0: Use #GtkStyleContext
**/
GtkStyle*
gtk_style_new (void)
@@ -648,6 +878,16 @@ gtk_style_new (void)
return style;
}
+gboolean
+gtk_style_has_context (GtkStyle *style)
+{
+ GtkStylePrivate *priv;
+
+ priv = GTK_STYLE_GET_PRIVATE (style);
+
+ return priv->context != NULL;
+}
+
/**
* gtk_style_attach:
* @style: a #GtkStyle.
@@ -667,6 +907,8 @@ gtk_style_new (void)
* If the style is newly created, the style parameter
* will be unref'ed, and the new style will have
* a reference count belonging to the caller.
+ *
+ * Deprecated:3.0: Use gtk_widget_style_attach() instead
*/
GtkStyle*
gtk_style_attach (GtkStyle *style,
@@ -743,14 +985,17 @@ gtk_style_attach (GtkStyle *style,
*
* Detaches a style from a window. If the style is not attached
* to any windows anymore, it is unrealized. See gtk_style_attach().
- *
+ *
+ * Deprecated:3.0: Use #GtkStyleContext instead
*/
void
gtk_style_detach (GtkStyle *style)
{
g_return_if_fail (GTK_IS_STYLE (style));
- g_return_if_fail (style->attach_count > 0);
-
+
+ if (style->attach_count == 0)
+ return;
+
style->attach_count -= 1;
if (style->attach_count == 0)
{
@@ -788,26 +1033,22 @@ gtk_style_realize (GtkStyle *style,
* otherwise %NULL.
*
* Return value: icon set of @stock_id
+ *
+ * Deprecated:3.0: Use gtk_style_context_lookup_icon_set() instead
*/
GtkIconSet*
gtk_style_lookup_icon_set (GtkStyle *style,
const char *stock_id)
{
- GSList *iter;
+ GtkStylePrivate *priv;
g_return_val_if_fail (GTK_IS_STYLE (style), NULL);
g_return_val_if_fail (stock_id != NULL, NULL);
-
- iter = style->icon_factories;
- while (iter != NULL)
- {
- GtkIconSet *icon_set = gtk_icon_factory_lookup (GTK_ICON_FACTORY (iter->data),
- stock_id);
- if (icon_set)
- return icon_set;
-
- iter = g_slist_next (iter);
- }
+
+ priv = GTK_STYLE_GET_PRIVATE (style);
+
+ if (priv->context)
+ return gtk_style_context_lookup_icon_set (priv->context, stock_id);
return gtk_icon_factory_lookup_default (stock_id);
}
@@ -827,6 +1068,8 @@ gtk_style_lookup_icon_set (GtkStyle *style,
* Return value: %TRUE if the mapping was found.
*
* Since: 2.10
+ *
+ * Deprecated:3.0: Use gtk_style_context_lookup_color() instead
**/
gboolean
gtk_style_lookup_color (GtkStyle *style,
@@ -834,7 +1077,8 @@ gtk_style_lookup_color (GtkStyle *style,
GdkColor *color)
{
GtkStylePrivate *priv;
- GSList *iter;
+ gboolean result;
+ GdkRGBA rgba;
g_return_val_if_fail (GTK_IS_STYLE (style), FALSE);
g_return_val_if_fail (color_name != NULL, FALSE);
@@ -842,21 +1086,20 @@ gtk_style_lookup_color (GtkStyle *style,
priv = GTK_STYLE_GET_PRIVATE (style);
- for (iter = priv->color_hashes; iter != NULL; iter = iter->next)
- {
- GHashTable *hash = iter->data;
- GdkColor *mapping = g_hash_table_lookup (hash, color_name);
+ if (!priv->context)
+ return FALSE;
- if (mapping)
- {
- color->red = mapping->red;
- color->green = mapping->green;
- color->blue = mapping->blue;
- return TRUE;
- }
+ result = gtk_style_context_lookup_color (priv->context, color_name, &rgba);
+
+ if (color)
+ {
+ color->red = (guint16) (rgba.red * 65535);
+ color->green = (guint16) (rgba.green * 65535);
+ color->blue = (guint16) (rgba.blue * 65535);
+ color->pixel = 0;
}
- return FALSE;
+ return result;
}
/**
@@ -867,6 +1110,8 @@ gtk_style_lookup_color (GtkStyle *style,
*
* Sets the background of @window to the background color or pixmap
* specified by @style for the given state.
+ *
+ * Deprecated:3.0: Use gtk_style_context_set_background() instead
*/
void
gtk_style_set_background (GtkStyle *style,
@@ -883,7 +1128,13 @@ gtk_style_set_background (GtkStyle *style,
static GtkStyle *
gtk_style_real_clone (GtkStyle *style)
{
- return g_object_new (G_OBJECT_TYPE (style), NULL);
+ GtkStylePrivate *priv;
+
+ priv = GTK_STYLE_GET_PRIVATE (style);
+
+ return g_object_new (G_OBJECT_TYPE (style),
+ "context", priv->context,
+ NULL);
}
static void
@@ -1349,6 +1600,8 @@ gtk_style_real_set_background (GtkStyle *style,
*
* Return value: (transfer full): a newly-created #GdkPixbuf
* containing the rendered icon
+ *
+ * Deprecated:3.0: Use gtk_render_icon_pixbuf() instead
*/
GdkPixbuf *
gtk_style_render_icon (GtkStyle *style,
@@ -1386,6 +1639,8 @@ gtk_style_render_icon (GtkStyle *style,
* @y:
* @width:
* @height:
+ *
+ * Deprecated:3.0: Use #GtkStyleContext instead
*/
void
gtk_style_apply_default_background (GtkStyle *style,
@@ -1428,54 +1683,6 @@ out:
}
static GdkPixbuf *
-scale_or_ref (GdkPixbuf *src,
- gint width,
- gint height)
-{
- if (width == gdk_pixbuf_get_width (src) &&
- height == gdk_pixbuf_get_height (src))
- {
- return g_object_ref (src);
- }
- else
- {
- return gdk_pixbuf_scale_simple (src,
- width, height,
- GDK_INTERP_BILINEAR);
- }
-}
-
-static gboolean
-lookup_icon_size (GtkStyle *style,
- GtkWidget *widget,
- GtkIconSize size,
- gint *width,
- gint *height)
-{
- GdkScreen *screen;
- GtkSettings *settings;
-
- if (widget && gtk_widget_has_screen (widget))
- {
- screen = gtk_widget_get_screen (widget);
- settings = gtk_settings_get_for_screen (screen);
- }
- else if (style && style->visual)
- {
- screen = gdk_visual_get_screen (style->visual);
- settings = gtk_settings_get_for_screen (screen);
- }
- else
- {
- settings = gtk_settings_get_default ();
- GTK_NOTE (MULTIHEAD,
- g_warning ("Using the default screen for gtk_default_render_icon()"));
- }
-
- return gtk_icon_size_lookup_for_settings (settings, size, width, height);
-}
-
-static GdkPixbuf *
gtk_default_render_icon (GtkStyle *style,
const GtkIconSource *source,
GtkTextDirection direction,
@@ -1484,65 +1691,46 @@ gtk_default_render_icon (GtkStyle *style,
GtkWidget *widget,
const gchar *detail)
{
- gint width = 1;
- gint height = 1;
- GdkPixbuf *scaled;
- GdkPixbuf *stated;
- GdkPixbuf *base_pixbuf;
-
- /* Oddly, style can be NULL in this function, because
- * GtkIconSet can be used without a style and if so
- * it uses this function.
- */
-
- base_pixbuf = gtk_icon_source_get_pixbuf (source);
-
- g_return_val_if_fail (base_pixbuf != NULL, NULL);
+ GtkStyleContext *context;
+ GtkStylePrivate *priv;
+ GtkStateFlags flags = 0;
+ GdkPixbuf *pixbuf;
- if (size != (GtkIconSize) -1 && !lookup_icon_size(style, widget, size, &width, &height))
+ if (widget)
+ context = gtk_widget_get_style_context (widget);
+ else
{
- g_warning (G_STRLOC ": invalid icon size '%d'", size);
- return NULL;
+ priv = GTK_STYLE_GET_PRIVATE (style);
+ context = priv->context;
}
- /* If the size was wildcarded, and we're allowed to scale, then scale; otherwise,
- * leave it alone.
- */
- if (size != (GtkIconSize)-1 && gtk_icon_source_get_size_wildcarded (source))
- scaled = scale_or_ref (base_pixbuf, width, height);
- else
- scaled = g_object_ref (base_pixbuf);
+ if (!context)
+ return NULL;
+
+ gtk_style_context_save (context);
+
+ if (detail)
+ transform_detail_string (detail, context);
- /* If the state was wildcarded, then generate a state. */
- if (gtk_icon_source_get_state_wildcarded (source))
+ switch (state)
{
- if (state == GTK_STATE_INSENSITIVE)
- {
- stated = gdk_pixbuf_copy (scaled);
-
- gdk_pixbuf_saturate_and_pixelate (scaled, stated,
- 0.8, TRUE);
-
- g_object_unref (scaled);
- }
- else if (state == GTK_STATE_PRELIGHT)
- {
- stated = gdk_pixbuf_copy (scaled);
-
- gdk_pixbuf_saturate_and_pixelate (scaled, stated,
- 1.2, FALSE);
-
- g_object_unref (scaled);
- }
- else
- {
- stated = scaled;
- }
+ case GTK_STATE_PRELIGHT:
+ flags |= GTK_STATE_FLAG_PRELIGHT;
+ break;
+ case GTK_STATE_INSENSITIVE:
+ flags |= GTK_STATE_FLAG_INSENSITIVE;
+ break;
+ default:
+ break;
}
- else
- stated = scaled;
-
- return stated;
+
+ gtk_style_context_set_state (context, flags);
+
+ pixbuf = gtk_render_icon_pixbuf (context, source, size);
+
+ gtk_style_context_restore (context);
+
+ return pixbuf;
}
static void
@@ -1600,7 +1788,168 @@ _cairo_draw_point (cairo_t *cr,
}
static void
-gtk_default_draw_hline (GtkStyle *style,
+transform_detail_string (const gchar *detail,
+ GtkStyleContext *context)
+{
+ if (!detail)
+ return;
+
+ if (strcmp (detail, "arrow") == 0)
+ gtk_style_context_add_class (context, "arrow");
+ else if (strcmp (detail, "button") == 0)
+ gtk_style_context_add_class (context, "button");
+ else if (strcmp (detail, "buttondefault") == 0)
+ {
+ gtk_style_context_add_class (context, "button");
+ gtk_style_context_add_class (context, "default");
+ }
+ else if (strcmp (detail, "calendar") == 0)
+ gtk_style_context_add_class (context, "calendar");
+ else if (strcmp (detail, "cellcheck") == 0)
+ {
+ gtk_style_context_add_class (context, "cell");
+ gtk_style_context_add_class (context, "check");
+ }
+ else if (strcmp (detail, "cellradio") == 0)
+ {
+ gtk_style_context_add_class (context, "cell");
+ gtk_style_context_add_class (context, "radio");
+ }
+ else if (strcmp (detail, "checkbutton") == 0)
+ gtk_style_context_add_class (context, "check");
+ else if (strcmp (detail, "check") == 0)
+ {
+ gtk_style_context_add_class (context, "check");
+ gtk_style_context_add_class (context, "menu");
+ }
+ else if (strcmp (detail, "radiobutton") == 0)
+ {
+ gtk_style_context_add_class (context, "radio");
+ }
+ else if (strcmp (detail, "option") == 0)
+ {
+ gtk_style_context_add_class (context, "radio");
+ gtk_style_context_add_class (context, "menu");
+ }
+ else if (strcmp (detail, "entry") == 0 ||
+ strcmp (detail, "entry_bg") == 0)
+ gtk_style_context_add_class (context, "entry");
+ else if (strcmp (detail, "expander") == 0)
+ gtk_style_context_add_class (context, "expander");
+ else if (strcmp (detail, "tooltip") == 0)
+ gtk_style_context_add_class (context, "tooltip");
+ else if (strcmp (detail, "frame") == 0)
+ gtk_style_context_add_class (context, "frame");
+ else if (strcmp (detail, "scrolled_window") == 0)
+ gtk_style_context_add_class (context, "scrolled-window");
+ else if (strcmp (detail, "viewport") == 0 ||
+ strcmp (detail, "viewportbin") == 0)
+ gtk_style_context_add_class (context, "viewport");
+ else if (strncmp (detail, "trough", 6) == 0)
+ gtk_style_context_add_class (context, "trough");
+ else if (strcmp (detail, "spinbutton") == 0)
+ gtk_style_context_add_class (context, "spinbutton");
+ else if (strcmp (detail, "spinbutton_up") == 0)
+ {
+ gtk_style_context_add_class (context, "spinbutton");
+ gtk_style_context_add_class (context, "button");
+ gtk_style_context_set_junction_sides (context, GTK_JUNCTION_BOTTOM);
+ }
+ else if (strcmp (detail, "spinbutton_down") == 0)
+ {
+ gtk_style_context_add_class (context, "spinbutton");
+ gtk_style_context_add_class (context, "button");
+ gtk_style_context_set_junction_sides (context, GTK_JUNCTION_TOP);
+ }
+ else if ((detail[0] == 'h' || detail[0] == 'v') &&
+ strncmp (&detail[1], "scrollbar_", 10) == 0)
+ {
+ gtk_style_context_add_class (context, "button");
+ gtk_style_context_add_class (context, "scrollbar");
+ }
+ else if (strcmp (detail, "slider") == 0)
+ {
+ gtk_style_context_add_class (context, "slider");
+ gtk_style_context_add_class (context, "scrollbar");
+ }
+ else if (strcmp (detail, "vscale") == 0 ||
+ strcmp (detail, "hscale") == 0)
+ {
+ gtk_style_context_add_class (context, "slider");
+ gtk_style_context_add_class (context, "scale");
+ }
+ else if (strcmp (detail, "menuitem") == 0)
+ {
+ gtk_style_context_add_class (context, "menuitem");
+ gtk_style_context_add_class (context, "menu");
+ }
+ else if (strcmp (detail, "menu") == 0)
+ {
+ gtk_style_context_add_class (context, "popup");
+ gtk_style_context_add_class (context, "menu");
+ }
+ else if (strcmp (detail, "accellabel") == 0)
+ gtk_style_context_add_class (context, "accelerator");
+ else if (strcmp (detail, "menubar") == 0)
+ gtk_style_context_add_class (context, "menubar");
+ else if (strcmp (detail, "base") == 0)
+ gtk_style_context_add_class (context, "background");
+ else if (strcmp (detail, "bar") == 0 ||
+ strcmp (detail, "progressbar") == 0)
+ gtk_style_context_add_class (context, "progressbar");
+ else if (strcmp (detail, "toolbar") == 0)
+ gtk_style_context_add_class (context, "toolbar");
+ else if (strcmp (detail, "handlebox_bin") == 0)
+ gtk_style_context_add_class (context, "dock");
+ else if (strcmp (detail, "notebook") == 0)
+ gtk_style_context_add_class (context, "notebook");
+ else if (strcmp (detail, "tab") == 0)
+ {
+ gtk_style_context_add_class (context, "notebook");
+ gtk_style_context_add_region (context, GTK_STYLE_REGION_TAB, 0);
+ }
+ else if (g_str_has_prefix (detail, "cell"))
+ {
+ GtkRegionFlags row, col;
+ gboolean ruled = FALSE;
+ GStrv tokens;
+ guint i;
+
+ tokens = g_strsplit (detail, "_", -1);
+ row = col = 0;
+ i = 0;
+
+ while (tokens[i])
+ {
+ if (strcmp (tokens[i], "even") == 0)
+ row |= GTK_REGION_EVEN;
+ else if (strcmp (tokens[i], "odd") == 0)
+ row |= GTK_REGION_ODD;
+ else if (strcmp (tokens[i], "start") == 0)
+ col |= GTK_REGION_FIRST;
+ else if (strcmp (tokens[i], "end") == 0)
+ col |= GTK_REGION_LAST;
+ else if (strcmp (tokens[i], "ruled") == 0)
+ ruled = TRUE;
+ else if (strcmp (tokens[i], "sorted") == 0)
+ col |= GTK_REGION_SORTED;
+
+ i++;
+ }
+
+ if (!ruled)
+ row &= ~(GTK_REGION_EVEN | GTK_REGION_ODD);
+
+ gtk_style_context_add_class (context, "cell");
+ gtk_style_context_add_region (context, "row", row);
+ gtk_style_context_add_region (context, "column", col);
+
+ g_strfreev (tokens);
+ }
+}
+
+static void
+gtk_default_draw_hline (GtkStyle *style,
cairo_t *cr,
GtkStateType state_type,
GtkWidget *widget,
@@ -1609,36 +1958,30 @@ gtk_default_draw_hline (GtkStyle *style,
gint x2,
gint y)
{
- gint thickness_light;
- gint thickness_dark;
- gint i;
-
- thickness_light = style->ythickness / 2;
- thickness_dark = style->ythickness - thickness_light;
-
- cairo_set_line_width (cr, 1.0);
+ GtkStyleContext *context;
+ GtkStylePrivate *priv;
- if (detail && !strcmp (detail, "label"))
- {
- if (state_type == GTK_STATE_INSENSITIVE)
- _cairo_draw_line (cr, &style->white, x1 + 1, y + 1, x2 + 1, y + 1);
- _cairo_draw_line (cr, &style->fg[state_type], x1, y, x2, y);
- }
+ if (widget)
+ context = gtk_widget_get_style_context (widget);
else
{
- for (i = 0; i < thickness_dark; i++)
- {
- _cairo_draw_line (cr, &style->dark[state_type], x1, y + i, x2 - i - 1, y + i);
- _cairo_draw_line (cr, &style->light[state_type], x2 - i, y + i, x2, y + i);
- }
-
- y += thickness_dark;
- for (i = 0; i < thickness_light; i++)
- {
- _cairo_draw_line (cr, &style->dark[state_type], x1, y + i, x1 + thickness_light - i - 1, y + i);
- _cairo_draw_line (cr, &style->light[state_type], x1 + thickness_light - i, y + i, x2, y + i);
- }
+ priv = GTK_STYLE_GET_PRIVATE (style);
+ context = priv->context;
}
+
+ gtk_style_context_save (context);
+
+ if (detail)
+ transform_detail_string (detail, context);
+
+ cairo_save (cr);
+
+ gtk_render_line (context, cr,
+ x1, y, x2, y);
+
+ cairo_restore (cr);
+
+ gtk_style_context_restore (context);
}
@@ -1652,31 +1995,29 @@ gtk_default_draw_vline (GtkStyle *style,
gint y2,
gint x)
{
- gint thickness_light;
- gint thickness_dark;
- gint i;
-
- thickness_light = style->xthickness / 2;
- thickness_dark = style->xthickness - thickness_light;
-
- cairo_set_line_width (cr, 1.0);
+ GtkStyleContext *context;
+ GtkStylePrivate *priv;
- for (i = 0; i < thickness_dark; i++)
- {
- _cairo_draw_line (cr, &style->dark[state_type],
- x + i, y1, x + i, y2 - i - 1);
- _cairo_draw_line (cr, &style->light[state_type],
- x + i, y2 - i, x + i, y2);
- }
-
- x += thickness_dark;
- for (i = 0; i < thickness_light; i++)
+ if (widget)
+ context = gtk_widget_get_style_context (widget);
+ else
{
- _cairo_draw_line (cr, &style->dark[state_type],
- x + i, y1, x + i, y1 + thickness_light - i - 1);
- _cairo_draw_line (cr, &style->light[state_type],
- x + i, y1 + thickness_light - i, x + i, y2);
+ priv = GTK_STYLE_GET_PRIVATE (style);
+ context = priv->context;
}
+
+ gtk_style_context_save (context);
+
+ if (detail)
+ transform_detail_string (detail, context);
+
+ cairo_save (cr);
+
+ gtk_render_line (context, cr,
+ x, y1, x, y2);
+
+ cairo_restore (cr);
+ gtk_style_context_restore (context);
}
static void
@@ -1838,299 +2179,32 @@ gtk_default_draw_shadow (GtkStyle *style,
gint width,
gint height)
{
- GdkColor *gc1 = NULL;
- GdkColor *gc2 = NULL;
- gint thickness_light;
- gint thickness_dark;
- gint i;
-
- cairo_set_line_width (cr, 1.0);
+ GtkStyleContext *context;
+ GtkStylePrivate *priv;
- if (shadow_type == GTK_SHADOW_IN)
+ if (widget)
+ context = gtk_widget_get_style_context (widget);
+ else
{
- if (detail && strcmp (detail, "buttondefault") == 0)
- {
- _cairo_draw_rectangle (cr, &style->black, FALSE,
- x, y, width - 1, height - 1);
-
- return;
- }
- if (detail && strcmp (detail, "trough") == 0)
- {
- draw_thin_shadow (style, cr, state_type,
- x, y, width, height);
-
- return;
- }
- if (GTK_IS_SPIN_BUTTON (widget) &&
- detail && strcmp (detail, "spinbutton") == 0)
- {
- draw_spinbutton_shadow (style, cr, state_type,
- get_direction (widget), x, y, width, height);
-
- return;
- }
+ priv = GTK_STYLE_GET_PRIVATE (style);
+ context = priv->context;
}
- if (shadow_type == GTK_SHADOW_OUT && detail && strcmp (detail, "menu") == 0)
- {
- draw_menu_shadow (style, cr, state_type, x, y, width, height);
- return;
- }
-
- switch (shadow_type)
- {
- case GTK_SHADOW_NONE:
- return;
- case GTK_SHADOW_IN:
- case GTK_SHADOW_ETCHED_IN:
- gc1 = &style->light[state_type];
- gc2 = &style->dark[state_type];
- break;
- case GTK_SHADOW_OUT:
- case GTK_SHADOW_ETCHED_OUT:
- gc1 = &style->dark[state_type];
- gc2 = &style->light[state_type];
- break;
- }
-
- switch (shadow_type)
- {
- case GTK_SHADOW_NONE:
- break;
-
- case GTK_SHADOW_IN:
- /* Light around right and bottom edge */
-
- if (style->ythickness > 0)
- _cairo_draw_line (cr, gc1,
- x, y + height - 1, x + width - 1, y + height - 1);
- if (style->xthickness > 0)
- _cairo_draw_line (cr, gc1,
- x + width - 1, y, x + width - 1, y + height - 1);
-
- if (style->ythickness > 1)
- _cairo_draw_line (cr, &style->bg[state_type],
- x + 1, y + height - 2, x + width - 2, y + height - 2);
- if (style->xthickness > 1)
- _cairo_draw_line (cr, &style->bg[state_type],
- x + width - 2, y + 1, x + width - 2, y + height - 2);
-
- /* Dark around left and top */
-
- if (style->ythickness > 1)
- _cairo_draw_line (cr, &style->black,
- x + 1, y + 1, x + width - 2, y + 1);
- if (style->xthickness > 1)
- _cairo_draw_line (cr, &style->black,
- x + 1, y + 1, x + 1, y + height - 2);
-
- if (style->ythickness > 0)
- _cairo_draw_line (cr, gc2,
- x, y, x + width - 1, y);
- if (style->xthickness > 0)
- _cairo_draw_line (cr, gc2,
- x, y, x, y + height - 1);
- break;
-
- case GTK_SHADOW_OUT:
- /* Dark around right and bottom edge */
-
- if (style->ythickness > 0)
- {
- if (style->ythickness > 1)
- {
- _cairo_draw_line (cr, gc1,
- x + 1, y + height - 2, x + width - 2, y + height - 2);
- _cairo_draw_line (cr, &style->black,
- x, y + height - 1, x + width - 1, y + height - 1);
- }
- else
- {
- _cairo_draw_line (cr, gc1,
- x + 1, y + height - 1, x + width - 1, y + height - 1);
- }
- }
+ gtk_style_context_save (context);
- if (style->xthickness > 0)
- {
- if (style->xthickness > 1)
- {
- _cairo_draw_line (cr, gc1,
- x + width - 2, y + 1, x + width - 2, y + height - 2);
-
- _cairo_draw_line (cr, &style->black,
- x + width - 1, y, x + width - 1, y + height - 1);
- }
- else
- {
- _cairo_draw_line (cr, gc1,
- x + width - 1, y + 1, x + width - 1, y + height - 1);
- }
- }
-
- /* Light around top and left */
-
- if (style->ythickness > 0)
- _cairo_draw_line (cr, gc2,
- x, y, x + width - 2, y);
- if (style->xthickness > 0)
- _cairo_draw_line (cr, gc2,
- x, y, x, y + height - 2);
+ if (detail)
+ transform_detail_string (detail, context);
- if (style->ythickness > 1)
- _cairo_draw_line (cr, &style->bg[state_type],
- x + 1, y + 1, x + width - 3, y + 1);
- if (style->xthickness > 1)
- _cairo_draw_line (cr, &style->bg[state_type],
- x + 1, y + 1, x + 1, y + height - 3);
- break;
-
- case GTK_SHADOW_ETCHED_IN:
- case GTK_SHADOW_ETCHED_OUT:
- if (style->xthickness > 0)
- {
- if (style->xthickness > 1)
- {
- thickness_light = 1;
- thickness_dark = 1;
-
- for (i = 0; i < thickness_dark; i++)
- {
- _cairo_draw_line (cr, gc1,
- x + width - i - 1,
- y + i,
- x + width - i - 1,
- y + height - i - 1);
- _cairo_draw_line (cr, gc2,
- x + i,
- y + i,
- x + i,
- y + height - i - 2);
- }
-
- for (i = 0; i < thickness_light; i++)
- {
- _cairo_draw_line (cr, gc1,
- x + thickness_dark + i,
- y + thickness_dark + i,
- x + thickness_dark + i,
- y + height - thickness_dark - i - 1);
- _cairo_draw_line (cr, gc2,
- x + width - thickness_light - i - 1,
- y + thickness_dark + i,
- x + width - thickness_light - i - 1,
- y + height - thickness_light - 1);
- }
- }
- else
- {
- _cairo_draw_line (cr,
- &style->dark[state_type],
- x, y, x, y + height);
- _cairo_draw_line (cr,
- &style->dark[state_type],
- x + width, y, x + width, y + height);
- }
- }
+ cairo_save (cr);
- if (style->ythickness > 0)
- {
- if (style->ythickness > 1)
- {
- thickness_light = 1;
- thickness_dark = 1;
-
- for (i = 0; i < thickness_dark; i++)
- {
- _cairo_draw_line (cr, gc1,
- x + i,
- y + height - i - 1,
- x + width - i - 1,
- y + height - i - 1);
-
- _cairo_draw_line (cr, gc2,
- x + i,
- y + i,
- x + width - i - 2,
- y + i);
- }
-
- for (i = 0; i < thickness_light; i++)
- {
- _cairo_draw_line (cr, gc1,
- x + thickness_dark + i,
- y + thickness_dark + i,
- x + width - thickness_dark - i - 2,
- y + thickness_dark + i);
-
- _cairo_draw_line (cr, gc2,
- x + thickness_dark + i,
- y + height - thickness_light - i - 1,
- x + width - thickness_light - 1,
- y + height - thickness_light - i - 1);
- }
- }
- else
- {
- _cairo_draw_line (cr,
- &style->dark[state_type],
- x, y, x + width, y);
- _cairo_draw_line (cr,
- &style->dark[state_type],
- x, y + height, x + width, y + height);
- }
- }
-
- break;
- }
+ gtk_render_frame (context, cr,
+ (gdouble) x,
+ (gdouble) y,
+ (gdouble) width,
+ (gdouble) height);
- if (shadow_type == GTK_SHADOW_IN &&
- GTK_IS_SPIN_BUTTON (widget) &&
- detail && strcmp (detail, "entry") == 0)
- {
- if (get_direction (widget) == GTK_TEXT_DIR_LTR)
- {
- _cairo_draw_line (cr,
- &style->base[state_type],
- x + width - 1, y + 2,
- x + width - 1, y + height - 3);
- _cairo_draw_line (cr,
- &style->base[state_type],
- x + width - 2, y + 2,
- x + width - 2, y + height - 3);
- /* draw point */
- _cairo_draw_point (cr,
- &style->black,
- x + width - 1, y + 1);
- _cairo_draw_point (cr,
- &style->bg[state_type],
- x + width - 1, y + height - 2);
- }
- else
- {
- _cairo_draw_line (cr,
- &style->base[state_type],
- x, y + 2,
- x, y + height - 3);
- _cairo_draw_line (cr,
- &style->base[state_type],
- x + 1, y + 2,
- x + 1, y + height - 3);
-
- _cairo_draw_point (cr,
- &style->black,
- x, y + 1);
-
- _cairo_draw_line (cr,
- &style->bg[state_type],
- x, y + height - 2,
- x + 1, y + height - 2);
- _cairo_draw_point (cr,
- &style->light[state_type],
- x, y + height - 1);
- }
- }
+ cairo_restore (cr);
+ gtk_style_context_restore (context);
}
static void
@@ -2259,16 +2333,79 @@ gtk_default_draw_arrow (GtkStyle *style,
gint width,
gint height)
{
- calculate_arrow_geometry (arrow_type, &x, &y, &width, &height);
+ GtkStyleContext *context;
+ GtkStylePrivate *priv;
+ GtkStateFlags flags = 0;
+ gdouble angle, size;
+
+ if (arrow_type == GTK_ARROW_NONE)
+ return;
+
+ if (widget)
+ context = gtk_widget_get_style_context (widget);
+ else
+ {
+ priv = GTK_STYLE_GET_PRIVATE (style);
+ context = priv->context;
+ }
+
+ gtk_style_context_save (context);
+
+ if (detail)
+ transform_detail_string (detail, context);
+
+ switch (arrow_type)
+ {
+ case GTK_ARROW_UP:
+ angle = 0;
+ size = width;
+ break;
+ case GTK_ARROW_RIGHT:
+ angle = G_PI / 2;
+ size = height;
+ break;
+ case GTK_ARROW_DOWN:
+ angle = G_PI;
+ size = width;
+ break;
+ case GTK_ARROW_LEFT:
+ angle = 3 * (G_PI / 2);
+ size = height;
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+
+ switch (state)
+ {
+ case GTK_STATE_PRELIGHT:
+ flags |= GTK_STATE_FLAG_PRELIGHT;
+ break;
+ case GTK_STATE_SELECTED:
+ flags |= GTK_STATE_FLAG_SELECTED;
+ break;
+ case GTK_STATE_INSENSITIVE:
+ flags |= GTK_STATE_FLAG_INSENSITIVE;
+ break;
+ case GTK_STATE_ACTIVE:
+ flags |= GTK_STATE_FLAG_ACTIVE;
+ break;
+ default:
+ break;
+ }
- if (detail && strcmp (detail, "menu_scroll_arrow_up") == 0)
- y++;
+ gtk_style_context_set_state (context, flags);
- if (state == GTK_STATE_INSENSITIVE)
- draw_arrow (cr, &style->white, arrow_type,
- x + 1, y + 1, width, height);
- draw_arrow (cr, &style->fg[state], arrow_type,
- x, y, width, height);
+ cairo_save (cr);
+
+ gtk_render_arrow (context,
+ cr, angle,
+ (gdouble) x,
+ (gdouble) y,
+ size);
+
+ cairo_restore (cr);
+ gtk_style_context_restore (context);
}
static void
@@ -2433,94 +2570,58 @@ gtk_default_draw_box (GtkStyle *style,
gint width,
gint height)
{
- gboolean is_spinbutton_box = FALSE;
-
- if (GTK_IS_SPIN_BUTTON (widget) && detail)
- {
- if (strcmp (detail, "spinbutton_up") == 0)
- {
- y += 2;
- width -= 3;
- height -= 2;
-
- if (get_direction (widget) == GTK_TEXT_DIR_RTL)
- x += 2;
- else
- x += 1;
-
- is_spinbutton_box = TRUE;
- }
- else if (strcmp (detail, "spinbutton_down") == 0)
- {
- width -= 3;
- height -= 2;
-
- if (get_direction (widget) == GTK_TEXT_DIR_RTL)
- x += 2;
- else
- x += 1;
+ GtkStyleContext *context;
+ GtkStylePrivate *priv;
+ GtkStateFlags flags = 0;
- is_spinbutton_box = TRUE;
- }
- }
-
- if (background_is_solid (style, state_type))
+ if (widget)
+ context = gtk_widget_get_style_context (widget);
+ else
{
- GdkColor *gc = &style->bg[state_type];
-
- if (state_type == GTK_STATE_SELECTED && detail && strcmp (detail, "paned") == 0)
- {
- if (widget && !gtk_widget_has_focus (widget))
- gc = &style->base[GTK_STATE_ACTIVE];
- }
-
- _cairo_draw_rectangle (cr, gc, TRUE,
- x, y, width, height);
+ priv = GTK_STYLE_GET_PRIVATE (style);
+ context = priv->context;
}
- else
- gtk_style_apply_default_background (style, cr, gtk_widget_get_window (widget),
- state_type, x, y, width, height);
+ gtk_style_context_save (context);
- if (is_spinbutton_box)
- {
- GdkColor *upper;
- GdkColor *lower;
+ if (detail)
+ transform_detail_string (detail, context);
- lower = &style->dark[state_type];
- if (shadow_type == GTK_SHADOW_OUT)
- upper = &style->light[state_type];
- else
- upper = &style->dark[state_type];
+ switch (state_type)
+ {
+ case GTK_STATE_ACTIVE:
+ flags |= GTK_STATE_FLAG_ACTIVE;
+ break;
+ case GTK_STATE_PRELIGHT:
+ flags |= GTK_STATE_FLAG_PRELIGHT;
+ break;
+ case GTK_STATE_SELECTED:
+ flags |= GTK_STATE_FLAG_SELECTED;
+ break;
+ case GTK_STATE_INSENSITIVE:
+ flags |= GTK_STATE_FLAG_INSENSITIVE;
+ break;
+ default:
+ break;
+ }
- _cairo_draw_line (cr, upper, x, y, x + width - 1, y);
- _cairo_draw_line (cr, lower, x, y + height - 1, x + width - 1, y + height - 1);
+ if (shadow_type == GTK_SHADOW_IN)
+ flags |= GTK_STATE_FLAG_ACTIVE;
- return;
- }
+ gtk_style_context_set_state (context, flags);
- gtk_paint_shadow (style, cr, state_type, shadow_type, widget, detail,
- x, y, width, height);
+ cairo_save (cr);
- if (detail && strcmp (detail, "optionmenu") == 0)
+ if (gtk_style_context_has_class (context, GTK_STYLE_CLASS_PROGRESSBAR))
+ gtk_render_activity (context, cr, x, y, width, height);
+ else
{
- GtkRequisition indicator_size;
- GtkBorder indicator_spacing;
- gint vline_x;
-
- option_menu_get_props (widget, &indicator_size, &indicator_spacing);
-
- if (get_direction (widget) == GTK_TEXT_DIR_RTL)
- vline_x = x + indicator_size.width + indicator_spacing.left + indicator_spacing.right;
- else
- vline_x = x + width - (indicator_size.width + indicator_spacing.left + indicator_spacing.right) - style->xthickness;
-
- gtk_paint_vline (style, cr, state_type, widget,
- detail,
- y + style->ythickness + 1,
- y + height - style->ythickness - 3,
- vline_x);
+ gtk_render_background (context, cr, x, y, width, height);
+ gtk_render_frame (context, cr, x, y, width, height);
}
+
+ cairo_restore (cr);
+ gtk_style_context_restore (context);
}
static GdkColor *
@@ -2552,198 +2653,56 @@ gtk_default_draw_flat_box (GtkStyle *style,
gint width,
gint height)
{
- GdkColor *gc1;
- GdkColor *freeme = NULL;
-
- cairo_set_line_width (cr, 1.0);
+ GtkStyleContext *context;
+ GtkStylePrivate *priv;
+ GtkStateFlags flags = 0;
- if (detail)
+ if (widget)
+ context = gtk_widget_get_style_context (widget);
+ else
{
- int trimmed_len = strlen (detail);
+ priv = GTK_STYLE_GET_PRIVATE (style);
+ context = priv->context;
+ }
- if (g_str_has_prefix (detail, "cell_"))
- {
- if (g_str_has_suffix (detail, "_start"))
- trimmed_len -= 6;
- else if (g_str_has_suffix (detail, "_middle"))
- trimmed_len -= 7;
- else if (g_str_has_suffix (detail, "_end"))
- trimmed_len -= 4;
- }
+ gtk_style_context_save (context);
- if (state_type == GTK_STATE_SELECTED)
- {
- if (!strcmp ("text", detail))
- gc1 = &style->bg[GTK_STATE_SELECTED];
- else if (!strncmp ("cell_even", detail, trimmed_len) ||
- !strncmp ("cell_odd", detail, trimmed_len) ||
- !strncmp ("cell_even_ruled", detail, trimmed_len) ||
- !strncmp ("cell_even_ruled_sorted", detail, trimmed_len))
- {
- /* This has to be really broken; alex made me do it. -jrb */
- if (widget && gtk_widget_has_focus (widget))
- gc1 = &style->base[state_type];
- else
- gc1 = &style->base[GTK_STATE_ACTIVE];
- }
- else if (!strncmp ("cell_odd_ruled", detail, trimmed_len) ||
- !strncmp ("cell_odd_ruled_sorted", detail, trimmed_len))
- {
- if (widget && gtk_widget_has_focus (widget))
- freeme = get_darkened (&style->base[state_type], 1);
- else
- freeme = get_darkened (&style->base[GTK_STATE_ACTIVE], 1);
- gc1 = freeme;
- }
- else
- {
- gc1 = &style->bg[state_type];
- }
- }
- else
- {
- if (!strcmp ("viewportbin", detail))
- gc1 = &style->bg[GTK_STATE_NORMAL];
- else if (!strcmp ("entry_bg", detail))
- gc1 = &style->base[gtk_widget_get_state (widget)];
-
- /* For trees: even rows are base color, odd rows are a shade of
- * the base color, the sort column is a shade of the original color
- * for that row.
- */
-
- else if (!strncmp ("cell_even", detail, trimmed_len) ||
- !strncmp ("cell_odd", detail, trimmed_len) ||
- !strncmp ("cell_even_ruled", detail, trimmed_len))
- {
- GdkColor *color = NULL;
+ if (detail)
+ transform_detail_string (detail, context);
- gtk_widget_style_get (widget,
- "even-row-color", &color,
- NULL);
+ switch (state_type)
+ {
+ case GTK_STATE_PRELIGHT:
+ flags |= GTK_STATE_FLAG_PRELIGHT;
+ break;
+ case GTK_STATE_SELECTED:
+ flags |= GTK_STATE_FLAG_SELECTED;
+ break;
+ case GTK_STATE_INSENSITIVE:
+ flags |= GTK_STATE_FLAG_INSENSITIVE;
+ break;
+ case GTK_STATE_ACTIVE:
+ flags |= GTK_STATE_FLAG_ACTIVE;
+ break;
+ case GTK_STATE_FOCUSED:
+ flags |= GTK_STATE_FLAG_FOCUSED;
+ break;
+ default:
+ break;
+ }
- if (color)
- {
- freeme = get_darkened (color, 0);
- gc1 = freeme;
+ gtk_style_context_set_state (context, flags);
- gdk_color_free (color);
- }
- else
- gc1 = &style->base[state_type];
- }
- else if (!strncmp ("cell_odd_ruled", detail, trimmed_len))
- {
- GdkColor *color = NULL;
-
- gtk_widget_style_get (widget,
- "odd-row-color", &color,
- NULL);
-
- if (color)
- {
- freeme = get_darkened (color, 0);
- gc1 = freeme;
-
- gdk_color_free (color);
- }
- else
- {
- gtk_widget_style_get (widget,
- "even-row-color", &color,
- NULL);
-
- if (color)
- {
- freeme = get_darkened (color, 1);
- gdk_color_free (color);
- }
- else
- freeme = get_darkened (&style->base[state_type], 1);
- gc1 = freeme;
- }
- }
- else if (!strncmp ("cell_even_sorted", detail, trimmed_len) ||
- !strncmp ("cell_odd_sorted", detail, trimmed_len) ||
- !strncmp ("cell_even_ruled_sorted", detail, trimmed_len))
- {
- GdkColor *color = NULL;
-
- if (!strncmp ("cell_odd_sorted", detail, trimmed_len))
- gtk_widget_style_get (widget,
- "odd-row-color", &color,
- NULL);
- else
- gtk_widget_style_get (widget,
- "even-row-color", &color,
- NULL);
-
- if (color)
- {
- freeme = get_darkened (color, 1);
- gc1 = freeme;
-
- gdk_color_free (color);
- }
- else
- {
- freeme = get_darkened (&style->base[state_type], 1);
- gc1 = freeme;
- }
- }
- else if (!strncmp ("cell_odd_ruled_sorted", detail, trimmed_len))
- {
- GdkColor *color = NULL;
-
- gtk_widget_style_get (widget,
- "odd-row-color", &color,
- NULL);
-
- if (color)
- {
- freeme = get_darkened (color, 1);
- gc1 = freeme;
-
- gdk_color_free (color);
- }
- else
- {
- gtk_widget_style_get (widget,
- "even-row-color", &color,
- NULL);
-
- if (color)
- {
- freeme = get_darkened (color, 2);
- gdk_color_free (color);
- }
- else
- freeme = get_darkened (&style->base[state_type], 2);
- gc1 = freeme;
- }
- }
- else
- gc1 = &style->bg[state_type];
- }
- }
- else
- gc1 = &style->bg[state_type];
-
- if (background_is_solid (style, state_type) || gc1 != &style->bg[state_type])
- {
- _cairo_draw_rectangle (cr, gc1, TRUE,
- x, y, width, height);
+ cairo_save (cr);
- if (detail && !strcmp ("tooltip", detail))
- _cairo_draw_rectangle (cr, &style->black, FALSE,
- x, y, width - 1, height - 1);
- }
- else
- gtk_style_apply_default_background (style, cr, gtk_widget_get_window (widget),
- state_type, x, y, width, height);
+ gtk_render_background (context, cr,
+ (gdouble) x,
+ (gdouble) y,
+ (gdouble) width,
+ (gdouble) height);
- if (freeme)
- gdk_color_free (freeme);
+ cairo_restore (cr);
+ gtk_style_context_restore (context);
}
static void
@@ -2758,107 +2717,53 @@ gtk_default_draw_check (GtkStyle *style,
gint width,
gint height)
{
- enum { BUTTON, MENU, CELL } type = BUTTON;
- int exterior_size;
- int interior_size;
- int pad;
-
- if (detail)
- {
- if (strcmp (detail, "cellcheck") == 0)
- type = CELL;
- else if (strcmp (detail, "check") == 0)
- type = MENU;
- }
-
- exterior_size = MIN (width, height);
- if (exterior_size % 2 == 0) /* Ensure odd */
- exterior_size -= 1;
-
- pad = style->xthickness + MAX (1, (exterior_size - 2 * style->xthickness) / 9);
- interior_size = MAX (1, exterior_size - 2 * pad);
+ GtkStyleContext *context;
+ GtkStylePrivate *priv;
+ GtkStateFlags flags = 0;
- if (interior_size < 7)
+ if (widget)
+ context = gtk_widget_get_style_context (widget);
+ else
{
- interior_size = 7;
- pad = MAX (0, (exterior_size - interior_size) / 2);
+ priv = GTK_STYLE_GET_PRIVATE (style);
+ context = priv->context;
}
- x -= (1 + exterior_size - width) / 2;
- y -= (1 + exterior_size - height) / 2;
+ gtk_style_context_save (context);
- switch (type)
- {
- case BUTTON:
- case CELL:
- if (type == BUTTON)
- gdk_cairo_set_source_color (cr, &style->fg[state_type]);
- else
- gdk_cairo_set_source_color (cr, &style->text[state_type]);
-
- cairo_set_line_width (cr, 1.0);
- cairo_rectangle (cr, x + 0.5, y + 0.5, exterior_size - 1, exterior_size - 1);
- cairo_stroke (cr);
+ if (detail)
+ transform_detail_string (detail, context);
- gdk_cairo_set_source_color (cr, &style->base[state_type]);
- cairo_rectangle (cr, x + 1, y + 1, exterior_size - 2, exterior_size - 2);
- cairo_fill (cr);
+ switch (state_type)
+ {
+ case GTK_STATE_PRELIGHT:
+ flags |= GTK_STATE_FLAG_PRELIGHT;
break;
-
- case MENU:
+ case GTK_STATE_SELECTED:
+ flags |= GTK_STATE_FLAG_SELECTED;
break;
- }
-
- switch (type)
- {
- case BUTTON:
- case CELL:
- gdk_cairo_set_source_color (cr, &style->text[state_type]);
+ case GTK_STATE_INSENSITIVE:
+ flags |= GTK_STATE_FLAG_INSENSITIVE;
break;
- case MENU:
- gdk_cairo_set_source_color (cr, &style->fg[state_type]);
+ default:
break;
}
if (shadow_type == GTK_SHADOW_IN)
- {
- cairo_translate (cr,
- x + pad, y + pad);
-
- cairo_scale (cr, interior_size / 7., interior_size / 7.);
-
- cairo_move_to (cr, 7.0, 0.0);
- cairo_line_to (cr, 7.5, 1.0);
- cairo_curve_to (cr, 5.3, 2.0,
- 4.3, 4.0,
- 3.5, 7.0);
- cairo_curve_to (cr, 3.0, 5.7,
- 1.3, 4.7,
- 0.0, 4.7);
- cairo_line_to (cr, 0.2, 3.5);
- cairo_curve_to (cr, 1.1, 3.5,
- 2.3, 4.3,
- 3.0, 5.0);
- cairo_curve_to (cr, 1.0, 3.9,
- 2.4, 4.1,
- 3.2, 4.9);
- cairo_curve_to (cr, 3.5, 3.1,
- 5.2, 2.0,
- 7.0, 0.0);
-
- cairo_fill (cr);
- }
- else if (shadow_type == GTK_SHADOW_ETCHED_IN) /* inconsistent */
- {
- int line_thickness = MAX (1, (3 + interior_size * 2) / 7);
+ flags |= GTK_STATE_FLAG_ACTIVE;
+ else if (shadow_type == GTK_SHADOW_ETCHED_IN)
+ flags |= GTK_STATE_FLAG_INCONSISTENT;
- cairo_rectangle (cr,
- x + pad,
- y + pad + (1 + interior_size - line_thickness) / 2,
- interior_size,
- line_thickness);
- cairo_fill (cr);
- }
+ gtk_style_context_set_state (context, flags);
+
+ cairo_save (cr);
+
+ gtk_render_check (context,
+ cr, x, y,
+ width, height);
+
+ cairo_restore (cr);
+ gtk_style_context_restore (context);
}
static void
@@ -2873,102 +2778,54 @@ gtk_default_draw_option (GtkStyle *style,
gint width,
gint height)
{
- enum { BUTTON, MENU, CELL } type = BUTTON;
- int exterior_size;
-
- if (detail)
- {
- if (strcmp (detail, "radio") == 0)
- type = CELL;
- else if (strcmp (detail, "option") == 0)
- type = MENU;
- }
-
- exterior_size = MIN (width, height);
- if (exterior_size % 2 == 0) /* Ensure odd */
- exterior_size -= 1;
-
- x -= (1 + exterior_size - width) / 2;
- y -= (1 + exterior_size - height) / 2;
+ GtkStyleContext *context;
+ GtkStylePrivate *priv;
+ GtkStateFlags flags = 0;
- switch (type)
+ if (widget)
+ context = gtk_widget_get_style_context (widget);
+ else
{
- case BUTTON:
- case CELL:
- gdk_cairo_set_source_color (cr, &style->base[state_type]);
-
- cairo_arc (cr,
- x + exterior_size / 2.,
- y + exterior_size / 2.,
- (exterior_size - 1) / 2.,
- 0, 2 * G_PI);
+ priv = GTK_STYLE_GET_PRIVATE (style);
+ context = priv->context;
+ }
- cairo_fill_preserve (cr);
+ gtk_style_context_save (context);
- if (type == BUTTON)
- gdk_cairo_set_source_color (cr, &style->fg[state_type]);
- else
- gdk_cairo_set_source_color (cr, &style->text[state_type]);
-
- cairo_set_line_width (cr, 1.);
- cairo_stroke (cr);
- break;
+ if (detail)
+ transform_detail_string (detail, context);
- case MENU:
- break;
- }
-
- switch (type)
+ switch (state_type)
{
- case BUTTON:
- gdk_cairo_set_source_color (cr, &style->text[state_type]);
+ case GTK_STATE_PRELIGHT:
+ flags |= GTK_STATE_FLAG_PRELIGHT;
+ break;
+ case GTK_STATE_SELECTED:
+ flags |= GTK_STATE_FLAG_SELECTED;
break;
- case CELL:
+ case GTK_STATE_INSENSITIVE:
+ flags |= GTK_STATE_FLAG_INSENSITIVE;
break;
- case MENU:
- gdk_cairo_set_source_color (cr, &style->fg[state_type]);
+ default:
break;
}
if (shadow_type == GTK_SHADOW_IN)
- {
- int pad = style->xthickness + MAX (1, 2 * (exterior_size - 2 * style->xthickness) / 9);
- int interior_size = MAX (1, exterior_size - 2 * pad);
+ flags |= GTK_STATE_FLAG_ACTIVE;
+ else if (shadow_type == GTK_SHADOW_ETCHED_IN)
+ flags |= GTK_STATE_FLAG_INCONSISTENT;
- if (interior_size < 5)
- {
- interior_size = 7;
- pad = MAX (0, (exterior_size - interior_size) / 2);
- }
+ gtk_style_context_set_state (context, flags);
- cairo_arc (cr,
- x + pad + interior_size / 2.,
- y + pad + interior_size / 2.,
- interior_size / 2.,
- 0, 2 * G_PI);
- cairo_fill (cr);
- }
- else if (shadow_type == GTK_SHADOW_ETCHED_IN) /* inconsistent */
- {
- int pad = style->xthickness + MAX (1, (exterior_size - 2 * style->xthickness) / 9);
- int interior_size = MAX (1, exterior_size - 2 * pad);
- int line_thickness;
-
- if (interior_size < 7)
- {
- interior_size = 7;
- pad = MAX (0, (exterior_size - interior_size) / 2);
- }
-
- line_thickness = MAX (1, (3 + interior_size * 2) / 7);
+ cairo_save (cr);
+ gtk_render_option (context, cr,
+ (gdouble) x,
+ (gdouble) y,
+ (gdouble) width,
+ (gdouble) height);
- cairo_rectangle (cr,
- x + pad,
- y + pad + (interior_size - line_thickness) / 2.,
- interior_size,
- line_thickness);
- cairo_fill (cr);
- }
+ cairo_restore (cr);
+ gtk_style_context_restore (context);
}
static void
@@ -3033,185 +2890,55 @@ gtk_default_draw_shadow_gap (GtkStyle *style,
gint gap_x,
gint gap_width)
{
- GdkColor *color1 = NULL;
- GdkColor *color2 = NULL;
- GdkColor *color3 = NULL;
- GdkColor *color4 = NULL;
-
- switch (shadow_type)
+ GtkStyleContext *context;
+ GtkStylePrivate *priv;
+ GtkStateFlags flags = 0;
+
+ if (widget)
+ context = gtk_widget_get_style_context (widget);
+ else
{
- case GTK_SHADOW_NONE:
- default:
- return;
- case GTK_SHADOW_IN:
- color1 = &style->dark[state_type];
- color2 = &style->black;
- color3 = &style->bg[state_type];
- color4 = &style->light[state_type];
+ priv = GTK_STYLE_GET_PRIVATE (style);
+ context = priv->context;
+ }
+
+ gtk_style_context_save (context);
+
+ if (detail)
+ transform_detail_string (detail, context);
+
+ switch (state_type)
+ {
+ case GTK_STATE_ACTIVE:
+ flags |= GTK_STATE_FLAG_ACTIVE;
break;
- case GTK_SHADOW_ETCHED_IN:
- color1 = &style->dark[state_type];
- color2 = &style->light[state_type];
- color3 = &style->dark[state_type];
- color4 = &style->light[state_type];
+ case GTK_STATE_PRELIGHT:
+ flags |= GTK_STATE_FLAG_PRELIGHT;
break;
- case GTK_SHADOW_OUT:
- color1 = &style->light[state_type];
- color2 = &style->bg[state_type];
- color3 = &style->dark[state_type];
- color4 = &style->black;
+ case GTK_STATE_SELECTED:
+ flags |= GTK_STATE_FLAG_SELECTED;
break;
- case GTK_SHADOW_ETCHED_OUT:
- color1 = &style->light[state_type];
- color2 = &style->dark[state_type];
- color3 = &style->light[state_type];
- color4 = &style->dark[state_type];
+ case GTK_STATE_INSENSITIVE:
+ flags |= GTK_STATE_FLAG_INSENSITIVE;
+ break;
+ default:
break;
}
- switch (shadow_type)
- {
- case GTK_SHADOW_NONE:
- case GTK_SHADOW_IN:
- case GTK_SHADOW_OUT:
- case GTK_SHADOW_ETCHED_IN:
- case GTK_SHADOW_ETCHED_OUT:
- switch (gap_side)
- {
- case GTK_POS_TOP:
- _cairo_draw_line (cr, color1,
- x, y, x, y + height - 1);
- _cairo_draw_line (cr, color2,
- x + 1, y, x + 1, y + height - 2);
-
- _cairo_draw_line (cr, color3,
- x + 1, y + height - 2, x + width - 2, y + height - 2);
- _cairo_draw_line (cr, color3,
- x + width - 2, y, x + width - 2, y + height - 2);
- _cairo_draw_line (cr, color4,
- x, y + height - 1, x + width - 1, y + height - 1);
- _cairo_draw_line (cr, color4,
- x + width - 1, y, x + width - 1, y + height - 1);
- if (gap_x > 0)
- {
- _cairo_draw_line (cr, color1,
- x, y, x + gap_x - 1, y);
- _cairo_draw_line (cr, color2,
- x + 1, y + 1, x + gap_x - 1, y + 1);
- _cairo_draw_line (cr, color2,
- x + gap_x, y, x + gap_x, y);
- }
- if ((width - (gap_x + gap_width)) > 0)
- {
- _cairo_draw_line (cr, color1,
- x + gap_x + gap_width, y, x + width - 2, y);
- _cairo_draw_line (cr, color2,
- x + gap_x + gap_width, y + 1, x + width - 3, y + 1);
- _cairo_draw_line (cr, color2,
- x + gap_x + gap_width - 1, y, x + gap_x + gap_width - 1, y);
- }
- break;
- case GTK_POS_BOTTOM:
- _cairo_draw_line (cr, color1,
- x, y, x + width - 1, y);
- _cairo_draw_line (cr, color1,
- x, y, x, y + height - 1);
- _cairo_draw_line (cr, color2,
- x + 1, y + 1, x + width - 2, y + 1);
- _cairo_draw_line (cr, color2,
- x + 1, y + 1, x + 1, y + height - 1);
-
- _cairo_draw_line (cr, color3,
- x + width - 2, y + 1, x + width - 2, y + height - 1);
- _cairo_draw_line (cr, color4,
- x + width - 1, y, x + width - 1, y + height - 1);
- if (gap_x > 0)
- {
- _cairo_draw_line (cr, color4,
- x, y + height - 1, x + gap_x - 1, y + height - 1);
- _cairo_draw_line (cr, color3,
- x + 1, y + height - 2, x + gap_x - 1, y + height - 2);
- _cairo_draw_line (cr, color3,
- x + gap_x, y + height - 1, x + gap_x, y + height - 1);
- }
- if ((width - (gap_x + gap_width)) > 0)
- {
- _cairo_draw_line (cr, color4,
- x + gap_x + gap_width, y + height - 1, x + width - 2, y + height - 1);
- _cairo_draw_line (cr, color3,
- x + gap_x + gap_width, y + height - 2, x + width - 2, y + height - 2);
- _cairo_draw_line (cr, color3,
- x + gap_x + gap_width - 1, y + height - 1, x + gap_x + gap_width - 1, y + height - 1);
- }
- break;
- case GTK_POS_LEFT:
- _cairo_draw_line (cr, color1,
- x, y, x + width - 1, y);
- _cairo_draw_line (cr, color2,
- x, y + 1, x + width - 2, y + 1);
-
- _cairo_draw_line (cr, color3,
- x, y + height - 2, x + width - 2, y + height - 2);
- _cairo_draw_line (cr, color3,
- x + width - 2, y + 1, x + width - 2, y + height - 2);
- _cairo_draw_line (cr, color4,
- x, y + height - 1, x + width - 1, y + height - 1);
- _cairo_draw_line (cr, color4,
- x + width - 1, y, x + width - 1, y + height - 1);
- if (gap_x > 0)
- {
- _cairo_draw_line (cr, color1,
- x, y, x, y + gap_x - 1);
- _cairo_draw_line (cr, color2,
- x + 1, y + 1, x + 1, y + gap_x - 1);
- _cairo_draw_line (cr, color2,
- x, y + gap_x, x, y + gap_x);
- }
- if ((width - (gap_x + gap_width)) > 0)
- {
- _cairo_draw_line (cr, color1,
- x, y + gap_x + gap_width, x, y + height - 2);
- _cairo_draw_line (cr, color2,
- x + 1, y + gap_x + gap_width, x + 1, y + height - 2);
- _cairo_draw_line (cr, color2,
- x, y + gap_x + gap_width - 1, x, y + gap_x + gap_width - 1);
- }
- break;
- case GTK_POS_RIGHT:
- _cairo_draw_line (cr, color1,
- x, y, x + width - 1, y);
- _cairo_draw_line (cr, color1,
- x, y, x, y + height - 1);
- _cairo_draw_line (cr, color2,
- x + 1, y + 1, x + width - 1, y + 1);
- _cairo_draw_line (cr, color2,
- x + 1, y + 1, x + 1, y + height - 2);
-
- _cairo_draw_line (cr, color3,
- x + 1, y + height - 2, x + width - 1, y + height - 2);
- _cairo_draw_line (cr, color4,
- x, y + height - 1, x + width - 1, y + height - 1);
- if (gap_x > 0)
- {
- _cairo_draw_line (cr, color4,
- x + width - 1, y, x + width - 1, y + gap_x - 1);
- _cairo_draw_line (cr, color3,
- x + width - 2, y + 1, x + width - 2, y + gap_x - 1);
- _cairo_draw_line (cr, color3,
- x + width - 1, y + gap_x, x + width - 1, y + gap_x);
- }
- if ((width - (gap_x + gap_width)) > 0)
- {
- _cairo_draw_line (cr, color4,
- x + width - 1, y + gap_x + gap_width, x + width - 1, y + height - 2);
- _cairo_draw_line (cr, color3,
- x + width - 2, y + gap_x + gap_width, x + width - 2, y + height - 2);
- _cairo_draw_line (cr, color3,
- x + width - 1, y + gap_x + gap_width - 1, x + width - 1, y + gap_x + gap_width - 1);
- }
- break;
- }
- }
+ gtk_style_context_set_state (context, flags);
+
+ cairo_save (cr);
+ gtk_render_frame_gap (context, cr,
+ (gdouble) x,
+ (gdouble) y,
+ (gdouble) width,
+ (gdouble) height,
+ gap_side,
+ (gdouble) gap_x,
+ (gdouble) gap_x + gap_width);
+
+ cairo_restore (cr);
+ gtk_style_context_restore (context);
}
static void
@@ -3229,189 +2956,61 @@ gtk_default_draw_box_gap (GtkStyle *style,
gint gap_x,
gint gap_width)
{
- GdkColor color1;
- GdkColor color2;
- GdkColor color3;
- GdkColor color4;
-
- gtk_style_apply_default_background (style, cr, gtk_widget_get_window (widget),
- state_type, x, y, width, height);
+ GtkStyleContext *context;
+ GtkStylePrivate *priv;
+ GtkStateFlags flags = 0;
- switch (shadow_type)
+ if (widget)
+ context = gtk_widget_get_style_context (widget);
+ else
{
- case GTK_SHADOW_NONE:
- return;
- case GTK_SHADOW_IN:
- color1 = style->dark[state_type];
- color2 = style->black;
- color3 = style->bg[state_type];
- color4 = style->light[state_type];
+ priv = GTK_STYLE_GET_PRIVATE (style);
+ context = priv->context;
+ }
+
+ gtk_style_context_save (context);
+
+ if (detail)
+ transform_detail_string (detail, context);
+
+ switch (state_type)
+ {
+ case GTK_STATE_ACTIVE:
+ flags |= GTK_STATE_FLAG_ACTIVE;
break;
- case GTK_SHADOW_ETCHED_IN:
- color1 = style->dark[state_type];
- color2 = style->light[state_type];
- color3 = style->dark[state_type];
- color4 = style->light[state_type];
+ case GTK_STATE_PRELIGHT:
+ flags |= GTK_STATE_FLAG_PRELIGHT;
break;
- case GTK_SHADOW_OUT:
- color1 = style->light[state_type];
- color2 = style->bg[state_type];
- color3 = style->dark[state_type];
- color4 = style->black;
+ case GTK_STATE_SELECTED:
+ flags |= GTK_STATE_FLAG_SELECTED;
break;
- case GTK_SHADOW_ETCHED_OUT:
- color1 = style->light[state_type];
- color2 = style->dark[state_type];
- color3 = style->light[state_type];
- color4 = style->dark[state_type];
+ case GTK_STATE_INSENSITIVE:
+ flags |= GTK_STATE_FLAG_INSENSITIVE;
+ break;
+ default:
break;
}
-
- cairo_set_line_width (cr, 1.0);
- switch (shadow_type)
- {
- case GTK_SHADOW_NONE:
- case GTK_SHADOW_IN:
- case GTK_SHADOW_OUT:
- case GTK_SHADOW_ETCHED_IN:
- case GTK_SHADOW_ETCHED_OUT:
- switch (gap_side)
- {
- case GTK_POS_TOP:
- _cairo_draw_line (cr, &color1,
- x, y, x, y + height - 1);
- _cairo_draw_line (cr, &color2,
- x + 1, y, x + 1, y + height - 2);
-
- _cairo_draw_line (cr, &color3,
- x + 1, y + height - 2, x + width - 2, y + height - 2);
- _cairo_draw_line (cr, &color3,
- x + width - 2, y, x + width - 2, y + height - 2);
- _cairo_draw_line (cr, &color4,
- x, y + height - 1, x + width - 1, y + height - 1);
- _cairo_draw_line (cr, &color4,
- x + width - 1, y, x + width - 1, y + height - 1);
- if (gap_x > 0)
- {
- _cairo_draw_line (cr, &color1,
- x, y, x + gap_x - 1, y);
- _cairo_draw_line (cr, &color2,
- x + 1, y + 1, x + gap_x - 1, y + 1);
- _cairo_draw_line (cr, &color2,
- x + gap_x, y, x + gap_x, y);
- }
- if ((width - (gap_x + gap_width)) > 0)
- {
- _cairo_draw_line (cr, &color1,
- x + gap_x + gap_width, y, x + width - 2, y);
- _cairo_draw_line (cr, &color2,
- x + gap_x + gap_width, y + 1, x + width - 2, y + 1);
- _cairo_draw_line (cr, &color2,
- x + gap_x + gap_width - 1, y, x + gap_x + gap_width - 1, y);
- }
- break;
- case GTK_POS_BOTTOM:
- _cairo_draw_line (cr, &color1,
- x, y, x + width - 1, y);
- _cairo_draw_line (cr, &color1,
- x, y, x, y + height - 1);
- _cairo_draw_line (cr, &color2,
- x + 1, y + 1, x + width - 2, y + 1);
- _cairo_draw_line (cr, &color2,
- x + 1, y + 1, x + 1, y + height - 1);
-
- _cairo_draw_line (cr, &color3,
- x + width - 2, y + 1, x + width - 2, y + height - 1);
- _cairo_draw_line (cr, &color4,
- x + width - 1, y, x + width - 1, y + height - 1);
- if (gap_x > 0)
- {
- _cairo_draw_line (cr, &color4,
- x, y + height - 1, x + gap_x - 1, y + height - 1);
- _cairo_draw_line (cr, &color3,
- x + 1, y + height - 2, x + gap_x - 1, y + height - 2);
- _cairo_draw_line (cr, &color3,
- x + gap_x, y + height - 1, x + gap_x, y + height - 1);
- }
- if ((width - (gap_x + gap_width)) > 0)
- {
- _cairo_draw_line (cr, &color4,
- x + gap_x + gap_width, y + height - 1, x + width - 2, y + height - 1);
- _cairo_draw_line (cr, &color3,
- x + gap_x + gap_width, y + height - 2, x + width - 2, y + height - 2);
- _cairo_draw_line (cr, &color3,
- x + gap_x + gap_width - 1, y + height - 1, x + gap_x + gap_width - 1, y + height - 1);
- }
- break;
- case GTK_POS_LEFT:
- _cairo_draw_line (cr, &color1,
- x, y, x + width - 1, y);
- _cairo_draw_line (cr, &color2,
- x, y + 1, x + width - 2, y + 1);
-
- _cairo_draw_line (cr, &color3,
- x, y + height - 2, x + width - 2, y + height - 2);
- _cairo_draw_line (cr, &color3,
- x + width - 2, y + 1, x + width - 2, y + height - 2);
- _cairo_draw_line (cr, &color4,
- x, y + height - 1, x + width - 1, y + height - 1);
- _cairo_draw_line (cr, &color4,
- x + width - 1, y, x + width - 1, y + height - 1);
- if (gap_x > 0)
- {
- _cairo_draw_line (cr, &color1,
- x, y, x, y + gap_x - 1);
- _cairo_draw_line (cr, &color2,
- x + 1, y + 1, x + 1, y + gap_x - 1);
- _cairo_draw_line (cr, &color2,
- x, y + gap_x, x, y + gap_x);
- }
- if ((height - (gap_x + gap_width)) > 0)
- {
- _cairo_draw_line (cr, &color1,
- x, y + gap_x + gap_width, x, y + height - 2);
- _cairo_draw_line (cr, &color2,
- x + 1, y + gap_x + gap_width, x + 1, y + height - 2);
- _cairo_draw_line (cr, &color2,
- x, y + gap_x + gap_width - 1, x, y + gap_x + gap_width - 1);
- }
- break;
- case GTK_POS_RIGHT:
- _cairo_draw_line (cr, &color1,
- x, y, x + width - 1, y);
- _cairo_draw_line (cr, &color1,
- x, y, x, y + height - 1);
- _cairo_draw_line (cr, &color2,
- x + 1, y + 1, x + width - 1, y + 1);
- _cairo_draw_line (cr, &color2,
- x + 1, y + 1, x + 1, y + height - 2);
-
- _cairo_draw_line (cr, &color3,
- x + 1, y + height - 2, x + width - 1, y + height - 2);
- _cairo_draw_line (cr, &color4,
- x, y + height - 1, x + width - 1, y + height - 1);
- if (gap_x > 0)
- {
- _cairo_draw_line (cr, &color4,
- x + width - 1, y, x + width - 1, y + gap_x - 1);
- _cairo_draw_line (cr, &color3,
- x + width - 2, y + 1, x + width - 2, y + gap_x - 1);
- _cairo_draw_line (cr, &color3,
- x + width - 1, y + gap_x, x + width - 1, y + gap_x);
- }
- if ((height - (gap_x + gap_width)) > 0)
- {
- _cairo_draw_line (cr, &color4,
- x + width - 1, y + gap_x + gap_width, x + width - 1, y + height - 2);
- _cairo_draw_line (cr, &color3,
- x + width - 2, y + gap_x + gap_width, x + width - 2, y + height - 2);
- _cairo_draw_line (cr, &color3,
- x + width - 1, y + gap_x + gap_width - 1, x + width - 1, y + gap_x + gap_width - 1);
- }
- break;
- }
- }
+ gtk_style_context_set_state (context, flags);
+
+ cairo_save (cr);
+ gtk_render_background (context, cr,
+ (gdouble) x,
+ (gdouble) y,
+ (gdouble) width,
+ (gdouble) height);
+
+ gtk_render_frame_gap (context, cr,
+ (gdouble) x,
+ (gdouble) y,
+ (gdouble) width,
+ (gdouble) height,
+ gap_side,
+ (gdouble) gap_x,
+ (gdouble) gap_x + gap_width);
+
+ cairo_restore (cr);
+ gtk_style_context_restore (context);
}
static void
@@ -3427,151 +3026,54 @@ gtk_default_draw_extension (GtkStyle *style,
gint height,
GtkPositionType gap_side)
{
- GdkWindow *window = gtk_widget_get_window (widget);
- GdkColor color1;
- GdkColor color2;
- GdkColor color3;
- GdkColor color4;
-
- switch (gap_side)
+ GtkStyleContext *context;
+ GtkStylePrivate *priv;
+ GtkStateFlags flags = 0;
+
+ if (widget)
+ context = gtk_widget_get_style_context (widget);
+ else
{
- case GTK_POS_TOP:
- gtk_style_apply_default_background (style, cr, window,
- state_type,
- x + 1,
- y,
- width - 2,
- height - 1);
- break;
- case GTK_POS_BOTTOM:
- gtk_style_apply_default_background (style, cr, window,
- state_type,
- x + 1,
- y + 1,
- width - 2,
- height - 1);
- break;
- case GTK_POS_LEFT:
- gtk_style_apply_default_background (style, cr, window,
- state_type,
- x,
- y + 1,
- width - 1,
- height - 2);
- break;
- case GTK_POS_RIGHT:
- gtk_style_apply_default_background (style, cr, window,
- state_type,
- x + 1,
- y + 1,
- width - 1,
- height - 2);
- break;
+ priv = GTK_STYLE_GET_PRIVATE (style);
+ context = priv->context;
}
- switch (shadow_type)
+ gtk_style_context_save (context);
+
+ if (detail)
+ transform_detail_string (detail, context);
+
+ switch (state_type)
{
- case GTK_SHADOW_NONE:
- return;
- case GTK_SHADOW_IN:
- color1 = style->dark[state_type];
- color2 = style->black;
- color3 = style->bg[state_type];
- color4 = style->light[state_type];
+ case GTK_STATE_ACTIVE:
+ flags |= GTK_STATE_FLAG_ACTIVE;
break;
- case GTK_SHADOW_ETCHED_IN:
- color1 = style->dark[state_type];
- color2 = style->light[state_type];
- color3 = style->dark[state_type];
- color4 = style->light[state_type];
+ case GTK_STATE_PRELIGHT:
+ flags |= GTK_STATE_FLAG_PRELIGHT;
break;
- case GTK_SHADOW_OUT:
- color1 = style->light[state_type];
- color2 = style->bg[state_type];
- color3 = style->dark[state_type];
- color4 = style->black;
+ case GTK_STATE_SELECTED:
+ flags |= GTK_STATE_FLAG_SELECTED;
break;
- case GTK_SHADOW_ETCHED_OUT:
- color1 = style->light[state_type];
- color2 = style->dark[state_type];
- color3 = style->light[state_type];
- color4 = style->dark[state_type];
+ case GTK_STATE_INSENSITIVE:
+ flags |= GTK_STATE_FLAG_INSENSITIVE;
+ break;
+ default:
break;
}
- cairo_set_line_width (cr, 1.0);
+ gtk_style_context_set_state (context, flags);
- switch (shadow_type)
- {
- case GTK_SHADOW_NONE:
- case GTK_SHADOW_IN:
- case GTK_SHADOW_OUT:
- case GTK_SHADOW_ETCHED_IN:
- case GTK_SHADOW_ETCHED_OUT:
- switch (gap_side)
- {
- case GTK_POS_TOP:
- _cairo_draw_line (cr, &color1,
- x, y, x, y + height - 2);
- _cairo_draw_line (cr, &color2,
- x + 1, y, x + 1, y + height - 2);
-
- _cairo_draw_line (cr, &color3,
- x + 2, y + height - 2, x + width - 2, y + height - 2);
- _cairo_draw_line (cr, &color3,
- x + width - 2, y, x + width - 2, y + height - 2);
- _cairo_draw_line (cr, &color4,
- x + 1, y + height - 1, x + width - 2, y + height - 1);
- _cairo_draw_line (cr, &color4,
- x + width - 1, y, x + width - 1, y + height - 2);
- break;
- case GTK_POS_BOTTOM:
- _cairo_draw_line (cr, &color1,
- x + 1, y, x + width - 2, y);
- _cairo_draw_line (cr, &color1,
- x, y + 1, x, y + height - 1);
- _cairo_draw_line (cr, &color2,
- x + 1, y + 1, x + width - 2, y + 1);
- _cairo_draw_line (cr, &color2,
- x + 1, y + 1, x + 1, y + height - 1);
-
- _cairo_draw_line (cr, &color3,
- x + width - 2, y + 2, x + width - 2, y + height - 1);
- _cairo_draw_line (cr, &color4,
- x + width - 1, y + 1, x + width - 1, y + height - 1);
- break;
- case GTK_POS_LEFT:
- _cairo_draw_line (cr, &color1,
- x, y, x + width - 2, y);
- _cairo_draw_line (cr, &color2,
- x + 1, y + 1, x + width - 2, y + 1);
-
- _cairo_draw_line (cr, &color3,
- x, y + height - 2, x + width - 2, y + height - 2);
- _cairo_draw_line (cr, &color3,
- x + width - 2, y + 2, x + width - 2, y + height - 2);
- _cairo_draw_line (cr, &color4,
- x, y + height - 1, x + width - 2, y + height - 1);
- _cairo_draw_line (cr, &color4,
- x + width - 1, y + 1, x + width - 1, y + height - 2);
- break;
- case GTK_POS_RIGHT:
- _cairo_draw_line (cr, &color1,
- x + 1, y, x + width - 1, y);
- _cairo_draw_line (cr, &color1,
- x, y + 1, x, y + height - 2);
- _cairo_draw_line (cr, &color2,
- x + 1, y + 1, x + width - 1, y + 1);
- _cairo_draw_line (cr, &color2,
- x + 1, y + 1, x + 1, y + height - 2);
-
- _cairo_draw_line (cr, &color3,
- x + 2, y + height - 2, x + width - 1, y + height - 2);
- _cairo_draw_line (cr, &color4,
- x + 1, y + height - 1, x + width - 1, y + height - 1);
- break;
- }
- }
+ cairo_save (cr);
+
+ gtk_render_extension (context, cr,
+ (gdouble) x,
+ (gdouble) y,
+ (gdouble) width,
+ (gdouble) height,
+ gap_side);
+
+ cairo_restore (cr);
+ gtk_style_context_restore (context);
}
static void
@@ -3585,74 +3087,32 @@ gtk_default_draw_focus (GtkStyle *style,
gint width,
gint height)
{
- gboolean free_dash_list = FALSE;
- gint line_width = 1;
- gint8 *dash_list = (gint8 *) "\1\1";
+ GtkStyleContext *context;
+ GtkStylePrivate *priv;
if (widget)
+ context = gtk_widget_get_style_context (widget);
+ else
{
- gtk_widget_style_get (widget,
- "focus-line-width", &line_width,
- "focus-line-pattern", (gchar *)&dash_list,
- NULL);
-
- free_dash_list = TRUE;
- }
-
- if (detail && !strcmp (detail, "add-mode"))
- {
- if (free_dash_list)
- g_free (dash_list);
-
- dash_list = (gint8 *) "\4\4";
- free_dash_list = FALSE;
+ priv = GTK_STYLE_GET_PRIVATE (style);
+ context = priv->context;
}
- if (detail && !strcmp (detail, "colorwheel_light"))
- cairo_set_source_rgb (cr, 0., 0., 0.);
- else if (detail && !strcmp (detail, "colorwheel_dark"))
- cairo_set_source_rgb (cr, 1., 1., 1.);
- else
- gdk_cairo_set_source_color (cr, &style->fg[state_type]);
-
- cairo_set_line_width (cr, line_width);
-
- if (dash_list[0])
- {
- gint n_dashes = strlen ((const gchar *) dash_list);
- gdouble *dashes = g_new (gdouble, n_dashes);
- gdouble total_length = 0;
- gdouble dash_offset;
- gint i;
+ gtk_style_context_save (context);
- for (i = 0; i < n_dashes; i++)
- {
- dashes[i] = dash_list[i];
- total_length += dash_list[i];
- }
+ if (detail)
+ transform_detail_string (detail, context);
- /* The dash offset here aligns the pattern to integer pixels
- * by starting the dash at the right side of the left border
- * Negative dash offsets in cairo don't work
- * (https://bugs.freedesktop.org/show_bug.cgi?id=2729)
- */
- dash_offset = - line_width / 2.;
- while (dash_offset < 0)
- dash_offset += total_length;
-
- cairo_set_dash (cr, dashes, n_dashes, dash_offset);
- g_free (dashes);
- }
+ cairo_save (cr);
- cairo_rectangle (cr,
- x + line_width / 2.,
- y + line_width / 2.,
- width - line_width,
- height - line_width);
- cairo_stroke (cr);
+ gtk_render_focus (context, cr,
+ (gdouble) x,
+ (gdouble) y,
+ (gdouble) width,
+ (gdouble) height);
- if (free_dash_list)
- g_free (dash_list);
+ cairo_restore (cr);
+ gtk_style_context_restore (context);
}
static void
@@ -3668,22 +3128,46 @@ gtk_default_draw_slider (GtkStyle *style,
gint height,
GtkOrientation orientation)
{
- gtk_paint_box (style, cr, state_type, shadow_type,
- widget, detail, x, y, width, height);
+ GtkStyleContext *context;
+ GtkStylePrivate *priv;
+ GtkStateFlags flags = 0;
- if (detail &&
- (strcmp ("hscale", detail) == 0 ||
- strcmp ("vscale", detail) == 0))
+ if (widget)
+ context = gtk_widget_get_style_context (widget);
+ else
{
- if (orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_paint_vline (style, cr, state_type, widget, detail,
- y + style->ythickness,
- y + height - style->ythickness - 1, x + width / 2);
- else
- gtk_paint_hline (style, cr, state_type, widget, detail,
- x + style->xthickness,
- x + width - style->xthickness - 1, y + height / 2);
+ priv = GTK_STYLE_GET_PRIVATE (style);
+ context = priv->context;
+ }
+
+ gtk_style_context_save (context);
+
+ if (detail)
+ transform_detail_string (detail, context);
+
+ switch (state_type)
+ {
+ case GTK_STATE_PRELIGHT:
+ flags |= GTK_STATE_FLAG_PRELIGHT;
+ break;
+ case GTK_STATE_SELECTED:
+ flags |= GTK_STATE_FLAG_SELECTED;
+ break;
+ case GTK_STATE_INSENSITIVE:
+ flags |= GTK_STATE_FLAG_INSENSITIVE;
+ break;
+ default:
+ break;
}
+
+ gtk_style_context_set_state (context, flags);
+
+ cairo_save (cr);
+
+ gtk_render_slider (context, cr, x, y, width, height, orientation);
+
+ cairo_restore (cr);
+ gtk_style_context_restore (context);
}
static void
@@ -3725,58 +3209,50 @@ gtk_default_draw_handle (GtkStyle *style,
gint height,
GtkOrientation orientation)
{
- gint xx, yy;
- gint xthick, ythick;
- GdkColor light, dark;
-
- gtk_paint_box (style, cr, state_type, shadow_type, widget,
- detail, x, y, width, height);
-
- if (detail && !strcmp (detail, "paned"))
- {
- /* we want to ignore the shadow border in paned widgets */
- xthick = 0;
- ythick = 0;
-
- if (state_type == GTK_STATE_SELECTED && widget && !gtk_widget_has_focus (widget))
- _gtk_style_shade (&style->base[GTK_STATE_ACTIVE], &light,
- LIGHTNESS_MULT);
- else
- light = style->light[state_type];
+ GtkStyleContext *context;
+ GtkStylePrivate *priv;
+ GtkStateFlags flags = 0;
- dark = style->black;
- }
+ if (widget)
+ context = gtk_widget_get_style_context (widget);
else
{
- xthick = style->xthickness;
- ythick = style->ythickness;
-
- light = style->light[state_type];
- dark = style->dark[state_type];
+ priv = GTK_STYLE_GET_PRIVATE (style);
+ context = priv->context;
}
-
- cairo_rectangle(cr, x + xthick, y + ythick,
- width - (xthick * 2), height - (ythick * 2));
- cairo_clip (cr);
- if (detail && !strcmp (detail, "paned"))
- {
- if (orientation == GTK_ORIENTATION_HORIZONTAL)
- for (xx = x + width/2 - 15; xx <= x + width/2 + 15; xx += 5)
- draw_dot (cr, &light, &dark, xx, y + height/2 - 1, 3);
- else
- for (yy = y + height/2 - 15; yy <= y + height/2 + 15; yy += 5)
- draw_dot (cr, &light, &dark, x + width/2 - 1, yy, 3);
- }
- else
+ gtk_style_context_save (context);
+
+ if (detail)
+ transform_detail_string (detail, context);
+
+ switch (state_type)
{
- for (yy = y + ythick; yy < (y + height - ythick); yy += 3)
- for (xx = x + xthick; xx < (x + width - xthick); xx += 6)
- {
- draw_dot (cr, &light, &dark, xx, yy, 2);
- draw_dot (cr, &light, &dark, xx + 3, yy + 1, 2);
- }
+ case GTK_STATE_PRELIGHT:
+ flags |= GTK_STATE_FLAG_PRELIGHT;
+ break;
+ case GTK_STATE_SELECTED:
+ flags |= GTK_STATE_FLAG_SELECTED;
+ break;
+ case GTK_STATE_INSENSITIVE:
+ flags |= GTK_STATE_FLAG_INSENSITIVE;
+ break;
+ default:
+ break;
}
+
+ gtk_style_context_set_state (context, flags);
+
+ cairo_save (cr);
+
+ gtk_render_handle (context, cr,
+ (gdouble) x,
+ (gdouble) y,
+ (gdouble) width,
+ (gdouble) height);
+
+ cairo_restore (cr);
+ gtk_style_context_restore (context);
}
static void
@@ -3789,117 +3265,63 @@ gtk_default_draw_expander (GtkStyle *style,
gint y,
GtkExpanderStyle expander_style)
{
-#define DEFAULT_EXPANDER_SIZE 12
-
- gint expander_size;
- gint line_width;
- double vertical_overshoot;
- int diameter;
- double radius;
- double interp; /* interpolation factor for center position */
- double x_double_horz, y_double_horz;
- double x_double_vert, y_double_vert;
- double x_double, y_double;
- gint degrees = 0;
+ GtkStyleContext *context;
+ GtkStylePrivate *priv;
+ GtkStateFlags flags = 0;
+ gint size;
- if (widget &&
- gtk_widget_class_find_style_property (GTK_WIDGET_GET_CLASS (widget),
- "expander-size"))
+ if (widget)
+ context = gtk_widget_get_style_context (widget);
+ else
{
- gtk_widget_style_get (widget,
- "expander-size", &expander_size,
- NULL);
+ priv = GTK_STYLE_GET_PRIVATE (style);
+ context = priv->context;
}
- else
- expander_size = DEFAULT_EXPANDER_SIZE;
-
- line_width = MAX (1, expander_size/9);
- switch (expander_style)
+ gtk_style_context_save (context);
+
+ if (detail)
+ transform_detail_string (detail, context);
+
+ gtk_style_context_add_class (context, "expander");
+
+ switch (state_type)
{
- case GTK_EXPANDER_COLLAPSED:
- degrees = (get_direction (widget) == GTK_TEXT_DIR_RTL) ? 180 : 0;
- interp = 0.0;
- break;
- case GTK_EXPANDER_SEMI_COLLAPSED:
- degrees = (get_direction (widget) == GTK_TEXT_DIR_RTL) ? 150 : 30;
- interp = 0.25;
+ case GTK_STATE_PRELIGHT:
+ flags |= GTK_STATE_FLAG_PRELIGHT;
break;
- case GTK_EXPANDER_SEMI_EXPANDED:
- degrees = (get_direction (widget) == GTK_TEXT_DIR_RTL) ? 120 : 60;
- interp = 0.75;
+ case GTK_STATE_SELECTED:
+ flags |= GTK_STATE_FLAG_SELECTED;
break;
- case GTK_EXPANDER_EXPANDED:
- degrees = 90;
- interp = 1.0;
+ case GTK_STATE_INSENSITIVE:
+ flags |= GTK_STATE_FLAG_INSENSITIVE;
break;
default:
- g_assert_not_reached ();
+ break;
}
- /* Compute distance that the stroke extends beyonds the end
- * of the triangle we draw.
- */
- vertical_overshoot = line_width / 2.0 * (1. / tan (G_PI / 8));
-
- /* For odd line widths, we end the vertical line of the triangle
- * at a half pixel, so we round differently.
- */
- if (line_width % 2 == 1)
- vertical_overshoot = ceil (0.5 + vertical_overshoot) - 0.5;
+ if (widget &&
+ gtk_widget_class_find_style_property (GTK_WIDGET_GET_CLASS (widget),
+ "expander-size"))
+ gtk_widget_style_get (widget, "expander-size", &size, NULL);
else
- vertical_overshoot = ceil (vertical_overshoot);
+ size = 12;
- /* Adjust the size of the triangle we draw so that the entire stroke fits
- */
- diameter = MAX (3, expander_size - 2 * vertical_overshoot);
+ if (expander_style == GTK_EXPANDER_EXPANDED)
+ flags |= GTK_STATE_FLAG_ACTIVE;
- /* If the line width is odd, we want the diameter to be even,
- * and vice versa, so force the sum to be odd. This relationship
- * makes the point of the triangle look right.
- */
- diameter -= (1 - (diameter + line_width) % 2);
-
- radius = diameter / 2.;
+ gtk_style_context_set_state (context, flags);
- /* Adjust the center so that the stroke is properly aligned with
- * the pixel grid. The center adjustment is different for the
- * horizontal and vertical orientations. For intermediate positions
- * we interpolate between the two.
- */
- x_double_vert = floor (x - (radius + line_width) / 2.) + (radius + line_width) / 2.;
- y_double_vert = y - 0.5;
-
- x_double_horz = x - 0.5;
- y_double_horz = floor (y - (radius + line_width) / 2.) + (radius + line_width) / 2.;
+ cairo_save (cr);
- x_double = x_double_vert * (1 - interp) + x_double_horz * interp;
- y_double = y_double_vert * (1 - interp) + y_double_horz * interp;
-
- cairo_translate (cr, x_double, y_double);
- cairo_rotate (cr, degrees * G_PI / 180);
+ gtk_render_expander (context, cr,
+ (gdouble) x - (size / 2),
+ (gdouble) y - (size / 2),
+ (gdouble) size,
+ (gdouble) size);
- cairo_move_to (cr, - radius / 2., - radius);
- cairo_line_to (cr, radius / 2., 0);
- cairo_line_to (cr, - radius / 2., radius);
- cairo_close_path (cr);
-
- cairo_set_line_width (cr, line_width);
-
- if (state_type == GTK_STATE_PRELIGHT)
- gdk_cairo_set_source_color (cr,
- &style->fg[GTK_STATE_PRELIGHT]);
- else if (state_type == GTK_STATE_ACTIVE)
- gdk_cairo_set_source_color (cr,
- &style->light[GTK_STATE_ACTIVE]);
- else
- gdk_cairo_set_source_color (cr,
- &style->base[GTK_STATE_NORMAL]);
-
- cairo_fill_preserve (cr);
-
- gdk_cairo_set_source_color (cr, &style->fg[state_type]);
- cairo_stroke (cr);
+ cairo_restore (cr);
+ gtk_style_context_restore (context);
}
static void
@@ -3913,49 +3335,49 @@ gtk_default_draw_layout (GtkStyle *style,
gint y,
PangoLayout *layout)
{
- GdkColor *gc;
- const PangoMatrix *matrix;
+ GtkStyleContext *context;
+ GtkStylePrivate *priv;
+ GtkStateFlags flags = 0;
- matrix = pango_context_get_matrix (pango_layout_get_context (layout));
- if (matrix)
+ if (widget)
+ context = gtk_widget_get_style_context (widget);
+ else
{
- cairo_matrix_t cairo_matrix;
- PangoMatrix tmp_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);
-
- tmp_matrix = *matrix;
- cairo_matrix.x0 += x - rect.x;
- cairo_matrix.y0 += y - rect.y;
-
- cairo_set_matrix (cr, &cairo_matrix);
+ priv = GTK_STYLE_GET_PRIVATE (style);
+ context = priv->context;
}
- else
- cairo_translate (cr, x, y);
- cairo_new_path (cr);
+ gtk_style_context_save (context);
- if (state_type == GTK_STATE_INSENSITIVE)
+ if (detail)
+ transform_detail_string (detail, context);
+
+ switch (state_type)
{
- gdk_cairo_set_source_color (cr, &style->white);
- cairo_move_to (cr, 1, 1);
- _gtk_pango_fill_layout (cr, layout);
- cairo_new_path (cr);
+ case GTK_STATE_PRELIGHT:
+ flags |= GTK_STATE_FLAG_PRELIGHT;
+ break;
+ case GTK_STATE_SELECTED:
+ flags |= GTK_STATE_FLAG_SELECTED;
+ break;
+ case GTK_STATE_INSENSITIVE:
+ flags |= GTK_STATE_FLAG_INSENSITIVE;
+ break;
+ default:
+ break;
}
- gc = use_text ? &style->text[state_type] : &style->fg[state_type];
+ gtk_style_context_set_state (context, flags);
+
+ cairo_save (cr);
- gdk_cairo_set_source_color (cr, gc);
+ gtk_render_layout (context, cr,
+ (gdouble) x,
+ (gdouble) y,
+ layout);
- pango_cairo_show_layout (cr, layout);
+ cairo_restore (cr);
+ gtk_style_context_restore (context);
}
static void
@@ -3970,284 +3392,83 @@ gtk_default_draw_resize_grip (GtkStyle *style,
gint width,
gint height)
{
- gint skip;
+ GtkStyleContext *context;
+ GtkStylePrivate *priv;
+ GtkStateFlags flags = 0;
+ GtkJunctionSides sides = 0;
- cairo_rectangle (cr, x, y, width, height);
- cairo_clip (cr);
+ if (widget)
+ context = gtk_widget_get_style_context (widget);
+ else
+ {
+ priv = GTK_STYLE_GET_PRIVATE (style);
+ context = priv->context;
+ }
+
+ gtk_style_context_save (context);
+
+ if (detail)
+ transform_detail_string (detail, context);
- cairo_set_line_width (cr, 1.0);
+ gtk_style_context_add_class (context, "grip");
+
+ switch (state_type)
+ {
+ case GTK_STATE_PRELIGHT:
+ flags |= GTK_STATE_FLAG_PRELIGHT;
+ break;
+ case GTK_STATE_SELECTED:
+ flags |= GTK_STATE_FLAG_SELECTED;
+ break;
+ case GTK_STATE_INSENSITIVE:
+ flags |= GTK_STATE_FLAG_INSENSITIVE;
+ break;
+ default:
+ break;
+ }
+
+ gtk_style_context_set_state (context, flags);
- skip = -1;
switch (edge)
{
case GDK_WINDOW_EDGE_NORTH_WEST:
- /* make it square */
- if (width < height)
- height = width;
- else if (height < width)
- width = height;
- skip = 2;
+ sides = GTK_JUNCTION_CORNER_TOPLEFT;
break;
case GDK_WINDOW_EDGE_NORTH:
- if (width < height)
- height = width;
+ sides = GTK_JUNCTION_TOP;
break;
case GDK_WINDOW_EDGE_NORTH_EAST:
- /* make it square, aligning to top right */
- if (width < height)
- height = width;
- else if (height < width)
- {
- x += (width - height);
- width = height;
- }
- skip = 3;
+ sides = GTK_JUNCTION_CORNER_TOPRIGHT;
break;
case GDK_WINDOW_EDGE_WEST:
- if (height < width)
- width = height;
+ sides = GTK_JUNCTION_LEFT;
break;
case GDK_WINDOW_EDGE_EAST:
- /* aligning to right */
- if (height < width)
- {
- x += (width - height);
- width = height;
- }
+ sides = GTK_JUNCTION_RIGHT;
break;
case GDK_WINDOW_EDGE_SOUTH_WEST:
- /* make it square, aligning to bottom left */
- if (width < height)
- {
- y += (height - width);
- height = width;
- }
- else if (height < width)
- width = height;
- skip = 1;
- break;
- case GDK_WINDOW_EDGE_SOUTH:
- /* align to bottom */
- if (width < height)
- {
- y += (height - width);
- height = width;
- }
- break;
- case GDK_WINDOW_EDGE_SOUTH_EAST:
- /* make it square, aligning to bottom right */
- if (width < height)
- {
- y += (height - width);
- height = width;
- }
- else if (height < width)
- {
- x += (width - height);
- width = height;
- }
- skip = 0;
- break;
- default:
- g_assert_not_reached ();
- }
-
- switch (edge)
- {
- case GDK_WINDOW_EDGE_WEST:
- case GDK_WINDOW_EDGE_EAST:
- {
- gint xi;
-
- xi = x;
-
- while (xi < x + width)
- {
- _cairo_draw_line (cr,
- &style->light[state_type],
- xi, y,
- xi, y + height);
-
- xi++;
- _cairo_draw_line (cr,
- &style->dark[state_type],
- xi, y,
- xi, y + height);
-
- xi += 2;
- }
- }
+ sides = GTK_JUNCTION_CORNER_BOTTOMLEFT;
break;
- case GDK_WINDOW_EDGE_NORTH:
case GDK_WINDOW_EDGE_SOUTH:
- {
- gint yi;
-
- yi = y;
-
- while (yi < y + height)
- {
- _cairo_draw_line (cr,
- &style->light[state_type],
- x, yi,
- x + width, yi);
-
- yi++;
- _cairo_draw_line (cr,
- &style->dark[state_type],
- x, yi,
- x + width, yi);
-
- yi+= 2;
- }
- }
- break;
- case GDK_WINDOW_EDGE_NORTH_WEST:
- {
- gint xi, yi;
-
- xi = x + width;
- yi = y + height;
-
- while (xi > x + 3)
- {
- _cairo_draw_line (cr,
- &style->dark[state_type],
- xi, y,
- x, yi);
-
- --xi;
- --yi;
-
- _cairo_draw_line (cr,
- &style->dark[state_type],
- xi, y,
- x, yi);
-
- --xi;
- --yi;
-
- _cairo_draw_line (cr,
- &style->light[state_type],
- xi, y,
- x, yi);
-
- xi -= 3;
- yi -= 3;
-
- }
- }
- break;
- case GDK_WINDOW_EDGE_NORTH_EAST:
- {
- gint xi, yi;
-
- xi = x;
- yi = y + height;
-
- while (xi < (x + width - 3))
- {
- _cairo_draw_line (cr,
- &style->light[state_type],
- xi, y,
- x + width, yi);
-
- ++xi;
- --yi;
-
- _cairo_draw_line (cr,
- &style->dark[state_type],
- xi, y,
- x + width, yi);
-
- ++xi;
- --yi;
-
- _cairo_draw_line (cr,
- &style->dark[state_type],
- xi, y,
- x + width, yi);
-
- xi += 3;
- yi -= 3;
- }
- }
- break;
- case GDK_WINDOW_EDGE_SOUTH_WEST:
- {
- gint xi, yi;
-
- xi = x + width;
- yi = y;
-
- while (xi > x + 3)
- {
- _cairo_draw_line (cr,
- &style->dark[state_type],
- x, yi,
- xi, y + height);
-
- --xi;
- ++yi;
-
- _cairo_draw_line (cr,
- &style->dark[state_type],
- x, yi,
- xi, y + height);
-
- --xi;
- ++yi;
-
- _cairo_draw_line (cr,
- &style->light[state_type],
- x, yi,
- xi, y + height);
-
- xi -= 3;
- yi += 3;
-
- }
- }
+ sides = GTK_JUNCTION_BOTTOM;
break;
case GDK_WINDOW_EDGE_SOUTH_EAST:
- {
- gint xi, yi;
-
- xi = x;
- yi = y;
-
- while (xi < (x + width - 3))
- {
- _cairo_draw_line (cr,
- &style->light[state_type],
- xi, y + height,
- x + width, yi);
-
- ++xi;
- ++yi;
-
- _cairo_draw_line (cr,
- &style->dark[state_type],
- xi, y + height,
- x + width, yi);
-
- ++xi;
- ++yi;
-
- _cairo_draw_line (cr,
- &style->dark[state_type],
- xi, y + height,
- x + width, yi);
-
- xi += 3;
- yi += 3;
- }
- }
- break;
- default:
- g_assert_not_reached ();
+ sides = GTK_JUNCTION_CORNER_BOTTOMRIGHT;
break;
}
+
+ gtk_style_context_set_junction_sides (context, sides);
+
+ cairo_save (cr);
+
+ gtk_render_handle (context, cr,
+ (gdouble) x,
+ (gdouble) y,
+ (gdouble) width,
+ (gdouble) height);
+
+ cairo_restore (cr);
+ gtk_style_context_restore (context);
}
static void
@@ -4517,8 +3738,10 @@ hls_to_rgb (gdouble *h,
*
* Draws a horizontal line from (@x1, @y) to (@x2, @y) in @cr
* using the given style and state.
- **/
-void
+ *
+ * Deprecated:3.0: Use gtk_render_line() instead
+ **/
+void
gtk_paint_hline (GtkStyle *style,
cairo_t *cr,
GtkStateType state_type,
@@ -4554,6 +3777,8 @@ gtk_paint_hline (GtkStyle *style,
*
* Draws a vertical line from (@x, @y1_) to (@x, @y2_) in @cr
* using the given style and state.
+ *
+ * Deprecated:3.0: Use gtk_render_line() instead
*/
void
gtk_paint_vline (GtkStyle *style,
@@ -4591,8 +3816,10 @@ gtk_paint_vline (GtkStyle *style,
* @width: width of the rectangle
* @height: width of the rectangle
*
- * Draws a shadow around the given rectangle in @cr
+ * Draws a shadow around the given rectangle in @cr
* using the given style and state and shadow type.
+ *
+ * Deprecated:3.0: Use gtk_render_frame() instead
*/
void
gtk_paint_shadow (GtkStyle *style,
@@ -4635,9 +3862,11 @@ gtk_paint_shadow (GtkStyle *style,
* @y: y origin of the rectangle to draw the arrow in
* @width: width of the rectangle to draw the arrow in
* @height: height of the rectangle to draw the arrow in
- *
- * Draws an arrow in the given rectangle on @cr using the given
+ *
+ * Draws an arrow in the given rectangle on @cr using the given
* parameters. @arrow_type determines the direction of the arrow.
+ *
+ * Deprecated:3.0: Use gtk_render_arrow() instead
*/
void
gtk_paint_arrow (GtkStyle *style,
@@ -4683,6 +3912,8 @@ gtk_paint_arrow (GtkStyle *style,
*
* Draws a diamond in the given rectangle on @window using the given
* parameters.
+ *
+ * Deprecated:3.0: Use cairo instead
*/
void
gtk_paint_diamond (GtkStyle *style,
@@ -4723,8 +3954,10 @@ gtk_paint_diamond (GtkStyle *style,
* @y: y origin of the box
* @width: the width of the box
* @height: the height of the box
- *
+ *
* Draws a box on @cr with the given parameters.
+ *
+ * Deprecated:3.0: Use gtk_render_frame() and gtk_render_background() instead
*/
void
gtk_paint_box (GtkStyle *style,
@@ -4765,8 +3998,10 @@ gtk_paint_box (GtkStyle *style,
* @y: y origin of the box
* @width: the width of the box
* @height: the height of the box
- *
+ *
* Draws a flat box on @cr with the given parameters.
+ *
+ * Deprecated:3.0: Use gtk_render_frame() and gtk_render_background() instead
*/
void
gtk_paint_flat_box (GtkStyle *style,
@@ -4807,9 +4042,11 @@ gtk_paint_flat_box (GtkStyle *style,
* @y: y origin of the rectangle to draw the check in
* @width: the width of the rectangle to draw the check in
* @height: the height of the rectangle to draw the check in
- *
- * Draws a check button indicator in the given rectangle on @cr with
+ *
+ * Draws a check button indicator in the given rectangle on @cr with
* the given parameters.
+ *
+ * Deprecated:3.0: Use gtk_render_check() instead
*/
void
gtk_paint_check (GtkStyle *style,
@@ -4849,8 +4086,10 @@ gtk_paint_check (GtkStyle *style,
* @width: the width of the rectangle to draw the option in
* @height: the height of the rectangle to draw the option in
*
- * Draws a radio button indicator in the given rectangle on @cr with
+ * Draws a radio button indicator in the given rectangle on @cr with
* the given parameters.
+ *
+ * Deprecated:3.0: Use gtk_render_option() instead
*/
void
gtk_paint_option (GtkStyle *style,
@@ -4892,7 +4131,9 @@ gtk_paint_option (GtkStyle *style,
*
* Draws an option menu tab (i.e. the up and down pointing arrows)
* in the given rectangle on @cr using the given parameters.
- */
+ *
+ * Deprecated:3.0: Use cairo instead
+ */
void
gtk_paint_tab (GtkStyle *style,
cairo_t *cr,
@@ -4935,9 +4176,11 @@ gtk_paint_tab (GtkStyle *style,
* @gap_width: width of the gap
*
* Draws a shadow around the given rectangle in @cr
- * using the given style and state and shadow type, leaving a
+ * using the given style and state and shadow type, leaving a
* gap in one side.
-*/
+ *
+ * Deprecated:3.0: Use gtk_render_frame_gap() instead
+ */
void
gtk_paint_shadow_gap (GtkStyle *style,
cairo_t *cr,
@@ -4984,8 +4227,10 @@ gtk_paint_shadow_gap (GtkStyle *style,
* @gap_x: starting position of the gap
* @gap_width: width of the gap
*
- * Draws a box in @cr using the given style and state and shadow type,
+ * Draws a box in @cr using the given style and state and shadow type,
* leaving a gap in one side.
+ *
+ * Deprecated:3.0: Use gtk_render_frame_gap() instead
*/
void
gtk_paint_box_gap (GtkStyle *style,
@@ -5018,7 +4263,7 @@ gtk_paint_box_gap (GtkStyle *style,
}
/**
- * gtk_paint_extension:
+ * gtk_paint_extension:
* @style: a #GtkStyle
* @cr: a #cairo_t
* @state_type: a state
@@ -5030,8 +4275,10 @@ gtk_paint_box_gap (GtkStyle *style,
* @width: width of the extension
* @height: width of the extension
* @gap_side: the side on to which the extension is attached
- *
+ *
* Draws an extension, i.e. a notebook tab.
+ *
+ * Deprecated:3.0: Use gtk_render_extension() instead
**/
void
gtk_paint_extension (GtkStyle *style,
@@ -5075,6 +4322,8 @@ gtk_paint_extension (GtkStyle *style,
*
* Draws a focus indicator around the given rectangle on @cr using the
* given style.
+ *
+ * Deprecated:3.0: Use gtk_render_focus() instead
*/
void
gtk_paint_focus (GtkStyle *style,
@@ -5118,6 +4367,8 @@ gtk_paint_focus (GtkStyle *style,
*
* Draws a slider in the given rectangle on @cr using the
* given style and orientation.
+ *
+ * Deprecated:3.0: Use gtk_render_slider() instead
**/
void
gtk_paint_slider (GtkStyle *style,
@@ -5160,8 +4411,10 @@ gtk_paint_slider (GtkStyle *style,
* @width: with of the handle
* @height: height of the handle
* @orientation: the orientation of the handle
- *
+ *
* Draws a handle as used in #GtkHandleBox and #GtkPaned.
+ *
+ * Deprecated:3.0: Use gtk_render_handle() instead
**/
void
gtk_paint_handle (GtkStyle *style,
@@ -5203,7 +4456,7 @@ gtk_paint_handle (GtkStyle *style,
* @expander_style: the style to draw the expander in; determines
* whether the expander is collapsed, expanded, or in an
* intermediate state.
- *
+ *
* Draws an expander as used in #GtkTreeView. @x and @y specify the
* center the expander. The size of the expander is determined by the
* "expander-size" style property of @widget. (If widget is not
@@ -5213,6 +4466,8 @@ gtk_paint_handle (GtkStyle *style,
* likely not useful.) The expander is expander_size pixels tall
* in the collapsed position and expander_size pixels wide in the
* expanded position.
+ *
+ * Deprecated:3.0: Use gtk_render_expander() instead
**/
void
gtk_paint_expander (GtkStyle *style,
@@ -5251,6 +4506,8 @@ gtk_paint_expander (GtkStyle *style,
* @layout: the layout to draw
*
* Draws a layout on @cr using the given parameters.
+ *
+ * Deprecated:3.0: Use gtk_render_layout() instead
**/
void
gtk_paint_layout (GtkStyle *style,
@@ -5290,7 +4547,9 @@ gtk_paint_layout (GtkStyle *style,
* @height: the height of the rectangle in which to draw the resize grip
*
* Draws a resize grip in the given rectangle on @cr using the given
- * parameters.
+ * parameters.
+ *
+ * Deprecated:3.0: Use gtk_render_handle() instead
*/
void
gtk_paint_resize_grip (GtkStyle *style,
@@ -5330,6 +4589,8 @@ gtk_paint_resize_grip (GtkStyle *style,
* @height: the height of the rectangle in which to draw the spinner
*
* Draws a spinner on @window using the given parameters.
+ *
+ * Deprecated:3.0: Use gtk_render_activity() instead
*/
void
gtk_paint_spinner (GtkStyle *style,
@@ -5356,53 +4617,6 @@ gtk_paint_spinner (GtkStyle *style,
cairo_restore (cr);
}
-/**
- * gtk_border_new:
- *
- * Allocates a new #GtkBorder structure and initializes its elements to zero.
- *
- * Returns: a new empty #GtkBorder. The newly allocated #GtkBorder should be
- * freed with gtk_border_free()
- *
- * Since: 2.14
- **/
-GtkBorder *
-gtk_border_new (void)
-{
- return g_slice_new0 (GtkBorder);
-}
-
-/**
- * gtk_border_copy:
- * @border_: a #GtkBorder.
- * @returns: a copy of @border_.
- *
- * Copies a #GtkBorder structure.
- **/
-GtkBorder *
-gtk_border_copy (const GtkBorder *border)
-{
- g_return_val_if_fail (border != NULL, NULL);
-
- return g_slice_dup (GtkBorder, border);
-}
-
-/**
- * gtk_border_free:
- * @border_: a #GtkBorder.
- *
- * Frees a #GtkBorder structure.
- **/
-void
-gtk_border_free (GtkBorder *border)
-{
- g_slice_free (GtkBorder, border);
-}
-
-G_DEFINE_BOXED_TYPE (GtkBorder, gtk_border,
- gtk_border_copy,
- gtk_border_free)
-
typedef struct _CursorInfo CursorInfo;
struct _CursorInfo
@@ -5516,7 +4730,7 @@ _gtk_widget_get_cursor_color (GtkWidget *widget,
* right-to-left. Should never be #GTK_TEXT_DIR_NONE
* @draw_arrow: %TRUE to draw a directional arrow on the
* cursor. Should be %FALSE unless the cursor is split.
- *
+ *
* Draws a text caret on @cr at @location. This is not a style function
* but merely a convenience function for drawing the standard cursor shape.
*
diff --git a/gtk/gtkstyle.h b/gtk/gtkstyle.h
index 84a018ce1a..3d44b1ffa7 100644
--- a/gtk/gtkstyle.h
+++ b/gtk/gtkstyle.h
@@ -45,12 +45,9 @@ G_BEGIN_DECLS
#define GTK_IS_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_STYLE))
#define GTK_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_STYLE, GtkStyleClass))
-#define GTK_TYPE_BORDER (gtk_border_get_type ())
-
/* Some forward declarations needed to rationalize the header
* files.
*/
-typedef struct _GtkBorder GtkBorder;
typedef struct _GtkStyle GtkStyle;
typedef struct _GtkStyleClass GtkStyleClass;
typedef struct _GtkThemeEngine GtkThemeEngine;
@@ -383,23 +380,7 @@ struct _GtkStyleClass
void (*_gtk_reserved11) (void);
};
-/**
- * GtkBorder:
- * @left: The width of the left border.
- * @right: The width of the right border.
- * @top: The width of the top border.
- * @bottom: The width of the bottom border.
- *
- * A struct that specifies a border around a rectangular area that can
- * be of different width on each side.
- */
-struct _GtkBorder
-{
- gint16 left;
- gint16 right;
- gint16 top;
- gint16 bottom;
-};
+#if !defined(GTK_DISABLE_DEPRECATED) || defined(GTK_COMPILATION)
GType gtk_style_get_type (void) G_GNUC_CONST;
GtkStyle* gtk_style_new (void);
@@ -637,12 +618,6 @@ void gtk_paint_spinner (GtkStyle *style,
gint width,
gint height);
-
-GType gtk_border_get_type (void) G_GNUC_CONST;
-GtkBorder *gtk_border_new (void) G_GNUC_MALLOC;
-GtkBorder *gtk_border_copy (const GtkBorder *border_);
-void gtk_border_free (GtkBorder *border_);
-
void gtk_style_get_style_property (GtkStyle *style,
GType widget_type,
const gchar *property_name,
@@ -656,6 +631,8 @@ void gtk_style_get (GtkStyle *style,
const gchar *first_property_name,
...) G_GNUC_NULL_TERMINATED;
+#endif
+
/* --- private API --- */
const GValue* _gtk_style_peek_property_value (GtkStyle *style,
GType widget_type,
@@ -678,6 +655,10 @@ void gtk_draw_insertion_cursor (GtkWidget *widget,
void _gtk_widget_get_cursor_color (GtkWidget *widget,
GdkColor *color);
+gboolean gtk_style_has_context (GtkStyle *style);
+
+
+
G_END_DECLS
#endif /* __GTK_STYLE_H__ */
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
new file mode 100644
index 0000000000..b8d8c992e7
--- /dev/null
+++ b/gtk/gtkstylecontext.c
@@ -0,0 +1,3985 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include <gdk/gdk.h>
+#include <stdlib.h>
+#include <gobject/gvaluecollector.h>
+
+#include "gtkstylecontext.h"
+#include "gtktypebuiltins.h"
+#include "gtkthemingengine.h"
+#include "gtkintl.h"
+#include "gtkwidget.h"
+#include "gtkwindow.h"
+#include "gtkprivate.h"
+#include "gtksymboliccolor.h"
+#include "gtkanimationdescription.h"
+#include "gtktimeline.h"
+#include "gtkiconfactory.h"
+
+/**
+ * SECTION:gtkstylecontext
+ * @Short_description: Rendering UI elements
+ * @Title: GtkStyleContext
+ *
+ * #GtkStyleContext is an object that stores styling information affecting
+ * a widget defined by #GtkWidgetPath.
+ *
+ * In order to construct the final style information, #GtkStyleContext
+ * queries information from all attached #GtkStyleProviders. Style providers
+ * can be either attached explicitly to the context through
+ * gtk_style_context_add_provider(), or to the screen through
+ * gtk_style_context_add_provider_for_screen(). The resulting style is a
+ * combination of all provider's information in priority order.
+ *
+ * For GTK+ widgets, any #GtkStyleContext returned by
+ * gtk_widget_get_style_context() will already have a #GtkWidgetPath, a
+ * #GdkScreen and RTL/LTR information set, the style context will be also
+ * updated automatically if any of these settings change on the widget.
+ *
+ * If you are using are the theming layer standalone, you will need to set a
+ * widget path and a screen yourself to the created style context through
+ * gtk_style_context_set_path() and gtk_style_context_set_screen(), as well
+ * as updating the context yourself using gtk_style_context_invalidate()
+ * whenever any of the conditions change, such as a change in the
+ * #GtkSettings:gtk-theme-name setting or a hierarchy change in the rendered
+ * widget.
+ *
+ * <refsect2 id="gtkstylecontext-animations">
+ * <title>Transition animations</title>
+ * <para>
+ * #GtkStyleContext has built-in support for state change transitions.
+ * Note that these animations respect the #GtkSettings:gtk-enable-animations
+ * setting.
+ * </para>
+ * <para>
+ * For simple widgets where state changes affect the whole widget area,
+ * calling gtk_style_context_notify_state_change() with a %NULL region
+ * is sufficient to trigger the transition animation. And GTK+ already
+ * does that when gtk_widget_set_state() or gtk_widget_set_state_flags()
+ * are called.
+ * </para>
+ * <para>
+ * If a widget needs to declare several animatable regions (i.e. not
+ * affecting the whole widget area), its #GtkWidget::draw signal handler
+ * needs to wrap the render operations for the different regions with
+ * calls to gtk_style_context_push_animatable_region() and
+ * gtk_style_context_pop_animatable_region(). These functions take an
+ * identifier for the region which must be unique within the style context.
+ * For simple widgets with a fixed set of animatable regions, using an
+ * enumeration works well:
+ * </para>
+ * <example>
+ * <title>Using an enumeration to identify animatable regions</title>
+ * <programlisting>
+ * enum {
+ * REGION_ENTRY,
+ * REGION_BUTTON_UP,
+ * REGION_BUTTON_DOWN
+ * };
+ *
+ * ...
+ *
+ * gboolean
+ * spin_button_draw (GtkWidget *widget,
+ * cairo_t *cr)
+ * {
+ * GtkStyleContext *context;
+ *
+ * context = gtk_widget_get_style_context (widget);
+ *
+ * gtk_style_context_push_animatable_region (context,
+ * GUINT_TO_POINTER (REGION_ENTRY));
+ *
+ * gtk_render_background (cr, 0, 0, 100, 30);
+ * gtk_render_frame (cr, 0, 0, 100, 30);
+ *
+ * gtk_style_context_pop_animatable_region (context);
+ *
+ * ...
+ * }
+ * </programlisting>
+ * </example>
+ * <para>
+ * For complex widgets with an arbitrary number of animatable regions, it
+ * is up to the implementation to come up with a way to uniquely identify
+ * each animatable region. Using pointers to internal structs is one way
+ * to achieve this:
+ * </para>
+ * <example>
+ * <title>Using struct pointers to identify animatable regions</title>
+ * <programlisting>
+ * void
+ * notebook_draw_tab (GtkWidget *widget,
+ * NotebookPage *page,
+ * cairo_t *cr)
+ * {
+ * gtk_style_context_push_animatable_region (context, page);
+ * gtk_render_extension (cr, page->x, page->y, page->width, page->height);
+ * gtk_style_context_pop_animatable_region (context);
+ * }
+ * </programlisting>
+ * </example>
+ * <para>
+ * The widget also needs to notify the style context about a state change
+ * for a given animatable region so the animation is triggered.
+ * </para>
+ * <example>
+ * <title>Triggering a state change animation on a region</title>
+ * <programlisting>
+ * gboolean
+ * notebook_motion_notify (GtkWidget *widget,
+ * GdkEventMotion *event)
+ * {
+ * GtkStyleContext *context;
+ * NotebookPage *page;
+ *
+ * context = gtk_widget_get_style_context (widget);
+ * page = find_page_under_pointer (widget, event);
+ * gtk_style_context_notify_state_change (context,
+ * gtk_widget_get_window (widget),
+ * page,
+ * GTK_STATE_PRELIGHT,
+ * TRUE);
+ * ...
+ * }
+ * </programlisting>
+ * </example>
+ * <para>
+ * gtk_style_context_notify_state_change() accepts %NULL region IDs as a
+ * special value, in this case, the whole widget area will be updated
+ * by the animation.
+ * </para>
+ * </refsect2>
+ * <refsect2 id="gtkstylecontext-classes">
+ * <title>Style classes and regions</title>
+ * <para>
+ * Widgets can add style classes to their context, which can be used
+ * to associate different styles by class (see <xref linkend="gtkcssprovider-selectors"/>). Theme engines can also use style classes to vary their
+ * rendering. GTK+ has a number of predefined style classes:
+ * <informaltable>
+ * <tgroup cols="3">
+ * <thead>
+ * <row>
+ * <entry>Style class</entry>
+ * <entry>Macro</entry>
+ * <entry>Used by</entry>
+ * </row>
+ * </thead>
+ * <tbody>
+ * <row>
+ * <entry>button</entry>
+ * <entry>GTK_STYLE_CLASS_BUTTON</entry>
+ * <entry>#GtkButton, #GtkToggleButton, #GtkRadioButton, #GtkCheckButton</entry>
+ * </row>
+ * <row>
+ * <entry>default</entry>
+ * <entry>GTK_STYLE_CLASS_DEFAULT</entry>
+ * <entry>#GtkButton</entry>
+ * </row>
+ * <row>
+ * <entry>check</entry>
+ * <entry>GTK_STYLE_CLASS_CHECK</entry>
+ * <entry>#GtkCheckButton, #GtkCheckMenuItem, #GtkCellRendererToggle</entry>
+ * </row>
+ * <row>
+ * <entry>radio</entry>
+ * <entry>GTK_STYLE_CLASS_RADIO</entry>
+ * <entry>#GtkRadioButton, #GtkRadioMenuItem, #GtkCellRendererToggle</entry>
+ * </row>
+ * <row>
+ * <entry>arrow</entry>
+ * <entry>GTK_STYLE_CLASS_ARROW</entry>
+ * <entry>#GtkArrow</entry>
+ * </row>
+ * <row>
+ * <entry>calendar</entry>
+ * <entry>GTK_STYLE_CLASS_CALENDAR</entry>
+ * <entry>#GtkCalendar</entry>
+ * </row>
+ * <row>
+ * <entry>entry</entry>
+ * <entry>GTK_STYLE_CLASS_ENTRY</entry>
+ * <entry>#GtkEntry</entry>
+ * </row>
+ * <row>
+ * <entry>cell</entry>
+ * <entry>GTK_STYLE_CLASS_CELL</entry>
+ * <entry>#GtkCellRendererToggle</entry>
+ * </row>
+ * <row>
+ * <entry>menu</entry>
+ * <entry>GTK_STYLE_CLASS_MENU</entry>
+ * <entry>#GtkMenu, #GtkMenuItem, #GtkCheckMenuItem, #GtkRadioMenuItem</entry>
+ * </row>
+ * <row>
+ * <entry>expander</entry>
+ * <entry>GTK_STYLE_CLASS_EXPANDER</entry>
+ * <entry>#GtkExpander</entry>
+ * </row>
+ * <row>
+ * <entry>tooltip</entry>
+ * <entry>GTK_STYLE_CLASS_TOOLTIP</entry>
+ * <entry>#GtkTooltip</entry>
+ * </row>
+ * <row>
+ * <entry>frame</entry>
+ * <entry>GTK_STYLE_CLASS_FRAME</entry>
+ * <entry>#GtkFrame</entry>
+ * </row>
+ * <row>
+ * <entry>scrolled-window</entry>
+ * <entry></entry>
+ * <entry>#GtkScrolledWindow</entry>
+ * </row>
+ * <row>
+ * <entry>viewport</entry>
+ * <entry></entry>
+ * <entry>#GtkViewport</entry>
+ * </row>
+ * <row>
+ * <entry>trough</entry>
+ * <entry>GTK_STYLE_CLASS_TROUGH</entry>
+ * <entry>#GtkScrollbar, #GtkProgressBar, #GtkScale</entry>
+ * </row>
+ * <row>
+ * <entry>progressbar</entry>
+ * <entry>GTK_STYLE_CLASS_PROGRESSBAR</entry>
+ * <entry>#GtkProgressBar, #GtkCellRendererProgress</entry>
+ * </row>
+ * <row>
+ * <entry>slider</entry>
+ * <entry>GTK_STYLE_CLASS_SLIDER</entry>
+ * <entry>#GtkScrollbar, #GtkScale</entry>
+ * </row>
+ * <row>
+ * <entry>menuitem</entry>
+ * <entry>GTK_STYLE_CLASS_MENUITEM</entry>
+ * <entry>#GtkMenuItem</entry>
+ * </row>
+ * <row>
+ * <entry>popup</entry>
+ * <entry></entry>
+ * <entry>#GtkMenu</entry>
+ * </row>
+ * <row>
+ * <entry>accelerator</entry>
+ * <entry>GTK_STYLE_CLASS_ACCELERATOR</entry>
+ * <entry>#GtkAccelLabel</entry>
+ * </row>
+ * <row>
+ * <entry>menubar</entry>
+ * <entry>GTK_STYLE_CLASS_MENUBAR</entry>
+ * <entry>#GtkMenuBar</entry>
+ * </row>
+ * <row>
+ * <entry>toolbar</entry>
+ * <entry>GTK_STYLE_CLASS_TOOLBAR</entry>
+ * <entry>#GtkToolbar</entry>
+ * </row>
+ * <row>
+ * <entry>dock</entry>
+ * <entry>GTK_STYLE_CLASS_DOCK</entry>
+ * <entry>#GtkHandleBox</entry>
+ * </row>
+ * <row>
+ * <entry>notebook</entry>
+ * <entry></entry>
+ * <entry>#GtkNotebook</entry>
+ * </row>
+ * <row>
+ * <entry>background</entry>
+ * <entry>GTK_STYLE_CLASS_BACKGROUND</entry>
+ * <entry>#GtkWindow</entry>
+ * </row>
+ * <row>
+ * <entry>rubberband</entry>
+ * <entry>GTK_STYLE_CLASS_RUBBERBAND</entry>
+ * <entry></entry>
+ * </row>
+ * <row>
+ * <entry>header</entry>
+ * <entry>GTK_STYLE_CLASS_HEADER</entry>
+ * <entry></entry>
+ * </row>
+ * <row>
+ * <entry>grip</entry>
+ * <entry>GTK_STYLE_CLASS_GRIP</entry>
+ * <entry>#GtkWindow</entry>
+ * </row>
+ * <row>
+ * <entry>spinner</entry>
+ * <entry>GTK_STYLE_CLASS_SPINNER</entry>
+ * <entry>#GtkSpinner</entry>
+ * </row>
+ * </tbody>
+ * </tgroup>
+ * </informaltable>
+ * </para>
+ * <para>
+ * Widgets can also add regions with flags to their context.
+ * The regions used by GTK+ widgets are:
+ * <informaltable>
+ * <tgroup cols="4">
+ * <thead>
+ * <row>
+ * <entry>Region</entry>
+ * <entry>Flags</entry>
+ * <entry>Macro</entry>
+ * <entry>Used by</entry>
+ * </row>
+ * </thead>
+ * <tbody>
+ * <row>
+ * <entry>row</entry>
+ * <entry>even, odd</entry>
+ * <entry>GTK_STYLE_REGION_ROW</entry>
+ * <entry>#GtkTreeView</entry>
+ * </row>
+ * <row>
+ * <entry>column</entry>
+ * <entry>first, last, sorted</entry>
+ * <entry>GTK_STYLE_REGION_COLUMN</entry>
+ * <entry>#GtkTreeView</entry>
+ * </row>
+ * <row>
+ * <entry>column-header</entry>
+ * <entry></entry>
+ * <entry>GTK_STYLE_REGION_COLUMN_HEADER</entry>
+ * <entry></entry>
+ * </row>
+ * <row>
+ * <entry>tab</entry>
+ * <entry>even, odd, first, last</entry>
+ * <entry>GTK_STYLE_REGION_TAB</entry>
+ * <entry>#GtkNotebook</entry>
+ * </row>
+ * </tbody>
+ * </tgroup>
+ * </informaltable>
+ * </para>
+ * </refsect2>
+ * <refsect2 id="gtkstylecontext-custom-styling">
+ * <title>Custom styling in UI libraries and applications</title>
+ * <para>
+ * If you are developing a library with custom #GtkWidget<!-- -->s that
+ * render differently than standard components, you may need to add a
+ * #GtkStyleProvider yourself with the %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK
+ * priority, either a #GtkCssProvider or a custom object implementing the
+ * #GtkStyleProvider interface. This way theming engines may still attempt
+ * to style your UI elements in a different way if needed so.
+ * </para>
+ * <para>
+ * If you are using custom styling on an applications, you probably want then
+ * to make your style information prevail to the theme's, so you must use
+ * a #GtkStyleProvider with the %GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
+ * priority, keep in mind that the user settings in
+ * <filename><replaceable>XDG_CONFIG_HOME</replaceable>/gtk-3.0/gtk.css</filename> will
+ * still take precedence over your changes, as it uses the
+ * %GTK_STYLE_PROVIDER_PRIORITY_USER priority.
+ * </para>
+ * <para>
+ * If a custom theming engine is needed, you probably want to implement a
+ * #GtkStyleProvider yourself so it points to your #GtkThemingEngine
+ * implementation, as #GtkCssProvider uses gtk_theming_engine_load()
+ * which loads the theming engine module from the standard paths.
+ * </para>
+ * </refsect2>
+ */
+
+typedef struct GtkStyleContextPrivate GtkStyleContextPrivate;
+typedef struct GtkStyleProviderData GtkStyleProviderData;
+typedef struct GtkStyleInfo GtkStyleInfo;
+typedef struct GtkRegion GtkRegion;
+typedef struct PropertyValue PropertyValue;
+typedef struct AnimationInfo AnimationInfo;
+typedef struct StyleData StyleData;
+
+struct GtkRegion
+{
+ GQuark class_quark;
+ GtkRegionFlags flags;
+};
+
+struct GtkStyleProviderData
+{
+ GtkStyleProvider *provider;
+ guint priority;
+};
+
+struct PropertyValue
+{
+ GType widget_type;
+ GParamSpec *pspec;
+ GtkStateFlags state;
+ GValue value;
+};
+
+struct GtkStyleInfo
+{
+ GArray *style_classes;
+ GArray *regions;
+ GtkJunctionSides junction_sides;
+ GtkStateFlags state_flags;
+};
+
+struct StyleData
+{
+ GtkStyleProperties *store;
+ GSList *icon_factories;
+ GArray *property_cache;
+};
+
+struct AnimationInfo
+{
+ GtkTimeline *timeline;
+
+ gpointer region_id;
+ GdkWindow *window;
+ GtkStateType state;
+ gboolean target_value;
+
+ cairo_region_t *invalidation_region;
+ GArray *rectangles;
+};
+
+struct GtkStyleContextPrivate
+{
+ GdkScreen *screen;
+
+ GList *providers;
+ GList *providers_last;
+
+ GtkWidgetPath *widget_path;
+ GHashTable *style_data;
+ GSList *info_stack;
+ StyleData *current_data;
+
+ GSList *animation_regions;
+ GSList *animations;
+
+ guint animations_invalidated : 1;
+ guint invalidating_context : 1;
+
+ GtkThemingEngine *theming_engine;
+
+ GtkTextDirection direction;
+};
+
+enum {
+ PROP_0,
+ PROP_SCREEN,
+ PROP_DIRECTION
+};
+
+enum {
+ CHANGED,
+ LAST_SIGNAL
+};
+
+guint signals[LAST_SIGNAL] = { 0 };
+
+static GQuark provider_list_quark = 0;
+
+static void gtk_style_context_finalize (GObject *object);
+
+static void gtk_style_context_impl_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec);
+static void gtk_style_context_impl_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec);
+
+
+G_DEFINE_TYPE (GtkStyleContext, gtk_style_context, G_TYPE_OBJECT)
+
+static void
+gtk_style_context_class_init (GtkStyleContextClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->finalize = gtk_style_context_finalize;
+ object_class->set_property = gtk_style_context_impl_set_property;
+ object_class->get_property = gtk_style_context_impl_get_property;
+
+ signals[CHANGED] =
+ g_signal_new (I_("changed"),
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (GtkStyleContextClass, changed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ g_object_class_install_property (object_class,
+ PROP_SCREEN,
+ g_param_spec_object ("screen",
+ P_("Screen"),
+ P_("The associated GdkScreen"),
+ GDK_TYPE_SCREEN,
+ GTK_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_DIRECTION,
+ g_param_spec_enum ("direction",
+ P_("Direction"),
+ P_("Text direction"),
+ GTK_TYPE_TEXT_DIRECTION,
+ GTK_TEXT_DIR_LTR,
+ GTK_PARAM_READWRITE));
+
+ g_type_class_add_private (object_class, sizeof (GtkStyleContextPrivate));
+}
+
+static GtkStyleInfo *
+style_info_new (void)
+{
+ GtkStyleInfo *info;
+
+ info = g_slice_new0 (GtkStyleInfo);
+ info->style_classes = g_array_new (FALSE, FALSE, sizeof (GQuark));
+ info->regions = g_array_new (FALSE, FALSE, sizeof (GtkRegion));
+
+ return info;
+}
+
+static void
+style_info_free (GtkStyleInfo *info)
+{
+ g_array_free (info->style_classes, TRUE);
+ g_array_free (info->regions, TRUE);
+ g_slice_free (GtkStyleInfo, info);
+}
+
+static GtkStyleInfo *
+style_info_copy (const GtkStyleInfo *info)
+{
+ GtkStyleInfo *copy;
+
+ copy = style_info_new ();
+ g_array_insert_vals (copy->style_classes, 0,
+ info->style_classes->data,
+ info->style_classes->len);
+
+ g_array_insert_vals (copy->regions, 0,
+ info->regions->data,
+ info->regions->len);
+
+ copy->junction_sides = info->junction_sides;
+ copy->state_flags = info->state_flags;
+
+ return copy;
+}
+
+static guint
+style_info_hash (gconstpointer elem)
+{
+ const GtkStyleInfo *info;
+ guint i, hash = 0;
+
+ info = elem;
+
+ for (i = 0; i < info->style_classes->len; i++)
+ {
+ hash += g_array_index (info->style_classes, GQuark, i);
+ hash <<= 5;
+ }
+
+ for (i = 0; i < info->regions->len; i++)
+ {
+ GtkRegion *region;
+
+ region = &g_array_index (info->regions, GtkRegion, i);
+ hash += region->class_quark;
+ hash += region->flags;
+ hash <<= 5;
+ }
+
+ return hash;
+}
+
+static gboolean
+style_info_equal (gconstpointer elem1,
+ gconstpointer elem2)
+{
+ const GtkStyleInfo *info1, *info2;
+
+ info1 = elem1;
+ info2 = elem2;
+
+ if (info1->junction_sides != info2->junction_sides)
+ return FALSE;
+
+ if (info1->style_classes->len != info2->style_classes->len)
+ return FALSE;
+
+ if (memcmp (info1->style_classes->data,
+ info2->style_classes->data,
+ info1->style_classes->len * sizeof (GQuark)) != 0)
+ return FALSE;
+
+ if (info1->regions->len != info2->regions->len)
+ return FALSE;
+
+ if (memcmp (info1->regions->data,
+ info2->regions->data,
+ info1->regions->len * sizeof (GtkRegion)) != 0)
+ return FALSE;
+
+ return TRUE;
+}
+
+static StyleData *
+style_data_new (void)
+{
+ StyleData *data;
+
+ data = g_slice_new0 (StyleData);
+ data->store = gtk_style_properties_new ();
+
+ return data;
+}
+
+static void
+clear_property_cache (StyleData *data)
+{
+ guint i;
+
+ if (!data->property_cache)
+ return;
+
+ for (i = 0; i < data->property_cache->len; i++)
+ {
+ PropertyValue *node = &g_array_index (data->property_cache, PropertyValue, i);
+
+ g_param_spec_unref (node->pspec);
+ g_value_unset (&node->value);
+ }
+
+ g_array_free (data->property_cache, TRUE);
+ data->property_cache = NULL;
+}
+
+static void
+style_data_free (StyleData *data)
+{
+ g_object_unref (data->store);
+ clear_property_cache (data);
+
+ g_slist_foreach (data->icon_factories, (GFunc) g_object_unref, NULL);
+ g_slist_free (data->icon_factories);
+
+ g_slice_free (StyleData, data);
+}
+
+static void
+gtk_style_context_init (GtkStyleContext *style_context)
+{
+ GtkStyleContextPrivate *priv;
+ GtkStyleInfo *info;
+
+ priv = style_context->priv = G_TYPE_INSTANCE_GET_PRIVATE (style_context,
+ GTK_TYPE_STYLE_CONTEXT,
+ GtkStyleContextPrivate);
+
+ priv->style_data = g_hash_table_new_full (style_info_hash,
+ style_info_equal,
+ (GDestroyNotify) style_info_free,
+ (GDestroyNotify) style_data_free);
+ priv->theming_engine = g_object_ref ((gpointer) gtk_theming_engine_load (NULL));
+
+ priv->direction = GTK_TEXT_DIR_RTL;
+
+ priv->screen = gdk_screen_get_default ();
+
+ /* Create default info store */
+ info = style_info_new ();
+ priv->info_stack = g_slist_prepend (priv->info_stack, info);
+}
+
+static GtkStyleProviderData *
+style_provider_data_new (GtkStyleProvider *provider,
+ guint priority)
+{
+ GtkStyleProviderData *data;
+
+ data = g_slice_new (GtkStyleProviderData);
+ data->provider = g_object_ref (provider);
+ data->priority = priority;
+
+ return data;
+}
+
+static void
+style_provider_data_free (GtkStyleProviderData *data)
+{
+ g_object_unref (data->provider);
+ g_slice_free (GtkStyleProviderData, data);
+}
+
+static void
+animation_info_free (AnimationInfo *info)
+{
+ g_object_unref (info->timeline);
+ g_object_unref (info->window);
+
+ if (info->invalidation_region)
+ cairo_region_destroy (info->invalidation_region);
+
+ g_array_free (info->rectangles, TRUE);
+ g_slice_free (AnimationInfo, info);
+}
+
+static AnimationInfo *
+animation_info_lookup_by_timeline (GtkStyleContext *context,
+ GtkTimeline *timeline)
+{
+ GtkStyleContextPrivate *priv;
+ AnimationInfo *info;
+ GSList *l;
+
+ priv = context->priv;
+
+ for (l = priv->animations; l; l = l->next)
+ {
+ info = l->data;
+
+ if (info->timeline == timeline)
+ return info;
+ }
+
+ return NULL;
+}
+
+static void
+timeline_frame_cb (GtkTimeline *timeline,
+ gdouble progress,
+ gpointer user_data)
+{
+ GtkStyleContextPrivate *priv;
+ GtkStyleContext *context;
+ AnimationInfo *info;
+
+ context = user_data;
+ priv = context->priv;
+ info = animation_info_lookup_by_timeline (context, timeline);
+
+ g_assert (info != NULL);
+
+ /* Cancel transition if window is gone */
+ if (gdk_window_is_destroyed (info->window) ||
+ !gdk_window_is_visible (info->window))
+ {
+ priv->animations = g_slist_remove (priv->animations, info);
+ animation_info_free (info);
+ return;
+ }
+
+ if (info->invalidation_region &&
+ !cairo_region_is_empty (info->invalidation_region))
+ gdk_window_invalidate_region (info->window, info->invalidation_region, TRUE);
+ else
+ gdk_window_invalidate_rect (info->window, NULL, TRUE);
+}
+
+static void
+timeline_finished_cb (GtkTimeline *timeline,
+ gpointer user_data)
+{
+ GtkStyleContextPrivate *priv;
+ GtkStyleContext *context;
+ AnimationInfo *info;
+
+ context = user_data;
+ priv = context->priv;
+ info = animation_info_lookup_by_timeline (context, timeline);
+
+ g_assert (info != NULL);
+
+ priv->animations = g_slist_remove (priv->animations, info);
+
+ /* Invalidate one last time the area, so the final content is painted */
+ if (info->invalidation_region &&
+ !cairo_region_is_empty (info->invalidation_region))
+ gdk_window_invalidate_region (info->window, info->invalidation_region, TRUE);
+ else
+ gdk_window_invalidate_rect (info->window, NULL, TRUE);
+
+ animation_info_free (info);
+}
+
+static AnimationInfo *
+animation_info_new (GtkStyleContext *context,
+ gpointer region_id,
+ guint duration,
+ GtkTimelineProgressType progress_type,
+ gboolean loop,
+ GtkStateType state,
+ gboolean target_value,
+ GdkWindow *window)
+{
+ AnimationInfo *info;
+
+ info = g_slice_new0 (AnimationInfo);
+
+ info->rectangles = g_array_new (FALSE, FALSE, sizeof (cairo_rectangle_int_t));
+ info->timeline = gtk_timeline_new (duration);
+ info->window = g_object_ref (window);
+ info->state = state;
+ info->target_value = target_value;
+ info->region_id = region_id;
+
+ gtk_timeline_set_progress_type (info->timeline, progress_type);
+ gtk_timeline_set_loop (info->timeline, loop);
+
+ if (!loop && !target_value)
+ {
+ gtk_timeline_set_direction (info->timeline, GTK_TIMELINE_DIRECTION_BACKWARD);
+ gtk_timeline_rewind (info->timeline);
+ }
+
+ g_signal_connect (info->timeline, "frame",
+ G_CALLBACK (timeline_frame_cb), context);
+ g_signal_connect (info->timeline, "finished",
+ G_CALLBACK (timeline_finished_cb), context);
+
+ gtk_timeline_start (info->timeline);
+
+ return info;
+}
+
+static AnimationInfo *
+animation_info_lookup (GtkStyleContext *context,
+ gpointer region_id,
+ GtkStateType state)
+{
+ GtkStyleContextPrivate *priv;
+ GSList *l;
+
+ priv = context->priv;
+
+ for (l = priv->animations; l; l = l->next)
+ {
+ AnimationInfo *info;
+
+ info = l->data;
+
+ if (info->state == state &&
+ info->region_id == region_id)
+ return info;
+ }
+
+ return NULL;
+}
+
+static void
+gtk_style_context_finalize (GObject *object)
+{
+ GtkStyleContextPrivate *priv;
+ GtkStyleContext *style_context;
+ GSList *l;
+
+ style_context = GTK_STYLE_CONTEXT (object);
+ priv = style_context->priv;
+
+ if (priv->widget_path)
+ gtk_widget_path_free (priv->widget_path);
+
+ g_hash_table_destroy (priv->style_data);
+
+ g_list_foreach (priv->providers, (GFunc) style_provider_data_free, NULL);
+ g_list_free (priv->providers);
+
+ g_slist_foreach (priv->info_stack, (GFunc) style_info_free, NULL);
+ g_slist_free (priv->info_stack);
+
+ g_slist_free (priv->animation_regions);
+
+ for (l = priv->animations; l; l = l->next)
+ animation_info_free ((AnimationInfo *) l->data);
+
+ g_slist_free (priv->animations);
+
+ if (priv->theming_engine)
+ g_object_unref (priv->theming_engine);
+
+ G_OBJECT_CLASS (gtk_style_context_parent_class)->finalize (object);
+}
+
+static void
+gtk_style_context_impl_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ GtkStyleContextPrivate *priv;
+ GtkStyleContext *style_context;
+
+ style_context = GTK_STYLE_CONTEXT (object);
+ priv = style_context->priv;
+
+ switch (prop_id)
+ {
+ case PROP_SCREEN:
+ gtk_style_context_set_screen (style_context,
+ g_value_get_object (value));
+ break;
+ case PROP_DIRECTION:
+ gtk_style_context_set_direction (style_context,
+ g_value_get_enum (value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+gtk_style_context_impl_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ GtkStyleContextPrivate *priv;
+ GtkStyleContext *style_context;
+
+ style_context = GTK_STYLE_CONTEXT (object);
+ priv = style_context->priv;
+
+ switch (prop_id)
+ {
+ case PROP_SCREEN:
+ g_value_set_object (value, priv->screen);
+ break;
+ case PROP_DIRECTION:
+ g_value_set_enum (value, priv->direction);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static GList *
+find_next_candidate (GList *local,
+ GList *global,
+ gboolean ascending)
+{
+ if (local && global)
+ {
+ GtkStyleProviderData *local_data, *global_data;
+
+ local_data = local->data;
+ global_data = global->data;
+
+ if (local_data->priority < global_data->priority)
+ return (ascending) ? local : global;
+ else
+ return (ascending) ? global : local;
+ }
+ else if (local)
+ return local;
+ else if (global)
+ return global;
+
+ return NULL;
+}
+
+static void
+build_properties (GtkStyleContext *context,
+ StyleData *style_data,
+ GtkWidgetPath *path)
+{
+ GtkStyleContextPrivate *priv;
+ GList *elem, *list, *global_list = NULL;
+
+ priv = context->priv;
+ list = priv->providers;
+
+ if (priv->screen)
+ global_list = g_object_get_qdata (G_OBJECT (priv->screen), provider_list_quark);
+
+ while ((elem = find_next_candidate (list, global_list, TRUE)) != NULL)
+ {
+ GtkStyleProviderData *data;
+ GtkStyleProperties *provider_style;
+
+ data = elem->data;
+
+ if (elem == list)
+ list = list->next;
+ else
+ global_list = global_list->next;
+
+ provider_style = gtk_style_provider_get_style (data->provider, path);
+
+ if (provider_style)
+ {
+ gtk_style_properties_merge (style_data->store, provider_style, TRUE);
+ g_object_unref (provider_style);
+ }
+ }
+}
+
+static void
+build_icon_factories (GtkStyleContext *context,
+ StyleData *style_data,
+ GtkWidgetPath *path)
+{
+ GtkStyleContextPrivate *priv;
+ GList *elem, *list, *global_list = NULL;
+
+ priv = context->priv;
+ list = priv->providers_last;
+
+ if (priv->screen)
+ {
+ global_list = g_object_get_qdata (G_OBJECT (priv->screen), provider_list_quark);
+ global_list = g_list_last (global_list);
+ }
+
+ while ((elem = find_next_candidate (list, global_list, FALSE)) != NULL)
+ {
+ GtkIconFactory *factory;
+ GtkStyleProviderData *data;
+
+ data = elem->data;
+
+ if (elem == list)
+ list = list->prev;
+ else
+ global_list = global_list->prev;
+
+ factory = gtk_style_provider_get_icon_factory (data->provider, path);
+
+ if (factory)
+ style_data->icon_factories = g_slist_prepend (style_data->icon_factories, factory);
+ }
+}
+
+GtkWidgetPath *
+create_query_path (GtkStyleContext *context)
+{
+ GtkStyleContextPrivate *priv;
+ GtkWidgetPath *path;
+ GtkStyleInfo *info;
+ guint i, pos;
+
+ priv = context->priv;
+ path = gtk_widget_path_copy (priv->widget_path);
+ pos = gtk_widget_path_length (path) - 1;
+
+ info = priv->info_stack->data;
+
+ /* Set widget regions */
+ for (i = 0; i < info->regions->len; i++)
+ {
+ GtkRegion *region;
+
+ region = &g_array_index (info->regions, GtkRegion, i);
+ gtk_widget_path_iter_add_region (path, pos,
+ g_quark_to_string (region->class_quark),
+ region->flags);
+ }
+
+ /* Set widget classes */
+ for (i = 0; i < info->style_classes->len; i++)
+ {
+ GQuark quark;
+
+ quark = g_array_index (info->style_classes, GQuark, i);
+ gtk_widget_path_iter_add_class (path, pos,
+ g_quark_to_string (quark));
+ }
+
+ return path;
+}
+
+static StyleData *
+style_data_lookup (GtkStyleContext *context)
+{
+ GtkStyleContextPrivate *priv;
+ StyleData *data;
+
+ priv = context->priv;
+
+ /* Current data in use is cached, just return it */
+ if (priv->current_data)
+ return priv->current_data;
+
+ g_assert (priv->widget_path != NULL);
+
+ data = g_hash_table_lookup (priv->style_data, priv->info_stack->data);
+
+ if (!data)
+ {
+ GtkWidgetPath *path;
+
+ data = style_data_new ();
+ path = create_query_path (context);
+
+ build_properties (context, data, path);
+ build_icon_factories (context, data, path);
+
+ g_hash_table_insert (priv->style_data,
+ style_info_copy (priv->info_stack->data),
+ data);
+
+ gtk_widget_path_free (path);
+ }
+
+ priv->current_data = data;
+
+ if (priv->theming_engine)
+ g_object_unref (priv->theming_engine);
+
+ gtk_style_properties_get (data->store, 0,
+ "engine", &priv->theming_engine,
+ NULL);
+ return data;
+}
+
+static void
+style_provider_add (GList **list,
+ GtkStyleProvider *provider,
+ guint priority)
+{
+ GtkStyleProviderData *new_data;
+ gboolean added = FALSE;
+ GList *l = *list;
+
+ new_data = style_provider_data_new (provider, priority);
+
+ while (l)
+ {
+ GtkStyleProviderData *data;
+
+ data = l->data;
+
+ /* Provider was already attached to the style
+ * context, remove in order to add the new data
+ */
+ if (data->provider == provider)
+ {
+ GList *link;
+
+ link = l;
+ l = l->next;
+
+ /* Remove and free link */
+ *list = g_list_remove_link (*list, link);
+ style_provider_data_free (link->data);
+ g_list_free_1 (link);
+
+ continue;
+ }
+
+ if (!added &&
+ data->priority > priority)
+ {
+ *list = g_list_insert_before (*list, l, new_data);
+ added = TRUE;
+ }
+
+ l = l->next;
+ }
+
+ if (!added)
+ *list = g_list_append (*list, new_data);
+}
+
+static gboolean
+style_provider_remove (GList **list,
+ GtkStyleProvider *provider)
+{
+ GList *l = *list;
+
+ while (l)
+ {
+ GtkStyleProviderData *data;
+
+ data = l->data;
+
+ if (data->provider == provider)
+ {
+ *list = g_list_remove_link (*list, l);
+ style_provider_data_free (l->data);
+ g_list_free_1 (l);
+
+ return TRUE;
+ }
+
+ l = l->next;
+ }
+
+ return FALSE;
+}
+
+/**
+ * gtk_style_context_new:
+ *
+ * Creates a standalone #GtkStyleContext, this style context
+ * won't be attached to any widget, so you may want
+ * to call gtk_style_context_set_path() yourself.
+ *
+ * <note>
+ * This function is only useful when using the theming layer
+ * separated from GTK+, if you are using #GtkStyleContext to
+ * theme #GtkWidget<!-- -->s, use gtk_widget_get_style_context()
+ * in order to get a style context ready to theme the widget.
+ * </note>
+ *
+ * Returns: A newly created #GtkStyleContext.
+ **/
+GtkStyleContext *
+gtk_style_context_new (void)
+{
+ return g_object_new (GTK_TYPE_STYLE_CONTEXT, NULL);
+}
+
+/**
+ * gtk_style_context_add_provider:
+ * @context: a #GtkStyleContext
+ * @provider: a #GtkStyleProvider
+ * @priority: the priority of the style provider. The lower
+ * it is, the earlier it will be used in the style
+ * construction. Typically this will be in the range
+ * between %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK and
+ * %GTK_STYLE_PROVIDER_PRIORITY_USER
+ *
+ * Adds a style provider to @context, to be used in style construction.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_add_provider (GtkStyleContext *context,
+ GtkStyleProvider *provider,
+ guint priority)
+{
+ GtkStyleContextPrivate *priv;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (GTK_IS_STYLE_PROVIDER (provider));
+
+ priv = context->priv;
+ style_provider_add (&priv->providers, provider, priority);
+ priv->providers_last = g_list_last (priv->providers);
+
+ gtk_style_context_invalidate (context);
+}
+
+/**
+ * gtk_style_context_remove_provider:
+ * @context: a #GtkStyleContext
+ * @provider: a #GtkStyleProvider
+ *
+ * Removes @provider from the style providers list in @context.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_remove_provider (GtkStyleContext *context,
+ GtkStyleProvider *provider)
+{
+ GtkStyleContextPrivate *priv;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (GTK_IS_STYLE_PROVIDER (provider));
+
+ priv = context->priv;
+
+ if (style_provider_remove (&priv->providers, provider))
+ {
+ priv->providers_last = g_list_last (priv->providers);
+
+ gtk_style_context_invalidate (context);
+ }
+}
+
+/**
+ * gtk_style_context_reset_widgets:
+ * @screen: a #GdkScreen
+ *
+ * This function recomputes the styles for all widgets under a particular
+ * #GdkScreen. This is useful when some global parameter has changed that
+ * affects the appearance of all widgets, because when a widget gets a new
+ * style, it will both redraw and recompute any cached information about
+ * its appearance. As an example, it is used when the color scheme changes
+ * in the related #GtkSettings object.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_reset_widgets (GdkScreen *screen)
+{
+ GList *list, *toplevels;
+
+ _gtk_icon_set_invalidate_caches ();
+
+ toplevels = gtk_window_list_toplevels ();
+ g_list_foreach (toplevels, (GFunc) g_object_ref, NULL);
+
+ for (list = toplevels; list; list = list->next)
+ {
+ if (gtk_widget_get_screen (list->data) == screen)
+ gtk_widget_reset_style (list->data);
+
+ g_object_unref (list->data);
+ }
+
+ g_list_free (toplevels);
+}
+
+/**
+ * gtk_style_context_add_provider_for_screen:
+ * @screen: a #GdkScreen
+ * @provider: a #GtkStyleProvider
+ * @priority: the priority of the style provider. The lower
+ * it is, the earlier it will be used in the style
+ * construction. Typically this will be in the range
+ * between %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK and
+ * %GTK_STYLE_PROVIDER_PRIORITY_USER
+ *
+ * Adds a global style provider to @screen, which will be used
+ * in style construction for all #GtkStyleContext<!-- -->s under
+ * @screen.
+ *
+ * GTK+ uses this to make styling information from #GtkSettings
+ * available.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_add_provider_for_screen (GdkScreen *screen,
+ GtkStyleProvider *provider,
+ guint priority)
+{
+ GList *providers, *list;
+
+ g_return_if_fail (GDK_IS_SCREEN (screen));
+ g_return_if_fail (GTK_IS_STYLE_PROVIDER (provider));
+
+ if (G_UNLIKELY (!provider_list_quark))
+ provider_list_quark = g_quark_from_static_string ("gtk-provider-list-quark");
+
+ list = providers = g_object_get_qdata (G_OBJECT (screen), provider_list_quark);
+ style_provider_add (&list, provider, priority);
+
+ if (list != providers)
+ g_object_set_qdata (G_OBJECT (screen), provider_list_quark, list);
+
+ gtk_style_context_reset_widgets (screen);
+}
+
+/**
+ * gtk_style_context_remove_provider_for_screen:
+ * @screen: a #GdkScreen
+ * @provider: a #GtkStyleProvider
+ *
+ * Removes @provider from the global style providers list in @screen.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_remove_provider_for_screen (GdkScreen *screen,
+ GtkStyleProvider *provider)
+{
+ GList *providers, *list;
+
+ g_return_if_fail (GDK_IS_SCREEN (screen));
+ g_return_if_fail (GTK_IS_STYLE_PROVIDER (provider));
+
+ if (G_UNLIKELY (!provider_list_quark))
+ return;
+
+ list = providers = g_object_get_qdata (G_OBJECT (screen), provider_list_quark);
+
+ if (style_provider_remove (&list, provider))
+ {
+ if (list != providers)
+ g_object_set_qdata (G_OBJECT (screen), provider_list_quark, list);
+
+ gtk_style_context_reset_widgets (screen);
+ }
+}
+
+/**
+ * gtk_style_context_get_property:
+ * @context: a #GtkStyleContext
+ * @property: style property name
+ * @state: state to retrieve the property value for
+ * @value: (out) (transfer full): return location for the style property value
+ *
+ * Gets a style property from @context for the given state.
+ *
+ * When @value is no longer needed, g_value_unset() must be called
+ * to free any allocated memory.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_get_property (GtkStyleContext *context,
+ const gchar *property,
+ GtkStateFlags state,
+ GValue *value)
+{
+ GtkStyleContextPrivate *priv;
+ StyleData *data;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (property != NULL);
+ g_return_if_fail (value != NULL);
+
+ priv = context->priv;
+
+ g_return_if_fail (priv->widget_path != NULL);
+
+ data = style_data_lookup (context);
+ gtk_style_properties_get_property (data->store, property, state, value);
+}
+
+/**
+ * gtk_style_context_get_valist:
+ * @context: a #GtkStyleContext
+ * @state: state to retrieve the property values for
+ * @args: va_list of property name/return location pairs, followed by %NULL
+ *
+ * Retrieves several style property values from @context for a given state.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_get_valist (GtkStyleContext *context,
+ GtkStateFlags state,
+ va_list args)
+{
+ GtkStyleContextPrivate *priv;
+ StyleData *data;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+
+ priv = context->priv;
+ g_return_if_fail (priv->widget_path != NULL);
+
+ data = style_data_lookup (context);
+ gtk_style_properties_get_valist (data->store, state, args);
+}
+
+/**
+ * gtk_style_context_get:
+ * @context: a #GtkStyleContext
+ * @state: state to retrieve the property values for
+ * @...: property name /return value pairs, followed by %NULL
+ *
+ * Retrieves several style property values from @context for a
+ * given state.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_get (GtkStyleContext *context,
+ GtkStateFlags state,
+ ...)
+{
+ GtkStyleContextPrivate *priv;
+ StyleData *data;
+ va_list args;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+
+ priv = context->priv;
+ g_return_if_fail (priv->widget_path != NULL);
+
+ data = style_data_lookup (context);
+
+ va_start (args, state);
+ gtk_style_properties_get_valist (data->store, state, args);
+ va_end (args);
+}
+
+/**
+ * gtk_style_context_set_state:
+ * @context: a #GtkStyleContext
+ * @flags: state to represent
+ *
+ * Sets the state to be used when rendering with any
+ * of the gtk_render_*() functions.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_set_state (GtkStyleContext *context,
+ GtkStateFlags flags)
+{
+ GtkStyleContextPrivate *priv;
+ GtkStyleInfo *info;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+
+ priv = context->priv;
+ info = priv->info_stack->data;
+ info->state_flags = flags;
+}
+
+/**
+ * gtk_style_context_get_state:
+ * @context: a #GtkStyleContext
+ *
+ * Returns the state used when rendering.
+ *
+ * Returns: the state flags
+ *
+ * Since: 3.0
+ **/
+GtkStateFlags
+gtk_style_context_get_state (GtkStyleContext *context)
+{
+ GtkStyleContextPrivate *priv;
+ GtkStyleInfo *info;
+
+ g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), 0);
+
+ priv = context->priv;
+ info = priv->info_stack->data;
+
+ return info->state_flags;
+}
+
+static gboolean
+context_has_animatable_region (GtkStyleContext *context,
+ gpointer region_id)
+{
+ GtkStyleContextPrivate *priv;
+ GSList *r;
+
+ /* NULL region_id means everything
+ * rendered through the style context
+ */
+ if (!region_id)
+ return TRUE;
+
+ priv = context->priv;
+
+ for (r = priv->animation_regions; r; r = r->next)
+ {
+ if (r->data == region_id)
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/**
+ * gtk_style_context_state_is_running:
+ * @context: a #GtkStyleContext
+ * @state: a widget state
+ * @progress: (out): return location for the transition progress
+ *
+ * Returns %TRUE if there is a transition animation running for the
+ * current region (see gtk_style_context_push_animatable_region()).
+ *
+ * If @progress is not %NULL, the animation progress will be returned
+ * there, 0.0 means the state is closest to being unset, while 1.0 means
+ * it's closest to being set. This means transition animation will
+ * run from 0 to 1 when @state is being set and from 1 to 0 when
+ * it's being unset.
+ *
+ * Returns: %TRUE if there is a running transition animation for @state.
+ *
+ * Since: 3.0
+ **/
+gboolean
+gtk_style_context_state_is_running (GtkStyleContext *context,
+ GtkStateType state,
+ gdouble *progress)
+{
+ GtkStyleContextPrivate *priv;
+ AnimationInfo *info;
+ GSList *l;
+
+ g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), FALSE);
+
+ priv = context->priv;
+
+ for (l = priv->animations; l; l = l->next)
+ {
+ info = l->data;
+
+ if (info->state == state &&
+ context_has_animatable_region (context, info->region_id))
+ {
+ if (progress)
+ *progress = gtk_timeline_get_progress (info->timeline);
+
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+/**
+ * gtk_style_context_set_path:
+ * @context: a #GtkStyleContext
+ * @path: a #GtkWidgetPath
+ *
+ * Sets the #GtkWidgetPath used for style matching. As a
+ * consequence, the style will be regenerated to match
+ * the new given path.
+ *
+ * If you are using a #GtkStyleContext returned from
+ * gtk_widget_get_style_context(), you do not need to call
+ * this yourself.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_set_path (GtkStyleContext *context,
+ GtkWidgetPath *path)
+{
+ GtkStyleContextPrivate *priv;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (path != NULL);
+
+ priv = context->priv;
+
+ if (priv->widget_path)
+ {
+ gtk_widget_path_free (priv->widget_path);
+ priv->widget_path = NULL;
+ }
+
+ if (path)
+ priv->widget_path = gtk_widget_path_copy (path);
+
+ gtk_style_context_invalidate (context);
+}
+
+/**
+ * gtk_style_context_get_path:
+ * @context: a #GtkStyleContext
+ *
+ * Returns the widget path used for style matching.
+ *
+ * Returns: (transfer none): A #GtkWidgetPath
+ *
+ * Since: 3.0
+ **/
+G_CONST_RETURN GtkWidgetPath *
+gtk_style_context_get_path (GtkStyleContext *context)
+{
+ GtkStyleContextPrivate *priv;
+
+ priv = context->priv;
+ return priv->widget_path;
+}
+
+/**
+ * gtk_style_context_save:
+ * @context: a #GtkStyleContext
+ *
+ * Saves the @context state, so all modifications done through
+ * gtk_style_context_add_class(), gtk_style_context_remove_class(),
+ * gtk_style_context_add_region(), gtk_style_context_remove_region()
+ * or gtk_style_context_set_junction_sides() can be reverted in one
+ * go through gtk_style_context_restore().
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_save (GtkStyleContext *context)
+{
+ GtkStyleContextPrivate *priv;
+ GtkStyleInfo *info;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+
+ priv = context->priv;
+
+ g_assert (priv->info_stack != NULL);
+
+ info = style_info_copy (priv->info_stack->data);
+ priv->info_stack = g_slist_prepend (priv->info_stack, info);
+}
+
+/**
+ * gtk_style_context_restore:
+ * @context: a #GtkStyleContext
+ *
+ * Restores @context state to a previous stage.
+ * See gtk_style_context_save().
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_restore (GtkStyleContext *context)
+{
+ GtkStyleContextPrivate *priv;
+ GtkStyleInfo *info;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+
+ priv = context->priv;
+
+ if (priv->info_stack)
+ {
+ info = priv->info_stack->data;
+ priv->info_stack = g_slist_remove (priv->info_stack, info);
+ style_info_free (info);
+ }
+
+ if (!priv->info_stack)
+ {
+ g_warning ("Unpaired gtk_style_context_restore() call");
+
+ /* Create default region */
+ info = style_info_new ();
+ priv->info_stack = g_slist_prepend (priv->info_stack, info);
+ }
+
+ priv->current_data = NULL;
+}
+
+static gboolean
+style_class_find (GArray *array,
+ GQuark class_quark,
+ guint *position)
+{
+ gint min, max, mid;
+ gboolean found = FALSE;
+ guint pos;
+
+ if (position)
+ *position = 0;
+
+ if (!array || array->len == 0)
+ return FALSE;
+
+ min = 0;
+ max = array->len - 1;
+
+ do
+ {
+ GQuark item;
+
+ mid = (min + max) / 2;
+ item = g_array_index (array, GQuark, mid);
+
+ if (class_quark == item)
+ {
+ found = TRUE;
+ pos = mid;
+ }
+ else if (class_quark > item)
+ min = pos = mid + 1;
+ else
+ {
+ max = mid - 1;
+ pos = mid;
+ }
+ }
+ while (!found && min <= max);
+
+ if (position)
+ *position = pos;
+
+ return found;
+}
+
+static gboolean
+region_find (GArray *array,
+ GQuark class_quark,
+ guint *position)
+{
+ gint min, max, mid;
+ gboolean found = FALSE;
+ guint pos;
+
+ if (position)
+ *position = 0;
+
+ if (!array || array->len == 0)
+ return FALSE;
+
+ min = 0;
+ max = array->len - 1;
+
+ do
+ {
+ GtkRegion *region;
+
+ mid = (min + max) / 2;
+ region = &g_array_index (array, GtkRegion, mid);
+
+ if (region->class_quark == class_quark)
+ {
+ found = TRUE;
+ pos = mid;
+ }
+ else if (region->class_quark > class_quark)
+ min = pos = mid + 1;
+ else
+ {
+ max = mid - 1;
+ pos = mid;
+ }
+ }
+ while (!found && min <= max);
+
+ if (position)
+ *position = pos;
+
+ return found;
+}
+
+/**
+ * gtk_style_context_add_class:
+ * @context: a #GtkStyleContext
+ * @class_name: class name to use in styling
+ *
+ * Adds a style class to @context, so posterior calls to
+ * gtk_style_context_get() or any of the gtk_render_*()
+ * functions will make use of this new class for styling.
+ *
+ * In the CSS file format, a #GtkEntry defining an "entry"
+ * class, would be matched by:
+ *
+ * <programlisting>
+ * GtkEntry.entry { ... }
+ * </programlisting>
+ *
+ * While any widget defining an "entry" class would be
+ * matched by:
+ * <programlisting>
+ * .entry { ... }
+ * </programlisting>
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_add_class (GtkStyleContext *context,
+ const gchar *class_name)
+{
+ GtkStyleContextPrivate *priv;
+ GtkStyleInfo *info;
+ GQuark class_quark;
+ guint position;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (class_name != NULL);
+
+ priv = context->priv;
+ class_quark = g_quark_from_string (class_name);
+
+ g_assert (priv->info_stack != NULL);
+ info = priv->info_stack->data;
+
+ if (!style_class_find (info->style_classes, class_quark, &position))
+ {
+ g_array_insert_val (info->style_classes, position, class_quark);
+
+ /* Unset current data, as it likely changed due to the class change */
+ priv->current_data = NULL;
+ }
+}
+
+/**
+ * gtk_style_context_remove_class:
+ * @context: a #GtkStyleContext
+ * @class_name: class name to remove
+ *
+ * Removes @class_name from @context.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_remove_class (GtkStyleContext *context,
+ const gchar *class_name)
+{
+ GtkStyleContextPrivate *priv;
+ GtkStyleInfo *info;
+ GQuark class_quark;
+ guint position;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (class_name != NULL);
+
+ class_quark = g_quark_try_string (class_name);
+
+ if (!class_quark)
+ return;
+
+ priv = context->priv;
+
+ g_assert (priv->info_stack != NULL);
+ info = priv->info_stack->data;
+
+ if (style_class_find (info->style_classes, class_quark, &position))
+ {
+ g_array_remove_index (info->style_classes, position);
+
+ /* Unset current data, as it likely changed due to the class change */
+ priv->current_data = NULL;
+ }
+}
+
+/**
+ * gtk_style_context_has_class:
+ * @context: a #GtkStyleContext
+ * @class_name: a class name
+ *
+ * Returns %TRUE if @context currently has defined the
+ * given class name
+ *
+ * Returns: %TRUE if @context has @class_name defined
+ *
+ * Since: 3.0
+ **/
+gboolean
+gtk_style_context_has_class (GtkStyleContext *context,
+ const gchar *class_name)
+{
+ GtkStyleContextPrivate *priv;
+ GtkStyleInfo *info;
+ GQuark class_quark;
+
+ g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), FALSE);
+ g_return_val_if_fail (class_name != NULL, FALSE);
+
+ class_quark = g_quark_try_string (class_name);
+
+ if (!class_quark)
+ return FALSE;
+
+ priv = context->priv;
+
+ g_assert (priv->info_stack != NULL);
+ info = priv->info_stack->data;
+
+ if (style_class_find (info->style_classes, class_quark, NULL))
+ return TRUE;
+
+ return FALSE;
+}
+
+/**
+ * gtk_style_context_list_classes:
+ * @context: a #GtkStyleContext
+ *
+ * Returns the list of classes currently defined in @context.
+ *
+ * Returns: (transfer container) (element-type utf8): a #GList of
+ * strings with the currently defined classes. The contents
+ * of the list are owned by GTK+, but you must free the list
+ * itself with g_list_free() when you are done with it.
+ *
+ * Since: 3.0
+ **/
+GList *
+gtk_style_context_list_classes (GtkStyleContext *context)
+{
+ GtkStyleContextPrivate *priv;
+ GtkStyleInfo *info;
+ GList *classes = NULL;
+ guint i;
+
+ g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), NULL);
+
+ priv = context->priv;
+
+ g_assert (priv->info_stack != NULL);
+ info = priv->info_stack->data;
+
+ for (i = 0; i < info->style_classes->len; i++)
+ {
+ GQuark quark;
+
+ quark = g_array_index (info->style_classes, GQuark, i);
+ classes = g_list_prepend (classes, (gchar *) g_quark_to_string (quark));
+ }
+
+ return classes;
+}
+
+/**
+ * gtk_style_context_list_regions:
+ * @context: a #GtkStyleContext
+ *
+ * Returns the list of regions currently defined in @context.
+ *
+ * Returns: (transfer container) (element-type utf8): a #GList of
+ * strings with the currently defined regions. The contents
+ * of the list are owned by GTK+, but you must free the list
+ * itself with g_list_free() when you are done with it.
+ *
+ * Since: 3.0
+ **/
+GList *
+gtk_style_context_list_regions (GtkStyleContext *context)
+{
+ GtkStyleContextPrivate *priv;
+ GtkStyleInfo *info;
+ GList *classes = NULL;
+ guint i;
+
+ g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), NULL);
+
+ priv = context->priv;
+
+ g_assert (priv->info_stack != NULL);
+ info = priv->info_stack->data;
+
+ for (i = 0; i < info->regions->len; i++)
+ {
+ GtkRegion *region;
+ const gchar *class_name;
+
+ region = &g_array_index (info->regions, GtkRegion, i);
+
+ class_name = g_quark_to_string (region->class_quark);
+ classes = g_list_prepend (classes, (gchar *) class_name);
+ }
+
+ return classes;
+}
+
+/**
+ * gtk_style_context_add_region:
+ * @context: a #GtkStyleContext
+ * @region_name: region name to use in styling
+ * @flags: flags that apply to the region
+ *
+ * Adds a region to @context, so posterior calls to
+ * gtk_style_context_get() or any of the gtk_render_*()
+ * functions will make use of this new region for styling.
+ *
+ * In the CSS file format, a #GtkTreeView defining a "row"
+ * region, would be matched by:
+ *
+ * <programlisting>
+ * GtkTreeView row { ... }
+ * </programlisting>
+ *
+ * Pseudo-classes are used for matching @flags, so the two
+ * following rules:
+ * <programlisting>
+ * GtkTreeView row:nth-child (even) { ... }
+ * GtkTreeView row:nth-child (odd) { ... }
+ * </programlisting>
+ *
+ * would apply to even and odd rows, respectively.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_add_region (GtkStyleContext *context,
+ const gchar *region_name,
+ GtkRegionFlags flags)
+{
+ GtkStyleContextPrivate *priv;
+ GtkStyleInfo *info;
+ GQuark region_quark;
+ guint position;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (region_name != NULL);
+
+ priv = context->priv;
+ region_quark = g_quark_from_string (region_name);
+
+ g_assert (priv->info_stack != NULL);
+ info = priv->info_stack->data;
+
+ if (!region_find (info->regions, region_quark, &position))
+ {
+ GtkRegion region;
+
+ region.class_quark = region_quark;
+ region.flags = flags;
+
+ g_array_insert_val (info->regions, position, region);
+
+ /* Unset current data, as it likely changed due to the region change */
+ priv->current_data = NULL;
+ }
+}
+
+/**
+ * gtk_style_context_remove_region:
+ * @context: a #GtkStyleContext
+ * @region_name: region name to unset
+ *
+ * Removes a region from @context.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_remove_region (GtkStyleContext *context,
+ const gchar *region_name)
+{
+ GtkStyleContextPrivate *priv;
+ GtkStyleInfo *info;
+ GQuark region_quark;
+ guint position;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (region_name != NULL);
+
+ region_quark = g_quark_try_string (region_name);
+
+ if (!region_quark)
+ return;
+
+ priv = context->priv;
+
+ g_assert (priv->info_stack != NULL);
+ info = priv->info_stack->data;
+
+ if (region_find (info->regions, region_quark, &position))
+ {
+ g_array_remove_index (info->regions, position);
+
+ /* Unset current data, as it likely changed due to the region change */
+ priv->current_data = NULL;
+ }
+}
+
+/**
+ * gtk_style_context_has_region:
+ * @context: a #GtkStyleContext
+ * @region_name: a region name
+ * @flags_return: (out) (allow-none): return location for region flags
+ *
+ * Returns %TRUE if @context has the region defined.
+ * If @flags_return is not %NULL, it is set to the flags
+ * affecting the region.
+ *
+ * Returns: %TRUE if region is defined
+ *
+ * Since: 3.0
+ **/
+gboolean
+gtk_style_context_has_region (GtkStyleContext *context,
+ const gchar *region_name,
+ GtkRegionFlags *flags_return)
+{
+ GtkStyleContextPrivate *priv;
+ GtkStyleInfo *info;
+ GQuark region_quark;
+ guint position;
+
+ g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), FALSE);
+ g_return_val_if_fail (region_name != NULL, FALSE);
+
+ if (flags_return)
+ *flags_return = 0;
+
+ region_quark = g_quark_try_string (region_name);
+
+ if (!region_quark)
+ return FALSE;
+
+ priv = context->priv;
+
+ g_assert (priv->info_stack != NULL);
+ info = priv->info_stack->data;
+
+ if (region_find (info->regions, region_quark, &position))
+ {
+ if (flags_return)
+ {
+ GtkRegion *region;
+
+ region = &g_array_index (info->regions, GtkRegion, position);
+ *flags_return = region->flags;
+ }
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static gint
+style_property_values_cmp (gconstpointer bsearch_node1,
+ gconstpointer bsearch_node2)
+{
+ const PropertyValue *val1 = bsearch_node1;
+ const PropertyValue *val2 = bsearch_node2;
+
+ if (val1->widget_type != val2->widget_type)
+ return val1->widget_type < val2->widget_type ? -1 : 1;
+
+ if (val1->pspec != val2->pspec)
+ return val1->pspec < val2->pspec ? -1 : 1;
+
+ if (val1->state != val2->state)
+ return val1->state < val2->state ? -1 : 1;
+
+ return 0;
+}
+
+const GValue *
+_gtk_style_context_peek_style_property (GtkStyleContext *context,
+ GType widget_type,
+ GtkStateFlags state,
+ GParamSpec *pspec)
+{
+ GtkStyleContextPrivate *priv;
+ PropertyValue *pcache, key = { 0 };
+ GList *global_list = NULL;
+ StyleData *data;
+ guint i;
+
+ priv = context->priv;
+ data = style_data_lookup (context);
+
+ key.widget_type = widget_type;
+ key.state = state;
+ key.pspec = pspec;
+
+ /* need value cache array */
+ if (!data->property_cache)
+ data->property_cache = g_array_new (FALSE, FALSE, sizeof (PropertyValue));
+ else
+ {
+ pcache = bsearch (&key,
+ data->property_cache->data, data->property_cache->len,
+ sizeof (PropertyValue), style_property_values_cmp);
+ if (pcache)
+ return &pcache->value;
+ }
+
+ i = 0;
+ while (i < data->property_cache->len &&
+ style_property_values_cmp (&key, &g_array_index (data->property_cache, PropertyValue, i)) >= 0)
+ i++;
+
+ g_array_insert_val (data->property_cache, i, key);
+ pcache = &g_array_index (data->property_cache, PropertyValue, i);
+
+ /* cache miss, initialize value type, then set contents */
+ g_param_spec_ref (pcache->pspec);
+ g_value_init (&pcache->value, G_PARAM_SPEC_VALUE_TYPE (pspec));
+
+ if (priv->screen)
+ {
+ global_list = g_object_get_qdata (G_OBJECT (priv->screen), provider_list_quark);
+ global_list = g_list_last (global_list);
+ }
+
+ if (priv->widget_path)
+ {
+ GList *list, *global, *elem;
+
+ list = priv->providers_last;
+ global = global_list;
+
+ while ((elem = find_next_candidate (list, global, FALSE)) != NULL)
+ {
+ GtkStyleProviderData *provider_data;
+
+ provider_data = elem->data;
+
+ if (elem == list)
+ list = list->prev;
+ else
+ global = global->prev;
+
+ if (gtk_style_provider_get_style_property (provider_data->provider,
+ priv->widget_path, state,
+ pspec, &pcache->value))
+ {
+ /* Resolve symbolic colors to GdkColor/GdkRGBA */
+ if (G_VALUE_TYPE (&pcache->value) == GTK_TYPE_SYMBOLIC_COLOR)
+ {
+ GtkSymbolicColor *color;
+ GdkRGBA rgba;
+
+ color = g_value_get_boxed (&pcache->value);
+
+ if (gtk_symbolic_color_resolve (color, data->store, &rgba))
+ {
+ g_value_unset (&pcache->value);
+
+ if (G_PARAM_SPEC_VALUE_TYPE (pspec) == GDK_TYPE_RGBA)
+ {
+ g_value_init (&pcache->value, GDK_TYPE_RGBA);
+ g_value_set_boxed (&pcache->value, &rgba);
+ }
+ else
+ {
+ GdkColor rgb;
+
+ rgb.red = rgba.red * 65535. + 0.5;
+ rgb.green = rgba.green * 65535. + 0.5;
+ rgb.blue = rgba.blue * 65535. + 0.5;
+
+ g_value_init (&pcache->value, GDK_TYPE_COLOR);
+ g_value_set_boxed (&pcache->value, &rgb);
+ }
+ }
+ else
+ g_param_value_set_default (pspec, &pcache->value);
+ }
+
+ return &pcache->value;
+ }
+ }
+ }
+
+ /* not supplied by any provider, revert to default */
+ g_param_value_set_default (pspec, &pcache->value);
+
+ return &pcache->value;
+}
+
+/**
+ * gtk_style_context_get_style_property:
+ * @context: a #GtkStyleContext
+ * @property_name: the name of the widget style property
+ * @value: (out) (transfer full): Return location for the property value
+ *
+ * Gets the value for a widget style property.
+ *
+ * When @value is no longer needed, g_value_unset() must be called
+ * to free any allocated memory.
+ **/
+void
+gtk_style_context_get_style_property (GtkStyleContext *context,
+ const gchar *property_name,
+ GValue *value)
+{
+ GtkStyleContextPrivate *priv;
+ GtkWidgetClass *widget_class;
+ GtkStateFlags state;
+ GParamSpec *pspec;
+ const GValue *peek_value;
+ GType widget_type;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (property_name != NULL);
+ g_return_if_fail (value != NULL);
+
+ priv = context->priv;
+
+ if (!priv->widget_path)
+ return;
+
+ widget_type = gtk_widget_path_get_widget_type (priv->widget_path);
+
+ widget_class = g_type_class_ref (widget_type);
+ pspec = gtk_widget_class_find_style_property (widget_class, property_name);
+ g_type_class_unref (widget_class);
+
+ if (!pspec)
+ {
+ g_warning ("%s: widget class `%s' has no style property named `%s'",
+ G_STRLOC,
+ g_type_name (widget_type),
+ property_name);
+ return;
+ }
+
+ state = gtk_style_context_get_state (context);
+ peek_value = _gtk_style_context_peek_style_property (context, widget_type,
+ state, pspec);
+
+ if (G_VALUE_TYPE (value) == G_VALUE_TYPE (peek_value))
+ g_value_copy (peek_value, value);
+ else if (g_value_type_transformable (G_VALUE_TYPE (peek_value), G_VALUE_TYPE (value)))
+ g_value_transform (peek_value, value);
+ else
+ g_warning ("can't retrieve style property `%s' of type `%s' as value of type `%s'",
+ pspec->name,
+ G_VALUE_TYPE_NAME (peek_value),
+ G_VALUE_TYPE_NAME (value));
+}
+
+/**
+ * gtk_style_context_get_style_valist:
+ * @context: a #GtkStyleContext
+ * @args: va_list of property name/return location pairs, followed by %NULL
+ *
+ * Retrieves several widget style properties from @context according to the
+ * current style.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_get_style_valist (GtkStyleContext *context,
+ va_list args)
+{
+ GtkStyleContextPrivate *priv;
+ const gchar *prop_name;
+ GtkStateFlags state;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+
+ prop_name = va_arg (args, const gchar *);
+ priv = context->priv;
+
+ if (!priv->widget_path)
+ return;
+
+ state = gtk_style_context_get_state (context);
+
+ while (prop_name)
+ {
+ GtkWidgetClass *widget_class;
+ GParamSpec *pspec;
+ const GValue *peek_value;
+ GType widget_type;
+ gchar *error;
+
+ widget_type = gtk_widget_path_get_widget_type (priv->widget_path);
+
+ widget_class = g_type_class_ref (widget_type);
+ pspec = gtk_widget_class_find_style_property (widget_class, prop_name);
+ g_type_class_unref (widget_class);
+
+ if (!pspec)
+ {
+ g_warning ("%s: widget class `%s' has no style property named `%s'",
+ G_STRLOC,
+ g_type_name (widget_type),
+ prop_name);
+ continue;
+ }
+
+ peek_value = _gtk_style_context_peek_style_property (context, widget_type,
+ state, pspec);
+
+ G_VALUE_LCOPY (peek_value, args, 0, &error);
+
+ if (error)
+ {
+ g_warning ("can't retrieve style property `%s' of type `%s': %s",
+ pspec->name,
+ G_VALUE_TYPE_NAME (peek_value),
+ error);
+ g_free (error);
+ }
+
+ prop_name = va_arg (args, const gchar *);
+ }
+}
+
+/**
+ * gtk_style_context_get_style:
+ * @context: a #GtkStyleContext
+ * @...: property name /return value pairs, followed by %NULL
+ *
+ * Retrieves several widget style properties from @context according to the
+ * current style.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_get_style (GtkStyleContext *context,
+ ...)
+{
+ va_list args;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+
+ va_start (args, context);
+ gtk_style_context_get_style_valist (context, args);
+ va_end (args);
+}
+
+
+/**
+ * gtk_style_context_lookup_icon_set:
+ * @context: a #GtkStyleContext
+ * @stock_id: an icon name
+ *
+ * Looks up @stock_id in the icon factories associated to @context and
+ * the default icon factory, returning an icon set if found, otherwise
+ * %NULL.
+ *
+ * Returns: (transfer none): The looked up %GtkIconSet, or %NULL
+ **/
+GtkIconSet *
+gtk_style_context_lookup_icon_set (GtkStyleContext *context,
+ const gchar *stock_id)
+{
+ GtkStyleContextPrivate *priv;
+ StyleData *data;
+ GSList *list;
+
+ g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), NULL);
+ g_return_val_if_fail (stock_id != NULL, NULL);
+
+ priv = context->priv;
+ g_return_val_if_fail (priv->widget_path != NULL, NULL);
+
+ data = style_data_lookup (context);
+
+ for (list = data->icon_factories; list; list = list->next)
+ {
+ GtkIconFactory *factory;
+ GtkIconSet *icon_set;
+
+ factory = list->data;
+ icon_set = gtk_icon_factory_lookup (factory, stock_id);
+
+ if (icon_set)
+ return icon_set;
+ }
+
+ return gtk_icon_factory_lookup_default (stock_id);
+}
+
+/**
+ * gtk_style_context_set_screen:
+ * @context: a #GtkStyleContext
+ * @screen: a #GdkScreen
+ *
+ * Attaches @context to the given screen.
+ *
+ * The screen is used to add style information from 'global' style
+ * providers, such as the screens #GtkSettings instance.
+ *
+ * If you are using a #GtkStyleContext returned from
+ * gtk_widget_get_style_context(), you do not need to
+ * call this yourself.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_set_screen (GtkStyleContext *context,
+ GdkScreen *screen)
+{
+ GtkStyleContextPrivate *priv;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (GDK_IS_SCREEN (screen));
+
+ priv = context->priv;
+ if (priv->screen == screen)
+ return;
+
+ priv->screen = screen;
+
+ g_object_notify (G_OBJECT (context), "screen");
+
+ gtk_style_context_invalidate (context);
+}
+
+/**
+ * gtk_style_context_get_screen:
+ * @context: a #GtkStyleContext
+ *
+ * Returns the #GdkScreen to which @context is attached.
+ *
+ * Returns: a #GdkScreen.
+ **/
+GdkScreen *
+gtk_style_context_get_screen (GtkStyleContext *context)
+{
+ GtkStyleContextPrivate *priv;
+
+ g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), NULL);
+
+ priv = context->priv;
+ return priv->screen;
+}
+
+/**
+ * gtk_style_context_set_direction:
+ * @context: a #GtkStyleContext
+ * @direction: the new direction.
+ *
+ * Sets the reading direction for rendering purposes.
+ *
+ * If you are using a #GtkStyleContext returned from
+ * gtk_widget_get_style_context(), you do not need to
+ * call this yourself.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_set_direction (GtkStyleContext *context,
+ GtkTextDirection direction)
+{
+ GtkStyleContextPrivate *priv;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+
+ priv = context->priv;
+ priv->direction = direction;
+
+ g_object_notify (G_OBJECT (context), "direction");
+}
+
+/**
+ * gtk_style_context_get_direction:
+ * @context: a #GtkStyleContext
+ *
+ * Returns the widget direction used for rendering.
+ *
+ * Returns: the widget direction
+ *
+ * Since: 3.0
+ **/
+GtkTextDirection
+gtk_style_context_get_direction (GtkStyleContext *context)
+{
+ GtkStyleContextPrivate *priv;
+
+ g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), GTK_TEXT_DIR_LTR);
+
+ priv = context->priv;
+ return priv->direction;
+}
+
+/**
+ * gtk_style_context_set_junction_sides:
+ * @context: a #GtkStyleContext
+ * @sides: sides where rendered elements are visually connected to
+ * other elements
+ *
+ * Sets the sides where rendered elements (mostly through
+ * gtk_render_frame()) will visually connect with other visual elements.
+ *
+ * This is merely a hint that may or may not be honored
+ * by theming engines.
+ *
+ * Container widgets are expected to set junction hints as appropriate
+ * for their children, so it should not normally be necessary to call
+ * this function manually.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_set_junction_sides (GtkStyleContext *context,
+ GtkJunctionSides sides)
+{
+ GtkStyleContextPrivate *priv;
+ GtkStyleInfo *info;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+
+ priv = context->priv;
+ info = priv->info_stack->data;
+ info->junction_sides = sides;
+}
+
+/**
+ * gtk_style_context_get_junction_sides:
+ * @context: a #GtkStyleContext
+ *
+ * Returns the sides where rendered elements connect visually with others.
+ *
+ * Returns: the junction sides
+ *
+ * Since: 3.0
+ **/
+GtkJunctionSides
+gtk_style_context_get_junction_sides (GtkStyleContext *context)
+{
+ GtkStyleContextPrivate *priv;
+ GtkStyleInfo *info;
+
+ g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), 0);
+
+ priv = context->priv;
+ info = priv->info_stack->data;
+ return info->junction_sides;
+}
+
+/**
+ * gtk_style_context_lookup_color:
+ * @context: a #GtkStyleContext
+ * @color_name: color name to lookup
+ * @color: (out): Return location for the looked up color
+ *
+ * Looks up and resolves a color name in the @context color map.
+ *
+ * Returns: %TRUE if @color_name was found and resolved, %FALSE otherwise
+ **/
+gboolean
+gtk_style_context_lookup_color (GtkStyleContext *context,
+ const gchar *color_name,
+ GdkRGBA *color)
+{
+ GtkStyleContextPrivate *priv;
+ GtkSymbolicColor *sym_color;
+ StyleData *data;
+
+ g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), FALSE);
+ g_return_val_if_fail (color_name != NULL, FALSE);
+ g_return_val_if_fail (color != NULL, FALSE);
+
+ priv = context->priv;
+ g_return_val_if_fail (priv->widget_path != NULL, FALSE);
+
+ data = style_data_lookup (context);
+ sym_color = gtk_style_properties_lookup_color (data->store, color_name);
+
+ if (!sym_color)
+ return FALSE;
+
+ return gtk_symbolic_color_resolve (sym_color, data->store, color);
+}
+
+/**
+ * gtk_style_context_notify_state_change:
+ * @context: a #GtkStyleContext
+ * @window: a #GdkWindow
+ * @region_id: (allow-none): animatable region to notify on, or %NULL.
+ * See gtk_style_context_push_animatable_region()
+ * @state: state to trigger transition for
+ * @state_value: %TRUE if @state is the state we are changing to,
+ * %FALSE if we are changing away from it
+ *
+ * Notifies a state change on @context, so if the current style makes use
+ * of transition animations, one will be started so all rendered elements
+ * under @region_id are animated for state @state being set to value
+ * @state_value.
+ *
+ * The @window parameter is used in order to invalidate the rendered area
+ * as the animation runs, so make sure it is the same window that is being
+ * rendered on by the gtk_render_*() functions.
+ *
+ * If @region_id is %NULL, all rendered elements using @context will be
+ * affected by this state transition.
+ *
+ * As a practical example, a #GtkButton notifying a state transition on
+ * the prelight state:
+ * <programlisting>
+ * gtk_style_context_notify_state_change (context,
+ * gtk_widget_get_window (widget),
+ * NULL,
+ * GTK_STATE_PRELIGHT,
+ * button->in_button);
+ * </programlisting>
+ *
+ * Can be handled in the CSS file like this:
+ * <programlisting>
+ * GtkButton {
+ * background-color: &num;f00
+ * }
+ *
+ * GtkButton:hover {
+ * background-color: &num;fff;
+ * transition: 200ms linear
+ * }
+ * </programlisting>
+ *
+ * This combination will animate the button background from red to white
+ * if a pointer enters the button, and back to red if the pointer leaves
+ * the button.
+ *
+ * Note that @state is used when finding the transition parameters, which
+ * is why the style places the transition under the :hover pseudo-class.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_notify_state_change (GtkStyleContext *context,
+ GdkWindow *window,
+ gpointer region_id,
+ GtkStateType state,
+ gboolean state_value)
+{
+ GtkStyleContextPrivate *priv;
+ GtkAnimationDescription *desc;
+ AnimationInfo *info;
+ GtkStateFlags flags;
+ StyleData *data;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (state > GTK_STATE_NORMAL && state <= GTK_STATE_FOCUSED);
+
+ priv = context->priv;
+ g_return_if_fail (priv->widget_path != NULL);
+
+ state_value = (state_value == TRUE);
+
+ switch (state)
+ {
+ case GTK_STATE_ACTIVE:
+ flags = GTK_STATE_FLAG_ACTIVE;
+ break;
+ case GTK_STATE_PRELIGHT:
+ flags = GTK_STATE_FLAG_PRELIGHT;
+ break;
+ case GTK_STATE_SELECTED:
+ flags = GTK_STATE_FLAG_SELECTED;
+ break;
+ case GTK_STATE_INSENSITIVE:
+ flags = GTK_STATE_FLAG_INSENSITIVE;
+ break;
+ case GTK_STATE_INCONSISTENT:
+ flags = GTK_STATE_FLAG_INCONSISTENT;
+ break;
+ case GTK_STATE_FOCUSED:
+ flags = GTK_STATE_FLAG_FOCUSED;
+ break;
+ case GTK_STATE_NORMAL:
+ default:
+ flags = 0;
+ break;
+ }
+
+ /* Find out if there is any animation description for the given
+ * state, it will fallback to the normal state as well if necessary.
+ */
+ data = style_data_lookup (context);
+ gtk_style_properties_get (data->store, flags,
+ "transition", &desc,
+ NULL);
+
+ if (!desc)
+ return;
+
+ if (gtk_animation_description_get_duration (desc) == 0)
+ {
+ gtk_animation_description_unref (desc);
+ return;
+ }
+
+ info = animation_info_lookup (context, region_id, state);
+
+ if (info &&
+ info->target_value != state_value)
+ {
+ /* Target values are the opposite */
+ if (!gtk_timeline_get_loop (info->timeline))
+ {
+ /* Reverse the animation */
+ if (gtk_timeline_get_direction (info->timeline) == GTK_TIMELINE_DIRECTION_FORWARD)
+ gtk_timeline_set_direction (info->timeline, GTK_TIMELINE_DIRECTION_BACKWARD);
+ else
+ gtk_timeline_set_direction (info->timeline, GTK_TIMELINE_DIRECTION_FORWARD);
+
+ info->target_value = state_value;
+ }
+ else
+ {
+ /* Take it out of its looping state */
+ gtk_timeline_set_loop (info->timeline, FALSE);
+ }
+ }
+ else if (!info &&
+ (!gtk_animation_description_get_loop (desc) ||
+ state_value))
+ {
+ info = animation_info_new (context, region_id,
+ gtk_animation_description_get_duration (desc),
+ gtk_animation_description_get_progress_type (desc),
+ gtk_animation_description_get_loop (desc),
+ state, state_value, window);
+
+ priv->animations = g_slist_prepend (priv->animations, info);
+ priv->animations_invalidated = TRUE;
+ }
+
+ gtk_animation_description_unref (desc);
+}
+
+/**
+ * gtk_style_context_push_animatable_region:
+ * @context: a #GtkStyleContext
+ * @region_id: unique identifier for the animatable region
+ *
+ * Pushes an animatable region, so all further gtk_render_*() calls between
+ * this call and the following gtk_style_context_pop_animatable_region()
+ * will potentially show transition animations for this region if
+ * gtk_style_context_notify_state_change() is called for a given state,
+ * and the current theme/style defines transition animations for state
+ * changes.
+ *
+ * The @region_id used must be unique in @context so the theming engine
+ * can uniquely identify rendered elements subject to a state transition.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_push_animatable_region (GtkStyleContext *context,
+ gpointer region_id)
+{
+ GtkStyleContextPrivate *priv;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (region_id != NULL);
+
+ priv = context->priv;
+ priv->animation_regions = g_slist_prepend (priv->animation_regions, region_id);
+}
+
+/**
+ * gtk_style_context_pop_animatable_region:
+ * @context: a #GtkStyleContext
+ *
+ * Pops an animatable region from @context.
+ * See gtk_style_context_push_animatable_region().
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_pop_animatable_region (GtkStyleContext *context)
+{
+ GtkStyleContextPrivate *priv;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+
+ priv = context->priv;
+ priv->animation_regions = g_slist_delete_link (priv->animation_regions,
+ priv->animation_regions);
+}
+
+void
+_gtk_style_context_invalidate_animation_areas (GtkStyleContext *context)
+{
+ GtkStyleContextPrivate *priv;
+ GSList *l;
+
+ priv = context->priv;
+
+ for (l = priv->animations; l; l = l->next)
+ {
+ AnimationInfo *info;
+
+ info = l->data;
+
+ /* A NULL invalidation region means it has to be recreated on
+ * the next expose event, this happens usually after a widget
+ * allocation change, so the next expose after it will update
+ * the invalidation region.
+ */
+ if (info->invalidation_region)
+ {
+ cairo_region_destroy (info->invalidation_region);
+ info->invalidation_region = NULL;
+ }
+ }
+
+ priv->animations_invalidated = TRUE;
+}
+
+void
+_gtk_style_context_coalesce_animation_areas (GtkStyleContext *context,
+ gint rel_x,
+ gint rel_y)
+{
+ GtkStyleContextPrivate *priv;
+ GSList *l;
+
+ priv = context->priv;
+
+ if (!priv->animations_invalidated)
+ return;
+
+ l = priv->animations;
+
+ while (l)
+ {
+ AnimationInfo *info;
+ GSList *cur;
+ guint i;
+
+ cur = l;
+ info = cur->data;
+ l = l->next;
+
+ if (info->invalidation_region)
+ continue;
+
+ /* There's not much point in keeping the animation running */
+ if (info->rectangles->len == 0)
+ {
+ priv->animations = g_slist_remove (priv->animations, info);
+ animation_info_free (info);
+ continue;
+ }
+
+ info->invalidation_region = cairo_region_create ();
+
+ for (i = 0; i < info->rectangles->len; i++)
+ {
+ cairo_rectangle_int_t *rect;
+
+ rect = &g_array_index (info->rectangles, cairo_rectangle_int_t, i);
+ rect->x += rel_x;
+ rect->y += rel_y;
+
+ cairo_region_union_rectangle (info->invalidation_region, rect);
+ }
+
+ g_array_remove_range (info->rectangles, 0, info->rectangles->len);
+ }
+
+ priv->animations_invalidated = FALSE;
+}
+
+static void
+store_animation_region (GtkStyleContext *context,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height)
+{
+ GtkStyleContextPrivate *priv;
+ GSList *l;
+
+ priv = context->priv;
+
+ if (!priv->animations_invalidated)
+ return;
+
+ for (l = priv->animations; l; l = l->next)
+ {
+ AnimationInfo *info;
+
+ info = l->data;
+
+ /* The animation doesn't need updating
+ * the invalidation area, bail out.
+ */
+ if (info->invalidation_region)
+ continue;
+
+ if (context_has_animatable_region (context, info->region_id))
+ {
+ cairo_rectangle_int_t rect;
+
+ rect.x = (gint) x;
+ rect.y = (gint) y;
+ rect.width = (gint) width;
+ rect.height = (gint) height;
+
+ g_array_append_val (info->rectangles, rect);
+ }
+ }
+}
+
+/**
+ * gtk_style_context_invalidate:
+ * @context: a #GtkStyleContext.
+ *
+ * Invalidates @context style information, so it will be reconstructed
+ * again.
+ *
+ * If you're using a #GtkStyleContext returned from
+ * gtk_widget_get_style_context(), you do not need to
+ * call this yourself.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_invalidate (GtkStyleContext *context)
+{
+ GtkStyleContextPrivate *priv;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+
+ priv = context->priv;
+
+ /* Avoid reentrancy */
+ if (priv->invalidating_context)
+ return;
+
+ priv->invalidating_context = TRUE;
+
+ g_hash_table_remove_all (priv->style_data);
+ priv->current_data = NULL;
+
+ g_signal_emit (context, signals[CHANGED], 0);
+
+ priv->invalidating_context = FALSE;
+}
+
+/**
+ * gtk_style_context_set_background:
+ * @context: a #GtkStyleContext
+ * @window: a #GdkWindow
+ *
+ * Sets the background of @window to the background pattern or
+ * color specified in @context for its current state.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_set_background (GtkStyleContext *context,
+ GdkWindow *window)
+{
+ GtkStateFlags state;
+ cairo_pattern_t *pattern;
+ GdkRGBA *color;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (GDK_IS_WINDOW (window));
+
+ state = gtk_style_context_get_state (context);
+ gtk_style_context_get (context, state,
+ "background-image", &pattern,
+ NULL);
+ if (pattern)
+ {
+ gdk_window_set_background_pattern (window, pattern);
+ cairo_pattern_destroy (pattern);
+ return;
+ }
+
+ gtk_style_context_get (context, state,
+ "background-color", &color,
+ NULL);
+ if (color)
+ {
+ gdk_window_set_background_rgba (window, color);
+ gdk_rgba_free (color);
+ }
+}
+
+/**
+ * gtk_style_context_get_color:
+ * @context: a #GtkStyleContext
+ * @state: state to retrieve the color for
+ * @color: (out): return value for the foreground color
+ *
+ * Gets the foreground color for a given state.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_get_color (GtkStyleContext *context,
+ GtkStateFlags state,
+ GdkRGBA *color)
+{
+ GtkStyleContextPrivate *priv;
+ StyleData *data;
+ const GValue *value;
+ GdkRGBA *c;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+
+ priv = context->priv;
+ g_return_if_fail (priv->widget_path != NULL);
+
+ data = style_data_lookup (context);
+ value = _gtk_style_properties_peek_property (data->store,
+ "color", state);
+ c = g_value_get_boxed (value);
+ *color = *c;
+}
+
+/**
+ * gtk_style_context_get_background_color:
+ * @context: a #GtkStyleContext
+ * @state: state to retrieve the color for
+ * @color: (out): return value for the background color
+ *
+ * Gets the background color for a given state.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_get_background_color (GtkStyleContext *context,
+ GtkStateFlags state,
+ GdkRGBA *color)
+{
+ GtkStyleContextPrivate *priv;
+ StyleData *data;
+ const GValue *value;
+ GdkRGBA *c;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+
+ priv = context->priv;
+ g_return_if_fail (priv->widget_path != NULL);
+
+ data = style_data_lookup (context);
+ value = _gtk_style_properties_peek_property (data->store,
+ "background-color", state);
+ c = g_value_get_boxed (value);
+ *color = *c;
+}
+
+/**
+ * gtk_style_context_get_border_color:
+ * @context: a #GtkStyleContext
+ * @state: state to retrieve the color for
+ * @color: (out): return value for the border color
+ *
+ * Gets the border color for a given state.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_get_border_color (GtkStyleContext *context,
+ GtkStateFlags state,
+ GdkRGBA *color)
+{
+ GtkStyleContextPrivate *priv;
+ StyleData *data;
+ const GValue *value;
+ GdkRGBA *c;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+
+ priv = context->priv;
+ g_return_if_fail (priv->widget_path != NULL);
+
+ data = style_data_lookup (context);
+ value = _gtk_style_properties_peek_property (data->store,
+ "border-color", state);
+ c = g_value_get_boxed (value);
+ *color = *c;
+}
+
+/**
+ * gtk_style_context_get_border:
+ * @context: a #GtkStyleContext
+ * @state: state to retrieve the border for
+ * @color: (out): return value for the border settings
+ *
+ * Gets the border for a given state as a #GtkBorder.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_get_border (GtkStyleContext *context,
+ GtkStateFlags state,
+ GtkBorder *border)
+{
+ GtkStyleContextPrivate *priv;
+ StyleData *data;
+ const GValue *value;
+ GtkBorder *b;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+
+ priv = context->priv;
+ g_return_if_fail (priv->widget_path != NULL);
+
+ data = style_data_lookup (context);
+ value = _gtk_style_properties_peek_property (data->store,
+ "border-width", state);
+ b = g_value_get_boxed (value);
+ *border = *b;
+}
+
+/**
+ * gtk_style_context_get_padding:
+ * @context: a #GtkStyleContext
+ * @state: state to retrieve the padding for
+ * @color: (out): return value for the padding settings
+ *
+ * Gets the padding for a given state as a #GtkBorder.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_get_padding (GtkStyleContext *context,
+ GtkStateFlags state,
+ GtkBorder *padding)
+{
+ GtkStyleContextPrivate *priv;
+ StyleData *data;
+ const GValue *value;
+ GtkBorder *b;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+
+ priv = context->priv;
+ g_return_if_fail (priv->widget_path != NULL);
+
+ data = style_data_lookup (context);
+ value = _gtk_style_properties_peek_property (data->store,
+ "padding", state);
+ b = g_value_get_boxed (value);
+ *padding = *b;
+}
+
+/**
+ * gtk_style_context_get_margin:
+ * @context: a #GtkStyleContext
+ * @state: state to retrieve the border for
+ * @color: (out): return value for the margin settings
+ *
+ * Gets the margin for a given state as a #GtkBorder.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_context_get_margin (GtkStyleContext *context,
+ GtkStateFlags state,
+ GtkBorder *margin)
+{
+ GtkStyleContextPrivate *priv;
+ StyleData *data;
+ const GValue *value;
+ GtkBorder *b;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+
+ priv = context->priv;
+ g_return_if_fail (priv->widget_path != NULL);
+
+ data = style_data_lookup (context);
+ value = _gtk_style_properties_peek_property (data->store,
+ "margin", state);
+ b = g_value_get_boxed (value);
+ *margin = *b;
+}
+
+/* Paint methods */
+
+/**
+ * gtk_render_check:
+ * @context: a #GtkStyleContext
+ * @cr: a #cairo_t
+ * @x: X origin of the rectangle
+ * @y: Y origin of the rectangle
+ * @width: rectangle width
+ * @height: rectangle height
+ *
+ * Renders a checkmark (as in a #GtkCheckButton).
+ *
+ * The %GTK_STATE_FLAG_ACTIVE state determines whether the check is
+ * on or off, and %GTK_STATE_FLAG_INCONSISTENT determines whether it
+ * should be marked as undefined.
+ *
+ * <example>
+ * <title>Typical checkmark rendering</title>
+ * <inlinegraphic fileref="checks.png" format="PNG"/>
+ * </example>
+ *
+ * Since: 3.0
+ **/
+void
+gtk_render_check (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height)
+{
+ GtkStyleContextPrivate *priv;
+ GtkThemingEngineClass *engine_class;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (cr != NULL);
+
+ priv = context->priv;
+ engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
+
+ store_animation_region (context, x, y, width, height);
+
+ _gtk_theming_engine_set_context (priv->theming_engine, context);
+ engine_class->render_check (priv->theming_engine, cr,
+ x, y, width, height);
+}
+
+/**
+ * gtk_render_option:
+ * @context: a #GtkStyleContext
+ * @cr: a #cairo_t
+ * @x: X origin of the rectangle
+ * @y: Y origin of the rectangle
+ * @width: rectangle width
+ * @height: rectangle height
+ *
+ * Renders an option mark (as in a #GtkRadioButton), the %GTK_STATE_FLAG_ACTIVE
+ * state will determine whether the option is on or off, and
+ * %GTK_STATE_FLAG_INCONSISTENT whether it should be marked as undefined.
+ *
+ * <example>
+ * <title>Typical option mark rendering</title>
+ * <inlinegraphic fileref="options.png" format="PNG"/>
+ * </example>
+ *
+ * Since: 3.0
+ **/
+void
+gtk_render_option (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height)
+{
+ GtkStyleContextPrivate *priv;
+ GtkThemingEngineClass *engine_class;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (cr != NULL);
+
+ priv = context->priv;
+ engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
+
+ store_animation_region (context, x, y, width, height);
+
+ _gtk_theming_engine_set_context (priv->theming_engine, context);
+ engine_class->render_option (priv->theming_engine, cr,
+ x, y, width, height);
+}
+
+/**
+ * gtk_render_arrow:
+ * @context: a #GtkStyleContext
+ * @cr: a #cairo_t
+ * @angle: arrow angle from 0 to 2 * %G_PI, being 0 the arrow pointing to the north
+ * @x: Center X for the render area
+ * @y: Center Y for the render area
+ * @size: square side for render area
+ *
+ * Renders an arrow pointing to @angle.
+ *
+ * <example>
+ * <title>Typical arrow rendering at 0, 1&solidus;2 &pi;, &pi; and 3&solidus;2 &pi;</title>
+ * <inlinegraphic fileref="arrows.png" format="PNG"/>
+ * </example>
+ *
+ * Since: 3.0
+ **/
+void
+gtk_render_arrow (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble angle,
+ gdouble x,
+ gdouble y,
+ gdouble size)
+{
+ GtkStyleContextPrivate *priv;
+ GtkThemingEngineClass *engine_class;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (cr != NULL);
+
+ priv = context->priv;
+ engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
+
+ store_animation_region (context, x, y, size, size);
+
+ _gtk_theming_engine_set_context (priv->theming_engine, context);
+ engine_class->render_arrow (priv->theming_engine, cr,
+ angle, x, y, size);
+}
+
+/**
+ * gtk_render_background:
+ * @context: a #GtkStyleContext
+ * @cr: a #cairo_t
+ * @x: X origin of the rectangle
+ * @y: Y origin of the rectangle
+ * @width: rectangle width
+ * @height: rectangle height
+ *
+ * Renders the background of an element.
+ *
+ * <example>
+ * <title>Typical background rendering, showing the effect of
+ * <parameter>background-image</parameter>,
+ * <parameter>border-width</parameter> and
+ * <parameter>border-radius</parameter></title>
+ * <inlinegraphic fileref="background.png" format="PNG"/>
+ * </example>
+ *
+ * Since: 3.0.
+ **/
+void
+gtk_render_background (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height)
+{
+ GtkStyleContextPrivate *priv;
+ GtkThemingEngineClass *engine_class;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (cr != NULL);
+
+ priv = context->priv;
+ engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
+
+ store_animation_region (context, x, y, width, height);
+
+ _gtk_theming_engine_set_context (priv->theming_engine, context);
+ engine_class->render_background (priv->theming_engine, cr, x, y, width, height);
+}
+
+/**
+ * gtk_render_frame:
+ * @context: a #GtkStyleContext
+ * @cr: a #cairo_t
+ * @x: X origin of the rectangle
+ * @y: Y origin of the rectangle
+ * @width: rectangle width
+ * @height: rectangle height
+ *
+ * Renders a frame around the rectangle defined by @x, @y, @width, @height.
+ *
+ * <example>
+ * <title>Examples of frame rendering, showing the effect of
+ * <parameter>border-image</parameter>,
+ * <parameter>border-color</parameter>,
+ * <parameter>border-width</parameter>,
+ * <parameter>border-radius</parameter> and
+ * junctions</title>
+ * <inlinegraphic fileref="frames.png" format="PNG"/>
+ * </example>
+ *
+ * Since: 3.0
+ **/
+void
+gtk_render_frame (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height)
+{
+ GtkStyleContextPrivate *priv;
+ GtkThemingEngineClass *engine_class;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (cr != NULL);
+
+ priv = context->priv;
+ engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
+
+ store_animation_region (context, x, y, width, height);
+
+ _gtk_theming_engine_set_context (priv->theming_engine, context);
+ engine_class->render_frame (priv->theming_engine, cr, x, y, width, height);
+}
+
+/**
+ * gtk_render_expander:
+ * @context: a #GtkStyleContext
+ * @cr: a #cairo_t
+ * @x: X origin of the rectangle
+ * @y: Y origin of the rectangle
+ * @width: rectangle width
+ * @height: rectangle height
+ *
+ * Renders an expander (as used in #GtkTreeView and #GtkExpander) in the area
+ * defined by @x, @y, @width, @height. The state %GTK_STATE_FLAG_ACTIVE
+ * determines whether the expander is collapsed or expanded.
+ *
+ * <example>
+ * <title>Typical expander rendering</title>
+ * <inlinegraphic fileref="expanders.png" format="PNG"/>
+ * </example>
+ *
+ * Since: 3.0
+ **/
+void
+gtk_render_expander (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height)
+{
+ GtkStyleContextPrivate *priv;
+ GtkThemingEngineClass *engine_class;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (cr != NULL);
+
+ priv = context->priv;
+ engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
+
+ store_animation_region (context, x, y, width, height);
+
+ _gtk_theming_engine_set_context (priv->theming_engine, context);
+ engine_class->render_expander (priv->theming_engine, cr, x, y, width, height);
+}
+
+/**
+ * gtk_render_focus:
+ * @context: a #GtkStyleContext
+ * @cr: a #cairo_t
+ * @x: X origin of the rectangle
+ * @y: Y origin of the rectangle
+ * @width: rectangle width
+ * @height: rectangle height
+ *
+ * Renders a focus indicator on the rectangle determined by @x, @y, @width, @height.
+ * <example>
+ * <title>Typical focus rendering</title>
+ * <inlinegraphic fileref="focus.png" format="PNG"/>
+ * </example>
+ *
+ * Since: 3.0
+ **/
+void
+gtk_render_focus (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height)
+{
+ GtkStyleContextPrivate *priv;
+ GtkThemingEngineClass *engine_class;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (cr != NULL);
+
+ priv = context->priv;
+ engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
+
+ store_animation_region (context, x, y, width, height);
+
+ _gtk_theming_engine_set_context (priv->theming_engine, context);
+ engine_class->render_focus (priv->theming_engine, cr, x, y, width, height);
+}
+
+/**
+ * gtk_render_layout:
+ * @context: a #GtkStyleContext
+ * @cr: a #cairo_t
+ * @x: X origin
+ * @y: Y origin
+ * @layout: the #PangoLayout to render
+ *
+ * Renders @layout on the coordinates @x, @y
+ *
+ * Since: 3.0
+ **/
+void
+gtk_render_layout (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ PangoLayout *layout)
+{
+ GtkStyleContextPrivate *priv;
+ GtkThemingEngineClass *engine_class;
+ PangoRectangle extents;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (cr != NULL);
+
+ priv = context->priv;
+ engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
+
+ pango_layout_get_extents (layout, &extents, NULL);
+
+ store_animation_region (context,
+ x + extents.x,
+ y + extents.y,
+ extents.width,
+ extents.height);
+
+ _gtk_theming_engine_set_context (priv->theming_engine, context);
+ engine_class->render_layout (priv->theming_engine, cr, x, y, layout);
+}
+
+/**
+ * gtk_render_line:
+ * @context: a #GtkStyleContext
+ * @cr: a #cairo_t
+ * @x0: X coordinate for the origin of the line
+ * @y0: Y coordinate for the origin of the line
+ * @x1: X coordinate for the end of the line
+ * @y1: Y coordinate for the end of the line
+ *
+ * Renders a line from (x0, y0) to (x1, y1).
+ *
+ * Since: 3.0
+ **/
+void
+gtk_render_line (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x0,
+ gdouble y0,
+ gdouble x1,
+ gdouble y1)
+{
+ GtkStyleContextPrivate *priv;
+ GtkThemingEngineClass *engine_class;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (cr != NULL);
+
+ priv = context->priv;
+ engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
+
+ _gtk_theming_engine_set_context (priv->theming_engine, context);
+ engine_class->render_line (priv->theming_engine, cr, x0, y0, x1, y1);
+}
+
+/**
+ * gtk_render_slider:
+ * @context: a #GtkStyleContext
+ * @cr: a #cairo_t
+ * @x: X origin of the rectangle
+ * @y: Y origin of the rectangle
+ * @width: rectangle width
+ * @height: rectangle height
+ * @orientation: orientation of the slider
+ *
+ * Renders a slider (as in #GtkScale) in the rectangle defined by @x, @y,
+ * @width, @height. @orientation defines whether the slider is vertical
+ * or horizontal.
+ *
+ * <example>
+ * <title>Typical slider rendering</title>
+ * <inlinegraphic fileref="sliders.png" format="PNG"/>
+ * </example>
+ *
+ * Since: 3.0
+ **/
+void
+gtk_render_slider (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height,
+ GtkOrientation orientation)
+{
+ GtkStyleContextPrivate *priv;
+ GtkThemingEngineClass *engine_class;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (cr != NULL);
+
+ priv = context->priv;
+ engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
+
+ store_animation_region (context, x, y, width, height);
+
+ _gtk_theming_engine_set_context (priv->theming_engine, context);
+ engine_class->render_slider (priv->theming_engine, cr, x, y, width, height, orientation);
+}
+
+/**
+ * gtk_render_frame_gap:
+ * @context: a #GtkStyleContext
+ * @cr: a #cairo_t
+ * @x: X origin of the rectangle
+ * @y: Y origin of the rectangle
+ * @width: rectangle width
+ * @height: rectangle height
+ * @gap_side: side where the gap is
+ * @xy0_gap: initial coordinate (X or Y depending on @gap_side) for the gap
+ * @xy1_gap: end coordinate (X or Y depending on @gap_side) for the gap
+ *
+ * Renders a frame around the rectangle defined by (@x, @y, @width, @height),
+ * leaving a gap on one side. @xy0_gap and @xy1_gap will mean X coordinates
+ * for %GTK_POS_TOP and %GTK_POS_BOTTOM gap sides, and Y coordinates for
+ * %GTK_POS_LEFT and %GTK_POS_RIGHT.
+ *
+ * <example>
+ * <title>Typical rendering of a frame with a gap</title>
+ * <inlinegraphic fileref="frame-gap.png" format="PNG"/>
+ * </example>
+ *
+ * Since: 3.0
+ **/
+void
+gtk_render_frame_gap (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height,
+ GtkPositionType gap_side,
+ gdouble xy0_gap,
+ gdouble xy1_gap)
+{
+ GtkStyleContextPrivate *priv;
+ GtkThemingEngineClass *engine_class;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (cr != NULL);
+
+ priv = context->priv;
+ engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
+
+ store_animation_region (context, x, y, width, height);
+
+ _gtk_theming_engine_set_context (priv->theming_engine, context);
+ engine_class->render_frame_gap (priv->theming_engine, cr,
+ x, y, width, height, gap_side,
+ xy0_gap, xy1_gap);
+}
+
+/**
+ * gtk_render_extension:
+ * @context: a #GtkStyleContext
+ * @cr: a #cairo_t
+ * @x: X origin of the rectangle
+ * @y: Y origin of the rectangle
+ * @width: rectangle width
+ * @height: rectangle height
+ * @gap_side: side where the gap is
+ *
+ * Renders a extension (as in a #GtkNotebook tab) in the rectangle
+ * defined by @x, @y, @width, @height. The side where the extension
+ * connects to is defined by @gap_side.
+ *
+ * <example>
+ * <title>Typical extension rendering</title>
+ * <inlinegraphic fileref="extensions.png" format="PNG"/>
+ * </example>
+ *
+ * Since: 3.0
+ **/
+void
+gtk_render_extension (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height,
+ GtkPositionType gap_side)
+{
+ GtkStyleContextPrivate *priv;
+ GtkThemingEngineClass *engine_class;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (cr != NULL);
+
+ priv = context->priv;
+ engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
+
+ store_animation_region (context, x, y, width, height);
+
+ _gtk_theming_engine_set_context (priv->theming_engine, context);
+ engine_class->render_extension (priv->theming_engine, cr, x, y, width, height, gap_side);
+}
+
+/**
+ * gtk_render_handle:
+ * @context: a #GtkStyleContext
+ * @cr: a #cairo_t
+ * @x: X origin of the rectangle
+ * @y: Y origin of the rectangle
+ * @width: rectangle width
+ * @height: rectangle height
+ *
+ * Renders a handle (as in #GtkHandleBox, #GtkPaned and
+ * #GtkWindow<!-- -->'s resize grip), in the rectangle
+ * determined by @x, @y, @width, @height.
+ *
+ * <example>
+ * <title>Handles rendered for the paned and grip classes</title>
+ * <inlinegraphic fileref="handles.png" format="PNG"/>
+ * </example>
+ *
+ * Since: 3.0
+ **/
+void
+gtk_render_handle (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height)
+{
+ GtkStyleContextPrivate *priv;
+ GtkThemingEngineClass *engine_class;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (cr != NULL);
+
+ priv = context->priv;
+ engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
+
+ store_animation_region (context, x, y, width, height);
+
+ _gtk_theming_engine_set_context (priv->theming_engine, context);
+ engine_class->render_handle (priv->theming_engine, cr, x, y, width, height);
+}
+
+/**
+ * gtk_render_activity:
+ * @context: a #GtkStyleContext
+ * @cr: a #cairo_t
+ * @x: X origin of the rectangle
+ * @y: Y origin of the rectangle
+ * @width: rectangle width
+ * @height: rectangle height
+ *
+ * Renders an activity area (Such as in #GtkSpinner or the
+ * fill line in #GtkRange), the state %GTK_STATE_FLAG_ACTIVE
+ * determines whether there is activity going on.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_render_activity (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height)
+{
+ GtkStyleContextPrivate *priv;
+ GtkThemingEngineClass *engine_class;
+
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+ g_return_if_fail (cr != NULL);
+
+ priv = context->priv;
+ engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
+
+ store_animation_region (context, x, y, width, height);
+
+ _gtk_theming_engine_set_context (priv->theming_engine, context);
+ engine_class->render_activity (priv->theming_engine, cr, x, y, width, height);
+}
+
+/**
+ * gtk_render_icon_pixbuf:
+ * @context: a #GtkStyleContext
+ * @source: the #GtkIconSource specifying the icon to render
+ * @size: (type int): the size to render the icon at. A size of (GtkIconSize) -1
+ * means render at the size of the source and don't scale.
+ *
+ * Renders the icon specified by @source at the given @size, returning the result
+ * in a pixbuf.
+ *
+ * Returns: (transfer full): a newly-created #GdkPixbuf containing the rendered icon
+ *
+ * Since: 3.0
+ **/
+GdkPixbuf *
+gtk_render_icon_pixbuf (GtkStyleContext *context,
+ const GtkIconSource *source,
+ GtkIconSize size)
+{
+ GtkStyleContextPrivate *priv;
+ GtkThemingEngineClass *engine_class;
+
+ g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), NULL);
+ g_return_val_if_fail (size == -1 || size <= GTK_ICON_SIZE_DIALOG, NULL);
+ g_return_val_if_fail (source != NULL, NULL);
+
+ priv = context->priv;
+ engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
+
+ _gtk_theming_engine_set_context (priv->theming_engine, context);
+ return engine_class->render_icon_pixbuf (priv->theming_engine, source, size);
+}
diff --git a/gtk/gtkstylecontext.h b/gtk/gtkstylecontext.h
new file mode 100644
index 0000000000..a67e523a83
--- /dev/null
+++ b/gtk/gtkstylecontext.h
@@ -0,0 +1,564 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
+#error "Only <gtk/gtk.h> can be included directly."
+#endif
+
+#ifndef __GTK_STYLE_CONTEXT_H__
+#define __GTK_STYLE_CONTEXT_H__
+
+#include <glib-object.h>
+#include <gtk/gtkstyleprovider.h>
+#include <gtk/gtkwidgetpath.h>
+#include <gtk/gtkborder.h>
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_STYLE_CONTEXT (gtk_style_context_get_type ())
+#define GTK_STYLE_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_STYLE_CONTEXT, GtkStyleContext))
+#define GTK_STYLE_CONTEXT_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GTK_TYPE_STYLE_CONTEXT, GtkStyleContextClass))
+#define GTK_IS_STYLE_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_STYLE_CONTEXT))
+#define GTK_IS_STYLE_CONTEXT_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GTK_TYPE_STYLE_CONTEXT))
+#define GTK_STYLE_CONTEXT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_STYLE_CONTEXT, GtkStyleContextClass))
+
+typedef struct _GtkStyleContext GtkStyleContext;
+typedef struct _GtkStyleContextClass GtkStyleContextClass;
+
+struct _GtkStyleContext
+{
+ GObject parent_object;
+ gpointer priv;
+};
+
+struct _GtkStyleContextClass
+{
+ GObjectClass parent_class;
+
+ void (* changed) (GtkStyleContext *context);
+};
+
+/* Default set of properties that GtkStyleContext may contain */
+
+/**
+ * GTK_STYLE_PROPERTY_BACKGROUND_COLOR:
+ *
+ * A property holding the background color of rendered elements as a #GdkRGBA.
+ */
+#define GTK_STYLE_PROPERTY_BACKGROUND_COLOR "background-color"
+
+/**
+ * GTK_STYLE_PROPERTY_COLOR:
+ *
+ * A property holding the foreground color of rendered elements as a #GdkRGBA.
+ */
+#define GTK_STYLE_PROPERTY_COLOR "color"
+
+/**
+ * GTK_STYLE_PROPERTY_FONT:
+ *
+ * A property holding the font properties used when rendering text
+ * as a #PangoFontDescription.
+ */
+#define GTK_STYLE_PROPERTY_FONT "font"
+
+/**
+ * GTK_STYLE_PROPERTY_MARGIN:
+ *
+ * A property holding the rendered element's margin as a #GtkBorder. The
+ * margin is defined as the spacing between the border of the element
+ * and its surrounding elements.
+ */
+#define GTK_STYLE_PROPERTY_MARGIN "margin"
+
+/**
+ * GTK_STYLE_PROPERTY_PADDING:
+ *
+ * A property holding the rendered element's padding as a #GtkBorder. The
+ * padding is defined as the spacing between the inner part of the element border
+ * and its child.
+ */
+#define GTK_STYLE_PROPERTY_PADDING "padding"
+
+/**
+ * GTK_STYLE_PROPERTY_BORDER_WIDTH:
+ *
+ * A property holding the rendered element's border width in pixels as a #gint.
+ */
+#define GTK_STYLE_PROPERTY_BORDER_WIDTH "border-width"
+
+/**
+ * GTK_STYLE_PROPERTY_BORDER_RADIUS:
+ *
+ * A property holding the rendered element's border radius in pixels as a #gint.
+ */
+#define GTK_STYLE_PROPERTY_BORDER_RADIUS "border-radius"
+
+/**
+ * GTK_STYLE_PROPERTY_BORDER_STYLE:
+ *
+ * A property holding the element's border style as a #GtkBorderStyle.
+ */
+#define GTK_STYLE_PROPERTY_BORDER_STYLE "border-style"
+
+/**
+ * GTK_STYLE_PROPERTY_BORDER_COLOR:
+ *
+ * A property holding the element's border color as a #GdkRGBA.
+ */
+#define GTK_STYLE_PROPERTY_BORDER_COLOR "border-color"
+
+/**
+ * GTK_STYLE_PROPERTY_BACKGROUND_IMAGE:
+ *
+ * A property holding the element's background as a #cairo_pattern_t.
+ */
+#define GTK_STYLE_PROPERTY_BACKGROUND_IMAGE "background-image"
+
+
+/* Predefined set of CSS classes */
+
+/**
+ * GTK_STYLE_CLASS_CELL:
+ *
+ * A CSS class to match content rendered in cell views.
+ */
+#define GTK_STYLE_CLASS_CELL "cell"
+
+/**
+ * GTK_STYLE_CLASS_ENTRY:
+ *
+ * A CSS class to match text entries.
+ */
+#define GTK_STYLE_CLASS_ENTRY "entry"
+
+/**
+ * GTK_STYLE_CLASS_BUTTON:
+ *
+ * A CSS class to match buttons.
+ */
+#define GTK_STYLE_CLASS_BUTTON "button"
+
+/**
+ * GTK_STYLE_CLASS_CALENDAR:
+ *
+ * A CSS class to match calendars.
+ */
+#define GTK_STYLE_CLASS_CALENDAR "calendar"
+
+/**
+ * GTK_STYLE_CLASS_SLIDER:
+ *
+ * A CSS class to match sliders.
+ */
+#define GTK_STYLE_CLASS_SLIDER "slider"
+
+/**
+ * GTK_STYLE_CLASS_BACKGROUND:
+ *
+ * A CSS class to match the window background.
+ */
+#define GTK_STYLE_CLASS_BACKGROUND "background"
+
+/**
+ * GTK_STYLE_CLASS_RUBBERBAND:
+ *
+ * A CSS class to match the rubberband selection rectangle.
+ */
+#define GTK_STYLE_CLASS_RUBBERBAND "rubberband"
+
+/**
+ * GTK_STYLE_CLASS_TOOLTIP:
+ *
+ * A CSS class to match tooltip windows.
+ */
+#define GTK_STYLE_CLASS_TOOLTIP "tooltip"
+
+/**
+ * GTK_STYLE_CLASS_MENU:
+ *
+ * A CSS class to match popup menus.
+ */
+#define GTK_STYLE_CLASS_MENU "menu"
+
+/**
+ * GTK_STYLE_CLASS_MENUBAR:
+ *
+ * A CSS class to menubars.
+ */
+#define GTK_STYLE_CLASS_MENUBAR "menubar"
+
+/**
+ * GTK_STYLE_CLASS_MENUITEM:
+ *
+ * A CSS class to match menu items.
+ */
+#define GTK_STYLE_CLASS_MENUITEM "menuitem"
+
+/**
+ * GTK_STYLE_CLASS_TOOLBAR:
+ *
+ * A CSS class to match toolbars.
+ */
+#define GTK_STYLE_CLASS_TOOLBAR "toolbar"
+
+/**
+ * GTK_STYLE_CLASS_RADIO:
+ *
+ * A CSS class to match radio buttons.
+ */
+#define GTK_STYLE_CLASS_RADIO "radio"
+
+/**
+ * GTK_STYLE_CLASS_CHECK:
+ *
+ * A CSS class to match check boxes.
+ */
+#define GTK_STYLE_CLASS_CHECK "check"
+
+/**
+ * GTK_STYLE_CLASS_DEFAULT:
+ *
+ * A CSS class to match the default widget.
+ */
+#define GTK_STYLE_CLASS_DEFAULT "default"
+
+/**
+ * GTK_STYLE_CLASS_TROUGH:
+ *
+ * A CSS class to match troughs, as in scrollbars and progressbars.
+ */
+#define GTK_STYLE_CLASS_TROUGH "trough"
+
+/**
+ * GTK_STYLE_CLASS_SCROLLBAR:
+ *
+ * A CSS class to match scrollbars.
+ */
+#define GTK_STYLE_CLASS_SCROLLBAR "scrollbar"
+
+/**
+ * GTK_STYLE_CLASS_HEADER:
+ *
+ * A CSS class to match a header element.
+ */
+#define GTK_STYLE_CLASS_HEADER "header"
+
+/**
+ * GTK_STYLE_CLASS_ACCELERATOR:
+ *
+ * A CSS class to match an accelerator.
+ */
+#define GTK_STYLE_CLASS_ACCELERATOR "accelerator"
+
+/**
+ * GTK_STYLE_CLASS_GRIP:
+ *
+ * A widget class defining a resize grip
+ */
+#define GTK_STYLE_CLASS_GRIP "grip"
+
+/**
+ * GTK_STYLE_CLASS_DOCK:
+ *
+ * A widget class defining a dock area
+ */
+#define GTK_STYLE_CLASS_DOCK "dock"
+
+/**
+ * GTK_STYLE_CLASS_PROGRESSBAR:
+ *
+ * A widget class defining a resize grip
+ */
+#define GTK_STYLE_CLASS_PROGRESSBAR "progressbar"
+
+/**
+ * GTK_STYLE_CLASS_SPINNER:
+ *
+ * A widget class defining a spinner
+ */
+#define GTK_STYLE_CLASS_SPINNER "spinner"
+
+/* Predefined set of widget regions */
+
+/**
+ * GTK_STYLE_REGION_ROW:
+ *
+ * A widget region name to define a treeview row.
+ */
+#define GTK_STYLE_REGION_ROW "row"
+
+/**
+ * GTK_STYLE_REGION_COLUMN:
+ *
+ * A widget region name to define a treeview column.
+ */
+#define GTK_STYLE_REGION_COLUMN "column"
+
+/**
+ * GTK_STYLE_REGION_COLUMN_HEADER:
+ *
+ * A widget region name to define a treeview column header.
+ */
+#define GTK_STYLE_REGION_COLUMN_HEADER "column-header"
+
+/**
+ * GTK_STYLE_REGION_TAB:
+ *
+ * A widget region name to define a notebook tab.
+ */
+#define GTK_STYLE_REGION_TAB "tab"
+
+
+GType gtk_style_context_get_type (void) G_GNUC_CONST;
+
+GtkStyleContext * gtk_style_context_new (void);
+
+void gtk_style_context_add_provider_for_screen (GdkScreen *screen,
+ GtkStyleProvider *provider,
+ guint priority);
+void gtk_style_context_remove_provider_for_screen (GdkScreen *screen,
+ GtkStyleProvider *provider);
+
+void gtk_style_context_add_provider (GtkStyleContext *context,
+ GtkStyleProvider *provider,
+ guint priority);
+
+void gtk_style_context_remove_provider (GtkStyleContext *context,
+ GtkStyleProvider *provider);
+
+void gtk_style_context_save (GtkStyleContext *context);
+void gtk_style_context_restore (GtkStyleContext *context);
+
+void gtk_style_context_get_property (GtkStyleContext *context,
+ const gchar *property,
+ GtkStateFlags state,
+ GValue *value);
+void gtk_style_context_get_valist (GtkStyleContext *context,
+ GtkStateFlags state,
+ va_list args);
+void gtk_style_context_get (GtkStyleContext *context,
+ GtkStateFlags state,
+ ...) G_GNUC_NULL_TERMINATED;
+
+void gtk_style_context_set_state (GtkStyleContext *context,
+ GtkStateFlags flags);
+GtkStateFlags gtk_style_context_get_state (GtkStyleContext *context);
+
+gboolean gtk_style_context_state_is_running (GtkStyleContext *context,
+ GtkStateType state,
+ gdouble *progress);
+
+void gtk_style_context_set_path (GtkStyleContext *context,
+ GtkWidgetPath *path);
+G_CONST_RETURN GtkWidgetPath * gtk_style_context_get_path (GtkStyleContext *context);
+
+GList * gtk_style_context_list_classes (GtkStyleContext *context);
+
+void gtk_style_context_add_class (GtkStyleContext *context,
+ const gchar *class_name);
+void gtk_style_context_remove_class (GtkStyleContext *context,
+ const gchar *class_name);
+gboolean gtk_style_context_has_class (GtkStyleContext *context,
+ const gchar *class_name);
+
+GList * gtk_style_context_list_regions (GtkStyleContext *context);
+
+void gtk_style_context_add_region (GtkStyleContext *context,
+ const gchar *region_name,
+ GtkRegionFlags flags);
+void gtk_style_context_remove_region (GtkStyleContext *context,
+ const gchar *region_name);
+gboolean gtk_style_context_has_region (GtkStyleContext *context,
+ const gchar *region_name,
+ GtkRegionFlags *flags_return);
+
+void gtk_style_context_get_style_property (GtkStyleContext *context,
+ const gchar *property_name,
+ GValue *value);
+void gtk_style_context_get_style_valist (GtkStyleContext *context,
+ va_list args);
+void gtk_style_context_get_style (GtkStyleContext *context,
+ ...);
+
+GtkIconSet * gtk_style_context_lookup_icon_set (GtkStyleContext *context,
+ const gchar *stock_id);
+GdkPixbuf * gtk_icon_set_render_icon_pixbuf (GtkIconSet *icon_set,
+ GtkStyleContext *context,
+ GtkIconSize size);
+
+void gtk_style_context_set_screen (GtkStyleContext *context,
+ GdkScreen *screen);
+GdkScreen * gtk_style_context_get_screen (GtkStyleContext *context);
+
+void gtk_style_context_set_direction (GtkStyleContext *context,
+ GtkTextDirection direction);
+GtkTextDirection gtk_style_context_get_direction (GtkStyleContext *context);
+
+void gtk_style_context_set_junction_sides (GtkStyleContext *context,
+ GtkJunctionSides sides);
+GtkJunctionSides gtk_style_context_get_junction_sides (GtkStyleContext *context);
+
+gboolean gtk_style_context_lookup_color (GtkStyleContext *context,
+ const gchar *color_name,
+ GdkRGBA *color);
+
+void gtk_style_context_notify_state_change (GtkStyleContext *context,
+ GdkWindow *window,
+ gpointer region_id,
+ GtkStateType state,
+ gboolean state_value);
+void gtk_style_context_push_animatable_region (GtkStyleContext *context,
+ gpointer region_id);
+void gtk_style_context_pop_animatable_region (GtkStyleContext *context);
+
+/* Some helper functions to retrieve most common properties */
+void gtk_style_context_get_color (GtkStyleContext *context,
+ GtkStateFlags state,
+ GdkRGBA *color);
+void gtk_style_context_get_background_color (GtkStyleContext *context,
+ GtkStateFlags state,
+ GdkRGBA *color);
+void gtk_style_context_get_border_color (GtkStyleContext *context,
+ GtkStateFlags state,
+ GdkRGBA *color);
+
+void gtk_style_context_get_border (GtkStyleContext *context,
+ GtkStateFlags state,
+ GtkBorder *border);
+void gtk_style_context_get_padding (GtkStyleContext *context,
+ GtkStateFlags state,
+ GtkBorder *padding);
+void gtk_style_context_get_margin (GtkStyleContext *context,
+ GtkStateFlags state,
+ GtkBorder *margin);
+
+/* Semi-private API */
+const GValue * _gtk_style_context_peek_style_property (GtkStyleContext *context,
+ GType widget_type,
+ GtkStateFlags state,
+ GParamSpec *pspec);
+void _gtk_style_context_invalidate_animation_areas (GtkStyleContext *context);
+void _gtk_style_context_coalesce_animation_areas (GtkStyleContext *context,
+ gint rel_x,
+ gint rel_y);
+
+void gtk_style_context_invalidate (GtkStyleContext *context);
+void gtk_style_context_reset_widgets (GdkScreen *screen);
+
+void gtk_style_context_set_background (GtkStyleContext *context,
+ GdkWindow *window);
+
+/* Paint methods */
+void gtk_render_check (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height);
+void gtk_render_option (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height);
+void gtk_render_arrow (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble angle,
+ gdouble x,
+ gdouble y,
+ gdouble size);
+void gtk_render_background (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height);
+void gtk_render_frame (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height);
+void gtk_render_expander (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height);
+void gtk_render_focus (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height);
+void gtk_render_layout (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ PangoLayout *layout);
+void gtk_render_line (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x0,
+ gdouble y0,
+ gdouble x1,
+ gdouble y1);
+void gtk_render_slider (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height,
+ GtkOrientation orientation);
+void gtk_render_frame_gap (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height,
+ GtkPositionType gap_side,
+ gdouble xy0_gap,
+ gdouble xy1_gap);
+void gtk_render_extension (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height,
+ GtkPositionType gap_side);
+void gtk_render_handle (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height);
+void gtk_render_activity (GtkStyleContext *context,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height);
+
+GdkPixbuf * gtk_render_icon_pixbuf (GtkStyleContext *context,
+ const GtkIconSource *source,
+ GtkIconSize size);
+
+G_END_DECLS
+
+#endif /* __GTK_STYLE_CONTEXT_H__ */
diff --git a/gtk/gtkstyleproperties.c b/gtk/gtkstyleproperties.c
new file mode 100644
index 0000000000..c6592740fc
--- /dev/null
+++ b/gtk/gtkstyleproperties.c
@@ -0,0 +1,1226 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include "gtkstyleproperties.h"
+
+#include <stdlib.h>
+#include <gobject/gvaluecollector.h>
+#include <cairo-gobject.h>
+
+#include "gtktypebuiltins.h"
+#include "gtkstyleprovider.h"
+#include "gtksymboliccolor.h"
+#include "gtkprivate.h"
+#include "gtkthemingengine.h"
+#include "gtkanimationdescription.h"
+#include "gtkborder.h"
+#include "gtkgradient.h"
+#include "gtk9slice.h"
+#include "gtkintl.h"
+
+/**
+ * SECTION:gtkstyleproperties
+ * @Short_description: Store for style property information
+ * @Title: GtkStyleProperties
+ *
+ * GtkStyleProperties provides the storage for style information
+ * that is used by #GtkStyleContext and other #GtkStyleProvider
+ * implementations.
+ *
+ * Before style properties can be stored in GtkStyleProperties, they
+ * must be registered with gtk_style_properties_register_property().
+ *
+ * Unless you are writing a #GtkStyleProvider implementation, you
+ * are unlikely to use this API directly, as gtk_style_context_get()
+ * and its variants are the preferred way to access styling information
+ * from widget implementations and theming engine implementations
+ * should use the APIs provided by #GtkThemingEngine instead.
+ */
+
+typedef struct GtkStylePropertiesPrivate GtkStylePropertiesPrivate;
+typedef struct PropertyData PropertyData;
+typedef struct PropertyNode PropertyNode;
+typedef struct ValueData ValueData;
+
+struct PropertyNode
+{
+ GQuark property_quark;
+ GParamSpec *pspec;
+ GtkStylePropertyParser parse_func;
+};
+
+struct ValueData
+{
+ GtkStateFlags state;
+ GValue value;
+};
+
+struct PropertyData
+{
+ GArray *values;
+};
+
+struct GtkStylePropertiesPrivate
+{
+ GHashTable *color_map;
+ GHashTable *properties;
+};
+
+static GArray *properties = NULL;
+
+static void gtk_style_properties_provider_init (GtkStyleProviderIface *iface);
+static void gtk_style_properties_finalize (GObject *object);
+
+
+G_DEFINE_TYPE_EXTENDED (GtkStyleProperties, gtk_style_properties, G_TYPE_OBJECT, 0,
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_STYLE_PROVIDER,
+ gtk_style_properties_provider_init));
+
+static void
+gtk_style_properties_class_init (GtkStylePropertiesClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->finalize = gtk_style_properties_finalize;
+
+ /* Initialize default property set */
+ gtk_style_properties_register_property (NULL,
+ g_param_spec_boxed ("color",
+ "Foreground color",
+ "Foreground color",
+ GDK_TYPE_RGBA, 0));
+ gtk_style_properties_register_property (NULL,
+ g_param_spec_boxed ("background-color",
+ "Background color",
+ "Background color",
+ GDK_TYPE_RGBA, 0));
+
+ gtk_style_properties_register_property (NULL,
+ g_param_spec_boxed ("font",
+ "Font Description",
+ "Font Description",
+ PANGO_TYPE_FONT_DESCRIPTION, 0));
+
+ gtk_style_properties_register_property (NULL,
+ g_param_spec_boxed ("margin",
+ "Margin",
+ "Margin",
+ GTK_TYPE_BORDER, 0));
+ gtk_style_properties_register_property (NULL,
+ g_param_spec_boxed ("padding",
+ "Padding",
+ "Padding",
+ GTK_TYPE_BORDER, 0));
+ gtk_style_properties_register_property (NULL,
+ g_param_spec_boxed ("border-width",
+ "Border width",
+ "Border width, in pixels",
+ GTK_TYPE_BORDER, 0));
+ gtk_style_properties_register_property (NULL,
+ g_param_spec_int ("border-radius",
+ "Border radius",
+ "Border radius, in pixels",
+ 0, G_MAXINT, 0, 0));
+ gtk_style_properties_register_property (NULL,
+ g_param_spec_enum ("border-style",
+ "Border style",
+ "Border style",
+ GTK_TYPE_BORDER_STYLE,
+ GTK_BORDER_STYLE_NONE, 0));
+ gtk_style_properties_register_property (NULL,
+ g_param_spec_boxed ("border-color",
+ "Border color",
+ "Border color",
+ GDK_TYPE_RGBA, 0));
+ gtk_style_properties_register_property (NULL,
+ g_param_spec_boxed ("background-image",
+ "Background Image",
+ "Background Image",
+ CAIRO_GOBJECT_TYPE_PATTERN, 0));
+ gtk_style_properties_register_property (NULL,
+ g_param_spec_boxed ("border-image",
+ "Border Image",
+ "Border Image",
+ GTK_TYPE_9SLICE, 0));
+ gtk_style_properties_register_property (NULL,
+ g_param_spec_object ("engine",
+ "Theming Engine",
+ "Theming Engine",
+ GTK_TYPE_THEMING_ENGINE, 0));
+ gtk_style_properties_register_property (NULL,
+ g_param_spec_boxed ("transition",
+ "Transition animation description",
+ "Transition animation description",
+ GTK_TYPE_ANIMATION_DESCRIPTION, 0));
+
+ g_type_class_add_private (object_class, sizeof (GtkStylePropertiesPrivate));
+}
+
+static PropertyData *
+property_data_new (void)
+{
+ PropertyData *data;
+
+ data = g_slice_new0 (PropertyData);
+ data->values = g_array_new (FALSE, FALSE, sizeof (ValueData));
+
+ return data;
+}
+
+static void
+property_data_free (PropertyData *data)
+{
+ guint i;
+
+ for (i = 0; i < data->values->len; i++)
+ {
+ ValueData *value_data;
+
+ value_data = &g_array_index (data->values, ValueData, i);
+
+ if (G_IS_VALUE (&value_data->value))
+ g_value_unset (&value_data->value);
+ }
+
+ g_array_free (data->values, TRUE);
+ g_slice_free (PropertyData, data);
+}
+
+static gboolean
+property_data_find_position (PropertyData *data,
+ GtkStateFlags state,
+ guint *pos)
+{
+ gint min, max, mid;
+ gboolean found = FALSE;
+ guint position;
+
+ if (pos)
+ *pos = 0;
+
+ if (data->values->len == 0)
+ return FALSE;
+
+ /* Find position for the given state, or the position where
+ * it would be if not found, the array is ordered by the
+ * state flags.
+ */
+ min = 0;
+ max = data->values->len - 1;
+
+ do
+ {
+ ValueData *value_data;
+
+ mid = (min + max) / 2;
+ value_data = &g_array_index (data->values, ValueData, mid);
+
+ if (value_data->state == state)
+ {
+ found = TRUE;
+ position = mid;
+ }
+ else if (value_data->state < state)
+ position = min = mid + 1;
+ else
+ {
+ max = mid - 1;
+ position = mid;
+ }
+ }
+ while (!found && min <= max);
+
+ if (pos)
+ *pos = position;
+
+ return found;
+}
+
+static GValue *
+property_data_get_value (PropertyData *data,
+ GtkStateFlags state)
+{
+ ValueData *val_data;
+ guint pos;
+
+ if (!property_data_find_position (data, state, &pos))
+ {
+ ValueData new = { 0 };
+
+ new.state = state;
+ g_array_insert_val (data->values, pos, new);
+ }
+
+ val_data = &g_array_index (data->values, ValueData, pos);
+
+ return &val_data->value;
+}
+
+static GValue *
+property_data_match_state (PropertyData *data,
+ GtkStateFlags state)
+{
+ guint pos;
+ gint i;
+
+ if (property_data_find_position (data, state, &pos))
+ {
+ ValueData *val_data;
+
+ /* Exact match */
+ val_data = &g_array_index (data->values, ValueData, pos);
+ return &val_data->value;
+ }
+
+ if (pos >= data->values->len)
+ pos = data->values->len - 1;
+
+ /* No exact match, go downwards the list to find
+ * the closest match to the given state flags, as
+ * a side effect, there is an implicit precedence
+ * of higher flags over the smaller ones.
+ */
+ for (i = pos; i >= 0; i--)
+ {
+ ValueData *val_data;
+
+ val_data = &g_array_index (data->values, ValueData, i);
+
+ /* Check whether any of the requested
+ * flags are set, and no other flags are.
+ *
+ * Also, no flags acts as a wildcard, such
+ * value should be always in the first position
+ * in the array (if present) anyways.
+ */
+ if (val_data->state == 0 ||
+ ((val_data->state & state) != 0 &&
+ (val_data->state & ~state) == 0))
+ return &val_data->value;
+ }
+
+ return NULL;
+}
+
+static void
+gtk_style_properties_init (GtkStyleProperties *props)
+{
+ GtkStylePropertiesPrivate *priv;
+
+ priv = props->priv = G_TYPE_INSTANCE_GET_PRIVATE (props,
+ GTK_TYPE_STYLE_PROPERTIES,
+ GtkStylePropertiesPrivate);
+
+ priv->properties = g_hash_table_new_full (NULL, NULL, NULL,
+ (GDestroyNotify) property_data_free);
+}
+
+static void
+gtk_style_properties_finalize (GObject *object)
+{
+ GtkStylePropertiesPrivate *priv;
+ GtkStyleProperties *props;
+
+ props = GTK_STYLE_PROPERTIES (object);
+ priv = props->priv;
+ g_hash_table_destroy (priv->properties);
+
+ if (priv->color_map)
+ g_hash_table_destroy (priv->color_map);
+
+ G_OBJECT_CLASS (gtk_style_properties_parent_class)->finalize (object);
+}
+
+GtkStyleProperties *
+gtk_style_properties_get_style (GtkStyleProvider *provider,
+ GtkWidgetPath *path)
+{
+ /* Return style set itself */
+ return g_object_ref (provider);
+}
+
+static void
+gtk_style_properties_provider_init (GtkStyleProviderIface *iface)
+{
+ iface->get_style = gtk_style_properties_get_style;
+}
+
+static int
+compare_property (gconstpointer p1,
+ gconstpointer p2)
+{
+ PropertyNode *key = (PropertyNode *) p1;
+ PropertyNode *node = (PropertyNode *) p2;
+
+ if (key->property_quark > node->property_quark)
+ return 1;
+ else if (key->property_quark < node->property_quark)
+ return -1;
+
+ return 0;
+}
+
+static PropertyNode *
+property_node_lookup (GQuark quark)
+{
+ PropertyNode key = { 0 };
+
+ if (!quark)
+ return NULL;
+
+ if (!properties)
+ return NULL;
+
+ key.property_quark = quark;
+
+ return bsearch (&key, properties->data, properties->len,
+ sizeof (PropertyNode), compare_property);
+}
+
+/* Property registration functions */
+
+/**
+ * gtk_style_properties_register_property:
+ * @parse_func: parsing function to use, or %NULL
+ * @pspec: the #GParamSpec for the new property
+ *
+ * Registers a property so it can be used in the CSS file format.
+ * This function is the low-level equivalent of
+ * gtk_theming_engine_register_property(), if you are implementing
+ * a theming engine, you want to use that function instead.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_properties_register_property (GtkStylePropertyParser parse_func,
+ GParamSpec *pspec)
+{
+ PropertyNode *node, new = { 0 };
+ GQuark quark;
+ gint i;
+
+ g_return_if_fail (G_IS_PARAM_SPEC (pspec));
+
+ if (G_UNLIKELY (!properties))
+ properties = g_array_new (FALSE, TRUE, sizeof (PropertyNode));
+
+ quark = g_quark_from_string (pspec->name);
+
+ if ((node = property_node_lookup (quark)) != NULL)
+ {
+ g_warning ("Property \"%s\" was already registered with type %s",
+ pspec->name, g_type_name (node->pspec->value_type));
+ return;
+ }
+
+ new.property_quark = quark;
+ new.pspec = pspec;
+
+ if (parse_func)
+ new.parse_func = parse_func;
+
+ for (i = 0; i < properties->len; i++)
+ {
+ node = &g_array_index (properties, PropertyNode, i);
+
+ if (node->property_quark > quark)
+ break;
+ }
+
+ g_array_insert_val (properties, i, new);
+}
+
+/**
+ * gtk_style_properties_lookup_property:
+ * @property_name: property name to look up
+ * @parse_func: (out): return location for the parse function
+ * @pspec: (out): return location for the #GParamSpec
+ *
+ * Returns %TRUE if a property has been registered, if @pspec or
+ * @parse_func are not %NULL, the #GParamSpec and parsing function
+ * will be respectively returned.
+ *
+ * Returns: %TRUE if the property is registered, %FALSE otherwise
+ *
+ * Since: 3.0
+ **/
+gboolean
+gtk_style_properties_lookup_property (const gchar *property_name,
+ GtkStylePropertyParser *parse_func,
+ GParamSpec **pspec)
+{
+ PropertyNode *node;
+ GtkStylePropertiesClass *klass;
+ gboolean found = FALSE;
+ GQuark quark;
+ gint i;
+
+ g_return_val_if_fail (property_name != NULL, FALSE);
+
+ klass = g_type_class_ref (GTK_TYPE_STYLE_PROPERTIES);
+ quark = g_quark_try_string (property_name);
+
+ if (quark == 0)
+ {
+ g_type_class_unref (klass);
+ return FALSE;
+ }
+
+ for (i = 0; i < properties->len; i++)
+ {
+ node = &g_array_index (properties, PropertyNode, i);
+
+ if (node->property_quark == quark)
+ {
+ if (pspec)
+ *pspec = node->pspec;
+
+ if (parse_func)
+ *parse_func = node->parse_func;
+
+ found = TRUE;
+ break;
+ }
+ else if (node->property_quark > quark)
+ break;
+ }
+
+ g_type_class_unref (klass);
+
+ return found;
+}
+
+/* GtkStyleProperties methods */
+
+/**
+ * gtk_style_properties_new:
+ *
+ * Returns a newly created #GtkStyleProperties
+ *
+ * Returns: a new #GtkStyleProperties
+ **/
+GtkStyleProperties *
+gtk_style_properties_new (void)
+{
+ return g_object_new (GTK_TYPE_STYLE_PROPERTIES, NULL);
+}
+
+/**
+ * gtk_style_properties_map_color:
+ * @props: a #GtkStyleProperties
+ * @name: color name
+ * @color: #GtkSymbolicColor to map @name to
+ *
+ * Maps @color so it can be referenced by @name. See
+ * gtk_style_properties_lookup_color()
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_properties_map_color (GtkStyleProperties *props,
+ const gchar *name,
+ GtkSymbolicColor *color)
+{
+ GtkStylePropertiesPrivate *priv;
+
+ g_return_if_fail (GTK_IS_STYLE_PROPERTIES (props));
+ g_return_if_fail (name != NULL);
+ g_return_if_fail (color != NULL);
+
+ priv = props->priv;
+
+ if (G_UNLIKELY (!priv->color_map))
+ priv->color_map = g_hash_table_new_full (g_str_hash,
+ g_str_equal,
+ (GDestroyNotify) g_free,
+ (GDestroyNotify) gtk_symbolic_color_unref);
+
+ g_hash_table_replace (priv->color_map,
+ g_strdup (name),
+ gtk_symbolic_color_ref (color));
+}
+
+/**
+ * gtk_style_properties_lookup_color:
+ * @props: a #GtkStyleProperties
+ * @name: color name to lookup
+ *
+ * Returns the symbolic color that is mapped
+ * to @name.
+ *
+ * Returns: The mapped color
+ *
+ * Since: 3.0
+ **/
+GtkSymbolicColor *
+gtk_style_properties_lookup_color (GtkStyleProperties *props,
+ const gchar *name)
+{
+ GtkStylePropertiesPrivate *priv;
+
+ g_return_val_if_fail (GTK_IS_STYLE_PROPERTIES (props), NULL);
+ g_return_val_if_fail (name != NULL, NULL);
+
+ priv = props->priv;
+
+ if (!priv->color_map)
+ return NULL;
+
+ return g_hash_table_lookup (priv->color_map, name);
+}
+
+/**
+ * gtk_style_properties_set_property:
+ * @props: a #GtkStyleProperties
+ * @property: styling property to set
+ * @state: state to set the value for
+ * @value: new value for the property
+ *
+ * Sets a styling property in @props.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_properties_set_property (GtkStyleProperties *props,
+ const gchar *property,
+ GtkStateFlags state,
+ const GValue *value)
+{
+ GtkStylePropertiesPrivate *priv;
+ PropertyNode *node;
+ PropertyData *prop;
+ GType value_type;
+ GValue *val;
+
+ g_return_if_fail (GTK_IS_STYLE_PROPERTIES (props));
+ g_return_if_fail (property != NULL);
+ g_return_if_fail (value != NULL);
+
+ value_type = G_VALUE_TYPE (value);
+ node = property_node_lookup (g_quark_try_string (property));
+
+ if (!node)
+ {
+ g_warning ("Style property \"%s\" is not registered", property);
+ return;
+ }
+
+ if (node->pspec->value_type == GDK_TYPE_RGBA ||
+ node->pspec->value_type == GDK_TYPE_COLOR)
+ {
+ /* Allow GtkSymbolicColor as well */
+ g_return_if_fail (value_type == GDK_TYPE_RGBA ||
+ value_type == GDK_TYPE_COLOR ||
+ value_type == GTK_TYPE_SYMBOLIC_COLOR);
+ }
+ else if (node->pspec->value_type == CAIRO_GOBJECT_TYPE_PATTERN)
+ {
+ /* Allow GtkGradient as a substitute */
+ g_return_if_fail (value_type == CAIRO_GOBJECT_TYPE_PATTERN ||
+ value_type == GTK_TYPE_GRADIENT);
+ }
+ else
+ g_return_if_fail (node->pspec->value_type == value_type);
+
+ priv = props->priv;
+ prop = g_hash_table_lookup (priv->properties,
+ GINT_TO_POINTER (node->property_quark));
+
+ if (!prop)
+ {
+ prop = property_data_new ();
+ g_hash_table_insert (priv->properties,
+ GINT_TO_POINTER (node->property_quark),
+ prop);
+ }
+
+ val = property_data_get_value (prop, state);
+
+ if (G_VALUE_TYPE (val) == value_type)
+ g_value_reset (val);
+ else
+ {
+ if (G_IS_VALUE (val))
+ g_value_unset (val);
+
+ g_value_init (val, value_type);
+ }
+
+ g_value_copy (value, val);
+}
+
+/**
+ * gtk_style_properties_set_valist:
+ * @props: a #GtkStyleProperties
+ * @state: state to set the values for
+ * @args: va_list of property name/value pairs, followed by %NULL
+ *
+ * Sets several style properties on @props.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_properties_set_valist (GtkStyleProperties *props,
+ GtkStateFlags state,
+ va_list args)
+{
+ GtkStylePropertiesPrivate *priv;
+ const gchar *property_name;
+
+ g_return_if_fail (GTK_IS_STYLE_PROPERTIES (props));
+
+ priv = props->priv;
+ property_name = va_arg (args, const gchar *);
+
+ while (property_name)
+ {
+ PropertyNode *node;
+ PropertyData *prop;
+ gchar *error = NULL;
+ GValue *val;
+
+ node = property_node_lookup (g_quark_try_string (property_name));
+
+ if (!node)
+ {
+ g_warning ("Style property \"%s\" is not registered", property_name);
+ break;
+ }
+
+ prop = g_hash_table_lookup (priv->properties,
+ GINT_TO_POINTER (node->property_quark));
+
+ if (!prop)
+ {
+ prop = property_data_new ();
+ g_hash_table_insert (priv->properties,
+ GINT_TO_POINTER (node->property_quark),
+ prop);
+ }
+
+ val = property_data_get_value (prop, state);
+
+ if (G_IS_VALUE (val))
+ g_value_unset (val);
+
+ g_value_init (val, node->pspec->value_type);
+ G_VALUE_COLLECT (val, args, 0, &error);
+
+ if (error)
+ {
+ g_warning ("Could not set style property \"%s\": %s", property_name, error);
+ g_value_unset (val);
+ g_free (error);
+ break;
+ }
+
+ property_name = va_arg (args, const gchar *);
+ }
+}
+
+/**
+ * gtk_style_properties_set:
+ * @props: a #GtkStyleProperties
+ * @state: state to set the values for
+ * @...: property name/value pairs, followed by %NULL
+ *
+ * Sets several style properties on @props.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_properties_set (GtkStyleProperties *props,
+ GtkStateFlags state,
+ ...)
+{
+ va_list args;
+
+ g_return_if_fail (GTK_IS_STYLE_PROPERTIES (props));
+
+ va_start (args, state);
+ gtk_style_properties_set_valist (props, state, args);
+ va_end (args);
+}
+
+static gboolean
+resolve_color (GtkStyleProperties *props,
+ GValue *value)
+{
+ GdkRGBA color;
+
+ /* Resolve symbolic color to GdkRGBA */
+ if (!gtk_symbolic_color_resolve (g_value_get_boxed (value), props, &color))
+ return FALSE;
+
+ /* Store it back, this is where GdkRGBA caching happens */
+ g_value_unset (value);
+ g_value_init (value, GDK_TYPE_RGBA);
+ g_value_set_boxed (value, &color);
+
+ return TRUE;
+}
+
+static gboolean
+resolve_color_rgb (GtkStyleProperties *props,
+ GValue *value)
+{
+ GdkColor color = { 0 };
+ GdkRGBA rgba;
+
+ if (!gtk_symbolic_color_resolve (g_value_get_boxed (value), props, &rgba))
+ return FALSE;
+
+ color.red = rgba.red * 65535. + 0.5;
+ color.green = rgba.green * 65535. + 0.5;
+ color.blue = rgba.blue * 65535. + 0.5;
+
+ g_value_unset (value);
+ g_value_init (value, GDK_TYPE_COLOR);
+ g_value_set_boxed (value, &color);
+
+ return TRUE;
+}
+
+static gboolean
+resolve_gradient (GtkStyleProperties *props,
+ GValue *value)
+{
+ cairo_pattern_t *gradient;
+
+ if (!gtk_gradient_resolve (g_value_get_boxed (value), props, &gradient))
+ return FALSE;
+
+ /* Store it back, this is where cairo_pattern_t caching happens */
+ g_value_unset (value);
+ g_value_init (value, CAIRO_GOBJECT_TYPE_PATTERN);
+ g_value_take_boxed (value, gradient);
+
+ return TRUE;
+}
+
+static gboolean
+style_properties_resolve_type (GtkStyleProperties *props,
+ PropertyNode *node,
+ GValue *val)
+{
+ if (val && G_VALUE_TYPE (val) == GTK_TYPE_SYMBOLIC_COLOR)
+ {
+ if (node->pspec->value_type == GDK_TYPE_RGBA)
+ {
+ if (!resolve_color (props, val))
+ return FALSE;
+ }
+ else if (node->pspec->value_type == GDK_TYPE_COLOR)
+ {
+ if (!resolve_color_rgb (props, val))
+ return FALSE;
+ }
+ else
+ return FALSE;
+ }
+ else if (val && G_VALUE_TYPE (val) == GTK_TYPE_GRADIENT)
+ {
+ g_return_val_if_fail (node->pspec->value_type == CAIRO_GOBJECT_TYPE_PATTERN, FALSE);
+
+ if (!resolve_gradient (props, val))
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static void
+lookup_default_value (PropertyNode *node,
+ GValue *value)
+{
+ if (node->pspec->value_type == GTK_TYPE_THEMING_ENGINE)
+ g_value_set_object (value, gtk_theming_engine_load (NULL));
+ else
+ g_param_value_set_default (node->pspec, value);
+}
+
+const GValue *
+_gtk_style_properties_peek_property (GtkStyleProperties *props,
+ const gchar *prop_name,
+ GtkStateFlags state)
+{
+ GtkStylePropertiesPrivate *priv;
+ PropertyNode *node;
+ PropertyData *prop;
+ GValue *val;
+
+ g_return_val_if_fail (GTK_IS_STYLE_PROPERTIES (props), NULL);
+ g_return_val_if_fail (prop_name != NULL, NULL);
+
+ node = property_node_lookup (g_quark_try_string (prop_name));
+
+ if (!node)
+ {
+ g_warning ("Style property \"%s\" is not registered", prop_name);
+ return NULL;
+ }
+
+ priv = props->priv;
+ prop = g_hash_table_lookup (priv->properties,
+ GINT_TO_POINTER (node->property_quark));
+
+ if (!prop)
+ return NULL;
+
+ val = property_data_match_state (prop, state);
+
+ if (val &&
+ !style_properties_resolve_type (props, node, val))
+ return NULL;
+
+ return val;
+}
+
+/**
+ * gtk_style_properties_get_property:
+ * @props: a #GtkStyleProperties
+ * @property: style property name
+ * @state: state to retrieve the property value for
+ * @value: (out) (transfer full): return location for the style property value.
+ *
+ * Gets a style property from @props for the given state. When done with @value,
+ * g_value_unset() needs to be called to free any allocated memory.
+ *
+ * Returns: %TRUE if the property exists in @props, %FALSE otherwise
+ *
+ * Since: 3.0
+ **/
+gboolean
+gtk_style_properties_get_property (GtkStyleProperties *props,
+ const gchar *property,
+ GtkStateFlags state,
+ GValue *value)
+{
+ GtkStylePropertiesPrivate *priv;
+ PropertyNode *node;
+ PropertyData *prop;
+ GValue *val;
+
+ g_return_val_if_fail (GTK_IS_STYLE_PROPERTIES (props), FALSE);
+ g_return_val_if_fail (property != NULL, FALSE);
+ g_return_val_if_fail (value != NULL, FALSE);
+
+ node = property_node_lookup (g_quark_try_string (property));
+
+ if (!node)
+ {
+ g_warning ("Style property \"%s\" is not registered", property);
+ return FALSE;
+ }
+
+ priv = props->priv;
+ prop = g_hash_table_lookup (priv->properties,
+ GINT_TO_POINTER (node->property_quark));
+
+ if (!prop)
+ return FALSE;
+
+ g_value_init (value, node->pspec->value_type);
+ val = property_data_match_state (prop, state);
+
+ if (val &&
+ !style_properties_resolve_type (props, node, val))
+ return FALSE;
+
+ if (val)
+ {
+ g_param_value_validate (node->pspec, val);
+ g_value_copy (val, value);
+ }
+ else
+ lookup_default_value (node, value);
+
+ return TRUE;
+}
+
+/**
+ * gtk_style_properties_get_valist:
+ * @props: a #GtkStyleProperties
+ * @state: state to retrieve the property values for
+ * @args: va_list of property name/return location pairs, followed by %NULL
+ *
+ * Retrieves several style property values from @props for a given state.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_properties_get_valist (GtkStyleProperties *props,
+ GtkStateFlags state,
+ va_list args)
+{
+ GtkStylePropertiesPrivate *priv;
+ const gchar *property_name;
+
+ g_return_if_fail (GTK_IS_STYLE_PROPERTIES (props));
+
+ priv = props->priv;
+ property_name = va_arg (args, const gchar *);
+
+ while (property_name)
+ {
+ PropertyNode *node;
+ PropertyData *prop;
+ gchar *error = NULL;
+ GValue *val = NULL;
+
+ node = property_node_lookup (g_quark_try_string (property_name));
+
+ if (!node)
+ {
+ g_warning ("Style property \"%s\" is not registered", property_name);
+ break;
+ }
+
+ prop = g_hash_table_lookup (priv->properties,
+ GINT_TO_POINTER (node->property_quark));
+
+ if (prop)
+ val = property_data_match_state (prop, state);
+
+ if (val &&
+ !style_properties_resolve_type (props, node, val))
+ val = NULL;
+
+ if (val)
+ {
+ g_param_value_validate (node->pspec, val);
+ G_VALUE_LCOPY (val, args, 0, &error);
+ }
+ else
+ {
+ GValue default_value = { 0 };
+
+ g_value_init (&default_value, node->pspec->value_type);
+ lookup_default_value (node, &default_value);
+ G_VALUE_LCOPY (&default_value, args, 0, &error);
+ g_value_unset (&default_value);
+ }
+
+ if (error)
+ {
+ g_warning ("Could not get style property \"%s\": %s", property_name, error);
+ g_free (error);
+ break;
+ }
+
+ property_name = va_arg (args, const gchar *);
+ }
+}
+
+/**
+ * gtk_style_properties_get:
+ * @props: a #GtkStyleProperties
+ * @state: state to retrieve the property values for
+ * @...: property name /return value pairs, followed by %NULL
+ *
+ * Retrieves several style property values from @props for a
+ * given state.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_properties_get (GtkStyleProperties *props,
+ GtkStateFlags state,
+ ...)
+{
+ va_list args;
+
+ g_return_if_fail (GTK_IS_STYLE_PROPERTIES (props));
+
+ va_start (args, state);
+ gtk_style_properties_get_valist (props, state, args);
+ va_end (args);
+}
+
+/**
+ * gtk_style_properties_unset_property:
+ * @props: a #GtkStyleProperties
+ * @property: property to unset
+ * @state: state to unset
+ *
+ * Unsets a style property in @props.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_properties_unset_property (GtkStyleProperties *props,
+ const gchar *property,
+ GtkStateFlags state)
+{
+ GtkStylePropertiesPrivate *priv;
+ PropertyNode *node;
+ PropertyData *prop;
+ guint pos;
+
+ g_return_if_fail (GTK_IS_STYLE_PROPERTIES (props));
+ g_return_if_fail (property != NULL);
+
+ node = property_node_lookup (g_quark_try_string (property));
+
+ if (!node)
+ {
+ g_warning ("Style property \"%s\" is not registered", property);
+ return;
+ }
+
+ priv = props->priv;
+ prop = g_hash_table_lookup (priv->properties,
+ GINT_TO_POINTER (node->property_quark));
+
+ if (!prop)
+ return;
+
+ if (property_data_find_position (prop, state, &pos))
+ {
+ ValueData *data;
+
+ data = &g_array_index (prop->values, ValueData, pos);
+
+ if (G_IS_VALUE (&data->value))
+ g_value_unset (&data->value);
+
+ g_array_remove_index (prop->values, pos);
+ }
+}
+
+/**
+ * gtk_style_properties_clear:
+ * @props: a #GtkStyleProperties
+ *
+ * Clears all style information from @props.
+ **/
+void
+gtk_style_properties_clear (GtkStyleProperties *props)
+{
+ GtkStylePropertiesPrivate *priv;
+
+ g_return_if_fail (GTK_IS_STYLE_PROPERTIES (props));
+
+ priv = props->priv;
+ g_hash_table_remove_all (priv->properties);
+}
+
+/**
+ * gtk_style_properties_merge:
+ * @props: a #GtkStyleProperties
+ * @props_to_merge: a second #GtkStyleProperties
+ * @replace: whether to replace values or not
+ *
+ * Merges into @props all the style information contained
+ * in @props_to_merge. If @replace is %TRUE, the values
+ * will be overwritten, if it is %FALSE, the older values
+ * will prevail.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_style_properties_merge (GtkStyleProperties *props,
+ const GtkStyleProperties *props_to_merge,
+ gboolean replace)
+{
+ GtkStylePropertiesPrivate *priv, *priv_to_merge;
+ GHashTableIter iter;
+ gpointer key, value;
+
+ g_return_if_fail (GTK_IS_STYLE_PROPERTIES (props));
+ g_return_if_fail (GTK_IS_STYLE_PROPERTIES (props_to_merge));
+
+ priv = props->priv;
+ priv_to_merge = props_to_merge->priv;
+
+ /* Merge symbolic color map */
+ if (priv_to_merge->color_map)
+ {
+ g_hash_table_iter_init (&iter, priv_to_merge->color_map);
+
+ while (g_hash_table_iter_next (&iter, &key, &value))
+ {
+ const gchar *name;
+ GtkSymbolicColor *color;
+
+ name = key;
+ color = value;
+
+ if (!replace &&
+ g_hash_table_lookup (priv->color_map, name))
+ continue;
+
+ gtk_style_properties_map_color (props, name, color);
+ }
+ }
+
+ /* Merge symbolic style properties */
+ g_hash_table_iter_init (&iter, priv_to_merge->properties);
+
+ while (g_hash_table_iter_next (&iter, &key, &value))
+ {
+ PropertyData *prop_to_merge = value;
+ PropertyData *prop;
+ guint i;
+
+ prop = g_hash_table_lookup (priv->properties, key);
+
+ if (!prop)
+ {
+ prop = property_data_new ();
+ g_hash_table_insert (priv->properties, key, prop);
+ }
+
+ for (i = 0; i < prop_to_merge->values->len; i++)
+ {
+ ValueData *data;
+ GValue *value;
+
+ data = &g_array_index (prop_to_merge->values, ValueData, i);
+ value = property_data_get_value (prop, data->state);
+
+ if (G_VALUE_TYPE (&data->value) == PANGO_TYPE_FONT_DESCRIPTION &&
+ G_IS_VALUE (value))
+ {
+ PangoFontDescription *font_desc;
+ PangoFontDescription *font_desc_to_merge;
+
+ /* Handle merging of font descriptions */
+ font_desc = g_value_get_boxed (value);
+ font_desc_to_merge = g_value_get_boxed (&data->value);
+
+ pango_font_description_merge (font_desc, font_desc_to_merge, replace);
+ }
+ else if (replace || !G_IS_VALUE (value))
+ {
+ if (!G_IS_VALUE (value))
+ g_value_init (value, G_VALUE_TYPE (&data->value));
+ else if (G_VALUE_TYPE (value) != G_VALUE_TYPE (&data->value))
+ {
+ g_value_unset (value);
+ g_value_init (value, G_VALUE_TYPE (&data->value));
+ }
+
+ g_value_copy (&data->value, value);
+ }
+ }
+ }
+}
diff --git a/gtk/gtkstyleproperties.h b/gtk/gtkstyleproperties.h
new file mode 100644
index 0000000000..113fe44f93
--- /dev/null
+++ b/gtk/gtkstyleproperties.h
@@ -0,0 +1,117 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
+#error "Only <gtk/gtk.h> can be included directly."
+#endif
+
+#ifndef __GTK_STYLE_PROPERTIES_H__
+#define __GTK_STYLE_PROPERTIES_H__
+
+#include <glib-object.h>
+#include <gdk/gdk.h>
+#include <gtk/gtkenums.h>
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_STYLE_PROPERTIES (gtk_style_properties_get_type ())
+#define GTK_STYLE_PROPERTIES(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_STYLE_PROPERTIES, GtkStyleProperties))
+#define GTK_STYLE_PROPERTIES_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GTK_TYPE_STYLE_PROPERTIES, GtkStylePropertiesClass))
+#define GTK_IS_STYLE_PROPERTIES(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_STYLE_PROPERTIES))
+#define GTK_IS_STYLE_PROPERTIES_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GTK_TYPE_STYLE_PROPERTIES))
+#define GTK_STYLE_PROPERTIES_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_STYLE_PROPERTIES, GtkStylePropertiesClass))
+
+typedef struct _GtkStyleProperties GtkStyleProperties;
+typedef struct _GtkStylePropertiesClass GtkStylePropertiesClass;
+
+typedef struct _GtkSymbolicColor GtkSymbolicColor;
+typedef struct _GtkGradient GtkGradient;
+
+struct _GtkStyleProperties
+{
+ GObject parent_object;
+ gpointer priv;
+};
+
+struct _GtkStylePropertiesClass
+{
+ GObjectClass parent_class;
+};
+
+typedef gboolean (* GtkStylePropertyParser) (const gchar *string,
+ GValue *value,
+ GError **error);
+
+GType gtk_style_properties_get_type (void) G_GNUC_CONST;
+
+/* Semi-private API */
+const GValue * _gtk_style_properties_peek_property (GtkStyleProperties *props,
+ const gchar *prop_name,
+ GtkStateFlags state);
+
+/* Functions to register style properties */
+void gtk_style_properties_register_property (GtkStylePropertyParser parse_func,
+ GParamSpec *pspec);
+gboolean gtk_style_properties_lookup_property (const gchar *property_name,
+ GtkStylePropertyParser *parse_func,
+ GParamSpec **pspec);
+
+GtkStyleProperties * gtk_style_properties_new (void);
+
+void gtk_style_properties_map_color (GtkStyleProperties *props,
+ const gchar *name,
+ GtkSymbolicColor *color);
+GtkSymbolicColor * gtk_style_properties_lookup_color (GtkStyleProperties *props,
+ const gchar *name);
+
+void gtk_style_properties_set_property (GtkStyleProperties *props,
+ const gchar *property,
+ GtkStateFlags state,
+ const GValue *value);
+void gtk_style_properties_set_valist (GtkStyleProperties *props,
+ GtkStateFlags state,
+ va_list args);
+void gtk_style_properties_set (GtkStyleProperties *props,
+ GtkStateFlags state,
+ ...) G_GNUC_NULL_TERMINATED;
+
+gboolean gtk_style_properties_get_property (GtkStyleProperties *props,
+ const gchar *property,
+ GtkStateFlags state,
+ GValue *value);
+void gtk_style_properties_get_valist (GtkStyleProperties *props,
+ GtkStateFlags state,
+ va_list args);
+void gtk_style_properties_get (GtkStyleProperties *props,
+ GtkStateFlags state,
+ ...) G_GNUC_NULL_TERMINATED;
+
+void gtk_style_properties_unset_property (GtkStyleProperties *props,
+ const gchar *property,
+ GtkStateFlags state);
+
+void gtk_style_properties_clear (GtkStyleProperties *props);
+
+void gtk_style_properties_merge (GtkStyleProperties *props,
+ const GtkStyleProperties *props_to_merge,
+ gboolean replace);
+
+G_END_DECLS
+
+#endif /* __GTK_STYLE_PROPERTIES_H__ */
diff --git a/gtk/gtkstyleprovider.c b/gtk/gtkstyleprovider.c
new file mode 100644
index 0000000000..8ed0d975ca
--- /dev/null
+++ b/gtk/gtkstyleprovider.c
@@ -0,0 +1,148 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include "gtkprivate.h"
+#include "gtkstyleprovider.h"
+#include "gtkintl.h"
+
+/**
+ * SECTION:gtkstyleprovider
+ * @Short_description: Interface to provide style information to GtkStyleContext
+ * @Title: GtkStyleProvider
+ * @See_also: #GtkStyleContext, #GtkCssProvider
+ *
+ * GtkStyleProvider is an interface used to provide style information to a #GtkStyleContext,
+ * see gtk_style_context_add_provider() and gtk_style_context_add_provider_for_screen().
+ */
+
+static void gtk_style_provider_iface_init (gpointer g_iface);
+
+GType
+gtk_style_provider_get_type (void)
+{
+ static GType style_provider_type = 0;
+
+ if (!style_provider_type)
+ style_provider_type = g_type_register_static_simple (G_TYPE_INTERFACE,
+ I_("GtkStyleProvider"),
+ sizeof (GtkStyleProviderIface),
+ (GClassInitFunc) gtk_style_provider_iface_init,
+ 0, NULL, 0);
+ return style_provider_type;
+}
+
+static void
+gtk_style_provider_iface_init (gpointer g_iface)
+{
+}
+
+/**
+ * gtk_style_provider_get_style:
+ * @provider: a #GtkStyleProvider
+ * @path: #GtkWidgetPath to query
+ *
+ * Returns the style settings affecting a widget defined by @path, or %NULL if
+ * @provider doesn't contemplate styling @path.
+ *
+ * Returns: a #GtkStyleProperties containing the style settings affecting @path
+ *
+ * Since: 3.0
+ **/
+GtkStyleProperties *
+gtk_style_provider_get_style (GtkStyleProvider *provider,
+ GtkWidgetPath *path)
+{
+ GtkStyleProviderIface *iface;
+
+ g_return_val_if_fail (GTK_IS_STYLE_PROVIDER (provider), NULL);
+
+ iface = GTK_STYLE_PROVIDER_GET_IFACE (provider);
+
+ if (!iface->get_style)
+ return NULL;
+
+ return iface->get_style (provider, path);
+}
+
+/**
+ * gtk_style_provider_get_style_property:
+ * @provider: a #GtkStyleProvider
+ * @path: #GtkWidgetPath to query
+ * @state: state to query the style property for
+ * @pspec: The #GParamSpec to query
+ * @value: (out): return location for the property value
+ *
+ * Looks up a widget style property as defined by @provider for
+ * the widget represented by @path.
+ *
+ * Returns: %TRUE if the property was found and has a value, %FALSE otherwise
+ **/
+gboolean
+gtk_style_provider_get_style_property (GtkStyleProvider *provider,
+ GtkWidgetPath *path,
+ GtkStateFlags state,
+ GParamSpec *pspec,
+ GValue *value)
+{
+ GtkStyleProviderIface *iface;
+
+ g_return_val_if_fail (GTK_IS_STYLE_PROVIDER (provider), FALSE);
+ g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), FALSE);
+ g_return_val_if_fail (path != NULL, FALSE);
+ g_return_val_if_fail (g_type_is_a (gtk_widget_path_get_widget_type (path), pspec->owner_type), FALSE);
+ g_return_val_if_fail (value != NULL, FALSE);
+
+ iface = GTK_STYLE_PROVIDER_GET_IFACE (provider);
+
+ if (!iface->get_style_property)
+ return FALSE;
+
+ return iface->get_style_property (provider, path, state, pspec, value);
+}
+
+/**
+ * gtk_style_provider_get_icon_factory:
+ * @provider: a #GtkStyleProvider
+ * @path: #GtkWidgetPath to query
+ *
+ * Returns the #GtkIconFactory defined to be in use for @path, or %NULL if none
+ * is defined.
+ *
+ * Returns: The icon factory to use for @path, or %NULL
+ *
+ * Since: 3.0
+ **/
+GtkIconFactory *
+gtk_style_provider_get_icon_factory (GtkStyleProvider *provider,
+ GtkWidgetPath *path)
+{
+ GtkStyleProviderIface *iface;
+
+ g_return_val_if_fail (GTK_IS_STYLE_PROVIDER (provider), NULL);
+ g_return_val_if_fail (path != NULL, NULL);
+
+ iface = GTK_STYLE_PROVIDER_GET_IFACE (provider);
+
+ if (!iface->get_icon_factory)
+ return NULL;
+
+ return iface->get_icon_factory (provider, path);
+}
diff --git a/gtk/gtkstyleprovider.h b/gtk/gtkstyleprovider.h
new file mode 100644
index 0000000000..d996bb77fe
--- /dev/null
+++ b/gtk/gtkstyleprovider.h
@@ -0,0 +1,128 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
+#error "Only <gtk/gtk.h> can be included directly."
+#endif
+
+#ifndef __GTK_STYLE_PROVIDER_H__
+#define __GTK_STYLE_PROVIDER_H__
+
+#include <glib-object.h>
+#include "gtkwidgetpath.h"
+#include "gtkiconfactory.h"
+#include "gtkstyleproperties.h"
+#include "gtkenums.h"
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_STYLE_PROVIDER (gtk_style_provider_get_type ())
+#define GTK_STYLE_PROVIDER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_STYLE_PROVIDER, GtkStyleProvider))
+#define GTK_IS_STYLE_PROVIDER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_STYLE_PROVIDER))
+#define GTK_STYLE_PROVIDER_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GTK_TYPE_STYLE_PROVIDER, GtkStyleProviderIface))
+
+/**
+ * GTK_STYLE_PROVIDER_PRIORITY_FALLBACK:
+ *
+ * The priority used for default style information
+ * that is used in the absence of themes.
+ */
+#define GTK_STYLE_PROVIDER_PRIORITY_FALLBACK 1
+
+/**
+ * GTK_STYLE_PROVIDER_PRIORITY_THEME:
+ *
+ * The priority used for style information provided
+ * by themes.
+ */
+#define GTK_STYLE_PROVIDER_PRIORITY_THEME 200
+
+/**
+ * GTK_STYLE_PROVIDER_PRIORITY_SETTINGS:
+ *
+ * The priority used for style information provided
+ * via #GtkSettings.
+ *
+ * This priority is higher than #GTK_STYLE_PROVIDER_PRIORITY_THEME
+ * to let settings override themes.
+ */
+#define GTK_STYLE_PROVIDER_PRIORITY_SETTINGS 400
+
+/**
+ * GTK_STYLE_PROVIDER_PRIORITY_APPLICATION:
+ *
+ * A priority that can be used when adding a #GtkStyleProvider
+ * for application-specific style information.
+ */
+#define GTK_STYLE_PROVIDER_PRIORITY_APPLICATION 600
+
+/**
+ * GTK_STYLE_PROVIDER_PRIORITY_USER:
+ *
+ * The priority used for the style information from
+ * <filename>~/.gtk-3.0.css</filename>.
+ *
+ * You should not use priorities higher than this, to
+ * give the user the last word.
+ */
+#define GTK_STYLE_PROVIDER_PRIORITY_USER 800
+
+typedef struct _GtkStyleProviderIface GtkStyleProviderIface;
+typedef struct _GtkStyleProvider GtkStyleProvider; /* dummy typedef */
+
+/**
+ * GtkStyleProviderIface
+ * @get_style: Gets a set of style information that applies to a widget path.
+ * @get_style_property: Gets the value of a widget style property that applies to a widget path.
+ * @get_icon_factory: Gets the icon factory that applies to a widget path.
+ */
+struct _GtkStyleProviderIface
+{
+ GTypeInterface g_iface;
+
+ GtkStyleProperties * (* get_style) (GtkStyleProvider *provider,
+ GtkWidgetPath *path);
+
+ gboolean (* get_style_property) (GtkStyleProvider *provider,
+ GtkWidgetPath *path,
+ GtkStateFlags state,
+ GParamSpec *pspec,
+ GValue *value);
+
+ GtkIconFactory * (* get_icon_factory) (GtkStyleProvider *provider,
+ GtkWidgetPath *path);
+};
+
+GType gtk_style_provider_get_type (void) G_GNUC_CONST;
+
+GtkStyleProperties *gtk_style_provider_get_style (GtkStyleProvider *provider,
+ GtkWidgetPath *path);
+
+gboolean gtk_style_provider_get_style_property (GtkStyleProvider *provider,
+ GtkWidgetPath *path,
+ GtkStateFlags state,
+ GParamSpec *pspec,
+ GValue *value);
+
+GtkIconFactory * gtk_style_provider_get_icon_factory (GtkStyleProvider *provider,
+ GtkWidgetPath *path);
+
+G_END_DECLS
+
+#endif /* __GTK_STYLE_PROVIDER_H__ */
diff --git a/gtk/gtksymboliccolor.c b/gtk/gtksymboliccolor.c
new file mode 100644
index 0000000000..2345cfa396
--- /dev/null
+++ b/gtk/gtksymboliccolor.c
@@ -0,0 +1,558 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+#include "gtksymboliccolor.h"
+#include "gtkstyleproperties.h"
+#include "gtkintl.h"
+
+/**
+ * SECTION:gtksymboliccolor
+ * @Short_description: Symbolic colors
+ * @Title: GtkSymbolicColor
+ *
+ * GtkSymbolicColor is a boxed type that represents a symbolic color.
+ * It is the result of parsing a
+ * <link linkend="gtkcssprovider-symbolic-colors">color expression</link>.
+ * To obtain the color represented by a GtkSymbolicColor, it has to
+ * be resolved with gtk_symbolic_color_resolve(), which replaces all
+ * symbolic color references by the colors they refer to (in a given
+ * context) and evaluates mix, shade and other expressions, resulting
+ * in a #GdkRGBA value.
+ *
+ * It is not normally necessary to deal directly with #GtkSymbolicColors,
+ * since they are mostly used behind the scenes by #GtkStyleContext and
+ * #GtkCssProvider.
+ */
+
+G_DEFINE_BOXED_TYPE (GtkSymbolicColor, gtk_symbolic_color,
+ gtk_symbolic_color_ref, gtk_symbolic_color_unref)
+
+/* Symbolic colors */
+typedef enum {
+ COLOR_TYPE_LITERAL,
+ COLOR_TYPE_NAME,
+ COLOR_TYPE_SHADE,
+ COLOR_TYPE_ALPHA,
+ COLOR_TYPE_MIX
+} ColorType;
+
+struct _GtkSymbolicColor
+{
+ ColorType type;
+ guint ref_count;
+
+ union
+ {
+ GdkRGBA color;
+ gchar *name;
+
+ struct
+ {
+ GtkSymbolicColor *color;
+ gdouble factor;
+ } shade, alpha;
+
+ struct
+ {
+ GtkSymbolicColor *color1;
+ GtkSymbolicColor *color2;
+ gdouble factor;
+ } mix;
+ };
+};
+
+/**
+ * gtk_symbolic_color_new_literal:
+ * @color: a #GdkRGBA
+ *
+ * Creates a symbolic color pointing to a literal color.
+ *
+ * Returns: a newly created #GtkSymbolicColor
+ *
+ * Since: 3.0
+ **/
+GtkSymbolicColor *
+gtk_symbolic_color_new_literal (const GdkRGBA *color)
+{
+ GtkSymbolicColor *symbolic_color;
+
+ g_return_val_if_fail (color != NULL, NULL);
+
+ symbolic_color = g_slice_new0 (GtkSymbolicColor);
+ symbolic_color->type = COLOR_TYPE_LITERAL;
+ symbolic_color->color = *color;
+ symbolic_color->ref_count = 1;
+
+ return symbolic_color;
+}
+
+/**
+ * gtk_symbolic_color_new_name:
+ * @name: color name
+ *
+ * Creates a symbolic color pointing to an unresolved named
+ * color. See gtk_style_context_lookup_color() and
+ * gtk_style_properties_lookup_color().
+ *
+ * Returns: a newly created #GtkSymbolicColor
+ *
+ * Since: 3.0
+ **/
+GtkSymbolicColor *
+gtk_symbolic_color_new_name (const gchar *name)
+{
+ GtkSymbolicColor *symbolic_color;
+
+ g_return_val_if_fail (name != NULL, NULL);
+
+ symbolic_color = g_slice_new0 (GtkSymbolicColor);
+ symbolic_color->type = COLOR_TYPE_NAME;
+ symbolic_color->name = g_strdup (name);
+ symbolic_color->ref_count = 1;
+
+ return symbolic_color;
+}
+
+/**
+ * gtk_symbolic_color_new_shade:
+ * @color: another #GtkSymbolicColor
+ * @factor: shading factor to apply to @color
+ *
+ * Creates a symbolic color defined as a shade of
+ * another color. A factor > 1.0 would resolve to
+ * a brighter color, while < 1.0 would resolve to
+ * a darker color.
+ *
+ * Returns: A newly created #GtkSymbolicColor
+ *
+ * Since: 3.0
+ **/
+GtkSymbolicColor *
+gtk_symbolic_color_new_shade (GtkSymbolicColor *color,
+ gdouble factor)
+{
+ GtkSymbolicColor *symbolic_color;
+
+ g_return_val_if_fail (color != NULL, NULL);
+
+ symbolic_color = g_slice_new0 (GtkSymbolicColor);
+ symbolic_color->type = COLOR_TYPE_SHADE;
+ symbolic_color->shade.color = gtk_symbolic_color_ref (color);
+ symbolic_color->shade.factor = factor;
+ symbolic_color->ref_count = 1;
+
+ return symbolic_color;
+}
+
+/**
+ * gtk_symbolic_color_new_alpha:
+ * @color: another #GtkSymbolicColor
+ * @factor: factor to apply to @color alpha
+ *
+ * Creates a symbolic color by modifying the relative alpha
+ * value of @color. A factor < 1.0 would resolve to a more
+ * transparent color, while > 1.0 would resolve to a more
+ * opaque color.
+ *
+ * Returns: A newly created #GtkSymbolicColor
+ *
+ * Since: 3.0
+ **/
+GtkSymbolicColor *
+gtk_symbolic_color_new_alpha (GtkSymbolicColor *color,
+ gdouble factor)
+{
+ GtkSymbolicColor *symbolic_color;
+
+ g_return_val_if_fail (color != NULL, NULL);
+
+ symbolic_color = g_slice_new0 (GtkSymbolicColor);
+ symbolic_color->type = COLOR_TYPE_ALPHA;
+ symbolic_color->alpha.color = gtk_symbolic_color_ref (color);
+ symbolic_color->alpha.factor = factor;
+ symbolic_color->ref_count = 1;
+
+ return symbolic_color;
+}
+
+/**
+ * gtk_symbolic_color_new_mix:
+ * @color1: color to mix
+ * @color2: another color to mix
+ * @factor: mix factor
+ *
+ * Creates a symbolic color defined as a mix of another
+ * two colors. a mix factor of 0 would resolve to @color1,
+ * while a factor of 1 would resolve to @color2.
+ *
+ * Returns: A newly created #GtkSymbolicColor
+ *
+ * Since: 3.0
+ **/
+GtkSymbolicColor *
+gtk_symbolic_color_new_mix (GtkSymbolicColor *color1,
+ GtkSymbolicColor *color2,
+ gdouble factor)
+{
+ GtkSymbolicColor *symbolic_color;
+
+ g_return_val_if_fail (color1 != NULL, NULL);
+ g_return_val_if_fail (color1 != NULL, NULL);
+
+ symbolic_color = g_slice_new0 (GtkSymbolicColor);
+ symbolic_color->type = COLOR_TYPE_MIX;
+ symbolic_color->mix.color1 = gtk_symbolic_color_ref (color1);
+ symbolic_color->mix.color2 = gtk_symbolic_color_ref (color2);
+ symbolic_color->mix.factor = factor;
+ symbolic_color->ref_count = 1;
+
+ return symbolic_color;
+}
+
+/**
+ * gtk_symbolic_color_ref:
+ * @color: a #GtkSymbolicColor
+ *
+ * Increases the reference count of @color
+ *
+ * Returns: the same @color
+ *
+ * Since: 3.0
+ **/
+GtkSymbolicColor *
+gtk_symbolic_color_ref (GtkSymbolicColor *color)
+{
+ g_return_val_if_fail (color != NULL, NULL);
+
+ color->ref_count++;
+
+ return color;
+}
+
+/**
+ * gtk_symbolic_color_unref:
+ * @color: a #GtkSymbolicColor
+ *
+ * Decreases the reference count of @color, freeing its memory if the
+ * reference count reaches 0.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_symbolic_color_unref (GtkSymbolicColor *color)
+{
+ g_return_if_fail (color != NULL);
+
+ color->ref_count--;
+
+ if (color->ref_count == 0)
+ {
+ switch (color->type)
+ {
+ case COLOR_TYPE_NAME:
+ g_free (color->name);
+ break;
+ case COLOR_TYPE_SHADE:
+ gtk_symbolic_color_unref (color->shade.color);
+ break;
+ case COLOR_TYPE_ALPHA:
+ gtk_symbolic_color_unref (color->alpha.color);
+ break;
+ case COLOR_TYPE_MIX:
+ gtk_symbolic_color_unref (color->mix.color1);
+ gtk_symbolic_color_unref (color->mix.color2);
+ break;
+ default:
+ break;
+ }
+
+ g_slice_free (GtkSymbolicColor, color);
+ }
+}
+
+static void
+rgb_to_hls (gdouble *r,
+ gdouble *g,
+ gdouble *b)
+{
+ gdouble min;
+ gdouble max;
+ gdouble red;
+ gdouble green;
+ gdouble blue;
+ gdouble h, l, s;
+ gdouble delta;
+
+ red = *r;
+ green = *g;
+ blue = *b;
+
+ if (red > green)
+ {
+ if (red > blue)
+ max = red;
+ else
+ max = blue;
+
+ if (green < blue)
+ min = green;
+ else
+ min = blue;
+ }
+ else
+ {
+ if (green > blue)
+ max = green;
+ else
+ max = blue;
+
+ if (red < blue)
+ min = red;
+ else
+ min = blue;
+ }
+
+ l = (max + min) / 2;
+ s = 0;
+ h = 0;
+
+ if (max != min)
+ {
+ if (l <= 0.5)
+ s = (max - min) / (max + min);
+ else
+ s = (max - min) / (2 - max - min);
+
+ delta = max -min;
+ if (red == max)
+ h = (green - blue) / delta;
+ else if (green == max)
+ h = 2 + (blue - red) / delta;
+ else if (blue == max)
+ h = 4 + (red - green) / delta;
+
+ h *= 60;
+ if (h < 0.0)
+ h += 360;
+ }
+
+ *r = h;
+ *g = l;
+ *b = s;
+}
+
+static void
+hls_to_rgb (gdouble *h,
+ gdouble *l,
+ gdouble *s)
+{
+ gdouble hue;
+ gdouble lightness;
+ gdouble saturation;
+ gdouble m1, m2;
+ gdouble r, g, b;
+
+ lightness = *l;
+ saturation = *s;
+
+ if (lightness <= 0.5)
+ m2 = lightness * (1 + saturation);
+ else
+ m2 = lightness + saturation - lightness * saturation;
+ m1 = 2 * lightness - m2;
+
+ if (saturation == 0)
+ {
+ *h = lightness;
+ *l = lightness;
+ *s = lightness;
+ }
+ else
+ {
+ hue = *h + 120;
+ while (hue > 360)
+ hue -= 360;
+ while (hue < 0)
+ hue += 360;
+
+ if (hue < 60)
+ r = m1 + (m2 - m1) * hue / 60;
+ else if (hue < 180)
+ r = m2;
+ else if (hue < 240)
+ r = m1 + (m2 - m1) * (240 - hue) / 60;
+ else
+ r = m1;
+
+ hue = *h;
+ while (hue > 360)
+ hue -= 360;
+ while (hue < 0)
+ hue += 360;
+
+ if (hue < 60)
+ g = m1 + (m2 - m1) * hue / 60;
+ else if (hue < 180)
+ g = m2;
+ else if (hue < 240)
+ g = m1 + (m2 - m1) * (240 - hue) / 60;
+ else
+ g = m1;
+
+ hue = *h - 120;
+ while (hue > 360)
+ hue -= 360;
+ while (hue < 0)
+ hue += 360;
+
+ if (hue < 60)
+ b = m1 + (m2 - m1) * hue / 60;
+ else if (hue < 180)
+ b = m2;
+ else if (hue < 240)
+ b = m1 + (m2 - m1) * (240 - hue) / 60;
+ else
+ b = m1;
+
+ *h = r;
+ *l = g;
+ *s = b;
+ }
+}
+
+static void
+_shade_color (GdkRGBA *color,
+ gdouble factor)
+{
+ GdkRGBA temp;
+
+ temp = *color;
+ rgb_to_hls (&temp.red, &temp.green, &temp.blue);
+
+ temp.green *= factor;
+ if (temp.green > 1.0)
+ temp.green = 1.0;
+ else if (temp.green < 0.0)
+ temp.green = 0.0;
+
+ temp.blue *= factor;
+ if (temp.blue > 1.0)
+ temp.blue = 1.0;
+ else if (temp.blue < 0.0)
+ temp.blue = 0.0;
+
+ hls_to_rgb (&temp.red, &temp.green, &temp.blue);
+ *color = temp;
+}
+
+/**
+ * gtk_symbolic_color_resolve:
+ * @color: a #GtkSymbolicColor
+ * @props: #GtkStyleProperties to use when resolving named colors
+ * @resolved_color: (out): return location for the resolved color
+ *
+ * If @color is resolvable, @resolved_color will be filled in
+ * with the resolved color, and %TRUE will be returned. Generally,
+ * if @color can't be resolved, it is due to it being defined on
+ * top of a named color that doesn't exist in @props.
+ *
+ * Returns: %TRUE if the color has been resolved
+ *
+ * Since: 3.0
+ **/
+gboolean
+gtk_symbolic_color_resolve (GtkSymbolicColor *color,
+ GtkStyleProperties *props,
+ GdkRGBA *resolved_color)
+{
+ g_return_val_if_fail (color != NULL, FALSE);
+ g_return_val_if_fail (resolved_color != NULL, FALSE);
+
+ switch (color->type)
+ {
+ case COLOR_TYPE_LITERAL:
+ *resolved_color = color->color;
+ return TRUE;
+ case COLOR_TYPE_NAME:
+ {
+ GtkSymbolicColor *named_color;
+
+ g_return_val_if_fail (GTK_IS_STYLE_PROPERTIES (props), FALSE);
+
+ named_color = gtk_style_properties_lookup_color (props, color->name);
+
+ if (!named_color)
+ return FALSE;
+
+ return gtk_symbolic_color_resolve (named_color, props, resolved_color);
+ }
+
+ break;
+ case COLOR_TYPE_SHADE:
+ {
+ GdkRGBA shade;
+
+ if (!gtk_symbolic_color_resolve (color->shade.color, props, &shade))
+ return FALSE;
+
+ _shade_color (&shade, color->shade.factor);
+ *resolved_color = shade;
+
+ return TRUE;
+ }
+
+ break;
+ case COLOR_TYPE_ALPHA:
+ {
+ GdkRGBA alpha;
+
+ if (!gtk_symbolic_color_resolve (color->alpha.color, props, &alpha))
+ return FALSE;
+
+ *resolved_color = alpha;
+ resolved_color->alpha = CLAMP (alpha.alpha * color->alpha.factor, 0, 1);
+
+ return TRUE;
+ }
+ case COLOR_TYPE_MIX:
+ {
+ GdkRGBA color1, color2;
+
+ if (!gtk_symbolic_color_resolve (color->mix.color1, props, &color1))
+ return FALSE;
+
+ if (!gtk_symbolic_color_resolve (color->mix.color2, props, &color2))
+ return FALSE;
+
+ resolved_color->red = CLAMP (color1.red + ((color2.red - color1.red) * color->mix.factor), 0, 1);
+ resolved_color->green = CLAMP (color1.green + ((color2.green - color1.green) * color->mix.factor), 0, 1);
+ resolved_color->blue = CLAMP (color1.blue + ((color2.blue - color1.blue) * color->mix.factor), 0, 1);
+ resolved_color->alpha = CLAMP (color1.alpha + ((color2.alpha - color1.alpha) * color->mix.factor), 0, 1);
+
+ return TRUE;
+ }
+
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+
+ return FALSE;
+}
diff --git a/gtk/gtksymboliccolor.h b/gtk/gtksymboliccolor.h
new file mode 100644
index 0000000000..4f4b8137b4
--- /dev/null
+++ b/gtk/gtksymboliccolor.h
@@ -0,0 +1,55 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
+#error "Only <gtk/gtk.h> can be included directly."
+#endif
+
+#ifndef __GTK_SYMBOLIC_COLOR_H__
+#define __GTK_SYMBOLIC_COLOR_H__
+
+#include <gdk/gdk.h>
+#include <gtk/gtkstyleproperties.h>
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_SYMBOLIC_COLOR (gtk_symbolic_color_get_type ())
+
+GType gtk_symbolic_color_get_type (void) G_GNUC_CONST;
+
+GtkSymbolicColor * gtk_symbolic_color_new_literal (const GdkRGBA *color);
+GtkSymbolicColor * gtk_symbolic_color_new_name (const gchar *name);
+GtkSymbolicColor * gtk_symbolic_color_new_shade (GtkSymbolicColor *color,
+ gdouble factor);
+GtkSymbolicColor * gtk_symbolic_color_new_alpha (GtkSymbolicColor *color,
+ gdouble factor);
+GtkSymbolicColor * gtk_symbolic_color_new_mix (GtkSymbolicColor *color1,
+ GtkSymbolicColor *color2,
+ gdouble factor);
+
+GtkSymbolicColor * gtk_symbolic_color_ref (GtkSymbolicColor *color);
+void gtk_symbolic_color_unref (GtkSymbolicColor *color);
+
+gboolean gtk_symbolic_color_resolve (GtkSymbolicColor *color,
+ GtkStyleProperties *props,
+ GdkRGBA *resolved_color);
+
+G_END_DECLS
+
+#endif /* __GTK_SYMBOLIC_COLOR_H__ */
diff --git a/gtk/gtktextbufferserialize.c b/gtk/gtktextbufferserialize.c
index 16a36d3994..526e9518aa 100644
--- a/gtk/gtktextbufferserialize.c
+++ b/gtk/gtktextbufferserialize.c
@@ -70,10 +70,6 @@ serialize_value (GValue *value)
return g_strdup_printf ("%x:%x:%x", color->red, color->green, color->blue);
}
- else if (g_type_is_a (value->g_type, GDK_TYPE_DRAWABLE))
- {
- /* Don't do anything */
- }
else
{
g_warning ("Type %s is not serializable\n", g_type_name (value->g_type));
diff --git a/gtk/gtkthemes.h b/gtk/gtkthemes.h
index 49d3e511dc..91edccc109 100644
--- a/gtk/gtkthemes.h
+++ b/gtk/gtkthemes.h
@@ -39,10 +39,14 @@ G_BEGIN_DECLS
#define GTK_THEME_ENGINE(theme_engine) (G_TYPE_CHECK_INSTANCE_CAST ((theme_engine), GTK_TYPE_THEME_ENGINE, GtkThemeEngine))
#define GTK_IS_THEME_ENGINE(theme_engine) (G_TYPE_CHECK_INSTANCE_TYPE ((theme_engine), GTK_TYPE_THEME_ENGINE))
+#if !defined(GTK_DISABLE_DEPRECATED) || defined(GTK_COMPILATION)
+
GType gtk_theme_engine_get_type (void) G_GNUC_CONST;
GtkThemeEngine *gtk_theme_engine_get (const gchar *name);
GtkRcStyle *gtk_theme_engine_create_rc_style (GtkThemeEngine *engine);
+#endif
+
G_END_DECLS
#endif /* __GTK_THEMES_H__ */
diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c
new file mode 100644
index 0000000000..e254161141
--- /dev/null
+++ b/gtk/gtkthemingengine.c
@@ -0,0 +1,3059 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include <math.h>
+#include <gtk/gtk.h>
+
+#include <gtk/gtkthemingengine.h>
+#include <gtk/gtkstylecontext.h>
+#include <gtk/gtkintl.h>
+
+#include "gtkprivate.h"
+#include "gtk9slice.h"
+#include "gtkpango.h"
+
+/**
+ * SECTION:gtkthemingengine
+ * @Short_description: Theming renderers
+ * @Title: GtkThemingEngine
+ * @See_also: #GtkStyleContext
+ *
+ * #GtkThemingEngine is the object used for rendering themed content
+ * in GTK+ widgets. Even though GTK+ has a default implementation,
+ * it can be overridden in CSS files by enforcing a #GtkThemingEngine
+ * object to be loaded as a module.
+ *
+ * In order to implement a theming engine, a #GtkThemingEngine subclass
+ * must be created, alongside the CSS file that will reference it, the
+ * theming engine would be created as an .so library, and installed in
+ * $(gtk-modules-dir)/theming-engines/.
+ *
+ * #GtkThemingEngine<!-- -->s have limited access to the object they are
+ * rendering, the #GtkThemingEngine API has read-only accessors to the
+ * style information contained in the rendered object's #GtkStyleContext.
+ */
+
+typedef struct GtkThemingEnginePrivate GtkThemingEnginePrivate;
+
+enum {
+ SIDE_LEFT = 1,
+ SIDE_BOTTOM = 1 << 1,
+ SIDE_RIGHT = 1 << 2,
+ SIDE_TOP = 1 << 3,
+ SIDE_ALL = 0xF
+};
+
+enum {
+ PROP_0,
+ PROP_NAME
+};
+
+struct GtkThemingEnginePrivate
+{
+ GtkStyleContext *context;
+ gchar *name;
+};
+
+#define GTK_THEMING_ENGINE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GTK_TYPE_THEMING_ENGINE, GtkThemingEnginePrivate))
+
+static void gtk_theming_engine_finalize (GObject *object);
+static void gtk_theming_engine_impl_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec);
+static void gtk_theming_engine_impl_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec);
+
+static void gtk_theming_engine_render_check (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height);
+static void gtk_theming_engine_render_option (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height);
+static void gtk_theming_engine_render_arrow (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble angle,
+ gdouble x,
+ gdouble y,
+ gdouble size);
+static void gtk_theming_engine_render_background (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height);
+static void gtk_theming_engine_render_frame (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height);
+static void gtk_theming_engine_render_expander (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height);
+static void gtk_theming_engine_render_focus (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height);
+static void gtk_theming_engine_render_layout (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ PangoLayout *layout);
+static void gtk_theming_engine_render_line (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x0,
+ gdouble y0,
+ gdouble x1,
+ gdouble y1);
+static void gtk_theming_engine_render_slider (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height,
+ GtkOrientation orientation);
+static void gtk_theming_engine_render_frame_gap (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height,
+ GtkPositionType gap_side,
+ gdouble xy0_gap,
+ gdouble xy1_gap);
+static void gtk_theming_engine_render_extension (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height,
+ GtkPositionType gap_side);
+static void gtk_theming_engine_render_handle (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height);
+static void gtk_theming_engine_render_activity (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height);
+static GdkPixbuf * gtk_theming_engine_render_icon_pixbuf (GtkThemingEngine *engine,
+ const GtkIconSource *source,
+ GtkIconSize size);
+
+G_DEFINE_TYPE (GtkThemingEngine, gtk_theming_engine, G_TYPE_OBJECT)
+
+
+typedef struct GtkThemingModule GtkThemingModule;
+typedef struct GtkThemingModuleClass GtkThemingModuleClass;
+
+struct GtkThemingModule
+{
+ GTypeModule parent_instance;
+ GModule *module;
+ gchar *name;
+
+ void (*init) (GTypeModule *module);
+ void (*exit) (void);
+ GtkThemingEngine * (*create_engine) (void);
+};
+
+struct GtkThemingModuleClass
+{
+ GTypeModuleClass parent_class;
+};
+
+#define GTK_TYPE_THEMING_MODULE (gtk_theming_module_get_type ())
+#define GTK_THEMING_MODULE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_THEMING_MODULE, GtkThemingModule))
+#define GTK_IS_THEMING_MODULE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_THEMING_MODULE))
+
+G_DEFINE_TYPE (GtkThemingModule, gtk_theming_module, G_TYPE_TYPE_MODULE);
+
+static void
+gtk_theming_engine_class_init (GtkThemingEngineClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->finalize = gtk_theming_engine_finalize;
+ object_class->set_property = gtk_theming_engine_impl_set_property;
+ object_class->get_property = gtk_theming_engine_impl_get_property;
+
+ klass->render_check = gtk_theming_engine_render_check;
+ klass->render_option = gtk_theming_engine_render_option;
+ klass->render_arrow = gtk_theming_engine_render_arrow;
+ klass->render_background = gtk_theming_engine_render_background;
+ klass->render_frame = gtk_theming_engine_render_frame;
+ klass->render_expander = gtk_theming_engine_render_expander;
+ klass->render_focus = gtk_theming_engine_render_focus;
+ klass->render_layout = gtk_theming_engine_render_layout;
+ klass->render_line = gtk_theming_engine_render_line;
+ klass->render_slider = gtk_theming_engine_render_slider;
+ klass->render_frame_gap = gtk_theming_engine_render_frame_gap;
+ klass->render_extension = gtk_theming_engine_render_extension;
+ klass->render_handle = gtk_theming_engine_render_handle;
+ klass->render_activity = gtk_theming_engine_render_activity;
+ klass->render_icon_pixbuf = gtk_theming_engine_render_icon_pixbuf;
+
+ /**
+ * GtkThemingEngine:name:
+ *
+ * The theming engine name, this name will be used when registering
+ * custom properties, for a theming engine named "Clearlooks" registering
+ * a "glossy" custom property, it could be referenced in the CSS file as
+ *
+ * <programlisting>
+ * -Clearlooks-glossy: true;
+ * </programlisting>
+ *
+ * Since: 3.0
+ */
+ g_object_class_install_property (object_class,
+ PROP_NAME,
+ g_param_spec_string ("name",
+ P_("Name"),
+ P_("Theming engine name"),
+ NULL,
+ G_PARAM_CONSTRUCT_ONLY | GTK_PARAM_READWRITE));
+
+ g_type_class_add_private (object_class, sizeof (GtkThemingEnginePrivate));
+}
+
+static void
+gtk_theming_engine_init (GtkThemingEngine *engine)
+{
+ engine->priv = GTK_THEMING_ENGINE_GET_PRIVATE (engine);
+}
+
+static void
+gtk_theming_engine_finalize (GObject *object)
+{
+ GtkThemingEnginePrivate *priv;
+
+ priv = GTK_THEMING_ENGINE (object)->priv;
+ g_free (priv->name);
+
+ G_OBJECT_GET_CLASS (gtk_theming_engine_parent_class)->finalize (object);
+}
+
+static void
+gtk_theming_engine_impl_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ GtkThemingEnginePrivate *priv;
+
+ priv = GTK_THEMING_ENGINE (object)->priv;
+
+ switch (prop_id)
+ {
+ case PROP_NAME:
+ if (priv->name)
+ g_free (priv->name);
+
+ priv->name = g_value_dup_string (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+gtk_theming_engine_impl_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ GtkThemingEnginePrivate *priv;
+
+ priv = GTK_THEMING_ENGINE (object)->priv;
+
+ switch (prop_id)
+ {
+ case PROP_NAME:
+ g_value_set_string (value, priv->name);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+void
+_gtk_theming_engine_set_context (GtkThemingEngine *engine,
+ GtkStyleContext *context)
+{
+ GtkThemingEnginePrivate *priv;
+
+ g_return_if_fail (GTK_IS_THEMING_ENGINE (engine));
+ g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+
+ priv = engine->priv;
+ priv->context = context;
+}
+
+/**
+ * gtk_theming_engine_register_property:
+ * @name_space: namespace for the property name
+ * @parse_func: parsing function to use, or %NULL
+ * @pspec: the #GParamSpec for the new property
+ *
+ * Registers a property so it can be used in the CSS file format,
+ * on the CSS file the property will look like
+ * "-${@name_space}-${property_name}". being
+ * ${property_name} the given to @pspec. @name_space will usually
+ * be the theme engine name.
+ *
+ * For any type a @parse_func may be provided, being this function
+ * used for turning any property value (between ':' and ';') in
+ * CSS to the #GValue needed. For basic types there is already
+ * builtin parsing support, so %NULL may be provided for these
+ * cases.
+ *
+ * <note>
+ * Engines must ensure property registration happens exactly once,
+ * usually GTK+ deals with theming engines as singletons, so this
+ * should be guaranteed to happen once, but bear this in mind
+ * when creating #GtkThemeEngine<!-- -->s yourself.
+ * </note>
+ *
+ * <note>
+ * In order to make use of the custom registered properties in
+ * the CSS file, make sure the engine is loaded first by specifying
+ * the engine property, either in a previous rule or within the same
+ * one.
+ * <programlisting>
+ * &ast; {
+ * engine: someengine;
+ * -SomeEngine-custom-property: 2;
+ * }
+ * </programlisting>
+ * </note>
+ *
+ * Since: 3.0
+ **/
+void
+gtk_theming_engine_register_property (const gchar *name_space,
+ GtkStylePropertyParser parse_func,
+ GParamSpec *pspec)
+{
+ gchar *name;
+
+ g_return_if_fail (name_space != NULL);
+ g_return_if_fail (strchr (name_space, ' ') == NULL);
+ g_return_if_fail (G_IS_PARAM_SPEC (pspec));
+
+ /* FIXME: hack hack hack, replacing pspec->name to include namespace */
+ name = g_strdup_printf ("-%s-%s", name_space, pspec->name);
+ g_free (pspec->name);
+ pspec->name = name;
+
+ gtk_style_properties_register_property (parse_func, pspec);
+}
+
+/**
+ * gtk_theming_engine_get_property:
+ * @engine: a #GtkThemingEngine
+ * @property: the property name
+ * @state: state to retrieve the value for
+ * @value: (out) (transfer full): return location for the property value,
+ * you must free this memory using g_value_unset() once you are
+ * done with it.
+ *
+ * Gets a property value as retrieved from the style settings that apply
+ * to the currently rendered element.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_theming_engine_get_property (GtkThemingEngine *engine,
+ const gchar *property,
+ GtkStateFlags state,
+ GValue *value)
+{
+ GtkThemingEnginePrivate *priv;
+
+ g_return_if_fail (GTK_IS_THEMING_ENGINE (engine));
+ g_return_if_fail (property != NULL);
+ g_return_if_fail (value != NULL);
+
+ priv = engine->priv;
+ gtk_style_context_get_property (priv->context, property, state, value);
+}
+
+/**
+ * gtk_theming_engine_get_valist:
+ * @engine: a #GtkThemingEngine
+ * @state: state to retrieve values for
+ * @args: va_list of property name/return location pairs, followed by %NULL
+ *
+ * Retrieves several style property values that apply to the currently
+ * rendered element.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_theming_engine_get_valist (GtkThemingEngine *engine,
+ GtkStateFlags state,
+ va_list args)
+{
+ GtkThemingEnginePrivate *priv;
+
+ g_return_if_fail (GTK_IS_THEMING_ENGINE (engine));
+
+ priv = engine->priv;
+ gtk_style_context_get_valist (priv->context, state, args);
+}
+
+/**
+ * gtk_theming_engine_get:
+ * @engine: a #GtkThemingEngine
+ * @state: state to retrieve values for
+ * @...: property name /return value pairs, followed by %NULL
+ *
+ * Retrieves several style property values that apply to the currently
+ * rendered element.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_theming_engine_get (GtkThemingEngine *engine,
+ GtkStateFlags state,
+ ...)
+{
+ GtkThemingEnginePrivate *priv;
+ va_list args;
+
+ g_return_if_fail (GTK_IS_THEMING_ENGINE (engine));
+
+ priv = engine->priv;
+
+ va_start (args, state);
+ gtk_style_context_get_valist (priv->context, state, args);
+ va_end (args);
+}
+
+/**
+ * gtk_theming_engine_get_style_property:
+ * @engine: a #GtkThemingEngine
+ * @property_name: the name of the widget style property
+ * @value: (out) (transfer full): Return location for the property value, free with
+ * g_value_unset() after use.
+ *
+ * Gets the value for a widget style property.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_theming_engine_get_style_property (GtkThemingEngine *engine,
+ const gchar *property_name,
+ GValue *value)
+{
+ GtkThemingEnginePrivate *priv;
+
+ g_return_if_fail (GTK_IS_THEMING_ENGINE (engine));
+ g_return_if_fail (property_name != NULL);
+
+ priv = engine->priv;
+ gtk_style_context_get_style_property (priv->context, property_name, value);
+}
+
+/**
+ * gtk_theming_engine_get_style_valist:
+ * @engine: a #GtkThemingEngine
+ * @args: va_list of property name/return location pairs, followed by %NULL
+ *
+ * Retrieves several widget style properties from @engine according to the
+ * currently rendered content's style.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_theming_engine_get_style_valist (GtkThemingEngine *engine,
+ va_list args)
+{
+ GtkThemingEnginePrivate *priv;
+
+ g_return_if_fail (GTK_IS_THEMING_ENGINE (engine));
+
+ priv = engine->priv;
+ gtk_style_context_get_style_valist (priv->context, args);
+}
+
+/**
+ * gtk_theming_engine_get_style:
+ * @engine: a #GtkThemingEngine
+ * @...: property name /return value pairs, followed by %NULL
+ *
+ * Retrieves several widget style properties from @engine according
+ * to the currently rendered content's style.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_theming_engine_get_style (GtkThemingEngine *engine,
+ ...)
+{
+ GtkThemingEnginePrivate *priv;
+ va_list args;
+
+ g_return_if_fail (GTK_IS_THEMING_ENGINE (engine));
+
+ priv = engine->priv;
+
+ va_start (args, engine);
+ gtk_style_context_get_style_valist (priv->context, args);
+ va_end (args);
+}
+
+/**
+ * gtk_theming_engine_lookup_color:
+ * @engine: a #GtkThemingEngine
+ * @color_name: color name to lookup
+ * @color: (out): Return location for the looked up color
+ *
+ * Looks up and resolves a color name in the current style's color map.
+ *
+ * Returns: %TRUE if @color_name was found and resolved, %FALSE otherwise
+ **/
+gboolean
+gtk_theming_engine_lookup_color (GtkThemingEngine *engine,
+ const gchar *color_name,
+ GdkRGBA *color)
+{
+ GtkThemingEnginePrivate *priv;
+
+ g_return_val_if_fail (GTK_IS_THEMING_ENGINE (engine), FALSE);
+ g_return_val_if_fail (color_name != NULL, FALSE);
+
+ priv = engine->priv;
+ return gtk_style_context_lookup_color (priv->context, color_name, color);
+}
+
+/**
+ * gtk_theming_engine_get_state:
+ * @engine: a #GtkThemingEngine
+ *
+ * returns the state used when rendering.
+ *
+ * Returns: the state flags
+ *
+ * Since: 3.0
+ **/
+GtkStateFlags
+gtk_theming_engine_get_state (GtkThemingEngine *engine)
+{
+ GtkThemingEnginePrivate *priv;
+
+ g_return_val_if_fail (GTK_IS_THEMING_ENGINE (engine), 0);
+
+ priv = engine->priv;
+ return gtk_style_context_get_state (priv->context);
+}
+
+/**
+ * gtk_theming_engine_state_is_running:
+ * @engine: a #GtkThemingEngine
+ * @state: a widget state
+ * @progress: (out): return location for the transition progress
+ *
+ * Returns %TRUE if there is a transition animation running for the
+ * current region (see gtk_style_context_push_animatable_region()).
+ *
+ * If @progress is not %NULL, the animation progress will be returned
+ * there, 0.0 means the state is closest to being %FALSE, while 1.0 means
+ * it's closest to being %TRUE. This means transition animations will
+ * run from 0 to 1 when @state is being set to %TRUE and from 1 to 0 when
+ * it's being set to %FALSE.
+ *
+ * Returns: %TRUE if there is a running transition animation for @state.
+ *
+ * Since: 3.0
+ **/
+gboolean
+gtk_theming_engine_state_is_running (GtkThemingEngine *engine,
+ GtkStateType state,
+ gdouble *progress)
+{
+ GtkThemingEnginePrivate *priv;
+
+ g_return_val_if_fail (GTK_IS_THEMING_ENGINE (engine), FALSE);
+
+ priv = engine->priv;
+ return gtk_style_context_state_is_running (priv->context, state, progress);
+}
+
+/**
+ * gtk_theming_engine_get_path:
+ * @engine: a #GtkThemingEngine
+ *
+ * Returns the widget path used for style matching.
+ *
+ * Returns: (transfer none): A #GtkWidgetPath
+ *
+ * Since: 3.0
+ **/
+G_CONST_RETURN GtkWidgetPath *
+gtk_theming_engine_get_path (GtkThemingEngine *engine)
+{
+ GtkThemingEnginePrivate *priv;
+
+ g_return_val_if_fail (GTK_IS_THEMING_ENGINE (engine), NULL);
+
+ priv = engine->priv;
+ return gtk_style_context_get_path (priv->context);
+}
+
+/**
+ * gtk_theming_engine_has_class:
+ * @engine: a #GtkThemingEngine
+ * @style_class: class name to look up
+ *
+ * Returns %TRUE if the currently rendered contents have
+ * defined the given class name.
+ *
+ * Returns: %TRUE if @engine has @class_name defined
+ *
+ * Since: 3.0
+ **/
+gboolean
+gtk_theming_engine_has_class (GtkThemingEngine *engine,
+ const gchar *style_class)
+{
+ GtkThemingEnginePrivate *priv;
+
+ g_return_val_if_fail (GTK_IS_THEMING_ENGINE (engine), FALSE);
+
+ priv = engine->priv;
+ return gtk_style_context_has_class (priv->context, style_class);
+}
+
+/**
+ * gtk_theming_engine_has_region:
+ * @engine: a #GtkThemingEngine
+ * @style_region: a region name
+ * @flags: (out) (allow-none): return location for region flags
+ *
+ * Returns %TRUE if the currently rendered contents have the
+ * region defined. If @flags_return is not %NULL, it is set
+ * to the flags affecting the region.
+ *
+ * Returns: %TRUE if region is defined
+ *
+ * Since: 3.0
+ **/
+gboolean
+gtk_theming_engine_has_region (GtkThemingEngine *engine,
+ const gchar *style_region,
+ GtkRegionFlags *flags)
+{
+ GtkThemingEnginePrivate *priv;
+
+ if (flags)
+ *flags = 0;
+
+ g_return_val_if_fail (GTK_IS_THEMING_ENGINE (engine), FALSE);
+
+ priv = engine->priv;
+ return gtk_style_context_has_region (priv->context, style_region, flags);
+}
+
+/**
+ * gtk_theming_engine_get_direction:
+ * @engine: a #GtkThemingEngine
+ *
+ * Returns the widget direction used for rendering.
+ *
+ * Returns: the widget direction
+ *
+ * Since: 3.0
+ **/
+GtkTextDirection
+gtk_theming_engine_get_direction (GtkThemingEngine *engine)
+{
+ GtkThemingEnginePrivate *priv;
+
+ g_return_val_if_fail (GTK_IS_THEMING_ENGINE (engine), GTK_TEXT_DIR_LTR);
+
+ priv = engine->priv;
+ return gtk_style_context_get_direction (priv->context);
+}
+
+/**
+ * gtk_theming_engine_get_junction_sides:
+ * @engine: a #GtkThemingEngine
+ *
+ * Returns the widget direction used for rendering.
+ *
+ * Returns: the widget direction
+ *
+ * Since: 3.0
+ **/
+GtkJunctionSides
+gtk_theming_engine_get_junction_sides (GtkThemingEngine *engine)
+{
+ GtkThemingEnginePrivate *priv;
+
+ g_return_val_if_fail (GTK_IS_THEMING_ENGINE (engine), 0);
+
+ priv = engine->priv;
+ return gtk_style_context_get_junction_sides (priv->context);
+}
+
+/**
+ * gtk_theming_engine_get_color:
+ * @engine: a #GtkThemingEngine
+ * @state: state to retrieve the color for
+ * @color: (out): return value for the foreground color
+ *
+ * Gets the foreground color for a given state.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_theming_engine_get_color (GtkThemingEngine *engine,
+ GtkStateFlags state,
+ GdkRGBA *color)
+{
+ GtkThemingEnginePrivate *priv;
+
+ g_return_if_fail (GTK_IS_THEMING_ENGINE (engine));
+
+ priv = engine->priv;
+ gtk_style_context_get_color (priv->context, state, color);
+}
+
+/**
+ * gtk_theming_engine_get_background_color:
+ * @engine: a #GtkThemingEngine
+ * @state: state to retrieve the color for
+ * @color: (out): return value for the background color
+ *
+ * Gets the background color for a given state.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_theming_engine_get_background_color (GtkThemingEngine *engine,
+ GtkStateFlags state,
+ GdkRGBA *color)
+{
+ GtkThemingEnginePrivate *priv;
+
+ g_return_if_fail (GTK_IS_THEMING_ENGINE (engine));
+
+ priv = engine->priv;
+ gtk_style_context_get_background_color (priv->context, state, color);
+}
+
+/**
+ * gtk_theming_engine_get_border_color:
+ * @engine: a #GtkThemingEngine
+ * @state: state to retrieve the color for
+ * @color: (out): return value for the border color
+ *
+ * Gets the border color for a given state.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_theming_engine_get_border_color (GtkThemingEngine *engine,
+ GtkStateFlags state,
+ GdkRGBA *color)
+{
+ GtkThemingEnginePrivate *priv;
+
+ g_return_if_fail (GTK_IS_THEMING_ENGINE (engine));
+
+ priv = engine->priv;
+ gtk_style_context_get_border_color (priv->context, state, color);
+}
+
+/**
+ * gtk_theming_engine_get_border:
+ * @engine: a #GtkthemingEngine
+ * @state: state to retrieve the border for
+ * @color: (out): return value for the border settings
+ *
+ * Gets the border for a given state as a #GtkBorder.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_theming_engine_get_border (GtkThemingEngine *engine,
+ GtkStateFlags state,
+ GtkBorder *border)
+{
+ GtkThemingEnginePrivate *priv;
+
+ g_return_if_fail (GTK_IS_THEMING_ENGINE (engine));
+
+ priv = engine->priv;
+ gtk_style_context_get_border (priv->context, state, border);
+}
+
+/**
+ * gtk_theming_engine_get_padding:
+ * @engine: a #GtkthemingEngine
+ * @state: state to retrieve the padding for
+ * @color: (out): return value for the padding settings
+ *
+ * Gets the padding for a given state as a #GtkBorder.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_theming_engine_get_padding (GtkThemingEngine *engine,
+ GtkStateFlags state,
+ GtkBorder *padding)
+{
+ GtkThemingEnginePrivate *priv;
+
+ g_return_if_fail (GTK_IS_THEMING_ENGINE (engine));
+
+ priv = engine->priv;
+ gtk_style_context_get_padding (priv->context, state, padding);
+}
+
+/**
+ * gtk_theming_engine_get_margin:
+ * @engien: a #GtkThemingEngine
+ * @state: state to retrieve the border for
+ * @color: (out): return value for the margin settings
+ *
+ * Gets the margin for a given state as a #GtkBorder.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_theming_engine_get_margin (GtkThemingEngine *engine,
+ GtkStateFlags state,
+ GtkBorder *margin)
+{
+ GtkThemingEnginePrivate *priv;
+
+ g_return_if_fail (GTK_IS_THEMING_ENGINE (engine));
+
+ priv = engine->priv;
+ gtk_style_context_get_margin (priv->context, state, margin);
+}
+
+
+/* GtkThemingModule */
+
+static gboolean
+gtk_theming_module_load (GTypeModule *type_module)
+{
+ GtkThemingModule *theming_module;
+ GModule *module;
+ gchar *name, *module_path;
+
+ theming_module = GTK_THEMING_MODULE (type_module);
+ name = theming_module->name;
+ module_path = _gtk_find_module (name, "theming-engines");
+
+ if (!module_path)
+ {
+ g_warning (_("Unable to locate theme engine in module path: \"%s\","), name);
+ return FALSE;
+ }
+
+ module = g_module_open (module_path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
+ g_free (module_path);
+
+ if (!module)
+ {
+ g_warning ("%s", g_module_error ());
+ return FALSE;
+ }
+
+ if (!g_module_symbol (module, "theme_init",
+ (gpointer *) &theming_module->init) ||
+ !g_module_symbol (module, "theme_exit",
+ (gpointer *) &theming_module->exit) ||
+ !g_module_symbol (module, "create_engine",
+ (gpointer *) &theming_module->create_engine))
+ {
+ g_warning ("%s", g_module_error ());
+ g_module_close (module);
+
+ return FALSE;
+ }
+
+ theming_module->module = module;
+
+ theming_module->init (G_TYPE_MODULE (theming_module));
+
+ return TRUE;
+}
+
+static void
+gtk_theming_module_unload (GTypeModule *type_module)
+{
+ GtkThemingModule *theming_module;
+
+ theming_module = GTK_THEMING_MODULE (type_module);
+
+ theming_module->exit ();
+
+ g_module_close (theming_module->module);
+
+ theming_module->module = NULL;
+ theming_module->init = NULL;
+ theming_module->exit = NULL;
+ theming_module->create_engine = NULL;
+}
+
+static void
+gtk_theming_module_class_init (GtkThemingModuleClass *klass)
+{
+ GTypeModuleClass *module_class = G_TYPE_MODULE_CLASS (klass);
+
+ module_class->load = gtk_theming_module_load;
+ module_class->unload = gtk_theming_module_unload;
+}
+
+static void
+gtk_theming_module_init (GtkThemingModule *module)
+{
+}
+
+/**
+ * gtk_theming_engine_load:
+ * @name: Theme engine name to load
+ *
+ * Loads and initializes a theming engine module from the
+ * standard directories.
+ *
+ * Returns: (transfer none): A theming engine, or %NULL if
+ * the engine @name doesn't exist.
+ **/
+GtkThemingEngine *
+gtk_theming_engine_load (const gchar *name)
+{
+ static GHashTable *engines = NULL;
+ static GtkThemingEngine *default_engine;
+ GtkThemingEngine *engine = NULL;
+
+ if (name)
+ {
+ if (!engines)
+ engines = g_hash_table_new (g_str_hash, g_str_equal);
+
+ engine = g_hash_table_lookup (engines, name);
+
+ if (!engine)
+ {
+ GtkThemingModule *module;
+
+ module = g_object_new (GTK_TYPE_THEMING_MODULE, NULL);
+ g_type_module_set_name (G_TYPE_MODULE (module), name);
+ module->name = g_strdup (name);
+
+ if (module && g_type_module_use (G_TYPE_MODULE (module)))
+ {
+ engine = (module->create_engine) ();
+
+ if (engine)
+ g_hash_table_insert (engines, module->name, engine);
+ }
+ }
+ }
+
+ if (!engine)
+ {
+ if (G_UNLIKELY (!default_engine))
+ default_engine = g_object_new (GTK_TYPE_THEMING_ENGINE, NULL);
+
+ engine = default_engine;
+ }
+
+ return engine;
+}
+
+/**
+ * gtk_theming_engine_get_screen:
+ * @engine: a #GtkThemingEngine
+ *
+ * Returns the #GdkScreen to which @engine currently rendering to.
+ *
+ * Returns: a #GdkScreen, or %NULL.
+ **/
+GdkScreen *
+gtk_theming_engine_get_screen (GtkThemingEngine *engine)
+{
+ GtkThemingEnginePrivate *priv;
+
+ g_return_val_if_fail (GTK_IS_THEMING_ENGINE (engine), NULL);
+
+ priv = engine->priv;
+ return gtk_style_context_get_screen (priv->context);
+}
+
+/* Paint method implementations */
+static void
+gtk_theming_engine_render_check (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height)
+{
+ GdkRGBA *fg_color, *bg_color, *border_color;
+ GtkStateFlags flags;
+ gint exterior_size, interior_size, thickness, pad;
+ GtkBorderStyle border_style;
+ GtkBorder *border;
+ gint border_width;
+
+ flags = gtk_theming_engine_get_state (engine);
+ cairo_save (cr);
+
+ gtk_theming_engine_get (engine, flags,
+ "color", &fg_color,
+ "background-color", &bg_color,
+ "border-color", &border_color,
+ "border-style", &border_style,
+ "border-width", &border,
+ NULL);
+
+ border_width = MIN (MIN (border->top, border->bottom),
+ MIN (border->left, border->right));
+ exterior_size = MIN (width, height);
+
+ if (exterior_size % 2 == 0) /* Ensure odd */
+ exterior_size -= 1;
+
+ /* FIXME: thickness */
+ thickness = 1;
+ pad = thickness + MAX (1, (exterior_size - 2 * thickness) / 9);
+ interior_size = MAX (1, exterior_size - 2 * pad);
+
+ if (interior_size < 7)
+ {
+ interior_size = 7;
+ pad = MAX (0, (exterior_size - interior_size) / 2);
+ }
+
+ x -= (1 + exterior_size - (gint) width) / 2;
+ y -= (1 + exterior_size - (gint) height) / 2;
+
+ if (border_style == GTK_BORDER_STYLE_SOLID)
+ {
+ cairo_set_line_width (cr, border_width);
+
+ cairo_rectangle (cr, x + 0.5, y + 0.5, exterior_size - 1, exterior_size - 1);
+ gdk_cairo_set_source_rgba (cr, bg_color);
+ cairo_fill_preserve (cr);
+
+ if (border_color)
+ gdk_cairo_set_source_rgba (cr, border_color);
+ else
+ gdk_cairo_set_source_rgba (cr, fg_color);
+
+ cairo_stroke (cr);
+ }
+
+ gdk_cairo_set_source_rgba (cr, fg_color);
+
+ if (flags & GTK_STATE_FLAG_INCONSISTENT)
+ {
+ int line_thickness = MAX (1, (3 + interior_size * 2) / 7);
+
+ cairo_rectangle (cr,
+ x + pad,
+ y + pad + (1 + interior_size - line_thickness) / 2,
+ interior_size,
+ line_thickness);
+ cairo_fill (cr);
+ }
+ else
+ {
+ gdouble progress;
+ gboolean running;
+
+ running = gtk_theming_engine_state_is_running (engine, GTK_STATE_ACTIVE, &progress);
+
+ if ((flags & GTK_STATE_FLAG_ACTIVE) || running)
+ {
+ if (!running)
+ progress = 1;
+
+ cairo_translate (cr,
+ x + pad, y + pad);
+
+ cairo_scale (cr, interior_size / 7., interior_size / 7.);
+
+ cairo_rectangle (cr, 0, 0, 7 * progress, 7);
+ cairo_clip (cr);
+
+ cairo_move_to (cr, 7.0, 0.0);
+ cairo_line_to (cr, 7.5, 1.0);
+ cairo_curve_to (cr, 5.3, 2.0,
+ 4.3, 4.0,
+ 3.5, 7.0);
+ cairo_curve_to (cr, 3.0, 5.7,
+ 1.3, 4.7,
+ 0.0, 4.7);
+ cairo_line_to (cr, 0.2, 3.5);
+ cairo_curve_to (cr, 1.1, 3.5,
+ 2.3, 4.3,
+ 3.0, 5.0);
+ cairo_curve_to (cr, 1.0, 3.9,
+ 2.4, 4.1,
+ 3.2, 4.9);
+ cairo_curve_to (cr, 3.5, 3.1,
+ 5.2, 2.0,
+ 7.0, 0.0);
+
+ cairo_fill (cr);
+ }
+ }
+
+ cairo_restore (cr);
+
+ gdk_rgba_free (fg_color);
+ gdk_rgba_free (bg_color);
+ gdk_rgba_free (border_color);
+ gtk_border_free (border);
+}
+
+static void
+gtk_theming_engine_render_option (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height)
+{
+ GtkStateFlags flags;
+ GdkRGBA *fg_color, *bg_color, *border_color;
+ gint exterior_size, interior_size, pad, thickness, border_width;
+ GtkBorderStyle border_style;
+ GtkBorder *border;
+ gdouble radius;
+
+ flags = gtk_theming_engine_get_state (engine);
+ radius = MIN (width, height) / 2 - 0.5;
+
+ cairo_save (cr);
+
+ gtk_theming_engine_get (engine, flags,
+ "color", &fg_color,
+ "background-color", &bg_color,
+ "border-color", &border_color,
+ "border-style", &border_style,
+ "border-width", &border,
+ NULL);
+
+ exterior_size = MIN (width, height);
+ border_width = MIN (MIN (border->top, border->bottom),
+ MIN (border->left, border->right));
+
+ if (exterior_size % 2 == 0) /* Ensure odd */
+ exterior_size -= 1;
+
+ x -= (1 + exterior_size - width) / 2;
+ y -= (1 + exterior_size - height) / 2;
+
+ if (border_style == GTK_BORDER_STYLE_SOLID)
+ {
+ cairo_set_line_width (cr, border_width);
+ cairo_arc (cr,
+ x + exterior_size / 2.,
+ y + exterior_size / 2.,
+ (exterior_size - 1) / 2.,
+ 0, 2 * G_PI);
+
+ gdk_cairo_set_source_rgba (cr, bg_color);
+ cairo_fill_preserve (cr);
+
+ if (border_color)
+ gdk_cairo_set_source_rgba (cr, border_color);
+ else
+ gdk_cairo_set_source_rgba (cr, fg_color);
+
+ cairo_stroke (cr);
+ }
+
+ gdk_cairo_set_source_rgba (cr, fg_color);
+
+ /* FIXME: thickness */
+ thickness = 1;
+
+ if (flags & GTK_STATE_FLAG_INCONSISTENT)
+ {
+ gint line_thickness;
+
+ pad = thickness + MAX (1, (exterior_size - 2 * thickness) / 9);
+ interior_size = MAX (1, exterior_size - 2 * pad);
+
+ if (interior_size < 7)
+ {
+ interior_size = 7;
+ pad = MAX (0, (exterior_size - interior_size) / 2);
+ }
+
+ line_thickness = MAX (1, (3 + interior_size * 2) / 7);
+
+ cairo_rectangle (cr,
+ x + pad,
+ y + pad + (interior_size - line_thickness) / 2.,
+ interior_size,
+ line_thickness);
+ cairo_fill (cr);
+ }
+ if (flags & GTK_STATE_FLAG_ACTIVE)
+ {
+ pad = thickness + MAX (1, 2 * (exterior_size - 2 * thickness) / 9);
+ interior_size = MAX (1, exterior_size - 2 * pad);
+
+ if (interior_size < 5)
+ {
+ interior_size = 7;
+ pad = MAX (0, (exterior_size - interior_size) / 2);
+ }
+
+ cairo_arc (cr,
+ x + pad + interior_size / 2.,
+ y + pad + interior_size / 2.,
+ interior_size / 2.,
+ 0, 2 * G_PI);
+ cairo_fill (cr);
+ }
+
+ cairo_restore (cr);
+
+ gdk_rgba_free (fg_color);
+ gdk_rgba_free (bg_color);
+ gdk_rgba_free (border_color);
+ gtk_border_free (border);
+}
+
+static void
+add_path_arrow (cairo_t *cr,
+ gdouble angle,
+ gdouble x,
+ gdouble y,
+ gdouble size)
+{
+ cairo_save (cr);
+
+ cairo_translate (cr, x + (size / 2), y + (size / 2));
+ cairo_rotate (cr, angle);
+
+ cairo_move_to (cr, 0, - (size / 4));
+ cairo_line_to (cr, - (size / 2), (size / 4));
+ cairo_line_to (cr, (size / 2), (size / 4));
+ cairo_close_path (cr);
+
+ cairo_restore (cr);
+}
+
+static void
+gtk_theming_engine_render_arrow (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble angle,
+ gdouble x,
+ gdouble y,
+ gdouble size)
+{
+ GtkStateFlags flags;
+ GdkRGBA *fg_color;
+
+ cairo_save (cr);
+
+ flags = gtk_theming_engine_get_state (engine);
+
+ gtk_theming_engine_get (engine, flags,
+ "color", &fg_color,
+ NULL);
+
+ if (flags & GTK_STATE_FLAG_INSENSITIVE)
+ {
+ add_path_arrow (cr, angle, x + 1, y + 1, size);
+ cairo_set_source_rgb (cr, 1, 1, 1);
+ cairo_fill (cr);
+ }
+
+ add_path_arrow (cr, angle, x, y, size);
+ gdk_cairo_set_source_rgba (cr, fg_color);
+ cairo_fill (cr);
+
+ cairo_restore (cr);
+
+ gdk_rgba_free (fg_color);
+}
+
+static void
+add_path_line (cairo_t *cr,
+ gdouble x1,
+ gdouble y1,
+ gdouble x2,
+ gdouble y2)
+{
+ /* Adjust endpoints */
+ if (y1 == y2)
+ {
+ y1 += 0.5;
+ y2 += 0.5;
+ x2 += 1;
+ }
+ else if (x1 == x2)
+ {
+ x1 += 0.5;
+ x2 += 0.5;
+ y2 += 1;
+ }
+
+ cairo_move_to (cr, x1, y1);
+ cairo_line_to (cr, x2, y2);
+}
+
+static void
+color_shade (const GdkRGBA *color,
+ gdouble factor,
+ GdkRGBA *color_return)
+{
+ GtkSymbolicColor *literal, *shade;
+
+ literal = gtk_symbolic_color_new_literal (color);
+ shade = gtk_symbolic_color_new_shade (literal, factor);
+ gtk_symbolic_color_unref (literal);
+
+ gtk_symbolic_color_resolve (shade, NULL, color_return);
+ gtk_symbolic_color_unref (shade);
+}
+
+static void
+_cairo_round_rectangle_sides (cairo_t *cr,
+ gdouble radius,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height,
+ guint sides,
+ GtkJunctionSides junction)
+{
+ radius = CLAMP (radius, 0, MIN (width / 2, height / 2));
+
+ if (sides & SIDE_RIGHT)
+ {
+ if (radius == 0 ||
+ (junction & GTK_JUNCTION_CORNER_TOPRIGHT))
+ cairo_move_to (cr, x + width, y);
+ else
+ {
+ cairo_new_sub_path (cr);
+ cairo_arc (cr, x + width - radius, y + radius, radius, - G_PI / 4, 0);
+ }
+
+ if (radius == 0 ||
+ (junction & GTK_JUNCTION_CORNER_BOTTOMRIGHT))
+ cairo_line_to (cr, x + width, y + height);
+ else
+ cairo_arc (cr, x + width - radius, y + height - radius, radius, 0, G_PI / 4);
+ }
+
+ if (sides & SIDE_BOTTOM)
+ {
+ if (radius != 0 &&
+ ! (junction & GTK_JUNCTION_CORNER_BOTTOMRIGHT))
+ {
+ if ((sides & SIDE_RIGHT) == 0)
+ cairo_new_sub_path (cr);
+
+ cairo_arc (cr, x + width - radius, y + height - radius, radius, G_PI / 4, G_PI / 2);
+ }
+ else if ((sides & SIDE_RIGHT) == 0)
+ cairo_move_to (cr, x + width, y + height);
+
+ if (radius == 0 ||
+ (junction & GTK_JUNCTION_CORNER_BOTTOMLEFT))
+ cairo_line_to (cr, x, y + height);
+ else
+ cairo_arc (cr, x + radius, y + height - radius, radius, G_PI / 2, 3 * (G_PI / 4));
+ }
+ else
+ cairo_move_to (cr, x, y + height);
+
+ if (sides & SIDE_LEFT)
+ {
+ if (radius != 0 &&
+ ! (junction & GTK_JUNCTION_CORNER_BOTTOMLEFT))
+ {
+ if ((sides & SIDE_BOTTOM) == 0)
+ cairo_new_sub_path (cr);
+
+ cairo_arc (cr, x + radius, y + height - radius, radius, 3 * (G_PI / 4), G_PI);
+ }
+ else if ((sides & SIDE_BOTTOM) == 0)
+ cairo_move_to (cr, x, y + height);
+
+ if (radius == 0 ||
+ (junction & GTK_JUNCTION_CORNER_TOPLEFT))
+ cairo_line_to (cr, x, y);
+ else
+ cairo_arc (cr, x + radius, y + radius, radius, G_PI, G_PI + G_PI / 4);
+ }
+
+ if (sides & SIDE_TOP)
+ {
+ if (radius != 0 &&
+ ! (junction & GTK_JUNCTION_CORNER_TOPLEFT))
+ {
+ if ((sides & SIDE_LEFT) == 0)
+ cairo_new_sub_path (cr);
+
+ cairo_arc (cr, x + radius, y + radius, radius, 5 * (G_PI / 4), 3 * (G_PI / 2));
+ }
+ else if ((sides & SIDE_LEFT) == 0)
+ cairo_move_to (cr, x, y);
+
+ if (radius == 0 ||
+ (junction & GTK_JUNCTION_CORNER_TOPRIGHT))
+ cairo_line_to (cr, x + width, y);
+ else
+ cairo_arc (cr, x + width - radius, y + radius, radius, 3 * (G_PI / 2), - G_PI / 4);
+ }
+}
+
+static void
+render_background_internal (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height,
+ GtkJunctionSides junction)
+{
+ GdkRGBA *bg_color;
+ cairo_pattern_t *pattern;
+ GtkStateFlags flags;
+ gboolean running;
+ gdouble progress, alpha = 1;
+ gint radius, border_width;
+ GtkBorder *border;
+
+ flags = gtk_theming_engine_get_state (engine);
+ cairo_save (cr);
+
+ gtk_theming_engine_get (engine, flags,
+ "background-image", &pattern,
+ "background-color", &bg_color,
+ "border-width", &border,
+ "border-radius", &radius,
+ NULL);
+
+ running = gtk_theming_engine_state_is_running (engine, GTK_STATE_PRELIGHT, &progress);
+ border_width = MIN (MIN (border->top, border->bottom),
+ MIN (border->left, border->right));
+
+ _cairo_round_rectangle_sides (cr, (gdouble) radius,
+ x, y, width, height,
+ SIDE_ALL, junction);
+ cairo_clip (cr);
+
+ if (gtk_theming_engine_has_class (engine, "background"))
+ {
+ cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.0); /* transparent */
+ cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
+ cairo_paint (cr);
+ }
+
+ cairo_translate (cr, x, y);
+ cairo_scale (cr, width, height);
+
+ if (running)
+ {
+ cairo_pattern_t *other_pattern;
+ GtkStateFlags other_flags;
+ GdkRGBA *other_bg;
+ cairo_pattern_t *new_pattern = NULL;
+
+ if (flags & GTK_STATE_FLAG_PRELIGHT)
+ {
+ other_flags = flags & ~(GTK_STATE_FLAG_PRELIGHT);
+ progress = 1 - progress;
+ }
+ else
+ other_flags = flags | GTK_STATE_FLAG_PRELIGHT;
+
+ gtk_theming_engine_get (engine, other_flags,
+ "background-image", &other_pattern,
+ "background-color", &other_bg,
+ NULL);
+
+ if (pattern && other_pattern)
+ {
+ cairo_pattern_type_t type, other_type;
+ gint n0, n1;
+
+ cairo_pattern_get_color_stop_count (pattern, &n0);
+ cairo_pattern_get_color_stop_count (other_pattern, &n1);
+ type = cairo_pattern_get_type (pattern);
+ other_type = cairo_pattern_get_type (other_pattern);
+
+ if (type == other_type && n0 == n1)
+ {
+ gdouble offset0, red0, green0, blue0, alpha0;
+ gdouble offset1, red1, green1, blue1, alpha1;
+ gdouble x00, x01, y00, y01, x10, x11, y10, y11;
+ gdouble r00, r01, r10, r11;
+ guint i;
+
+ if (type == CAIRO_PATTERN_TYPE_LINEAR)
+ {
+ cairo_pattern_get_linear_points (pattern, &x00, &y00, &x01, &y01);
+ cairo_pattern_get_linear_points (other_pattern, &x10, &y10, &x11, &y11);
+
+ new_pattern = cairo_pattern_create_linear (x00 + (x10 - x00) * progress,
+ y00 + (y10 - y00) * progress,
+ x01 + (x11 - x01) * progress,
+ y01 + (y11 - y01) * progress);
+ }
+ else
+ {
+ cairo_pattern_get_radial_circles (pattern, &x00, &y00, &r00, &x01, &y01, &r01);
+ cairo_pattern_get_radial_circles (other_pattern, &x10, &y10, &r10, &x11, &y11, &r11);
+
+ new_pattern = cairo_pattern_create_radial (x00 + (x10 - x00) * progress,
+ y00 + (y10 - y00) * progress,
+ r00 + (r10 - r00) * progress,
+ x01 + (x11 - x01) * progress,
+ y01 + (y11 - y01) * progress,
+ r01 + (r11 - r01) * progress);
+ }
+
+ cairo_pattern_set_filter (new_pattern, CAIRO_FILTER_FAST);
+ i = 0;
+
+ /* Blend both gradients into one */
+ while (i < n0 && i < n1)
+ {
+ cairo_pattern_get_color_stop_rgba (pattern, i,
+ &offset0,
+ &red0, &green0, &blue0,
+ &alpha0);
+ cairo_pattern_get_color_stop_rgba (other_pattern, i,
+ &offset1,
+ &red1, &green1, &blue1,
+ &alpha1);
+
+ cairo_pattern_add_color_stop_rgba (new_pattern,
+ offset0 + ((offset1 - offset0) * progress),
+ red0 + ((red1 - red0) * progress),
+ green0 + ((green1 - green0) * progress),
+ blue0 + ((blue1 - blue0) * progress),
+ alpha0 + ((alpha1 - alpha0) * progress));
+ i++;
+ }
+ }
+ else
+ {
+ /* Different pattern types, or different color
+ * stop counts, alpha blend both patterns.
+ */
+ cairo_rectangle (cr, 0, 0, 1, 1);
+ cairo_set_source (cr, other_pattern);
+ cairo_fill_preserve (cr);
+
+ /* Set alpha for posterior drawing
+ * of the target pattern
+ */
+ alpha = 1 - progress;
+ }
+ }
+ else if (pattern || other_pattern)
+ {
+ cairo_pattern_t *p;
+ const GdkRGBA *c;
+ gdouble x0, y0, x1, y1, r0, r1;
+ gint n, i;
+
+ /* Blend a pattern with a color */
+ if (pattern)
+ {
+ p = pattern;
+ c = other_bg;
+ progress = 1 - progress;
+ }
+ else
+ {
+ p = other_pattern;
+ c = bg_color;
+ }
+
+ if (cairo_pattern_get_type (p) == CAIRO_PATTERN_TYPE_LINEAR)
+ {
+ cairo_pattern_get_linear_points (p, &x0, &y0, &x1, &y1);
+ new_pattern = cairo_pattern_create_linear (x0, y0, x1, y1);
+ }
+ else
+ {
+ cairo_pattern_get_radial_circles (p, &x0, &y0, &r0, &x1, &y1, &r1);
+ new_pattern = cairo_pattern_create_radial (x0, y0, r0, x1, y1, r1);
+ }
+
+ cairo_pattern_get_color_stop_count (p, &n);
+
+ for (i = 0; i < n; i++)
+ {
+ gdouble red1, green1, blue1, alpha1;
+ gdouble offset;
+
+ cairo_pattern_get_color_stop_rgba (p, i,
+ &offset,
+ &red1, &green1, &blue1,
+ &alpha1);
+ cairo_pattern_add_color_stop_rgba (new_pattern, offset,
+ c->red + ((red1 - c->red) * progress),
+ c->green + ((green1 - c->green) * progress),
+ c->blue + ((blue1 - c->blue) * progress),
+ c->alpha + ((alpha1 - c->alpha) * progress));
+ }
+ }
+ else
+ {
+ const GdkRGBA *color, *other_color;
+
+ /* Merge just colors */
+ color = bg_color;
+ other_color = other_bg;
+
+ new_pattern = cairo_pattern_create_rgba (CLAMP (color->red + ((other_color->red - color->red) * progress), 0, 1),
+ CLAMP (color->green + ((other_color->green - color->green) * progress), 0, 1),
+ CLAMP (color->blue + ((other_color->blue - color->blue) * progress), 0, 1),
+ CLAMP (color->alpha + ((other_color->alpha - color->alpha) * progress), 0, 1));
+ }
+
+ if (new_pattern)
+ {
+ /* Replace pattern to use */
+ cairo_pattern_destroy (pattern);
+ pattern = new_pattern;
+ }
+
+ if (other_pattern)
+ cairo_pattern_destroy (other_pattern);
+
+ if (other_bg)
+ gdk_rgba_free (other_bg);
+ }
+
+ cairo_rectangle (cr, 0, 0, 1, 1);
+
+ if (pattern)
+ {
+ cairo_set_source (cr, pattern);
+ cairo_pattern_destroy (pattern);
+ }
+ else
+ gdk_cairo_set_source_rgba (cr, bg_color);
+
+ if (alpha == 1)
+ cairo_fill (cr);
+ else
+ {
+ cairo_pattern_t *mask;
+
+ mask = cairo_pattern_create_rgba (1, 1, 1, alpha);
+ cairo_mask (cr, mask);
+ cairo_pattern_destroy (mask);
+ }
+
+ cairo_restore (cr);
+
+ gdk_rgba_free (bg_color);
+ gtk_border_free (border);
+}
+
+static void
+gtk_theming_engine_render_background (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height)
+{
+ GtkJunctionSides junction;
+ GtkStateFlags flags;
+ GtkBorder *border;
+
+ junction = gtk_theming_engine_get_junction_sides (engine);
+
+ if (gtk_theming_engine_has_class (engine, "spinbutton") &&
+ gtk_theming_engine_has_class (engine, "button"))
+ {
+ x += 2;
+ y += 2;
+ width -= 4;
+ height -= 4;
+ }
+
+ flags = gtk_theming_engine_get_state (engine);
+ gtk_theming_engine_get (engine, flags,
+ "border-width", &border,
+ NULL);
+
+ x += border->left;
+ y += border->top;
+ width -= border->left + border->right;
+ height -= border->top + border->bottom;
+
+ render_background_internal (engine, cr,
+ x, y, width, height,
+ junction);
+
+ gtk_border_free (border);
+}
+
+/* Renders the small triangle on corners so
+ * frames with 0 radius have a 3D-like effect
+ */
+static void
+_cairo_corner_triangle (cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gint size)
+{
+ gint i;
+
+ cairo_move_to (cr, x + 0.5, y + size - 0.5);
+ cairo_line_to (cr, x + size - 0.5, y + size - 0.5);
+ cairo_line_to (cr, x + size - 0.5, y + 0.5);
+
+ for (i = 1; i < size - 1; i++)
+ {
+ cairo_move_to (cr, x + size - 0.5, y + i + 0.5);
+ cairo_line_to (cr, x + (size - i) - 0.5, y + i + 0.5);
+ }
+}
+
+static void
+render_frame_internal (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height,
+ guint hidden_side,
+ GtkJunctionSides junction)
+{
+ GtkStateFlags state;
+ GdkRGBA lighter;
+ GdkRGBA *border_color;
+ GtkBorderStyle border_style;
+ gint border_width, radius;
+ gdouble progress, d1, d2, m;
+ gboolean running;
+ GtkBorder *border;
+
+ state = gtk_theming_engine_get_state (engine);
+ gtk_theming_engine_get (engine, state,
+ "border-color", &border_color,
+ "border-style", &border_style,
+ "border-width", &border,
+ "border-radius", &radius,
+ NULL);
+
+ running = gtk_theming_engine_state_is_running (engine, GTK_STATE_PRELIGHT, &progress);
+ border_width = MIN (MIN (border->top, border->bottom),
+ MIN (border->left, border->right));
+
+ if (running)
+ {
+ GtkStateFlags other_state;
+ GdkRGBA *other_color;
+
+ if (state & GTK_STATE_FLAG_PRELIGHT)
+ {
+ other_state = state & ~(GTK_STATE_FLAG_PRELIGHT);
+ progress = 1 - progress;
+ }
+ else
+ other_state = state | GTK_STATE_FLAG_PRELIGHT;
+
+ gtk_theming_engine_get (engine, other_state,
+ "border-color", &other_color,
+ NULL);
+
+ border_color->red = CLAMP (border_color->red + ((other_color->red - border_color->red) * progress), 0, 1);
+ border_color->green = CLAMP (border_color->green + ((other_color->green - border_color->green) * progress), 0, 1);
+ border_color->blue = CLAMP (border_color->blue + ((other_color->blue - border_color->blue) * progress), 0, 1);
+ border_color->alpha = CLAMP (border_color->alpha + ((other_color->alpha - border_color->alpha) * progress), 0, 1);
+
+ gdk_rgba_free (other_color);
+ }
+
+ cairo_save (cr);
+
+ color_shade (border_color, 1.8, &lighter);
+
+ switch (border_style)
+ {
+ case GTK_BORDER_STYLE_NONE:
+ break;
+ case GTK_BORDER_STYLE_SOLID:
+ cairo_set_line_width (cr, border_width);
+ cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
+
+ if (border_width > 1)
+ {
+ x += (gdouble) border_width / 2;
+ y += (gdouble) border_width / 2;
+ width -= border_width;
+ height -= border_width;
+ }
+ else if (border_width == 1)
+ {
+ x += 0.5;
+ y += 0.5;
+ width -= 1;
+ height -= 1;
+ }
+
+ _cairo_round_rectangle_sides (cr, (gdouble) radius,
+ x, y, width, height,
+ SIDE_ALL & ~(hidden_side),
+ junction);
+ gdk_cairo_set_source_rgba (cr, border_color);
+ cairo_stroke (cr);
+
+ break;
+ case GTK_BORDER_STYLE_INSET:
+ case GTK_BORDER_STYLE_OUTSET:
+ cairo_set_line_width (cr, border_width);
+
+ if (radius == 0)
+ cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
+ else
+ cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT);
+
+ if (border_width > 1)
+ {
+ d1 = (gdouble) border_width / 2;
+ d2 = border_width;
+ }
+ else
+ {
+ d1 = 0.5;
+ d2 = 1;
+ }
+
+ cairo_save (cr);
+
+ m = MIN (width, height);
+ m /= 2;
+
+ if (border_style == GTK_BORDER_STYLE_INSET)
+ gdk_cairo_set_source_rgba (cr, &lighter);
+ else
+ gdk_cairo_set_source_rgba (cr, border_color);
+
+ _cairo_round_rectangle_sides (cr, (gdouble) radius,
+ x + d1, y + d1,
+ width - d2, height - d2,
+ (SIDE_BOTTOM | SIDE_RIGHT) & ~(hidden_side),
+ junction);
+ cairo_stroke (cr);
+
+ if (border_style == GTK_BORDER_STYLE_INSET)
+ gdk_cairo_set_source_rgba (cr, border_color);
+ else
+ gdk_cairo_set_source_rgba (cr, &lighter);
+
+ _cairo_round_rectangle_sides (cr, (gdouble) radius,
+ x + d1, y + d1,
+ width - d2, height - d2,
+ (SIDE_TOP | SIDE_LEFT) & ~(hidden_side),
+ junction);
+ cairo_stroke (cr);
+
+ if (border_width > 1)
+ {
+ /* overprint top/right and bottom/left corner
+ * triangles if there are square corners there,
+ * to give the box a 3D-like appearance.
+ */
+ cairo_save (cr);
+
+ if (border_style == GTK_BORDER_STYLE_INSET)
+ gdk_cairo_set_source_rgba (cr, &lighter);
+ else
+ gdk_cairo_set_source_rgba (cr, border_color);
+
+ cairo_set_line_width (cr, 1);
+
+ if (radius == 0 ||
+ (junction & GTK_JUNCTION_CORNER_TOPRIGHT) != 0)
+ _cairo_corner_triangle (cr,
+ x + width - border_width, y,
+ border_width);
+
+ if (radius == 0 ||
+ (junction & GTK_JUNCTION_CORNER_BOTTOMLEFT) != 0)
+ _cairo_corner_triangle (cr,
+ x, y + height - border_width,
+ border_width);
+ cairo_stroke (cr);
+ cairo_restore (cr);
+ }
+
+ cairo_restore (cr);
+ break;
+ }
+
+ cairo_restore (cr);
+
+ if (border_color)
+ gdk_rgba_free (border_color);
+
+ gtk_border_free (border);
+}
+
+static void
+gtk_theming_engine_render_frame (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height)
+{
+ GtkStateFlags flags;
+ Gtk9Slice *slice;
+ GtkBorderStyle border_style;
+ GtkJunctionSides junction;
+
+ flags = gtk_theming_engine_get_state (engine);
+ junction = gtk_theming_engine_get_junction_sides (engine);
+
+ gtk_theming_engine_get (engine, flags,
+ "border-image", &slice,
+ "border-style", &border_style,
+ NULL);
+
+ if (slice)
+ {
+ gtk_9slice_render (slice, cr, x, y, width, height);
+ gtk_9slice_unref (slice);
+ }
+ else if (border_style != GTK_BORDER_STYLE_NONE)
+ render_frame_internal (engine, cr,
+ x, y, width, height,
+ 0, junction);
+}
+
+static void
+gtk_theming_engine_render_expander (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height)
+{
+ GtkStateFlags flags;
+ GdkRGBA *outline_color, *fg_color;
+ double vertical_overshoot;
+ int diameter;
+ double radius;
+ double interp; /* interpolation factor for center position */
+ double x_double_horz, y_double_horz;
+ double x_double_vert, y_double_vert;
+ double x_double, y_double;
+ gdouble angle;
+ gint line_width;
+
+ cairo_save (cr);
+ flags = gtk_theming_engine_get_state (engine);
+
+ gtk_theming_engine_get (engine, flags,
+ "color", &fg_color,
+ NULL);
+ gtk_theming_engine_get (engine, 0,
+ "color", &outline_color,
+ NULL);
+
+ line_width = 1;
+
+ /* FIXME: LTR/RTL */
+ if (flags & GTK_STATE_FLAG_ACTIVE)
+ {
+ angle = G_PI / 2;
+ interp = 1.0;
+ }
+ else
+ {
+ angle = 0;
+ interp = 0;
+ }
+
+ /* Compute distance that the stroke extends beyonds the end
+ * of the triangle we draw.
+ */
+ vertical_overshoot = line_width / 2.0 * (1. / tan (G_PI / 8));
+
+ /* For odd line widths, we end the vertical line of the triangle
+ * at a half pixel, so we round differently.
+ */
+ if (line_width % 2 == 1)
+ vertical_overshoot = ceil (0.5 + vertical_overshoot) - 0.5;
+ else
+ vertical_overshoot = ceil (vertical_overshoot);
+
+ /* Adjust the size of the triangle we draw so that the entire stroke fits
+ */
+ diameter = (gint) MAX (3, width - 2 * vertical_overshoot);
+
+ /* If the line width is odd, we want the diameter to be even,
+ * and vice versa, so force the sum to be odd. This relationship
+ * makes the point of the triangle look right.
+ */
+ diameter -= (1 - (diameter + line_width) % 2);
+
+ radius = diameter / 2.;
+
+ /* Adjust the center so that the stroke is properly aligned with
+ * the pixel grid. The center adjustment is different for the
+ * horizontal and vertical orientations. For intermediate positions
+ * we interpolate between the two.
+ */
+ x_double_vert = floor ((x + width / 2) - (radius + line_width) / 2.) + (radius + line_width) / 2.;
+ y_double_vert = (y + height / 2) - 0.5;
+
+ x_double_horz = (x + width / 2) - 0.5;
+ y_double_horz = floor ((y + height / 2) - (radius + line_width) / 2.) + (radius + line_width) / 2.;
+
+ x_double = x_double_vert * (1 - interp) + x_double_horz * interp;
+ y_double = y_double_vert * (1 - interp) + y_double_horz * interp;
+
+ cairo_translate (cr, x_double, y_double);
+ cairo_rotate (cr, angle);
+
+ cairo_move_to (cr, - radius / 2., - radius);
+ cairo_line_to (cr, radius / 2., 0);
+ cairo_line_to (cr, - radius / 2., radius);
+ cairo_close_path (cr);
+
+ cairo_set_line_width (cr, line_width);
+
+ gdk_cairo_set_source_rgba (cr, fg_color);
+
+ cairo_fill_preserve (cr);
+
+ gdk_cairo_set_source_rgba (cr, outline_color);
+ cairo_stroke (cr);
+
+ cairo_restore (cr);
+
+ gdk_rgba_free (fg_color);
+ gdk_rgba_free (outline_color);
+}
+
+static void
+gtk_theming_engine_render_focus (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height)
+{
+ GtkStateFlags flags;
+ GdkRGBA *color;
+ gint line_width;
+ gint8 *dash_list;
+
+ cairo_save (cr);
+ flags = gtk_theming_engine_get_state (engine);
+
+ gtk_theming_engine_get (engine, flags,
+ "color", &color,
+ NULL);
+
+ gtk_theming_engine_get_style (engine,
+ "focus-line-width", &line_width,
+ "focus-line-pattern", (gchar *) &dash_list,
+ NULL);
+
+ cairo_set_line_width (cr, (gdouble) line_width);
+
+ if (dash_list[0])
+ {
+ gint n_dashes = strlen ((const gchar *) dash_list);
+ gdouble *dashes = g_new (gdouble, n_dashes);
+ gdouble total_length = 0;
+ gdouble dash_offset;
+ gint i;
+
+ for (i = 0; i < n_dashes; i++)
+ {
+ dashes[i] = dash_list[i];
+ total_length += dash_list[i];
+ }
+
+ /* The dash offset here aligns the pattern to integer pixels
+ * by starting the dash at the right side of the left border
+ * Negative dash offsets in cairo don't work
+ * (https://bugs.freedesktop.org/show_bug.cgi?id=2729)
+ */
+ dash_offset = - line_width / 2.;
+
+ while (dash_offset < 0)
+ dash_offset += total_length;
+
+ cairo_set_dash (cr, dashes, n_dashes, dash_offset);
+ g_free (dashes);
+ }
+
+ cairo_rectangle (cr,
+ x + line_width / 2.,
+ y + line_width / 2.,
+ width - line_width,
+ height - line_width);
+
+ gdk_cairo_set_source_rgba (cr, color);
+ cairo_stroke (cr);
+
+ cairo_restore (cr);
+
+ gdk_rgba_free (color);
+ g_free (dash_list);
+}
+
+static void
+gtk_theming_engine_render_line (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x0,
+ gdouble y0,
+ gdouble x1,
+ gdouble y1)
+{
+ GdkRGBA *bg_color, darker, lighter;
+ GtkStateFlags flags;
+ gint i, thickness, thickness_dark, thickness_light, len;
+ cairo_matrix_t matrix;
+ gdouble angle;
+
+ /* FIXME: thickness */
+ thickness = 2;
+ thickness_dark = thickness / 2;
+ thickness_light = thickness - thickness_dark;
+
+ flags = gtk_theming_engine_get_state (engine);
+ cairo_save (cr);
+
+ gtk_theming_engine_get (engine, flags,
+ "background-color", &bg_color,
+ NULL);
+ color_shade (bg_color, 0.7, &darker);
+ color_shade (bg_color, 1.3, &lighter);
+
+ cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
+ cairo_set_line_width (cr, 1);
+
+ angle = atan2 (x1 - x0, y1 - y0);
+ angle = (2 * G_PI) - angle;
+ angle += G_PI / 2;
+
+ cairo_get_matrix (cr, &matrix);
+ cairo_matrix_translate (&matrix, x0, y0);
+ cairo_matrix_rotate (&matrix, angle);
+ cairo_set_matrix (cr, &matrix);
+
+ x1 -= x0;
+ y1 -= y0;
+
+ len = (gint) sqrt ((x1 * x1) + (y1 * y1));
+
+ y0 = -thickness_dark;
+
+ for (i = 0; i < thickness_dark; i++)
+ {
+ gdk_cairo_set_source_rgba (cr, &lighter);
+ add_path_line (cr, len - i - 1.5, y0, len - 0.5, y0);
+ cairo_stroke (cr);
+
+ gdk_cairo_set_source_rgba (cr, &darker);
+ add_path_line (cr, 0.5, y0, len - i - 1.5, y0);
+ cairo_stroke (cr);
+
+ y0++;
+ }
+
+ for (i = 0; i < thickness_light; i++)
+ {
+ gdk_cairo_set_source_rgba (cr, &darker);
+ add_path_line (cr, 0.5, y0, thickness_light - i + 0.5, y0);
+ cairo_stroke (cr);
+
+ gdk_cairo_set_source_rgba (cr, &lighter);
+ add_path_line (cr, thickness_light - i + 0.5, y0, len - 0.5, y0);
+ cairo_stroke (cr);
+
+ y0++;
+ }
+
+ cairo_restore (cr);
+
+ gdk_rgba_free (bg_color);
+}
+
+static void
+gtk_theming_engine_render_layout (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ PangoLayout *layout)
+{
+ const PangoMatrix *matrix;
+ GdkRGBA *fg_color;
+ GtkStateFlags flags;
+ GdkScreen *screen;
+ gdouble progress;
+ gboolean running;
+
+ cairo_save (cr);
+ flags = gtk_theming_engine_get_state (engine);
+
+ gtk_theming_engine_get (engine, flags,
+ "color", &fg_color,
+ NULL);
+
+ screen = gtk_theming_engine_get_screen (engine);
+ matrix = pango_context_get_matrix (pango_layout_get_context (layout));
+
+ running = gtk_theming_engine_state_is_running (engine, GTK_STATE_PRELIGHT, &progress);
+
+ if (running)
+ {
+ GtkStateFlags other_flags;
+ GdkRGBA *other_fg;
+
+ if (flags & GTK_STATE_FLAG_PRELIGHT)
+ {
+ other_flags = flags & ~(GTK_STATE_FLAG_PRELIGHT);
+ progress = 1 - progress;
+ }
+ else
+ other_flags = flags | GTK_STATE_FLAG_PRELIGHT;
+
+ gtk_theming_engine_get (engine, other_flags,
+ "color", &other_fg,
+ NULL);
+
+ if (fg_color && other_fg)
+ {
+ fg_color->red = CLAMP (fg_color->red + ((other_fg->red - fg_color->red) * progress), 0, 1);
+ fg_color->green = CLAMP (fg_color->green + ((other_fg->green - fg_color->green) * progress), 0, 1);
+ fg_color->blue = CLAMP (fg_color->blue + ((other_fg->blue - fg_color->blue) * progress), 0, 1);
+ fg_color->alpha = CLAMP (fg_color->alpha + ((other_fg->alpha - fg_color->alpha) * progress), 0, 1);
+ }
+
+ if (other_fg)
+ gdk_rgba_free (other_fg);
+ }
+
+ if (matrix)
+ {
+ cairo_matrix_t cairo_matrix;
+ PangoMatrix tmp_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);
+
+ tmp_matrix = *matrix;
+ cairo_matrix.x0 += x - rect.x;
+ cairo_matrix.y0 += y - rect.y;
+
+ cairo_set_matrix (cr, &cairo_matrix);
+ }
+ else
+ cairo_translate (cr, x, y);
+
+ if (flags & GTK_STATE_FLAG_INSENSITIVE)
+ {
+ cairo_save (cr);
+ cairo_set_source_rgb (cr, 1, 1, 1);
+ cairo_move_to (cr, 1, 1);
+ _gtk_pango_fill_layout (cr, layout);
+ cairo_restore (cr);
+ }
+
+ gdk_cairo_set_source_rgba (cr, fg_color);
+ pango_cairo_show_layout (cr, layout);
+
+ cairo_restore (cr);
+
+ gdk_rgba_free (fg_color);
+}
+
+static void
+gtk_theming_engine_render_slider (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height,
+ GtkOrientation orientation)
+{
+ const GtkWidgetPath *path;
+ gint thickness;
+
+ path = gtk_theming_engine_get_path (engine);
+
+ gtk_theming_engine_render_background (engine, cr, x, y, width, height);
+ gtk_theming_engine_render_frame (engine, cr, x, y, width, height);
+
+ /* FIXME: thickness */
+ thickness = 2;
+
+ if (gtk_widget_path_is_type (path, GTK_TYPE_SCALE))
+ {
+ if (orientation == GTK_ORIENTATION_VERTICAL)
+ gtk_theming_engine_render_line (engine, cr,
+ x + thickness,
+ y + (gint) height / 2,
+ x + width - thickness - 1,
+ y + (gint) height / 2);
+ else
+ gtk_theming_engine_render_line (engine, cr,
+ x + (gint) width / 2,
+ y + thickness,
+ x + (gint) width / 2,
+ y + height - thickness - 1);
+ }
+}
+
+static void
+gtk_theming_engine_render_frame_gap (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height,
+ GtkPositionType gap_side,
+ gdouble xy0_gap,
+ gdouble xy1_gap)
+{
+ GtkJunctionSides junction;
+ GtkStateFlags state;
+ gint border_width, radius;
+ gdouble x0, y0, x1, y1, xc, yc, wc, hc;
+ GtkBorder *border;
+
+ xc = yc = wc = hc = 0;
+ state = gtk_theming_engine_get_state (engine);
+ junction = gtk_theming_engine_get_junction_sides (engine);
+ gtk_theming_engine_get (engine, state,
+ "border-width", &border,
+ "border-radius", &radius,
+ NULL);
+
+ border_width = MIN (MIN (border->top, border->bottom),
+ MIN (border->left, border->right));
+
+ cairo_save (cr);
+
+ switch (gap_side)
+ {
+ case GTK_POS_TOP:
+ xc = x + xy0_gap + border_width;
+ yc = y;
+ wc = MAX (xy1_gap - xy0_gap - 2 * border_width, 0);
+ hc = border_width;
+
+ if (xy0_gap < radius)
+ junction |= GTK_JUNCTION_CORNER_TOPLEFT;
+
+ if (xy1_gap > width - radius)
+ junction |= GTK_JUNCTION_CORNER_TOPRIGHT;
+ break;
+ case GTK_POS_BOTTOM:
+ xc = x + xy0_gap + border_width;
+ yc = y + height - border_width;
+ wc = MAX (xy1_gap - xy0_gap - 2 * border_width, 0);
+ hc = border_width;
+
+ if (xy0_gap < radius)
+ junction |= GTK_JUNCTION_CORNER_BOTTOMLEFT;
+
+ if (xy1_gap > width - radius)
+ junction |= GTK_JUNCTION_CORNER_BOTTOMRIGHT;
+
+ break;
+ case GTK_POS_LEFT:
+ xc = x;
+ yc = y + xy0_gap + border_width;
+ wc = border_width;
+ hc = MAX (xy1_gap - xy0_gap - 2 * border_width, 0);
+
+ if (xy0_gap < radius)
+ junction |= GTK_JUNCTION_CORNER_TOPLEFT;
+
+ if (xy1_gap > height - radius)
+ junction |= GTK_JUNCTION_CORNER_BOTTOMLEFT;
+
+ break;
+ case GTK_POS_RIGHT:
+ xc = x + width - border_width;
+ yc = y + xy0_gap + border_width;
+ wc = border_width;
+ hc = MAX (xy1_gap - xy0_gap - 2 * border_width, 0);
+
+ if (xy0_gap < radius)
+ junction |= GTK_JUNCTION_CORNER_TOPRIGHT;
+
+ if (xy1_gap > height - radius)
+ junction |= GTK_JUNCTION_CORNER_BOTTOMRIGHT;
+
+ break;
+ }
+
+ cairo_clip_extents (cr, &x0, &y0, &x1, &y1);
+ cairo_rectangle (cr, x0, y0, x1 - x0, yc - y0);
+ cairo_rectangle (cr, x0, yc, xc - x0, hc);
+ cairo_rectangle (cr, xc + wc, yc, x1 - (xc + wc), hc);
+ cairo_rectangle (cr, x0, yc + hc, x1 - x0, y1 - (yc + hc));
+ cairo_clip (cr);
+
+ render_frame_internal (engine, cr,
+ x, y, width, height,
+ 0, junction);
+
+ cairo_restore (cr);
+
+ gtk_border_free (border);
+}
+
+static void
+gtk_theming_engine_render_extension (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height,
+ GtkPositionType gap_side)
+{
+ GtkJunctionSides junction = 0;
+ guint hidden_side = 0;
+
+ cairo_save (cr);
+
+ switch (gap_side)
+ {
+ case GTK_POS_LEFT:
+ junction = GTK_JUNCTION_LEFT;
+ hidden_side = SIDE_LEFT;
+
+ cairo_translate (cr, x + width, y);
+ cairo_rotate (cr, G_PI / 2);
+ break;
+ case GTK_POS_RIGHT:
+ junction = GTK_JUNCTION_RIGHT;
+ hidden_side = SIDE_RIGHT;
+
+ cairo_translate (cr, x, y + height);
+ cairo_rotate (cr, - G_PI / 2);
+ break;
+ case GTK_POS_TOP:
+ junction = GTK_JUNCTION_TOP;
+ hidden_side = SIDE_TOP;
+
+ cairo_translate (cr, x + width, y + height);
+ cairo_rotate (cr, G_PI);
+ break;
+ case GTK_POS_BOTTOM:
+ junction = GTK_JUNCTION_BOTTOM;
+ hidden_side = SIDE_BOTTOM;
+
+ cairo_translate (cr, x, y);
+ break;
+ }
+
+ if (gap_side == GTK_POS_TOP ||
+ gap_side == GTK_POS_BOTTOM)
+ render_background_internal (engine, cr,
+ 0, 0, width, height,
+ junction);
+ else
+ render_background_internal (engine, cr,
+ 0, 0, height, width,
+ junction);
+
+ cairo_restore (cr);
+
+ cairo_save (cr);
+
+ render_frame_internal (engine, cr,
+ x, y, width, height,
+ hidden_side, junction);
+
+ cairo_restore (cr);
+}
+
+static void
+render_dot (cairo_t *cr,
+ const GdkRGBA *lighter,
+ const GdkRGBA *darker,
+ gdouble x,
+ gdouble y,
+ gdouble size)
+{
+ size = CLAMP ((gint) size, 2, 3);
+
+ if (size == 2)
+ {
+ gdk_cairo_set_source_rgba (cr, lighter);
+ cairo_rectangle (cr, x, y, 1, 1);
+ cairo_rectangle (cr, x + 1, y + 1, 1, 1);
+ cairo_fill (cr);
+ }
+ else if (size == 3)
+ {
+ gdk_cairo_set_source_rgba (cr, lighter);
+ cairo_rectangle (cr, x, y, 2, 1);
+ cairo_rectangle (cr, x, y, 1, 2);
+ cairo_fill (cr);
+
+ gdk_cairo_set_source_rgba (cr, darker);
+ cairo_rectangle (cr, x + 1, y + 1, 2, 1);
+ cairo_rectangle (cr, x + 2, y, 1, 2);
+ cairo_fill (cr);
+ }
+}
+
+static void
+gtk_theming_engine_render_handle (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height)
+{
+ GtkStateFlags flags;
+ GdkRGBA *bg_color;
+ GdkRGBA lighter, darker;
+ gint xx, yy;
+
+ cairo_save (cr);
+ flags = gtk_theming_engine_get_state (engine);
+
+ cairo_set_line_width (cr, 1);
+
+ gtk_theming_engine_get (engine, flags,
+ "background-color", &bg_color,
+ NULL);
+ color_shade (bg_color, 0.7, &darker);
+ color_shade (bg_color, 1.3, &lighter);
+
+ gdk_cairo_set_source_rgba (cr, bg_color);
+ cairo_rectangle (cr, x, y, width, height);
+ cairo_fill (cr);
+
+ if (gtk_theming_engine_has_class (engine, "grip"))
+ {
+ GtkJunctionSides sides;
+ gint skip = -1;
+
+ cairo_save (cr);
+
+ cairo_set_line_width (cr, 1.0);
+ sides = gtk_theming_engine_get_junction_sides (engine);
+
+ /* reduce confusing values to a meaningful state */
+ if ((sides & (GTK_JUNCTION_CORNER_TOPLEFT | GTK_JUNCTION_CORNER_BOTTOMRIGHT)) == (GTK_JUNCTION_CORNER_TOPLEFT | GTK_JUNCTION_CORNER_BOTTOMRIGHT))
+ sides &= ~GTK_JUNCTION_CORNER_TOPLEFT;
+
+ if ((sides & (GTK_JUNCTION_CORNER_TOPRIGHT | GTK_JUNCTION_CORNER_BOTTOMLEFT)) == (GTK_JUNCTION_CORNER_TOPRIGHT | GTK_JUNCTION_CORNER_BOTTOMLEFT))
+ sides &= ~GTK_JUNCTION_CORNER_TOPRIGHT;
+
+ if (sides == 0)
+ sides = GTK_JUNCTION_CORNER_BOTTOMRIGHT;
+
+ /* align drawing area to the connected side */
+ if (sides == GTK_JUNCTION_LEFT)
+ {
+ if (height < width)
+ width = height;
+ }
+ else if (sides == GTK_JUNCTION_CORNER_TOPLEFT)
+ {
+ if (width < height)
+ height = width;
+ else if (height < width)
+ width = height;
+
+ skip = 2;
+ }
+ else if (sides == GTK_JUNCTION_CORNER_BOTTOMLEFT)
+ {
+ /* make it square, aligning to bottom left */
+ if (width < height)
+ {
+ y += (height - width);
+ height = width;
+ }
+ else if (height < width)
+ width = height;
+
+ skip = 1;
+ }
+ else if (sides == GTK_JUNCTION_RIGHT)
+ {
+ /* aligning to right */
+ if (height < width)
+ {
+ x += (width - height);
+ width = height;
+ }
+ }
+ else if (sides == GTK_JUNCTION_CORNER_TOPRIGHT)
+ {
+ if (width < height)
+ height = width;
+ else if (height < width)
+ {
+ x += (width - height);
+ width = height;
+ }
+
+ skip = 3;
+ }
+ else if (sides == GTK_JUNCTION_CORNER_BOTTOMRIGHT)
+ {
+ /* make it square, aligning to bottom right */
+ if (width < height)
+ {
+ y += (height - width);
+ height = width;
+ }
+ else if (height < width)
+ {
+ x += (width - height);
+ width = height;
+ }
+
+ skip = 0;
+ }
+ else if (sides == GTK_JUNCTION_TOP)
+ {
+ if (width < height)
+ height = width;
+ }
+ else if (sides == GTK_JUNCTION_BOTTOM)
+ {
+ /* align to bottom */
+ if (width < height)
+ {
+ y += (height - width);
+ height = width;
+ }
+ }
+ else
+ g_assert_not_reached ();
+
+ if (sides == GTK_JUNCTION_LEFT ||
+ sides == GTK_JUNCTION_RIGHT)
+ {
+ gint xi;
+
+ xi = x;
+
+ while (xi < x + width)
+ {
+ gdk_cairo_set_source_rgba (cr, &lighter);
+ add_path_line (cr, x, y, x, y + height);
+ cairo_stroke (cr);
+ xi++;
+
+ gdk_cairo_set_source_rgba (cr, &darker);
+ add_path_line (cr, xi, y, xi, y + height);
+ cairo_stroke (cr);
+ xi += 2;
+ }
+ }
+ else if (sides == GTK_JUNCTION_TOP ||
+ sides == GTK_JUNCTION_BOTTOM)
+ {
+ gint yi;
+
+ yi = y;
+
+ while (yi < y + height)
+ {
+ gdk_cairo_set_source_rgba (cr, &lighter);
+ add_path_line (cr, x, yi, x + width, yi);
+ cairo_stroke (cr);
+ yi++;
+
+ gdk_cairo_set_source_rgba (cr, &darker);
+ add_path_line (cr, x, yi, x + width, yi);
+ cairo_stroke (cr);
+ yi+= 2;
+ }
+ }
+ else if (sides == GTK_JUNCTION_CORNER_TOPLEFT)
+ {
+ gint xi, yi;
+
+ xi = x + width;
+ yi = y + height;
+
+ while (xi > x + 3)
+ {
+ gdk_cairo_set_source_rgba (cr, &darker);
+ add_path_line (cr, xi, y, x, yi);
+ cairo_stroke (cr);
+
+ --xi;
+ --yi;
+
+ add_path_line (cr, xi, y, x, yi);
+ cairo_stroke (cr);
+
+ --xi;
+ --yi;
+
+ gdk_cairo_set_source_rgba (cr, &lighter);
+ add_path_line (cr, xi, y, x, yi);
+ cairo_stroke (cr);
+
+ xi -= 3;
+ yi -= 3;
+ }
+ }
+ else if (sides == GTK_JUNCTION_CORNER_TOPRIGHT)
+ {
+ gint xi, yi;
+
+ xi = x;
+ yi = y + height;
+
+ while (xi < (x + width - 3))
+ {
+ gdk_cairo_set_source_rgba (cr, &lighter);
+ add_path_line (cr, xi, y, x + width, yi);
+ cairo_stroke (cr);
+
+ ++xi;
+ --yi;
+
+ gdk_cairo_set_source_rgba (cr, &darker);
+ add_path_line (cr, xi, y, x + width, yi);
+ cairo_stroke (cr);
+
+ ++xi;
+ --yi;
+
+ add_path_line (cr, xi, y, x + width, yi);
+ cairo_stroke (cr);
+
+ xi += 3;
+ yi -= 3;
+ }
+ }
+ else if (sides == GTK_JUNCTION_CORNER_BOTTOMLEFT)
+ {
+ gint xi, yi;
+
+ xi = x + width;
+ yi = y;
+
+ while (xi > x + 3)
+ {
+ gdk_cairo_set_source_rgba (cr, &darker);
+ add_path_line (cr, x, yi, xi, y + height);
+ cairo_stroke (cr);
+
+ --xi;
+ ++yi;
+
+ add_path_line (cr, x, yi, xi, y + height);
+ cairo_stroke (cr);
+
+ --xi;
+ ++yi;
+
+ gdk_cairo_set_source_rgba (cr, &lighter);
+ add_path_line (cr, x, yi, xi, y + height);
+ cairo_stroke (cr);
+
+ xi -= 3;
+ yi += 3;
+ }
+ }
+ else if (sides == GTK_JUNCTION_CORNER_BOTTOMRIGHT)
+ {
+ gint xi, yi;
+
+ xi = x;
+ yi = y;
+
+ while (xi < (x + width - 3))
+ {
+ gdk_cairo_set_source_rgba (cr, &lighter);
+ add_path_line (cr, xi, y + height, x + width, yi);
+ cairo_stroke (cr);
+
+ ++xi;
+ ++yi;
+
+ gdk_cairo_set_source_rgba (cr, &darker);
+ add_path_line (cr, xi, y + height, x + width, yi);
+ cairo_stroke (cr);
+
+ ++xi;
+ ++yi;
+
+ add_path_line (cr, xi, y + height, x + width, yi);
+ cairo_stroke (cr);
+
+ xi += 3;
+ yi += 3;
+ }
+ }
+
+ cairo_restore (cr);
+ }
+ else if (gtk_theming_engine_has_class (engine, "paned"))
+ {
+ if (width > height)
+ for (xx = x + width / 2 - 15; xx <= x + width / 2 + 15; xx += 5)
+ render_dot (cr, &lighter, &darker, xx, y + height / 2 - 1, 3);
+ else
+ for (yy = y + height / 2 - 15; yy <= y + height / 2 + 15; yy += 5)
+ render_dot (cr, &lighter, &darker, x + width / 2 - 1, yy, 3);
+ }
+ else
+ {
+ for (yy = y; yy < y + height; yy += 3)
+ for (xx = x; xx < x + width; xx += 6)
+ {
+ render_dot (cr, &lighter, &darker, xx, yy, 2);
+ render_dot (cr, &lighter, &darker, xx + 3, yy + 1, 2);
+ }
+ }
+
+ cairo_restore (cr);
+
+ gdk_rgba_free (bg_color);
+}
+
+static void
+gtk_theming_engine_render_activity (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height)
+{
+ if (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_SPINNER))
+ {
+ GtkStateFlags state;
+ guint num_steps, step;
+ GdkRGBA *color;
+ gdouble dx, dy;
+ gdouble progress;
+ gdouble radius;
+ gdouble half;
+ gint i;
+
+ num_steps = 0;
+
+ gtk_theming_engine_get_style (engine,
+ "num-steps", &num_steps,
+ NULL);
+
+ state = gtk_theming_engine_get_state (engine);
+ gtk_theming_engine_get (engine, state,
+ "color", &color,
+ NULL);
+ if (num_steps == 0)
+ num_steps = 12;
+
+ if (gtk_theming_engine_state_is_running (engine, GTK_STATE_ACTIVE, &progress))
+ step = (guint) (progress * num_steps);
+ else
+ step = 0;
+
+ cairo_save (cr);
+
+ cairo_translate (cr, x, y);
+
+ /* draw clip region */
+ cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
+
+ dx = width / 2;
+ dy = height / 2;
+ radius = MIN (width / 2, height / 2);
+ half = num_steps / 2;
+
+ for (i = 0; i < num_steps; i++)
+ {
+ gint inset = 0.7 * radius;
+
+ /* transparency is a function of time and intial value */
+ gdouble t = (gdouble) ((i + num_steps - step)
+ % num_steps) / num_steps;
+
+ cairo_save (cr);
+
+ cairo_set_source_rgba (cr,
+ color->red,
+ color->green,
+ color->blue,
+ color->alpha * t);
+
+ cairo_set_line_width (cr, 2.0);
+ cairo_move_to (cr,
+ dx + (radius - inset) * cos (i * G_PI / half),
+ dy + (radius - inset) * sin (i * G_PI / half));
+ cairo_line_to (cr,
+ dx + radius * cos (i * G_PI / half),
+ dy + radius * sin (i * G_PI / half));
+ cairo_stroke (cr);
+
+ cairo_restore (cr);
+ }
+
+ cairo_restore (cr);
+
+ gdk_rgba_free (color);
+ }
+ else
+ {
+ gtk_theming_engine_render_background (engine, cr, x, y, width, height);
+ gtk_theming_engine_render_frame (engine, cr, x, y, width, height);
+ }
+}
+
+static GdkPixbuf *
+scale_or_ref (GdkPixbuf *src,
+ gint width,
+ gint height)
+{
+ if (width == gdk_pixbuf_get_width (src) &&
+ height == gdk_pixbuf_get_height (src))
+ return g_object_ref (src);
+ else
+ return gdk_pixbuf_scale_simple (src,
+ width, height,
+ GDK_INTERP_BILINEAR);
+}
+
+static gboolean
+lookup_icon_size (GtkThemingEngine *engine,
+ GtkIconSize size,
+ gint *width,
+ gint *height)
+{
+ GdkScreen *screen;
+ GtkSettings *settings;
+
+ screen = gtk_theming_engine_get_screen (engine);
+ settings = gtk_settings_get_for_screen (screen);
+
+ return gtk_icon_size_lookup_for_settings (settings, size, width, height);
+}
+
+static GdkPixbuf *
+gtk_theming_engine_render_icon_pixbuf (GtkThemingEngine *engine,
+ const GtkIconSource *source,
+ GtkIconSize size)
+{
+ GdkPixbuf *scaled;
+ GdkPixbuf *stated;
+ GdkPixbuf *base_pixbuf;
+ GtkStateFlags state;
+ gint width = 1;
+ gint height = 1;
+
+ base_pixbuf = gtk_icon_source_get_pixbuf (source);
+ state = gtk_theming_engine_get_state (engine);
+
+ g_return_val_if_fail (base_pixbuf != NULL, NULL);
+
+ if (size != (GtkIconSize) -1 &&
+ !lookup_icon_size (engine, size, &width, &height))
+ {
+ g_warning (G_STRLOC ": invalid icon size '%d'", size);
+ return NULL;
+ }
+
+ /* If the size was wildcarded, and we're allowed to scale, then scale; otherwise,
+ * leave it alone.
+ */
+ if (size != (GtkIconSize) -1 &&
+ gtk_icon_source_get_size_wildcarded (source))
+ scaled = scale_or_ref (base_pixbuf, width, height);
+ else
+ scaled = g_object_ref (base_pixbuf);
+
+ /* If the state was wildcarded, then generate a state. */
+ if (gtk_icon_source_get_state_wildcarded (source))
+ {
+ if (state & GTK_STATE_FLAG_INSENSITIVE)
+ {
+ stated = gdk_pixbuf_copy (scaled);
+ gdk_pixbuf_saturate_and_pixelate (scaled, stated,
+ 0.8, TRUE);
+ g_object_unref (scaled);
+ }
+ else if (state & GTK_STATE_FLAG_PRELIGHT)
+ {
+ stated = gdk_pixbuf_copy (scaled);
+ gdk_pixbuf_saturate_and_pixelate (scaled, stated,
+ 1.2, FALSE);
+ g_object_unref (scaled);
+ }
+ else
+ stated = scaled;
+ }
+ else
+ stated = scaled;
+
+ return stated;
+}
diff --git a/gtk/gtkthemingengine.h b/gtk/gtkthemingengine.h
new file mode 100644
index 0000000000..64b39216e2
--- /dev/null
+++ b/gtk/gtkthemingengine.h
@@ -0,0 +1,251 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
+#error "Only <gtk/gtk.h> can be included directly."
+#endif
+
+#ifndef __GTK_THEMING_ENGINE_H__
+#define __GTK_THEMING_ENGINE_H__
+
+#include <glib-object.h>
+#include <cairo.h>
+
+#include <gtk/gtkstylecontext.h>
+#include <gtk/gtkwidgetpath.h>
+#include <gtk/gtkenums.h>
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_THEMING_ENGINE (gtk_theming_engine_get_type ())
+#define GTK_THEMING_ENGINE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_THEMING_ENGINE, GtkThemingEngine))
+#define GTK_THEMING_ENGINE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GTK_TYPE_THEMING_ENGINE, GtkThemingEngineClass))
+#define GTK_IS_THEMING_ENGINE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_THEMING_ENGINE))
+#define GTK_IS_THEMING_ENGINE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GTK_TYPE_THEMING_ENGINE))
+#define GTK_THEMING_ENGINE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_THEMING_ENGINE, GtkThemingEngineClass))
+
+typedef struct _GtkThemingEngine GtkThemingEngine;
+typedef struct _GtkThemingEngineClass GtkThemingEngineClass;
+
+struct _GtkThemingEngine
+{
+ GObject parent_object;
+ gpointer priv;
+};
+
+/**
+ * GtkThemingEngineClass
+ * @parent_class: The parent class.
+ * @render_line: Renders a line between two points.
+ * @render_background: Renders the background area of a widget region.
+ * @render_frame: Renders the frame around a widget area.
+ * @render_frame_gap: Renders the frame around a widget area with a gap in it.
+ * @render_extension: Renders a extension to a box, usually a notebook tab.
+ * @render_check: Renders a checkmark, as in #GtkCheckButton.
+ * @render_option: Renders an option, as in #GtkRadioButton.
+ * @render_arrow: Renders an arrow pointing to a certain direction.
+ * @render_expander: Renders an element what will expose/expand part of
+ * the UI, as in #GtkExpander.
+ * @render_focus: Renders the focus indicator.
+ * @render_layout: Renders a #PangoLayout
+ * @render_slider: Renders a slider control, as in #GtkScale.
+ * @render_handle: Renders a handle to drag UI elements, as in #GtkPaned.
+ * @render_activity: Renders an area displaying activity, such as in #GtkSpinner,
+ * or #GtkProgressBar.
+ * @render_icon_pixbuf: Renders an icon as a #GdkPixbuf.
+ *
+ * Base class for theming engines.
+ */
+struct _GtkThemingEngineClass
+{
+ GObjectClass parent_class;
+
+ void (* render_line) (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x0,
+ gdouble y0,
+ gdouble x1,
+ gdouble y1);
+ void (* render_background) (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height);
+ void (* render_frame) (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height);
+ void (* render_frame_gap) (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height,
+ GtkPositionType gap_side,
+ gdouble xy0_gap,
+ gdouble xy1_gap);
+ void (* render_extension) (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height,
+ GtkPositionType gap_side);
+ void (* render_check) (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height);
+ void (* render_option) (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height);
+ void (* render_arrow) (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble angle,
+ gdouble x,
+ gdouble y,
+ gdouble size);
+ void (* render_expander) (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height);
+ void (* render_focus) (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height);
+ void (* render_layout) (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ PangoLayout *layout);
+ void (* render_slider) (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height,
+ GtkOrientation orientation);
+ void (* render_handle) (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height);
+ void (* render_activity) (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height);
+
+ GdkPixbuf * (* render_icon_pixbuf) (GtkThemingEngine *engine,
+ const GtkIconSource *source,
+ GtkIconSize size);
+};
+
+GType gtk_theming_engine_get_type (void) G_GNUC_CONST;
+
+void _gtk_theming_engine_set_context (GtkThemingEngine *engine,
+ GtkStyleContext *context);
+
+void gtk_theming_engine_register_property (const gchar *name_space,
+ GtkStylePropertyParser parse_func,
+ GParamSpec *pspec);
+
+void gtk_theming_engine_get_property (GtkThemingEngine *engine,
+ const gchar *property,
+ GtkStateFlags state,
+ GValue *value);
+void gtk_theming_engine_get_valist (GtkThemingEngine *engine,
+ GtkStateFlags state,
+ va_list args);
+void gtk_theming_engine_get (GtkThemingEngine *engine,
+ GtkStateFlags state,
+ ...) G_GNUC_NULL_TERMINATED;
+
+void gtk_theming_engine_get_style_property (GtkThemingEngine *engine,
+ const gchar *property_name,
+ GValue *value);
+void gtk_theming_engine_get_style_valist (GtkThemingEngine *engine,
+ va_list args);
+void gtk_theming_engine_get_style (GtkThemingEngine *engine,
+ ...);
+
+gboolean gtk_theming_engine_lookup_color (GtkThemingEngine *engine,
+ const gchar *color_name,
+ GdkRGBA *color);
+
+G_CONST_RETURN GtkWidgetPath * gtk_theming_engine_get_path (GtkThemingEngine *engine);
+
+gboolean gtk_theming_engine_has_class (GtkThemingEngine *engine,
+ const gchar *style_class);
+gboolean gtk_theming_engine_has_region (GtkThemingEngine *engine,
+ const gchar *style_region,
+ GtkRegionFlags *flags);
+
+GtkStateFlags gtk_theming_engine_get_state (GtkThemingEngine *engine);
+gboolean gtk_theming_engine_state_is_running (GtkThemingEngine *engine,
+ GtkStateType state,
+ gdouble *progress);
+
+GtkTextDirection gtk_theming_engine_get_direction (GtkThemingEngine *engine);
+
+GtkJunctionSides gtk_theming_engine_get_junction_sides (GtkThemingEngine *engine);
+
+/* Helper functions */
+void gtk_theming_engine_get_color (GtkThemingEngine *engine,
+ GtkStateFlags state,
+ GdkRGBA *color);
+void gtk_theming_engine_get_background_color (GtkThemingEngine *engine,
+ GtkStateFlags state,
+ GdkRGBA *color);
+void gtk_theming_engine_get_border_color (GtkThemingEngine *engine,
+ GtkStateFlags state,
+ GdkRGBA *color);
+
+void gtk_theming_engine_get_border (GtkThemingEngine *engine,
+ GtkStateFlags state,
+ GtkBorder *border);
+void gtk_theming_engine_get_padding (GtkThemingEngine *engine,
+ GtkStateFlags state,
+ GtkBorder *padding);
+void gtk_theming_engine_get_margin (GtkThemingEngine *engine,
+ GtkStateFlags state,
+ GtkBorder *margin);
+
+
+GtkThemingEngine * gtk_theming_engine_load (const gchar *name);
+
+GdkScreen * gtk_theming_engine_get_screen (GtkThemingEngine *engine);
+
+
+G_END_DECLS
+
+#endif /* __GTK_THEMING_ENGINE_H__ */
diff --git a/gtk/gtktimeline.c b/gtk/gtktimeline.c
new file mode 100644
index 0000000000..348011c768
--- /dev/null
+++ b/gtk/gtktimeline.c
@@ -0,0 +1,735 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2007 Carlos Garnacho <carlos@imendio.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <gtk/gtktimeline.h>
+#include <gtk/gtktypebuiltins.h>
+#include <gtk/gtksettings.h>
+#include <math.h>
+
+#define MSECS_PER_SEC 1000
+#define FRAME_INTERVAL(nframes) (MSECS_PER_SEC / nframes)
+#define DEFAULT_FPS 30
+
+typedef struct GtkTimelinePriv GtkTimelinePriv;
+
+struct GtkTimelinePriv
+{
+ guint duration;
+ guint fps;
+ guint source_id;
+
+ GTimer *timer;
+
+ gdouble progress;
+ gdouble last_progress;
+
+ GdkScreen *screen;
+
+ GtkTimelineProgressType progress_type;
+
+ guint animations_enabled : 1;
+ guint loop : 1;
+ guint direction : 1;
+};
+
+enum {
+ PROP_0,
+ PROP_FPS,
+ PROP_DURATION,
+ PROP_LOOP,
+ PROP_DIRECTION,
+ PROP_SCREEN
+};
+
+enum {
+ STARTED,
+ PAUSED,
+ FINISHED,
+ FRAME,
+ LAST_SIGNAL
+};
+
+static guint signals [LAST_SIGNAL] = { 0, };
+
+
+static void gtk_timeline_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec);
+static void gtk_timeline_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec);
+static void gtk_timeline_finalize (GObject *object);
+
+
+G_DEFINE_TYPE (GtkTimeline, gtk_timeline, G_TYPE_OBJECT)
+
+
+static void
+gtk_timeline_class_init (GtkTimelineClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->set_property = gtk_timeline_set_property;
+ object_class->get_property = gtk_timeline_get_property;
+ object_class->finalize = gtk_timeline_finalize;
+
+ g_object_class_install_property (object_class,
+ PROP_FPS,
+ g_param_spec_uint ("fps",
+ "FPS",
+ "Frames per second for the timeline",
+ 1, G_MAXUINT,
+ DEFAULT_FPS,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_DURATION,
+ g_param_spec_uint ("duration",
+ "Animation Duration",
+ "Animation Duration",
+ 0, G_MAXUINT,
+ 0,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_LOOP,
+ g_param_spec_boolean ("loop",
+ "Loop",
+ "Whether the timeline loops or not",
+ FALSE,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_SCREEN,
+ g_param_spec_object ("screen",
+ "Screen",
+ "Screen to get the settings from",
+ GDK_TYPE_SCREEN,
+ G_PARAM_READWRITE));
+
+ signals[STARTED] =
+ g_signal_new ("started",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GtkTimelineClass, started),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ signals[PAUSED] =
+ g_signal_new ("paused",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GtkTimelineClass, paused),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ signals[FINISHED] =
+ g_signal_new ("finished",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GtkTimelineClass, finished),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ signals[FRAME] =
+ g_signal_new ("frame",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GtkTimelineClass, frame),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__DOUBLE,
+ G_TYPE_NONE, 1,
+ G_TYPE_DOUBLE);
+
+ g_type_class_add_private (klass, sizeof (GtkTimelinePriv));
+}
+
+static void
+gtk_timeline_init (GtkTimeline *timeline)
+{
+ GtkTimelinePriv *priv;
+
+ priv = timeline->priv = G_TYPE_INSTANCE_GET_PRIVATE (timeline,
+ GTK_TYPE_TIMELINE,
+ GtkTimelinePriv);
+
+ priv->fps = DEFAULT_FPS;
+ priv->duration = 0.0;
+ priv->direction = GTK_TIMELINE_DIRECTION_FORWARD;
+ priv->screen = gdk_screen_get_default ();
+
+ priv->last_progress = 0;
+}
+
+static void
+gtk_timeline_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ GtkTimeline *timeline;
+ GtkTimelinePriv *priv;
+
+ timeline = GTK_TIMELINE (object);
+ priv = timeline->priv;
+
+ switch (prop_id)
+ {
+ case PROP_FPS:
+ gtk_timeline_set_fps (timeline, g_value_get_uint (value));
+ break;
+ case PROP_DURATION:
+ gtk_timeline_set_duration (timeline, g_value_get_uint (value));
+ break;
+ case PROP_LOOP:
+ gtk_timeline_set_loop (timeline, g_value_get_boolean (value));
+ break;
+ case PROP_DIRECTION:
+ gtk_timeline_set_direction (timeline, g_value_get_enum (value));
+ break;
+ case PROP_SCREEN:
+ gtk_timeline_set_screen (timeline,
+ GDK_SCREEN (g_value_get_object (value)));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
+}
+
+static void
+gtk_timeline_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ GtkTimeline *timeline;
+ GtkTimelinePriv *priv;
+
+ timeline = GTK_TIMELINE (object);
+ priv = timeline->priv;
+
+ switch (prop_id)
+ {
+ case PROP_FPS:
+ g_value_set_uint (value, priv->fps);
+ break;
+ case PROP_DURATION:
+ g_value_set_uint (value, priv->duration);
+ break;
+ case PROP_LOOP:
+ g_value_set_boolean (value, priv->loop);
+ break;
+ case PROP_DIRECTION:
+ g_value_set_enum (value, priv->direction);
+ break;
+ case PROP_SCREEN:
+ g_value_set_object (value, priv->screen);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
+}
+
+static void
+gtk_timeline_finalize (GObject *object)
+{
+ GtkTimelinePriv *priv;
+ GtkTimeline *timeline;
+
+ timeline = (GtkTimeline *) object;
+ priv = timeline->priv;
+
+ if (priv->source_id)
+ {
+ g_source_remove (priv->source_id);
+ priv->source_id = 0;
+ }
+
+ if (priv->timer)
+ g_timer_destroy (priv->timer);
+
+ G_OBJECT_CLASS (gtk_timeline_parent_class)->finalize (object);
+}
+
+gdouble
+calculate_progress (gdouble linear_progress,
+ GtkTimelineProgressType progress_type)
+{
+ gdouble progress;
+
+ progress = linear_progress;
+
+ switch (progress_type)
+ {
+ case GTK_TIMELINE_PROGRESS_LINEAR:
+ break;
+ case GTK_TIMELINE_PROGRESS_EASE_IN_OUT:
+ progress *= 2;
+
+ if (progress < 1)
+ progress = pow (progress, 3) / 2;
+ else
+ progress = (pow (progress - 2, 3) + 2) / 2;
+
+ break;
+ case GTK_TIMELINE_PROGRESS_EASE:
+ progress = (sinf ((progress - 0.5) * G_PI) + 1) / 2;
+ break;
+ case GTK_TIMELINE_PROGRESS_EASE_IN:
+ progress = pow (progress, 3);
+ break;
+ case GTK_TIMELINE_PROGRESS_EASE_OUT:
+ progress = pow (progress - 1, 3) + 1;
+ break;
+ default:
+ g_warning ("Timeline progress type not implemented");
+ }
+
+ return progress;
+}
+
+static gboolean
+gtk_timeline_run_frame (GtkTimeline *timeline)
+{
+ GtkTimelinePriv *priv;
+ gdouble delta_progress, progress;
+ guint elapsed_time;
+
+ priv = timeline->priv;
+
+ elapsed_time = (guint) (g_timer_elapsed (priv->timer, NULL) * 1000);
+ g_timer_start (priv->timer);
+
+ if (priv->animations_enabled)
+ {
+ delta_progress = (gdouble) elapsed_time / priv->duration;
+ progress = priv->last_progress;
+
+ if (priv->direction == GTK_TIMELINE_DIRECTION_BACKWARD)
+ progress -= delta_progress;
+ else
+ progress += delta_progress;
+
+ priv->last_progress = progress;
+
+ progress = CLAMP (progress, 0., 1.);
+ }
+ else
+ progress = (priv->direction == GTK_TIMELINE_DIRECTION_FORWARD) ? 1.0 : 0.0;
+
+ priv->progress = progress;
+ g_signal_emit (timeline, signals [FRAME], 0,
+ calculate_progress (progress, priv->progress_type));
+
+ if ((priv->direction == GTK_TIMELINE_DIRECTION_FORWARD && progress == 1.0) ||
+ (priv->direction == GTK_TIMELINE_DIRECTION_BACKWARD && progress == 0.0))
+ {
+ if (!priv->loop)
+ {
+ if (priv->source_id)
+ {
+ g_source_remove (priv->source_id);
+ priv->source_id = 0;
+ }
+ g_timer_stop (priv->timer);
+ g_signal_emit (timeline, signals [FINISHED], 0);
+ return FALSE;
+ }
+ else
+ gtk_timeline_rewind (timeline);
+ }
+
+ return TRUE;
+}
+
+/**
+ * gtk_timeline_new:
+ * @duration: duration in milliseconds for the timeline
+ *
+ * Creates a new #GtkTimeline with the specified number of frames.
+ *
+ * Return Value: the newly created #GtkTimeline
+ **/
+GtkTimeline *
+gtk_timeline_new (guint duration)
+{
+ return g_object_new (GTK_TYPE_TIMELINE,
+ "duration", duration,
+ NULL);
+}
+
+GtkTimeline *
+gtk_timeline_new_for_screen (guint duration,
+ GdkScreen *screen)
+{
+ return g_object_new (GTK_TYPE_TIMELINE,
+ "duration", duration,
+ "screen", screen,
+ NULL);
+}
+
+/**
+ * gtk_timeline_start:
+ * @timeline: A #GtkTimeline
+ *
+ * Runs the timeline from the current frame.
+ **/
+void
+gtk_timeline_start (GtkTimeline *timeline)
+{
+ GtkTimelinePriv *priv;
+ GtkSettings *settings;
+ gboolean enable_animations = FALSE;
+
+ g_return_if_fail (GTK_IS_TIMELINE (timeline));
+
+ priv = timeline->priv;
+
+ if (!priv->source_id)
+ {
+ if (priv->timer)
+ g_timer_continue (priv->timer);
+ else
+ priv->timer = g_timer_new ();
+
+ /* sanity check */
+ g_assert (priv->fps > 0);
+
+ if (priv->screen)
+ {
+ settings = gtk_settings_get_for_screen (priv->screen);
+ g_object_get (settings, "gtk-enable-animations", &enable_animations, NULL);
+ }
+
+ priv->animations_enabled = (enable_animations == TRUE);
+
+ g_signal_emit (timeline, signals [STARTED], 0);
+
+ if (enable_animations)
+ priv->source_id = gdk_threads_add_timeout (FRAME_INTERVAL (priv->fps),
+ (GSourceFunc) gtk_timeline_run_frame,
+ timeline);
+ else
+ priv->source_id = gdk_threads_add_idle ((GSourceFunc) gtk_timeline_run_frame,
+ timeline);
+ }
+}
+
+/**
+ * gtk_timeline_pause:
+ * @timeline: A #GtkTimeline
+ *
+ * Pauses the timeline.
+ **/
+void
+gtk_timeline_pause (GtkTimeline *timeline)
+{
+ GtkTimelinePriv *priv;
+
+ g_return_if_fail (GTK_IS_TIMELINE (timeline));
+
+ priv = timeline->priv;
+
+ if (priv->source_id)
+ {
+ g_timer_stop (priv->timer);
+ g_source_remove (priv->source_id);
+ priv->source_id = 0;
+ g_signal_emit (timeline, signals [PAUSED], 0);
+ }
+}
+
+/**
+ * gtk_timeline_rewind:
+ * @timeline: A #GtkTimeline
+ *
+ * Rewinds the timeline.
+ **/
+void
+gtk_timeline_rewind (GtkTimeline *timeline)
+{
+ GtkTimelinePriv *priv;
+
+ g_return_if_fail (GTK_IS_TIMELINE (timeline));
+
+ priv = timeline->priv;
+
+ if (gtk_timeline_get_direction(timeline) != GTK_TIMELINE_DIRECTION_FORWARD)
+ priv->progress = priv->last_progress = 1.;
+ else
+ priv->progress = priv->last_progress = 0.;
+
+ /* reset timer */
+ if (priv->timer)
+ {
+ g_timer_start (priv->timer);
+
+ if (!priv->source_id)
+ g_timer_stop (priv->timer);
+ }
+}
+
+/**
+ * gtk_timeline_is_running:
+ * @timeline: A #GtkTimeline
+ *
+ * Returns whether the timeline is running or not.
+ *
+ * Return Value: %TRUE if the timeline is running
+ **/
+gboolean
+gtk_timeline_is_running (GtkTimeline *timeline)
+{
+ GtkTimelinePriv *priv;
+
+ g_return_val_if_fail (GTK_IS_TIMELINE (timeline), FALSE);
+
+ priv = timeline->priv;
+
+ return (priv->source_id != 0);
+}
+
+/**
+ * gtk_timeline_get_fps:
+ * @timeline: A #GtkTimeline
+ *
+ * Returns the number of frames per second.
+ *
+ * Return Value: frames per second
+ **/
+guint
+gtk_timeline_get_fps (GtkTimeline *timeline)
+{
+ GtkTimelinePriv *priv;
+
+ g_return_val_if_fail (GTK_IS_TIMELINE (timeline), 1);
+
+ priv = timeline->priv;
+ return priv->fps;
+}
+
+/**
+ * gtk_timeline_set_fps:
+ * @timeline: A #GtkTimeline
+ * @fps: frames per second
+ *
+ * Sets the number of frames per second that
+ * the timeline will play.
+ **/
+void
+gtk_timeline_set_fps (GtkTimeline *timeline,
+ guint fps)
+{
+ GtkTimelinePriv *priv;
+
+ g_return_if_fail (GTK_IS_TIMELINE (timeline));
+ g_return_if_fail (fps > 0);
+
+ priv = timeline->priv;
+
+ priv->fps = fps;
+
+ if (gtk_timeline_is_running (timeline))
+ {
+ g_source_remove (priv->source_id);
+ priv->source_id = gdk_threads_add_timeout (FRAME_INTERVAL (priv->fps),
+ (GSourceFunc) gtk_timeline_run_frame,
+ timeline);
+ }
+
+ g_object_notify (G_OBJECT (timeline), "fps");
+}
+
+/**
+ * gtk_timeline_get_loop:
+ * @timeline: A #GtkTimeline
+ *
+ * Returns whether the timeline loops to the
+ * beginning when it has reached the end.
+ *
+ * Return Value: %TRUE if the timeline loops
+ **/
+gboolean
+gtk_timeline_get_loop (GtkTimeline *timeline)
+{
+ GtkTimelinePriv *priv;
+
+ g_return_val_if_fail (GTK_IS_TIMELINE (timeline), FALSE);
+
+ priv = timeline->priv;
+ return priv->loop;
+}
+
+/**
+ * gtk_timeline_set_loop:
+ * @timeline: A #GtkTimeline
+ * @loop: %TRUE to make the timeline loop
+ *
+ * Sets whether the timeline loops to the beginning
+ * when it has reached the end.
+ **/
+void
+gtk_timeline_set_loop (GtkTimeline *timeline,
+ gboolean loop)
+{
+ GtkTimelinePriv *priv;
+
+ g_return_if_fail (GTK_IS_TIMELINE (timeline));
+
+ priv = timeline->priv;
+
+ if (loop != priv->loop)
+ {
+ priv->loop = loop;
+ g_object_notify (G_OBJECT (timeline), "loop");
+ }
+}
+
+void
+gtk_timeline_set_duration (GtkTimeline *timeline,
+ guint duration)
+{
+ GtkTimelinePriv *priv;
+
+ g_return_if_fail (GTK_IS_TIMELINE (timeline));
+
+ priv = timeline->priv;
+
+ if (duration != priv->duration)
+ {
+ priv->duration = duration;
+ g_object_notify (G_OBJECT (timeline), "duration");
+ }
+}
+
+guint
+gtk_timeline_get_duration (GtkTimeline *timeline)
+{
+ GtkTimelinePriv *priv;
+
+ g_return_val_if_fail (GTK_IS_TIMELINE (timeline), 0);
+
+ priv = timeline->priv;
+
+ return priv->duration;
+}
+
+/**
+ * gtk_timeline_set_direction:
+ * @timeline: A #GtkTimeline
+ * @direction: direction
+ *
+ * Sets the direction of the timeline.
+ **/
+void
+gtk_timeline_set_direction (GtkTimeline *timeline,
+ GtkTimelineDirection direction)
+{
+ GtkTimelinePriv *priv;
+
+ g_return_if_fail (GTK_IS_TIMELINE (timeline));
+
+ priv = timeline->priv;
+ priv->direction = direction;
+}
+
+/**
+ * gtk_timeline_get_direction:
+ * @timeline: A #GtkTimeline
+ *
+ * Returns the direction of the timeline.
+ *
+ * Return Value: direction
+ **/
+GtkTimelineDirection
+gtk_timeline_get_direction (GtkTimeline *timeline)
+{
+ GtkTimelinePriv *priv;
+
+ g_return_val_if_fail (GTK_IS_TIMELINE (timeline), GTK_TIMELINE_DIRECTION_FORWARD);
+
+ priv = timeline->priv;
+ return priv->direction;
+}
+
+void
+gtk_timeline_set_screen (GtkTimeline *timeline,
+ GdkScreen *screen)
+{
+ GtkTimelinePriv *priv;
+
+ g_return_if_fail (GTK_IS_TIMELINE (timeline));
+ g_return_if_fail (GDK_IS_SCREEN (screen));
+
+ priv = timeline->priv;
+
+ if (priv->screen)
+ g_object_unref (priv->screen);
+
+ priv->screen = g_object_ref (screen);
+
+ g_object_notify (G_OBJECT (timeline), "screen");
+}
+
+GdkScreen *
+gtk_timeline_get_screen (GtkTimeline *timeline)
+{
+ GtkTimelinePriv *priv;
+
+ g_return_val_if_fail (GTK_IS_TIMELINE (timeline), NULL);
+
+ priv = timeline->priv;
+ return priv->screen;
+}
+
+gdouble
+gtk_timeline_get_progress (GtkTimeline *timeline)
+{
+ GtkTimelinePriv *priv;
+
+ g_return_val_if_fail (GTK_IS_TIMELINE (timeline), 0.);
+
+ priv = timeline->priv;
+ return calculate_progress (priv->progress, priv->progress_type);
+}
+
+GtkTimelineProgressType
+gtk_timeline_get_progress_type (GtkTimeline *timeline)
+{
+ GtkTimelinePriv *priv;
+
+ g_return_val_if_fail (GTK_IS_TIMELINE (timeline), GTK_TIMELINE_PROGRESS_LINEAR);
+
+ priv = timeline->priv;
+ return priv->progress_type;
+}
+
+void
+gtk_timeline_set_progress_type (GtkTimeline *timeline,
+ GtkTimelineProgressType progress_type)
+{
+ GtkTimelinePriv *priv;
+
+ g_return_if_fail (GTK_IS_TIMELINE (timeline));
+
+ priv = timeline->priv;
+ priv->progress_type = progress_type;
+}
diff --git a/gtk/gtktimeline.h b/gtk/gtktimeline.h
new file mode 100644
index 0000000000..d9a6ae5d2c
--- /dev/null
+++ b/gtk/gtktimeline.h
@@ -0,0 +1,117 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2007 Carlos Garnacho <carlos@imendio.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GTK_TIMELINE_H__
+#define __GTK_TIMELINE_H__
+
+#include <glib-object.h>
+#include <gtk/gtkenums.h>
+#include <gdk/gdk.h>
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_TIMELINE (gtk_timeline_get_type ())
+#define GTK_TIMELINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TIMELINE, GtkTimeline))
+#define GTK_TIMELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TIMELINE, GtkTimelineClass))
+#define GTK_IS_TIMELINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TIMELINE))
+#define GTK_IS_TIMELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TIMELINE))
+#define GTK_TIMELINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TIMELINE, GtkTimelineClass))
+
+typedef struct GtkTimeline GtkTimeline;
+typedef struct GtkTimelineClass GtkTimelineClass;
+
+typedef enum {
+ GTK_TIMELINE_DIRECTION_FORWARD,
+ GTK_TIMELINE_DIRECTION_BACKWARD
+} GtkTimelineDirection;
+
+typedef enum {
+ GTK_TIMELINE_PROGRESS_LINEAR,
+ GTK_TIMELINE_PROGRESS_EASE,
+ GTK_TIMELINE_PROGRESS_EASE_IN,
+ GTK_TIMELINE_PROGRESS_EASE_OUT,
+ GTK_TIMELINE_PROGRESS_EASE_IN_OUT
+} GtkTimelineProgressType;
+
+struct GtkTimeline
+{
+ GObject parent_instance;
+ gpointer priv;
+};
+
+struct GtkTimelineClass
+{
+ GObjectClass parent_class;
+
+ void (* started) (GtkTimeline *timeline);
+ void (* finished) (GtkTimeline *timeline);
+ void (* paused) (GtkTimeline *timeline);
+
+ void (* frame) (GtkTimeline *timeline,
+ gdouble progress);
+
+ void (* __gtk_reserved1) (void);
+ void (* __gtk_reserved2) (void);
+ void (* __gtk_reserved3) (void);
+ void (* __gtk_reserved4) (void);
+};
+
+
+GType gtk_timeline_get_type (void) G_GNUC_CONST;
+
+GtkTimeline *gtk_timeline_new (guint duration);
+GtkTimeline *gtk_timeline_new_for_screen (guint duration,
+ GdkScreen *screen);
+
+void gtk_timeline_start (GtkTimeline *timeline);
+void gtk_timeline_pause (GtkTimeline *timeline);
+void gtk_timeline_rewind (GtkTimeline *timeline);
+
+gboolean gtk_timeline_is_running (GtkTimeline *timeline);
+
+guint gtk_timeline_get_fps (GtkTimeline *timeline);
+void gtk_timeline_set_fps (GtkTimeline *timeline,
+ guint fps);
+
+gboolean gtk_timeline_get_loop (GtkTimeline *timeline);
+void gtk_timeline_set_loop (GtkTimeline *timeline,
+ gboolean loop);
+
+guint gtk_timeline_get_duration (GtkTimeline *timeline);
+void gtk_timeline_set_duration (GtkTimeline *timeline,
+ guint duration);
+
+GdkScreen *gtk_timeline_get_screen (GtkTimeline *timeline);
+void gtk_timeline_set_screen (GtkTimeline *timeline,
+ GdkScreen *screen);
+
+GtkTimelineDirection gtk_timeline_get_direction (GtkTimeline *timeline);
+void gtk_timeline_set_direction (GtkTimeline *timeline,
+ GtkTimelineDirection direction);
+
+gdouble gtk_timeline_get_progress (GtkTimeline *timeline);
+
+GtkTimelineProgressType gtk_timeline_get_progress_type (GtkTimeline *timeline);
+void gtk_timeline_set_progress_type (GtkTimeline *timeline,
+ GtkTimelineProgressType progress_type);
+
+
+G_END_DECLS
+
+#endif /* __GTK_TIMELINE_H__ */
diff --git a/gtk/gtktogglebutton.c b/gtk/gtktogglebutton.c
index a4979b3fa4..7b8ae49f62 100644
--- a/gtk/gtktogglebutton.c
+++ b/gtk/gtktogglebutton.c
@@ -329,6 +329,8 @@ gtk_toggle_button_set_mode (GtkToggleButton *toggle_button,
if (priv->draw_indicator != draw_indicator)
{
+ GtkStyleContext *context;
+
priv->draw_indicator = draw_indicator;
GTK_BUTTON (toggle_button)->priv->depress_on_activate = !draw_indicator;
@@ -336,6 +338,16 @@ gtk_toggle_button_set_mode (GtkToggleButton *toggle_button,
gtk_widget_queue_resize (GTK_WIDGET (toggle_button));
g_object_notify (G_OBJECT (toggle_button), "draw-indicator");
+
+ /* Make toggle buttons conditionally have the "button"
+ * class depending on draw_indicator.
+ */
+ context = gtk_widget_get_style_context (GTK_WIDGET (toggle_button));
+
+ if (draw_indicator)
+ gtk_style_context_remove_class (context, GTK_STYLE_CLASS_BUTTON);
+ else
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_BUTTON);
}
}
@@ -551,13 +563,16 @@ gtk_toggle_button_update_state (GtkButton *button)
GtkToggleButton *toggle_button = GTK_TOGGLE_BUTTON (button);
GtkToggleButtonPrivate *priv = toggle_button->priv;
gboolean depressed, touchscreen;
- GtkStateType new_state;
+ GtkStateFlags new_state = 0;
g_object_get (gtk_widget_get_settings (GTK_WIDGET (button)),
"gtk-touchscreen-mode", &touchscreen,
NULL);
if (priv->inconsistent)
+ new_state |= GTK_STATE_FLAG_INCONSISTENT;
+
+ if (priv->inconsistent)
depressed = FALSE;
else if (button->priv->in_button && button->priv->button_down)
depressed = TRUE;
@@ -565,10 +580,11 @@ gtk_toggle_button_update_state (GtkButton *button)
depressed = priv->active;
if (!touchscreen && button->priv->in_button && (!button->priv->button_down || priv->draw_indicator))
- new_state = GTK_STATE_PRELIGHT;
- else
- new_state = depressed ? GTK_STATE_ACTIVE : GTK_STATE_NORMAL;
+ new_state |= GTK_STATE_FLAG_PRELIGHT;
+
+ if (depressed)
+ new_state |= GTK_STATE_FLAG_ACTIVE;
- _gtk_button_set_depressed (button, depressed);
- gtk_widget_set_state (GTK_WIDGET (toggle_button), new_state);
+ _gtk_button_set_depressed (button, depressed);
+ gtk_widget_set_state_flags (GTK_WIDGET (toggle_button), new_state, TRUE);
}
diff --git a/gtk/gtktoolitemgroup.c b/gtk/gtktoolitemgroup.c
index 7983667ffc..abcc64014b 100644
--- a/gtk/gtktoolitemgroup.c
+++ b/gtk/gtktoolitemgroup.c
@@ -1752,7 +1752,7 @@ gtk_tool_item_group_set_label_widget (GtkToolItemGroup *group,
if (priv->label_widget)
{
- gtk_widget_set_state (priv->label_widget, GTK_STATE_NORMAL);
+ gtk_widget_set_state_flags (priv->label_widget, 0, TRUE);
gtk_container_remove (GTK_CONTAINER (alignment), priv->label_widget);
}
diff --git a/gtk/gtktrayicon-x11.c b/gtk/gtktrayicon-x11.c
index 0d9b3afd17..150b634823 100644
--- a/gtk/gtktrayicon-x11.c
+++ b/gtk/gtktrayicon-x11.c
@@ -879,9 +879,9 @@ gtk_tray_icon_realize (GtkWidget *widget)
GTK_NOTE (PLUGSOCKET,
g_print ("GtkStatusIcon %p: realized, window: %lx, socket window: %lx\n",
widget,
- (gulong) GDK_WINDOW_XWINDOW (window),
+ (gulong) GDK_WINDOW_XID (window),
gtk_plug_get_socket_window (GTK_PLUG (icon)) ?
- (gulong) GDK_WINDOW_XWINDOW (gtk_plug_get_socket_window (GTK_PLUG (icon))) : 0UL));
+ (gulong) GDK_WINDOW_XID (gtk_plug_get_socket_window (GTK_PLUG (icon))) : 0UL));
if (icon->priv->manager_window != None)
gtk_tray_icon_send_dock_request (icon);
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index aca9989d16..93d5ee4505 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -58,6 +58,12 @@
#include "gtkbuildable.h"
#include "gtkbuilderprivate.h"
#include "gtksizerequest.h"
+#include "gtkstylecontext.h"
+#include "gtksymboliccolor.h"
+#include "gtkcssprovider.h"
+#include "gtkanimationdescription.h"
+#include "gtkmodifierstyle.h"
+#include "gtkversion.h"
#include "gtkdebug.h"
@@ -287,15 +293,7 @@ struct _GtkWidgetPrivate
* 5 widget states (defined in "gtkenums.h")
* so 3 bits.
*/
- guint state : 3;
-
- /* The saved state of the widget. When a widget's state
- * is changed to GTK_STATE_INSENSITIVE via
- * "gtk_widget_set_state" or "gtk_widget_set_sensitive"
- * the old state is kept around in this field. The state
- * will be restored once the widget gets sensitive again.
- */
- guint saved_state : 3;
+ guint state_flags : 6;
guint direction : 2;
@@ -354,6 +352,7 @@ struct _GtkWidgetPrivate
* the font to use for text.
*/
GtkStyle *style;
+ GtkStyleContext *context;
/* The widget's allocated size.
*/
@@ -371,6 +370,9 @@ struct _GtkWidgetPrivate
/* The widget's parent.
*/
GtkWidget *parent;
+
+ /* Widget's path for styling */
+ GtkWidgetPath *path;
};
enum {
@@ -382,6 +384,7 @@ enum {
REALIZE,
UNREALIZE,
SIZE_ALLOCATE,
+ STATE_FLAGS_CHANGED,
STATE_CHANGED,
PARENT_SET,
HIERARCHY_CHANGED,
@@ -422,7 +425,6 @@ enum {
PROXIMITY_IN_EVENT,
PROXIMITY_OUT_EVENT,
CLIENT_EVENT,
- NO_EXPOSE_EVENT,
VISIBILITY_NOTIFY_EVENT,
WINDOW_STATE_EVENT,
DAMAGE_EVENT,
@@ -443,6 +445,7 @@ enum {
COMPOSITED_CHANGED,
QUERY_TOOLTIP,
DRAG_FAILED,
+ STYLE_UPDATED,
LAST_SIGNAL
};
@@ -487,10 +490,16 @@ enum {
typedef struct _GtkStateData GtkStateData;
+enum {
+ STATE_CHANGE_REPLACE,
+ STATE_CHANGE_SET,
+ STATE_CHANGE_UNSET
+};
+
struct _GtkStateData
{
- GtkStateType state;
- guint state_restoration : 1;
+ guint flags : 6;
+ guint operation : 2;
guint parent_sensitive : 1;
guint use_forall : 1;
};
@@ -529,6 +538,7 @@ static gboolean gtk_widget_real_query_tooltip (GtkWidget *widget,
gint y,
gboolean keyboard_tip,
GtkTooltip *tooltip);
+static void gtk_widget_real_style_updated (GtkWidget *widget);
static gboolean gtk_widget_real_show_help (GtkWidget *widget,
GtkWidgetHelpType help_type);
@@ -671,6 +681,7 @@ static GQuark quark_tooltip_markup = 0;
static GQuark quark_has_tooltip = 0;
static GQuark quark_tooltip_window = 0;
static GQuark quark_visual = 0;
+static GQuark quark_modifier_style = 0;
GParamSpecPool *_gtk_widget_child_property_pool = NULL;
GObjectNotifyContext *_gtk_widget_child_property_notify_context = NULL;
@@ -784,6 +795,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
quark_has_tooltip = g_quark_from_static_string ("gtk-has-tooltip");
quark_tooltip_window = g_quark_from_static_string ("gtk-tooltip-window");
quark_visual = g_quark_from_static_string ("gtk-widget-visual");
+ quark_modifier_style = g_quark_from_static_string ("gtk-widget-modifier-style");
style_property_spec_pool = g_param_spec_pool_new (FALSE);
_gtk_widget_child_property_pool = g_param_spec_pool_new (TRUE);
@@ -859,14 +871,13 @@ gtk_widget_class_init (GtkWidgetClass *klass)
klass->can_activate_accel = gtk_widget_real_can_activate_accel;
klass->grab_broken_event = NULL;
klass->query_tooltip = gtk_widget_real_query_tooltip;
+ klass->style_updated = gtk_widget_real_style_updated;
klass->show_help = gtk_widget_real_show_help;
/* Accessibility support */
klass->get_accessible = gtk_widget_real_get_accessible;
- klass->no_expose_event = NULL;
-
klass->adjust_size_request = gtk_widget_real_adjust_size_request;
klass->adjust_size_allocation = gtk_widget_real_adjust_size_allocation;
@@ -1425,6 +1436,8 @@ gtk_widget_class_init (GtkWidgetClass *klass)
*
* The ::state-changed signal is emitted when the widget state changes.
* See gtk_widget_get_state().
+ *
+ * Deprecated: 3.0. Use #GtkWidget::state-flags-changed instead.
*/
widget_signals[STATE_CHANGED] =
g_signal_new (I_("state-changed"),
@@ -1437,6 +1450,26 @@ gtk_widget_class_init (GtkWidgetClass *klass)
GTK_TYPE_STATE_TYPE);
/**
+ * GtkWidget::state-flags-changed:
+ * @widget: the object which received the signal.
+ * @flags: The previous state flags.
+ *
+ * The ::state-flags-changed signal is emitted when the widget state
+ * changes, see gtk_widget_get_state_flags().
+ *
+ * Since: 3.0
+ */
+ widget_signals[STATE_FLAGS_CHANGED] =
+ g_signal_new (I_("state-flags-changed"),
+ G_TYPE_FROM_CLASS (gobject_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (GtkWidgetClass, state_flags_changed),
+ NULL, NULL,
+ _gtk_marshal_VOID__FLAGS,
+ G_TYPE_NONE, 1,
+ GTK_TYPE_STATE_FLAGS);
+
+ /**
* GtkWidget::parent-set:
* @widget: the object on which the signal is emitted
* @old_parent: (allow-none): the previous parent, or %NULL if the widget
@@ -1497,6 +1530,15 @@ gtk_widget_class_init (GtkWidgetClass *klass)
G_TYPE_NONE, 1,
GTK_TYPE_STYLE);
+ widget_signals[STYLE_UPDATED] =
+ g_signal_new (I_("style-updated"),
+ G_TYPE_FROM_CLASS (gobject_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (GtkWidgetClass, style_updated),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
/**
* GtkWidget::direction-changed:
* @widget: the object on which the signal is emitted
@@ -2704,30 +2746,6 @@ gtk_widget_class_init (GtkWidgetClass *klass)
GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
/**
- * GtkWidget::no-expose-event:
- * @widget: the object which received the signal
- * @event: (type Gdk.EventNoExpose): the #GdkEventNoExpose which triggered
- * this signal.
- *
- * The ::no-expose-event will be emitted when the @widget's window is
- * drawn as a copy of another #GdkDrawable which was completely unobscured.
- * If the source window was partially obscured #GdkEventExpose events will
- * be generated for those areas.
- *
- * Returns: %TRUE to stop other handlers from being invoked for the event.
- * %FALSE to propagate the event further.
- */
- widget_signals[NO_EXPOSE_EVENT] =
- g_signal_new (I_("no-expose-event"),
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GtkWidgetClass, no_expose_event),
- _gtk_boolean_handled_accumulator, NULL,
- _gtk_marshal_BOOLEAN__BOXED,
- G_TYPE_BOOLEAN, 1,
- GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
-
- /**
* GtkWidget::window-state-event:
* @widget: the object which received the signal
* @event: (type Gdk.EventWindowState): the #GdkEventWindowState which
@@ -3473,8 +3491,6 @@ gtk_widget_init (GtkWidget *widget)
priv = widget->priv;
priv->child_visible = TRUE;
- priv->state = GTK_STATE_NORMAL;
- priv->saved_state = GTK_STATE_NORMAL;
priv->name = NULL;
priv->allocation.x = -1;
priv->allocation.y = -1;
@@ -4015,6 +4031,82 @@ gtk_widget_show_all (GtkWidget *widget)
class->show_all (widget);
}
+static void
+_gtk_widget_notify_state_change (GtkWidget *widget,
+ GtkStateFlags flag,
+ gboolean target)
+{
+ GtkStateType state;
+
+ switch (flag)
+ {
+ case GTK_STATE_FLAG_ACTIVE:
+ state = GTK_STATE_ACTIVE;
+ break;
+ case GTK_STATE_FLAG_PRELIGHT:
+ state = GTK_STATE_PRELIGHT;
+ break;
+ case GTK_STATE_FLAG_SELECTED:
+ state = GTK_STATE_SELECTED;
+ break;
+ case GTK_STATE_FLAG_INSENSITIVE:
+ state = GTK_STATE_INSENSITIVE;
+ break;
+ case GTK_STATE_FLAG_INCONSISTENT:
+ state = GTK_STATE_INCONSISTENT;
+ break;
+ case GTK_STATE_FLAG_FOCUSED:
+ state = GTK_STATE_FOCUSED;
+ break;
+ default:
+ return;
+ }
+
+ gtk_style_context_notify_state_change (widget->priv->context,
+ gtk_widget_get_window (widget),
+ NULL, state, target);
+}
+
+/* Initializes state transitions for those states that
+ * were enabled before mapping and have a looping animation.
+ */
+static void
+_gtk_widget_start_state_transitions (GtkWidget *widget)
+{
+ GtkStateFlags state, flag;
+
+ if (!widget->priv->context)
+ return;
+
+ state = gtk_widget_get_state_flags (widget);
+ flag = GTK_STATE_FLAG_FOCUSED;
+
+ while (flag)
+ {
+ GtkAnimationDescription *animation_desc;
+
+ if ((state & flag) == 0)
+ {
+ flag >>= 1;
+ continue;
+ }
+
+ gtk_style_context_get (widget->priv->context, state,
+ "transition", &animation_desc,
+ NULL);
+
+ if (animation_desc)
+ {
+ if (gtk_animation_description_get_loop (animation_desc))
+ _gtk_widget_notify_state_change (widget, flag, TRUE);
+
+ gtk_animation_description_unref (animation_desc);
+ }
+
+ flag >>= 1;
+ }
+}
+
/**
* gtk_widget_map:
* @widget: a #GtkWidget
@@ -4042,6 +4134,8 @@ gtk_widget_map (GtkWidget *widget)
if (!gtk_widget_get_has_window (widget))
gdk_window_invalidate_rect (priv->window, &priv->allocation, FALSE);
+
+ _gtk_widget_start_state_transitions (widget);
}
}
@@ -4681,6 +4775,14 @@ gtk_widget_size_allocate (GtkWidget *widget,
cairo_region_destroy (invalidate);
}
}
+
+ if (size_changed || position_changed)
+ {
+ GtkStyleContext *context;
+
+ context = gtk_widget_get_style_context (widget);
+ _gtk_style_context_invalidate_animation_areas (context);
+ }
}
if ((size_changed || position_changed) && priv->parent &&
@@ -5414,6 +5516,8 @@ _gtk_widget_draw_internal (GtkWidget *widget,
cairo_t *cr,
gboolean clip_to_size)
{
+ GtkStyleContext *context;
+
if (!gtk_widget_is_drawable (widget))
return;
@@ -5434,6 +5538,11 @@ _gtk_widget_draw_internal (GtkWidget *widget,
0, cr,
&result);
}
+
+ context = gtk_widget_get_style_context (widget);
+ _gtk_style_context_coalesce_animation_areas (context,
+ widget->priv->allocation.x,
+ widget->priv->allocation.y);
}
/**
@@ -5817,9 +5926,6 @@ gtk_widget_event_internal (GtkWidget *widget,
case GDK_PROXIMITY_OUT:
signal_num = PROXIMITY_OUT_EVENT;
break;
- case GDK_NO_EXPOSE:
- signal_num = NO_EXPOSE_EVENT;
- break;
case GDK_CLIENT_EVENT:
signal_num = CLIENT_EVENT;
break;
@@ -6231,6 +6337,14 @@ gtk_widget_real_query_tooltip (GtkWidget *widget,
return FALSE;
}
+static void
+gtk_widget_real_style_updated (GtkWidget *widget)
+{
+ if (widget->priv->context)
+ gtk_style_context_invalidate (widget->priv->context);
+ gtk_widget_queue_resize (widget);
+}
+
static gboolean
gtk_widget_real_show_help (GtkWidget *widget,
GtkWidgetHelpType help_type)
@@ -6655,6 +6769,18 @@ gtk_widget_set_name (GtkWidget *widget,
g_free (priv->name);
priv->name = new_name;
+ if (priv->path)
+ {
+ guint pos;
+
+ pos = gtk_widget_path_length (priv->path) - 1;
+ gtk_widget_path_iter_set_name (priv->path, pos,
+ priv->name);
+ }
+
+ if (priv->context)
+ gtk_style_context_set_path (priv->context, priv->path);
+
if (priv->rc_style)
gtk_widget_reset_rc_style (widget);
@@ -6685,37 +6811,34 @@ gtk_widget_get_name (GtkWidget *widget)
return G_OBJECT_TYPE_NAME (widget);
}
-/**
- * gtk_widget_set_state:
- * @widget: a #GtkWidget
- * @state: new state for @widget
- *
- * This function is for use in widget implementations. Sets the state
- * of a widget (insensitive, prelighted, etc.) Usually you should set
- * the state using wrapper functions such as gtk_widget_set_sensitive().
- **/
-void
-gtk_widget_set_state (GtkWidget *widget,
- GtkStateType state)
+static void
+_gtk_widget_update_state_flags (GtkWidget *widget,
+ GtkStateFlags flags,
+ guint operation)
{
GtkWidgetPrivate *priv;
- g_return_if_fail (GTK_IS_WIDGET (widget));
-
priv = widget->priv;
- if (state == gtk_widget_get_state (widget))
- return;
+ /* Handle insensitive first, since it is propagated
+ * differently throughout the widget hierarchy.
+ */
+ if ((flags & GTK_STATE_FLAG_INSENSITIVE) !=
+ (priv->state_flags & GTK_STATE_FLAG_INSENSITIVE))
+ gtk_widget_set_sensitive (widget,
+ operation != STATE_CHANGE_UNSET);
- if (state == GTK_STATE_INSENSITIVE)
- gtk_widget_set_sensitive (widget, FALSE);
- else
+ flags &= ~(GTK_STATE_FLAG_INSENSITIVE);
+
+ if (flags != 0 ||
+ operation == STATE_CHANGE_REPLACE)
{
GtkStateData data;
- data.state = state;
- data.state_restoration = FALSE;
+ data.flags = flags;
+ data.operation = operation;
data.use_forall = FALSE;
+
if (priv->parent)
data.parent_sensitive = (gtk_widget_is_sensitive (priv->parent) != FALSE);
else
@@ -6729,6 +6852,141 @@ gtk_widget_set_state (GtkWidget *widget,
}
/**
+ * gtk_widget_set_state_flags:
+ * @widget: a #GtkWidget
+ * @flags: State flags to turn on
+ * @clear: Whether to clear state before turning on @flags
+ *
+ * This function is for use in widget implementations. Turns on flag
+ * values in the current widget state (insensitive, prelighted, etc.).
+ *
+ * It is worth mentioning that any other state than %GTK_STATE_FLAG_INSENSITIVE,
+ * will be propagated down to all non-internal children if @widget is a
+ * #GtkContainer, while %GTK_STATE_FLAG_INSENSITIVE itself will be propagated
+ * down to all #GtkContainer children by different means than turning on the
+ * state flag down the hierarchy, both gtk_widget_get_state_flags() and
+ * gtk_widget_is_sensitive() will make use of these.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_widget_set_state_flags (GtkWidget *widget,
+ GtkStateFlags flags,
+ gboolean clear)
+{
+ g_return_if_fail (GTK_IS_WIDGET (widget));
+
+ if ((!clear && (widget->priv->state_flags & flags) == flags) ||
+ (clear && widget->priv->state_flags == flags))
+ return;
+
+ if (clear)
+ _gtk_widget_update_state_flags (widget, flags, STATE_CHANGE_REPLACE);
+ else
+ _gtk_widget_update_state_flags (widget, flags, STATE_CHANGE_SET);
+}
+
+/**
+ * gtk_widget_unset_state_flags:
+ * @widget: a #GtkWidget
+ * @flags: State flags to turn off
+ *
+ * This function is for use in widget implementations. Turns off flag
+ * values for the current widget state (insensitive, prelighted, etc.).
+ * See gtk_widget_set_state_flags().
+ *
+ * Since: 3.0
+ **/
+void
+gtk_widget_unset_state_flags (GtkWidget *widget,
+ GtkStateFlags flags)
+{
+ g_return_if_fail (GTK_IS_WIDGET (widget));
+
+ if ((widget->priv->state_flags & flags) == 0)
+ return;
+
+ _gtk_widget_update_state_flags (widget, flags, STATE_CHANGE_UNSET);
+}
+
+/**
+ * gtk_widget_get_state_flags:
+ * @widget: a #GtkWidget
+ *
+ * Returns the widget state as a flag set. It is worth mentioning
+ * that the effective %GTK_STATE_FLAG_INSENSITIVE state will be
+ * returned, that is, also based on parent insensitivity, even if
+ * @widget itself is sensitive.
+ *
+ * Returns: The state flags for widget
+ *
+ * Since: 3.0
+ **/
+GtkStateFlags
+gtk_widget_get_state_flags (GtkWidget *widget)
+{
+ GtkStateFlags flags;
+
+ g_return_val_if_fail (GTK_IS_WIDGET (widget), 0);
+
+ flags = widget->priv->state_flags;
+
+ if (!gtk_widget_is_sensitive (widget))
+ flags |= GTK_STATE_FLAG_INSENSITIVE;
+
+ return flags;
+}
+
+/**
+ * gtk_widget_set_state:
+ * @widget: a #GtkWidget
+ * @state: new state for @widget
+ *
+ * This function is for use in widget implementations. Sets the state
+ * of a widget (insensitive, prelighted, etc.) Usually you should set
+ * the state using wrapper functions such as gtk_widget_set_sensitive().
+ *
+ * Deprecated: 3.0. Use gtk_widget_set_state_flags() instead.
+ **/
+void
+gtk_widget_set_state (GtkWidget *widget,
+ GtkStateType state)
+{
+ GtkStateFlags flags;
+
+ if (state == gtk_widget_get_state (widget))
+ return;
+
+ switch (state)
+ {
+ case GTK_STATE_ACTIVE:
+ flags = GTK_STATE_FLAG_ACTIVE;
+ break;
+ case GTK_STATE_PRELIGHT:
+ flags = GTK_STATE_FLAG_PRELIGHT;
+ break;
+ case GTK_STATE_SELECTED:
+ flags = GTK_STATE_FLAG_SELECTED;
+ break;
+ case GTK_STATE_INSENSITIVE:
+ flags = GTK_STATE_FLAG_INSENSITIVE;
+ break;
+ case GTK_STATE_INCONSISTENT:
+ flags = GTK_STATE_FLAG_INCONSISTENT;
+ break;
+ case GTK_STATE_FOCUSED:
+ flags = GTK_STATE_FLAG_FOCUSED;
+ break;
+ case GTK_STATE_NORMAL:
+ default:
+ flags = 0;
+ break;
+ }
+
+ _gtk_widget_update_state_flags (widget, flags, STATE_CHANGE_REPLACE);
+}
+
+/**
* gtk_widget_get_state:
* @widget: a #GtkWidget
*
@@ -6737,13 +6995,32 @@ gtk_widget_set_state (GtkWidget *widget,
* Returns: the state of @widget.
*
* Since: 2.18
+ *
+ * Deprecated: 3.0. Use gtk_widget_get_state_flags() instead.
*/
GtkStateType
gtk_widget_get_state (GtkWidget *widget)
{
+ GtkStateFlags flags;
+
g_return_val_if_fail (GTK_IS_WIDGET (widget), GTK_STATE_NORMAL);
- return widget->priv->state;
+ flags = gtk_widget_get_state_flags (widget);
+
+ if (flags & GTK_STATE_FLAG_INSENSITIVE)
+ return GTK_STATE_INSENSITIVE;
+ else if (flags & GTK_STATE_FLAG_INCONSISTENT)
+ return GTK_STATE_INCONSISTENT;
+ else if (flags & GTK_STATE_FLAG_ACTIVE)
+ return GTK_STATE_ACTIVE;
+ else if (flags & GTK_STATE_FLAG_SELECTED)
+ return GTK_STATE_SELECTED;
+ else if (flags & GTK_STATE_FLAG_FOCUSED)
+ return GTK_STATE_FOCUSED;
+ else if (flags & GTK_STATE_FLAG_PRELIGHT)
+ return GTK_STATE_PRELIGHT;
+ else
+ return GTK_STATE_NORMAL;
}
/**
@@ -7150,17 +7427,19 @@ gtk_widget_set_sensitive (GtkWidget *widget,
if (widget->priv->sensitive == sensitive)
return;
+ data.flags = GTK_STATE_FLAG_INSENSITIVE;
+
if (sensitive)
{
widget->priv->sensitive = TRUE;
- data.state = priv->saved_state;
+ data.operation = STATE_CHANGE_UNSET;
}
else
{
widget->priv->sensitive = FALSE;
- data.state = gtk_widget_get_state (widget);
+ data.operation = STATE_CHANGE_SET;
}
- data.state_restoration = TRUE;
+
data.use_forall = TRUE;
if (priv->parent)
@@ -7169,6 +7448,7 @@ gtk_widget_set_sensitive (GtkWidget *widget,
data.parent_sensitive = TRUE;
gtk_widget_propagate_state (widget, &data);
+
if (gtk_widget_is_drawable (widget))
gtk_widget_queue_draw (widget);
@@ -7216,6 +7496,18 @@ gtk_widget_is_sensitive (GtkWidget *widget)
return widget->priv->sensitive && widget->priv->parent_sensitive;
}
+static void
+_gtk_widget_update_path (GtkWidget *widget)
+{
+ if (widget->priv->path)
+ {
+ gtk_widget_path_free (widget->priv->path);
+ widget->priv->path = NULL;
+ }
+
+ gtk_widget_get_path (widget);
+}
+
/**
* gtk_widget_set_parent:
* @widget: a #GtkWidget
@@ -7232,6 +7524,7 @@ void
gtk_widget_set_parent (GtkWidget *widget,
GtkWidget *parent)
{
+ GtkStateFlags parent_flags;
GtkWidgetPrivate *priv;
GtkStateData data;
@@ -7258,14 +7551,17 @@ gtk_widget_set_parent (GtkWidget *widget,
g_object_ref_sink (widget);
priv->parent = parent;
- if (gtk_widget_get_state (parent) != GTK_STATE_NORMAL)
- data.state = gtk_widget_get_state (parent);
- else
- data.state = gtk_widget_get_state (widget);
- data.state_restoration = FALSE;
+ parent_flags = gtk_widget_get_state_flags (parent);
+
+ /* Merge both old state and current parent state,
+ * We don't want the insensitive flag to propagate
+ * to the new child though */
+ data.flags = parent_flags & ~GTK_STATE_FLAG_INSENSITIVE;
+ data.flags |= priv->state_flags;
+
+ data.operation = STATE_CHANGE_REPLACE;
data.parent_sensitive = (gtk_widget_is_sensitive (parent) != FALSE);
data.use_forall = gtk_widget_is_sensitive (parent) != gtk_widget_is_sensitive (widget);
-
gtk_widget_propagate_state (widget, &data);
gtk_widget_reset_rc_styles (widget);
@@ -7307,6 +7603,15 @@ gtk_widget_set_parent (GtkWidget *widget,
{
gtk_widget_queue_compute_expand (parent);
}
+
+ if (widget->priv->context)
+ {
+ _gtk_widget_update_path (widget);
+ gtk_style_context_set_path (widget->priv->context, widget->priv->path);
+
+ gtk_style_context_set_screen (widget->priv->context,
+ gtk_widget_get_screen (widget));
+ }
}
/**
@@ -7371,6 +7676,8 @@ gtk_widget_style_attach (GtkWidget *widget)
* mechanism, %FALSE otherwise.
*
* Since: 2.20
+ *
+ * Deprecated:3.0: Use #GtkStyleContext instead
**/
gboolean
gtk_widget_has_rc_style (GtkWidget *widget)
@@ -7390,6 +7697,8 @@ gtk_widget_has_rc_style (GtkWidget *widget)
* want to use this function; it interacts badly with themes, because
* themes work by replacing the #GtkStyle. Instead, use
* gtk_widget_modify_style().
+ *
+ * Deprecated:3.0: Use #GtkStyleContext instead
**/
void
gtk_widget_set_style (GtkWidget *widget,
@@ -7423,14 +7732,31 @@ gtk_widget_set_style (GtkWidget *widget,
* function; most of the time, if you want the style, the widget is
* realized, and realized widgets are guaranteed to have a style
* already.
+ *
+ * Deprecated:3.0: Use #GtkStyleContext instead
**/
void
gtk_widget_ensure_style (GtkWidget *widget)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
+ if (!widget->priv->style ||
+ !gtk_style_has_context (widget->priv->style))
+ {
+ GtkStyle *style;
+
+ style = g_object_new (GTK_TYPE_STYLE,
+ "context", gtk_widget_get_style_context (widget),
+ NULL);
+
+ gtk_widget_set_style_internal (widget, style, TRUE);
+ g_object_unref (style);
+ }
+
+#if 0
if (!widget->priv->rc_style && !widget->priv->user_style)
gtk_widget_reset_rc_style (widget);
+#endif
}
/* Look up the RC style for this widget, unsetting any user style that
@@ -7464,6 +7790,8 @@ gtk_widget_reset_rc_style (GtkWidget *widget)
* Simply an accessor function that returns @widget->style.
*
* Return value: (transfer none): the widget's #GtkStyle
+ *
+ * Deprecated:3.0: Use #GtkStyleContext instead
**/
GtkStyle*
gtk_widget_get_style (GtkWidget *widget)
@@ -7495,6 +7823,8 @@ gtk_widget_get_style (GtkWidget *widget)
* if you first call gtk_widget_modify_style(), subsequent calls
* to such functions gtk_widget_modify_fg() will have a cumulative
* effect with the initial modifications.
+ *
+ * Deprecated:3.0: Use #GtkStyleContext with a custom #GtkStyleProvider instead
**/
void
gtk_widget_modify_style (GtkWidget *widget,
@@ -7533,12 +7863,15 @@ gtk_widget_modify_style (GtkWidget *widget,
* thus dropping any reference to the old modifier style. Add a reference
* to the modifier style if you want to keep it alive.
*
- * Return value: (transfer none): the modifier style for the widget. This rc style is
- * owned by the widget. If you want to keep a pointer to value this
- * around, you must add a refcount using g_object_ref().
+ * Return value: (transfer none): the modifier style for the widget.
+ * This rc style is owned by the widget. If you want to keep a
+ * pointer to value this around, you must add a refcount using
+ * g_object_ref().
+ *
+ * Deprecated:3.0: Use #GtkStyleContext with a custom #GtkStyleProvider instead
**/
GtkRcStyle *
-gtk_widget_get_modifier_style (GtkWidget *widget)
+gtk_widget_get_modifier_style (GtkWidget *widget)
{
GtkRcStyle *rc_style;
@@ -7594,30 +7927,207 @@ gtk_widget_modify_color_component (GtkWidget *widget,
gtk_widget_modify_style (widget, rc_style);
}
+static void
+modifier_style_changed (GtkModifierStyle *style,
+ GtkWidget *widget)
+{
+ GtkStyleContext *context;
+
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_invalidate (context);
+}
+
+static GtkModifierStyle *
+_gtk_widget_get_modifier_properties (GtkWidget *widget)
+{
+ GtkModifierStyle *style;
+
+ style = g_object_get_qdata (G_OBJECT (widget), quark_modifier_style);
+
+ if (G_UNLIKELY (!style))
+ {
+ GtkStyleContext *context;
+
+ style = gtk_modifier_style_new ();
+ g_object_set_qdata_full (G_OBJECT (widget),
+ quark_modifier_style,
+ style,
+ (GDestroyNotify) g_object_unref);
+
+ g_signal_connect (style, "changed",
+ G_CALLBACK (modifier_style_changed), widget);
+
+ context = gtk_widget_get_style_context (widget);
+
+ gtk_style_context_add_provider (context,
+ GTK_STYLE_PROVIDER (style),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ }
+
+ return style;
+}
+
+/**
+ * gtk_widget_override_color:
+ * @widget: a #GtkWidget
+ * @state: the state for which to set the color
+ * @color: the color to assign, or %NULL to undo the effect
+ * of previous calls to gtk_widget_override_color()
+ *
+ * Sets the color to use for a widget. All other style values are left
+ * untouched.
+ *
+ * <note>
+ * <para>
+ * This API is mostly meant as a quick way for applications to change a
+ * widget appearance. If you are developing a widgets library and intend
+ * this change to be themeable, it is better done by setting meaningful
+ * CSS classes and regions in your widget/container implementation through
+ * gtk_style_context_add_class() and gtk_style_context_add_region().
+ * </para>
+ * <para>
+ * This way, your widget library can install a #GtkCssProvider with the
+ * %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK priority in order to provide a
+ * default styling for those widgets that need so, and this theming may
+ * fully overridden by the user's theme.
+ * </para>
+ * </note>
+ *
+ * <note>
+ * <para>
+ * Note that for complex widgets this may bring in
+ * undesired results (such as uniform background color everywhere),
+ * in these cases it is better to fully style such widgets through a
+ * #GtkCssProvider with the %GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
+ * priority.
+ * </para>
+ * </note>
+ *
+ * Since: 3.0
+ **/
+void
+gtk_widget_override_color (GtkWidget *widget,
+ GtkStateFlags state,
+ const GdkRGBA *color)
+{
+ GtkModifierStyle *style;
+
+ g_return_if_fail (GTK_IS_WIDGET (widget));
+
+ style = _gtk_widget_get_modifier_properties (widget);
+ gtk_modifier_style_set_color (style, state, color);
+}
+
+/**
+ * gtk_widget_override_background_color:
+ * @widget: a #GtkWidget
+ * @state: the state for which to set the background color
+ * @color: the color to assign, or %NULL to undo the effect
+ * of previous calls to gtk_widget_override_background_color()
+ *
+ * Sets the background color to use for a widget. All other style values
+ * are left untouched. See gtk_widget_override_color().
+ *
+ * Since: 3.0
+ **/
+void
+gtk_widget_override_background_color (GtkWidget *widget,
+ GtkStateFlags state,
+ const GdkRGBA *color)
+{
+ GtkModifierStyle *style;
+
+ g_return_if_fail (GTK_IS_WIDGET (widget));
+
+ style = _gtk_widget_get_modifier_properties (widget);
+ gtk_modifier_style_set_background_color (style, state, color);
+}
+
/**
- * gtk_widget_modify_symbolic_color:
+ * gtk_widget_override_font:
+ * @widget: a #GtkWidget
+ * @font_desc: the font descriptiong to use, or %NULL to undo
+ * the effect of previous calls to
+ * gtk_widget_override_font().
+ *
+ * Sets the font to use for a widget. All other style values are
+ * left untouched. See gtk_widget_override_color().
+ *
+ * Since: 3.0
+ **/
+void
+gtk_widget_override_font (GtkWidget *widget,
+ const PangoFontDescription *font_desc)
+{
+ GtkModifierStyle *style;
+
+ g_return_if_fail (GTK_IS_WIDGET (widget));
+
+ style = _gtk_widget_get_modifier_properties (widget);
+ gtk_modifier_style_set_font (style, font_desc);
+}
+
+/**
+ * gtk_widget_override_symbolic_color:
* @widget: a #GtkWidget
* @name: the name of the symbolic color to modify
* @color: (allow-none): the color to assign (does not need to be allocated),
* or %NULL to undo the effect of previous calls to
- * of gtk_widget_modify_symbolic_color().
+ * gtk_widget_override_symbolic_color().
*
- * Sets a symbolic color for a widget.
- * All other style values are left untouched. See also
- * gtk_widget_modify_style().
+ * Sets a symbolic color for a widget, All other style values are left
+ * untouched. See gtk_widget_override_color() for overriding the foreground
+ * or background color.
*
* Since: 3.0
**/
void
-gtk_widget_modify_symbolic_color (GtkWidget *widget,
- const gchar *name,
- const GdkColor *color)
+gtk_widget_override_symbolic_color (GtkWidget *widget,
+ const gchar *name,
+ const GdkRGBA *color)
{
- GtkRcStyle *rc_style = gtk_widget_get_modifier_style (widget);
+ GtkModifierStyle *style;
+
+ g_return_if_fail (GTK_IS_WIDGET (widget));
- _gtk_rc_style_set_symbolic_color (rc_style, name, color);
+ style = _gtk_widget_get_modifier_properties (widget);
+ gtk_modifier_style_map_color (style, name, color);
+}
- gtk_widget_modify_style (widget, rc_style);
+/**
+ * gtk_widget_override_cursor:
+ * @widget: a #GtkWidget
+ * @primary: the color to use for primary cursor (does not need to be
+ * allocated), or %NULL to undo the effect of previous calls to
+ * of gtk_widget_override_cursor().
+ * @secondary: the color to use for secondary cursor (does not need to be
+ * allocated), or %NULL to undo the effect of previous calls to
+ * of gtk_widget_override_cursor().
+ *
+ * Sets the cursor color to use in a widget, overriding the
+ * #GtkWidget:cursor-color and #GtkWidget:secondary-cursor-color
+ * style properties. All other style values are left untouched.
+ * See also gtk_widget_modify_style().
+ *
+ * Since: 3.0
+ **/
+void
+gtk_widget_override_cursor (GtkWidget *widget,
+ const GdkColor *cursor,
+ const GdkColor *secondary_cursor)
+{
+ GtkModifierStyle *style;
+
+ g_return_if_fail (GTK_IS_WIDGET (widget));
+
+ style = _gtk_widget_get_modifier_properties (widget);
+ gtk_modifier_style_set_color_property (style,
+ GTK_TYPE_WIDGET,
+ "cursor-color", cursor);
+ gtk_modifier_style_set_color_property (style,
+ GTK_TYPE_WIDGET,
+ "secondary-cursor-color",
+ secondary_cursor);
}
/**
@@ -7631,16 +8141,55 @@ gtk_widget_modify_symbolic_color (GtkWidget *widget,
* Sets the foreground color for a widget in a particular state.
* All other style values are left untouched. See also
* gtk_widget_modify_style().
+ *
+ * Deprecated:3.0: Use gtk_widget_override_color() instead
**/
void
gtk_widget_modify_fg (GtkWidget *widget,
GtkStateType state,
const GdkColor *color)
{
+ GtkStateFlags flags;
+ GdkRGBA rgba;
+
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (state >= GTK_STATE_NORMAL && state <= GTK_STATE_INSENSITIVE);
- gtk_widget_modify_color_component (widget, GTK_RC_FG, state, color);
+ switch (state)
+ {
+ case GTK_STATE_ACTIVE:
+ flags = GTK_STATE_FLAG_ACTIVE;
+ break;
+ case GTK_STATE_PRELIGHT:
+ flags = GTK_STATE_FLAG_PRELIGHT;
+ break;
+ case GTK_STATE_SELECTED:
+ flags = GTK_STATE_FLAG_SELECTED;
+ break;
+ case GTK_STATE_INSENSITIVE:
+ flags = GTK_STATE_FLAG_INSENSITIVE;
+ break;
+ case GTK_STATE_NORMAL:
+ default:
+ flags = 0;
+ }
+
+ if (color)
+ {
+ rgba.red = color->red / 65535.;
+ rgba.green = color->green / 65535.;
+ rgba.blue = color->blue / 65535.;
+ rgba.alpha = 1;
+
+ gtk_widget_override_color (widget, state, &rgba);
+ }
+ else
+ gtk_widget_override_color (widget, state, NULL);
+
+ g_signal_emit (widget,
+ widget_signals[STYLE_SET],
+ 0,
+ widget->priv->style);
}
/**
@@ -7662,16 +8211,55 @@ gtk_widget_modify_fg (GtkWidget *widget,
* on their parent; if you want to set the background of a rectangular
* area around a label, try placing the label in a #GtkEventBox widget
* and setting the background color on that.
+ *
+ * Deprecated:3.0: Use gtk_widget_override_background_color() instead
**/
void
gtk_widget_modify_bg (GtkWidget *widget,
GtkStateType state,
const GdkColor *color)
{
+ GtkStateFlags flags;
+ GdkRGBA rgba;
+
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (state >= GTK_STATE_NORMAL && state <= GTK_STATE_INSENSITIVE);
- gtk_widget_modify_color_component (widget, GTK_RC_BG, state, color);
+ switch (state)
+ {
+ case GTK_STATE_ACTIVE:
+ flags = GTK_STATE_FLAG_ACTIVE;
+ break;
+ case GTK_STATE_PRELIGHT:
+ flags = GTK_STATE_FLAG_PRELIGHT;
+ break;
+ case GTK_STATE_SELECTED:
+ flags = GTK_STATE_FLAG_SELECTED;
+ break;
+ case GTK_STATE_INSENSITIVE:
+ flags = GTK_STATE_FLAG_INSENSITIVE;
+ break;
+ case GTK_STATE_NORMAL:
+ default:
+ flags = 0;
+ }
+
+ if (color)
+ {
+ rgba.red = color->red / 65535.;
+ rgba.green = color->green / 65535.;
+ rgba.blue = color->blue / 65535.;
+ rgba.alpha = 1;
+
+ gtk_widget_override_background_color (widget, state, &rgba);
+ }
+ else
+ gtk_widget_override_background_color (widget, state, NULL);
+
+ g_signal_emit (widget,
+ widget_signals[STYLE_SET],
+ 0,
+ widget->priv->style);
}
/**
@@ -7687,6 +8275,8 @@ gtk_widget_modify_bg (GtkWidget *widget,
* color used along with the base color (see gtk_widget_modify_base())
* for widgets such as #GtkEntry and #GtkTextView. See also
* gtk_widget_modify_style().
+ *
+ * Deprecated:3.0: Use gtk_widget_override_color() instead
**/
void
gtk_widget_modify_text (GtkWidget *widget,
@@ -7720,6 +8310,8 @@ gtk_widget_modify_text (GtkWidget *widget,
* parent; if you want to set the background of a rectangular area around
* a label, try placing the label in a #GtkEventBox widget and setting
* the base color on that.
+ *
+ * Deprecated:3.0: Use gtk_widget_override_background_color() instead
**/
void
gtk_widget_modify_base (GtkWidget *widget,
@@ -7778,22 +8370,22 @@ modify_color_property (GtkWidget *widget,
* See also gtk_widget_modify_style().
*
* Since: 2.12
+ *
+ * Deprecated: 3.0. Use gtk_widget_override_cursor() instead.
**/
void
gtk_widget_modify_cursor (GtkWidget *widget,
const GdkColor *primary,
const GdkColor *secondary)
{
- GtkRcStyle *rc_style;
-
g_return_if_fail (GTK_IS_WIDGET (widget));
- rc_style = gtk_widget_get_modifier_style (widget);
-
- modify_color_property (widget, rc_style, "cursor-color", primary);
- modify_color_property (widget, rc_style, "secondary-cursor-color", secondary);
+ gtk_widget_override_cursor (widget, primary, secondary);
- gtk_widget_modify_style (widget, rc_style);
+ g_signal_emit (widget,
+ widget_signals[STYLE_SET],
+ 0,
+ widget->priv->style);
}
/**
@@ -7804,26 +8396,21 @@ gtk_widget_modify_cursor (GtkWidget *widget,
*
* Sets the font to use for a widget. All other style values are left
* untouched. See also gtk_widget_modify_style().
+ *
+ * Deprecated:3.0: Use gtk_widget_override_font() instead
**/
void
gtk_widget_modify_font (GtkWidget *widget,
PangoFontDescription *font_desc)
{
- GtkRcStyle *rc_style;
-
g_return_if_fail (GTK_IS_WIDGET (widget));
- rc_style = gtk_widget_get_modifier_style (widget);
-
- if (rc_style->font_desc)
- pango_font_description_free (rc_style->font_desc);
-
- if (font_desc)
- rc_style->font_desc = pango_font_description_copy (font_desc);
- else
- rc_style->font_desc = NULL;
+ gtk_widget_override_font (widget, font_desc);
- gtk_widget_modify_style (widget, rc_style);
+ g_signal_emit (widget,
+ widget_signals[STYLE_SET],
+ 0,
+ widget->priv->style);
}
static void
@@ -7841,7 +8428,8 @@ gtk_widget_real_style_set (GtkWidget *widget,
if (gtk_widget_get_realized (widget) &&
gtk_widget_get_has_window (widget))
- gtk_style_set_background (priv->style, priv->window, priv->state);
+ gtk_style_set_background (priv->style, priv->window,
+ gtk_widget_get_state (widget));
}
static void
@@ -7907,6 +8495,8 @@ do_screen_change (GtkWidget *widget,
{
if (old_screen != new_screen)
{
+ GtkStyleContext *context;
+
if (old_screen)
{
PangoContext *context = g_object_get_qdata (G_OBJECT (widget), quark_pango_context);
@@ -7915,6 +8505,10 @@ do_screen_change (GtkWidget *widget,
}
_gtk_tooltip_hide (widget);
+
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_set_screen (context, gtk_widget_get_screen (widget));
+
g_signal_emit (widget, widget_signals[SCREEN_CHANGED], 0, old_screen);
}
}
@@ -8078,17 +8672,33 @@ _gtk_widget_propagate_screen_changed (GtkWidget *widget,
}
static void
-reset_rc_styles_recurse (GtkWidget *widget, gpointer data)
+reset_style_recurse (GtkWidget *widget, gpointer data)
{
+#if 0
if (widget->priv->rc_style)
gtk_widget_reset_rc_style (widget);
+#endif
+
+ if (widget->priv->context)
+ {
+ _gtk_widget_update_path (widget);
+ gtk_style_context_set_path (widget->priv->context,
+ widget->priv->path);
+ }
if (GTK_IS_CONTAINER (widget))
gtk_container_forall (GTK_CONTAINER (widget),
- reset_rc_styles_recurse,
+ reset_style_recurse,
NULL);
}
+void
+gtk_widget_reset_style (GtkWidget *widget)
+{
+ g_return_if_fail (GTK_IS_WIDGET (widget));
+
+ reset_style_recurse (widget, NULL);
+}
/**
* gtk_widget_reset_rc_styles:
@@ -8099,13 +8709,15 @@ reset_rc_styles_recurse (GtkWidget *widget, gpointer data)
* for the currently loaded RC file settings.
*
* This function is not useful for applications.
+ *
+ * Deprecated:3.0: Use #GtkStyleContext instead
*/
void
gtk_widget_reset_rc_styles (GtkWidget *widget)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
- reset_rc_styles_recurse (widget, NULL);
+ reset_style_recurse (widget, NULL);
}
/**
@@ -8113,8 +8725,10 @@ gtk_widget_reset_rc_styles (GtkWidget *widget)
*
* Returns the default style used by all widgets initially.
*
- * Returns: (transfer none): the default style. This #GtkStyle object is owned
- * by GTK+ and should not be modified or freed.
+ * Returns: (transfer none): the default style. This #GtkStyle
+ * object is owned by GTK+ and should not be modified or freed.
+ *
+ * Deprecated:3.0: Use #GtkStyleContext instead
*/
GtkStyle*
gtk_widget_get_default_style (void)
@@ -8176,12 +8790,22 @@ static void
update_pango_context (GtkWidget *widget,
PangoContext *context)
{
- GtkWidgetPrivate *priv = widget->priv;
+ PangoFontDescription *font_desc;
+ GtkStyleContext *style_context;
+
+ style_context = gtk_widget_get_style_context (widget);
- pango_context_set_font_description (context, priv->style->font_desc);
+ gtk_style_context_get (style_context,
+ gtk_widget_get_state_flags (widget),
+ "font", &font_desc,
+ NULL);
+
+ pango_context_set_font_description (context, font_desc);
pango_context_set_base_dir (context,
gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR ?
PANGO_DIRECTION_LTR : PANGO_DIRECTION_RTL);
+
+ pango_font_description_free (font_desc);
}
static void
@@ -8277,21 +8901,18 @@ gtk_widget_create_pango_layout (GtkWidget *widget,
}
/**
- * gtk_widget_render_icon:
+ * gtk_widget_render_icon_pixbuf:
* @widget: a #GtkWidget
* @stock_id: a stock ID
* @size: (type int): a stock size. A size of (GtkIconSize)-1 means
* render at the size of the source and don't scale (if there are
* multiple source sizes, GTK+ picks one of the available sizes).
- * @detail: (allow-none): render detail to pass to theme engine
*
- * A convenience function that uses the theme engine and RC file
+ * A convenience function that uses the theme engine and style
* settings for @widget to look up @stock_id and render it to
* a pixbuf. @stock_id should be a stock icon ID such as
* #GTK_STOCK_OPEN or #GTK_STOCK_OK. @size should be a size
- * such as #GTK_ICON_SIZE_MENU. @detail should be a string that
- * identifies the widget or code doing the rendering, so that
- * theme engines can special-case rendering for that widget or code.
+ * such as #GTK_ICON_SIZE_MENU.
*
* The pixels in the returned #GdkPixbuf are shared with the rest of
* the application and should not be modified. The pixbuf should be freed
@@ -8299,16 +8920,16 @@ gtk_widget_create_pango_layout (GtkWidget *widget,
*
* Return value: (transfer full): a new pixbuf, or %NULL if the
* stock ID wasn't known
+ *
+ * Since: 3.0
**/
GdkPixbuf*
-gtk_widget_render_icon (GtkWidget *widget,
- const gchar *stock_id,
- GtkIconSize size,
- const gchar *detail)
+gtk_widget_render_icon_pixbuf (GtkWidget *widget,
+ const gchar *stock_id,
+ GtkIconSize size)
{
GtkWidgetPrivate *priv;
GtkIconSet *icon_set;
- GdkPixbuf *retval;
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
g_return_val_if_fail (stock_id != NULL, NULL);
@@ -8318,20 +8939,47 @@ gtk_widget_render_icon (GtkWidget *widget,
gtk_widget_ensure_style (widget);
- icon_set = gtk_style_lookup_icon_set (priv->style, stock_id);
+ icon_set = gtk_style_context_lookup_icon_set (priv->context, stock_id);
if (icon_set == NULL)
return NULL;
- retval = gtk_icon_set_render_icon (icon_set,
- priv->style,
- gtk_widget_get_direction (widget),
- gtk_widget_get_state (widget),
- size,
- widget,
- detail);
+ return gtk_icon_set_render_icon_pixbuf (icon_set, priv->context, size);
+}
- return retval;
+/**
+ * gtk_widget_render_icon:
+ * @widget: a #GtkWidget
+ * @stock_id: a stock ID
+ * @size: (type int): a stock size. A size of (GtkIconSize)-1 means
+ * render at the size of the source and don't scale (if there are
+ * multiple source sizes, GTK+ picks one of the available sizes).
+ * @detail: (allow-none): render detail to pass to theme engine
+ *
+ * A convenience function that uses the theme engine and RC file
+ * settings for @widget to look up @stock_id and render it to
+ * a pixbuf. @stock_id should be a stock icon ID such as
+ * #GTK_STOCK_OPEN or #GTK_STOCK_OK. @size should be a size
+ * such as #GTK_ICON_SIZE_MENU. @detail should be a string that
+ * identifies the widget or code doing the rendering, so that
+ * theme engines can special-case rendering for that widget or code.
+ *
+ * The pixels in the returned #GdkPixbuf are shared with the rest of
+ * the application and should not be modified. The pixbuf should be freed
+ * after use with g_object_unref().
+ *
+ * Return value: (transfer full): a new pixbuf, or %NULL if the
+ * stock ID wasn't known
+ *
+ * Deprecated: 3.0: Use gtk_widget_render_icon_pixbuf() instead.
+ **/
+GdkPixbuf*
+gtk_widget_render_icon (GtkWidget *widget,
+ const gchar *stock_id,
+ GtkIconSize size,
+ const gchar *detail)
+{
+ return gtk_widget_render_icon_pixbuf (widget, stock_id, size);
}
/**
@@ -9567,7 +10215,13 @@ gtk_widget_set_direction (GtkWidget *widget,
widget->priv->direction = dir;
if (old_dir != gtk_widget_get_direction (widget))
- gtk_widget_emit_direction_changed (widget, old_dir);
+ {
+ if (widget->priv->context)
+ gtk_style_context_set_direction (widget->priv->context,
+ gtk_widget_get_direction (widget));
+
+ gtk_widget_emit_direction_changed (widget, old_dir);
+ }
}
/**
@@ -9726,6 +10380,12 @@ gtk_widget_finalize (GObject *object)
if (accessible)
g_object_unref (accessible);
+ if (priv->path)
+ gtk_widget_path_free (priv->path);
+
+ if (priv->context)
+ g_object_unref (priv->context);
+
if (g_object_is_floating (object))
g_warning ("A floating object was finalized. This means that someone\n"
"called g_object_unref() on an object that had only a floating\n"
@@ -10278,33 +10938,27 @@ gtk_widget_propagate_state (GtkWidget *widget,
GtkStateData *data)
{
GtkWidgetPrivate *priv = widget->priv;
- guint8 old_state = gtk_widget_get_state (widget);
- guint8 old_saved_state = priv->saved_state;
+ GtkStateFlags new_flags, old_flags = priv->state_flags;
+ GtkStateType old_state;
- /* don't call this function with state==GTK_STATE_INSENSITIVE,
- * parent_sensitive==TRUE on a sensitive widget
- */
+ old_state = gtk_widget_get_state (widget);
+ if (!priv->parent_sensitive)
+ old_flags |= GTK_STATE_FLAG_INSENSITIVE;
priv->parent_sensitive = data->parent_sensitive;
- if (gtk_widget_is_sensitive (widget))
+ switch (data->operation)
{
- if (data->state_restoration)
- priv->state = priv->saved_state;
- else
- priv->state = data->state;
- }
- else
- {
- if (!data->state_restoration)
- {
- if (data->state != GTK_STATE_INSENSITIVE)
- priv->saved_state = data->state;
- }
- else if (gtk_widget_get_state (widget) != GTK_STATE_INSENSITIVE)
- priv->saved_state = gtk_widget_get_state (widget);
- priv->state = GTK_STATE_INSENSITIVE;
+ case STATE_CHANGE_REPLACE:
+ priv->state_flags = data->flags;
+ break;
+ case STATE_CHANGE_SET:
+ priv->state_flags |= data->flags;
+ break;
+ case STATE_CHANGE_UNSET:
+ priv->state_flags &= ~(data->flags);
+ break;
}
if (gtk_widget_is_focus (widget) && !gtk_widget_is_sensitive (widget))
@@ -10312,12 +10966,14 @@ gtk_widget_propagate_state (GtkWidget *widget,
GtkWidget *window;
window = gtk_widget_get_toplevel (widget);
+
if (window && gtk_widget_is_toplevel (window))
gtk_window_set_focus (GTK_WINDOW (window), NULL);
}
- if (old_state != gtk_widget_get_state (widget) ||
- old_saved_state != priv->saved_state)
+ new_flags = gtk_widget_get_state_flags (widget);
+
+ if (old_flags != new_flags)
{
g_object_ref (widget);
@@ -10325,6 +10981,7 @@ gtk_widget_propagate_state (GtkWidget *widget,
gtk_grab_remove (widget);
g_signal_emit (widget, widget_signals[STATE_CHANGED], 0, old_state);
+ g_signal_emit (widget, widget_signals[STATE_FLAGS_CHANGED], 0, old_flags);
if (!priv->shadowed)
{
@@ -10351,7 +11008,7 @@ gtk_widget_propagate_state (GtkWidget *widget,
if (!gtk_widget_is_sensitive (widget))
_gtk_widget_synthesize_crossing (widget, NULL, d->data,
GDK_CROSSING_STATE_CHANGED);
- else if (old_state == GTK_STATE_INSENSITIVE)
+ else if (old_flags & GTK_STATE_FLAG_INSENSITIVE)
_gtk_widget_synthesize_crossing (NULL, widget, d->data,
GDK_CROSSING_STATE_CHANGED);
@@ -10363,17 +11020,48 @@ gtk_widget_propagate_state (GtkWidget *widget,
}
if (GTK_IS_CONTAINER (widget))
- {
- data->parent_sensitive = (gtk_widget_is_sensitive (widget) != FALSE);
- if (data->use_forall)
- gtk_container_forall (GTK_CONTAINER (widget),
- (GtkCallback) gtk_widget_propagate_state,
- data);
- else
- gtk_container_foreach (GTK_CONTAINER (widget),
- (GtkCallback) gtk_widget_propagate_state,
- data);
- }
+ {
+ data->parent_sensitive = gtk_widget_is_sensitive (widget);
+
+ /* Do not propagate insensitive state further */
+ data->flags &= ~(GTK_STATE_FLAG_INSENSITIVE);
+
+ if (data->use_forall)
+ gtk_container_forall (GTK_CONTAINER (widget),
+ (GtkCallback) gtk_widget_propagate_state,
+ data);
+ else
+ gtk_container_foreach (GTK_CONTAINER (widget),
+ (GtkCallback) gtk_widget_propagate_state,
+ data);
+ }
+
+ /* Trigger state change transitions for the widget */
+ if (priv->context &&
+ gtk_widget_get_mapped (widget))
+ {
+ gint diff, flag = 1;
+ GdkWindow *window;
+
+ diff = old_flags ^ new_flags;
+ window = gtk_widget_get_window (widget);
+
+ while (diff != 0)
+ {
+ if ((diff & flag) != 0)
+ {
+ gboolean target;
+
+ target = ((new_flags & flag) != 0);
+ _gtk_widget_notify_state_change (widget, flag, target);
+
+ diff &= ~flag;
+ }
+
+ flag <<= 1;
+ }
+ }
+
g_object_unref (widget);
}
}
@@ -10692,15 +11380,12 @@ gtk_widget_style_get_property (GtkWidget *widget,
const gchar *property_name,
GValue *value)
{
- GtkWidgetPrivate *priv;
GParamSpec *pspec;
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (property_name != NULL);
g_return_if_fail (G_IS_VALUE (value));
- priv = widget->priv;
-
g_object_ref (widget);
pspec = g_param_spec_pool_lookup (style_property_spec_pool,
property_name,
@@ -10713,12 +11398,16 @@ gtk_widget_style_get_property (GtkWidget *widget,
property_name);
else
{
+ GtkStyleContext *context;
const GValue *peek_value;
+ GtkStateFlags state;
+
+ context = gtk_widget_get_style_context (widget);
+ state = gtk_widget_get_state_flags (widget);
- peek_value = _gtk_style_peek_property_value (priv->style,
- G_OBJECT_TYPE (widget),
- pspec,
- (GtkRcPropertyParser) g_param_spec_get_qdata (pspec, quark_property_parser));
+ peek_value = _gtk_style_context_peek_style_property (context,
+ G_OBJECT_TYPE (widget),
+ state, pspec);
/* auto-conversion of the caller's value type
*/
@@ -10751,14 +11440,15 @@ gtk_widget_style_get_valist (GtkWidget *widget,
const gchar *first_property_name,
va_list var_args)
{
- GtkWidgetPrivate *priv;
+ GtkStyleContext *context;
+ GtkStateFlags state;
const gchar *name;
g_return_if_fail (GTK_IS_WIDGET (widget));
- priv = widget->priv;
-
g_object_ref (widget);
+ context = gtk_widget_get_style_context (widget);
+ state = gtk_widget_get_state_flags (widget);
name = first_property_name;
while (name)
@@ -10781,10 +11471,10 @@ gtk_widget_style_get_valist (GtkWidget *widget,
}
/* style pspecs are always readable so we can spare that check here */
- peek_value = _gtk_style_peek_property_value (priv->style,
- G_OBJECT_TYPE (widget),
- pspec,
- (GtkRcPropertyParser) g_param_spec_get_qdata (pspec, quark_property_parser));
+ peek_value = _gtk_style_context_peek_style_property (context,
+ G_OBJECT_TYPE (widget),
+ state, pspec);
+
G_VALUE_LCOPY (peek_value, var_args, 0, &error);
if (error)
{
@@ -10826,9 +11516,12 @@ gtk_widget_style_get (GtkWidget *widget,
/**
* gtk_widget_path:
* @widget: a #GtkWidget
- * @path_length: (out) (allow-none): location to store length of the path, or %NULL
- * @path: (out) (allow-none): location to store allocated path string, or %NULL
- * @path_reversed: (out) (allow-none): location to store allocated reverse path string, or %NULL
+ * @path_length: (out) (allow-none): location to store length of the path,
+ * or %NULL
+ * @path: (out) (allow-none): location to store allocated path string,
+ * or %NULL
+ * @path_reversed: (out) (allow-none): location to store allocated reverse
+ * path string, or %NULL
*
* Obtains the full path to @widget. The path is simply the name of a
* widget and all its parents in the container hierarchy, separated by
@@ -10842,6 +11535,8 @@ gtk_widget_style_get (GtkWidget *widget,
* file. @path_reversed_p fills in the path in reverse order,
* i.e. starting with @widget's name instead of starting with the name
* of @widget's outermost ancestor.
+ *
+ * Deprecated:3.0: Use gtk_widget_get_path() instead
**/
void
gtk_widget_path (GtkWidget *widget,
@@ -10899,14 +11594,17 @@ gtk_widget_path (GtkWidget *widget,
/**
* gtk_widget_class_path:
* @widget: a #GtkWidget
- * @path_length: (out) (allow-none): location to store the length of the class path, or %NULL
- * @path: (out) (allow-none): location to store the class path as an allocated string, or %NULL
- * @path_reversed: (out) (allow-none): location to store the reverse class path as an allocated
- * string, or %NULL
+ * @path_length: (out) (allow-none): location to store the length of the
+ * class path, or %NULL
+ * @path: (out) (allow-none): location to store the class path as an
+ * allocated string, or %NULL
+ * @path_reversed: (out) (allow-none): location to store the reverse
+ * class path as an allocated string, or %NULL
*
* Same as gtk_widget_path(), but always uses the name of a widget's type,
* never uses a custom name set with gtk_widget_set_name().
*
+ * Deprecated:3.0: Use gtk_widget_get_path() instead
**/
void
gtk_widget_class_path (GtkWidget *widget,
@@ -13191,3 +13889,112 @@ _gtk_widget_set_height_request_needed (GtkWidget *widget,
{
widget->priv->height_request_needed = height_request_needed;
}
+
+/**
+ * gtk_widget_get_path:
+ * @widget: a #GtkWidget
+ *
+ * Returns the #GtkWidgetPath representing @widget, if the widget
+ * is not connected to a toplevel widget, a partial path will be
+ * created.
+ *
+ * Returns: (transfer none): The #GtkWidgetPath representing @widget
+ **/
+GtkWidgetPath *
+gtk_widget_get_path (GtkWidget *widget)
+{
+ g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
+
+ /* As strange as it may seem, this may happen on object construction.
+ * init() implementations of parent types may eventually call this function,
+ * each with its corresponding GType, which could leave a child
+ * implementation with a wrong widget type in the widget path
+ */
+ if (widget->priv->path &&
+ G_OBJECT_TYPE (widget) != gtk_widget_path_get_widget_type (widget->priv->path))
+ {
+ gtk_widget_path_free (widget->priv->path);
+ widget->priv->path = NULL;
+ }
+
+ if (!widget->priv->path)
+ {
+ GtkWidget *parent;
+ guint pos;
+
+ parent = widget->priv->parent;
+
+ if (parent)
+ widget->priv->path = gtk_container_get_path_for_child (GTK_CONTAINER (parent), widget);
+ else
+ {
+ /* Widget is either toplevel or unparented, treat both
+ * as toplevels style wise, since there are situations
+ * where style properties might be retrieved on that
+ * situation.
+ */
+ widget->priv->path = gtk_widget_path_new ();
+ }
+
+ pos = gtk_widget_path_append_type (widget->priv->path, G_OBJECT_TYPE (widget));
+
+ if (widget->priv->name)
+ gtk_widget_path_iter_set_name (widget->priv->path, pos, widget->priv->name);
+
+ if (widget->priv->context)
+ gtk_style_context_set_path (widget->priv->context,
+ widget->priv->path);
+ }
+
+ return widget->priv->path;
+}
+
+static void
+style_context_changed (GtkStyleContext *context,
+ gpointer user_data)
+{
+ GtkWidget *widget = user_data;
+
+ g_signal_emit (widget, widget_signals[STYLE_UPDATED], 0);
+}
+
+/**
+ * gtk_widget_get_style_context:
+ * @widget: a #GtkWidget
+ *
+ * Returns the style context associated to @widget.
+ *
+ * Returns: (transfer none): a #GtkStyleContext. This memory is owned by @widget and
+ * must not be freed.
+ **/
+GtkStyleContext *
+gtk_widget_get_style_context (GtkWidget *widget)
+{
+ g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
+
+ if (G_UNLIKELY (!widget->priv->context))
+ {
+ widget->priv->context = g_object_new (GTK_TYPE_STYLE_CONTEXT,
+ "direction", gtk_widget_get_direction (widget),
+ NULL);
+
+ g_signal_connect (widget->priv->context, "changed",
+ G_CALLBACK (style_context_changed), widget);
+
+ gtk_style_context_set_screen (widget->priv->context,
+ gtk_widget_get_screen (widget));
+
+ _gtk_widget_update_path (widget);
+ gtk_style_context_set_path (widget->priv->context,
+ widget->priv->path);
+ }
+ else
+ {
+ /* Force widget path regeneration if needed, the
+ * context will be updated within this function.
+ */
+ gtk_widget_get_path (widget);
+ }
+
+ return widget->priv->context;
+}
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 8a566df12b..83cdb66270 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -35,7 +35,10 @@
#include <gtk/gtkaccelgroup.h>
#include <gtk/gtkadjustment.h>
#include <gtk/gtkstyle.h>
+#include <gtk/gtkborder.h>
#include <gtk/gtksettings.h>
+#include <gtk/gtkstylecontext.h>
+#include <gtk/gtkwidgetpath.h>
#include <atk/atk.h>
G_BEGIN_DECLS
@@ -223,6 +226,8 @@ struct _GtkWidgetClass
GtkAllocation *allocation);
void (* state_changed) (GtkWidget *widget,
GtkStateType previous_state);
+ void (* state_flags_changed) (GtkWidget *widget,
+ GtkStateFlags previous_state_flags);
void (* parent_set) (GtkWidget *widget,
GtkWidget *previous_parent);
void (* hierarchy_changed) (GtkWidget *widget,
@@ -320,8 +325,6 @@ struct _GtkWidgetClass
GdkEventVisibility *event);
gboolean (* client_event) (GtkWidget *widget,
GdkEventClient *event);
- gboolean (* no_expose_event) (GtkWidget *widget,
- GdkEventAny *event);
gboolean (* window_state_event) (GtkWidget *widget,
GdkEventWindowState *event);
gboolean (* damage_event) (GtkWidget *widget,
@@ -416,6 +419,8 @@ struct _GtkWidgetClass
gint *allocated_pos,
gint *allocated_size);
+ void (* style_updated) (GtkWidget *widget);
+
/*< private >*/
/* Padding for future expansion */
@@ -576,6 +581,13 @@ void gtk_widget_set_state (GtkWidget *widget,
GtkStateType state);
GtkStateType gtk_widget_get_state (GtkWidget *widget);
+void gtk_widget_set_state_flags (GtkWidget *widget,
+ GtkStateFlags flags,
+ gboolean clear);
+void gtk_widget_unset_state_flags (GtkWidget *widget,
+ GtkStateFlags flags);
+GtkStateFlags gtk_widget_get_state_flags (GtkWidget *widget);
+
void gtk_widget_set_sensitive (GtkWidget *widget,
gboolean sensitive);
gboolean gtk_widget_get_sensitive (GtkWidget *widget);
@@ -747,10 +759,31 @@ gboolean gtk_widget_translate_coordinates (GtkWidget *src_widget,
*/
gboolean gtk_widget_hide_on_delete (GtkWidget *widget);
+/* Functions to override widget styling */
+void gtk_widget_override_color (GtkWidget *widget,
+ GtkStateFlags state,
+ const GdkRGBA *color);
+void gtk_widget_override_background_color (GtkWidget *widget,
+ GtkStateFlags state,
+ const GdkRGBA *color);
+
+void gtk_widget_override_font (GtkWidget *widget,
+ const PangoFontDescription *font_desc);
+
+void gtk_widget_override_symbolic_color (GtkWidget *widget,
+ const gchar *name,
+ const GdkRGBA *color);
+void gtk_widget_override_cursor (GtkWidget *widget,
+ const GdkColor *cursor,
+ const GdkColor *secondary_cursor);
+
+
+void gtk_widget_style_attach (GtkWidget *widget);
+
+#if !defined(GTK_DISABLE_DEPRECATED) || defined(GTK_COMPILATION)
+
/* Widget styles.
*/
-void gtk_widget_style_attach (GtkWidget *widget);
-
gboolean gtk_widget_has_rc_style (GtkWidget *widget);
void gtk_widget_set_style (GtkWidget *widget,
GtkStyle *style);
@@ -777,9 +810,27 @@ void gtk_widget_modify_cursor (GtkWidget *widget,
const GdkColor *secondary);
void gtk_widget_modify_font (GtkWidget *widget,
PangoFontDescription *font_desc);
-void gtk_widget_modify_symbolic_color (GtkWidget *widget,
- const gchar *name,
- const GdkColor *color);
+
+/* Descend recursively and set rc-style on all widgets without user styles */
+void gtk_widget_reset_rc_styles (GtkWidget *widget);
+void gtk_widget_reset_style (GtkWidget *widget);
+
+/* Set certain default values to be used at widget creation time */
+GtkStyle* gtk_widget_get_default_style (void);
+
+/* Compute a widget's path in the form "GtkWindow.MyLabel", and
+ * return newly alocated strings.
+ */
+void gtk_widget_path (GtkWidget *widget,
+ guint *path_length,
+ gchar **path,
+ gchar **path_reversed);
+void gtk_widget_class_path (GtkWidget *widget,
+ guint *path_length,
+ gchar **path,
+ gchar **path_reversed);
+
+#endif /* GTK_DISABLE_DEPRECATED */
PangoContext *gtk_widget_create_pango_context (GtkWidget *widget);
PangoContext *gtk_widget_get_pango_context (GtkWidget *widget);
@@ -798,9 +849,6 @@ void gtk_widget_set_composite_name (GtkWidget *widget,
const gchar *name);
gchar* gtk_widget_get_composite_name (GtkWidget *widget);
-/* Descend recursively and set rc-style on all widgets without user styles */
-void gtk_widget_reset_rc_styles (GtkWidget *widget);
-
/* Push/pop pairs, to change default values upon a widget's creation.
* This will override the values that got set by the
* gtk_widget_set_default_* () functions.
@@ -829,13 +877,7 @@ void gtk_widget_style_get (GtkWidget *widget,
const gchar *first_property_name,
...) G_GNUC_NULL_TERMINATED;
-
-/* Set certain default values to be used at widget creation time.
- */
-GtkStyle* gtk_widget_get_default_style (void);
-
-/* Functions for setting directionality for widgets
- */
+/* Functions for setting directionality for widgets */
void gtk_widget_set_direction (GtkWidget *widget,
GtkTextDirection dir);
@@ -857,18 +899,6 @@ void gtk_widget_input_shape_combine_region (GtkWidget *widget,
/* internal function */
void gtk_widget_reset_shapes (GtkWidget *widget);
-/* Compute a widget's path in the form "GtkWindow.MyLabel", and
- * return newly alocated strings.
- */
-void gtk_widget_path (GtkWidget *widget,
- guint *path_length,
- gchar **path,
- gchar **path_reversed);
-void gtk_widget_class_path (GtkWidget *widget,
- guint *path_length,
- gchar **path,
- gchar **path_reversed);
-
GList* gtk_widget_list_mnemonic_labels (GtkWidget *widget);
void gtk_widget_add_mnemonic_label (GtkWidget *widget,
GtkWidget *label);
@@ -943,6 +973,11 @@ void _gtk_widget_buildable_finish_accelerator (GtkWidget *widget,
gboolean gtk_widget_in_destruction (GtkWidget *widget);
+GtkStyleContext * gtk_widget_get_style_context (GtkWidget *widget);
+
+GtkWidgetPath * gtk_widget_get_path (GtkWidget *widget);
+
+
G_END_DECLS
#endif /* __GTK_WIDGET_H__ */
diff --git a/gtk/gtkwidgetpath.c b/gtk/gtkwidgetpath.c
new file mode 100644
index 0000000000..d25f550975
--- /dev/null
+++ b/gtk/gtkwidgetpath.c
@@ -0,0 +1,1048 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include <string.h>
+
+#include "gtkwidget.h"
+#include "gtkwidgetpath.h"
+
+/**
+ * SECTION:gtkwidgetpath
+ * @Short_description: Widget path abstraction
+ * @Title: GtkWidgetPath
+ * @See_also: #GtkStyleContext
+ *
+ * GtkWidgetPath is a boxed type that represents a widget hierarchy from
+ * the topmost widget, typically a toplevel, to any child. This widget
+ * path abstraction is used in #GtkStyleContext on behalf of the real
+ * widget in order to query style information.
+ *
+ * If you are using GTK+ widgets, you probably will not need to use
+ * this API directly, as there is gtk_widget_get_path(), and the style
+ * context returned by gtk_widget_get_style_context() will be automatically
+ * updated on widget hierarchy changes.
+ *
+ * The widget path generation is generally simple:
+ * <example>
+ * <title>Defining a button within a window</title>
+ * <programlisting>
+ * {
+ * GtkWidgetPath *path;
+ *
+ * path = gtk_widget_path_new ();
+ * gtk_widget_path_append_type (path, GTK_TYPE_WINDOW);
+ * gtk_widget_path_append_type (path, GTK_TYPE_BUTTON);
+ * }
+ * </programlisting>
+ * </example>
+ *
+ * Although more complex information, such as widget names, or
+ * different classes (property that may be used by other widget
+ * types) and intermediate regions may be included:
+ *
+ * <example>
+ * <title>Defining the first tab widget in a notebook</title>
+ * <programlisting>
+ * {
+ * GtkWidgetPath *path;
+ * guint pos;
+ *
+ * path = gtk_widget_path_new ();
+ *
+ * pos = gtk_widget_path_append_type (path, GTK_TYPE_NOTEBOOK);
+ * gtk_widget_path_iter_add_region (path, pos, "tab", GTK_REGION_EVEN | GTK_REGION_FIRST);
+ *
+ * pos = gtk_widget_path_append_type (path, GTK_TYPE_LABEL);
+ * gtk_widget_path_iter_set_name (path, pos, "first tab label");
+ * }
+ * </programlisting>
+ * </example>
+ *
+ * All this information will be used to match the style information
+ * that applies to the described widget.
+ **/
+
+G_DEFINE_BOXED_TYPE (GtkWidgetPath, gtk_widget_path,
+ gtk_widget_path_copy, gtk_widget_path_free)
+
+
+typedef struct GtkPathElement GtkPathElement;
+
+struct GtkPathElement
+{
+ GType type;
+ GQuark name;
+ GHashTable *regions;
+ GArray *classes;
+};
+
+struct _GtkWidgetPath
+{
+ GArray *elems; /* First element contains the described widget */
+};
+
+/**
+ * gtk_widget_path_new:
+ *
+ * Returns an empty widget path.
+ *
+ * Returns: (transfer full): A newly created, empty, #GtkWidgetPath
+ *
+ * Since: 3.0
+ **/
+GtkWidgetPath *
+gtk_widget_path_new (void)
+{
+ GtkWidgetPath *path;
+
+ path = g_slice_new0 (GtkWidgetPath);
+ path->elems = g_array_new (FALSE, TRUE, sizeof (GtkPathElement));
+
+ return path;
+}
+
+/**
+ * gtk_widget_path_copy:
+ * @path: a #GtkWidgetPath
+ *
+ * Returns a copy of @path
+ *
+ * Returns: (transfer full): a copy of @path
+ *
+ * Since: 3.0
+ **/
+GtkWidgetPath *
+gtk_widget_path_copy (const GtkWidgetPath *path)
+{
+ GtkWidgetPath *new_path;
+ guint i;
+
+ g_return_val_if_fail (path != NULL, NULL);
+
+ new_path = gtk_widget_path_new ();
+
+ for (i = 0; i < path->elems->len; i++)
+ {
+ GtkPathElement *elem, new = { 0 };
+
+ elem = &g_array_index (path->elems, GtkPathElement, i);
+
+ new.type = elem->type;
+ new.name = elem->name;
+
+ if (elem->regions)
+ {
+ GHashTableIter iter;
+ gpointer key, value;
+
+ g_hash_table_iter_init (&iter, elem->regions);
+ new.regions = g_hash_table_new (NULL, NULL);
+
+ while (g_hash_table_iter_next (&iter, &key, &value))
+ g_hash_table_insert (new.regions, key, value);
+ }
+
+ if (elem->classes)
+ {
+ new.classes = g_array_new (FALSE, FALSE, sizeof (GQuark));
+ g_array_append_vals (new.classes, elem->classes->data, elem->classes->len);
+ }
+
+ g_array_append_val (new_path->elems, new);
+ }
+
+ return new_path;
+}
+
+/**
+ * gtk_widget_path_free:
+ * @path: a #GtkWidgetPath
+ *
+ * Frees a #GtkWidgetPath.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_widget_path_free (GtkWidgetPath *path)
+{
+ guint i;
+
+ g_return_if_fail (path != NULL);
+
+ for (i = 0; i < path->elems->len; i++)
+ {
+ GtkPathElement *elem;
+
+ elem = &g_array_index (path->elems, GtkPathElement, i);
+
+ if (elem->regions)
+ g_hash_table_destroy (elem->regions);
+
+ if (elem->classes)
+ g_array_free (elem->classes, TRUE);
+ }
+
+ g_array_free (path->elems, TRUE);
+ g_slice_free (GtkWidgetPath, path);
+}
+
+/**
+ * gtk_widget_path_length:
+ * @path: a #GtkWidgetPath
+ *
+ * Returns the number of #GtkWidget #GTypes between the represented
+ * widget and its topmost container.
+ *
+ * Returns: the number of elements in the path
+ *
+ * Since: 3.0
+ **/
+gint
+gtk_widget_path_length (const GtkWidgetPath *path)
+{
+ g_return_val_if_fail (path != NULL, 0);
+
+ return path->elems->len;
+}
+
+/**
+ * gtk_widget_path_prepend_type:
+ * @path: a #GtkWidgetPath
+ * @type: widget type to prepend
+ *
+ * Prepends a widget type to the widget hierachy represented by @path.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_widget_path_prepend_type (GtkWidgetPath *path,
+ GType type)
+{
+ GtkPathElement new = { 0 };
+
+ g_return_if_fail (path != NULL);
+ g_return_if_fail (g_type_is_a (type, GTK_TYPE_WIDGET));
+
+ new.type = type;
+ g_array_prepend_val (path->elems, new);
+}
+
+/**
+ * gtk_widget_path_append_type:
+ * @path: a #GtkWidgetPath
+ * @type: widget type to append
+ *
+ * Appends a widget type to the widget hierachy represented by @path.
+ *
+ * Returns: the position where the element was inserted
+ *
+ * Since: 3.0
+ **/
+gint
+gtk_widget_path_append_type (GtkWidgetPath *path,
+ GType type)
+{
+ GtkPathElement new = { 0 };
+
+ g_return_val_if_fail (path != NULL, 0);
+ g_return_val_if_fail (g_type_is_a (type, GTK_TYPE_WIDGET), 0);
+
+ new.type = type;
+ g_array_append_val (path->elems, new);
+
+ return path->elems->len - 1;
+}
+
+/**
+ * gtk_widget_path_iter_get_widget_type:
+ * @path: a #GtkWidgetPath
+ * @pos: position to get the widget type for, -1 for the path head
+ *
+ * Returns the widget #GType that is at position @pos in the widget
+ * hierarchy defined in @path.
+ *
+ * Returns: a widget type
+ *
+ * Since: 3.0
+ **/
+GType
+gtk_widget_path_iter_get_widget_type (const GtkWidgetPath *path,
+ gint pos)
+{
+ GtkPathElement *elem;
+
+ g_return_val_if_fail (path != NULL, G_TYPE_INVALID);
+ g_return_val_if_fail (path->elems->len != 0, G_TYPE_INVALID);
+
+ if (pos < 0 || pos > path->elems->len)
+ pos = path->elems->len - 1;
+
+ elem = &g_array_index (path->elems, GtkPathElement, pos);
+ return elem->type;
+}
+
+/**
+ * gtk_widget_path_iter_set_widget_type:
+ * @path: a #GtkWidgetPath
+ * @pos: position to modify, -1 for the path head
+ * @type: widget type to set
+ *
+ * Sets the widget type for a given position in the widget hierarchy
+ * defined by @path. @type must be a #GtkWidget derived #GType.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_widget_path_iter_set_widget_type (GtkWidgetPath *path,
+ gint pos,
+ GType type)
+{
+ GtkPathElement *elem;
+
+ g_return_if_fail (path != NULL);
+ g_return_if_fail (path->elems->len != 0);
+ g_return_if_fail (g_type_is_a (type, GTK_TYPE_WIDGET));
+
+ if (pos < 0 || pos > path->elems->len)
+ pos = path->elems->len - 1;
+
+ elem = &g_array_index (path->elems, GtkPathElement, pos);
+ elem->type = type;
+}
+
+/**
+ * gtk_widget_path_iter_get_name:
+ * @path: a #GtkWidgetPath
+ * @pos: position to get the widget name for, -1 for the path head
+ *
+ * Returns the name corresponding to the widget found at
+ * the position @pos in the widget hierarchy defined by
+ * @path
+ *
+ * Returns: The widget name, or %NULL if none was set.
+ **/
+G_CONST_RETURN gchar *
+gtk_widget_path_iter_get_name (const GtkWidgetPath *path,
+ gint pos)
+{
+ GtkPathElement *elem;
+
+ g_return_val_if_fail (path != NULL, NULL);
+ g_return_val_if_fail (path->elems->len != 0, NULL);
+
+ if (pos < 0 || pos > path->elems->len)
+ pos = path->elems->len - 1;
+
+ elem = &g_array_index (path->elems, GtkPathElement, pos);
+ return g_quark_to_string (elem->name);
+}
+
+/**
+ * gtk_widget_path_iter_set_name:
+ * @path: a #GtkWidgetPath
+ * @pos: position to modify, -1 for the path head
+ * @name: widget name
+ *
+ * Sets the widget name for the widget found at position @pos
+ * in the widget hierarchy defined by @path.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_widget_path_iter_set_name (GtkWidgetPath *path,
+ gint pos,
+ const gchar *name)
+{
+ GtkPathElement *elem;
+
+ g_return_if_fail (path != NULL);
+ g_return_if_fail (path->elems->len != 0);
+ g_return_if_fail (name != NULL);
+
+ if (pos < 0 || pos > path->elems->len)
+ pos = path->elems->len - 1;
+
+ elem = &g_array_index (path->elems, GtkPathElement, pos);
+
+ elem->name = g_quark_from_string (name);
+}
+
+/**
+ * gtk_widget_path_iter_has_qname:
+ * @path: a #GtkWidgetPath
+ * @pos: position to query, -1 for the path head
+ * @qname: widget name as a #GQuark
+ *
+ * See gtk_widget_path_iter_has_name(). This is a version
+ * that operates on #GQuark<!-- -->s.
+ *
+ * Returns: %TRUE if the widget at @pos has this name
+ *
+ * Since: 3.0
+ **/
+gboolean
+gtk_widget_path_iter_has_qname (const GtkWidgetPath *path,
+ gint pos,
+ GQuark qname)
+{
+ GtkPathElement *elem;
+
+ g_return_val_if_fail (path != NULL, FALSE);
+ g_return_val_if_fail (path->elems->len != 0, FALSE);
+ g_return_val_if_fail (qname != 0, FALSE);
+
+ if (pos < 0 || pos > path->elems->len)
+ pos = path->elems->len - 1;
+
+ elem = &g_array_index (path->elems, GtkPathElement, pos);
+
+ return (elem->name == qname);
+}
+
+/**
+ * gtk_widget_path_iter_has_name:
+ * @path: a #GtkWidgetPath
+ * @pos: position to query, -1 for the path head
+ * @name: a widget name
+ *
+ * Returns %TRUE if the widget at position @pos has the name @name,
+ * %FALSE otherwise.
+ *
+ * Returns: %TRUE if the widget at @pos has this name
+ *
+ * Since: 3.0
+ **/
+gboolean
+gtk_widget_path_iter_has_name (const GtkWidgetPath *path,
+ gint pos,
+ const gchar *name)
+{
+ GQuark qname;
+
+ g_return_val_if_fail (path != NULL, FALSE);
+ g_return_val_if_fail (path->elems->len != 0, FALSE);
+
+ if (pos < 0 || pos > path->elems->len)
+ pos = path->elems->len - 1;
+
+ qname = g_quark_try_string (name);
+
+ if (qname == 0)
+ return FALSE;
+
+ return gtk_widget_path_iter_has_qname (path, pos, qname);
+}
+
+/**
+ * gtk_widget_path_iter_add_class:
+ * @path: a #GtkWidget
+ * @pos: position to modify, -1 for the path head
+ * @name: a class name
+ *
+ * Adds the class @name to the widget at position @pos in
+ * the hierarchy defined in @path. See
+ * gtk_style_context_add_class().
+ *
+ * Since: 3.0
+ **/
+void
+gtk_widget_path_iter_add_class (GtkWidgetPath *path,
+ gint pos,
+ const gchar *name)
+{
+ GtkPathElement *elem;
+ gboolean added = FALSE;
+ GQuark qname;
+ guint i;
+
+ g_return_if_fail (path != NULL);
+ g_return_if_fail (path->elems->len != 0);
+ g_return_if_fail (name != NULL);
+
+ if (pos < 0 || pos > path->elems->len)
+ pos = path->elems->len - 1;
+
+ elem = &g_array_index (path->elems, GtkPathElement, pos);
+ qname = g_quark_from_string (name);
+
+ if (!elem->classes)
+ elem->classes = g_array_new (FALSE, FALSE, sizeof (GQuark));
+
+ for (i = 0; i < elem->classes->len; i++)
+ {
+ GQuark quark;
+
+ quark = g_array_index (elem->classes, GQuark, i);
+
+ if (qname == quark)
+ {
+ /* Already there */
+ added = TRUE;
+ break;
+ }
+ if (qname < quark)
+ {
+ g_array_insert_val (elem->classes, i, qname);
+ added = TRUE;
+ break;
+ }
+ }
+
+ if (!added)
+ g_array_append_val (elem->classes, qname);
+}
+
+/**
+ * gtk_widget_path_iter_remove_class:
+ * @path: a #GtkWidgetPath
+ * @pos: position to modify, -1 for the path head
+ * @name: class name
+ *
+ * Removes the class @name from the widget at position @pos in
+ * the hierarchy defined in @path.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_widget_path_iter_remove_class (GtkWidgetPath *path,
+ gint pos,
+ const gchar *name)
+{
+ GtkPathElement *elem;
+ GQuark qname;
+ guint i;
+
+ g_return_if_fail (path != NULL);
+ g_return_if_fail (path->elems->len != 0);
+ g_return_if_fail (name != NULL);
+
+ if (pos < 0 || pos > path->elems->len)
+ pos = path->elems->len - 1;
+
+ qname = g_quark_try_string (name);
+
+ if (qname == 0)
+ return;
+
+ elem = &g_array_index (path->elems, GtkPathElement, pos);
+
+ if (!elem->classes)
+ return;
+
+ for (i = 0; i < elem->classes->len; i++)
+ {
+ GQuark quark;
+
+ quark = g_array_index (elem->classes, GQuark, i);
+
+ if (quark > qname)
+ break;
+ else if (quark == qname)
+ {
+ g_array_remove_index (elem->classes, i);
+ break;
+ }
+ }
+}
+
+/**
+ * gtk_widget_path_iter_clear_classes:
+ * @path: a #GtkWidget
+ * @pos: position to modify, -1 for the path head
+ *
+ * Removes all classes from the widget at position @pos in the
+ * hierarchy defined in @path.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_widget_path_iter_clear_classes (GtkWidgetPath *path,
+ gint pos)
+{
+ GtkPathElement *elem;
+
+ g_return_if_fail (path != NULL);
+ g_return_if_fail (path->elems->len != 0);
+
+ if (pos < 0 || pos > path->elems->len)
+ pos = path->elems->len - 1;
+
+ elem = &g_array_index (path->elems, GtkPathElement, pos);
+
+ if (!elem->classes)
+ return;
+
+ if (elem->classes->len > 0)
+ g_array_remove_range (elem->classes, 0, elem->classes->len);
+}
+
+/**
+ * gtk_widget_path_iter_list_classes:
+ * @path: a #GtkWidgetPath
+ * @pos: position to query, -1 for the path head
+ *
+ * Returns a list with all the class names defined for the widget
+ * at position @pos in the hierarchy defined in @path.
+ *
+ * Returns: (transfer container) (type utf8): The list of classes,
+ * This is a list of strings, the #GSList contents are
+ * owned by GTK+, but you should use g_slist_free() to
+ * free the list itself.
+ *
+ * Since: 3.0
+ **/
+GSList *
+gtk_widget_path_iter_list_classes (const GtkWidgetPath *path,
+ gint pos)
+{
+ GtkPathElement *elem;
+ GSList *list = NULL;
+ guint i;
+
+ g_return_val_if_fail (path != NULL, NULL);
+ g_return_val_if_fail (path->elems->len != 0, NULL);
+
+ if (pos < 0 || pos > path->elems->len)
+ pos = path->elems->len - 1;
+
+ elem = &g_array_index (path->elems, GtkPathElement, pos);
+
+ if (!elem->classes)
+ return NULL;
+
+ for (i = 0; i < elem->classes->len; i++)
+ {
+ GQuark quark;
+
+ quark = g_array_index (elem->classes, GQuark, i);
+ list = g_slist_prepend (list, (gchar *) g_quark_to_string (quark));
+ }
+
+ return g_slist_reverse (list);
+}
+
+/**
+ * gtk_widget_path_iter_has_qclass:
+ * @path: a #GtkWidgetPath
+ * @pos: position to query, -1 for the path head
+ * @qname: class name as a #GQuark
+ *
+ * See gtk_widget_path_iter_has_class(). This is a version that operates
+ * with GQuark<!-- -->s.
+ *
+ * Returns: %TRUE if the widget at @pos has the class defined.
+ *
+ * Since: 3.0
+ **/
+gboolean
+gtk_widget_path_iter_has_qclass (const GtkWidgetPath *path,
+ gint pos,
+ GQuark qname)
+{
+ GtkPathElement *elem;
+ guint i;
+
+ g_return_val_if_fail (path != NULL, FALSE);
+ g_return_val_if_fail (path->elems->len != 0, FALSE);
+ g_return_val_if_fail (qname != 0, FALSE);
+
+ if (pos < 0 || pos > path->elems->len)
+ pos = path->elems->len - 1;
+
+ elem = &g_array_index (path->elems, GtkPathElement, pos);
+
+ if (!elem->classes)
+ return FALSE;
+
+ for (i = 0; i < elem->classes->len; i++)
+ {
+ GQuark quark;
+
+ quark = g_array_index (elem->classes, GQuark, i);
+
+ if (quark == qname)
+ return TRUE;
+ else if (quark > qname)
+ break;
+ }
+
+ return FALSE;
+}
+
+/**
+ * gtk_widget_path_iter_has_class:
+ * @path: a #GtkWidgetPath
+ * @pos: position to query, -1 for the path head
+ * @name: class name
+ *
+ * Returns %TRUE if the widget at position @pos has the class @name
+ * defined, %FALSE otherwise.
+ *
+ * Returns: %TRUE if the class @name is defined for the widget at @pos
+ *
+ * Since: 3.0
+ **/
+gboolean
+gtk_widget_path_iter_has_class (const GtkWidgetPath *path,
+ gint pos,
+ const gchar *name)
+{
+ GQuark qname;
+
+ g_return_val_if_fail (path != NULL, FALSE);
+ g_return_val_if_fail (path->elems->len != 0, FALSE);
+ g_return_val_if_fail (name != NULL, FALSE);
+
+ if (pos < 0 || pos > path->elems->len)
+ pos = path->elems->len - 1;
+
+ qname = g_quark_try_string (name);
+
+ if (qname == 0)
+ return FALSE;
+
+ return gtk_widget_path_iter_has_qclass (path, pos, qname);
+}
+
+/**
+ * gtk_widget_path_iter_add_region:
+ * @path: a #GtkWidgetPath
+ * @pos: position to modify, -1 for the path head
+ * @name: region name
+ * @flags: flags affecting the region
+ *
+ * Adds the region @name to the widget at position @pos in
+ * the hierarchy defined in @path. See
+ * gtk_style_context_add_region().
+ *
+ * Since: 3.0
+ **/
+void
+gtk_widget_path_iter_add_region (GtkWidgetPath *path,
+ gint pos,
+ const gchar *name,
+ GtkRegionFlags flags)
+{
+ GtkPathElement *elem;
+ GQuark qname;
+
+ g_return_if_fail (path != NULL);
+ g_return_if_fail (path->elems->len != 0);
+ g_return_if_fail (name != NULL);
+
+ if (pos < 0 || pos > path->elems->len)
+ pos = path->elems->len - 1;
+
+ elem = &g_array_index (path->elems, GtkPathElement, pos);
+ qname = g_quark_from_string (name);
+
+ if (!elem->regions)
+ elem->regions = g_hash_table_new (NULL, NULL);
+
+ g_hash_table_insert (elem->regions,
+ GUINT_TO_POINTER (qname),
+ GUINT_TO_POINTER (flags));
+}
+
+/**
+ * gtk_widget_path_iter_remove_region:
+ * @path: a #GtkWidgetPath
+ * @pos: position to modify, -1 for the path head
+ * @name: region name
+ *
+ * Removes the region @name from the widget at position @pos in
+ * the hierarchy defined in @path.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_widget_path_iter_remove_region (GtkWidgetPath *path,
+ gint pos,
+ const gchar *name)
+{
+ GtkPathElement *elem;
+ GQuark qname;
+
+ g_return_if_fail (path != NULL);
+ g_return_if_fail (path->elems->len != 0);
+ g_return_if_fail (name != NULL);
+
+ if (pos < 0 || pos > path->elems->len)
+ pos = path->elems->len - 1;
+
+ qname = g_quark_try_string (name);
+
+ if (qname == 0)
+ return;
+
+ elem = &g_array_index (path->elems, GtkPathElement, pos);
+
+ if (elem->regions)
+ g_hash_table_remove (elem->regions, GUINT_TO_POINTER (qname));
+}
+
+/**
+ * gtk_widget_path_iter_clear_regions:
+ * @path: a #GtkWidgetPath
+ * @pos: position to modify, -1 for the path head
+ *
+ * Removes all regions from the widget at position @pos in the
+ * hierarchy defined in @path.
+ *
+ * Since: 3.0
+ **/
+void
+gtk_widget_path_iter_clear_regions (GtkWidgetPath *path,
+ gint pos)
+{
+ GtkPathElement *elem;
+
+ g_return_if_fail (path != NULL);
+ g_return_if_fail (path->elems->len != 0);
+
+ if (pos < 0 || pos > path->elems->len)
+ pos = path->elems->len - 1;
+
+ elem = &g_array_index (path->elems, GtkPathElement, pos);
+
+ if (elem->regions)
+ g_hash_table_remove_all (elem->regions);
+}
+
+/**
+ * gtk_widget_path_iter_list_regions:
+ * @path: a #GtkWidgetPath
+ * @pos: position to query, -1 for the path head
+ *
+ * Returns a list with all the region names defined for the widget
+ * at position @pos in the hierarchy defined in @path.
+ *
+ * Returns: (transfer container) (type utf8): The list of regions,
+ * This is a list of strings, the #GSList contents are
+ * owned by GTK+, but you should use g_slist_free() to
+ * free the list itself.
+ *
+ * Since: 3.0
+ **/
+GSList *
+gtk_widget_path_iter_list_regions (const GtkWidgetPath *path,
+ gint pos)
+{
+ GtkPathElement *elem;
+ GHashTableIter iter;
+ GSList *list = NULL;
+ gpointer key;
+
+ g_return_val_if_fail (path != NULL, NULL);
+ g_return_val_if_fail (path->elems->len != 0, NULL);
+
+ if (pos < 0 || pos > path->elems->len)
+ pos = path->elems->len - 1;
+
+ elem = &g_array_index (path->elems, GtkPathElement, pos);
+
+ if (!elem->regions)
+ return NULL;
+
+ g_hash_table_iter_init (&iter, elem->regions);
+
+ while (g_hash_table_iter_next (&iter, &key, NULL))
+ {
+ GQuark qname;
+
+ qname = GPOINTER_TO_UINT (key);
+ list = g_slist_prepend (list, (gchar *) g_quark_to_string (qname));
+ }
+
+ return list;
+}
+
+/**
+ * gtk_widget_path_iter_has_qregion:
+ * @path: a #GtkWidgetPath
+ * @pos: position to query, -1 for the path head
+ * @qname: region name as a #GQuark
+ * @flags: (out): return location for the region flags
+ *
+ * See gtk_widget_path_iter_has_region(). This is a version that operates
+ * with GQuark<!-- -->s.
+ *
+ * Returns: %TRUE if the widget at @pos has the region defined.
+ *
+ * Since: 3.0
+ **/
+gboolean
+gtk_widget_path_iter_has_qregion (const GtkWidgetPath *path,
+ gint pos,
+ GQuark qname,
+ GtkRegionFlags *flags)
+{
+ GtkPathElement *elem;
+ gpointer value;
+
+ g_return_val_if_fail (path != NULL, FALSE);
+ g_return_val_if_fail (path->elems->len != 0, FALSE);
+ g_return_val_if_fail (qname != 0, FALSE);
+
+ if (pos < 0 || pos > path->elems->len)
+ pos = path->elems->len - 1;
+
+ elem = &g_array_index (path->elems, GtkPathElement, pos);
+
+ if (!elem->regions)
+ return FALSE;
+
+ if (!g_hash_table_lookup_extended (elem->regions,
+ GUINT_TO_POINTER (qname),
+ NULL, &value))
+ return FALSE;
+
+ if (flags)
+ *flags = GPOINTER_TO_UINT (value);
+
+ return TRUE;
+}
+
+/**
+ * gtk_widget_path_iter_has_region:
+ * @path: a #GtkWidgetPath
+ * @pos: position to query, -1 for the path head
+ * @name: region name
+ * @flags: (out): return location for the region flags
+ *
+ * Returns %TRUE if the widget at position @pos has the class @name
+ * defined, %FALSE otherwise.
+ *
+ * Returns: %TRUE if the class @name is defined for the widget at @pos
+ *
+ * Since: 3.0
+ **/
+gboolean
+gtk_widget_path_iter_has_region (const GtkWidgetPath *path,
+ gint pos,
+ const gchar *name,
+ GtkRegionFlags *flags)
+{
+ GQuark qname;
+
+ g_return_val_if_fail (path != NULL, FALSE);
+ g_return_val_if_fail (path->elems->len != 0, FALSE);
+ g_return_val_if_fail (name != NULL, FALSE);
+
+ if (pos < 0 || pos > path->elems->len)
+ pos = path->elems->len - 1;
+
+ qname = g_quark_try_string (name);
+
+ if (qname == 0)
+ return FALSE;
+
+ return gtk_widget_path_iter_has_qregion (path, pos, qname, flags);
+}
+
+/**
+ * gtk_widget_path_get_widget_type:
+ * @path: a #GtkWidget
+ *
+ * Returns the topmost widget type, that is, the widget type this path
+ * is representing.
+ *
+ * Returns: The widget type
+ *
+ * Since: 3.0
+ **/
+GType
+gtk_widget_path_get_widget_type (const GtkWidgetPath *path)
+{
+ GtkPathElement *elem;
+
+ g_return_val_if_fail (path != NULL, G_TYPE_INVALID);
+
+ elem = &g_array_index (path->elems, GtkPathElement,
+ path->elems->len - 1);
+ return elem->type;
+}
+
+/**
+ * gtk_widget_path_is_type:
+ * @path: a #GtkWidgetPath
+ * @type: widget type to match
+ *
+ * Returns %TRUE if the widget type represented by this path
+ * is @type, or a subtype of it.
+ *
+ * Returns: %TRUE if the widget represented by @path is of type @type
+ *
+ * Since: 3.0
+ **/
+gboolean
+gtk_widget_path_is_type (const GtkWidgetPath *path,
+ GType type)
+{
+ GtkPathElement *elem;
+
+ g_return_val_if_fail (path != NULL, FALSE);
+ g_return_val_if_fail (g_type_is_a (type, GTK_TYPE_WIDGET), FALSE);
+
+ elem = &g_array_index (path->elems, GtkPathElement,
+ path->elems->len - 1);
+
+ if (elem->type == type ||
+ g_type_is_a (elem->type, type))
+ return TRUE;
+
+ return FALSE;
+}
+
+/**
+ * gtk_widget_path_has_parent:
+ * @path: a #GtkWidgetPath
+ * @type: widget type to check in parents
+ *
+ * Returns %TRUE if any of the parents of the widget represented
+ * in @path is of type @type, or any subtype of it.
+ *
+ * Returns: %TRUE if any parent is of type @type
+ *
+ * Since: 3.0
+ **/
+gboolean
+gtk_widget_path_has_parent (const GtkWidgetPath *path,
+ GType type)
+{
+ guint i;
+
+ g_return_val_if_fail (path != NULL, FALSE);
+ g_return_val_if_fail (g_type_is_a (type, GTK_TYPE_WIDGET), FALSE);
+
+ for (i = 0; i < path->elems->len - 1; i++)
+ {
+ GtkPathElement *elem;
+
+ elem = &g_array_index (path->elems, GtkPathElement, i);
+
+ if (elem->type == type ||
+ g_type_is_a (elem->type, type))
+ return TRUE;
+ }
+
+ return FALSE;
+}
diff --git a/gtk/gtkwidgetpath.h b/gtk/gtkwidgetpath.h
new file mode 100644
index 0000000000..801906c68f
--- /dev/null
+++ b/gtk/gtkwidgetpath.h
@@ -0,0 +1,113 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
+#error "Only <gtk/gtk.h> can be included directly."
+#endif
+
+#ifndef __GTK_WIDGET_PATH_H__
+#define __GTK_WIDGET_PATH_H__
+
+#include <glib-object.h>
+#include "gtkenums.h"
+
+G_BEGIN_DECLS
+
+typedef struct _GtkWidgetPath GtkWidgetPath;
+
+
+GtkWidgetPath * gtk_widget_path_new (void);
+
+GtkWidgetPath * gtk_widget_path_copy (const GtkWidgetPath *path);
+void gtk_widget_path_free (GtkWidgetPath *path);
+
+gint gtk_widget_path_length (const GtkWidgetPath *path);
+
+gint gtk_widget_path_append_type (GtkWidgetPath *path,
+ GType type);
+void gtk_widget_path_prepend_type (GtkWidgetPath *path,
+ GType type);
+
+GType gtk_widget_path_iter_get_widget_type (const GtkWidgetPath *path,
+ gint pos);
+void gtk_widget_path_iter_set_widget_type (GtkWidgetPath *path,
+ gint pos,
+ GType type);
+
+G_CONST_RETURN gchar * gtk_widget_path_iter_get_name (const GtkWidgetPath *path,
+ gint pos);
+void gtk_widget_path_iter_set_name (GtkWidgetPath *path,
+ gint pos,
+ const gchar *name);
+gboolean gtk_widget_path_iter_has_name (const GtkWidgetPath *path,
+ gint pos,
+ const gchar *name);
+gboolean gtk_widget_path_iter_has_qname (const GtkWidgetPath *path,
+ gint pos,
+ GQuark qname);
+
+void gtk_widget_path_iter_add_class (GtkWidgetPath *path,
+ gint pos,
+ const gchar *name);
+void gtk_widget_path_iter_remove_class (GtkWidgetPath *path,
+ gint pos,
+ const gchar *name);
+void gtk_widget_path_iter_clear_classes (GtkWidgetPath *path,
+ gint pos);
+GSList * gtk_widget_path_iter_list_classes (const GtkWidgetPath *path,
+ gint pos);
+gboolean gtk_widget_path_iter_has_class (const GtkWidgetPath *path,
+ gint pos,
+ const gchar *name);
+gboolean gtk_widget_path_iter_has_qclass (const GtkWidgetPath *path,
+ gint pos,
+ GQuark qname);
+
+void gtk_widget_path_iter_add_region (GtkWidgetPath *path,
+ gint pos,
+ const gchar *name,
+ GtkRegionFlags flags);
+void gtk_widget_path_iter_remove_region (GtkWidgetPath *path,
+ gint pos,
+ const gchar *name);
+void gtk_widget_path_iter_clear_regions (GtkWidgetPath *path,
+ gint pos);
+
+GSList * gtk_widget_path_iter_list_regions (const GtkWidgetPath *path,
+ gint pos);
+
+gboolean gtk_widget_path_iter_has_region (const GtkWidgetPath *path,
+ gint pos,
+ const gchar *name,
+ GtkRegionFlags *flags);
+gboolean gtk_widget_path_iter_has_qregion (const GtkWidgetPath *path,
+ gint pos,
+ GQuark qname,
+ GtkRegionFlags *flags);
+
+GType gtk_widget_path_get_widget_type (const GtkWidgetPath *path);
+
+gboolean gtk_widget_path_is_type (const GtkWidgetPath *path,
+ GType type);
+gboolean gtk_widget_path_has_parent (const GtkWidgetPath *path,
+ GType type);
+
+G_END_DECLS
+
+#endif /* __GTK_WIDGET_PATH_H__ */
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 1f7134e646..31f46a56cd 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -345,8 +345,7 @@ static gint gtk_window_focus_in_event (GtkWidget *widget,
GdkEventFocus *event);
static gint gtk_window_focus_out_event (GtkWidget *widget,
GdkEventFocus *event);
-static void gtk_window_style_set (GtkWidget *widget,
- GtkStyle *style);
+static void gtk_window_style_updated (GtkWidget *widget);
static gint gtk_window_client_event (GtkWidget *widget,
GdkEventClient *event);
static gboolean gtk_window_state_event (GtkWidget *widget,
@@ -595,7 +594,7 @@ gtk_window_class_init (GtkWindowClass *klass)
widget_class->window_state_event = gtk_window_state_event;
widget_class->direction_changed = gtk_window_direction_changed;
widget_class->state_changed = gtk_window_state_changed;
- widget_class->style_set = gtk_window_style_set;
+ widget_class->style_updated = gtk_window_style_updated;
container_class->check_resize = gtk_window_check_resize;
@@ -4879,12 +4878,12 @@ gtk_window_realize (GtkWidget *widget)
{
GtkAllocation allocation;
GtkWindow *window;
- GtkStyle *style;
GdkWindow *parent_window;
GdkWindow *gdk_window;
GdkWindowAttr attributes;
gint attributes_mask;
GtkWindowPrivate *priv;
+ GtkStyleContext *context;
window = GTK_WINDOW (widget);
priv = window->priv;
@@ -5012,10 +5011,11 @@ gtk_window_realize (GtkWidget *widget)
gdk_window_set_user_data (gdk_window, window);
gtk_widget_style_attach (widget);
- style = gtk_widget_get_style (widget);
- gtk_style_set_background (style, gdk_window, GTK_STATE_NORMAL);
+ context = gtk_widget_get_style_context (widget);
+
+ gtk_style_context_set_background (context, gdk_window);
if (priv->frame)
- gtk_style_set_background (style, priv->frame, GTK_STATE_NORMAL);
+ gtk_style_context_set_background (context, priv->frame);
if (priv->transient_parent &&
gtk_widget_get_realized (GTK_WIDGET (priv->transient_parent)))
@@ -5113,12 +5113,13 @@ gtk_window_unrealize (GtkWidget *widget)
GTK_WIDGET_CLASS (gtk_window_parent_class)->unrealize (widget);
}
-static GdkWindowEdge
-get_grip_edge (GtkWidget *widget)
+static GtkJunctionSides
+get_grip_junction (GtkWidget *widget)
{
- return gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR
- ? GDK_WINDOW_EDGE_SOUTH_EAST
- : GDK_WINDOW_EDGE_SOUTH_WEST;
+ if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
+ return GTK_JUNCTION_CORNER_BOTTOMRIGHT;
+ else
+ return GTK_JUNCTION_CORNER_BOTTOMLEFT;
}
static gboolean
@@ -5231,7 +5232,7 @@ set_grip_shape (GtkWindow *window)
cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 0.0);
cairo_paint (cr);
cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 1.0);
- if (get_grip_edge (GTK_WIDGET (window)) == GDK_WINDOW_EDGE_SOUTH_EAST)
+ if (get_grip_junction (GTK_WIDGET (window)) & GTK_JUNCTION_CORNER_BOTTOMRIGHT)
{
cairo_move_to (cr, width, 0.0);
cairo_line_to (cr, width, height);
@@ -5461,8 +5462,7 @@ gtk_window_state_changed (GtkWidget *widget,
}
static void
-gtk_window_style_set (GtkWidget *widget,
- GtkStyle *style)
+gtk_window_style_updated (GtkWidget *widget)
{
GtkWindow *window = GTK_WINDOW (widget);
GtkWindowPrivate *priv = window->priv;
@@ -5681,7 +5681,6 @@ gtk_window_get_resize_grip_area (GtkWindow *window,
{
GtkWidget *widget = GTK_WIDGET (window);
GtkAllocation allocation;
- GtkStyle *style;
gint grip_width;
gint grip_height;
@@ -5691,7 +5690,6 @@ gtk_window_get_resize_grip_area (GtkWindow *window,
return FALSE;
gtk_widget_get_allocation (widget, &allocation);
- style = gtk_widget_get_style (widget);
gtk_widget_style_get (widget,
"resize-grip-width", &grip_width,
@@ -7432,16 +7430,30 @@ gtk_window_draw (GtkWidget *widget,
cairo_t *cr)
{
GtkWindowPrivate *priv = GTK_WINDOW (widget)->priv;
+ GtkStyleContext *context;
gboolean ret = FALSE;
+ context = gtk_widget_get_style_context (widget);
+
+ gtk_style_context_save (context);
+
if (!gtk_widget_get_app_paintable (widget))
- gtk_paint_flat_box (gtk_widget_get_style (widget),
- cr,
- GTK_STATE_NORMAL,
- GTK_SHADOW_NONE, widget, "base",
- 0, 0,
- gtk_widget_get_allocated_width (widget),
- gtk_widget_get_allocated_height (widget));
+ {
+ GtkStateFlags state;
+
+ state = gtk_widget_get_state_flags (widget);
+
+ if (gtk_window_has_toplevel_focus (GTK_WINDOW (widget)))
+ state |= GTK_STATE_FLAG_FOCUSED;
+
+ gtk_style_context_set_state (context, state);
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_BACKGROUND);
+ gtk_render_background (context, cr, 0, 0,
+ gtk_widget_get_allocated_width (widget),
+ gtk_widget_get_allocated_height (widget));
+ }
+
+ gtk_style_context_restore (context);
if (GTK_WIDGET_CLASS (gtk_window_parent_class)->draw)
ret = GTK_WIDGET_CLASS (gtk_window_parent_class)->draw (widget, cr);
@@ -7451,18 +7463,18 @@ gtk_window_draw (GtkWidget *widget,
{
GdkRectangle rect;
+ gtk_style_context_save (context);
cairo_save (cr);
+
gtk_cairo_transform_to_window (cr, widget, priv->grip_window);
gtk_window_get_resize_grip_area (GTK_WINDOW (widget), &rect);
- gtk_paint_resize_grip (gtk_widget_get_style (widget),
- cr,
- gtk_widget_get_state (widget),
- widget,
- "statusbar",
- get_grip_edge (widget),
- 0, 0,
- rect.width, rect.height);
+
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_GRIP);
+ gtk_style_context_set_junction_sides (context, get_grip_junction (widget));
+ gtk_render_handle (context, cr, 0, 0, rect.width, rect.height);
+
cairo_restore (cr);
+ gtk_style_context_restore (context);
}
return ret;
diff --git a/gtk/gtkxembed.c b/gtk/gtkxembed.c
index 7353e30cd3..5c900fc479 100644
--- a/gtk/gtkxembed.c
+++ b/gtk/gtkxembed.c
@@ -153,7 +153,7 @@ _gtk_xembed_send_message (GdkWindow *recipient,
g_message ("Sending %s", _gtk_xembed_message_name (message)));
memset (&xclient, 0, sizeof (xclient));
- xclient.window = GDK_WINDOW_XWINDOW (recipient);
+ xclient.window = GDK_WINDOW_XID (recipient);
xclient.type = ClientMessage;
xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_XEMBED");
xclient.format = 32;
@@ -165,7 +165,7 @@ _gtk_xembed_send_message (GdkWindow *recipient,
gdk_error_trap_push ();
XSendEvent (GDK_WINDOW_XDISPLAY(recipient),
- GDK_WINDOW_XWINDOW (recipient),
+ GDK_WINDOW_XID (recipient),
False, NoEventMask, (XEvent *)&xclient);
gdk_error_trap_pop_ignored ();
}
diff --git a/gtk/tests/Makefile.am b/gtk/tests/Makefile.am
index e97a30f9cb..dda9727d49 100644
--- a/gtk/tests/Makefile.am
+++ b/gtk/tests/Makefile.am
@@ -50,8 +50,8 @@ floating_SOURCES = floating.c
floating_LDADD = $(progs_ldadd)
#TEST_PROGS += object
-object_SOURCES = object.c pixbuf-init.c
-object_LDADD = $(progs_ldadd)
+#object_SOURCES = object.c pixbuf-init.c
+#object_LDADD = $(progs_ldadd)
# this doesn't work in make distcheck, since running
# on a naked X server creates slightly different event
@@ -100,6 +100,11 @@ SAMPLE_PROGS = gtk-example-application
gtk_example_application_SOURCES = gtk-example-application.c
gtk_example_application_LDADD = $(progs_ldadd)
+TEST_PROGS += stylecontext
+stylecontext_SOURCES = stylecontext.c
+stylecontext_LDADD = $(progs_ldadd)
+EXTRA_DIST += test.css test.png
+
EXTRA_DIST += \
file-chooser-test-dir/empty \
diff --git a/gtk/tests/stylecontext.c b/gtk/tests/stylecontext.c
new file mode 100644
index 0000000000..20b7dadfc9
--- /dev/null
+++ b/gtk/tests/stylecontext.c
@@ -0,0 +1,534 @@
+#include <gtk/gtk.h>
+
+static void
+test_parse_empty (void)
+{
+ GtkCssProvider *provider;
+ GError *error;
+ gboolean res;
+
+ provider = gtk_css_provider_new ();
+ error = NULL;
+ res = gtk_css_provider_load_from_data (provider, "", -1, &error);
+
+ g_assert (res);
+ g_assert_no_error (error);
+ g_clear_error (&error);
+
+ g_object_unref (provider);
+}
+
+static void
+test_parse_at (void)
+{
+ GtkCssProvider *provider;
+ GError *error;
+ gboolean res;
+ gint i;
+ const gchar *valid[] = {
+ "@import \"test.css\";",
+ "@import 'test.css';",
+ "@import url(\"test.css\");",
+ "@import url('test.css');",
+ "@import\nurl (\t\"test.css\" ) ;",
+ "@define-color bg_color #f9a039;",
+ "@define-color color @bg_color;",
+ "@define-color color rgb(100, 99, 88);",
+ "@define-color color rgba(50%, 50%, 50%, 0.5);",
+ "@define-color color lighter(#f9a039);",
+ "@define-color color darker ( @blue ) ;",
+ "@define-color color shade(@blue, 1.3);",
+ "@define-color color alpha(@blue, 1.3);",
+ "@define-color color mix(@blue, @red, 0.2);",
+ "@define-color color red;",
+ "@define-color color mix(shade (#121212, 0.5), mix (rgb(10%,20%,100%), @blue,0.5), 0.2);",
+ "@define-color blue @blue;",
+ "@define-color blue123_a-b #123;",
+ NULL
+ };
+
+ const gchar *invalid[] = {
+ "@import test.css ;",
+ "@import url ( \"test.css\" xyz );",
+ "@import url(\");",
+ "@import url(');",
+ "@import url(\"abc');",
+ "@ import ;",
+ "@define_color blue red;",
+ "@define-color blue #12234;",
+ "@define-color blue #12g234;",
+ "@define-color blue @@;",
+ "@define-color blue 5!#%4@DG$##x;",
+ "@define-color color mix(@red, @blue, @green);",
+ "@define-color color mix(@blue, 0.2, @red);",
+ "@define-color color mix(0.2, @blue, @red);",
+ "@define-color color mix(@blue, @red);",
+ "@define-color color mix(@blue);",
+ "@define-color color mix();",
+ "@define-color color rgba(50%, 50%, 50%);",
+ "@define-color color rgb(50%, a);",
+ "@define-color 1col rgb(50%, a);",
+ "@three-dee { some other crap };",
+ NULL
+ };
+
+ error = NULL;
+ for (i = 0; valid[i]; i++)
+ {
+ provider = gtk_css_provider_new ();
+ res = gtk_css_provider_load_from_data (provider, valid[i], -1, &error);
+ g_assert_no_error (error);
+ g_assert (res);
+
+ g_object_unref (provider);
+ }
+
+ for (i = 0; invalid[i]; i++)
+ {
+ provider = gtk_css_provider_new ();
+ res = gtk_css_provider_load_from_data (provider, invalid[i], -1, &error);
+ g_assert_error (error, GTK_CSS_PROVIDER_ERROR, GTK_CSS_PROVIDER_ERROR_FAILED);
+ g_assert (!res);
+ g_object_unref (provider);
+ g_clear_error (&error);
+ }
+}
+
+static void
+test_parse_selectors (void)
+{
+ GtkCssProvider *provider;
+ GError *error;
+ gboolean res;
+ gint i;
+ const gchar *valid[] = {
+ "* {}",
+ "E {}",
+ "E F {}",
+ "E > F {}",
+ "E#id {}",
+ "#id {}",
+ "tab:first-child {}",
+ "tab:last-child {}",
+ "tab:nth-child(first) {}",
+ "tab:nth-child(last) {}",
+ "tab:nth-child(even) {}",
+ "tab:nth-child(odd) {}",
+ "tab:sorted {}",
+ ".some-class {}",
+ ".some-class.another-class {}",
+ ".some-class .another-class {}",
+ "E * {}",
+ "E .class {}",
+ "E > .foo {}",
+ "E > #id {}",
+ "E:active {}",
+ "E:prelight {}",
+ "E:hover {}",
+ "E:selected {}",
+ "E:insensitive {}",
+ "E:inconsistent {}",
+ "E:focused {}",
+ "E:active:prelight {}",
+ "* > .notebook tab:first-child .label:focused {}",
+ "E, F {}",
+ "E, F /* comment here */ {}",
+ "E,/* comment here */ F {}",
+ "E1.e1_2 #T3_4 {}",
+ NULL
+ };
+
+ const gchar *invalid[] = {
+ /* nth-child and similar pseudo classes can only
+ * be used with regions, not with types
+ */
+ "E:first-child {}",
+ "E:last-child {}",
+ "E:nth-child(first) {}",
+ "E:nth-child(last) {}",
+ "E:nth-child(even) {}",
+ "E:nth-child(odd) {}",
+ "E:sorted {}",
+ /* widget state pseudo-classes can only be used for
+ * the last element
+ */
+ "E:focused tab {}",
+ NULL
+ };
+
+ error = NULL;
+ for (i = 0; valid[i]; i++)
+ {
+ provider = gtk_css_provider_new ();
+ res = gtk_css_provider_load_from_data (provider, valid[i], -1, &error);
+ g_assert_no_error (error);
+ g_assert (res);
+
+ g_object_unref (provider);
+ }
+
+ for (i = 0; invalid[i]; i++)
+ {
+ provider = gtk_css_provider_new ();
+ res = gtk_css_provider_load_from_data (provider, invalid[i], -1, &error);
+ g_assert_error (error, GTK_CSS_PROVIDER_ERROR, GTK_CSS_PROVIDER_ERROR_FAILED);
+ g_assert (!res);
+ g_object_unref (provider);
+ g_clear_error (&error);
+ }
+}
+
+static void
+test_parse_declarations (void)
+{
+ GtkCssProvider *provider;
+ GError *error;
+ gboolean res;
+ gint i;
+ const gchar *valid[] = {
+ "* {}",
+ "* { font: Sans 15 }",
+ "* { font: Sans 15; }",
+ "* { font: bold }",
+ "* { color: red }",
+ "* { /* just a comment */ }",
+ "* { /* multi\nline\ncomment */ }",
+ "* { font: /* comment here */ Sans 15 }",
+ "* { color: red; background-color: shade (@bg_color, 0.5) }",
+ "* { margin: 5 }",
+ "* { margin: 5 10 }",
+ "* { margin: 5 10 3 }",
+ "* { margin: 5 10 3 5 }",
+ "* { padding: 5 }",
+ "* { padding: 5 10 }",
+ "* { border-width: 5; border-radius: 10 }",
+ "* { border-color: #ff00ff }",
+ "* { engine: clearlooks }",
+ "* { background-image: -gtk-gradient (linear, \n"
+ " left top, right top, \n"
+ " from (#fff), to (#000)) }",
+ "* { background-image: -gtk-gradient (linear, \n"
+ " 0.0 0.5, 0.5 1.0, \n"
+ " from (#fff), \n"
+ " color-stop (0.5, #f00),\n"
+ " to (#000)) }",
+ "* { background-image: -gtk-gradient (radial, \n"
+ " center center, 0.2, \n"
+ " center center, 0.8, \n"
+ " color-stop (0.0,#fff),\n"
+ " color-stop (1.0,#000))}\n",
+ "* { border-image: url (\"test.png\") 3 4 3 4 stretch }",
+ "* { border-image: url (\"test.png\") 3 4 3 4 repeat stretch}",
+ "* { transition: 150ms ease-in-out }",
+ "* { transition: 1s linear loop }",
+ NULL
+ };
+
+ const gchar *invalid[] = {
+ "* { color }",
+ "* { color:green; color }",
+ "* { color:red; color; color:green }",
+ "* { color:green; color: }",
+ "* { color:red; color:; color:green }",
+ "* { color:green; color{;color:maroon} }",
+ "* { color:red; color{;color:maroon}; color:green }",
+ "* { content: 'Hello",
+ NULL
+ };
+
+ error = NULL;
+ for (i = 0; valid[i]; i++)
+ {
+ provider = gtk_css_provider_new ();
+ res = gtk_css_provider_load_from_data (provider, valid[i], -1, &error);
+ g_assert_no_error (error);
+ g_assert (res);
+
+ g_object_unref (provider);
+ }
+
+ for (i = 0; invalid[i]; i++)
+ {
+ provider = gtk_css_provider_new ();
+ res = gtk_css_provider_load_from_data (provider, invalid[i], -1, &error);
+ g_assert_error (error, GTK_CSS_PROVIDER_ERROR, GTK_CSS_PROVIDER_ERROR_FAILED);
+ g_assert (!res);
+ g_object_unref (provider);
+ g_clear_error (&error);
+ }
+}
+
+static void
+test_path (void)
+{
+ GtkWidgetPath *path;
+ GtkWidgetPath *path2;
+ gint pos;
+ GtkRegionFlags flags;
+
+ path = gtk_widget_path_new ();
+ g_assert_cmpint (gtk_widget_path_length (path), ==, 0);
+
+ pos = gtk_widget_path_append_type (path, GTK_TYPE_WINDOW);
+ g_assert_cmpint (pos, ==, 0);
+ g_assert_cmpint (gtk_widget_path_length (path), ==, 1);
+ g_assert (gtk_widget_path_iter_get_widget_type (path, 0) == GTK_TYPE_WINDOW);
+ g_assert (gtk_widget_path_is_type (path, GTK_TYPE_WIDGET));
+ g_assert (gtk_widget_path_iter_get_name (path, 0) == NULL);
+
+ pos = gtk_widget_path_append_type (path, GTK_TYPE_WIDGET);
+ g_assert_cmpint (pos, ==, 1);
+ g_assert_cmpint (gtk_widget_path_length (path), ==, 2);
+ gtk_widget_path_iter_set_widget_type (path, pos, GTK_TYPE_BUTTON);
+ g_assert (gtk_widget_path_is_type (path, GTK_TYPE_BUTTON));
+ g_assert (gtk_widget_path_has_parent (path, GTK_TYPE_WIDGET));
+ g_assert (gtk_widget_path_has_parent (path, GTK_TYPE_WINDOW));
+ g_assert (!gtk_widget_path_has_parent (path, GTK_TYPE_DIALOG));
+ g_assert (gtk_widget_path_iter_get_name (path, 1) == NULL);
+
+ gtk_widget_path_iter_set_name (path, 1, "name");
+ g_assert (gtk_widget_path_iter_has_name (path, 1, "name"));
+
+ gtk_widget_path_iter_add_class (path, 1, "class1");
+ gtk_widget_path_iter_add_class (path, 1, "class2");
+ g_assert (gtk_widget_path_iter_has_class (path, 1, "class1"));
+ g_assert (gtk_widget_path_iter_has_class (path, 1, "class2"));
+ g_assert (!gtk_widget_path_iter_has_class (path, 1, "class3"));
+
+ path2 = gtk_widget_path_copy (path);
+ g_assert (gtk_widget_path_iter_has_class (path2, 1, "class1"));
+ g_assert (gtk_widget_path_iter_has_class (path2, 1, "class2"));
+ g_assert (!gtk_widget_path_iter_has_class (path2, 1, "class3"));
+ gtk_widget_path_free (path2);
+
+ gtk_widget_path_iter_remove_class (path, 1, "class2");
+ g_assert (gtk_widget_path_iter_has_class (path, 1, "class1"));
+ g_assert (!gtk_widget_path_iter_has_class (path, 1, "class2"));
+ gtk_widget_path_iter_clear_classes (path, 1);
+ g_assert (!gtk_widget_path_iter_has_class (path, 1, "class1"));
+
+ gtk_widget_path_iter_add_region (path, 1, "tab", 0);
+ gtk_widget_path_iter_add_region (path, 1, "title", GTK_REGION_EVEN | GTK_REGION_FIRST);
+
+ g_assert (gtk_widget_path_iter_has_region (path, 1, "tab", &flags) &&
+ flags == 0);
+ g_assert (gtk_widget_path_iter_has_region (path, 1, "title", &flags) &&
+ flags == (GTK_REGION_EVEN | GTK_REGION_FIRST));
+ g_assert (!gtk_widget_path_iter_has_region (path, 1, "extension", NULL));
+
+ path2 = gtk_widget_path_copy (path);
+ g_assert (gtk_widget_path_iter_has_region (path2, 1, "tab", &flags) &&
+ flags == 0);
+ g_assert (gtk_widget_path_iter_has_region (path2, 1, "title", &flags) &&
+ flags == (GTK_REGION_EVEN | GTK_REGION_FIRST));
+ g_assert (!gtk_widget_path_iter_has_region (path2, 1, "extension", NULL));
+ gtk_widget_path_free (path2);
+
+ gtk_widget_path_free (path);
+}
+
+static void
+test_match (void)
+{
+ GtkStyleContext *context;
+ GtkWidgetPath *path;
+ GtkCssProvider *provider;
+ GError *error;
+ const gchar *data;
+ GdkRGBA *color;
+ GdkRGBA expected;
+
+ error = NULL;
+ provider = gtk_css_provider_new ();
+
+ gdk_rgba_parse (&expected, "#fff");
+
+ context = gtk_style_context_new ();
+
+ path = gtk_widget_path_new ();
+ gtk_widget_path_append_type (path, GTK_TYPE_WINDOW);
+ gtk_widget_path_append_type (path, GTK_TYPE_BOX);
+ gtk_widget_path_append_type (path, GTK_TYPE_BUTTON);
+ gtk_widget_path_iter_set_name (path, 0, "mywindow");
+ gtk_widget_path_iter_add_class (path, 2, "button");
+ gtk_style_context_set_path (context, path);
+ gtk_widget_path_free (path);
+
+ gtk_style_context_add_provider (context,
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_USER);
+
+ data = "* { color: #fff }";
+ gtk_css_provider_load_from_data (provider, data, -1, &error);
+ g_assert_no_error (error);
+ gtk_style_context_invalidate (context);
+ gtk_style_context_get (context, 0, "color", &color, NULL);
+ g_assert (gdk_rgba_equal (color, &expected));
+ gdk_rgba_free (color);
+
+ data = "* { color: #f00 }\n"
+ "GtkButton { color: #fff }";
+ gtk_css_provider_load_from_data (provider, data, -1, &error);
+ g_assert_no_error (error);
+ gtk_style_context_invalidate (context);
+ gtk_style_context_get (context, 0, "color", &color, NULL);
+ g_assert (gdk_rgba_equal (color, &expected));
+ gdk_rgba_free (color);
+
+ data = "* { color: #f00 }\n"
+ "GtkButton { color: #fff }\n"
+ "GtkWindow > GtkButton { color: #000 }";
+ gtk_css_provider_load_from_data (provider, data, -1, &error);
+ g_assert_no_error (error);
+ gtk_style_context_invalidate (context);
+ gtk_style_context_get (context, 0, "color", &color, NULL);
+ g_assert (gdk_rgba_equal (color, &expected));
+ gdk_rgba_free (color);
+
+ data = "* { color: #f00 }\n"
+ ".button { color: #fff }";
+ gtk_css_provider_load_from_data (provider, data, -1, &error);
+ g_assert_no_error (error);
+ gtk_style_context_invalidate (context);
+ gtk_style_context_get (context, 0, "color", &color, NULL);
+ g_assert (gdk_rgba_equal (color, &expected));
+ gdk_rgba_free (color);
+
+ data = "* { color: #f00 }\n"
+ "GtkButton { color: #000 }\n"
+ ".button { color: #fff }";
+ gtk_css_provider_load_from_data (provider, data, -1, &error);
+ g_assert_no_error (error);
+ gtk_style_context_invalidate (context);
+ gtk_style_context_get (context, 0, "color", &color, NULL);
+ g_assert (gdk_rgba_equal (color, &expected));
+ gdk_rgba_free (color);
+
+ data = "* { color: #f00 }\n"
+ "GtkButton { color: #000 }\n"
+ "GtkWindow GtkButton { color: #fff }";
+ gtk_css_provider_load_from_data (provider, data, -1, &error);
+ g_assert_no_error (error);
+ gtk_style_context_invalidate (context);
+ gtk_style_context_get (context, 0, "color", &color, NULL);
+ g_assert (gdk_rgba_equal (color, &expected));
+ gdk_rgba_free (color);
+
+ data = "* { color: #f00 }\n"
+ ".button { color: #000 }\n"
+ "GtkWindow .button { color: #fff }";
+ gtk_css_provider_load_from_data (provider, data, -1, &error);
+ g_assert_no_error (error);
+ gtk_style_context_invalidate (context);
+ gtk_style_context_get (context, 0, "color", &color, NULL);
+ g_assert (gdk_rgba_equal (color, &expected));
+ gdk_rgba_free (color);
+
+ data = "* { color: #f00 }\n"
+ "* .button { color: #000 }\n"
+ "#mywindow .button { color: #fff }";
+ gtk_css_provider_load_from_data (provider, data, -1, &error);
+ g_assert_no_error (error);
+ gtk_style_context_invalidate (context);
+ gtk_style_context_get (context, 0, "color", &color, NULL);
+ g_assert (gdk_rgba_equal (color, &expected));
+ gdk_rgba_free (color);
+
+ data = "* { color: #f00 }\n"
+ "GtkWindow .button { color: #000 }\n"
+ "GtkWindow#mywindow .button { color: #fff }";
+ gtk_css_provider_load_from_data (provider, data, -1, &error);
+ g_assert_no_error (error);
+ gtk_style_context_invalidate (context);
+ gtk_style_context_get (context, 0, "color", &color, NULL);
+ g_assert (gdk_rgba_equal (color, &expected));
+ gdk_rgba_free (color);
+
+ data = "* { color: #f00 }\n"
+ "GtkWindow .button { color: #fff }\n"
+ "GObject .button { color: #000 }";
+ gtk_css_provider_load_from_data (provider, data, -1, &error);
+ g_assert_no_error (error);
+ gtk_style_context_invalidate (context);
+ gtk_style_context_get (context, 0, "color", &color, NULL);
+ g_assert (gdk_rgba_equal (color, &expected));
+ gdk_rgba_free (color);
+
+ g_object_unref (provider);
+ g_object_unref (context);
+}
+
+static void
+test_style_property (void)
+{
+ GtkStyleContext *context;
+ GtkWidgetPath *path;
+ GtkCssProvider *provider;
+ GError *error;
+ const gchar *data;
+ gint x;
+ GdkRGBA *color;
+ GdkRGBA expected;
+
+ error = NULL;
+ provider = gtk_css_provider_new ();
+
+ context = gtk_style_context_new ();
+
+ path = gtk_widget_path_new ();
+ gtk_widget_path_append_type (path, GTK_TYPE_WINDOW);
+ gtk_widget_path_append_type (path, GTK_TYPE_BOX);
+ gtk_widget_path_append_type (path, GTK_TYPE_BUTTON);
+ gtk_style_context_set_path (context, path);
+ gtk_widget_path_free (path);
+ gtk_style_context_set_state (context, GTK_STATE_FLAG_PRELIGHT);
+
+ /* Since we set the prelight state on the context, we expect
+ * only the third selector to match, even though the second one
+ * has higher specificity, and the fourth one comes later.
+ *
+ * In particular, we want to verify that widget style properties and
+ * CSS properties follow the same matching rules, ie we expect
+ * color to be #003 and child-displacement-x to be 3.
+ */
+ data = "GtkButton:insensitive { color: #001; -GtkButton-child-displacement-x: 1 }\n"
+ "GtkBox GtkButton:selected { color: #002; -GtkButton-child-displacement-x: 2 }\n"
+ "GtkButton:prelight { color: #003; -GtkButton-child-displacement-x: 3 }\n"
+ "GtkButton:focused { color: #004; -GtkButton-child-displacement-x: 4 }\n";
+ gtk_css_provider_load_from_data (provider, data, -1, &error);
+ g_assert_no_error (error);
+ gtk_style_context_add_provider (context,
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_USER);
+
+ gtk_style_context_invalidate (context);
+
+ gtk_style_context_get (context, GTK_STATE_FLAG_PRELIGHT, "color", &color, NULL);
+ gdk_rgba_parse (&expected, "#003");
+ g_assert (gdk_rgba_equal (color, &expected));
+ gdk_rgba_free (color);
+
+ gtk_style_context_get_style (context, "child-displacement-x", &x, NULL);
+
+ g_assert_cmpint (x, ==, 3);
+
+ g_object_unref (provider);
+ g_object_unref (context);
+}
+
+int
+main (int argc, char *argv[])
+{
+ gtk_init (NULL, NULL);
+ g_test_init (&argc, &argv, NULL);
+
+ g_test_add_func ("/style/parse/empty", test_parse_empty);
+ g_test_add_func ("/style/parse/at", test_parse_at);
+ g_test_add_func ("/style/parse/selectors", test_parse_selectors);
+ g_test_add_func ("/style/parse/declarations", test_parse_declarations);
+ g_test_add_func ("/style/path", test_path);
+ g_test_add_func ("/style/match", test_match);
+ g_test_add_func ("/style/style-property", test_style_property);
+
+ return g_test_run ();
+}
diff --git a/gtk/tests/test.css b/gtk/tests/test.css
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/gtk/tests/test.css
diff --git a/gtk/tests/test.png b/gtk/tests/test.png
new file mode 100644
index 0000000000..8d0f458491
--- /dev/null
+++ b/gtk/tests/test.png
Binary files differ
diff --git a/modules/input/gtkimcontextxim.c b/modules/input/gtkimcontextxim.c
index c9de4207c6..035edc3a00 100644
--- a/modules/input/gtkimcontextxim.c
+++ b/modules/input/gtkimcontextxim.c
@@ -707,9 +707,9 @@ gtk_im_context_xim_filter_keypress (GtkIMContext *context,
xevent.type = (event->type == GDK_KEY_PRESS) ? KeyPress : KeyRelease;
xevent.serial = 0; /* hope it doesn't matter */
xevent.send_event = event->send_event;
- xevent.display = GDK_DRAWABLE_XDISPLAY (event->window);
- xevent.window = GDK_DRAWABLE_XID (event->window);
- xevent.root = GDK_DRAWABLE_XID (root_window);
+ xevent.display = GDK_WINDOW_XDISPLAY (event->window);
+ xevent.window = GDK_WINDOW_XID (event->window);
+ xevent.root = GDK_WINDOW_XID (root_window);
xevent.subwindow = xevent.window;
xevent.time = event->time;
xevent.x = xevent.x_root = 0;
@@ -718,7 +718,7 @@ gtk_im_context_xim_filter_keypress (GtkIMContext *context,
xevent.keycode = event->hardware_keycode;
xevent.same_screen = True;
- if (XFilterEvent ((XEvent *)&xevent, GDK_DRAWABLE_XID (context_xim->client_window)))
+ if (XFilterEvent ((XEvent *)&xevent, GDK_WINDOW_XID (context_xim->client_window)))
return TRUE;
if (event->state &
@@ -1434,7 +1434,7 @@ gtk_im_context_xim_get_ic (GtkIMContextXIM *context_xim)
xic = XCreateIC (context_xim->im_info->im,
XNInputStyle, im_style,
- XNClientWindow, GDK_DRAWABLE_XID (context_xim->client_window),
+ XNClientWindow, GDK_WINDOW_XID (context_xim->client_window),
name1, list1,
name2, list2,
NULL);
diff --git a/modules/other/gail/gailwindow.c b/modules/other/gail/gailwindow.c
index a99e43036d..73b1993783 100644
--- a/modules/other/gail/gailwindow.c
+++ b/modules/other/gail/gailwindow.c
@@ -723,7 +723,7 @@ get_stacked_windows (GailScreenInfo *info)
gdk_error_trap_push ();
ret_type = None;
result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
- GDK_WINDOW_XWINDOW (info->root_window),
+ GDK_WINDOW_XID (info->root_window),
_net_client_list_stacking,
0, G_MAXLONG,
False, XA_WINDOW, &ret_type, &format, &nitems,
@@ -827,8 +827,7 @@ filter_func (GdkXEvent *gdkxevent,
if (window)
{
- screen_n = gdk_screen_get_number (
- gdk_window_get_screen (GDK_DRAWABLE (window)));
+ screen_n = gdk_screen_get_number (gdk_window_get_screen (window));
gail_screens [screen_n].update_stacked_windows = TRUE;
if (!gail_screens [screen_n].update_handler)
@@ -920,11 +919,11 @@ init_gail_screen (GdkScreen *screen,
get_stacked_windows (&gail_screens [screen_n]);
XGetWindowAttributes (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
- GDK_WINDOW_XWINDOW (gail_screens [screen_n].root_window),
+ GDK_WINDOW_XID (gail_screens [screen_n].root_window),
&attrs);
XSelectInput (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
- GDK_WINDOW_XWINDOW (gail_screens [screen_n].root_window),
+ GDK_WINDOW_XID (gail_screens [screen_n].root_window),
attrs.your_event_mask | PropertyChangeMask);
gail_screens [screen_n].screen_initialized = TRUE;
@@ -965,8 +964,7 @@ get_window_zorder (GdkWindow *window)
gail_return_val_if_fail (GDK_IS_WINDOW (window), -1);
- info = get_screen_info (
- gdk_window_get_screen (GDK_DRAWABLE (window)));
+ info = get_screen_info (gdk_window_get_screen (window));
gail_return_val_if_fail (info->stacked_windows != NULL, -1);
diff --git a/po-properties/es.po b/po-properties/es.po
index 70db01e403..be287b4698 100644
--- a/po-properties/es.po
+++ b/po-properties/es.po
@@ -17,8 +17,8 @@ msgstr ""
"Project-Id-Version: gtk+-properties.master\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gtk"
"%2b&component=general\n"
-"POT-Creation-Date: 2010-10-25 09:20+0000\n"
-"PO-Revision-Date: 2010-10-25 16:25+0200\n"
+"POT-Creation-Date: 2010-11-30 05:33+0000\n"
+"PO-Revision-Date: 2010-12-02 19:09+0100\n"
"Last-Translator: Jorge González <jorgegonz@svn.gnome.org>\n"
"Language-Team: Español <gnome-es-list@gnome.org>\n"
"MIME-Version: 1.0\n"
@@ -28,64 +28,64 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: KBabel 1.11.4\n"
-#: ../gdk/gdkdevice.c:99
+#: ../gdk/gdkdevice.c:113
msgid "Device Display"
msgstr "Pantalla del dispositivo"
-#: ../gdk/gdkdevice.c:100
+#: ../gdk/gdkdevice.c:114
msgid "Display which the device belongs to"
msgstr "Pantalla a la que pertenece el dispositivo"
-#: ../gdk/gdkdevice.c:114
+#: ../gdk/gdkdevice.c:128
msgid "Device manager"
msgstr "Gestor de dispositivos"
-#: ../gdk/gdkdevice.c:115
+#: ../gdk/gdkdevice.c:129
msgid "Device manager which the device belongs to"
msgstr "Gestor de dispositivos al que pertenece el dispositivo"
-#: ../gdk/gdkdevice.c:129 ../gdk/gdkdevice.c:130
+#: ../gdk/gdkdevice.c:143 ../gdk/gdkdevice.c:144
msgid "Device name"
msgstr "Nombre del dispositivo"
-#: ../gdk/gdkdevice.c:144
+#: ../gdk/gdkdevice.c:158
msgid "Device type"
msgstr "Tipo de dispositivo"
-#: ../gdk/gdkdevice.c:145
+#: ../gdk/gdkdevice.c:159
msgid "Device role in the device manager"
msgstr "Rol del dispositivo en el gestor de dispositivos"
-#: ../gdk/gdkdevice.c:161
+#: ../gdk/gdkdevice.c:175
msgid "Associated device"
msgstr "Dispositivo asociado"
-#: ../gdk/gdkdevice.c:162
+#: ../gdk/gdkdevice.c:176
msgid "Associated pointer or keyboard with this device"
msgstr "Dispositivo apuntador o teclado asociado con este dispositivo"
-#: ../gdk/gdkdevice.c:175
+#: ../gdk/gdkdevice.c:189
msgid "Input source"
msgstr "Fuente de entrada"
-#: ../gdk/gdkdevice.c:176
+#: ../gdk/gdkdevice.c:190
msgid "Source type for the device"
msgstr "Tipo de la fuente de entrada para el dispositivo"
-#: ../gdk/gdkdevice.c:191 ../gdk/gdkdevice.c:192
+#: ../gdk/gdkdevice.c:205 ../gdk/gdkdevice.c:206
msgid "Input mode for the device"
msgstr "Modo de entrada para el dispositivo"
-#: ../gdk/gdkdevice.c:207
+#: ../gdk/gdkdevice.c:221
msgid "Whether the device has a cursor"
msgstr "Indica si el dispositivo tiene un cursor"
-#: ../gdk/gdkdevice.c:208
+#: ../gdk/gdkdevice.c:222
msgid "Whether there is a visible cursor following device motion"
msgstr ""
"Indica si existe un cursor disponible siguiendo el movimiento del dispositivo"
-#: ../gdk/gdkdevice.c:222 ../gdk/gdkdevice.c:223
+#: ../gdk/gdkdevice.c:236 ../gdk/gdkdevice.c:237
msgid "Number of axes in the device"
msgstr "Número de ejes en el dispositivo"
@@ -97,27 +97,27 @@ msgstr "Pantalla"
msgid "Display for the device manager"
msgstr "Pantalla para el gestor de dispositivos"
-#: ../gdk/gdkdisplaymanager.c:101
+#: ../gdk/gdkdisplaymanager.c:106
msgid "Default Display"
msgstr "Visor predeterminado"
-#: ../gdk/gdkdisplaymanager.c:102
+#: ../gdk/gdkdisplaymanager.c:107
msgid "The default display for GDK"
msgstr "El visor predeterminado para GDK"
-#: ../gdk/gdkscreen.c:74
+#: ../gdk/gdkscreen.c:90
msgid "Font options"
msgstr "Opciones de la tipografía"
-#: ../gdk/gdkscreen.c:75
+#: ../gdk/gdkscreen.c:91
msgid "The default font options for the screen"
msgstr "Las opciones predeterminadas de la tipografía para la pantalla"
-#: ../gdk/gdkscreen.c:82
+#: ../gdk/gdkscreen.c:98
msgid "Font resolution"
msgstr "Resolución de la tipografía"
-#: ../gdk/gdkscreen.c:83
+#: ../gdk/gdkscreen.c:99
msgid "The resolution for fonts on the screen"
msgstr "La resolución para las tipografías en la pantalla"
@@ -294,9 +294,9 @@ msgstr "Nombre"
msgid "A unique name for the action."
msgstr "Un nombre único para la acción."
-#: ../gtk/gtkaction.c:241 ../gtk/gtkbutton.c:238 ../gtk/gtkexpander.c:209
-#: ../gtk/gtkframe.c:130 ../gtk/gtklabel.c:549 ../gtk/gtkmenuitem.c:331
-#: ../gtk/gtktoolbutton.c:202 ../gtk/gtktoolitemgroup.c:1571
+#: ../gtk/gtkaction.c:241 ../gtk/gtkbutton.c:226 ../gtk/gtkexpander.c:209
+#: ../gtk/gtkframe.c:130 ../gtk/gtklabel.c:567 ../gtk/gtkmenuitem.c:331
+#: ../gtk/gtktoolbutton.c:202 ../gtk/gtktoolitemgroup.c:1588
msgid "Label"
msgstr "Etiqueta"
@@ -338,26 +338,26 @@ msgid "GIcon"
msgstr "GIcon"
#: ../gtk/gtkaction.c:305 ../gtk/gtkcellrendererpixbuf.c:215
-#: ../gtk/gtkimage.c:320 ../gtk/gtkstatusicon.c:253
+#: ../gtk/gtkimage.c:326 ../gtk/gtkstatusicon.c:253
msgid "The GIcon being displayed"
msgstr "El icono mostrado"
#: ../gtk/gtkaction.c:325 ../gtk/gtkcellrendererpixbuf.c:180
-#: ../gtk/gtkimage.c:302 ../gtk/gtkprinter.c:174 ../gtk/gtkstatusicon.c:236
-#: ../gtk/gtkwindow.c:732
+#: ../gtk/gtkimage.c:308 ../gtk/gtkprinter.c:174 ../gtk/gtkstatusicon.c:236
+#: ../gtk/gtkwindow.c:733
msgid "Icon Name"
msgstr "Nombre del icono"
#: ../gtk/gtkaction.c:326 ../gtk/gtkcellrendererpixbuf.c:181
-#: ../gtk/gtkimage.c:303 ../gtk/gtkstatusicon.c:237
+#: ../gtk/gtkimage.c:309 ../gtk/gtkstatusicon.c:237
msgid "The name of the icon from the icon theme"
msgstr "El nombre del icono del tema de iconos"
-#: ../gtk/gtkaction.c:333 ../gtk/gtktoolitem.c:186
+#: ../gtk/gtkaction.c:333 ../gtk/gtktoolitem.c:195
msgid "Visible when horizontal"
msgstr "Visible si es horizontal"
-#: ../gtk/gtkaction.c:334 ../gtk/gtktoolitem.c:187
+#: ../gtk/gtkaction.c:334 ../gtk/gtktoolitem.c:196
msgid ""
"Whether the toolbar item is visible when the toolbar is in a horizontal "
"orientation."
@@ -377,11 +377,11 @@ msgstr ""
"Cuando sea TRUE, se representan elementos de proximidad para esta acción en "
"el menú de rebosamiento de la barra de herramientas."
-#: ../gtk/gtkaction.c:357 ../gtk/gtktoolitem.c:193
+#: ../gtk/gtkaction.c:357 ../gtk/gtktoolitem.c:202
msgid "Visible when vertical"
msgstr "Visible si es vertical"
-#: ../gtk/gtkaction.c:358 ../gtk/gtktoolitem.c:194
+#: ../gtk/gtkaction.c:358 ../gtk/gtktoolitem.c:203
msgid ""
"Whether the toolbar item is visible when the toolbar is in a vertical "
"orientation."
@@ -389,7 +389,7 @@ msgstr ""
"Indica si el elemento de la barra de herramientas es visible cuando la barra "
"esté en orientación vertical."
-#: ../gtk/gtkaction.c:365 ../gtk/gtktoolitem.c:200
+#: ../gtk/gtkaction.c:365 ../gtk/gtktoolitem.c:209
msgid "Is important"
msgstr "Es importante"
@@ -413,7 +413,7 @@ msgstr ""
"acción se ocultan."
#: ../gtk/gtkaction.c:381 ../gtk/gtkactiongroup.c:235
-#: ../gtk/gtkcellrenderer.c:243 ../gtk/gtkwidget.c:975
+#: ../gtk/gtkcellrenderer.c:282 ../gtk/gtkwidget.c:916
msgid "Sensitive"
msgstr "Sensible"
@@ -423,7 +423,7 @@ msgstr "Indica si la acción está activada."
#: ../gtk/gtkaction.c:388 ../gtk/gtkactiongroup.c:242
#: ../gtk/gtkstatusicon.c:287 ../gtk/gtktreeviewcolumn.c:213
-#: ../gtk/gtkwidget.c:968
+#: ../gtk/gtkwidget.c:909
msgid "Visible"
msgstr "Visible"
@@ -443,11 +443,11 @@ msgstr ""
"El GtkActionGroup con el que esta GtkAction está asociada, o NULL (para uso "
"interno)."
-#: ../gtk/gtkaction.c:414 ../gtk/gtkimagemenuitem.c:172
+#: ../gtk/gtkaction.c:414 ../gtk/gtkimagemenuitem.c:182
msgid "Always show image"
msgstr "Siempre mostrar la imagen"
-#: ../gtk/gtkaction.c:415 ../gtk/gtkimagemenuitem.c:173
+#: ../gtk/gtkaction.c:415 ../gtk/gtkimagemenuitem.c:183
msgid "Whether the image will always be shown"
msgstr "Indica si la imagen se mostrará siempre"
@@ -483,7 +483,7 @@ msgstr ""
"relacionadas"
#: ../gtk/gtkadjustment.c:114 ../gtk/gtkcellrendererprogress.c:126
-#: ../gtk/gtkscalebutton.c:220 ../gtk/gtkspinbutton.c:289
+#: ../gtk/gtkscalebutton.c:220 ../gtk/gtkspinbutton.c:291
msgid "Value"
msgstr "Valor"
@@ -535,7 +535,7 @@ msgstr "El tamaño de página del ajuste"
msgid "Horizontal alignment"
msgstr "Alineación horizontal"
-#: ../gtk/gtkalignment.c:128 ../gtk/gtkbutton.c:289
+#: ../gtk/gtkalignment.c:128 ../gtk/gtkbutton.c:277
msgid ""
"Horizontal position of child in available space. 0.0 is left aligned, 1.0 is "
"right aligned"
@@ -547,7 +547,7 @@ msgstr ""
msgid "Vertical alignment"
msgstr "Alineación vertical"
-#: ../gtk/gtkalignment.c:138 ../gtk/gtkbutton.c:308
+#: ../gtk/gtkalignment.c:138 ../gtk/gtkbutton.c:296
msgid ""
"Vertical position of child in available space. 0.0 is top aligned, 1.0 is "
"bottom aligned"
@@ -627,7 +627,7 @@ msgstr "Sombra de la flecha"
msgid "Appearance of the shadow surrounding the arrow"
msgstr "Apariencia de la sombra que rodea la flecha"
-#: ../gtk/gtkarrow.c:127 ../gtk/gtkmenu.c:730 ../gtk/gtkmenuitem.c:394
+#: ../gtk/gtkarrow.c:127 ../gtk/gtkmenu.c:731 ../gtk/gtkmenuitem.c:394
msgid "Arrow Scaling"
msgstr "Escalado de flechas"
@@ -635,7 +635,7 @@ msgstr "Escalado de flechas"
msgid "Amount of space used up by arrow"
msgstr "Cantidad de espacio ocupado por flecha"
-#: ../gtk/gtkaspectframe.c:109 ../gtk/gtkwidget.c:1171
+#: ../gtk/gtkaspectframe.c:109 ../gtk/gtkwidget.c:1112
msgid "Horizontal Alignment"
msgstr "Alineación horizontal"
@@ -643,7 +643,7 @@ msgstr "Alineación horizontal"
msgid "X alignment of the child"
msgstr "Alineación X del hijo"
-#: ../gtk/gtkaspectframe.c:116 ../gtk/gtkwidget.c:1187
+#: ../gtk/gtkaspectframe.c:116 ../gtk/gtkwidget.c:1128
msgid "Vertical Alignment"
msgstr "Alineación vertical"
@@ -667,100 +667,100 @@ msgstr "Obedecer al hijo"
msgid "Force aspect ratio to match that of the frame's child"
msgstr "Forzar la proporción para que coincida con el hijo del marco"
-#: ../gtk/gtkassistant.c:310
+#: ../gtk/gtkassistant.c:327
msgid "Header Padding"
msgstr "Separación de la cabecera"
-#: ../gtk/gtkassistant.c:311
+#: ../gtk/gtkassistant.c:328
msgid "Number of pixels around the header."
msgstr "Número de píxeles alrededor de la cabecera."
-#: ../gtk/gtkassistant.c:318
+#: ../gtk/gtkassistant.c:335
msgid "Content Padding"
msgstr "Separación del contenido"
-#: ../gtk/gtkassistant.c:319
+#: ../gtk/gtkassistant.c:336
msgid "Number of pixels around the content pages."
msgstr "Número de píxeles alrededor de las páginas de contenidos."
-#: ../gtk/gtkassistant.c:335
+#: ../gtk/gtkassistant.c:352
msgid "Page type"
msgstr "Tipo de página"
-#: ../gtk/gtkassistant.c:336
+#: ../gtk/gtkassistant.c:353
msgid "The type of the assistant page"
msgstr "El tipo de página del asistente"
-#: ../gtk/gtkassistant.c:353
+#: ../gtk/gtkassistant.c:370
msgid "Page title"
msgstr "Título de página"
-#: ../gtk/gtkassistant.c:354
+#: ../gtk/gtkassistant.c:371
msgid "The title of the assistant page"
msgstr "El título de la página del asistente"
-#: ../gtk/gtkassistant.c:370
+#: ../gtk/gtkassistant.c:387
msgid "Header image"
msgstr "Imagen de la cabecera"
-#: ../gtk/gtkassistant.c:371
+#: ../gtk/gtkassistant.c:388
msgid "Header image for the assistant page"
msgstr "Imagen de la cabecera para la página del asistente"
-#: ../gtk/gtkassistant.c:387
+#: ../gtk/gtkassistant.c:404
msgid "Sidebar image"
msgstr "Imagen de barra lateral"
-#: ../gtk/gtkassistant.c:388
+#: ../gtk/gtkassistant.c:405
msgid "Sidebar image for the assistant page"
msgstr "Imagen de barra lateral para la página del asistente"
-#: ../gtk/gtkassistant.c:403
+#: ../gtk/gtkassistant.c:420
msgid "Page complete"
msgstr "Página completa"
-#: ../gtk/gtkassistant.c:404
+#: ../gtk/gtkassistant.c:421
msgid "Whether all required fields on the page have been filled out"
msgstr "Indica si todos los campos requeridos en la página se han rellenado"
-#: ../gtk/gtkbbox.c:135
+#: ../gtk/gtkbbox.c:152
msgid "Minimum child width"
msgstr "Anchura mínima del hijo"
-#: ../gtk/gtkbbox.c:136
+#: ../gtk/gtkbbox.c:153
msgid "Minimum width of buttons inside the box"
msgstr "Anchura mínima de los botones dentro de la caja"
-#: ../gtk/gtkbbox.c:144
+#: ../gtk/gtkbbox.c:161
msgid "Minimum child height"
msgstr "Altura mínima del hijo"
-#: ../gtk/gtkbbox.c:145
+#: ../gtk/gtkbbox.c:162
msgid "Minimum height of buttons inside the box"
msgstr "Altura mínima de los botones dentro de la caja"
-#: ../gtk/gtkbbox.c:153
+#: ../gtk/gtkbbox.c:170
msgid "Child internal width padding"
msgstr "Anchura interna de relleno del hijo"
-#: ../gtk/gtkbbox.c:154
+#: ../gtk/gtkbbox.c:171
msgid "Amount to increase child's size on either side"
msgstr "Cantidad en la que se incrementa el tamaño del hijo por cada lado"
-#: ../gtk/gtkbbox.c:162
+#: ../gtk/gtkbbox.c:179
msgid "Child internal height padding"
msgstr "Altura interna de relleno del hijo"
-#: ../gtk/gtkbbox.c:163
+#: ../gtk/gtkbbox.c:180
msgid "Amount to increase child's size on the top and bottom"
msgstr ""
"Cantidad en la que se incrementa el tamaño del hijo por arriba y por abajo"
-#: ../gtk/gtkbbox.c:171
+#: ../gtk/gtkbbox.c:188
msgid "Layout style"
msgstr "Estilo de la distribución"
-#: ../gtk/gtkbbox.c:172
+#: ../gtk/gtkbbox.c:189
msgid ""
"How to lay out the buttons in the box. Possible values are: spread, edge, "
"start and end"
@@ -768,11 +768,11 @@ msgstr ""
"Como disponer los botones en la caja. Los valores posibles son: esparcidos, "
"esquinas, inicio y final"
-#: ../gtk/gtkbbox.c:180
+#: ../gtk/gtkbbox.c:197
msgid "Secondary"
msgstr "Secundario"
-#: ../gtk/gtkbbox.c:181
+#: ../gtk/gtkbbox.c:198
msgid ""
"If TRUE, the child appears in a secondary group of children, suitable for, e."
"g., help buttons"
@@ -780,34 +780,34 @@ msgstr ""
"Si es TRUE, el hijo aparece en un grupo secundario de hijos, apropiado para, "
"por ejemplo, botones de ayuda"
-#: ../gtk/gtkbox.c:237 ../gtk/gtkexpander.c:233 ../gtk/gtkiconview.c:684
+#: ../gtk/gtkbox.c:241 ../gtk/gtkexpander.c:233 ../gtk/gtkiconview.c:696
#: ../gtk/gtktreeviewcolumn.c:238
msgid "Spacing"
msgstr "Espaciado"
-#: ../gtk/gtkbox.c:238
+#: ../gtk/gtkbox.c:242
msgid "The amount of space between children"
msgstr "La cantidad de espacio entre hijos"
-#: ../gtk/gtkbox.c:247 ../gtk/gtktable.c:188 ../gtk/gtktoolbar.c:547
-#: ../gtk/gtktoolitemgroup.c:1624
+#: ../gtk/gtkbox.c:251 ../gtk/gtktable.c:193 ../gtk/gtktoolbar.c:553
+#: ../gtk/gtktoolitemgroup.c:1641
msgid "Homogeneous"
msgstr "Homogéneo"
-#: ../gtk/gtkbox.c:248
+#: ../gtk/gtkbox.c:252
msgid "Whether the children should all be the same size"
msgstr "Indica si todos los hijos deben ser del mismo tamaño"
-#: ../gtk/gtkbox.c:264 ../gtk/gtktoolbar.c:539 ../gtk/gtktoolitemgroup.c:1631
-#: ../gtk/gtktoolpalette.c:1038 ../gtk/gtktreeviewcolumn.c:294
+#: ../gtk/gtkbox.c:268 ../gtk/gtktoolbar.c:545 ../gtk/gtktoolitemgroup.c:1648
+#: ../gtk/gtktoolpalette.c:1092 ../gtk/gtktreeviewcolumn.c:294
msgid "Expand"
msgstr "Expandir"
-#: ../gtk/gtkbox.c:265
+#: ../gtk/gtkbox.c:269
msgid "Whether the child should receive extra space when the parent grows"
msgstr "Indica si el hijo debe recibir espacio extra cuando el padre crece"
-#: ../gtk/gtkbox.c:281 ../gtk/gtktoolitemgroup.c:1638
+#: ../gtk/gtkbox.c:281 ../gtk/gtktoolitemgroup.c:1655
msgid "Fill"
msgstr "Relleno"
@@ -831,7 +831,7 @@ msgstr "Espacio extra para colocar entre el hijo y sus vecinos, en píxeles"
msgid "Pack type"
msgstr "Tipo de empaquetado"
-#: ../gtk/gtkbox.c:297 ../gtk/gtknotebook.c:786
+#: ../gtk/gtkbox.c:297 ../gtk/gtknotebook.c:793
msgid ""
"A GtkPackType indicating whether the child is packed with reference to the "
"start or end of the parent"
@@ -839,12 +839,12 @@ msgstr ""
"Un GtkPackType que indica si el hijo está empaquetado con referencia al "
"inicio o el final del padre"
-#: ../gtk/gtkbox.c:303 ../gtk/gtknotebook.c:757 ../gtk/gtkpaned.c:271
-#: ../gtk/gtkruler.c:158 ../gtk/gtktoolitemgroup.c:1652
+#: ../gtk/gtkbox.c:303 ../gtk/gtknotebook.c:764 ../gtk/gtkpaned.c:327
+#: ../gtk/gtktoolitemgroup.c:1669
msgid "Position"
msgstr "Posición"
-#: ../gtk/gtkbox.c:304 ../gtk/gtknotebook.c:758
+#: ../gtk/gtkbox.c:304 ../gtk/gtknotebook.c:765
msgid "The index of the child in the parent"
msgstr "El índice del hijo en el padre"
@@ -856,7 +856,7 @@ msgstr "Dominio de traducción"
msgid "The translation domain used by gettext"
msgstr "El dominio de traducción que usa gettext"
-#: ../gtk/gtkbutton.c:239
+#: ../gtk/gtkbutton.c:227
msgid ""
"Text of the label widget inside the button, if the button contains a label "
"widget"
@@ -864,12 +864,12 @@ msgstr ""
"Texto del etiqueta del widget dentro del botón, si el botón contiene una "
"etiqueta del widget"
-#: ../gtk/gtkbutton.c:246 ../gtk/gtkexpander.c:217 ../gtk/gtklabel.c:570
+#: ../gtk/gtkbutton.c:234 ../gtk/gtkexpander.c:217 ../gtk/gtklabel.c:588
#: ../gtk/gtkmenuitem.c:346 ../gtk/gtktoolbutton.c:209
msgid "Use underline"
msgstr "Utilizar subrayado"
-#: ../gtk/gtkbutton.c:247 ../gtk/gtkexpander.c:218 ../gtk/gtklabel.c:571
+#: ../gtk/gtkbutton.c:235 ../gtk/gtkexpander.c:218 ../gtk/gtklabel.c:589
#: ../gtk/gtkmenuitem.c:347
msgid ""
"If set, an underline in the text indicates the next character should be used "
@@ -878,71 +878,71 @@ msgstr ""
"Si se establece, un subrayado en el texto indica que el siguiente carácter "
"se utiliza como el nemotécnico de la teclas aceleradora"
-#: ../gtk/gtkbutton.c:254 ../gtk/gtkimagemenuitem.c:153
+#: ../gtk/gtkbutton.c:242 ../gtk/gtkimagemenuitem.c:163
msgid "Use stock"
msgstr "Usar inventario"
-#: ../gtk/gtkbutton.c:255
+#: ../gtk/gtkbutton.c:243
msgid ""
"If set, the label is used to pick a stock item instead of being displayed"
msgstr ""
"Si se selecciona, la etiqueta se utiliza para tomar un elemento del "
"inventario en vez de para mostrarse"
-#: ../gtk/gtkbutton.c:262 ../gtk/gtkcombobox.c:861
+#: ../gtk/gtkbutton.c:250 ../gtk/gtkcombobox.c:865
#: ../gtk/gtkfilechooserbutton.c:383
msgid "Focus on click"
msgstr "Enfocar al pulsar"
-#: ../gtk/gtkbutton.c:263 ../gtk/gtkfilechooserbutton.c:384
+#: ../gtk/gtkbutton.c:251 ../gtk/gtkfilechooserbutton.c:384
msgid "Whether the button grabs focus when it is clicked with the mouse"
msgstr "Indica si el botón obtiene el foco al ser pulsado con el ratón"
-#: ../gtk/gtkbutton.c:270
+#: ../gtk/gtkbutton.c:258
msgid "Border relief"
msgstr "Relieve del borde"
-#: ../gtk/gtkbutton.c:271
+#: ../gtk/gtkbutton.c:259
msgid "The border relief style"
msgstr "Estilo del relieve del borde"
-#: ../gtk/gtkbutton.c:288
+#: ../gtk/gtkbutton.c:276
msgid "Horizontal alignment for child"
msgstr "Alineación horizontal para el hijo"
-#: ../gtk/gtkbutton.c:307
+#: ../gtk/gtkbutton.c:295
msgid "Vertical alignment for child"
msgstr "Alineación vertical para el hijo"
-#: ../gtk/gtkbutton.c:324 ../gtk/gtkimagemenuitem.c:138
+#: ../gtk/gtkbutton.c:312 ../gtk/gtkimagemenuitem.c:148
msgid "Image widget"
msgstr "Widget de imagen"
-#: ../gtk/gtkbutton.c:325
+#: ../gtk/gtkbutton.c:313
msgid "Child widget to appear next to the button text"
msgstr "Widget hijo que aparece al lado del texto del botón"
-#: ../gtk/gtkbutton.c:339
+#: ../gtk/gtkbutton.c:327
msgid "Image position"
msgstr "Posición de la imagen"
-#: ../gtk/gtkbutton.c:340
+#: ../gtk/gtkbutton.c:328
msgid "The position of the image relative to the text"
msgstr "Posición de la imagen relativa al texto"
-#: ../gtk/gtkbutton.c:460
+#: ../gtk/gtkbutton.c:448
msgid "Default Spacing"
msgstr "Espaciado predeterminado"
-#: ../gtk/gtkbutton.c:461
+#: ../gtk/gtkbutton.c:449
msgid "Extra space to add for GTK_CAN_DEFAULT buttons"
msgstr "Espacio adicional que añadir para los botones CAN_DEFAULT"
-#: ../gtk/gtkbutton.c:475
+#: ../gtk/gtkbutton.c:463
msgid "Default Outside Spacing"
msgstr "Espaciado exterior predeterminado"
-#: ../gtk/gtkbutton.c:476
+#: ../gtk/gtkbutton.c:464
msgid ""
"Extra space to add for GTK_CAN_DEFAULT buttons that is always drawn outside "
"the border"
@@ -950,31 +950,31 @@ msgstr ""
"Espacio adicional que añadir para los botones CAN_DEFAULT que se dibuja "
"siempre fuera del borde"
-#: ../gtk/gtkbutton.c:481
+#: ../gtk/gtkbutton.c:469
msgid "Child X Displacement"
msgstr "Desplazamiento X del hijo"
-#: ../gtk/gtkbutton.c:482
+#: ../gtk/gtkbutton.c:470
msgid ""
"How far in the x direction to move the child when the button is depressed"
msgstr ""
"Cuánta distancia en la dirección x se mueve el hijo cuando se suelta el botón"
-#: ../gtk/gtkbutton.c:489
+#: ../gtk/gtkbutton.c:477
msgid "Child Y Displacement"
msgstr "Desplazamiento Y del hijo"
-#: ../gtk/gtkbutton.c:490
+#: ../gtk/gtkbutton.c:478
msgid ""
"How far in the y direction to move the child when the button is depressed"
msgstr ""
"Cuánta distancia en la dirección y se mueve el hijo cuando se suelta el botón"
-#: ../gtk/gtkbutton.c:506
+#: ../gtk/gtkbutton.c:494
msgid "Displace focus"
msgstr "Desplazar el foco"
-#: ../gtk/gtkbutton.c:507
+#: ../gtk/gtkbutton.c:495
msgid ""
"Whether the child_displacement_x/_y properties should also affect the focus "
"rectangle"
@@ -982,43 +982,43 @@ msgstr ""
"Indica si las propiedades child_displacement_x/_y deben afectar también al "
"rectángulo del foco"
-#: ../gtk/gtkbutton.c:520 ../gtk/gtkentry.c:695 ../gtk/gtkentry.c:1740
+#: ../gtk/gtkbutton.c:508 ../gtk/gtkentry.c:786 ../gtk/gtkentry.c:1831
msgid "Inner Border"
msgstr "Borde interior"
-#: ../gtk/gtkbutton.c:521
+#: ../gtk/gtkbutton.c:509
msgid "Border between button edges and child."
msgstr "Borde entre los bordes del botón y el hijo."
-#: ../gtk/gtkbutton.c:534
+#: ../gtk/gtkbutton.c:522
msgid "Image spacing"
msgstr "Espaciado de imagen"
-#: ../gtk/gtkbutton.c:535
+#: ../gtk/gtkbutton.c:523
msgid "Spacing in pixels between the image and label"
msgstr "Espaciado en píxeles entre la imagen y la etiqueta"
-#: ../gtk/gtkcalendar.c:470
+#: ../gtk/gtkcalendar.c:475
msgid "Year"
msgstr "Año"
-#: ../gtk/gtkcalendar.c:471
+#: ../gtk/gtkcalendar.c:476
msgid "The selected year"
msgstr "El año seleccionado"
-#: ../gtk/gtkcalendar.c:484
+#: ../gtk/gtkcalendar.c:489
msgid "Month"
msgstr "Mes"
-#: ../gtk/gtkcalendar.c:485
+#: ../gtk/gtkcalendar.c:490
msgid "The selected month (as a number between 0 and 11)"
msgstr "El mes seleccionado (como un número entre 0 y 11)"
-#: ../gtk/gtkcalendar.c:499
+#: ../gtk/gtkcalendar.c:504
msgid "Day"
msgstr "Día"
-#: ../gtk/gtkcalendar.c:500
+#: ../gtk/gtkcalendar.c:505
msgid ""
"The selected day (as a number between 1 and 31, or 0 to unselect the "
"currently selected day)"
@@ -1026,83 +1026,83 @@ msgstr ""
"El día seleccionado (como un número entre 1 y 31, o 0 para deseleccionar el "
"día actualmente seleccionado)"
-#: ../gtk/gtkcalendar.c:514
+#: ../gtk/gtkcalendar.c:519
msgid "Show Heading"
msgstr "Mostrar cabecera"
-#: ../gtk/gtkcalendar.c:515
+#: ../gtk/gtkcalendar.c:520
msgid "If TRUE, a heading is displayed"
msgstr "Si es TRUE, se muestra una cabecera"
-#: ../gtk/gtkcalendar.c:529
+#: ../gtk/gtkcalendar.c:534
msgid "Show Day Names"
msgstr "Mostrar nombres de los días"
-#: ../gtk/gtkcalendar.c:530
+#: ../gtk/gtkcalendar.c:535
msgid "If TRUE, day names are displayed"
msgstr "Si es TRUE, se muestran los nombres de los días"
-#: ../gtk/gtkcalendar.c:543
+#: ../gtk/gtkcalendar.c:548
msgid "No Month Change"
msgstr "Sin cambio de mes"
-#: ../gtk/gtkcalendar.c:544
+#: ../gtk/gtkcalendar.c:549
msgid "If TRUE, the selected month cannot be changed"
msgstr "Si es TRUE, el mes seleccionado no puede cambiarse"
-#: ../gtk/gtkcalendar.c:558
+#: ../gtk/gtkcalendar.c:563
msgid "Show Week Numbers"
msgstr "Mostrar números de las semanas"
-#: ../gtk/gtkcalendar.c:559
+#: ../gtk/gtkcalendar.c:564
msgid "If TRUE, week numbers are displayed"
msgstr "Si es TRUE, se muestran los números de las semanas"
-#: ../gtk/gtkcalendar.c:574
+#: ../gtk/gtkcalendar.c:579
msgid "Details Width"
msgstr "Detalles de la anchura"
-#: ../gtk/gtkcalendar.c:575
+#: ../gtk/gtkcalendar.c:580
msgid "Details width in characters"
msgstr "Detalla la anchura en los caracteres"
-#: ../gtk/gtkcalendar.c:590
+#: ../gtk/gtkcalendar.c:595
msgid "Details Height"
msgstr "Detalles de la altura"
-#: ../gtk/gtkcalendar.c:591
+#: ../gtk/gtkcalendar.c:596
msgid "Details height in rows"
msgstr "Detalla la altura en las filas"
-#: ../gtk/gtkcalendar.c:607
+#: ../gtk/gtkcalendar.c:612
msgid "Show Details"
msgstr "Mostrar detalles"
-#: ../gtk/gtkcalendar.c:608
+#: ../gtk/gtkcalendar.c:613
msgid "If TRUE, details are shown"
msgstr "Si es TRUE, se muestran los detalles"
-#: ../gtk/gtkcalendar.c:620
+#: ../gtk/gtkcalendar.c:625
msgid "Inner border"
msgstr "Borde interior"
-#: ../gtk/gtkcalendar.c:621
+#: ../gtk/gtkcalendar.c:626
msgid "Inner border space"
msgstr "Espacio del borde interior"
-#: ../gtk/gtkcalendar.c:632
+#: ../gtk/gtkcalendar.c:637
msgid "Vertical separation"
msgstr "Separación vertical"
-#: ../gtk/gtkcalendar.c:633
+#: ../gtk/gtkcalendar.c:638
msgid "Space between day headers and main area"
msgstr "Espacio entre las cabeceras del día y el área principal"
-#: ../gtk/gtkcalendar.c:644
+#: ../gtk/gtkcalendar.c:649
msgid "Horizontal separation"
msgstr "Separación horizontal"
-#: ../gtk/gtkcalendar.c:645
+#: ../gtk/gtkcalendar.c:650
msgid "Space between week headers and main area"
msgstr "Espacio entre las cabeceras de la semana y el área principal"
@@ -1146,129 +1146,127 @@ msgstr "Modo del acelerador"
msgid "The type of accelerators"
msgstr "El tipo de aceleradores"
-#: ../gtk/gtkcellrenderer.c:227
+#: ../gtk/gtkcellrenderer.c:266
msgid "mode"
msgstr "modo"
-#: ../gtk/gtkcellrenderer.c:228
+#: ../gtk/gtkcellrenderer.c:267
msgid "Editable mode of the CellRenderer"
msgstr "Modo editable del CellRenderer"
-#: ../gtk/gtkcellrenderer.c:236
+#: ../gtk/gtkcellrenderer.c:275
msgid "visible"
msgstr "visible"
-#: ../gtk/gtkcellrenderer.c:237
+#: ../gtk/gtkcellrenderer.c:276
msgid "Display the cell"
msgstr "Mostrar la celda"
-#: ../gtk/gtkcellrenderer.c:244
+#: ../gtk/gtkcellrenderer.c:283
msgid "Display the cell sensitive"
msgstr "Mostrar la celda sensible"
-#: ../gtk/gtkcellrenderer.c:251
+#: ../gtk/gtkcellrenderer.c:290
msgid "xalign"
msgstr "xalign"
-#: ../gtk/gtkcellrenderer.c:252
+#: ../gtk/gtkcellrenderer.c:291
msgid "The x-align"
msgstr "La alineación x"
-#: ../gtk/gtkcellrenderer.c:261
+#: ../gtk/gtkcellrenderer.c:300
msgid "yalign"
msgstr "yalign"
-#: ../gtk/gtkcellrenderer.c:262
+#: ../gtk/gtkcellrenderer.c:301
msgid "The y-align"
msgstr "La alineación y"
-#: ../gtk/gtkcellrenderer.c:271
+#: ../gtk/gtkcellrenderer.c:310
msgid "xpad"
msgstr "xpad"
-#: ../gtk/gtkcellrenderer.c:272
+#: ../gtk/gtkcellrenderer.c:311
msgid "The xpad"
msgstr "La separación x"
-#: ../gtk/gtkcellrenderer.c:281
+#: ../gtk/gtkcellrenderer.c:320
msgid "ypad"
msgstr "ypad"
-#: ../gtk/gtkcellrenderer.c:282
+#: ../gtk/gtkcellrenderer.c:321
msgid "The ypad"
msgstr "La separación y"
-#: ../gtk/gtkcellrenderer.c:291
+#: ../gtk/gtkcellrenderer.c:330
msgid "width"
msgstr "anchura"
-#: ../gtk/gtkcellrenderer.c:292
+#: ../gtk/gtkcellrenderer.c:331
msgid "The fixed width"
msgstr "La anchura fija"
-#: ../gtk/gtkcellrenderer.c:301
+#: ../gtk/gtkcellrenderer.c:340
msgid "height"
msgstr "altura"
-#: ../gtk/gtkcellrenderer.c:302
+#: ../gtk/gtkcellrenderer.c:341
msgid "The fixed height"
msgstr "La altura fija"
-#: ../gtk/gtkcellrenderer.c:311
+#: ../gtk/gtkcellrenderer.c:350
msgid "Is Expander"
msgstr "Es expansor"
-#: ../gtk/gtkcellrenderer.c:312
+#: ../gtk/gtkcellrenderer.c:351
msgid "Row has children"
msgstr "La fila tiene hijos"
-#: ../gtk/gtkcellrenderer.c:320
+#: ../gtk/gtkcellrenderer.c:359
msgid "Is Expanded"
msgstr "Está expandido"
-#: ../gtk/gtkcellrenderer.c:321
+#: ../gtk/gtkcellrenderer.c:360
msgid "Row is an expander row, and is expanded"
msgstr "La fila es una fila de expansor, y está expandida"
-#: ../gtk/gtkcellrenderer.c:328
+#: ../gtk/gtkcellrenderer.c:367
msgid "Cell background color name"
msgstr "Nombre del color de fondo de la celda"
-#: ../gtk/gtkcellrenderer.c:329
+#: ../gtk/gtkcellrenderer.c:368
msgid "Cell background color as a string"
msgstr "Color de fondo de la celda como una cadena"
-#: ../gtk/gtkcellrenderer.c:336
+#: ../gtk/gtkcellrenderer.c:375
msgid "Cell background color"
msgstr "Color de fondo de la celda"
-#: ../gtk/gtkcellrenderer.c:337
+#: ../gtk/gtkcellrenderer.c:376
msgid "Cell background color as a GdkColor"
msgstr "Color de fondo de la celda como GdkColor"
-#: ../gtk/gtkcellrenderer.c:350
-#| msgid "Cell background color"
+#: ../gtk/gtkcellrenderer.c:389
msgid "Cell background RGBA color"
msgstr "Color de fondo RGBA de la celda"
-#: ../gtk/gtkcellrenderer.c:351
-#| msgid "Cell background color as a GdkColor"
+#: ../gtk/gtkcellrenderer.c:390
msgid "Cell background color as a GdkRGBA"
msgstr "Color de fondo de la celda como GdkRGBA"
-#: ../gtk/gtkcellrenderer.c:358
+#: ../gtk/gtkcellrenderer.c:397
msgid "Editing"
msgstr "Editando"
-#: ../gtk/gtkcellrenderer.c:359
+#: ../gtk/gtkcellrenderer.c:398
msgid "Whether the cell renderer is currently in editing mode"
msgstr "Indica si la renderización de la celda está en modo de edición"
-#: ../gtk/gtkcellrenderer.c:367
+#: ../gtk/gtkcellrenderer.c:406
msgid "Cell background set"
msgstr "Establece el fondo de la celda"
-#: ../gtk/gtkcellrenderer.c:368
+#: ../gtk/gtkcellrenderer.c:407
msgid "Whether this tag affects the cell background color"
msgstr "Indica si esta etiqueta afecta el color de fondo de la celda"
@@ -1289,7 +1287,7 @@ msgid "A column in the data source model to get the strings from"
msgstr ""
"Una columna en el modelo de origen de datos del que se obtienen las cadenas"
-#: ../gtk/gtkcellrenderercombo.c:150 ../gtk/gtkcombobox.c:928
+#: ../gtk/gtkcellrenderercombo.c:150 ../gtk/gtkcombobox.c:932
msgid "Has Entry"
msgstr "Tiene entrada"
@@ -1322,7 +1320,7 @@ msgstr "Pixbuf del expansor cerrado"
msgid "Pixbuf for closed expander"
msgstr "El pixbuf para el expansor cerrado"
-#: ../gtk/gtkcellrendererpixbuf.c:144 ../gtk/gtkimage.c:244
+#: ../gtk/gtkcellrendererpixbuf.c:144 ../gtk/gtkimage.c:250
#: ../gtk/gtkstatusicon.c:228
msgid "Stock ID"
msgstr "ID del inventario"
@@ -1356,8 +1354,8 @@ msgstr "Seguir estado"
msgid "Whether the rendered pixbuf should be colorized according to the state"
msgstr "Indica si el pixbuf renderizado debe colorearse de acuerdo al estado"
-#: ../gtk/gtkcellrendererpixbuf.c:214 ../gtk/gtkimage.c:319
-#: ../gtk/gtkwindow.c:709
+#: ../gtk/gtkcellrendererpixbuf.c:214 ../gtk/gtkimage.c:325
+#: ../gtk/gtkwindow.c:710
msgid "Icon"
msgstr "Icono"
@@ -1365,10 +1363,10 @@ msgstr "Icono"
msgid "Value of the progress bar"
msgstr "Valor de la barra de progreso"
-#: ../gtk/gtkcellrendererprogress.c:144 ../gtk/gtkcellrenderertext.c:233
-#: ../gtk/gtkentry.c:738 ../gtk/gtkentrybuffer.c:352
-#: ../gtk/gtkmessagedialog.c:226 ../gtk/gtkprogressbar.c:145
-#: ../gtk/gtktextbuffer.c:210
+#: ../gtk/gtkcellrendererprogress.c:144 ../gtk/gtkcellrenderertext.c:247
+#: ../gtk/gtkentry.c:829 ../gtk/gtkentrybuffer.c:352
+#: ../gtk/gtkmessagedialog.c:226 ../gtk/gtkprogressbar.c:177
+#: ../gtk/gtktextbuffer.c:209
msgid "Text"
msgstr "Texto"
@@ -1408,21 +1406,21 @@ msgstr "Alineación y del texto"
msgid "The vertical text alignment, from 0 (top) to 1 (bottom)."
msgstr "La alineación vertical del texto, desde 0 (superior) a 1 (inferior)."
-#: ../gtk/gtkcellrendererprogress.c:214 ../gtk/gtkprogressbar.c:121
-#: ../gtk/gtkrange.c:433
+#: ../gtk/gtkcellrendererprogress.c:214 ../gtk/gtkprogressbar.c:153
+#: ../gtk/gtkrange.c:440
msgid "Inverted"
msgstr "Invertido"
-#: ../gtk/gtkcellrendererprogress.c:215 ../gtk/gtkprogressbar.c:122
+#: ../gtk/gtkcellrendererprogress.c:215 ../gtk/gtkprogressbar.c:154
msgid "Invert the direction in which the progress bar grows"
msgstr "Invertir la dirección en la que aumentan las barras de progreso"
-#: ../gtk/gtkcellrendererspin.c:91 ../gtk/gtkrange.c:425
-#: ../gtk/gtkscalebutton.c:239 ../gtk/gtkspinbutton.c:228
+#: ../gtk/gtkcellrendererspin.c:91 ../gtk/gtkrange.c:432
+#: ../gtk/gtkscalebutton.c:239 ../gtk/gtkspinbutton.c:230
msgid "Adjustment"
msgstr "Ajuste"
-#: ../gtk/gtkcellrendererspin.c:92 ../gtk/gtkspinbutton.c:229
+#: ../gtk/gtkcellrendererspin.c:92 ../gtk/gtkspinbutton.c:231
msgid "The adjustment that holds the value of the spin button"
msgstr "El ajuste que mantiene el valor del botón incrementable"
@@ -1430,22 +1428,23 @@ msgstr "El ajuste que mantiene el valor del botón incrementable"
msgid "Climb rate"
msgstr "Tasa de subida"
-#: ../gtk/gtkcellrendererspin.c:108 ../gtk/gtkspinbutton.c:237
+#: ../gtk/gtkcellrendererspin.c:108 ../gtk/gtkspinbutton.c:239
msgid "The acceleration rate when you hold down a button"
msgstr "La tasa de aceleración cuando mantiene apretado un botón"
-#: ../gtk/gtkcellrendererspin.c:121 ../gtk/gtkscale.c:244
-#: ../gtk/gtkspinbutton.c:246
+#: ../gtk/gtkcellrendererspin.c:121 ../gtk/gtkscale.c:249
+#: ../gtk/gtkspinbutton.c:248
msgid "Digits"
msgstr "Dígitos"
-#: ../gtk/gtkcellrendererspin.c:122 ../gtk/gtkspinbutton.c:247
+#: ../gtk/gtkcellrendererspin.c:122 ../gtk/gtkspinbutton.c:249
msgid "The number of decimal places to display"
msgstr "El número de lugares decimales que mostrar"
#: ../gtk/gtkcellrendererspinner.c:119 ../gtk/gtkcheckmenuitem.c:105
-#: ../gtk/gtkmenu.c:520 ../gtk/gtkspinner.c:131 ../gtk/gtktoggleaction.c:133
-#: ../gtk/gtktogglebutton.c:115 ../gtk/gtktoggletoolbutton.c:112
+#: ../gtk/gtkmenu.c:521 ../gtk/gtkspinner.c:131 ../gtk/gtkswitch.c:739
+#: ../gtk/gtktoggleaction.c:133 ../gtk/gtktogglebutton.c:125
+#: ../gtk/gtktoggletoolbutton.c:112
msgid "Active"
msgstr "Activo"
@@ -1464,197 +1463,193 @@ msgstr ""
"El valor de GTKIconSize que especifica el tamaño del marcador incrementable "
"renderizado"
-#: ../gtk/gtkcellrenderertext.c:234
+#: ../gtk/gtkcellrenderertext.c:248
msgid "Text to render"
msgstr "Texto a renderizar"
-#: ../gtk/gtkcellrenderertext.c:241
+#: ../gtk/gtkcellrenderertext.c:255
msgid "Markup"
msgstr "Marcado"
-#: ../gtk/gtkcellrenderertext.c:242
+#: ../gtk/gtkcellrenderertext.c:256
msgid "Marked up text to render"
msgstr "Texto resaltado a renderizar"
-#: ../gtk/gtkcellrenderertext.c:249 ../gtk/gtklabel.c:556
+#: ../gtk/gtkcellrenderertext.c:263 ../gtk/gtklabel.c:574
msgid "Attributes"
msgstr "Atributos"
-#: ../gtk/gtkcellrenderertext.c:250
+#: ../gtk/gtkcellrenderertext.c:264
msgid "A list of style attributes to apply to the text of the renderer"
msgstr ""
"Un lista de atributos de estilos para aplicar al texto del renderizador"
-#: ../gtk/gtkcellrenderertext.c:257
+#: ../gtk/gtkcellrenderertext.c:271
msgid "Single Paragraph Mode"
msgstr "Modo de parágrafo simple"
-#: ../gtk/gtkcellrenderertext.c:258
+#: ../gtk/gtkcellrenderertext.c:272
msgid "Whether to keep all text in a single paragraph"
msgstr "Indica si se debe mantener todo el texto en un sólo parágrafo"
-#: ../gtk/gtkcellrenderertext.c:266 ../gtk/gtkcellview.c:179
+#: ../gtk/gtkcellrenderertext.c:280 ../gtk/gtkcellview.c:192
#: ../gtk/gtktexttag.c:178
msgid "Background color name"
msgstr "Nombre del color de fondo"
-#: ../gtk/gtkcellrenderertext.c:267 ../gtk/gtkcellview.c:180
+#: ../gtk/gtkcellrenderertext.c:281 ../gtk/gtkcellview.c:193
#: ../gtk/gtktexttag.c:179
msgid "Background color as a string"
msgstr "Color de fondo como una cadena"
-#: ../gtk/gtkcellrenderertext.c:274 ../gtk/gtkcellview.c:186
+#: ../gtk/gtkcellrenderertext.c:288 ../gtk/gtkcellview.c:199
#: ../gtk/gtktexttag.c:186
msgid "Background color"
msgstr "Color de fondo"
-#: ../gtk/gtkcellrenderertext.c:275 ../gtk/gtkcellview.c:187
+#: ../gtk/gtkcellrenderertext.c:289 ../gtk/gtkcellview.c:200
msgid "Background color as a GdkColor"
msgstr "Color de fondo como GdkColor"
-#: ../gtk/gtkcellrenderertext.c:289
-#| msgid "Background color name"
+#: ../gtk/gtkcellrenderertext.c:303
msgid "Background color as RGBA"
msgstr "Nombre del color de fondo como RGBA"
-#: ../gtk/gtkcellrenderertext.c:290 ../gtk/gtkcellview.c:201
-#| msgid "Background color as a GdkColor"
+#: ../gtk/gtkcellrenderertext.c:304 ../gtk/gtkcellview.c:214
msgid "Background color as a GdkRGBA"
msgstr "Color de fondo como GdkRGBA"
-#: ../gtk/gtkcellrenderertext.c:296 ../gtk/gtktexttag.c:202
+#: ../gtk/gtkcellrenderertext.c:310 ../gtk/gtktexttag.c:202
msgid "Foreground color name"
msgstr "Nombre del color de primer plano"
-#: ../gtk/gtkcellrenderertext.c:297 ../gtk/gtktexttag.c:203
+#: ../gtk/gtkcellrenderertext.c:311 ../gtk/gtktexttag.c:203
msgid "Foreground color as a string"
msgstr "Color de primer plano como una cadena"
-#: ../gtk/gtkcellrenderertext.c:304 ../gtk/gtktexttag.c:210
+#: ../gtk/gtkcellrenderertext.c:318 ../gtk/gtktexttag.c:210
#: ../gtk/gtktrayicon-x11.c:133
msgid "Foreground color"
msgstr "Color de primer plano"
-#: ../gtk/gtkcellrenderertext.c:305
+#: ../gtk/gtkcellrenderertext.c:319
msgid "Foreground color as a GdkColor"
msgstr "Color de primer plano como GdkColor"
-#: ../gtk/gtkcellrenderertext.c:319
-#| msgid "Foreground color name"
+#: ../gtk/gtkcellrenderertext.c:333
msgid "Foreground color as RGBA"
msgstr "Color de primer plano como RGBA"
-#: ../gtk/gtkcellrenderertext.c:320
-#| msgid "Foreground color as a GdkColor"
+#: ../gtk/gtkcellrenderertext.c:334
msgid "Foreground color as a GdkRGBA"
msgstr "Color de primer plano como GdkRGBA"
-#: ../gtk/gtkcellrenderertext.c:328 ../gtk/gtkentry.c:662
-#: ../gtk/gtktexttag.c:227 ../gtk/gtktextview.c:660
+#: ../gtk/gtkcellrenderertext.c:342 ../gtk/gtkentry.c:753
+#: ../gtk/gtktexttag.c:227 ../gtk/gtktextview.c:686
msgid "Editable"
msgstr "Editable"
-#: ../gtk/gtkcellrenderertext.c:329 ../gtk/gtktexttag.c:228
-#: ../gtk/gtktextview.c:661
+#: ../gtk/gtkcellrenderertext.c:343 ../gtk/gtktexttag.c:228
+#: ../gtk/gtktextview.c:687
msgid "Whether the text can be modified by the user"
msgstr "Indica si el texto puede modificarse por el usuario"
-#: ../gtk/gtkcellrenderertext.c:336 ../gtk/gtkcellrenderertext.c:344
+#: ../gtk/gtkcellrenderertext.c:350 ../gtk/gtkcellrenderertext.c:358
#: ../gtk/gtktexttag.c:243 ../gtk/gtktexttag.c:251
msgid "Font"
msgstr "Tipografía"
-#: ../gtk/gtkcellrenderertext.c:337 ../gtk/gtktexttag.c:244
+#: ../gtk/gtkcellrenderertext.c:351 ../gtk/gtktexttag.c:244
msgid "Font description as a string, e.g. \"Sans Italic 12\""
msgstr ""
"Descripción de la tipografía como una cadena, ejemplo: «Sans Italic 12»"
-#: ../gtk/gtkcellrenderertext.c:345 ../gtk/gtktexttag.c:252
+#: ../gtk/gtkcellrenderertext.c:359 ../gtk/gtktexttag.c:252
msgid "Font description as a PangoFontDescription struct"
msgstr "Descripción de la tipografía como una estructura PangoFontDescription"
-#: ../gtk/gtkcellrenderertext.c:353 ../gtk/gtktexttag.c:259
+#: ../gtk/gtkcellrenderertext.c:367 ../gtk/gtktexttag.c:259
msgid "Font family"
msgstr "Familia tipográfica"
-#: ../gtk/gtkcellrenderertext.c:354 ../gtk/gtktexttag.c:260
+#: ../gtk/gtkcellrenderertext.c:368 ../gtk/gtktexttag.c:260
msgid "Name of the font family, e.g. Sans, Helvetica, Times, Monospace"
msgstr ""
"Nombre de la familia tipográfica, ej. Sans, Helvética, Times, Monospace"
-#: ../gtk/gtkcellrenderertext.c:361 ../gtk/gtkcellrenderertext.c:362
+#: ../gtk/gtkcellrenderertext.c:375 ../gtk/gtkcellrenderertext.c:376
#: ../gtk/gtktexttag.c:267
msgid "Font style"
msgstr "Estilo de la tipografía"
-#: ../gtk/gtkcellrenderertext.c:370 ../gtk/gtkcellrenderertext.c:371
+#: ../gtk/gtkcellrenderertext.c:384 ../gtk/gtkcellrenderertext.c:385
#: ../gtk/gtktexttag.c:276
msgid "Font variant"
msgstr "Variante de la tipografía"
-#: ../gtk/gtkcellrenderertext.c:379 ../gtk/gtkcellrenderertext.c:380
+#: ../gtk/gtkcellrenderertext.c:393 ../gtk/gtkcellrenderertext.c:394
#: ../gtk/gtktexttag.c:285
msgid "Font weight"
msgstr "Anchura de la tipografía"
-#: ../gtk/gtkcellrenderertext.c:389 ../gtk/gtkcellrenderertext.c:390
+#: ../gtk/gtkcellrenderertext.c:403 ../gtk/gtkcellrenderertext.c:404
#: ../gtk/gtktexttag.c:296
msgid "Font stretch"
msgstr "Estiramiento de la tipografía"
-#: ../gtk/gtkcellrenderertext.c:398 ../gtk/gtkcellrenderertext.c:399
+#: ../gtk/gtkcellrenderertext.c:412 ../gtk/gtkcellrenderertext.c:413
#: ../gtk/gtktexttag.c:305
msgid "Font size"
msgstr "Tamaño de la tipografía"
-#: ../gtk/gtkcellrenderertext.c:408 ../gtk/gtktexttag.c:325
+#: ../gtk/gtkcellrenderertext.c:422 ../gtk/gtktexttag.c:325
msgid "Font points"
msgstr "Puntos de la tipografía"
-#: ../gtk/gtkcellrenderertext.c:409 ../gtk/gtktexttag.c:326
+#: ../gtk/gtkcellrenderertext.c:423 ../gtk/gtktexttag.c:326
msgid "Font size in points"
msgstr "Tamaño de la tipografía en puntos"
-#: ../gtk/gtkcellrenderertext.c:418 ../gtk/gtktexttag.c:315
+#: ../gtk/gtkcellrenderertext.c:432 ../gtk/gtktexttag.c:315
msgid "Font scale"
msgstr "Escala de la tipografía"
-#: ../gtk/gtkcellrenderertext.c:419
+#: ../gtk/gtkcellrenderertext.c:433
msgid "Font scaling factor"
msgstr "Factor de escalado de la tipografía"
-#: ../gtk/gtkcellrenderertext.c:428 ../gtk/gtktexttag.c:394
+#: ../gtk/gtkcellrenderertext.c:442 ../gtk/gtktexttag.c:394
msgid "Rise"
msgstr "Elevar"
-#: ../gtk/gtkcellrenderertext.c:429
+#: ../gtk/gtkcellrenderertext.c:443
msgid ""
"Offset of text above the baseline (below the baseline if rise is negative)"
msgstr ""
"Desplazamiento del texto sobre la línea base (por debajo de la línea base la "
"elevación es negativa)"
-#: ../gtk/gtkcellrenderertext.c:440 ../gtk/gtktexttag.c:434
+#: ../gtk/gtkcellrenderertext.c:454 ../gtk/gtktexttag.c:434
msgid "Strikethrough"
msgstr "Tachar"
-#: ../gtk/gtkcellrenderertext.c:441 ../gtk/gtktexttag.c:435
+#: ../gtk/gtkcellrenderertext.c:455 ../gtk/gtktexttag.c:435
msgid "Whether to strike through the text"
msgstr "Indica si se tacha el texto"
-#: ../gtk/gtkcellrenderertext.c:448 ../gtk/gtktexttag.c:442
+#: ../gtk/gtkcellrenderertext.c:462 ../gtk/gtktexttag.c:442
msgid "Underline"
msgstr "Subrayado"
-#: ../gtk/gtkcellrenderertext.c:449 ../gtk/gtktexttag.c:443
+#: ../gtk/gtkcellrenderertext.c:463 ../gtk/gtktexttag.c:443
msgid "Style of underline for this text"
msgstr "Estilo de subrayado de este texto"
-#: ../gtk/gtkcellrenderertext.c:457 ../gtk/gtktexttag.c:354
+#: ../gtk/gtkcellrenderertext.c:471 ../gtk/gtktexttag.c:354
msgid "Language"
msgstr "Idioma"
-#: ../gtk/gtkcellrenderertext.c:458
+#: ../gtk/gtkcellrenderertext.c:472
msgid ""
"The language this text is in, as an ISO code. Pango can use this as a hint "
"when rendering the text. If you don't understand this parameter, you "
@@ -1664,12 +1659,12 @@ msgstr ""
"como una ayuda cuando está renderizando el texto. Si no comprende este "
"parámetro probablemente no lo necesite"
-#: ../gtk/gtkcellrenderertext.c:478 ../gtk/gtklabel.c:681
-#: ../gtk/gtkprogressbar.c:175
+#: ../gtk/gtkcellrenderertext.c:492 ../gtk/gtklabel.c:699
+#: ../gtk/gtkprogressbar.c:207
msgid "Ellipsize"
msgstr "Elipsis"
-#: ../gtk/gtkcellrenderertext.c:479
+#: ../gtk/gtkcellrenderertext.c:493
msgid ""
"The preferred place to ellipsize the string, if the cell renderer does not "
"have enough room to display the entire string"
@@ -1677,28 +1672,28 @@ msgstr ""
"El lugar preferido para la elipsis de la cadena, si el renderizador de la "
"celda no tiene espacio suficiente para mostrar la cadena completa"
-#: ../gtk/gtkcellrenderertext.c:498 ../gtk/gtkfilechooserbutton.c:411
-#: ../gtk/gtklabel.c:702
+#: ../gtk/gtkcellrenderertext.c:512 ../gtk/gtkfilechooserbutton.c:411
+#: ../gtk/gtklabel.c:720
msgid "Width In Characters"
msgstr "Anchura en caracteres"
-#: ../gtk/gtkcellrenderertext.c:499 ../gtk/gtklabel.c:703
+#: ../gtk/gtkcellrenderertext.c:513 ../gtk/gtklabel.c:721
msgid "The desired width of the label, in characters"
msgstr "La anchura deseada de la etiqueta, en caracteres"
-#: ../gtk/gtkcellrenderertext.c:523 ../gtk/gtklabel.c:763
+#: ../gtk/gtkcellrenderertext.c:537 ../gtk/gtklabel.c:781
msgid "Maximum Width In Characters"
msgstr "Anchura máxima en caracteres"
-#: ../gtk/gtkcellrenderertext.c:524
+#: ../gtk/gtkcellrenderertext.c:538
msgid "The maximum width of the cell, in characters"
msgstr "La anchura máxima de la celda, en caracteres"
-#: ../gtk/gtkcellrenderertext.c:542 ../gtk/gtktexttag.c:451
+#: ../gtk/gtkcellrenderertext.c:556 ../gtk/gtktexttag.c:451
msgid "Wrap mode"
msgstr "Modo de ajuste"
-#: ../gtk/gtkcellrenderertext.c:543
+#: ../gtk/gtkcellrenderertext.c:557
msgid ""
"How to break the string into multiple lines, if the cell renderer does not "
"have enough room to display the entire string"
@@ -1706,150 +1701,150 @@ msgstr ""
"Cómo romper la cadena en líneas múltiples, si el renderizador de la celda no "
"tiene suficiente espacio para mostrar la cadena completa"
-#: ../gtk/gtkcellrenderertext.c:562 ../gtk/gtkcombobox.c:750
+#: ../gtk/gtkcellrenderertext.c:576 ../gtk/gtkcombobox.c:754
msgid "Wrap width"
msgstr "Ajustar anchura"
-#: ../gtk/gtkcellrenderertext.c:563
+#: ../gtk/gtkcellrenderertext.c:577
msgid "The width at which the text is wrapped"
msgstr "La anchura a la que el texto se ajusta"
-#: ../gtk/gtkcellrenderertext.c:583 ../gtk/gtktreeviewcolumn.c:319
+#: ../gtk/gtkcellrenderertext.c:597 ../gtk/gtktreeviewcolumn.c:319
msgid "Alignment"
msgstr "Alineación"
-#: ../gtk/gtkcellrenderertext.c:584
+#: ../gtk/gtkcellrenderertext.c:598
msgid "How to align the lines"
msgstr "Cómo alinear las líneas"
-#: ../gtk/gtkcellrenderertext.c:596 ../gtk/gtkcellview.c:223
+#: ../gtk/gtkcellrenderertext.c:610 ../gtk/gtkcellview.c:236
#: ../gtk/gtktexttag.c:540
msgid "Background set"
msgstr "Establece el fondo"
-#: ../gtk/gtkcellrenderertext.c:597 ../gtk/gtkcellview.c:224
+#: ../gtk/gtkcellrenderertext.c:611 ../gtk/gtkcellview.c:237
#: ../gtk/gtktexttag.c:541
msgid "Whether this tag affects the background color"
msgstr "Indica si esta etiqueta afecta el color de fondo"
-#: ../gtk/gtkcellrenderertext.c:600 ../gtk/gtktexttag.c:548
+#: ../gtk/gtkcellrenderertext.c:614 ../gtk/gtktexttag.c:548
msgid "Foreground set"
msgstr "Establece el primer plano"
-#: ../gtk/gtkcellrenderertext.c:601 ../gtk/gtktexttag.c:549
+#: ../gtk/gtkcellrenderertext.c:615 ../gtk/gtktexttag.c:549
msgid "Whether this tag affects the foreground color"
msgstr "Indica si esta etiqueta afecta al color de frente"
-#: ../gtk/gtkcellrenderertext.c:604 ../gtk/gtktexttag.c:552
+#: ../gtk/gtkcellrenderertext.c:618 ../gtk/gtktexttag.c:552
msgid "Editability set"
msgstr "Establece la editabilidad"
-#: ../gtk/gtkcellrenderertext.c:605 ../gtk/gtktexttag.c:553
+#: ../gtk/gtkcellrenderertext.c:619 ../gtk/gtktexttag.c:553
msgid "Whether this tag affects text editability"
msgstr "Indica si esta etiqueta afecta la editabilidad del texto"
-#: ../gtk/gtkcellrenderertext.c:608 ../gtk/gtktexttag.c:556
+#: ../gtk/gtkcellrenderertext.c:622 ../gtk/gtktexttag.c:556
msgid "Font family set"
msgstr "Establece familia tipográfica"
-#: ../gtk/gtkcellrenderertext.c:609 ../gtk/gtktexttag.c:557
+#: ../gtk/gtkcellrenderertext.c:623 ../gtk/gtktexttag.c:557
msgid "Whether this tag affects the font family"
msgstr "Indica si esta etiqueta afecta a la familia de la tipografía"
-#: ../gtk/gtkcellrenderertext.c:612 ../gtk/gtktexttag.c:560
+#: ../gtk/gtkcellrenderertext.c:626 ../gtk/gtktexttag.c:560
msgid "Font style set"
msgstr "Establece el estilo de la tipografía"
-#: ../gtk/gtkcellrenderertext.c:613 ../gtk/gtktexttag.c:561
+#: ../gtk/gtkcellrenderertext.c:627 ../gtk/gtktexttag.c:561
msgid "Whether this tag affects the font style"
msgstr "Indica si esta etiqueta afecta el estilo de la tipografía"
-#: ../gtk/gtkcellrenderertext.c:616 ../gtk/gtktexttag.c:564
+#: ../gtk/gtkcellrenderertext.c:630 ../gtk/gtktexttag.c:564
msgid "Font variant set"
msgstr "Establece la variante de la tipografía"
-#: ../gtk/gtkcellrenderertext.c:617 ../gtk/gtktexttag.c:565
+#: ../gtk/gtkcellrenderertext.c:631 ../gtk/gtktexttag.c:565
msgid "Whether this tag affects the font variant"
msgstr "Indica si esta etiqueta afecta la variante de la tipografía"
-#: ../gtk/gtkcellrenderertext.c:620 ../gtk/gtktexttag.c:568
+#: ../gtk/gtkcellrenderertext.c:634 ../gtk/gtktexttag.c:568
msgid "Font weight set"
msgstr "Establece el peso de la tipografía"
-#: ../gtk/gtkcellrenderertext.c:621 ../gtk/gtktexttag.c:569
+#: ../gtk/gtkcellrenderertext.c:635 ../gtk/gtktexttag.c:569
msgid "Whether this tag affects the font weight"
msgstr "Indica si esta etiqueta afecta el peso de la tipografía"
-#: ../gtk/gtkcellrenderertext.c:624 ../gtk/gtktexttag.c:572
+#: ../gtk/gtkcellrenderertext.c:638 ../gtk/gtktexttag.c:572
msgid "Font stretch set"
msgstr "Establece el ancho de la tipografía"
-#: ../gtk/gtkcellrenderertext.c:625 ../gtk/gtktexttag.c:573
+#: ../gtk/gtkcellrenderertext.c:639 ../gtk/gtktexttag.c:573
msgid "Whether this tag affects the font stretch"
msgstr "Indica si esta etiqueta afecta el estiramiento de la tipografía"
-#: ../gtk/gtkcellrenderertext.c:628 ../gtk/gtktexttag.c:576
+#: ../gtk/gtkcellrenderertext.c:642 ../gtk/gtktexttag.c:576
msgid "Font size set"
msgstr "Establece el tamaño de tipografía"
-#: ../gtk/gtkcellrenderertext.c:629 ../gtk/gtktexttag.c:577
+#: ../gtk/gtkcellrenderertext.c:643 ../gtk/gtktexttag.c:577
msgid "Whether this tag affects the font size"
msgstr "Indica si esta etiqueta afecta el tamaño de la tipografía"
-#: ../gtk/gtkcellrenderertext.c:632 ../gtk/gtktexttag.c:580
+#: ../gtk/gtkcellrenderertext.c:646 ../gtk/gtktexttag.c:580
msgid "Font scale set"
msgstr "Establece la escala de la tipografía"
-#: ../gtk/gtkcellrenderertext.c:633 ../gtk/gtktexttag.c:581
+#: ../gtk/gtkcellrenderertext.c:647 ../gtk/gtktexttag.c:581
msgid "Whether this tag scales the font size by a factor"
msgstr ""
"Indica si esta etiqueta escala el tamaño de la tipografía por un factor"
-#: ../gtk/gtkcellrenderertext.c:636 ../gtk/gtktexttag.c:600
+#: ../gtk/gtkcellrenderertext.c:650 ../gtk/gtktexttag.c:600
msgid "Rise set"
msgstr "Establece el elevamiento"
-#: ../gtk/gtkcellrenderertext.c:637 ../gtk/gtktexttag.c:601
+#: ../gtk/gtkcellrenderertext.c:651 ../gtk/gtktexttag.c:601
msgid "Whether this tag affects the rise"
msgstr "Indica si esta etiqueta afecta la elevación"
-#: ../gtk/gtkcellrenderertext.c:640 ../gtk/gtktexttag.c:616
+#: ../gtk/gtkcellrenderertext.c:654 ../gtk/gtktexttag.c:616
msgid "Strikethrough set"
msgstr "Establece el tachado"
-#: ../gtk/gtkcellrenderertext.c:641 ../gtk/gtktexttag.c:617
+#: ../gtk/gtkcellrenderertext.c:655 ../gtk/gtktexttag.c:617
msgid "Whether this tag affects strikethrough"
msgstr "Indica si esta etiqueta afecta el tachado"
-#: ../gtk/gtkcellrenderertext.c:644 ../gtk/gtktexttag.c:624
+#: ../gtk/gtkcellrenderertext.c:658 ../gtk/gtktexttag.c:624
msgid "Underline set"
msgstr "Establece el subrayado"
-#: ../gtk/gtkcellrenderertext.c:645 ../gtk/gtktexttag.c:625
+#: ../gtk/gtkcellrenderertext.c:659 ../gtk/gtktexttag.c:625
msgid "Whether this tag affects underlining"
msgstr "Indica si esta etiqueta afecta el subrayado"
-#: ../gtk/gtkcellrenderertext.c:648 ../gtk/gtktexttag.c:588
+#: ../gtk/gtkcellrenderertext.c:662 ../gtk/gtktexttag.c:588
msgid "Language set"
msgstr "Establece el idioma"
-#: ../gtk/gtkcellrenderertext.c:649 ../gtk/gtktexttag.c:589
+#: ../gtk/gtkcellrenderertext.c:663 ../gtk/gtktexttag.c:589
msgid "Whether this tag affects the language the text is rendered as"
msgstr "Indica si esta etiqueta afecta al idioma en que se renderiza el texto"
-#: ../gtk/gtkcellrenderertext.c:652
+#: ../gtk/gtkcellrenderertext.c:666
msgid "Ellipsize set"
msgstr "Establece la elipsis"
-#: ../gtk/gtkcellrenderertext.c:653
+#: ../gtk/gtkcellrenderertext.c:667
msgid "Whether this tag affects the ellipsize mode"
msgstr "Indica si esta etiqueta afecta el modo de elipsis"
-#: ../gtk/gtkcellrenderertext.c:656
+#: ../gtk/gtkcellrenderertext.c:670
msgid "Align set"
msgstr "Establece alineación"
-#: ../gtk/gtkcellrenderertext.c:657
+#: ../gtk/gtkcellrenderertext.c:671
msgid "Whether this tag affects the alignment mode"
msgstr "Indica si esta etiqueta afecta el modo de alineamiento"
@@ -1889,33 +1884,32 @@ msgstr "Dibujar el botón de activación como un botón de radio"
msgid "Indicator size"
msgstr "Tamaño del indicador"
-#: ../gtk/gtkcellrenderertoggle.c:161 ../gtk/gtkcheckbutton.c:72
+#: ../gtk/gtkcellrenderertoggle.c:161 ../gtk/gtkcheckbutton.c:78
#: ../gtk/gtkcheckmenuitem.c:129
msgid "Size of check or radio indicator"
msgstr "Tamaño del indicador de radio o de la casilla"
-#: ../gtk/gtkcellview.c:200
-#| msgid "Background color"
+#: ../gtk/gtkcellview.c:213
msgid "Background RGBA color"
msgstr "Color de fondo RGBA"
-#: ../gtk/gtkcellview.c:215
+#: ../gtk/gtkcellview.c:228
msgid "CellView model"
msgstr "Modelo CellView"
-#: ../gtk/gtkcellview.c:216
+#: ../gtk/gtkcellview.c:229
msgid "The model for cell view"
msgstr "El modelo para la vista de celda"
-#: ../gtk/gtkcheckbutton.c:71 ../gtk/gtkcheckmenuitem.c:128
+#: ../gtk/gtkcheckbutton.c:77 ../gtk/gtkcheckmenuitem.c:128
msgid "Indicator Size"
msgstr "Tamaño del indicador"
-#: ../gtk/gtkcheckbutton.c:79 ../gtk/gtkexpander.c:267
+#: ../gtk/gtkcheckbutton.c:85 ../gtk/gtkexpander.c:267
msgid "Indicator Spacing"
msgstr "Espacio del indicador"
-#: ../gtk/gtkcheckbutton.c:80
+#: ../gtk/gtkcheckbutton.c:86
msgid "Spacing around check or radio indicator"
msgstr "Espacio que rodea el indicador de radio o casilla"
@@ -1923,7 +1917,7 @@ msgstr "Espacio que rodea el indicador de radio o casilla"
msgid "Whether the menu item is checked"
msgstr "Indica si el elemento de menú está marcado"
-#: ../gtk/gtkcheckmenuitem.c:113 ../gtk/gtktogglebutton.c:123
+#: ../gtk/gtkcheckmenuitem.c:113 ../gtk/gtktogglebutton.c:133
msgid "Inconsistent"
msgstr "Inconsistente"
@@ -1941,86 +1935,82 @@ msgstr ""
"Indica si la apariencia del elemento de menú es como un elemento de menú de "
"radio"
-#: ../gtk/gtkcolorbutton.c:158
+#: ../gtk/gtkcolorbutton.c:171
msgid "Use alpha"
msgstr "Usar alfa"
-#: ../gtk/gtkcolorbutton.c:159
+#: ../gtk/gtkcolorbutton.c:172
msgid "Whether to give the color an alpha value"
msgstr "Indica si se debe dar un valor alfa al color"
# components/music/nautilus-music-view.c:198
-#: ../gtk/gtkcolorbutton.c:173 ../gtk/gtkfilechooserbutton.c:397
+#: ../gtk/gtkcolorbutton.c:186 ../gtk/gtkfilechooserbutton.c:397
#: ../gtk/gtkfontbutton.c:140 ../gtk/gtkprintjob.c:115
#: ../gtk/gtkstatusicon.c:415 ../gtk/gtktreeviewcolumn.c:286
msgid "Title"
msgstr "Título"
-#: ../gtk/gtkcolorbutton.c:174
+#: ../gtk/gtkcolorbutton.c:187
msgid "The title of the color selection dialog"
msgstr "El título del diálogo de selección del color"
-#: ../gtk/gtkcolorbutton.c:188 ../gtk/gtkcolorsel.c:325
+#: ../gtk/gtkcolorbutton.c:201 ../gtk/gtkcolorsel.c:339
msgid "Current Color"
msgstr "Color actual"
-#: ../gtk/gtkcolorbutton.c:189
+#: ../gtk/gtkcolorbutton.c:202
msgid "The selected color"
msgstr "El color seleccionado"
-#: ../gtk/gtkcolorbutton.c:203 ../gtk/gtkcolorsel.c:332
+#: ../gtk/gtkcolorbutton.c:216 ../gtk/gtkcolorsel.c:346
msgid "Current Alpha"
msgstr "Alfa actual"
-#: ../gtk/gtkcolorbutton.c:204
+#: ../gtk/gtkcolorbutton.c:217
msgid "The selected opacity value (0 fully transparent, 65535 fully opaque)"
msgstr ""
"El valor de opacidad actual (0 es completamente transparente, 65535 es "
"completamente opaco)"
-#: ../gtk/gtkcolorbutton.c:218
-#| msgid "Current Color"
+#: ../gtk/gtkcolorbutton.c:231
msgid "Current RGBA Color"
msgstr "Color RGBA actual"
-#: ../gtk/gtkcolorbutton.c:219
-#| msgid "The selected color"
+#: ../gtk/gtkcolorbutton.c:232
msgid "The selected RGBA color"
msgstr "El color RGBA seleccionado"
-#: ../gtk/gtkcolorsel.c:311
+#: ../gtk/gtkcolorsel.c:325
msgid "Has Opacity Control"
msgstr "Tiene control de opacidad"
-#: ../gtk/gtkcolorsel.c:312
+#: ../gtk/gtkcolorsel.c:326
msgid "Whether the color selector should allow setting opacity"
msgstr "Indica si el selector de color permite seleccionar la opacidad"
-#: ../gtk/gtkcolorsel.c:318
+#: ../gtk/gtkcolorsel.c:332
msgid "Has palette"
msgstr "Tiene paleta"
-#: ../gtk/gtkcolorsel.c:319
+#: ../gtk/gtkcolorsel.c:333
msgid "Whether a palette should be used"
msgstr "Indica si se debe usar una paleta"
-#: ../gtk/gtkcolorsel.c:326
+#: ../gtk/gtkcolorsel.c:340
msgid "The current color"
msgstr "El color actual"
-#: ../gtk/gtkcolorsel.c:333
+#: ../gtk/gtkcolorsel.c:347
msgid "The current opacity value (0 fully transparent, 65535 fully opaque)"
msgstr ""
"El valor de opacidad actual (0 es completamente transparente, 65535 es "
"completamente opaco)"
-#: ../gtk/gtkcolorsel.c:347
-#| msgid "Current Alpha"
+#: ../gtk/gtkcolorsel.c:361
msgid "Current RGBA"
msgstr "RGBA actual"
-#: ../gtk/gtkcolorsel.c:348
-#| msgid "The current color"
+#: ../gtk/gtkcolorsel.c:362
msgid "The current RGBA color"
msgstr "El color RGBA actual"
@@ -2056,98 +2046,98 @@ msgstr "Botón Ayuda"
msgid "The help button of the dialog."
msgstr "El botón Ayuda del diálogo."
-#: ../gtk/gtkcombobox.c:733
+#: ../gtk/gtkcombobox.c:737
msgid "ComboBox model"
msgstr "Modelo de ComboBox"
-#: ../gtk/gtkcombobox.c:734
+#: ../gtk/gtkcombobox.c:738
msgid "The model for the combo box"
msgstr "El modelo para el ComboBox"
-#: ../gtk/gtkcombobox.c:751
+#: ../gtk/gtkcombobox.c:755
msgid "Wrap width for laying out the items in a grid"
msgstr "Ajusta la anchura para distribuir los elementos en una rejilla"
-#: ../gtk/gtkcombobox.c:773
+#: ../gtk/gtkcombobox.c:777
msgid "Row span column"
msgstr "Fila expande columna"
-#: ../gtk/gtkcombobox.c:774
+#: ../gtk/gtkcombobox.c:778
msgid "TreeModel column containing the row span values"
msgstr "Columna TreeModel que contiene los valores de expansión de la fila"
-#: ../gtk/gtkcombobox.c:795
+#: ../gtk/gtkcombobox.c:799
msgid "Column span column"
msgstr "Columna expande columna"
-#: ../gtk/gtkcombobox.c:796
+#: ../gtk/gtkcombobox.c:800
msgid "TreeModel column containing the column span values"
msgstr "Columna TreeModel que contiene los valores de expansión de columna"
-#: ../gtk/gtkcombobox.c:817
+#: ../gtk/gtkcombobox.c:821
msgid "Active item"
msgstr "Elemento activo"
-#: ../gtk/gtkcombobox.c:818
+#: ../gtk/gtkcombobox.c:822
msgid "The item which is currently active"
msgstr "El elemento que está activo actualmente"
-#: ../gtk/gtkcombobox.c:837 ../gtk/gtkuimanager.c:224
+#: ../gtk/gtkcombobox.c:841 ../gtk/gtkuimanager.c:224
msgid "Add tearoffs to menus"
msgstr "Añadir tiradores a los menús"
-#: ../gtk/gtkcombobox.c:838
+#: ../gtk/gtkcombobox.c:842
msgid "Whether dropdowns should have a tearoff menu item"
msgstr "Indica si los desplegables deben tener un tirador en el menú"
-#: ../gtk/gtkcombobox.c:853 ../gtk/gtkentry.c:687
+#: ../gtk/gtkcombobox.c:857 ../gtk/gtkentry.c:778
msgid "Has Frame"
msgstr "Tiene marco"
-#: ../gtk/gtkcombobox.c:854
+#: ../gtk/gtkcombobox.c:858
msgid "Whether the combo box draws a frame around the child"
msgstr "Indica si el ComboBox dibuja un marco alrededor del hijo"
-#: ../gtk/gtkcombobox.c:862
+#: ../gtk/gtkcombobox.c:866
msgid "Whether the combo box grabs focus when it is clicked with the mouse"
msgstr "Indica si el ComboBox obtiene el foco cuando se pulsa con el ratón"
-#: ../gtk/gtkcombobox.c:877 ../gtk/gtkmenu.c:575
+#: ../gtk/gtkcombobox.c:881 ../gtk/gtkmenu.c:576
msgid "Tearoff Title"
msgstr "Título del tirador"
-#: ../gtk/gtkcombobox.c:878
+#: ../gtk/gtkcombobox.c:882
msgid ""
"A title that may be displayed by the window manager when the popup is torn-"
"off"
msgstr ""
"Un título que podría mostrar el gestor de ventanas al desprender el emergente"
-#: ../gtk/gtkcombobox.c:895
+#: ../gtk/gtkcombobox.c:899
msgid "Popup shown"
msgstr "Emergente mostrado"
-#: ../gtk/gtkcombobox.c:896
+#: ../gtk/gtkcombobox.c:900
msgid "Whether the combo's dropdown is shown"
msgstr "Indica si se muestra el desplegable del combo"
-#: ../gtk/gtkcombobox.c:912
+#: ../gtk/gtkcombobox.c:916
msgid "Button Sensitivity"
msgstr "Sensibilidad del botón"
-#: ../gtk/gtkcombobox.c:913
+#: ../gtk/gtkcombobox.c:917
msgid "Whether the dropdown button is sensitive when the model is empty"
msgstr "Indica si el botón desplegable es sensible cunado el modelo está vacío"
-#: ../gtk/gtkcombobox.c:929
+#: ../gtk/gtkcombobox.c:933
msgid "Whether combo box has an entry"
msgstr "Indica si el ComboBox tiene una entrada"
-#: ../gtk/gtkcombobox.c:944
+#: ../gtk/gtkcombobox.c:948
msgid "Entry Text Column"
msgstr "Columna de entrada de texto"
-#: ../gtk/gtkcombobox.c:945
+#: ../gtk/gtkcombobox.c:949
msgid ""
"The column in the combo box's model to associate with strings from the entry "
"if the combo was created with #GtkComboBox:has-entry = %TRUE"
@@ -2155,11 +2145,37 @@ msgstr ""
"La columna en el modelo ce caja combinada para asociar con cadenas de la "
"entrada si la caja combinada se creó con #GtkComboBox:has-entry = %TRUE"
-#: ../gtk/gtkcombobox.c:962
+#: ../gtk/gtkcombobox.c:966
+#| msgid "Columns"
+msgid "ID Column"
+msgstr "ID de la columna"
+
+#: ../gtk/gtkcombobox.c:967
+#| msgid ""
+#| "The column in the combo box's model to associate with strings from the "
+#| "entry if the combo was created with #GtkComboBox:has-entry = %TRUE"
+msgid ""
+"The column in the combo box's model that provides string IDs for the values "
+"in the model"
+msgstr ""
+"La columna en el modelo ce caja combinada que proporciona los ID de cadenas "
+"para los valores en el modelo"
+
+#: ../gtk/gtkcombobox.c:982
+#| msgid "Active"
+msgid "Active id"
+msgstr "ID activo"
+
+#: ../gtk/gtkcombobox.c:983
+#| msgid "The name of the icon from the icon theme"
+msgid "The value of the id column for the active row"
+msgstr "El valor del ID de la columna para la fila activa"
+
+#: ../gtk/gtkcombobox.c:998
msgid "Popup Fixed Width"
msgstr "Anchura fija del emergente"
-#: ../gtk/gtkcombobox.c:963
+#: ../gtk/gtkcombobox.c:999
msgid ""
"Whether the popup's width should be a fixed width matching the allocated "
"width of the combo box"
@@ -2167,29 +2183,29 @@ msgstr ""
"Indica si la anchura del emergente debería ser fija coincidiendo con la "
"anchura reservada para la caja combinada"
-#: ../gtk/gtkcombobox.c:971
+#: ../gtk/gtkcombobox.c:1007
msgid "Appears as list"
msgstr "Aparece como una lista"
-#: ../gtk/gtkcombobox.c:972
+#: ../gtk/gtkcombobox.c:1008
msgid "Whether dropdowns should look like lists rather than menus"
msgstr "Indica si los desplegables se parecen a listas en lugar de menús"
-#: ../gtk/gtkcombobox.c:988
+#: ../gtk/gtkcombobox.c:1024
msgid "Arrow Size"
msgstr "Tamaño de la flecha"
-#: ../gtk/gtkcombobox.c:989
+#: ../gtk/gtkcombobox.c:1025
msgid "The minimum size of the arrow in the combo box"
msgstr "El tamaño mínimo de la flecha en la caja combo"
-#: ../gtk/gtkcombobox.c:1004 ../gtk/gtkentry.c:787 ../gtk/gtkhandlebox.c:182
-#: ../gtk/gtkmenubar.c:189 ../gtk/gtkstatusbar.c:178 ../gtk/gtktoolbar.c:597
-#: ../gtk/gtkviewport.c:148
+#: ../gtk/gtkcombobox.c:1040 ../gtk/gtkentry.c:878 ../gtk/gtkhandlebox.c:188
+#: ../gtk/gtkmenubar.c:196 ../gtk/gtkstatusbar.c:180 ../gtk/gtktoolbar.c:603
+#: ../gtk/gtkviewport.c:154
msgid "Shadow type"
msgstr "Tipo de sombra"
-#: ../gtk/gtkcombobox.c:1005
+#: ../gtk/gtkcombobox.c:1041
msgid "Which kind of shadow to draw around the combo box"
msgstr "Qué clase de sombra dibujar alrededor de la caja combo"
@@ -2251,49 +2267,49 @@ msgstr ""
"Anchura del borde alrededor del área del botón en la parte inferior del "
"diálogo"
-#: ../gtk/gtkentry.c:634
+#: ../gtk/gtkentry.c:725
msgid "Text Buffer"
msgstr "Búfer de texto"
-#: ../gtk/gtkentry.c:635
+#: ../gtk/gtkentry.c:726
msgid "Text buffer object which actually stores entry text"
msgstr "Objeto de búfer de texto que realmente almacena la entrada de texto"
-#: ../gtk/gtkentry.c:642 ../gtk/gtklabel.c:644
+#: ../gtk/gtkentry.c:733 ../gtk/gtklabel.c:662
msgid "Cursor Position"
msgstr "Posición del cursor"
-#: ../gtk/gtkentry.c:643 ../gtk/gtklabel.c:645
+#: ../gtk/gtkentry.c:734 ../gtk/gtklabel.c:663
msgid "The current position of the insertion cursor in chars"
msgstr "La posición actual del cursor de inserción en caracteres"
-#: ../gtk/gtkentry.c:652 ../gtk/gtklabel.c:654
+#: ../gtk/gtkentry.c:743 ../gtk/gtklabel.c:672
msgid "Selection Bound"
msgstr "Límite de selección"
-#: ../gtk/gtkentry.c:653 ../gtk/gtklabel.c:655
+#: ../gtk/gtkentry.c:744 ../gtk/gtklabel.c:673
msgid ""
"The position of the opposite end of the selection from the cursor in chars"
msgstr ""
"La posición en caracteres del extremo opuesto de la selección desde el cursor"
-#: ../gtk/gtkentry.c:663
+#: ../gtk/gtkentry.c:754
msgid "Whether the entry contents can be edited"
msgstr "Indica si los contenidos de la entrada pueden editarse"
-#: ../gtk/gtkentry.c:670 ../gtk/gtkentrybuffer.c:382
+#: ../gtk/gtkentry.c:761 ../gtk/gtkentrybuffer.c:382
msgid "Maximum length"
msgstr "Longitud máxima"
-#: ../gtk/gtkentry.c:671 ../gtk/gtkentrybuffer.c:383
+#: ../gtk/gtkentry.c:762 ../gtk/gtkentrybuffer.c:383
msgid "Maximum number of characters for this entry. Zero if no maximum"
msgstr "Número máximo de caracteres para esta entrada. Cero si no hay máximo"
-#: ../gtk/gtkentry.c:679
+#: ../gtk/gtkentry.c:770
msgid "Visibility"
msgstr "Visibilidad"
-#: ../gtk/gtkentry.c:680
+#: ../gtk/gtkentry.c:771
msgid ""
"FALSE displays the \"invisible char\" instead of the actual text (password "
"mode)"
@@ -2301,32 +2317,32 @@ msgstr ""
"FALSE muestra el «carácter invisible» en lugar del texto actual (modo "
"contraseña)"
-#: ../gtk/gtkentry.c:688
+#: ../gtk/gtkentry.c:779
msgid "FALSE removes outside bevel from entry"
msgstr "FALSE quita el bisel exterior de la entrada"
-#: ../gtk/gtkentry.c:696
+#: ../gtk/gtkentry.c:787
msgid ""
"Border between text and frame. Overrides the inner-border style property"
msgstr ""
"Borde entre el texto y el marco. Toma precedencia sobre la propiedad de "
"estilo del borde interno"
-#: ../gtk/gtkentry.c:703 ../gtk/gtkentry.c:1269
+#: ../gtk/gtkentry.c:794 ../gtk/gtkentry.c:1360
msgid "Invisible character"
msgstr "Carácter invisible"
-#: ../gtk/gtkentry.c:704 ../gtk/gtkentry.c:1270
+#: ../gtk/gtkentry.c:795 ../gtk/gtkentry.c:1361
msgid "The character to use when masking entry contents (in \"password mode\")"
msgstr ""
"El carácter que se usará cuando se enmascaren los contenidos de la entrada "
"(en «modo contraseña»)"
-#: ../gtk/gtkentry.c:711
+#: ../gtk/gtkentry.c:802
msgid "Activates default"
msgstr "Activar predeterminado"
-#: ../gtk/gtkentry.c:712
+#: ../gtk/gtkentry.c:803
msgid ""
"Whether to activate the default widget (such as the default button in a "
"dialog) when Enter is pressed"
@@ -2334,33 +2350,33 @@ msgstr ""
"Indica si se debe activar el widget predeterminado (como el botón "
"predeterminado en un diálogo) cuando se pulse INTRO"
-#: ../gtk/gtkentry.c:718
+#: ../gtk/gtkentry.c:809
msgid "Width in chars"
msgstr "Anchura en caracteres"
-#: ../gtk/gtkentry.c:719
+#: ../gtk/gtkentry.c:810
msgid "Number of characters to leave space for in the entry"
msgstr "Número de caracteres para dejar de espacio en la entrada"
-#: ../gtk/gtkentry.c:728
+#: ../gtk/gtkentry.c:819
msgid "Scroll offset"
msgstr "Desplazamiento del scroll"
-#: ../gtk/gtkentry.c:729
+#: ../gtk/gtkentry.c:820
msgid "Number of pixels of the entry scrolled off the screen to the left"
msgstr ""
"Número de píxeles de la entrada desplazados en scroll fuera de la pantalla "
"hacia la izquierda"
-#: ../gtk/gtkentry.c:739
+#: ../gtk/gtkentry.c:830
msgid "The contents of the entry"
msgstr "El contenido de la entrada"
-#: ../gtk/gtkentry.c:754 ../gtk/gtkmisc.c:81
+#: ../gtk/gtkentry.c:845 ../gtk/gtkmisc.c:81
msgid "X align"
msgstr "X alineación"
-#: ../gtk/gtkentry.c:755 ../gtk/gtkmisc.c:82
+#: ../gtk/gtkentry.c:846 ../gtk/gtkmisc.c:82
msgid ""
"The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL "
"layouts."
@@ -2368,68 +2384,68 @@ msgstr ""
"La alineación horizontal, desde 0 (izquierda) hasta 1 (derecha). Al revés "
"para distribuciones D-->I."
-#: ../gtk/gtkentry.c:771
+#: ../gtk/gtkentry.c:862
msgid "Truncate multiline"
msgstr "Truncar multilínea"
-#: ../gtk/gtkentry.c:772
+#: ../gtk/gtkentry.c:863
msgid "Whether to truncate multiline pastes to one line."
msgstr "Indica si se truncan las pegadas multilíneas a una línea."
-#: ../gtk/gtkentry.c:788
+#: ../gtk/gtkentry.c:879
msgid "Which kind of shadow to draw around the entry when has-frame is set"
msgstr ""
"Qué clase de sombra dibujar alrededor de la entrada cuando has-frame está "
"activado"
-#: ../gtk/gtkentry.c:803 ../gtk/gtktextview.c:740
+#: ../gtk/gtkentry.c:894 ../gtk/gtktextview.c:766
msgid "Overwrite mode"
msgstr "Modo de sobreescritura"
-#: ../gtk/gtkentry.c:804
+#: ../gtk/gtkentry.c:895
msgid "Whether new text overwrites existing text"
msgstr "Indica si el texto introducido sobreescribe el existente"
-#: ../gtk/gtkentry.c:818 ../gtk/gtkentrybuffer.c:367
+#: ../gtk/gtkentry.c:909 ../gtk/gtkentrybuffer.c:367
msgid "Text length"
msgstr "Longitud del texto"
-#: ../gtk/gtkentry.c:819
+#: ../gtk/gtkentry.c:910
msgid "Length of the text currently in the entry"
msgstr "Longitud del texto actualmente en la entrada"
-#: ../gtk/gtkentry.c:834
+#: ../gtk/gtkentry.c:925
msgid "Invisible character set"
msgstr "Conjunto de caracteres invisibles"
-#: ../gtk/gtkentry.c:835
+#: ../gtk/gtkentry.c:926
msgid "Whether the invisible character has been set"
msgstr ""
"Indica si se ha establecido la invisibilidad del conjunto de caracteres"
-#: ../gtk/gtkentry.c:853
+#: ../gtk/gtkentry.c:944
msgid "Caps Lock warning"
msgstr "Advertencia de bloqueo de mayúsculas"
-#: ../gtk/gtkentry.c:854
+#: ../gtk/gtkentry.c:945
msgid "Whether password entries will show a warning when Caps Lock is on"
msgstr ""
"Indica si en las entradas de contraseñas se muestra una advertencia cuando "
"el bloqueo de mayúsculas está activo"
-#: ../gtk/gtkentry.c:868
+#: ../gtk/gtkentry.c:959
msgid "Progress Fraction"
msgstr "Fracción de progreso"
-#: ../gtk/gtkentry.c:869
+#: ../gtk/gtkentry.c:960
msgid "The current fraction of the task that's been completed"
msgstr "La fracción actual completada de la tarea"
-#: ../gtk/gtkentry.c:886
+#: ../gtk/gtkentry.c:977
msgid "Progress Pulse Step"
msgstr "Progreso del paso del pulso"
-#: ../gtk/gtkentry.c:887
+#: ../gtk/gtkentry.c:978
msgid ""
"The fraction of total entry width to move the progress bouncing block for "
"each call to gtk_entry_progress_pulse()"
@@ -2437,169 +2453,169 @@ msgstr ""
"La fracción del ancho total de la entrada para mover el bloque de rebote de "
"progreso para cada llamada a gtk_entry_progress_pulse()"
-#: ../gtk/gtkentry.c:903
+#: ../gtk/gtkentry.c:994
msgid "Primary pixbuf"
msgstr "Pixbuf primario"
-#: ../gtk/gtkentry.c:904
+#: ../gtk/gtkentry.c:995
msgid "Primary pixbuf for the entry"
msgstr "El pixbuf primario para la entrada"
-#: ../gtk/gtkentry.c:918
+#: ../gtk/gtkentry.c:1009
msgid "Secondary pixbuf"
msgstr "Pixbuf secundario"
-#: ../gtk/gtkentry.c:919
+#: ../gtk/gtkentry.c:1010
msgid "Secondary pixbuf for the entry"
msgstr "El pixbuf secundario para la entrada"
-#: ../gtk/gtkentry.c:933
+#: ../gtk/gtkentry.c:1024
msgid "Primary stock ID"
msgstr "ID de almacenamiento primario"
-#: ../gtk/gtkentry.c:934
+#: ../gtk/gtkentry.c:1025
msgid "Stock ID for primary icon"
msgstr "ID de almacenamiento para el icono primario"
-#: ../gtk/gtkentry.c:948
+#: ../gtk/gtkentry.c:1039
msgid "Secondary stock ID"
msgstr "ID de almacenamiento secundario"
-#: ../gtk/gtkentry.c:949
+#: ../gtk/gtkentry.c:1040
msgid "Stock ID for secondary icon"
msgstr "ID de almacenamiento para el icono secundario"
-#: ../gtk/gtkentry.c:963
+#: ../gtk/gtkentry.c:1054
msgid "Primary icon name"
msgstr "Nombre del icono primario"
-#: ../gtk/gtkentry.c:964
+#: ../gtk/gtkentry.c:1055
msgid "Icon name for primary icon"
msgstr "Nombre del icono para el icono primario"
-#: ../gtk/gtkentry.c:978
+#: ../gtk/gtkentry.c:1069
msgid "Secondary icon name"
msgstr "Nombre del icono secundario"
-#: ../gtk/gtkentry.c:979
+#: ../gtk/gtkentry.c:1070
msgid "Icon name for secondary icon"
msgstr "Nombre del icono para el icono secundario"
-#: ../gtk/gtkentry.c:993
+#: ../gtk/gtkentry.c:1084
msgid "Primary GIcon"
msgstr "GIcon primario"
-#: ../gtk/gtkentry.c:994
+#: ../gtk/gtkentry.c:1085
msgid "GIcon for primary icon"
msgstr "GIcon para el icono primario"
-#: ../gtk/gtkentry.c:1008
+#: ../gtk/gtkentry.c:1099
msgid "Secondary GIcon"
msgstr "GIcon secundario"
-#: ../gtk/gtkentry.c:1009
+#: ../gtk/gtkentry.c:1100
msgid "GIcon for secondary icon"
msgstr "GIcon para el icono secundario"
-#: ../gtk/gtkentry.c:1023
+#: ../gtk/gtkentry.c:1114
msgid "Primary storage type"
msgstr "Tipo de almacenamiento primario"
-#: ../gtk/gtkentry.c:1024
+#: ../gtk/gtkentry.c:1115
msgid "The representation being used for primary icon"
msgstr "La representación empleada para el icono primario"
-#: ../gtk/gtkentry.c:1039
+#: ../gtk/gtkentry.c:1130
msgid "Secondary storage type"
msgstr "Tipo de almacenamiento secundario"
-#: ../gtk/gtkentry.c:1040
+#: ../gtk/gtkentry.c:1131
msgid "The representation being used for secondary icon"
msgstr "La representación empleada para el icono secundario"
-#: ../gtk/gtkentry.c:1061
+#: ../gtk/gtkentry.c:1152
msgid "Primary icon activatable"
msgstr "Icono primario activable"
-#: ../gtk/gtkentry.c:1062
+#: ../gtk/gtkentry.c:1153
msgid "Whether the primary icon is activatable"
msgstr "Indica si el icono primario es activable"
-#: ../gtk/gtkentry.c:1082
+#: ../gtk/gtkentry.c:1173
msgid "Secondary icon activatable"
msgstr "Icono secundario activable"
-#: ../gtk/gtkentry.c:1083
+#: ../gtk/gtkentry.c:1174
msgid "Whether the secondary icon is activatable"
msgstr "Indica si el icono secundario es activable"
-#: ../gtk/gtkentry.c:1105
+#: ../gtk/gtkentry.c:1196
msgid "Primary icon sensitive"
msgstr "Sensibilidad del icono primario"
-#: ../gtk/gtkentry.c:1106
+#: ../gtk/gtkentry.c:1197
msgid "Whether the primary icon is sensitive"
msgstr "Indica si el icono primario es sensible"
-#: ../gtk/gtkentry.c:1127
+#: ../gtk/gtkentry.c:1218
msgid "Secondary icon sensitive"
msgstr "Sensibilidad del icono secundario"
-#: ../gtk/gtkentry.c:1128
+#: ../gtk/gtkentry.c:1219
msgid "Whether the secondary icon is sensitive"
msgstr "Indica si el icono secundario es sensible"
-#: ../gtk/gtkentry.c:1144
+#: ../gtk/gtkentry.c:1235
msgid "Primary icon tooltip text"
msgstr "Texto del consejo del icono primario"
-#: ../gtk/gtkentry.c:1145 ../gtk/gtkentry.c:1181
+#: ../gtk/gtkentry.c:1236 ../gtk/gtkentry.c:1272
msgid "The contents of the tooltip on the primary icon"
msgstr "El contenido del consejo para el icono primario"
-#: ../gtk/gtkentry.c:1161
+#: ../gtk/gtkentry.c:1252
msgid "Secondary icon tooltip text"
msgstr "Texto del consejo del icono secundario"
-#: ../gtk/gtkentry.c:1162 ../gtk/gtkentry.c:1200
+#: ../gtk/gtkentry.c:1253 ../gtk/gtkentry.c:1291
msgid "The contents of the tooltip on the secondary icon"
msgstr "El contenido del consejo para el icono secundario"
-#: ../gtk/gtkentry.c:1180
+#: ../gtk/gtkentry.c:1271
msgid "Primary icon tooltip markup"
msgstr "Marcado del consejo del icono primario"
-#: ../gtk/gtkentry.c:1199
+#: ../gtk/gtkentry.c:1290
msgid "Secondary icon tooltip markup"
msgstr "Marcado del consejo del icono secundario"
-#: ../gtk/gtkentry.c:1219 ../gtk/gtktextview.c:768
+#: ../gtk/gtkentry.c:1310 ../gtk/gtktextview.c:794
msgid "IM module"
msgstr "Módulo ME"
-#: ../gtk/gtkentry.c:1220 ../gtk/gtktextview.c:769
+#: ../gtk/gtkentry.c:1311 ../gtk/gtktextview.c:795
msgid "Which IM module should be used"
msgstr "Qué módulo de ME se debe usar"
-#: ../gtk/gtkentry.c:1234
+#: ../gtk/gtkentry.c:1325
msgid "Icon Prelight"
msgstr "Iluminación de icono"
-#: ../gtk/gtkentry.c:1235
+#: ../gtk/gtkentry.c:1326
msgid "Whether activatable icons should prelight when hovered"
msgstr ""
"Indica si los iconos activables deben iluminarse al pasar el ratón sobre "
"ellos"
-#: ../gtk/gtkentry.c:1248
+#: ../gtk/gtkentry.c:1339
msgid "Progress Border"
msgstr "Borde del progreso"
-#: ../gtk/gtkentry.c:1249
+#: ../gtk/gtkentry.c:1340
msgid "Border around the progress bar"
msgstr "Borde alrededor de la barra de progreso"
-#: ../gtk/gtkentry.c:1741
+#: ../gtk/gtkentry.c:1832
msgid "Border between text and frame."
msgstr "Borde entre el texto y el marco."
@@ -2627,7 +2643,7 @@ msgstr "Longitud mínima de clave"
msgid "Minimum length of the search key in order to look up matches"
msgstr "Longitud mínima de la clave de búsqueda para buscar coincidencias"
-#: ../gtk/gtkentrycompletion.c:304 ../gtk/gtkiconview.c:605
+#: ../gtk/gtkentrycompletion.c:304 ../gtk/gtkiconview.c:617
msgid "Text column"
msgstr "Columna de texto"
@@ -2712,11 +2728,11 @@ msgstr "Indica si el expansor ha sido abierto para revelar el widget hijo"
msgid "Text of the expander's label"
msgstr "Texto de la etiqueta del expansor"
-#: ../gtk/gtkexpander.c:225 ../gtk/gtklabel.c:563
+#: ../gtk/gtkexpander.c:225 ../gtk/gtklabel.c:581
msgid "Use markup"
msgstr "Usar marcado"
-#: ../gtk/gtkexpander.c:226 ../gtk/gtklabel.c:564
+#: ../gtk/gtkexpander.c:226 ../gtk/gtklabel.c:582
msgid "The text of the label includes XML markup. See pango_parse_markup()"
msgstr "El texto de la etiqueta incluye marcado XML. Vea pango_parse_markup()"
@@ -2725,7 +2741,7 @@ msgid "Space to put between the label and the child"
msgstr "Espacio para colocar entre la etiqueta y el hijo"
#: ../gtk/gtkexpander.c:243 ../gtk/gtkframe.c:165 ../gtk/gtktoolbutton.c:216
-#: ../gtk/gtktoolitemgroup.c:1578
+#: ../gtk/gtktoolitemgroup.c:1595
msgid "Label widget"
msgstr "Widget etiqueta"
@@ -2743,13 +2759,13 @@ msgstr ""
"Indica si el widget de etiqueta debería llenar todo el espacio horizontal "
"disponible"
-#: ../gtk/gtkexpander.c:258 ../gtk/gtktoolitemgroup.c:1606
-#: ../gtk/gtktreeview.c:766
+#: ../gtk/gtkexpander.c:258 ../gtk/gtktoolitemgroup.c:1623
+#: ../gtk/gtktreeview.c:863
msgid "Expander Size"
msgstr "Tamaño del expansor"
-#: ../gtk/gtkexpander.c:259 ../gtk/gtktoolitemgroup.c:1607
-#: ../gtk/gtktreeview.c:767
+#: ../gtk/gtkexpander.c:259 ../gtk/gtktoolitemgroup.c:1624
+#: ../gtk/gtktreeview.c:864
msgid "Size of the expander arrow"
msgstr "Tamaño de la flecha del expansor"
@@ -2876,19 +2892,19 @@ msgstr ""
"Indica si un selector de archivos en modo distinto a abrir ofrece al usuario "
"la posibilidad de crear carpetas nuevas."
-#: ../gtk/gtkfixed.c:98 ../gtk/gtklayout.c:603
+#: ../gtk/gtkfixed.c:103 ../gtk/gtklayout.c:633
msgid "X position"
msgstr "Posición X"
-#: ../gtk/gtkfixed.c:99 ../gtk/gtklayout.c:604
+#: ../gtk/gtkfixed.c:104 ../gtk/gtklayout.c:634
msgid "X position of child widget"
msgstr "Posición X del widget hijo"
-#: ../gtk/gtkfixed.c:108 ../gtk/gtklayout.c:613
+#: ../gtk/gtkfixed.c:111 ../gtk/gtklayout.c:643
msgid "Y position"
msgstr "Posición Y"
-#: ../gtk/gtkfixed.c:109 ../gtk/gtklayout.c:614
+#: ../gtk/gtkfixed.c:112 ../gtk/gtklayout.c:644
msgid "Y position of child widget"
msgstr "Posición Y del widget hijo"
@@ -2986,23 +3002,23 @@ msgstr "Apariencia del borde del marco"
msgid "A widget to display in place of the usual frame label"
msgstr "Un widget a mostrar en lugar de la usual etiqueta del marco"
-#: ../gtk/gtkhandlebox.c:183
+#: ../gtk/gtkhandlebox.c:189
msgid "Appearance of the shadow that surrounds the container"
msgstr "Apariencia de la sombra que rodea al contenedor"
-#: ../gtk/gtkhandlebox.c:191
+#: ../gtk/gtkhandlebox.c:197
msgid "Handle position"
msgstr "Posición del tirador"
-#: ../gtk/gtkhandlebox.c:192
+#: ../gtk/gtkhandlebox.c:198
msgid "Position of the handle relative to the child widget"
msgstr "Posición del tirador relativa al widget hijo"
-#: ../gtk/gtkhandlebox.c:200
+#: ../gtk/gtkhandlebox.c:206
msgid "Snap edge"
msgstr "Ajustar al borde"
-#: ../gtk/gtkhandlebox.c:201
+#: ../gtk/gtkhandlebox.c:207
msgid ""
"Side of the handlebox that's lined up with the docking point to dock the "
"handlebox"
@@ -3010,11 +3026,11 @@ msgstr ""
"Lado de la caja manipuladora que está alineada con el punto de anclaje para "
"anclar la caja manejadora"
-#: ../gtk/gtkhandlebox.c:209
+#: ../gtk/gtkhandlebox.c:215
msgid "Snap edge set"
msgstr "Ajuste al borde establecido"
-#: ../gtk/gtkhandlebox.c:210
+#: ../gtk/gtkhandlebox.c:216
msgid ""
"Whether to use the value from the snap_edge property or a value derived from "
"handle_position"
@@ -3022,11 +3038,11 @@ msgstr ""
"Indica si se debe usar el valor desde la propiedad snap_edge o un valor "
"derivado de handle_position"
-#: ../gtk/gtkhandlebox.c:217
+#: ../gtk/gtkhandlebox.c:223
msgid "Child Detached"
msgstr "Hijo desacoplado"
-#: ../gtk/gtkhandlebox.c:218
+#: ../gtk/gtkhandlebox.c:224
msgid ""
"A boolean value indicating whether the handlebox's child is attached or "
"detached."
@@ -3034,217 +3050,217 @@ msgstr ""
"Una variable booleana indicando si el hijo del manejador de la caja está "
"acoplado o desacoplado."
-#: ../gtk/gtkiconview.c:568
+#: ../gtk/gtkiconview.c:580
msgid "Selection mode"
msgstr "Modo de selección"
-#: ../gtk/gtkiconview.c:569
+#: ../gtk/gtkiconview.c:581
msgid "The selection mode"
msgstr "El modo de selección"
-#: ../gtk/gtkiconview.c:587
+#: ../gtk/gtkiconview.c:599
msgid "Pixbuf column"
msgstr "Columna de pixbuf"
-#: ../gtk/gtkiconview.c:588
+#: ../gtk/gtkiconview.c:600
msgid "Model column used to retrieve the icon pixbuf from"
msgstr "Columna modelo usada para obtener el pixbuf del icono"
-#: ../gtk/gtkiconview.c:606
+#: ../gtk/gtkiconview.c:618
msgid "Model column used to retrieve the text from"
msgstr "Columna modelo usada para obtener el texto"
-#: ../gtk/gtkiconview.c:625
+#: ../gtk/gtkiconview.c:637
msgid "Markup column"
msgstr "Columna de marcado"
-#: ../gtk/gtkiconview.c:626
+#: ../gtk/gtkiconview.c:638
msgid "Model column used to retrieve the text if using Pango markup"
msgstr "Columna modelo usada para obtener el texto si se usa marcado Pango"
-#: ../gtk/gtkiconview.c:633
+#: ../gtk/gtkiconview.c:645
msgid "Icon View Model"
msgstr "Modelo de vista de icono"
-#: ../gtk/gtkiconview.c:634
+#: ../gtk/gtkiconview.c:646
msgid "The model for the icon view"
msgstr "El modelo para la vista de icono"
-#: ../gtk/gtkiconview.c:650
+#: ../gtk/gtkiconview.c:662
msgid "Number of columns"
msgstr "Número de columnas"
-#: ../gtk/gtkiconview.c:651
+#: ../gtk/gtkiconview.c:663
msgid "Number of columns to display"
msgstr "El número de columnas que se mostrarán"
-#: ../gtk/gtkiconview.c:668
+#: ../gtk/gtkiconview.c:680
msgid "Width for each item"
msgstr "Anchura de cada elemento"
-#: ../gtk/gtkiconview.c:669
+#: ../gtk/gtkiconview.c:681
msgid "The width used for each item"
msgstr "La anchura usada por cada elemento"
-#: ../gtk/gtkiconview.c:685
+#: ../gtk/gtkiconview.c:697
msgid "Space which is inserted between cells of an item"
msgstr "Espacio que se introduce entre las celdas de un elemento"
-#: ../gtk/gtkiconview.c:700
+#: ../gtk/gtkiconview.c:712
msgid "Row Spacing"
msgstr "Espaciado entre filas"
-#: ../gtk/gtkiconview.c:701
+#: ../gtk/gtkiconview.c:713
msgid "Space which is inserted between grid rows"
msgstr "Espacio que se introduce entre las filas de la rejilla"
-#: ../gtk/gtkiconview.c:716
+#: ../gtk/gtkiconview.c:728
msgid "Column Spacing"
msgstr "Espaciado entre columnas"
-#: ../gtk/gtkiconview.c:717
+#: ../gtk/gtkiconview.c:729
msgid "Space which is inserted between grid columns"
msgstr "Espacio que se inserta entre las columnas de la rejilla"
-#: ../gtk/gtkiconview.c:732
+#: ../gtk/gtkiconview.c:744
msgid "Margin"
msgstr "Margen"
-#: ../gtk/gtkiconview.c:733
+#: ../gtk/gtkiconview.c:745
msgid "Space which is inserted at the edges of the icon view"
msgstr "Espacio que se introduce entre los bordes de la vista de icono"
-#: ../gtk/gtkiconview.c:748
+#: ../gtk/gtkiconview.c:760
msgid "Item Orientation"
msgstr "Orientación del elemento"
-#: ../gtk/gtkiconview.c:749
+#: ../gtk/gtkiconview.c:761
msgid ""
"How the text and icon of each item are positioned relative to each other"
msgstr ""
"Cómo se sitúan el texto y el icono para cada elemento relativo a los demás"
-#: ../gtk/gtkiconview.c:765 ../gtk/gtktreeview.c:601
+#: ../gtk/gtkiconview.c:777 ../gtk/gtktreeview.c:698
#: ../gtk/gtktreeviewcolumn.c:329
msgid "Reorderable"
msgstr "Reordenable"
-#: ../gtk/gtkiconview.c:766 ../gtk/gtktreeview.c:602
+#: ../gtk/gtkiconview.c:778 ../gtk/gtktreeview.c:699
msgid "View is reorderable"
msgstr "La vista es reordenable"
-#: ../gtk/gtkiconview.c:773 ../gtk/gtktreeview.c:752
+#: ../gtk/gtkiconview.c:785 ../gtk/gtktreeview.c:849
msgid "Tooltip Column"
msgstr "Columna de consejo"
-#: ../gtk/gtkiconview.c:774
+#: ../gtk/gtkiconview.c:786
msgid "The column in the model containing the tooltip texts for the items"
msgstr ""
"La columna del modelo que contiene los textos de consejo para los elementos"
-#: ../gtk/gtkiconview.c:791
+#: ../gtk/gtkiconview.c:803
msgid "Item Padding"
msgstr "Separación del elemento"
-#: ../gtk/gtkiconview.c:792
+#: ../gtk/gtkiconview.c:804
msgid "Padding around icon view items"
msgstr "Separación alrededor de la vista de iconos"
-#: ../gtk/gtkiconview.c:803
+#: ../gtk/gtkiconview.c:817
msgid "Selection Box Color"
msgstr "Color de la caja de selección"
-#: ../gtk/gtkiconview.c:804
+#: ../gtk/gtkiconview.c:818
msgid "Color of the selection box"
msgstr "Color de la caja de selección"
-#: ../gtk/gtkiconview.c:810
+#: ../gtk/gtkiconview.c:824
msgid "Selection Box Alpha"
msgstr "Alfa de la caja de selección"
-#: ../gtk/gtkiconview.c:811
+#: ../gtk/gtkiconview.c:825
msgid "Opacity of the selection box"
msgstr "Opacidad de la caja de selección"
-#: ../gtk/gtkimage.c:227 ../gtk/gtkstatusicon.c:212
+#: ../gtk/gtkimage.c:233 ../gtk/gtkstatusicon.c:212
msgid "Pixbuf"
msgstr "Pixbuf"
-#: ../gtk/gtkimage.c:228 ../gtk/gtkstatusicon.c:213
+#: ../gtk/gtkimage.c:234 ../gtk/gtkstatusicon.c:213
msgid "A GdkPixbuf to display"
msgstr "Un GdkPixbuf para mostrar"
-#: ../gtk/gtkimage.c:235 ../gtk/gtkrecentmanager.c:294
+#: ../gtk/gtkimage.c:241 ../gtk/gtkrecentmanager.c:294
#: ../gtk/gtkstatusicon.c:220
msgid "Filename"
msgstr "Nombre de archivo"
-#: ../gtk/gtkimage.c:236 ../gtk/gtkstatusicon.c:221
+#: ../gtk/gtkimage.c:242 ../gtk/gtkstatusicon.c:221
msgid "Filename to load and display"
msgstr "Nombre del archivo a cargar y mostrar"
-#: ../gtk/gtkimage.c:245 ../gtk/gtkstatusicon.c:229
+#: ../gtk/gtkimage.c:251 ../gtk/gtkstatusicon.c:229
msgid "Stock ID for a stock image to display"
msgstr "ID de inventario para una imagen de inventario que mostrar"
-#: ../gtk/gtkimage.c:252
+#: ../gtk/gtkimage.c:258
msgid "Icon set"
msgstr "Conjunto de iconos"
-#: ../gtk/gtkimage.c:253
+#: ../gtk/gtkimage.c:259
msgid "Icon set to display"
msgstr "Conjunto de iconos para mostrar"
-#: ../gtk/gtkimage.c:260 ../gtk/gtkscalebutton.c:230 ../gtk/gtktoolbar.c:514
-#: ../gtk/gtktoolpalette.c:976
+#: ../gtk/gtkimage.c:266 ../gtk/gtkscalebutton.c:230 ../gtk/gtktoolbar.c:520
+#: ../gtk/gtktoolpalette.c:1030
msgid "Icon size"
msgstr "Tamaño del icono"
-#: ../gtk/gtkimage.c:261
+#: ../gtk/gtkimage.c:267
msgid "Symbolic size to use for stock icon, icon set or named icon"
msgstr ""
"Tamaño simbólico que usar para el icono de inventario, conjunto de iconos o "
"icono nombrado"
-#: ../gtk/gtkimage.c:277
+#: ../gtk/gtkimage.c:283
msgid "Pixel size"
msgstr "Tamaño del píxel"
-#: ../gtk/gtkimage.c:278
+#: ../gtk/gtkimage.c:284
msgid "Pixel size to use for named icon"
msgstr "Tamaño de píxel que usar para el icono nombrado"
-#: ../gtk/gtkimage.c:286
+#: ../gtk/gtkimage.c:292
msgid "Animation"
msgstr "Animación"
-#: ../gtk/gtkimage.c:287
+#: ../gtk/gtkimage.c:293
msgid "GdkPixbufAnimation to display"
msgstr "GdkPixbufAnimation para mostrar"
-#: ../gtk/gtkimage.c:327 ../gtk/gtkstatusicon.c:260
+#: ../gtk/gtkimage.c:333 ../gtk/gtkstatusicon.c:260
msgid "Storage type"
msgstr "Tipo de almacenamiento"
-#: ../gtk/gtkimage.c:328 ../gtk/gtkstatusicon.c:261
+#: ../gtk/gtkimage.c:334 ../gtk/gtkstatusicon.c:261
msgid "The representation being used for image data"
msgstr "La representación empleada para los datos de la imagen"
-#: ../gtk/gtkimagemenuitem.c:139
+#: ../gtk/gtkimagemenuitem.c:149
msgid "Child widget to appear next to the menu text"
msgstr "Widget hijo que aparecerá al lado del texto del menú"
-#: ../gtk/gtkimagemenuitem.c:154
+#: ../gtk/gtkimagemenuitem.c:164
msgid "Whether to use the label text to create a stock menu item"
msgstr ""
"Indica si se debe usar el texto de la etiqueta para crear un elemento del "
"menú de stock"
-#: ../gtk/gtkimagemenuitem.c:187 ../gtk/gtkmenu.c:535
+#: ../gtk/gtkimagemenuitem.c:197 ../gtk/gtkmenu.c:536
msgid "Accel Group"
msgstr "Grupo de aceleración"
-#: ../gtk/gtkimagemenuitem.c:188
+#: ../gtk/gtkimagemenuitem.c:198
msgid "The Accel Group to use for stock accelerator keys"
msgstr ""
"El grupo de aceleración que usar para los aceleradores de teclado de stock"
@@ -3270,27 +3286,27 @@ msgid "Width of border around the action area"
msgstr "Anchura del borde alrededor del área de acción"
#: ../gtk/gtkinvisible.c:90 ../gtk/gtkmountoperation.c:175
-#: ../gtk/gtkstatusicon.c:279 ../gtk/gtkwindow.c:740
+#: ../gtk/gtkstatusicon.c:279 ../gtk/gtkwindow.c:741
msgid "Screen"
msgstr "Pantalla"
-#: ../gtk/gtkinvisible.c:91 ../gtk/gtkwindow.c:741
+#: ../gtk/gtkinvisible.c:91 ../gtk/gtkwindow.c:742
msgid "The screen where this window will be displayed"
msgstr "La pantalla donde se mostrará esta ventana"
-#: ../gtk/gtklabel.c:550
+#: ../gtk/gtklabel.c:568
msgid "The text of the label"
msgstr "El texto de la etiqueta"
-#: ../gtk/gtklabel.c:557
+#: ../gtk/gtklabel.c:575
msgid "A list of style attributes to apply to the text of the label"
msgstr "Un lista de atributos de estilos para aplicar al texto de la etiqueta"
-#: ../gtk/gtklabel.c:578 ../gtk/gtktexttag.c:335 ../gtk/gtktextview.c:677
+#: ../gtk/gtklabel.c:596 ../gtk/gtktexttag.c:335 ../gtk/gtktextview.c:703
msgid "Justification"
msgstr "Justificación"
-#: ../gtk/gtklabel.c:579
+#: ../gtk/gtklabel.c:597
msgid ""
"The alignment of the lines in the text of the label relative to each other. "
"This does NOT affect the alignment of the label within its allocation. See "
@@ -3300,11 +3316,11 @@ msgstr ""
"Esto NO afecta la alineación de la etiqueta dentro de su ubicación. Ver "
"GtkMisc::xalign para ello"
-#: ../gtk/gtklabel.c:587
+#: ../gtk/gtklabel.c:605
msgid "Pattern"
msgstr "Patrón"
-#: ../gtk/gtklabel.c:588
+#: ../gtk/gtklabel.c:606
msgid ""
"A string with _ characters in positions correspond to characters in the text "
"to underline"
@@ -3312,50 +3328,50 @@ msgstr ""
"Un cadena con caracteres _ en posiciones correspondientes a caracteres en el "
"texto a subrayar"
-#: ../gtk/gtklabel.c:595
+#: ../gtk/gtklabel.c:613
msgid "Line wrap"
msgstr "Ajuste de línea"
-#: ../gtk/gtklabel.c:596
+#: ../gtk/gtklabel.c:614
msgid "If set, wrap lines if the text becomes too wide"
msgstr ""
"Si esta definido, ajustar las líneas si el texto se vuelve demasiado ancho"
-#: ../gtk/gtklabel.c:611
+#: ../gtk/gtklabel.c:629
msgid "Line wrap mode"
msgstr "Modo de ajuste de línea"
-#: ../gtk/gtklabel.c:612
+#: ../gtk/gtklabel.c:630
msgid "If wrap is set, controls how linewrapping is done"
msgstr "Si se establece el ajuste, controla cómo se hace el ajuste de línea"
-#: ../gtk/gtklabel.c:619
+#: ../gtk/gtklabel.c:637
msgid "Selectable"
msgstr "Seleccionable"
-#: ../gtk/gtklabel.c:620
+#: ../gtk/gtklabel.c:638
msgid "Whether the label text can be selected with the mouse"
msgstr "Indica si el texto de la etiqueta puede ser seleccionado con el ratón"
-#: ../gtk/gtklabel.c:626
+#: ../gtk/gtklabel.c:644
msgid "Mnemonic key"
msgstr "Tecla nemónica"
-#: ../gtk/gtklabel.c:627
+#: ../gtk/gtklabel.c:645
msgid "The mnemonic accelerator key for this label"
msgstr "La tecla nemotécnica del acelerador para esta etiqueta"
-#: ../gtk/gtklabel.c:635
+#: ../gtk/gtklabel.c:653
msgid "Mnemonic widget"
msgstr "Widget nemónico"
-#: ../gtk/gtklabel.c:636
+#: ../gtk/gtklabel.c:654
msgid "The widget to be activated when the label's mnemonic key is pressed"
msgstr ""
"El widget que se activará cuando se presione la tecla mnemotécnica de la "
"etiqueta"
-#: ../gtk/gtklabel.c:682
+#: ../gtk/gtklabel.c:700
msgid ""
"The preferred place to ellipsize the string, if the label does not have "
"enough room to display the entire string"
@@ -3363,47 +3379,47 @@ msgstr ""
"El lugar preferido para la elipsis de la cadena, si la etiqueta no tiene "
"suficiente espacio para mostrar la cadena completa"
-#: ../gtk/gtklabel.c:723
+#: ../gtk/gtklabel.c:741
msgid "Single Line Mode"
msgstr "Modo de línea única"
-#: ../gtk/gtklabel.c:724
+#: ../gtk/gtklabel.c:742
msgid "Whether the label is in single line mode"
msgstr "Indica si la etiqueta está en modo de línea única"
-#: ../gtk/gtklabel.c:741
+#: ../gtk/gtklabel.c:759
msgid "Angle"
msgstr "Ángulo"
-#: ../gtk/gtklabel.c:742
+#: ../gtk/gtklabel.c:760
msgid "Angle at which the label is rotated"
msgstr "Ángulo al cual la etiqueta se rota"
-#: ../gtk/gtklabel.c:764
+#: ../gtk/gtklabel.c:782
msgid "The desired maximum width of the label, in characters"
msgstr "La anchura máxima deseada de la etiqueta, en caracteres"
-#: ../gtk/gtklabel.c:782
+#: ../gtk/gtklabel.c:800
msgid "Track visited links"
msgstr "Seguir los enlaces visitados"
-#: ../gtk/gtklabel.c:783
+#: ../gtk/gtklabel.c:801
msgid "Whether visited links should be tracked"
msgstr "Indica si deben seguir los enlaces visitados"
-#: ../gtk/gtklayout.c:627 ../gtk/gtktreeviewcolumn.c:229
+#: ../gtk/gtklayout.c:659 ../gtk/gtktreeviewcolumn.c:229
msgid "Width"
msgstr "Anchura"
-#: ../gtk/gtklayout.c:628
+#: ../gtk/gtklayout.c:660
msgid "The width of the layout"
msgstr "La anchura de la distribución"
-#: ../gtk/gtklayout.c:636
+#: ../gtk/gtklayout.c:668
msgid "Height"
msgstr "Altura"
-#: ../gtk/gtklayout.c:637
+#: ../gtk/gtklayout.c:669
msgid "The height of the layout"
msgstr "La altura de la distribución"
@@ -3423,63 +3439,63 @@ msgstr "Visitado"
msgid "Whether this link has been visited."
msgstr "Indica si este enlace se ha visitado."
-#: ../gtk/gtkmenubar.c:163
+#: ../gtk/gtkmenubar.c:170
msgid "Pack direction"
msgstr "Dirección del empaquetado"
-#: ../gtk/gtkmenubar.c:164
+#: ../gtk/gtkmenubar.c:171
msgid "The pack direction of the menubar"
msgstr "La dirección del empaquetado de la barra de menú"
-#: ../gtk/gtkmenubar.c:180
+#: ../gtk/gtkmenubar.c:187
msgid "Child Pack direction"
msgstr "Dirección de empaquetado del hijo"
-#: ../gtk/gtkmenubar.c:181
+#: ../gtk/gtkmenubar.c:188
msgid "The child pack direction of the menubar"
msgstr "La dirección de empaquetado hijo de la barra de menú"
-#: ../gtk/gtkmenubar.c:190
+#: ../gtk/gtkmenubar.c:197
msgid "Style of bevel around the menubar"
msgstr "Estilo del bisel alrededor de la barra de menús"
-#: ../gtk/gtkmenubar.c:197 ../gtk/gtktoolbar.c:564
+#: ../gtk/gtkmenubar.c:204 ../gtk/gtktoolbar.c:570
msgid "Internal padding"
msgstr "Relleno interno"
-#: ../gtk/gtkmenubar.c:198
+#: ../gtk/gtkmenubar.c:205
msgid "Amount of border space between the menubar shadow and the menu items"
msgstr ""
"Número de espacios del borde entre la sombra de la barra de menús y los "
"elementos del menú"
-#: ../gtk/gtkmenu.c:521
+#: ../gtk/gtkmenu.c:522
msgid "The currently selected menu item"
msgstr "El elemento del menú actualmente seleccionado"
-#: ../gtk/gtkmenu.c:536
+#: ../gtk/gtkmenu.c:537
msgid "The accel group holding accelerators for the menu"
msgstr "El grupo de aceleración que contiene los aceleradores para el menú"
-#: ../gtk/gtkmenu.c:550 ../gtk/gtkmenuitem.c:316
+#: ../gtk/gtkmenu.c:551 ../gtk/gtkmenuitem.c:316
msgid "Accel Path"
msgstr "Ruta del acelerador"
-#: ../gtk/gtkmenu.c:551
+#: ../gtk/gtkmenu.c:552
msgid "An accel path used to conveniently construct accel paths of child items"
msgstr ""
"Una ruta de acelerador usada para construir convenientemente rutas de "
"aceleración de elementos hijo"
-#: ../gtk/gtkmenu.c:567
+#: ../gtk/gtkmenu.c:568
msgid "Attach Widget"
msgstr "Acoplar widget"
-#: ../gtk/gtkmenu.c:568
+#: ../gtk/gtkmenu.c:569
msgid "The widget the menu is attached to"
msgstr "El menú al que está acoplado el widget"
-#: ../gtk/gtkmenu.c:576
+#: ../gtk/gtkmenu.c:577
msgid ""
"A title that may be displayed by the window manager when this menu is torn-"
"off"
@@ -3487,54 +3503,54 @@ msgstr ""
"Un título que podría mostrarse por el administrador de ventanas cuando este "
"menú se desprenda"
-#: ../gtk/gtkmenu.c:590
+#: ../gtk/gtkmenu.c:591
msgid "Tearoff State"
msgstr "Estado de desprendimiento"
-#: ../gtk/gtkmenu.c:591
+#: ../gtk/gtkmenu.c:592
msgid "A boolean that indicates whether the menu is torn-off"
msgstr "Un booleano que indica si el menú ha sido desprendido"
-#: ../gtk/gtkmenu.c:605
+#: ../gtk/gtkmenu.c:606
msgid "Monitor"
msgstr "Monitor"
-#: ../gtk/gtkmenu.c:606
+#: ../gtk/gtkmenu.c:607
msgid "The monitor the menu will be popped up on"
msgstr "El monitor en el que se mostrará el menú"
-#: ../gtk/gtkmenu.c:612
+#: ../gtk/gtkmenu.c:613
msgid "Vertical Padding"
msgstr "Separación vertical"
-#: ../gtk/gtkmenu.c:613
+#: ../gtk/gtkmenu.c:614
msgid "Extra space at the top and bottom of the menu"
msgstr "El espacio adicional en la parte superior e inferior del menú"
-#: ../gtk/gtkmenu.c:635
+#: ../gtk/gtkmenu.c:636
msgid "Reserve Toggle Size"
msgstr "Reservar tamaño para conmutar"
-#: ../gtk/gtkmenu.c:636
+#: ../gtk/gtkmenu.c:637
msgid ""
"A boolean that indicates whether the menu reserves space for toggles and "
"icons"
msgstr ""
"Un booleano que indica si el menú reserva espacio para conmutadores e iconos"
-#: ../gtk/gtkmenu.c:642
+#: ../gtk/gtkmenu.c:643
msgid "Horizontal Padding"
msgstr "Separación horizontal"
-#: ../gtk/gtkmenu.c:643
+#: ../gtk/gtkmenu.c:644
msgid "Extra space at the left and right edges of the menu"
msgstr "El espacio adicional en los bordes derecho e izquierdo del menú"
-#: ../gtk/gtkmenu.c:651
+#: ../gtk/gtkmenu.c:652
msgid "Vertical Offset"
msgstr "Desplazamiento vertical"
-#: ../gtk/gtkmenu.c:652
+#: ../gtk/gtkmenu.c:653
msgid ""
"When the menu is a submenu, position it this number of pixels offset "
"vertically"
@@ -3542,11 +3558,11 @@ msgstr ""
"Cuando el menú es un submenú, colocarlo este número de píxeles de "
"desplazamiento vertical"
-#: ../gtk/gtkmenu.c:660
+#: ../gtk/gtkmenu.c:661
msgid "Horizontal Offset"
msgstr "Desplazamiento horizontal"
-#: ../gtk/gtkmenu.c:661
+#: ../gtk/gtkmenu.c:662
msgid ""
"When the menu is a submenu, position it this number of pixels offset "
"horizontally"
@@ -3554,55 +3570,55 @@ msgstr ""
"Cuando el menú es un submenú, colocarlo este número de píxeles de "
"desplazamiento horizontal"
-#: ../gtk/gtkmenu.c:669
+#: ../gtk/gtkmenu.c:670
msgid "Double Arrows"
msgstr "Dobles flechas"
-#: ../gtk/gtkmenu.c:670
+#: ../gtk/gtkmenu.c:671
msgid "When scrolling, always show both arrows."
msgstr "Al desplazar, siempre mostrar ambas flechas."
-#: ../gtk/gtkmenu.c:683
+#: ../gtk/gtkmenu.c:684
msgid "Arrow Placement"
msgstr "Colocación de flecha"
-#: ../gtk/gtkmenu.c:684
+#: ../gtk/gtkmenu.c:685
msgid "Indicates where scroll arrows should be placed"
msgstr "Indica si las flechas de desplazamiento se deben colocar"
-#: ../gtk/gtkmenu.c:692
+#: ../gtk/gtkmenu.c:693
msgid "Left Attach"
msgstr "Acoplar a la izquierda"
-#: ../gtk/gtkmenu.c:693 ../gtk/gtktable.c:197
+#: ../gtk/gtkmenu.c:694 ../gtk/gtktable.c:202
msgid "The column number to attach the left side of the child to"
msgstr "El número de columnas que acoplar al lado izquierdo del hijo"
-#: ../gtk/gtkmenu.c:700
+#: ../gtk/gtkmenu.c:701
msgid "Right Attach"
msgstr "Acoplar a la derecha"
-#: ../gtk/gtkmenu.c:701
+#: ../gtk/gtkmenu.c:702
msgid "The column number to attach the right side of the child to"
msgstr "El número de columnas que acoplar al lado derecho del hijo"
-#: ../gtk/gtkmenu.c:708
+#: ../gtk/gtkmenu.c:709
msgid "Top Attach"
msgstr "Acoplamiento superior"
-#: ../gtk/gtkmenu.c:709
+#: ../gtk/gtkmenu.c:710
msgid "The row number to attach the top of the child to"
msgstr "El número de filas que acoplar por encima del hijo"
-#: ../gtk/gtkmenu.c:716
+#: ../gtk/gtkmenu.c:717
msgid "Bottom Attach"
msgstr "Acoplamiento inferior"
-#: ../gtk/gtkmenu.c:717 ../gtk/gtktable.c:218
+#: ../gtk/gtkmenu.c:718 ../gtk/gtktable.c:223
msgid "The row number to attach the bottom of the child to"
msgstr "El número de filas que acoplar por debajo del hijo"
-#: ../gtk/gtkmenu.c:731
+#: ../gtk/gtkmenu.c:732
msgid "Arbitrary constant to scale down the size of the scroll arrow"
msgstr ""
"Constante arbitraria para reducir el escalado del tamaño de la flecha de "
@@ -3649,11 +3665,11 @@ msgstr "Anchura en caracteres"
msgid "The minimum desired width of the menu item in characters"
msgstr "La anchura mínima deseada del elemento del menú en caracteres"
-#: ../gtk/gtkmenushell.c:379
+#: ../gtk/gtkmenushell.c:381
msgid "Take Focus"
msgstr "Toma el foco"
-#: ../gtk/gtkmenushell.c:380
+#: ../gtk/gtkmenushell.c:382
msgid "A boolean that determines whether the menu grabs the keyboard focus"
msgstr "Un booleano que indica si el menú obtiene el foco del teclado"
@@ -3777,52 +3793,52 @@ msgstr "Estamos mostrando un diálogo"
msgid "The screen where this window will be displayed."
msgstr "La pantalla donde se mostrará esta ventana."
-#: ../gtk/gtknotebook.c:682
+#: ../gtk/gtknotebook.c:689
msgid "Page"
msgstr "Página"
-#: ../gtk/gtknotebook.c:683
+#: ../gtk/gtknotebook.c:690
msgid "The index of the current page"
msgstr "El índice de la página actual"
-#: ../gtk/gtknotebook.c:691
+#: ../gtk/gtknotebook.c:698
msgid "Tab Position"
msgstr "Posición del tabulador"
-#: ../gtk/gtknotebook.c:692
+#: ../gtk/gtknotebook.c:699
msgid "Which side of the notebook holds the tabs"
msgstr "Qué lado del cuaderno contiene las solapas"
-#: ../gtk/gtknotebook.c:699
+#: ../gtk/gtknotebook.c:706
msgid "Show Tabs"
msgstr "Mostrar solapas"
-#: ../gtk/gtknotebook.c:700
+#: ../gtk/gtknotebook.c:707
msgid "Whether tabs should be shown"
msgstr "Indica si se deben mostrar las solapas"
-#: ../gtk/gtknotebook.c:706
+#: ../gtk/gtknotebook.c:713
msgid "Show Border"
msgstr "Mostrar borde"
-#: ../gtk/gtknotebook.c:707
+#: ../gtk/gtknotebook.c:714
msgid "Whether the border should be shown"
msgstr "Indica si se debe mostrar el borde"
-#: ../gtk/gtknotebook.c:713
+#: ../gtk/gtknotebook.c:720
msgid "Scrollable"
msgstr "Desplazable"
-#: ../gtk/gtknotebook.c:714
+#: ../gtk/gtknotebook.c:721
msgid "If TRUE, scroll arrows are added if there are too many tabs to fit"
msgstr ""
"Si es TRUE, añadir flechas de desplazamiento si no caben todas las solapas"
-#: ../gtk/gtknotebook.c:720
+#: ../gtk/gtknotebook.c:727
msgid "Enable Popup"
msgstr "Activar emergente"
-#: ../gtk/gtknotebook.c:721
+#: ../gtk/gtknotebook.c:728
msgid ""
"If TRUE, pressing the right mouse button on the notebook pops up a menu that "
"you can use to go to a page"
@@ -3830,125 +3846,125 @@ msgstr ""
"Si es TRUE, presionando el botón derecho del ratón en el cuaderno emerge un "
"menú que puede usar para ir a una página"
-#: ../gtk/gtknotebook.c:735
+#: ../gtk/gtknotebook.c:742
msgid "Group Name"
msgstr "Nombre del grupo"
-#: ../gtk/gtknotebook.c:736
+#: ../gtk/gtknotebook.c:743
msgid "Group name for tab drag and drop"
msgstr "Nombre del grupo para el arrastre y suelte de solapas"
-#: ../gtk/gtknotebook.c:743
+#: ../gtk/gtknotebook.c:750
msgid "Tab label"
msgstr "Etiqueta de la solapa"
-#: ../gtk/gtknotebook.c:744
+#: ../gtk/gtknotebook.c:751
msgid "The string displayed on the child's tab label"
msgstr "La cadena mostrada en la etiqueta de la solapa hija"
-#: ../gtk/gtknotebook.c:750
+#: ../gtk/gtknotebook.c:757
msgid "Menu label"
msgstr "Etiqueta de menú"
-#: ../gtk/gtknotebook.c:751
+#: ../gtk/gtknotebook.c:758
msgid "The string displayed in the child's menu entry"
msgstr "La cadena mostrada en la entrada de menú hija"
-#: ../gtk/gtknotebook.c:764
+#: ../gtk/gtknotebook.c:771
msgid "Tab expand"
msgstr "Expansión de la solapa"
-#: ../gtk/gtknotebook.c:765
+#: ../gtk/gtknotebook.c:772
msgid "Whether to expand the child's tab"
msgstr "Indica si se deben expandir la solapas del hijo"
-#: ../gtk/gtknotebook.c:771
+#: ../gtk/gtknotebook.c:778
msgid "Tab fill"
msgstr "Relleno de la solapa"
-#: ../gtk/gtknotebook.c:772
+#: ../gtk/gtknotebook.c:779
msgid "Whether the child's tab should fill the allocated area"
msgstr "Indica si se debe rellenar el área asignada de las solapas hijas "
-#: ../gtk/gtknotebook.c:785
+#: ../gtk/gtknotebook.c:792
msgid "Tab pack type"
msgstr "Tipo de empaquetado de la solapa"
-#: ../gtk/gtknotebook.c:792
+#: ../gtk/gtknotebook.c:799
msgid "Tab reorderable"
msgstr "Solapa reordenable"
-#: ../gtk/gtknotebook.c:793
+#: ../gtk/gtknotebook.c:800
msgid "Whether the tab is reorderable by user action"
msgstr "Indica si la solapa se puede reordenar por una acción del usuario"
-#: ../gtk/gtknotebook.c:799
+#: ../gtk/gtknotebook.c:806
msgid "Tab detachable"
msgstr "Solapa desprendible"
-#: ../gtk/gtknotebook.c:800
+#: ../gtk/gtknotebook.c:807
msgid "Whether the tab is detachable"
msgstr "Indica si la solapa es desprendible"
-#: ../gtk/gtknotebook.c:815 ../gtk/gtkscrollbar.c:105
+#: ../gtk/gtknotebook.c:822 ../gtk/gtkscrollbar.c:105
msgid "Secondary backward stepper"
msgstr "Flecha de retroceso secundaria"
-#: ../gtk/gtknotebook.c:816
+#: ../gtk/gtknotebook.c:823
msgid ""
"Display a second backward arrow button on the opposite end of the tab area"
msgstr ""
"Muestra una segunda flecha de retroceso en el extremo opuesto del área de "
"solapas"
-#: ../gtk/gtknotebook.c:831 ../gtk/gtkscrollbar.c:112
+#: ../gtk/gtknotebook.c:838 ../gtk/gtkscrollbar.c:112
msgid "Secondary forward stepper"
msgstr "Flecha de adelanto secundaria"
-#: ../gtk/gtknotebook.c:832
+#: ../gtk/gtknotebook.c:839
msgid ""
"Display a second forward arrow button on the opposite end of the tab area"
msgstr ""
"Mostrar una segunda flecha de avance en el extremo opuesto del área de "
"solapas"
-#: ../gtk/gtknotebook.c:846 ../gtk/gtkscrollbar.c:91
+#: ../gtk/gtknotebook.c:853 ../gtk/gtkscrollbar.c:91
msgid "Backward stepper"
msgstr "Flecha de retroceso"
-#: ../gtk/gtknotebook.c:847 ../gtk/gtkscrollbar.c:92
+#: ../gtk/gtknotebook.c:854 ../gtk/gtkscrollbar.c:92
msgid "Display the standard backward arrow button"
msgstr "Mostrar el botón estándar de flecha de retroceso"
-#: ../gtk/gtknotebook.c:861 ../gtk/gtkscrollbar.c:98
+#: ../gtk/gtknotebook.c:868 ../gtk/gtkscrollbar.c:98
msgid "Forward stepper"
msgstr "Flecha de avance"
-#: ../gtk/gtknotebook.c:862 ../gtk/gtkscrollbar.c:99
+#: ../gtk/gtknotebook.c:869 ../gtk/gtkscrollbar.c:99
msgid "Display the standard forward arrow button"
msgstr "Mostrar el botón estándar de flecha de avance"
-#: ../gtk/gtknotebook.c:876
+#: ../gtk/gtknotebook.c:883
msgid "Tab overlap"
msgstr "Solapamiento de la solapa"
-#: ../gtk/gtknotebook.c:877
+#: ../gtk/gtknotebook.c:884
msgid "Size of tab overlap area"
msgstr "Tamaño del área de solapamiento de la solapa"
-#: ../gtk/gtknotebook.c:892
+#: ../gtk/gtknotebook.c:899
msgid "Tab curvature"
msgstr "Curvatura de la solapa"
-#: ../gtk/gtknotebook.c:893
+#: ../gtk/gtknotebook.c:900
msgid "Size of tab curvature"
msgstr "Tamaño de la curvatura de la solapa"
-#: ../gtk/gtknotebook.c:909
+#: ../gtk/gtknotebook.c:916
msgid "Arrow spacing"
msgstr "Espaciado de las flechas"
-#: ../gtk/gtknotebook.c:910
+#: ../gtk/gtknotebook.c:917
msgid "Scroll arrow spacing"
msgstr "Espaciado del desplazamiento de las flechas"
@@ -3961,58 +3977,58 @@ msgstr "Orientación"
msgid "The orientation of the orientable"
msgstr "La orientación del orientable"
-#: ../gtk/gtkpaned.c:272
+#: ../gtk/gtkpaned.c:328
msgid ""
"Position of paned separator in pixels (0 means all the way to the left/top)"
msgstr ""
"Posición del separador cada hoja de la ventana en píxeles (0 significa todo "
"el trayecto hacia la izquierda/arriba) "
-#: ../gtk/gtkpaned.c:281
+#: ../gtk/gtkpaned.c:337
msgid "Position Set"
msgstr "Posición establecida"
-#: ../gtk/gtkpaned.c:282
+#: ../gtk/gtkpaned.c:338
msgid "TRUE if the Position property should be used"
msgstr "TRUE si debe usarse la propiedad «Posición»"
-#: ../gtk/gtkpaned.c:288
+#: ../gtk/gtkpaned.c:344
msgid "Handle Size"
msgstr "Tamaño del tirador"
-#: ../gtk/gtkpaned.c:289
+#: ../gtk/gtkpaned.c:345
msgid "Width of handle"
msgstr "Anchura del tirador"
-#: ../gtk/gtkpaned.c:305
+#: ../gtk/gtkpaned.c:361
msgid "Minimal Position"
msgstr "Posición mínima"
-#: ../gtk/gtkpaned.c:306
+#: ../gtk/gtkpaned.c:362
msgid "Smallest possible value for the \"position\" property"
msgstr "El valor más pequeño posible para la propiedad \"position\""
-#: ../gtk/gtkpaned.c:323
+#: ../gtk/gtkpaned.c:379
msgid "Maximal Position"
msgstr "Posición máxima"
-#: ../gtk/gtkpaned.c:324
+#: ../gtk/gtkpaned.c:380
msgid "Largest possible value for the \"position\" property"
msgstr "El valor más grande posible para la propiedad \"posicion\""
-#: ../gtk/gtkpaned.c:341
+#: ../gtk/gtkpaned.c:397
msgid "Resize"
msgstr "Redimensionar"
-#: ../gtk/gtkpaned.c:342
+#: ../gtk/gtkpaned.c:398
msgid "If TRUE, the child expands and shrinks along with the paned widget"
msgstr "Si es TRUE, el hijo se expande y encoge junto con el widget dividido"
-#: ../gtk/gtkpaned.c:357
+#: ../gtk/gtkpaned.c:413
msgid "Shrink"
msgstr "Encoger"
-#: ../gtk/gtkpaned.c:358
+#: ../gtk/gtkpaned.c:414
msgid "If TRUE, the child can be made smaller than its requisition"
msgstr "Si es TRUE, el hijo puede hacerse más pequeño que sus requisitos"
@@ -4339,36 +4355,36 @@ msgstr ""
"TRUE si los combos de configuración de página están empotrados en "
"GtkPrintUnixDialog"
-#: ../gtk/gtkprogressbar.c:129
+#: ../gtk/gtkprogressbar.c:161
msgid "Fraction"
msgstr "Fracción"
-#: ../gtk/gtkprogressbar.c:130
+#: ../gtk/gtkprogressbar.c:162
msgid "The fraction of total work that has been completed"
msgstr "La fracción del trabajo total que ha sido completado"
-#: ../gtk/gtkprogressbar.c:137
+#: ../gtk/gtkprogressbar.c:169
msgid "Pulse Step"
msgstr "Paso del pulso"
-#: ../gtk/gtkprogressbar.c:138
+#: ../gtk/gtkprogressbar.c:170
msgid "The fraction of total progress to move the bouncing block when pulsed"
msgstr ""
"La fracción del progreso total para mover el bloque rebotador cuando se pulsa"
-#: ../gtk/gtkprogressbar.c:146
+#: ../gtk/gtkprogressbar.c:178
msgid "Text to be displayed in the progress bar"
msgstr "Texto que se mostrará en la barra de progreso"
-#: ../gtk/gtkprogressbar.c:153
+#: ../gtk/gtkprogressbar.c:185
msgid "Show text"
msgstr "Mostrar texto"
-#: ../gtk/gtkprogressbar.c:154
+#: ../gtk/gtkprogressbar.c:186
msgid "Whether the progress is shown as text."
msgstr "Indica si el progreso se muestra como texto."
-#: ../gtk/gtkprogressbar.c:176
+#: ../gtk/gtkprogressbar.c:208
msgid ""
"The preferred place to ellipsize the string, if the progress bar does not "
"have enough room to display the entire string, if at all."
@@ -4376,51 +4392,51 @@ msgstr ""
"El lugar preferido para la elipsis de la cadena, si la barra de progreso no "
"tiene suficiente espacio para mostrar la cadena completa."
-#: ../gtk/gtkprogressbar.c:183
+#: ../gtk/gtkprogressbar.c:215
msgid "X spacing"
msgstr "Espaciado X"
-#: ../gtk/gtkprogressbar.c:184
+#: ../gtk/gtkprogressbar.c:216
msgid "Extra spacing applied to the width of a progress bar."
msgstr "Espacio extra aplicado a la anchura de una barra de progreso."
-#: ../gtk/gtkprogressbar.c:189
+#: ../gtk/gtkprogressbar.c:221
msgid "Y spacing"
msgstr "Espaciado Y"
-#: ../gtk/gtkprogressbar.c:190
+#: ../gtk/gtkprogressbar.c:222
msgid "Extra spacing applied to the height of a progress bar."
msgstr "Espacio adicional aplicado a la altura >de una barra de progreso."
-#: ../gtk/gtkprogressbar.c:203
+#: ../gtk/gtkprogressbar.c:235
msgid "Minimum horizontal bar width"
msgstr "Anchura mínima de la barra horizontal"
-#: ../gtk/gtkprogressbar.c:204
+#: ../gtk/gtkprogressbar.c:236
msgid "The minimum horizontal width of the progress bar"
msgstr "La anchura mínima horizontal de la barra de progreso"
-#: ../gtk/gtkprogressbar.c:216
+#: ../gtk/gtkprogressbar.c:248
msgid "Minimum horizontal bar height"
msgstr "Altura mínima de la barra horizontal"
-#: ../gtk/gtkprogressbar.c:217
+#: ../gtk/gtkprogressbar.c:249
msgid "Minimum horizontal height of the progress bar"
msgstr "La altura mínima horizontal de la barra de progreso"
-#: ../gtk/gtkprogressbar.c:229
+#: ../gtk/gtkprogressbar.c:261
msgid "Minimum vertical bar width"
msgstr "Anchura mínima horizontal de la barra"
-#: ../gtk/gtkprogressbar.c:230
+#: ../gtk/gtkprogressbar.c:262
msgid "The minimum vertical width of the progress bar"
msgstr "La anchura mínima vertical de la barra de progreso"
-#: ../gtk/gtkprogressbar.c:242
+#: ../gtk/gtkprogressbar.c:274
msgid "Minimum vertical bar height"
msgstr "Altura mínima vertical de la barra"
-#: ../gtk/gtkprogressbar.c:243
+#: ../gtk/gtkprogressbar.c:275
msgid "The minimum vertical height of the progress bar"
msgstr "La altura mínima vertical de la barra de progreso"
@@ -4436,7 +4452,7 @@ msgstr ""
"El valor devuelto por gtk_radio_action_get_current_value() cuando esta "
"acción es la acción actual de su grupo."
-#: ../gtk/gtkradioaction.c:135 ../gtk/gtkradiobutton.c:160
+#: ../gtk/gtkradioaction.c:135 ../gtk/gtkradiobutton.c:163
#: ../gtk/gtkradiomenuitem.c:373 ../gtk/gtkradiotoolbutton.c:65
msgid "Group"
msgstr "Grupo"
@@ -4457,7 +4473,7 @@ msgstr ""
"La propiedad del valor del miembro actualmente activo del grupo al que esta "
"acción pertenece."
-#: ../gtk/gtkradiobutton.c:161
+#: ../gtk/gtkradiobutton.c:164
msgid "The radio button whose group this widget belongs to."
msgstr "El botón de radio a cuyo grupo pertenece este widget."
@@ -4469,29 +4485,29 @@ msgstr "El elemento del menú de radio a cuyo grupo pertenece este widget."
msgid "The radio tool button whose group this button belongs to."
msgstr "La herramienta de botón de radio a cuyo grupo pertenece este widget."
-#: ../gtk/gtkrange.c:416
+#: ../gtk/gtkrange.c:423
msgid "Update policy"
msgstr "Política de actualización"
-#: ../gtk/gtkrange.c:417
+#: ../gtk/gtkrange.c:424
msgid "How the range should be updated on the screen"
msgstr "Cómo se debe actualizar el rango en la pantalla"
-#: ../gtk/gtkrange.c:426
+#: ../gtk/gtkrange.c:433
msgid "The GtkAdjustment that contains the current value of this range object"
msgstr "El GtkAdjustment que contiene el valor actual de este objeto de rango"
-#: ../gtk/gtkrange.c:434
+#: ../gtk/gtkrange.c:441
msgid "Invert direction slider moves to increase range value"
msgstr ""
"Invierte la dirección en que se mueve el deslizador para incrementar el "
"valor del rango"
-#: ../gtk/gtkrange.c:441
+#: ../gtk/gtkrange.c:448
msgid "Lower stepper sensitivity"
msgstr "Sensibilidad de la flecha inferior"
-#: ../gtk/gtkrange.c:442
+#: ../gtk/gtkrange.c:449
msgid ""
"The sensitivity policy for the stepper that points to the adjustment's lower "
"side"
@@ -4499,11 +4515,11 @@ msgstr ""
"La directiva de sensibilidad del botón de desplazamiento que apunta al lado "
"más bajo del ajuste"
-#: ../gtk/gtkrange.c:450
+#: ../gtk/gtkrange.c:457
msgid "Upper stepper sensitivity"
msgstr "Sensibilidad de la flecha superior"
-#: ../gtk/gtkrange.c:451
+#: ../gtk/gtkrange.c:458
msgid ""
"The sensitivity policy for the stepper that points to the adjustment's upper "
"side"
@@ -4511,91 +4527,91 @@ msgstr ""
"La directiva de sensibilidad del botón de flecha que apunta al lado más alto "
"del ajuste"
-#: ../gtk/gtkrange.c:468
+#: ../gtk/gtkrange.c:475
msgid "Show Fill Level"
msgstr "Mostrar nivel de relleno"
-#: ../gtk/gtkrange.c:469
+#: ../gtk/gtkrange.c:476
msgid "Whether to display a fill level indicator graphics on trough."
msgstr ""
"Indica si se debe mostrar el indicador de nivel de llenado en los gráficos "
"mientras se llena."
-#: ../gtk/gtkrange.c:485
+#: ../gtk/gtkrange.c:492
msgid "Restrict to Fill Level"
msgstr "Restringir al nivel de llenado"
-#: ../gtk/gtkrange.c:486
+#: ../gtk/gtkrange.c:493
msgid "Whether to restrict the upper boundary to the fill level."
msgstr "Indica si se debe restringir el borde superior al nivel de llenado."
-#: ../gtk/gtkrange.c:501
+#: ../gtk/gtkrange.c:508
msgid "Fill Level"
msgstr "Nivel de llenado"
-#: ../gtk/gtkrange.c:502
+#: ../gtk/gtkrange.c:509
msgid "The fill level."
msgstr "El nivel de llenado."
-#: ../gtk/gtkrange.c:510
+#: ../gtk/gtkrange.c:517 ../gtk/gtkswitch.c:773
msgid "Slider Width"
msgstr "Anchura del deslizador"
-#: ../gtk/gtkrange.c:511
+#: ../gtk/gtkrange.c:518
msgid "Width of scrollbar or scale thumb"
msgstr "Anchura de la barra de desplazamiento o escala de miniatura"
-#: ../gtk/gtkrange.c:518
+#: ../gtk/gtkrange.c:525
msgid "Trough Border"
msgstr "Borde del carril"
-#: ../gtk/gtkrange.c:519
+#: ../gtk/gtkrange.c:526
msgid "Spacing between thumb/steppers and outer trough bevel"
msgstr ""
"Espaciado entre la marcador/flechas de desplazamiento y el bisel exterior "
"del carril"
-#: ../gtk/gtkrange.c:526
+#: ../gtk/gtkrange.c:533
msgid "Stepper Size"
msgstr "Tamaño del botón de flecha de desplazamiento"
-#: ../gtk/gtkrange.c:527
+#: ../gtk/gtkrange.c:534
msgid "Length of step buttons at ends"
msgstr "Longitud de los botones de flecha en los extremos"
-#: ../gtk/gtkrange.c:542
+#: ../gtk/gtkrange.c:549
msgid "Stepper Spacing"
msgstr "Espaciado de los botones de flecha de desplazamiento"
-#: ../gtk/gtkrange.c:543
+#: ../gtk/gtkrange.c:550
msgid "Spacing between step buttons and thumb"
msgstr "Espaciado entre los botones de flecha de desplazamiento y el marcador"
-#: ../gtk/gtkrange.c:550
+#: ../gtk/gtkrange.c:557
msgid "Arrow X Displacement"
msgstr "Desplazamiento de la flecha X"
-#: ../gtk/gtkrange.c:551
+#: ../gtk/gtkrange.c:558
msgid ""
"How far in the x direction to move the arrow when the button is depressed"
msgstr ""
"Distancia en la dirección «X» para mover la flecha cuando se suelta el botón "
-#: ../gtk/gtkrange.c:558
+#: ../gtk/gtkrange.c:565
msgid "Arrow Y Displacement"
msgstr "Desplazamiento de la flecha Y"
-#: ../gtk/gtkrange.c:559
+#: ../gtk/gtkrange.c:566
msgid ""
"How far in the y direction to move the arrow when the button is depressed"
msgstr ""
"Distancia en la dirección «Y» para mover la flecha cuando se suelta el botón "
-#: ../gtk/gtkrange.c:577
+#: ../gtk/gtkrange.c:584
msgid "Trough Under Steppers"
msgstr "Carril bajo las flechas de deslizamiento"
-#: ../gtk/gtkrange.c:578
+#: ../gtk/gtkrange.c:585
msgid ""
"Whether to draw trough for full length of range or exclude the steppers and "
"spacing"
@@ -4603,11 +4619,11 @@ msgstr ""
"Indica si se debe dibujar para la longitud completa del rango o excluir las "
"flechas de desplazamiento y el espaciado"
-#: ../gtk/gtkrange.c:591
+#: ../gtk/gtkrange.c:598
msgid "Arrow scaling"
msgstr "Escalado de flechas"
-#: ../gtk/gtkrange.c:592
+#: ../gtk/gtkrange.c:599
msgid "Arrow scaling with regard to scroll button size"
msgstr ""
"Escalado de flechas en consideración con el tamaño del botón de "
@@ -4703,42 +4719,6 @@ msgstr "La ruta completa al archivo a usar para almacenar y leer la lista"
msgid "The size of the recently used resources list"
msgstr "El tamaño de la lista de recursos usados recientemente"
-#: ../gtk/gtkruler.c:138
-msgid "Lower"
-msgstr "Inferior"
-
-#: ../gtk/gtkruler.c:139
-msgid "Lower limit of ruler"
-msgstr "Límite inferior de la regla"
-
-#: ../gtk/gtkruler.c:148
-msgid "Upper"
-msgstr "Superior"
-
-#: ../gtk/gtkruler.c:149
-msgid "Upper limit of ruler"
-msgstr "Límite superior de la regla"
-
-#: ../gtk/gtkruler.c:159
-msgid "Position of mark on the ruler"
-msgstr "Posición de la etiqueta en la regla"
-
-#: ../gtk/gtkruler.c:168
-msgid "Max Size"
-msgstr "Tamaño máximo"
-
-#: ../gtk/gtkruler.c:169
-msgid "Maximum size of the ruler"
-msgstr "Tamaño máximo de la regla"
-
-#: ../gtk/gtkruler.c:184
-msgid "Metric"
-msgstr "Métrica"
-
-#: ../gtk/gtkruler.c:185
-msgid "The metric used for the ruler"
-msgstr "La métrica de la regla"
-
#: ../gtk/gtkscalebutton.c:221
msgid "The value of the scale"
msgstr "El valor de la escala"
@@ -4762,40 +4742,40 @@ msgstr "Iconos"
msgid "List of icon names"
msgstr "Lista de nombres de iconos"
-#: ../gtk/gtkscale.c:245
+#: ../gtk/gtkscale.c:250
msgid "The number of decimal places that are displayed in the value"
msgstr "El número de lugares decimales que se mostrarán en el valor"
-#: ../gtk/gtkscale.c:254
+#: ../gtk/gtkscale.c:259
msgid "Draw Value"
msgstr "Dibujar valor"
-#: ../gtk/gtkscale.c:255
+#: ../gtk/gtkscale.c:260
msgid "Whether the current value is displayed as a string next to the slider"
msgstr ""
"Indica si el valor actual se muestra como una cadena contigua al deslizador"
-#: ../gtk/gtkscale.c:262
+#: ../gtk/gtkscale.c:267
msgid "Value Position"
msgstr "Posición del valor"
-#: ../gtk/gtkscale.c:263
+#: ../gtk/gtkscale.c:268
msgid "The position in which the current value is displayed"
msgstr "La posición en que se muestra el valor actual"
-#: ../gtk/gtkscale.c:270
+#: ../gtk/gtkscale.c:275
msgid "Slider Length"
msgstr "Longitud del deslizador"
-#: ../gtk/gtkscale.c:271
+#: ../gtk/gtkscale.c:276
msgid "Length of scale's slider"
msgstr "Longitud de la escala del deslizador"
-#: ../gtk/gtkscale.c:279
+#: ../gtk/gtkscale.c:284
msgid "Value spacing"
msgstr "Espaciado del valor"
-#: ../gtk/gtkscale.c:280
+#: ../gtk/gtkscale.c:285
msgid "Space between value text and the slider/trough area"
msgstr "Espacio entre el texto del valor y el área del deslizador/carril"
@@ -4913,7 +4893,6 @@ msgstr ""
"Número de píxeles entre las barras de desplazamiento y la ventana enrollada"
#: ../gtk/gtkscrolledwindow.c:383
-#| msgid "Minimum Width"
msgid "Minimum Content Width"
msgstr "Anchura mínima del contenido"
@@ -4923,7 +4902,6 @@ msgstr ""
"La anchura mínima que la ventana desplazada reservará para su contenido"
#: ../gtk/gtkscrolledwindow.c:390
-#| msgid "Minimum child height"
msgid "Minimum Content Height"
msgstr "Altura mínima del contenido"
@@ -4932,19 +4910,19 @@ msgid ""
"The minimum height that the scrolled window will allocate to its content"
msgstr "La altura mínima que la ventana desplazada reservará para su contenido"
-#: ../gtk/gtkseparatortoolitem.c:138
+#: ../gtk/gtkseparatortoolitem.c:143
msgid "Draw"
msgstr "Dibujar"
-#: ../gtk/gtkseparatortoolitem.c:139
+#: ../gtk/gtkseparatortoolitem.c:144
msgid "Whether the separator is drawn, or just blank"
msgstr "Indica si el separador se dibuja, o sólo se deja en blanco"
-#: ../gtk/gtksettings.c:241
+#: ../gtk/gtksettings.c:277
msgid "Double Click Time"
msgstr "Tiempo del doble pulsación"
-#: ../gtk/gtksettings.c:242
+#: ../gtk/gtksettings.c:278
msgid ""
"Maximum time allowed between two clicks for them to be considered a double "
"click (in milliseconds)"
@@ -4952,11 +4930,11 @@ msgstr ""
"Tiempo máximo permitido entre dos pulsaciones para ser considerados como una "
"pulsación doble (en milisegundos)"
-#: ../gtk/gtksettings.c:249
+#: ../gtk/gtksettings.c:285
msgid "Double Click Distance"
msgstr "Distancia de la pulsación doble"
-#: ../gtk/gtksettings.c:250
+#: ../gtk/gtksettings.c:286
msgid ""
"Maximum distance allowed between two clicks for them to be considered a "
"double click (in pixels)"
@@ -4964,35 +4942,35 @@ msgstr ""
"Distancia máxima permitida entre dos pulsaciones para ser considerados como "
"una pulsación doble (en píxeles)"
-#: ../gtk/gtksettings.c:266
+#: ../gtk/gtksettings.c:302
msgid "Cursor Blink"
msgstr "Parpadeo del cursor"
-#: ../gtk/gtksettings.c:267
+#: ../gtk/gtksettings.c:303
msgid "Whether the cursor should blink"
msgstr "Indica si el cursor debe parpadear"
-#: ../gtk/gtksettings.c:274
+#: ../gtk/gtksettings.c:310
msgid "Cursor Blink Time"
msgstr "Tiempo de parpadeo del cursor"
-#: ../gtk/gtksettings.c:275
+#: ../gtk/gtksettings.c:311
msgid "Length of the cursor blink cycle, in milliseconds"
msgstr "Longitud del ciclo de parpadeo del cursor, en milisegundos"
-#: ../gtk/gtksettings.c:294
+#: ../gtk/gtksettings.c:330
msgid "Cursor Blink Timeout"
msgstr "Intervalo de parpadeo del cursor"
-#: ../gtk/gtksettings.c:295
+#: ../gtk/gtksettings.c:331
msgid "Time after which the cursor stops blinking, in seconds"
msgstr "Tiempo tras el que el cursor para de parpadear, en segundos"
-#: ../gtk/gtksettings.c:302
+#: ../gtk/gtksettings.c:338
msgid "Split Cursor"
msgstr "Dividir cursor"
-#: ../gtk/gtksettings.c:303
+#: ../gtk/gtksettings.c:339
msgid ""
"Whether two cursors should be displayed for mixed left-to-right and right-to-"
"left text"
@@ -5000,161 +4978,161 @@ msgstr ""
"Indica si deben mostrarse dos cursores para el texto mezclado de izquierda-a-"
"derecha y derecha-a-izquierda"
-#: ../gtk/gtksettings.c:310
+#: ../gtk/gtksettings.c:346
msgid "Theme Name"
msgstr "Nombre del tema"
-#: ../gtk/gtksettings.c:311
+#: ../gtk/gtksettings.c:347
msgid "Name of theme RC file to load"
msgstr "Nombre del archivo RC de tema que cargar"
-#: ../gtk/gtksettings.c:319
+#: ../gtk/gtksettings.c:355
msgid "Icon Theme Name"
msgstr "Nombre del tema de iconos"
-#: ../gtk/gtksettings.c:320
+#: ../gtk/gtksettings.c:356
msgid "Name of icon theme to use"
msgstr "Nombre del tema de iconos que utilizar"
-#: ../gtk/gtksettings.c:328
+#: ../gtk/gtksettings.c:364
msgid "Fallback Icon Theme Name"
msgstr "Nombre del tema de iconos de resguardo"
-#: ../gtk/gtksettings.c:329
+#: ../gtk/gtksettings.c:365
msgid "Name of a icon theme to fall back to"
msgstr "Nombre del tema de iconos que utilizar como resguardo"
-#: ../gtk/gtksettings.c:337
+#: ../gtk/gtksettings.c:373
msgid "Key Theme Name"
msgstr "Nombre del tema de teclas"
-#: ../gtk/gtksettings.c:338
+#: ../gtk/gtksettings.c:374
msgid "Name of key theme RC file to load"
msgstr "Nombre del archivo RC de tema de teclas que cargar"
-#: ../gtk/gtksettings.c:346
+#: ../gtk/gtksettings.c:382
msgid "Menu bar accelerator"
msgstr "Acelerador de la barra de menús"
-#: ../gtk/gtksettings.c:347
+#: ../gtk/gtksettings.c:383
msgid "Keybinding to activate the menu bar"
msgstr "Combinación de teclas para activar la barra de menús"
-#: ../gtk/gtksettings.c:355
+#: ../gtk/gtksettings.c:391
msgid "Drag threshold"
msgstr "Umbral del arrastre"
-#: ../gtk/gtksettings.c:356
+#: ../gtk/gtksettings.c:392
msgid "Number of pixels the cursor can move before dragging"
msgstr ""
"Número de píxeles que el cursor puede mover antes de iniciar el arrastre"
-#: ../gtk/gtksettings.c:364
+#: ../gtk/gtksettings.c:400
msgid "Font Name"
msgstr "Nombre de la tipografía"
-#: ../gtk/gtksettings.c:365
+#: ../gtk/gtksettings.c:401
msgid "Name of default font to use"
msgstr "Nombre de la tipografía predeterminada a utilizar"
-#: ../gtk/gtksettings.c:387
+#: ../gtk/gtksettings.c:423
msgid "Icon Sizes"
msgstr "Tamaños de los iconos"
-#: ../gtk/gtksettings.c:388
+#: ../gtk/gtksettings.c:424
msgid "List of icon sizes (gtk-menu=16,16:gtk-button=20,20..."
msgstr "Lista de tamaños de los iconos (gtk-menu=16,16:gtk-button=20,20..."
-#: ../gtk/gtksettings.c:396
+#: ../gtk/gtksettings.c:432
msgid "GTK Modules"
msgstr "Módulos GTK"
-#: ../gtk/gtksettings.c:397
+#: ../gtk/gtksettings.c:433
msgid "List of currently active GTK modules"
msgstr "Lista de módulos GTK activos actualmente"
-#: ../gtk/gtksettings.c:406
+#: ../gtk/gtksettings.c:442
msgid "Xft Antialias"
msgstr "Suavizado Xft"
-#: ../gtk/gtksettings.c:407
+#: ../gtk/gtksettings.c:443
msgid "Whether to antialias Xft fonts; 0=no, 1=yes, -1=default"
msgstr ""
"Indica si se deben suavizar los bordes de las tipografías Xft; 0=no,1=sí, "
"-1=predeterminado"
-#: ../gtk/gtksettings.c:416
+#: ../gtk/gtksettings.c:452
msgid "Xft Hinting"
msgstr "Sugerencias Xft"
-#: ../gtk/gtksettings.c:417
+#: ../gtk/gtksettings.c:453
msgid "Whether to hint Xft fonts; 0=no, 1=yes, -1=default"
msgstr ""
"Indica si se deben usar las sugerencias de las tipografías Xft; 0=no, 1 =sí, "
"-1=predeterminado"
-#: ../gtk/gtksettings.c:426
+#: ../gtk/gtksettings.c:462
msgid "Xft Hint Style"
msgstr "Estilo de sugerencias Xft"
-#: ../gtk/gtksettings.c:427
+#: ../gtk/gtksettings.c:463
msgid ""
"What degree of hinting to use; hintnone, hintslight, hintmedium, or hintfull"
msgstr "Qué grado de sugerencias usar: ninguno, ligero, medio o completo"
-#: ../gtk/gtksettings.c:436
+#: ../gtk/gtksettings.c:472
msgid "Xft RGBA"
msgstr "Xft RGBA"
-#: ../gtk/gtksettings.c:437
+#: ../gtk/gtksettings.c:473
msgid "Type of subpixel antialiasing; none, rgb, bgr, vrgb, vbgr"
msgstr "Tipo de suavizado de subpíxel: ninguno, rgb, bgr, vrgb, vbgr"
-#: ../gtk/gtksettings.c:446
+#: ../gtk/gtksettings.c:482
msgid "Xft DPI"
msgstr "PPP Xft (DPI)"
-#: ../gtk/gtksettings.c:447
+#: ../gtk/gtksettings.c:483
msgid "Resolution for Xft, in 1024 * dots/inch. -1 to use default value"
msgstr ""
"Resolución para Xft, en 1024 * puntos/pulgada. -1 para usar el valor "
"predeterminado"
-#: ../gtk/gtksettings.c:456
+#: ../gtk/gtksettings.c:492
msgid "Cursor theme name"
msgstr "Nombre del tema del cursor"
-#: ../gtk/gtksettings.c:457
+#: ../gtk/gtksettings.c:493
msgid "Name of the cursor theme to use, or NULL to use the default theme"
msgstr ""
"Nombre del tema de cursor que utilizar, o NULL para usar el tema "
"predeterminado"
-#: ../gtk/gtksettings.c:465
+#: ../gtk/gtksettings.c:501
msgid "Cursor theme size"
msgstr "Tamaño del tema del cursor"
-#: ../gtk/gtksettings.c:466
+#: ../gtk/gtksettings.c:502
msgid "Size to use for cursors, or 0 to use the default size"
msgstr ""
"Tamaño que se va a usar para los cursores, o 0 para usar el tamaño "
"predeterminado"
-#: ../gtk/gtksettings.c:476
+#: ../gtk/gtksettings.c:512
msgid "Alternative button order"
msgstr "Orden de los botones alternativo"
-#: ../gtk/gtksettings.c:477
+#: ../gtk/gtksettings.c:513
msgid "Whether buttons in dialogs should use the alternative button order"
msgstr ""
"Indica si los botones en los diálogos deben usar un orden de botones "
"alternativo"
-#: ../gtk/gtksettings.c:494
+#: ../gtk/gtksettings.c:530
msgid "Alternative sort indicator direction"
msgstr "Dirección alternativa del indicador de ordenamiento"
-#: ../gtk/gtksettings.c:495
+#: ../gtk/gtksettings.c:531
msgid ""
"Whether the direction of the sort indicators in list and tree views is "
"inverted compared to the default (where down means ascending)"
@@ -5163,11 +5141,11 @@ msgstr ""
"vista de árbol está invertida en comparación con la predeterminada (donde "
"abajo significa ascendente)"
-#: ../gtk/gtksettings.c:503
+#: ../gtk/gtksettings.c:539
msgid "Show the 'Input Methods' menu"
msgstr "Mostrar el menú de métodos de entrada"
-#: ../gtk/gtksettings.c:504
+#: ../gtk/gtksettings.c:540
msgid ""
"Whether the context menus of entries and text views should offer to change "
"the input method"
@@ -5175,11 +5153,11 @@ msgstr ""
"Indica si los menús de contexto y las vistas de texto deben ofrecer cambiar "
"el método de entrada"
-#: ../gtk/gtksettings.c:512
+#: ../gtk/gtksettings.c:548
msgid "Show the 'Insert Unicode Control Character' menu"
msgstr "Mostrar el menú «Insertar carácter de control Unicode»"
-#: ../gtk/gtksettings.c:513
+#: ../gtk/gtksettings.c:549
msgid ""
"Whether the context menus of entries and text views should offer to insert "
"control characters"
@@ -5187,254 +5165,254 @@ msgstr ""
"Indica si los menús de contexto de las estradas y las vistas de texto deben "
"ofrecer insertar caracteres de control"
-#: ../gtk/gtksettings.c:521
+#: ../gtk/gtksettings.c:557
msgid "Start timeout"
msgstr "Tiempo de expiración de inicio"
-#: ../gtk/gtksettings.c:522
+#: ../gtk/gtksettings.c:558
msgid "Starting value for timeouts, when button is pressed"
msgstr "Valor de inicio para las expiraciones, cuando se pulsa el botón"
-#: ../gtk/gtksettings.c:531
+#: ../gtk/gtksettings.c:567
msgid "Repeat timeout"
msgstr "Expiración de repetición"
-#: ../gtk/gtksettings.c:532
+#: ../gtk/gtksettings.c:568
msgid "Repeat value for timeouts, when button is pressed"
msgstr "Valor de repetición para expiraciones, cuando el botón se pulsa"
-#: ../gtk/gtksettings.c:541
+#: ../gtk/gtksettings.c:577
msgid "Expand timeout"
msgstr "Expiración del expansor"
-#: ../gtk/gtksettings.c:542
+#: ../gtk/gtksettings.c:578
msgid "Expand value for timeouts, when a widget is expanding a new region"
msgstr ""
"Valor de expansión para las expiraciones, cuando un widget está expandiendo "
"una región nueva"
-#: ../gtk/gtksettings.c:577
+#: ../gtk/gtksettings.c:613
msgid "Color scheme"
msgstr "Esquema de color"
-#: ../gtk/gtksettings.c:578
+#: ../gtk/gtksettings.c:614
msgid "A palette of named colors for use in themes"
msgstr "Una paleta de colores con nombre para usar en los temas"
-#: ../gtk/gtksettings.c:587
+#: ../gtk/gtksettings.c:623
msgid "Enable Animations"
msgstr "Activar animaciones"
-#: ../gtk/gtksettings.c:588
+#: ../gtk/gtksettings.c:624
msgid "Whether to enable toolkit-wide animations."
msgstr "Indica si se activan las animaciones para todo el toolkit."
-#: ../gtk/gtksettings.c:606
+#: ../gtk/gtksettings.c:642
msgid "Enable Touchscreen Mode"
msgstr "Activar modo pantalla táctil"
-#: ../gtk/gtksettings.c:607
+#: ../gtk/gtksettings.c:643
msgid "When TRUE, there are no motion notify events delivered on this screen"
msgstr ""
"Cuando esté a TRUE, no hay eventos de notificación de movimiento entregados "
"en esta pantalla"
-#: ../gtk/gtksettings.c:624
+#: ../gtk/gtksettings.c:660
msgid "Tooltip timeout"
msgstr "Tiempo de expiración del consejo"
-#: ../gtk/gtksettings.c:625
+#: ../gtk/gtksettings.c:661
msgid "Timeout before tooltip is shown"
msgstr "Tiempo de expiración antes de que se muestre el consejo"
-#: ../gtk/gtksettings.c:650
+#: ../gtk/gtksettings.c:686
msgid "Tooltip browse timeout"
msgstr "Tiempo de los consejos de navegación"
-#: ../gtk/gtksettings.c:651
+#: ../gtk/gtksettings.c:687
msgid "Timeout before tooltip is shown when browse mode is enabled"
msgstr ""
"Tiempo de expiración antes de que se muestre el consejo cuando el modo de "
"navegación está activado"
-#: ../gtk/gtksettings.c:672
+#: ../gtk/gtksettings.c:708
msgid "Tooltip browse mode timeout"
msgstr "Tiempo de los consejos en modo navegación"
-#: ../gtk/gtksettings.c:673
+#: ../gtk/gtksettings.c:709
msgid "Timeout after which browse mode is disabled"
msgstr ""
"Tiempo de expiración después del cual se desactiva el modo de navegación"
-#: ../gtk/gtksettings.c:692
+#: ../gtk/gtksettings.c:728
msgid "Keynav Cursor Only"
msgstr "Sólo cursor para navegar con teclas"
-#: ../gtk/gtksettings.c:693
+#: ../gtk/gtksettings.c:729
msgid "When TRUE, there are only cursor keys available to navigate widgets"
msgstr ""
"Cuando sea TRUE, sólo hay teclas de cursos disponibles para navegar por los "
"widgets"
-#: ../gtk/gtksettings.c:710
+#: ../gtk/gtksettings.c:746
msgid "Keynav Wrap Around"
msgstr "Saltar al navegar con el teclado"
-#: ../gtk/gtksettings.c:711
+#: ../gtk/gtksettings.c:747
msgid "Whether to wrap around when keyboard-navigating widgets"
msgstr ""
"Indica si se ha de saltar alrededor cuando se navegue por los widgets con el "
"teclado"
-#: ../gtk/gtksettings.c:731
+#: ../gtk/gtksettings.c:767
msgid "Error Bell"
msgstr "Campana de error"
-#: ../gtk/gtksettings.c:732
+#: ../gtk/gtksettings.c:768
msgid "When TRUE, keyboard navigation and other errors will cause a beep"
msgstr ""
"Cuando sea TRUE, la navegación con el teclado y otros errores causarán un bip"
-#: ../gtk/gtksettings.c:749
+#: ../gtk/gtksettings.c:785
msgid "Color Hash"
msgstr "Hash del color"
-#: ../gtk/gtksettings.c:750
+#: ../gtk/gtksettings.c:786
msgid "A hash table representation of the color scheme."
msgstr "Una representación en tabla hash del esquema de color."
-#: ../gtk/gtksettings.c:758
+#: ../gtk/gtksettings.c:794
msgid "Default file chooser backend"
msgstr "Backend predeterminado del selector de archivos"
-#: ../gtk/gtksettings.c:759
+#: ../gtk/gtksettings.c:795
msgid "Name of the GtkFileChooser backend to use by default"
msgstr "Nombre del backend predeterminado del GtkFileChooser"
-#: ../gtk/gtksettings.c:776
+#: ../gtk/gtksettings.c:812
msgid "Default print backend"
msgstr "Backend predeterminado de impresión"
-#: ../gtk/gtksettings.c:777
+#: ../gtk/gtksettings.c:813
msgid "List of the GtkPrintBackend backends to use by default"
msgstr "Lista de backends GtkPrintBackend para usar por omisión"
-#: ../gtk/gtksettings.c:800
+#: ../gtk/gtksettings.c:836
msgid "Default command to run when displaying a print preview"
msgstr ""
"Comando predeterminado que ejecutar al mostrar una vista previa de impresión"
-#: ../gtk/gtksettings.c:801
+#: ../gtk/gtksettings.c:837
msgid "Command to run when displaying a print preview"
msgstr "Comando que ejecutar al mostrar una vista previa de impresión"
-#: ../gtk/gtksettings.c:817
+#: ../gtk/gtksettings.c:853
msgid "Enable Mnemonics"
msgstr "Activar mnemónicos"
-#: ../gtk/gtksettings.c:818
+#: ../gtk/gtksettings.c:854
msgid "Whether labels should have mnemonics"
msgstr "Indica si las etiquetas deben tener mnemónicos"
-#: ../gtk/gtksettings.c:834
+#: ../gtk/gtksettings.c:870
msgid "Enable Accelerators"
msgstr "Activar aceleradores"
-#: ../gtk/gtksettings.c:835
+#: ../gtk/gtksettings.c:871
msgid "Whether menu items should have accelerators"
msgstr "Indica si los elementos del menú deben tener aceleradores"
-#: ../gtk/gtksettings.c:852
+#: ../gtk/gtksettings.c:888
msgid "Recent Files Limit"
msgstr "Límite de archivos recientes"
-#: ../gtk/gtksettings.c:853
+#: ../gtk/gtksettings.c:889
msgid "Number of recently used files"
msgstr "Número de archivos usados recientemente"
-#: ../gtk/gtksettings.c:871
+#: ../gtk/gtksettings.c:907
msgid "Default IM module"
msgstr "Módulo de método de entrada predeterminado"
-#: ../gtk/gtksettings.c:872
+#: ../gtk/gtksettings.c:908
msgid "Which IM module should be used by default"
msgstr "Qué módulo de método de entrada se debe usar de forma predeterminada"
-#: ../gtk/gtksettings.c:890
+#: ../gtk/gtksettings.c:926
msgid "Recent Files Max Age"
msgstr "Antigüedad máxima de los archivos recientes"
-#: ../gtk/gtksettings.c:891
+#: ../gtk/gtksettings.c:927
msgid "Maximum age of recently used files, in days"
msgstr "Máxima antigüedad para los archivos recientemente usados, en días"
-#: ../gtk/gtksettings.c:900
+#: ../gtk/gtksettings.c:936
msgid "Fontconfig configuration timestamp"
msgstr "Configuración de la marca de tiempo de fontconfig"
-#: ../gtk/gtksettings.c:901
+#: ../gtk/gtksettings.c:937
msgid "Timestamp of current fontconfig configuration"
msgstr "Marca de tiempo de la configuración actual de fontconfig"
-#: ../gtk/gtksettings.c:923
+#: ../gtk/gtksettings.c:959
msgid "Sound Theme Name"
msgstr "Nombre del tema de sonido"
-#: ../gtk/gtksettings.c:924
+#: ../gtk/gtksettings.c:960
msgid "XDG sound theme name"
msgstr "Nombre del tema de sonido XDG"
#. Translators: this means sounds that are played as feedback to user input
-#: ../gtk/gtksettings.c:946
+#: ../gtk/gtksettings.c:982
msgid "Audible Input Feedback"
msgstr "Contexto de entrada audible"
-#: ../gtk/gtksettings.c:947
+#: ../gtk/gtksettings.c:983
msgid "Whether to play event sounds as feedback to user input"
msgstr ""
"Indica si se deben reproducir eventos como respuesta a las entradas del "
"usuario"
-#: ../gtk/gtksettings.c:968
+#: ../gtk/gtksettings.c:1004
msgid "Enable Event Sounds"
msgstr "Activar eventos de sonido"
-#: ../gtk/gtksettings.c:969
+#: ../gtk/gtksettings.c:1005
msgid "Whether to play any event sounds at all"
msgstr "Indica si se debe reproducir cualquier evento de sonido"
-#: ../gtk/gtksettings.c:984
+#: ../gtk/gtksettings.c:1020
msgid "Enable Tooltips"
msgstr "Activar consejos"
-#: ../gtk/gtksettings.c:985
+#: ../gtk/gtksettings.c:1021
msgid "Whether tooltips should be shown on widgets"
msgstr "Indica si se deben mostrar los consejos en los widgets"
-#: ../gtk/gtksettings.c:998
+#: ../gtk/gtksettings.c:1034
msgid "Toolbar style"
msgstr "Estilo de la barra de herramientas"
-#: ../gtk/gtksettings.c:999
+#: ../gtk/gtksettings.c:1035
msgid ""
"Whether default toolbars have text only, text and icons, icons only, etc."
msgstr ""
"Indica si las barras de herramientas predeterminadas tienen sólo texto, "
"texto e iconos, sólo iconos, etc."
-#: ../gtk/gtksettings.c:1013
+#: ../gtk/gtksettings.c:1049
msgid "Toolbar Icon Size"
msgstr "Tamaño del icono de la barra de herramientas"
-#: ../gtk/gtksettings.c:1014
+#: ../gtk/gtksettings.c:1050
msgid "The size of icons in default toolbars."
msgstr "El tamaño de los iconos el las barras de herramientas."
-#: ../gtk/gtksettings.c:1031
+#: ../gtk/gtksettings.c:1067
msgid "Auto Mnemonics"
msgstr "Mnemónicos automáticos"
-#: ../gtk/gtksettings.c:1032
+#: ../gtk/gtksettings.c:1068
msgid ""
"Whether mnemonics should be automatically shown and hidden when the user "
"presses the mnemonic activator."
@@ -5442,63 +5420,63 @@ msgstr ""
"Indica si se deben mostrar y ocultar automáticamente los mnemónicos cuando "
"el usuario pulsa el activador de mnemónicos."
-#: ../gtk/gtksettings.c:1057
+#: ../gtk/gtksettings.c:1093
msgid "Application prefers a dark theme"
msgstr "La aplicación prefiere un tema oscuro"
-#: ../gtk/gtksettings.c:1058
+#: ../gtk/gtksettings.c:1094
msgid "Whether the application prefers to have a dark theme."
msgstr "Indica si la aplicación prefiere un tema oscuro."
-#: ../gtk/gtksettings.c:1073
+#: ../gtk/gtksettings.c:1109
msgid "Show button images"
msgstr "Mostrar imágenes en los botones"
-#: ../gtk/gtksettings.c:1074
+#: ../gtk/gtksettings.c:1110
msgid "Whether images should be shown on buttons"
msgstr "Indica si se deben mostrar las imágenes en los botones"
-#: ../gtk/gtksettings.c:1082 ../gtk/gtksettings.c:1176
+#: ../gtk/gtksettings.c:1118 ../gtk/gtksettings.c:1212
msgid "Select on focus"
msgstr "Seleccionar al enfocar"
-#: ../gtk/gtksettings.c:1083
+#: ../gtk/gtksettings.c:1119
msgid "Whether to select the contents of an entry when it is focused"
msgstr ""
"Indica si se deben seleccionar los contenidos de una entrada cuando obtiene "
"el foco"
-#: ../gtk/gtksettings.c:1100
+#: ../gtk/gtksettings.c:1136
msgid "Password Hint Timeout"
msgstr "Tiempo de expiración del hint de contraseña"
-#: ../gtk/gtksettings.c:1101
+#: ../gtk/gtksettings.c:1137
msgid "How long to show the last input character in hidden entries"
msgstr ""
"Indica durante cuánto tiempo mostrar el último carácter en las entradas "
"ocultas"
-#: ../gtk/gtksettings.c:1110
+#: ../gtk/gtksettings.c:1146
msgid "Show menu images"
msgstr "Mostrar imágenes del menú"
-#: ../gtk/gtksettings.c:1111
+#: ../gtk/gtksettings.c:1147
msgid "Whether images should be shown in menus"
msgstr "Indica si deben mostrarse o no las imágenes en los menús"
-#: ../gtk/gtksettings.c:1119
+#: ../gtk/gtksettings.c:1155
msgid "Delay before drop down menus appear"
msgstr "Retardo antes de que aparezcan los menús desplegables"
-#: ../gtk/gtksettings.c:1120
+#: ../gtk/gtksettings.c:1156
msgid "Delay before the submenus of a menu bar appear"
msgstr "Retardo antes de que aparezcan los submenús de una barra de menús"
-#: ../gtk/gtksettings.c:1137
+#: ../gtk/gtksettings.c:1173
msgid "Scrolled Window Placement"
msgstr "Colocación de la ventana donde se ha desplazado"
-#: ../gtk/gtksettings.c:1138
+#: ../gtk/gtksettings.c:1174
msgid ""
"Where the contents of scrolled windows are located with respect to the "
"scrollbars, if not overridden by the scrolled window's own placement."
@@ -5507,33 +5485,33 @@ msgstr ""
"respecto a las barras de desplazamiento, si no toma precedencia por el "
"propio emplazamiento de la ventana donde se hizo scroll."
-#: ../gtk/gtksettings.c:1147
+#: ../gtk/gtksettings.c:1183
msgid "Can change accelerators"
msgstr "Puede cambiar aceleradores"
-#: ../gtk/gtksettings.c:1148
+#: ../gtk/gtksettings.c:1184
msgid ""
"Whether menu accelerators can be changed by pressing a key over the menu item"
msgstr ""
"Indica si los aceleradores del menú pueden cambiarse pulsando una tecla "
"sobre el elemento del menú"
-#: ../gtk/gtksettings.c:1156
+#: ../gtk/gtksettings.c:1192
msgid "Delay before submenus appear"
msgstr "Retraso antes de que aparezcan los submenús"
-#: ../gtk/gtksettings.c:1157
+#: ../gtk/gtksettings.c:1193
msgid ""
"Minimum time the pointer must stay over a menu item before the submenu appear"
msgstr ""
"Tiempo mínimo en que el puntero debe permanecer sobre un elemento de menú "
"antes de que el submenú aparezca"
-#: ../gtk/gtksettings.c:1166
+#: ../gtk/gtksettings.c:1202
msgid "Delay before hiding a submenu"
msgstr "Retraso antes de ocultar un submenú"
-#: ../gtk/gtksettings.c:1167
+#: ../gtk/gtksettings.c:1203
msgid ""
"The time before hiding a submenu when the pointer is moving towards the "
"submenu"
@@ -5541,33 +5519,33 @@ msgstr ""
"El tiempo antes de ocultar un submenú cuando el puntero se este moviendo "
"hacia el submenú"
-#: ../gtk/gtksettings.c:1177
+#: ../gtk/gtksettings.c:1213
msgid "Whether to select the contents of a selectable label when it is focused"
msgstr ""
"Indica si se debe seleccionar el contenido de una etiqueta seleccionable "
"cuando obtiene el foco"
-#: ../gtk/gtksettings.c:1185
+#: ../gtk/gtksettings.c:1221
msgid "Custom palette"
msgstr "Paleta personalizada"
-#: ../gtk/gtksettings.c:1186
+#: ../gtk/gtksettings.c:1222
msgid "Palette to use in the color selector"
msgstr "Paleta que se usará en el selector de colores"
-#: ../gtk/gtksettings.c:1194
+#: ../gtk/gtksettings.c:1230
msgid "IM Preedit style"
msgstr "Estilo de preedición del ME"
-#: ../gtk/gtksettings.c:1195
+#: ../gtk/gtksettings.c:1231
msgid "How to draw the input method preedit string"
msgstr "Cómo dibujar la cadena del método de entrada de preedición"
-#: ../gtk/gtksettings.c:1204
+#: ../gtk/gtksettings.c:1240
msgid "IM Status style"
msgstr "Estilo del estado ME"
-#: ../gtk/gtksettings.c:1205
+#: ../gtk/gtksettings.c:1241
msgid "How to draw the input method statusbar"
msgstr "Cómo dibujar el método de entrada de la barra de estado"
@@ -5594,15 +5572,15 @@ msgstr ""
"Si es TRUE, los widgets no mapeados se ignoran al determinar el tamaño del "
"grupo"
-#: ../gtk/gtkspinbutton.c:236
+#: ../gtk/gtkspinbutton.c:238
msgid "Climb Rate"
msgstr "Tasa de subida"
-#: ../gtk/gtkspinbutton.c:256
+#: ../gtk/gtkspinbutton.c:258
msgid "Snap to Ticks"
msgstr "Ajustarse a los ticks"
-#: ../gtk/gtkspinbutton.c:257
+#: ../gtk/gtkspinbutton.c:259
msgid ""
"Whether erroneous values are automatically changed to a spin button's "
"nearest step increment"
@@ -5610,39 +5588,39 @@ msgstr ""
"Indica si los valores erróneos se cambian por el valor más cercano de un "
"botón incrementable"
-#: ../gtk/gtkspinbutton.c:264
+#: ../gtk/gtkspinbutton.c:266
msgid "Numeric"
msgstr "Numérico"
-#: ../gtk/gtkspinbutton.c:265
+#: ../gtk/gtkspinbutton.c:267
msgid "Whether non-numeric characters should be ignored"
msgstr "Indica si se ignoran los caracteres no numéricos"
-#: ../gtk/gtkspinbutton.c:272
+#: ../gtk/gtkspinbutton.c:274
msgid "Wrap"
msgstr "Volver al inicio"
-#: ../gtk/gtkspinbutton.c:273
+#: ../gtk/gtkspinbutton.c:275
msgid "Whether a spin button should wrap upon reaching its limits"
msgstr ""
"Indica si un botón giratorio debe volver al inicio al alcanzar sus límites"
-#: ../gtk/gtkspinbutton.c:280
+#: ../gtk/gtkspinbutton.c:282
msgid "Update Policy"
msgstr "Norma de actualización"
-#: ../gtk/gtkspinbutton.c:281
+#: ../gtk/gtkspinbutton.c:283
msgid ""
"Whether the spin button should update always, or only when the value is legal"
msgstr ""
"Indica si el botón incrementable se actualiza siempre, o sólo cuando el "
"valor es legal"
-#: ../gtk/gtkspinbutton.c:290
+#: ../gtk/gtkspinbutton.c:292
msgid "Reads the current value, or sets a new value"
msgstr "Lee el valor actual, o establece un valor nuevo"
-#: ../gtk/gtkspinbutton.c:299
+#: ../gtk/gtkspinbutton.c:301
msgid "Style of bevel around the spin button"
msgstr "Estilo de bisel alrededor del botón giratorio"
@@ -5675,7 +5653,7 @@ msgstr ""
"El tiempo en milisegundos para que el marcador incrementable complete una "
"vuelta completa"
-#: ../gtk/gtkstatusbar.c:179
+#: ../gtk/gtkstatusbar.c:181
msgid "Style of bevel around the statusbar text"
msgstr "Estilo del bisel alrededor del texto de la barra de estado"
@@ -5699,7 +5677,7 @@ msgstr "Indica si el icono de estado está empotrado"
msgid "The orientation of the tray"
msgstr "La orientación de la bandeja"
-#: ../gtk/gtkstatusicon.c:347 ../gtk/gtkwidget.c:1084
+#: ../gtk/gtkstatusicon.c:347 ../gtk/gtkwidget.c:1025
msgid "Has tooltip"
msgstr "Tiene consejo"
@@ -5707,15 +5685,15 @@ msgstr "Tiene consejo"
msgid "Whether this tray icon has a tooltip"
msgstr "Indica si el icono de la bandeja tiene un consejo"
-#: ../gtk/gtkstatusicon.c:373 ../gtk/gtkwidget.c:1105
+#: ../gtk/gtkstatusicon.c:373 ../gtk/gtkwidget.c:1046
msgid "Tooltip Text"
msgstr "Texto del consejo"
-#: ../gtk/gtkstatusicon.c:374 ../gtk/gtkwidget.c:1106 ../gtk/gtkwidget.c:1127
+#: ../gtk/gtkstatusicon.c:374 ../gtk/gtkwidget.c:1047 ../gtk/gtkwidget.c:1068
msgid "The contents of the tooltip for this widget"
msgstr "El contenido de los consejos para este widget"
-#: ../gtk/gtkstatusicon.c:397 ../gtk/gtkwidget.c:1126
+#: ../gtk/gtkstatusicon.c:397 ../gtk/gtkwidget.c:1067
msgid "Tooltip markup"
msgstr "Marcado de consejos"
@@ -5727,89 +5705,99 @@ msgstr "El contenido de los consejos para este icono de la bandeja"
msgid "The title of this tray icon"
msgstr "El título de este icono de la bandeja"
-#: ../gtk/gtktable.c:152
+#: ../gtk/gtkswitch.c:740
+#| msgid "Whether the widget is double buffered"
+msgid "Whether the switch is on or off"
+msgstr "Indica si el interruptor está encendido o apagado"
+
+#: ../gtk/gtkswitch.c:774
+#| msgid "The minimum value of the adjustment"
+msgid "The minimum width of the handle"
+msgstr "La anchura mínima del tirador"
+
+#: ../gtk/gtktable.c:157
msgid "Rows"
msgstr "Filas"
-#: ../gtk/gtktable.c:153
+#: ../gtk/gtktable.c:158
msgid "The number of rows in the table"
msgstr "El número de filas en la tabla"
-#: ../gtk/gtktable.c:161
+#: ../gtk/gtktable.c:166
msgid "Columns"
msgstr "Columnas"
-#: ../gtk/gtktable.c:162
+#: ../gtk/gtktable.c:167
msgid "The number of columns in the table"
msgstr "El número de columnas en la tabla"
-#: ../gtk/gtktable.c:170
+#: ../gtk/gtktable.c:175
msgid "Row spacing"
msgstr "Espaciado entre filas"
-#: ../gtk/gtktable.c:171
+#: ../gtk/gtktable.c:176
msgid "The amount of space between two consecutive rows"
msgstr "La cantidad de espacio entre dos filas consecutivas"
-#: ../gtk/gtktable.c:179
+#: ../gtk/gtktable.c:184
msgid "Column spacing"
msgstr "Espaciado de la columna"
-#: ../gtk/gtktable.c:180
+#: ../gtk/gtktable.c:185
msgid "The amount of space between two consecutive columns"
msgstr "La cantidad de espacio entre dos columnas consecutivas"
-#: ../gtk/gtktable.c:189
+#: ../gtk/gtktable.c:194
msgid "If TRUE, the table cells are all the same width/height"
msgstr ""
"Si es TRUE, las celdas de la tabla tienen todas de la misma anchura/altura"
-#: ../gtk/gtktable.c:196
+#: ../gtk/gtktable.c:201
msgid "Left attachment"
msgstr "Acoplado izquierdo"
-#: ../gtk/gtktable.c:203
+#: ../gtk/gtktable.c:208
msgid "Right attachment"
msgstr "Acoplado derecho"
-#: ../gtk/gtktable.c:204
+#: ../gtk/gtktable.c:209
msgid "The column number to attach the right side of a child widget to"
msgstr ""
"El número de columnas que acoplar hacia el lado derecho de un widget hijo"
-#: ../gtk/gtktable.c:210
+#: ../gtk/gtktable.c:215
msgid "Top attachment"
msgstr "Acoplado superior"
-#: ../gtk/gtktable.c:211
+#: ../gtk/gtktable.c:216
msgid "The row number to attach the top of a child widget to"
msgstr "El número de fila que acoplar a la parte superior de un widget hijo"
-#: ../gtk/gtktable.c:217
+#: ../gtk/gtktable.c:222
msgid "Bottom attachment"
msgstr "Acoplado inferior"
-#: ../gtk/gtktable.c:224
+#: ../gtk/gtktable.c:229
msgid "Horizontal options"
msgstr "Opciones horizontales"
-#: ../gtk/gtktable.c:225
+#: ../gtk/gtktable.c:230
msgid "Options specifying the horizontal behaviour of the child"
msgstr "Opciones que indicar el comportamiento horizontal del hijo"
-#: ../gtk/gtktable.c:231
+#: ../gtk/gtktable.c:236
msgid "Vertical options"
msgstr "Opciones verticales"
-#: ../gtk/gtktable.c:232
+#: ../gtk/gtktable.c:237
msgid "Options specifying the vertical behaviour of the child"
msgstr "Opciones que especifican el comportamiento vertical del hijo"
-#: ../gtk/gtktable.c:238
+#: ../gtk/gtktable.c:243
msgid "Horizontal padding"
msgstr "Relleno horizontal"
-#: ../gtk/gtktable.c:239
+#: ../gtk/gtktable.c:244
msgid ""
"Extra space to put between the child and its left and right neighbors, in "
"pixels"
@@ -5817,11 +5805,11 @@ msgstr ""
"Espacio extra que poner entre el hijo y sus vecinos izquierdos y derechos, "
"en píxeles"
-#: ../gtk/gtktable.c:245
+#: ../gtk/gtktable.c:250
msgid "Vertical padding"
msgstr "Relleno vertical"
-#: ../gtk/gtktable.c:246
+#: ../gtk/gtktable.c:251
msgid ""
"Extra space to put between the child and its upper and lower neighbors, in "
"pixels"
@@ -5829,53 +5817,53 @@ msgstr ""
"Espacio extra que poner entre el hijo y sus vecinos superiores e inferiores, "
"en píxeles"
-#: ../gtk/gtktextbuffer.c:192
+#: ../gtk/gtktextbuffer.c:191
msgid "Tag Table"
msgstr "Tabla de etiquetas"
-#: ../gtk/gtktextbuffer.c:193
+#: ../gtk/gtktextbuffer.c:192
msgid "Text Tag Table"
msgstr "Tabla de etiquetas de texto"
-#: ../gtk/gtktextbuffer.c:211
+#: ../gtk/gtktextbuffer.c:210
msgid "Current text of the buffer"
msgstr "Texto actual del búfer"
-#: ../gtk/gtktextbuffer.c:225
+#: ../gtk/gtktextbuffer.c:224
msgid "Has selection"
msgstr "Tiene selección"
-#: ../gtk/gtktextbuffer.c:226
+#: ../gtk/gtktextbuffer.c:225
msgid "Whether the buffer has some text currently selected"
msgstr "Indica si el búfer tiene algo de texto actualmente seleccionado"
-#: ../gtk/gtktextbuffer.c:242
+#: ../gtk/gtktextbuffer.c:241
msgid "Cursor position"
msgstr "Posición del cursor"
-#: ../gtk/gtktextbuffer.c:243
+#: ../gtk/gtktextbuffer.c:242
msgid ""
"The position of the insert mark (as offset from the beginning of the buffer)"
msgstr ""
"La posición de la marca de inserción (como un desplazamiento desde el "
"principio del búfer)"
-#: ../gtk/gtktextbuffer.c:258
+#: ../gtk/gtktextbuffer.c:257
msgid "Copy target list"
msgstr "Lista de destinos de la copia"
-#: ../gtk/gtktextbuffer.c:259
+#: ../gtk/gtktextbuffer.c:258
msgid ""
"The list of targets this buffer supports for clipboard copying and DND source"
msgstr ""
"La lista de destinos que soporta este búfer para copiar desde el "
"portapapeles y el origen del DND"
-#: ../gtk/gtktextbuffer.c:274
+#: ../gtk/gtktextbuffer.c:273
msgid "Paste target list"
msgstr "Lista de destinos de pegado"
-#: ../gtk/gtktextbuffer.c:275
+#: ../gtk/gtktextbuffer.c:274
msgid ""
"The list of targets this buffer supports for clipboard pasting and DND "
"destination"
@@ -5975,7 +5963,7 @@ msgstr ""
"tema, etc. por lo cual se recomienda. Pango define previamente algunas "
"escalas tales como PANGO_SCALE_X_LARGE"
-#: ../gtk/gtktexttag.c:336 ../gtk/gtktextview.c:678
+#: ../gtk/gtktexttag.c:336 ../gtk/gtktextview.c:704
msgid "Left, right, or center justification"
msgstr "Justificación a la izquierda, derecha o centro"
@@ -5992,7 +5980,7 @@ msgstr ""
msgid "Left margin"
msgstr "Margen izquierdo"
-#: ../gtk/gtktexttag.c:363 ../gtk/gtktextview.c:687
+#: ../gtk/gtktexttag.c:363 ../gtk/gtktextview.c:713
msgid "Width of the left margin in pixels"
msgstr "Anchura del margen izquierdo en píxeles"
@@ -6000,15 +5988,15 @@ msgstr "Anchura del margen izquierdo en píxeles"
msgid "Right margin"
msgstr "Margen derecho"
-#: ../gtk/gtktexttag.c:373 ../gtk/gtktextview.c:697
+#: ../gtk/gtktexttag.c:373 ../gtk/gtktextview.c:723
msgid "Width of the right margin in pixels"
msgstr "Anchura del margen derecho en píxeles"
-#: ../gtk/gtktexttag.c:383 ../gtk/gtktextview.c:706
+#: ../gtk/gtktexttag.c:383 ../gtk/gtktextview.c:732
msgid "Indent"
msgstr "Sangrar"
-#: ../gtk/gtktexttag.c:384 ../gtk/gtktextview.c:707
+#: ../gtk/gtktexttag.c:384 ../gtk/gtktextview.c:733
msgid "Amount to indent the paragraph, in pixels"
msgstr "Número de píxeles para el sangrado del párrafo"
@@ -6024,7 +6012,7 @@ msgstr ""
msgid "Pixels above lines"
msgstr "Píxeles encima de las líneas"
-#: ../gtk/gtktexttag.c:405 ../gtk/gtktextview.c:631
+#: ../gtk/gtktexttag.c:405 ../gtk/gtktextview.c:657
msgid "Pixels of blank space above paragraphs"
msgstr "Píxeles de espacio en blanco encima de los párrafos"
@@ -6032,7 +6020,7 @@ msgstr "Píxeles de espacio en blanco encima de los párrafos"
msgid "Pixels below lines"
msgstr "Píxeles debajo de las líneas"
-#: ../gtk/gtktexttag.c:415 ../gtk/gtktextview.c:641
+#: ../gtk/gtktexttag.c:415 ../gtk/gtktextview.c:667
msgid "Pixels of blank space below paragraphs"
msgstr "Píxeles de espacio en blanco debajo de los párrafos"
@@ -6040,22 +6028,22 @@ msgstr "Píxeles de espacio en blanco debajo de los párrafos"
msgid "Pixels inside wrap"
msgstr "Píxeles dentro del ajuste"
-#: ../gtk/gtktexttag.c:425 ../gtk/gtktextview.c:651
+#: ../gtk/gtktexttag.c:425 ../gtk/gtktextview.c:677
msgid "Pixels of blank space between wrapped lines in a paragraph"
msgstr "Píxeles de espacio en blanco entre las líneas ajustadas en un párrafo"
-#: ../gtk/gtktexttag.c:452 ../gtk/gtktextview.c:669
+#: ../gtk/gtktexttag.c:452 ../gtk/gtktextview.c:695
msgid ""
"Whether to wrap lines never, at word boundaries, or at character boundaries"
msgstr ""
"Indica si deben ajustarse las líneas, a los límites de las palabras, a los "
"límites de los caracteres, o nunca"
-#: ../gtk/gtktexttag.c:461 ../gtk/gtktextview.c:716
+#: ../gtk/gtktexttag.c:461 ../gtk/gtktextview.c:742
msgid "Tabs"
msgstr "Solapas"
-#: ../gtk/gtktexttag.c:462 ../gtk/gtktextview.c:717
+#: ../gtk/gtktexttag.c:462 ../gtk/gtktextview.c:743
msgid "Custom tabs for this text"
msgstr "Pestañas personalizadas para este texto"
@@ -6186,63 +6174,63 @@ msgstr "Fondo de parágrafo establecido"
msgid "Whether this tag affects the paragraph background color"
msgstr "Indica si esta etiqueta afecta el color de fondo del parágrafo"
-#: ../gtk/gtktextview.c:630
+#: ../gtk/gtktextview.c:656
msgid "Pixels Above Lines"
msgstr "Píxeles sobre las líneas"
-#: ../gtk/gtktextview.c:640
+#: ../gtk/gtktextview.c:666
msgid "Pixels Below Lines"
msgstr "Píxeles por debajo de las líneas"
-#: ../gtk/gtktextview.c:650
+#: ../gtk/gtktextview.c:676
msgid "Pixels Inside Wrap"
msgstr "Píxeles dentro del ajuste"
-#: ../gtk/gtktextview.c:668
+#: ../gtk/gtktextview.c:694
msgid "Wrap Mode"
msgstr "Modo de ajuste"
-#: ../gtk/gtktextview.c:686
+#: ../gtk/gtktextview.c:712
msgid "Left Margin"
msgstr "Margen izquierdo"
-#: ../gtk/gtktextview.c:696
+#: ../gtk/gtktextview.c:722
msgid "Right Margin"
msgstr "Margen derecho"
-#: ../gtk/gtktextview.c:724
+#: ../gtk/gtktextview.c:750
msgid "Cursor Visible"
msgstr "Cursor visible"
-#: ../gtk/gtktextview.c:725
+#: ../gtk/gtktextview.c:751
msgid "If the insertion cursor is shown"
msgstr "Si se muestra el cursor de inserción"
-#: ../gtk/gtktextview.c:732
+#: ../gtk/gtktextview.c:758
msgid "Buffer"
msgstr "Búfer"
-#: ../gtk/gtktextview.c:733
+#: ../gtk/gtktextview.c:759
msgid "The buffer which is displayed"
msgstr "El búfer que se está mostrando"
-#: ../gtk/gtktextview.c:741
+#: ../gtk/gtktextview.c:767
msgid "Whether entered text overwrites existing contents"
msgstr "Indica si el texto introducido sobreescribe el existente"
-#: ../gtk/gtktextview.c:748
+#: ../gtk/gtktextview.c:774
msgid "Accepts tab"
msgstr "Acepta tabuladores"
-#: ../gtk/gtktextview.c:749
+#: ../gtk/gtktextview.c:775
msgid "Whether Tab will result in a tab character being entered"
msgstr "Indica si Tab resultará en la introducción de un carácter tabulador"
-#: ../gtk/gtktextview.c:782
+#: ../gtk/gtktextview.c:810
msgid "Error underline color"
msgstr "Color de subrayado de errores"
-#: ../gtk/gtktextview.c:783
+#: ../gtk/gtktextview.c:811
msgid "Color with which to draw error-indication underlines"
msgstr "Color con el que dibujar el subrayado de indicación de errores"
@@ -6260,101 +6248,101 @@ msgstr ""
msgid "Whether the toggle action should be active"
msgstr "Indica si la acción de conmutación debe estar activa"
-#: ../gtk/gtktogglebutton.c:116 ../gtk/gtktoggletoolbutton.c:113
+#: ../gtk/gtktogglebutton.c:126 ../gtk/gtktoggletoolbutton.c:113
msgid "If the toggle button should be pressed in"
msgstr "Si el botón de conmutación debe estar pulsado"
-#: ../gtk/gtktogglebutton.c:124
+#: ../gtk/gtktogglebutton.c:134
msgid "If the toggle button is in an \"in between\" state"
msgstr "Si el botón de conmutación está en un estado «intermedio»"
-#: ../gtk/gtktogglebutton.c:131
+#: ../gtk/gtktogglebutton.c:141
msgid "Draw Indicator"
msgstr "Indicador de dibujo"
-#: ../gtk/gtktogglebutton.c:132
+#: ../gtk/gtktogglebutton.c:142
msgid "If the toggle part of the button is displayed"
msgstr "Si se muestra la parte de conmutación del botón"
-#: ../gtk/gtktoolbar.c:485 ../gtk/gtktoolpalette.c:1006
+#: ../gtk/gtktoolbar.c:491 ../gtk/gtktoolpalette.c:1060
msgid "Toolbar Style"
msgstr "Estilo de la barra de herramientas"
-#: ../gtk/gtktoolbar.c:486
+#: ../gtk/gtktoolbar.c:492
msgid "How to draw the toolbar"
msgstr "Cómo dibujar la barra de herramientas"
-#: ../gtk/gtktoolbar.c:493
+#: ../gtk/gtktoolbar.c:499
msgid "Show Arrow"
msgstr "Mostrar flecha"
-#: ../gtk/gtktoolbar.c:494
+#: ../gtk/gtktoolbar.c:500
msgid "If an arrow should be shown if the toolbar doesn't fit"
msgstr ""
"Indica si debe mostrarse una flecha si no cabe la barra de herramientas"
-#: ../gtk/gtktoolbar.c:515
+#: ../gtk/gtktoolbar.c:521
msgid "Size of icons in this toolbar"
msgstr "Tamaño de los iconos en esta barra de herramientas"
-#: ../gtk/gtktoolbar.c:530 ../gtk/gtktoolpalette.c:992
+#: ../gtk/gtktoolbar.c:536 ../gtk/gtktoolpalette.c:1046
msgid "Icon size set"
msgstr "Tamaño del icono establecido"
-#: ../gtk/gtktoolbar.c:531 ../gtk/gtktoolpalette.c:993
+#: ../gtk/gtktoolbar.c:537 ../gtk/gtktoolpalette.c:1047
msgid "Whether the icon-size property has been set"
msgstr "Indica si se ha establecido la propiedad de tamaño del icono"
-#: ../gtk/gtktoolbar.c:540
+#: ../gtk/gtktoolbar.c:546
msgid "Whether the item should receive extra space when the toolbar grows"
msgstr ""
"Indica si el elemento debe recibir espacio extra cuando la barra crezca"
-#: ../gtk/gtktoolbar.c:548 ../gtk/gtktoolitemgroup.c:1625
+#: ../gtk/gtktoolbar.c:554 ../gtk/gtktoolitemgroup.c:1642
msgid "Whether the item should be the same size as other homogeneous items"
msgstr ""
"Indica si el elemento debe ser del mismo tamaño que otros elementos "
"homogéneos"
-#: ../gtk/gtktoolbar.c:555
+#: ../gtk/gtktoolbar.c:561
msgid "Spacer size"
msgstr "Tamaño del espaciador"
-#: ../gtk/gtktoolbar.c:556
+#: ../gtk/gtktoolbar.c:562
msgid "Size of spacers"
msgstr "Tamaño de los espaciadores"
-#: ../gtk/gtktoolbar.c:565
+#: ../gtk/gtktoolbar.c:571
msgid "Amount of border space between the toolbar shadow and the buttons"
msgstr ""
"Número de espacio del borde entre la sombra de la barra de herramientas y "
"los botones"
-#: ../gtk/gtktoolbar.c:573
+#: ../gtk/gtktoolbar.c:579
msgid "Maximum child expand"
msgstr "Expansión de hijos máxima"
-#: ../gtk/gtktoolbar.c:574
+#: ../gtk/gtktoolbar.c:580
msgid "Maximum amount of space an expandable item will be given"
msgstr "Cantidad máxima de espacio que se le dará a un elemento expandible"
-#: ../gtk/gtktoolbar.c:582
+#: ../gtk/gtktoolbar.c:588
msgid "Space style"
msgstr "Estilo del espacio"
-#: ../gtk/gtktoolbar.c:583
+#: ../gtk/gtktoolbar.c:589
msgid "Whether spacers are vertical lines or just blank"
msgstr "Indica si los espaciadores son líneas verticales o sólo blancos"
-#: ../gtk/gtktoolbar.c:590
+#: ../gtk/gtktoolbar.c:596
msgid "Button relief"
msgstr "Borde del botón"
-#: ../gtk/gtktoolbar.c:591
+#: ../gtk/gtktoolbar.c:597
msgid "Type of bevel around toolbar buttons"
msgstr "Tipo de bisel alrededor de los botones de la barra de herramientas"
-#: ../gtk/gtktoolbar.c:598
+#: ../gtk/gtktoolbar.c:604
msgid "Style of bevel around the toolbar"
msgstr "Estilo del bisel alrededor de la barra de herramientas"
@@ -6407,7 +6395,7 @@ msgstr "Espaciado entre iconos"
msgid "Spacing in pixels between the icon and label"
msgstr "Espaciado en píxeles entre el icono y la etiqueta"
-#: ../gtk/gtktoolitem.c:201
+#: ../gtk/gtktoolitem.c:210
msgid ""
"Whether the toolbar item is considered important. When TRUE, toolbar buttons "
"show text in GTK_TOOLBAR_BOTH_HORIZ mode"
@@ -6416,85 +6404,85 @@ msgstr ""
"Cuando está a TRUE, los botones de la barra de herramientas muestran texto "
"en modo GTK_TOOLBAR_BOTH_HORIZ"
-#: ../gtk/gtktoolitemgroup.c:1572
+#: ../gtk/gtktoolitemgroup.c:1589
msgid "The human-readable title of this item group"
msgstr "El título leíble por humanos de este grupo de elementos"
-#: ../gtk/gtktoolitemgroup.c:1579
+#: ../gtk/gtktoolitemgroup.c:1596
msgid "A widget to display in place of the usual label"
msgstr "Un widget para mostrar en lugar de la usual etiqueta"
-#: ../gtk/gtktoolitemgroup.c:1585
+#: ../gtk/gtktoolitemgroup.c:1602
msgid "Collapsed"
msgstr "Contraído"
-#: ../gtk/gtktoolitemgroup.c:1586
+#: ../gtk/gtktoolitemgroup.c:1603
msgid "Whether the group has been collapsed and items are hidden"
msgstr "Indica si el grupo se ha colapsado y sus elementos están ocultos"
-#: ../gtk/gtktoolitemgroup.c:1592
+#: ../gtk/gtktoolitemgroup.c:1609
msgid "ellipsize"
msgstr "elipsis"
-#: ../gtk/gtktoolitemgroup.c:1593
+#: ../gtk/gtktoolitemgroup.c:1610
msgid "Ellipsize for item group headers"
msgstr "Elipsis para las cabeceras de grupo de los elementos"
-#: ../gtk/gtktoolitemgroup.c:1599
+#: ../gtk/gtktoolitemgroup.c:1616
msgid "Header Relief"
msgstr "Relieve de la cabecera"
-#: ../gtk/gtktoolitemgroup.c:1600
+#: ../gtk/gtktoolitemgroup.c:1617
msgid "Relief of the group header button"
msgstr "Relieve del botón de cabecera del grupo"
-#: ../gtk/gtktoolitemgroup.c:1615
+#: ../gtk/gtktoolitemgroup.c:1632
msgid "Header Spacing"
msgstr "Espaciado de la cabecera"
-#: ../gtk/gtktoolitemgroup.c:1616
+#: ../gtk/gtktoolitemgroup.c:1633
msgid "Spacing between expander arrow and caption"
msgstr "Espaciado entre la flecha del expansor y la descripción"
-#: ../gtk/gtktoolitemgroup.c:1632
+#: ../gtk/gtktoolitemgroup.c:1649
msgid "Whether the item should receive extra space when the group grows"
msgstr "Indica si el elemento debe recibir espacio extra cuando el grupo crece"
-#: ../gtk/gtktoolitemgroup.c:1639
+#: ../gtk/gtktoolitemgroup.c:1656
msgid "Whether the item should fill the available space"
msgstr "Indica si el elemento debería llenar todo el espacio disponible"
-#: ../gtk/gtktoolitemgroup.c:1645
+#: ../gtk/gtktoolitemgroup.c:1662
msgid "New Row"
msgstr "Fila nueva"
-#: ../gtk/gtktoolitemgroup.c:1646
+#: ../gtk/gtktoolitemgroup.c:1663
msgid "Whether the item should start a new row"
msgstr "Indica si el elemento debería iniciar una fila nueva"
-#: ../gtk/gtktoolitemgroup.c:1653
+#: ../gtk/gtktoolitemgroup.c:1670
msgid "Position of the item within this group"
msgstr "Posición del elemento en su grupo"
-#: ../gtk/gtktoolpalette.c:977
+#: ../gtk/gtktoolpalette.c:1031
msgid "Size of icons in this tool palette"
msgstr "Tamaño de los iconos en esta paleta de herramientas"
-#: ../gtk/gtktoolpalette.c:1007
+#: ../gtk/gtktoolpalette.c:1061
msgid "Style of items in the tool palette"
msgstr "Estilo de los elementos en la paleta de herramientas"
-#: ../gtk/gtktoolpalette.c:1023
+#: ../gtk/gtktoolpalette.c:1077
msgid "Exclusive"
msgstr "Exclusivo"
-#: ../gtk/gtktoolpalette.c:1024
+#: ../gtk/gtktoolpalette.c:1078
msgid "Whether the item group should be the only expanded at a given time"
msgstr ""
"Indica si el elemento del grupo deben ser el único expandido en un "
"determinado momento"
-#: ../gtk/gtktoolpalette.c:1039
+#: ../gtk/gtktoolpalette.c:1093
msgid ""
"Whether the item group should receive extra space when the palette grows"
msgstr ""
@@ -6541,222 +6529,222 @@ msgstr "Modelo TreeModelSort"
msgid "The model for the TreeModelSort to sort"
msgstr "El modelo para el TreeModelSort a ordenar"
-#: ../gtk/gtktreeview.c:566
+#: ../gtk/gtktreeview.c:661
msgid "TreeView Model"
msgstr "Modelo TreeView"
-#: ../gtk/gtktreeview.c:567
+#: ../gtk/gtktreeview.c:662
msgid "The model for the tree view"
msgstr "El modelo para la vista de árbol"
-#: ../gtk/gtktreeview.c:577
+#: ../gtk/gtktreeview.c:674
msgid "Headers Visible"
msgstr "Cabeceras visibles"
-#: ../gtk/gtktreeview.c:578
+#: ../gtk/gtktreeview.c:675
msgid "Show the column header buttons"
msgstr "Mostrar botones en los encabezados de columna"
-#: ../gtk/gtktreeview.c:585
+#: ../gtk/gtktreeview.c:682
msgid "Headers Clickable"
msgstr "Cabeceras pulsables"
-#: ../gtk/gtktreeview.c:586
+#: ../gtk/gtktreeview.c:683
msgid "Column headers respond to click events"
msgstr "Las cabeceras de las columnas responden a los eventos de pulsación"
-#: ../gtk/gtktreeview.c:593
+#: ../gtk/gtktreeview.c:690
msgid "Expander Column"
msgstr "Columna expansora"
-#: ../gtk/gtktreeview.c:594
+#: ../gtk/gtktreeview.c:691
msgid "Set the column for the expander column"
msgstr "Define la columna para la columna expansora"
-#: ../gtk/gtktreeview.c:609
+#: ../gtk/gtktreeview.c:706
msgid "Rules Hint"
msgstr "Consejo de las reglas"
-#: ../gtk/gtktreeview.c:610
+#: ../gtk/gtktreeview.c:707
msgid "Set a hint to the theme engine to draw rows in alternating colors"
msgstr ""
"Define un consejo para el motor del tema para dibujar las filas con colores "
"alternativos"
-#: ../gtk/gtktreeview.c:617
+#: ../gtk/gtktreeview.c:714
msgid "Enable Search"
msgstr "Habilitar búsqueda"
-#: ../gtk/gtktreeview.c:618
+#: ../gtk/gtktreeview.c:715
msgid "View allows user to search through columns interactively"
msgstr ""
"La vista permite a los usuarios buscar en forma interactiva a través de las "
"columnas"
-#: ../gtk/gtktreeview.c:625
+#: ../gtk/gtktreeview.c:722
msgid "Search Column"
msgstr "Columna de búsqueda"
-#: ../gtk/gtktreeview.c:626
+#: ../gtk/gtktreeview.c:723
msgid "Model column to search through during interactive search"
msgstr ""
"Columna modelo para buscar a través de ella en una búsqueda interactiva"
-#: ../gtk/gtktreeview.c:646
+#: ../gtk/gtktreeview.c:743
msgid "Fixed Height Mode"
msgstr "Modo de altura fija"
-#: ../gtk/gtktreeview.c:647
+#: ../gtk/gtktreeview.c:744
msgid "Speeds up GtkTreeView by assuming that all rows have the same height"
msgstr ""
"Acelera GtkTreeView asumiendo que todas las filas tienen la misma altura"
-#: ../gtk/gtktreeview.c:667
+#: ../gtk/gtktreeview.c:764
msgid "Hover Selection"
msgstr "Selección al pasar por encima"
-#: ../gtk/gtktreeview.c:668
+#: ../gtk/gtktreeview.c:765
msgid "Whether the selection should follow the pointer"
msgstr "Indica si la selección debe seguir al puntero"
-#: ../gtk/gtktreeview.c:687
+#: ../gtk/gtktreeview.c:784
msgid "Hover Expand"
msgstr "Expandir al poner el cursor encima"
-#: ../gtk/gtktreeview.c:688
+#: ../gtk/gtktreeview.c:785
msgid ""
"Whether rows should be expanded/collapsed when the pointer moves over them"
msgstr ""
"Indica si las filas deben expandirse/contraerse cuando el puntero se mueve "
"sobre ellas"
-#: ../gtk/gtktreeview.c:702
+#: ../gtk/gtktreeview.c:799
msgid "Show Expanders"
msgstr "Mostrar expansores"
-#: ../gtk/gtktreeview.c:703
+#: ../gtk/gtktreeview.c:800
msgid "View has expanders"
msgstr "La vista tiene expansores"
-#: ../gtk/gtktreeview.c:717
+#: ../gtk/gtktreeview.c:814
msgid "Level Indentation"
msgstr "Nivel de sangrado"
-#: ../gtk/gtktreeview.c:718
+#: ../gtk/gtktreeview.c:815
msgid "Extra indentation for each level"
msgstr "Sangría extra para cada nivel"
-#: ../gtk/gtktreeview.c:727
+#: ../gtk/gtktreeview.c:824
msgid "Rubber Banding"
msgstr "Bandas de goma"
-#: ../gtk/gtktreeview.c:728
+#: ../gtk/gtktreeview.c:825
msgid ""
"Whether to enable selection of multiple items by dragging the mouse pointer"
msgstr ""
"Indica si se debe activar la selección de múltiples elementos arrastrándo el "
"puntero del ratón"
-#: ../gtk/gtktreeview.c:735
+#: ../gtk/gtktreeview.c:832
msgid "Enable Grid Lines"
msgstr "Activar líneas de la rejilla"
-#: ../gtk/gtktreeview.c:736
+#: ../gtk/gtktreeview.c:833
msgid "Whether grid lines should be drawn in the tree view"
msgstr "Indica si debe haber un icono cerca del elemento"
-#: ../gtk/gtktreeview.c:744
+#: ../gtk/gtktreeview.c:841
msgid "Enable Tree Lines"
msgstr "Activar líneas del árbol"
-#: ../gtk/gtktreeview.c:745
+#: ../gtk/gtktreeview.c:842
msgid "Whether tree lines should be drawn in the tree view"
msgstr "Indica si deben dibujar las líneas en la vista del árbol"
-#: ../gtk/gtktreeview.c:753
+#: ../gtk/gtktreeview.c:850
msgid "The column in the model containing the tooltip texts for the rows"
msgstr ""
"La columna del modelo que contiene los textos de consejo para las filas"
-#: ../gtk/gtktreeview.c:775
+#: ../gtk/gtktreeview.c:872
msgid "Vertical Separator Width"
msgstr "Anchura del separador vertical"
-#: ../gtk/gtktreeview.c:776
+#: ../gtk/gtktreeview.c:873
msgid "Vertical space between cells. Must be an even number"
msgstr "Espacio vertical entre celdas. Debe ser un número par"
-#: ../gtk/gtktreeview.c:784
+#: ../gtk/gtktreeview.c:881
msgid "Horizontal Separator Width"
msgstr "Anchura del separador horizontal"
-#: ../gtk/gtktreeview.c:785
+#: ../gtk/gtktreeview.c:882
msgid "Horizontal space between cells. Must be an even number"
msgstr "Espacio horizontal entre celdas. Debe ser un número par"
-#: ../gtk/gtktreeview.c:793
+#: ../gtk/gtktreeview.c:890
msgid "Allow Rules"
msgstr "Permitir reglas"
-#: ../gtk/gtktreeview.c:794
+#: ../gtk/gtktreeview.c:891
msgid "Allow drawing of alternating color rows"
msgstr "Permitir el dibujado de filas con colores alternativos"
-#: ../gtk/gtktreeview.c:800
+#: ../gtk/gtktreeview.c:897
msgid "Indent Expanders"
msgstr "Sangrar expansores"
-#: ../gtk/gtktreeview.c:801
+#: ../gtk/gtktreeview.c:898
msgid "Make the expanders indented"
msgstr "Crea los expansores sangrados"
-#: ../gtk/gtktreeview.c:807
+#: ../gtk/gtktreeview.c:904
msgid "Even Row Color"
msgstr "Color de la fila par"
-#: ../gtk/gtktreeview.c:808
+#: ../gtk/gtktreeview.c:905
msgid "Color to use for even rows"
msgstr "Color a usar para las filas pares"
-#: ../gtk/gtktreeview.c:814
+#: ../gtk/gtktreeview.c:911
msgid "Odd Row Color"
msgstr "Color de la fila impar"
-#: ../gtk/gtktreeview.c:815
+#: ../gtk/gtktreeview.c:912
msgid "Color to use for odd rows"
msgstr "Color a usar para las filas impares"
-#: ../gtk/gtktreeview.c:821
+#: ../gtk/gtktreeview.c:918
msgid "Grid line width"
msgstr "Anchura de la línea de la rejilla"
-#: ../gtk/gtktreeview.c:822
+#: ../gtk/gtktreeview.c:919
msgid "Width, in pixels, of the tree view grid lines"
msgstr "Anchura, en píxeles, de la línea indicadora del foco"
-#: ../gtk/gtktreeview.c:828
+#: ../gtk/gtktreeview.c:925
msgid "Tree line width"
msgstr "Anchura de la línea del árbol"
-#: ../gtk/gtktreeview.c:829
+#: ../gtk/gtktreeview.c:926
msgid "Width, in pixels, of the tree view lines"
msgstr "Anchura, en píxeles, de la línea indicadora del foco"
-#: ../gtk/gtktreeview.c:835
+#: ../gtk/gtktreeview.c:932
msgid "Grid line pattern"
msgstr "Patrón de la línea de la rejilla"
-#: ../gtk/gtktreeview.c:836
+#: ../gtk/gtktreeview.c:933
msgid "Dash pattern used to draw the tree view grid lines"
msgstr ""
"Patrón de guiones utilizado para dibujar las líneas de rejilla de la vista "
"de árbol"
-#: ../gtk/gtktreeview.c:842
+#: ../gtk/gtktreeview.c:939
msgid "Tree line pattern"
msgstr "Patrón de la línea del árbol"
-#: ../gtk/gtktreeview.c:843
+#: ../gtk/gtktreeview.c:940
msgid "Dash pattern used to draw the tree view lines"
msgstr ""
"Patrón de guiones utilizado para dibujar las líneas de la vista de árbol"
@@ -6765,7 +6753,7 @@ msgstr ""
msgid "Whether to display the column"
msgstr "Indica si se debe mostrar la columna"
-#: ../gtk/gtktreeviewcolumn.c:221 ../gtk/gtkwindow.c:656
+#: ../gtk/gtktreeviewcolumn.c:221 ../gtk/gtkwindow.c:657
msgid "Resizable"
msgstr "Redimensionable"
@@ -6886,32 +6874,32 @@ msgstr "Definición del IU combinado"
msgid "An XML string describing the merged UI"
msgstr "Una cadena XML describiendo el IU combinado"
-#: ../gtk/gtkviewport.c:149
+#: ../gtk/gtkviewport.c:155
msgid "Determines how the shadowed box around the viewport is drawn"
msgstr ""
"Determina como es dibujado el marco sombreado alrededor del puerto de visión"
-#: ../gtk/gtkwidget.c:935
+#: ../gtk/gtkwidget.c:876
msgid "Widget name"
msgstr "Nombre del widget"
-#: ../gtk/gtkwidget.c:936
+#: ../gtk/gtkwidget.c:877
msgid "The name of the widget"
msgstr "El nombre del widget"
-#: ../gtk/gtkwidget.c:942
+#: ../gtk/gtkwidget.c:883
msgid "Parent widget"
msgstr "Widget padre"
-#: ../gtk/gtkwidget.c:943
+#: ../gtk/gtkwidget.c:884
msgid "The parent widget of this widget. Must be a Container widget"
msgstr "El widget padre de este widget. Debe ser un widget contenedor"
-#: ../gtk/gtkwidget.c:950
+#: ../gtk/gtkwidget.c:891
msgid "Width request"
msgstr "Petición de anchura"
-#: ../gtk/gtkwidget.c:951
+#: ../gtk/gtkwidget.c:892
msgid ""
"Override for width request of the widget, or -1 if natural request should be "
"used"
@@ -6919,11 +6907,11 @@ msgstr ""
"Sobreescribir el ancho solicitado del widget, o -1 si deber ser utilizado la "
"solicitud natural"
-#: ../gtk/gtkwidget.c:959
+#: ../gtk/gtkwidget.c:900
msgid "Height request"
msgstr "Petición de altura"
-#: ../gtk/gtkwidget.c:960
+#: ../gtk/gtkwidget.c:901
msgid ""
"Override for height request of the widget, or -1 if natural request should "
"be used"
@@ -6931,84 +6919,84 @@ msgstr ""
"Sobreescribir la altura solicitada del widget, o -1 si deber ser utilizada "
"la solicitud natural"
-#: ../gtk/gtkwidget.c:969
+#: ../gtk/gtkwidget.c:910
msgid "Whether the widget is visible"
msgstr "Indica si el widget es visible"
-#: ../gtk/gtkwidget.c:976
+#: ../gtk/gtkwidget.c:917
msgid "Whether the widget responds to input"
msgstr "Indica si el widget responde al ingreso"
-#: ../gtk/gtkwidget.c:982
+#: ../gtk/gtkwidget.c:923
msgid "Application paintable"
msgstr "Pintable por la aplicación"
-#: ../gtk/gtkwidget.c:983
+#: ../gtk/gtkwidget.c:924
msgid "Whether the application will paint directly on the widget"
msgstr "Indica si la aplicación pintará directamente sobre el widget"
-#: ../gtk/gtkwidget.c:989
+#: ../gtk/gtkwidget.c:930
msgid "Can focus"
msgstr "Puede enfocar"
-#: ../gtk/gtkwidget.c:990
+#: ../gtk/gtkwidget.c:931
msgid "Whether the widget can accept the input focus"
msgstr "Indica si el widget puede aceptar el foco de entrada"
-#: ../gtk/gtkwidget.c:996
+#: ../gtk/gtkwidget.c:937
msgid "Has focus"
msgstr "Tiene foco"
-#: ../gtk/gtkwidget.c:997
+#: ../gtk/gtkwidget.c:938
msgid "Whether the widget has the input focus"
msgstr "Indica si el widget tiene el foco de entrada"
-#: ../gtk/gtkwidget.c:1003
+#: ../gtk/gtkwidget.c:944
msgid "Is focus"
msgstr "Tiene el foco"
-#: ../gtk/gtkwidget.c:1004
+#: ../gtk/gtkwidget.c:945
msgid "Whether the widget is the focus widget within the toplevel"
msgstr "Indica si el widget es el widget con foco dentro del nivel superior"
-#: ../gtk/gtkwidget.c:1010
+#: ../gtk/gtkwidget.c:951
msgid "Can default"
msgstr "Puede por omisión"
-#: ../gtk/gtkwidget.c:1011
+#: ../gtk/gtkwidget.c:952
msgid "Whether the widget can be the default widget"
msgstr "Indica si el widget puede ser el widget predeterminado"
-#: ../gtk/gtkwidget.c:1017
+#: ../gtk/gtkwidget.c:958
msgid "Has default"
msgstr "Tiene por omisión"
-#: ../gtk/gtkwidget.c:1018
+#: ../gtk/gtkwidget.c:959
msgid "Whether the widget is the default widget"
msgstr "Indica si el widget es el widget predeterminado"
-#: ../gtk/gtkwidget.c:1024
+#: ../gtk/gtkwidget.c:965
msgid "Receives default"
msgstr "Recibe por omisión"
-#: ../gtk/gtkwidget.c:1025
+#: ../gtk/gtkwidget.c:966
msgid "If TRUE, the widget will receive the default action when it is focused"
msgstr ""
"Si es TRUE el widget recibirá la acción predeterminada cuando obtiene el foco"
-#: ../gtk/gtkwidget.c:1031
+#: ../gtk/gtkwidget.c:972
msgid "Composite child"
msgstr "Hijo compuesto"
-#: ../gtk/gtkwidget.c:1032
+#: ../gtk/gtkwidget.c:973
msgid "Whether the widget is part of a composite widget"
msgstr "Indica si el widget es parte de un widget compuesto"
-#: ../gtk/gtkwidget.c:1038
+#: ../gtk/gtkwidget.c:979
msgid "Style"
msgstr "Estilo"
-#: ../gtk/gtkwidget.c:1039
+#: ../gtk/gtkwidget.c:980
msgid ""
"The style of the widget, which contains information about how it will look "
"(colors etc)"
@@ -7016,186 +7004,186 @@ msgstr ""
"El estilo del widget, que contiene información sobre la apariencia (colores, "
"etc)"
-#: ../gtk/gtkwidget.c:1045
+#: ../gtk/gtkwidget.c:986
msgid "Events"
msgstr "Eventos"
-#: ../gtk/gtkwidget.c:1046
+#: ../gtk/gtkwidget.c:987
msgid "The event mask that decides what kind of GdkEvents this widget gets"
msgstr ""
"La máscara de eventos que decide que tipo de GtkEvents recibe este widget"
-#: ../gtk/gtkwidget.c:1053
+#: ../gtk/gtkwidget.c:994
msgid "Extension events"
msgstr "Eventos de extensión"
-#: ../gtk/gtkwidget.c:1054
+#: ../gtk/gtkwidget.c:995
msgid "The mask that decides what kind of extension events this widget gets"
msgstr ""
"La máscara que decide que clase de eventos de extensión conseguirá este "
"widget"
-#: ../gtk/gtkwidget.c:1061
+#: ../gtk/gtkwidget.c:1002
msgid "No show all"
msgstr "No mostrar todo"
-#: ../gtk/gtkwidget.c:1062
+#: ../gtk/gtkwidget.c:1003
msgid "Whether gtk_widget_show_all() should not affect this widget"
msgstr "Indica que gtk_widget_show_all() no debe afectar a este widget"
-#: ../gtk/gtkwidget.c:1085
+#: ../gtk/gtkwidget.c:1026
msgid "Whether this widget has a tooltip"
msgstr "Indica si el widget tiene un consejo"
-#: ../gtk/gtkwidget.c:1141
+#: ../gtk/gtkwidget.c:1082
msgid "Window"
msgstr "Ventana"
-#: ../gtk/gtkwidget.c:1142
+#: ../gtk/gtkwidget.c:1083
msgid "The widget's window if it is realized"
msgstr "La ventana del widget si se realiza"
-#: ../gtk/gtkwidget.c:1156
+#: ../gtk/gtkwidget.c:1097
msgid "Double Buffered"
msgstr "Búfer doble"
-#: ../gtk/gtkwidget.c:1157
+#: ../gtk/gtkwidget.c:1098
msgid "Whether the widget is double buffered"
msgstr "Indica si el widget tiene búfer doble"
-#: ../gtk/gtkwidget.c:1172
+#: ../gtk/gtkwidget.c:1113
msgid "How to position in extra horizontal space"
msgstr "Cómo posicionar en el espacio horizontal adicional"
-#: ../gtk/gtkwidget.c:1188
+#: ../gtk/gtkwidget.c:1129
msgid "How to position in extra vertical space"
msgstr "Cómo posicionar en el espacio vertical adicional"
-#: ../gtk/gtkwidget.c:1207
+#: ../gtk/gtkwidget.c:1148
msgid "Margin on Left"
msgstr "Margen a la izquierda"
-#: ../gtk/gtkwidget.c:1208
+#: ../gtk/gtkwidget.c:1149
msgid "Pixels of extra space on the left side"
msgstr "Píxeles de espacio adicional en la parte izquierda"
-#: ../gtk/gtkwidget.c:1228
+#: ../gtk/gtkwidget.c:1169
msgid "Margin on Right"
msgstr "Margen a la derecha"
-#: ../gtk/gtkwidget.c:1229
+#: ../gtk/gtkwidget.c:1170
msgid "Pixels of extra space on the right side"
msgstr "Píxeles de espacio adicional en la parte derecha"
-#: ../gtk/gtkwidget.c:1249
+#: ../gtk/gtkwidget.c:1190
msgid "Margin on Top"
msgstr "Margen arriba"
-#: ../gtk/gtkwidget.c:1250
+#: ../gtk/gtkwidget.c:1191
msgid "Pixels of extra space on the top side"
msgstr "Píxeles de espacio adicional en la parte superior"
-#: ../gtk/gtkwidget.c:1270
+#: ../gtk/gtkwidget.c:1211
msgid "Margin on Bottom"
msgstr "Margen abajo"
-#: ../gtk/gtkwidget.c:1271
+#: ../gtk/gtkwidget.c:1212
msgid "Pixels of extra space on the bottom side"
msgstr "Píxeles de espacio adicional en la parte inferior"
-#: ../gtk/gtkwidget.c:1288
+#: ../gtk/gtkwidget.c:1229
msgid "All Margins"
msgstr "Todos los márgenes"
-#: ../gtk/gtkwidget.c:1289
+#: ../gtk/gtkwidget.c:1230
msgid "Pixels of extra space on all four sides"
msgstr "Píxeles de espacio adicionales en las cuatro partes"
-#: ../gtk/gtkwidget.c:1322
+#: ../gtk/gtkwidget.c:1263
msgid "Horizontal Expand"
msgstr "Expansión horizontal"
-#: ../gtk/gtkwidget.c:1323
+#: ../gtk/gtkwidget.c:1264
msgid "Whether widget wants more horizontal space"
msgstr "Indica si el widget quiere usar más espacio horizontal"
-#: ../gtk/gtkwidget.c:1337
+#: ../gtk/gtkwidget.c:1278
msgid "Horizontal Expand Set"
msgstr "Ajuste de expansión horizontal"
-#: ../gtk/gtkwidget.c:1338
+#: ../gtk/gtkwidget.c:1279
msgid "Whether to use the hexpand property"
msgstr "Indica si se debe usar la propiedad hexpand"
-#: ../gtk/gtkwidget.c:1352
+#: ../gtk/gtkwidget.c:1293
msgid "Vertical Expand"
msgstr "Expansión vertial"
-#: ../gtk/gtkwidget.c:1353
+#: ../gtk/gtkwidget.c:1294
msgid "Whether widget wants more vertical space"
msgstr "Indica si el widget quiere usar más espacio vertical"
-#: ../gtk/gtkwidget.c:1367
+#: ../gtk/gtkwidget.c:1308
msgid "Vertical Expand Set"
msgstr "Ajuste de expansión vertical"
-#: ../gtk/gtkwidget.c:1368
+#: ../gtk/gtkwidget.c:1309
msgid "Whether to use the vexpand property"
msgstr "Indica si se debe usar la propiedad vexpand"
-#: ../gtk/gtkwidget.c:1382
+#: ../gtk/gtkwidget.c:1323
msgid "Expand Both"
msgstr "Expandir en ambas"
-#: ../gtk/gtkwidget.c:1383
+#: ../gtk/gtkwidget.c:1324
msgid "Whether widget wants to expand in both directions"
msgstr "Indica si el widget quiere expandirse en ambas direcciones"
-#: ../gtk/gtkwidget.c:3037
+#: ../gtk/gtkwidget.c:2963
msgid "Interior Focus"
msgstr "Foco interior"
-#: ../gtk/gtkwidget.c:3038
+#: ../gtk/gtkwidget.c:2964
msgid "Whether to draw the focus indicator inside widgets"
msgstr "Indica si se ha de dibujar el indicador del foco dentro de los widgets"
-#: ../gtk/gtkwidget.c:3044
+#: ../gtk/gtkwidget.c:2970
msgid "Focus linewidth"
msgstr "Dar foco al ancho de línea"
-#: ../gtk/gtkwidget.c:3045
+#: ../gtk/gtkwidget.c:2971
msgid "Width, in pixels, of the focus indicator line"
msgstr "Anchura, en píxeles, de la línea indicadora del foco"
-#: ../gtk/gtkwidget.c:3051
+#: ../gtk/gtkwidget.c:2977
msgid "Focus line dash pattern"
msgstr "Dar foco a la línea con patrón punteado"
-#: ../gtk/gtkwidget.c:3052
+#: ../gtk/gtkwidget.c:2978
msgid "Dash pattern used to draw the focus indicator"
msgstr "Patrón punteado utilizado para dibujar el indicador de foco"
-#: ../gtk/gtkwidget.c:3057
+#: ../gtk/gtkwidget.c:2983
msgid "Focus padding"
msgstr "Relleno del foco"
-#: ../gtk/gtkwidget.c:3058
+#: ../gtk/gtkwidget.c:2984
msgid "Width, in pixels, between focus indicator and the widget 'box'"
msgstr "Anchura, en píxeles, entre el indicador de foco y la «caja» del widget"
-#: ../gtk/gtkwidget.c:3063
+#: ../gtk/gtkwidget.c:2989
msgid "Cursor color"
msgstr "Color del cursor"
-#: ../gtk/gtkwidget.c:3064
+#: ../gtk/gtkwidget.c:2990
msgid "Color with which to draw insertion cursor"
msgstr "Color con el cual dibujar el cursor de inserción"
-#: ../gtk/gtkwidget.c:3069
+#: ../gtk/gtkwidget.c:2995
msgid "Secondary cursor color"
msgstr "Color secundario del cursor"
-#: ../gtk/gtkwidget.c:3070
+#: ../gtk/gtkwidget.c:2996
msgid ""
"Color with which to draw the secondary insertion cursor when editing mixed "
"right-to-left and left-to-right text"
@@ -7203,43 +7191,43 @@ msgstr ""
"Color con el cual dibujar el cursor de inserción secundario cuando se esta "
"editando una mezcla de texto de derecha-a-izquierda y izquierda-a-derecha"
-#: ../gtk/gtkwidget.c:3075
+#: ../gtk/gtkwidget.c:3001
msgid "Cursor line aspect ratio"
msgstr "Proporción de la línea del cursor"
-#: ../gtk/gtkwidget.c:3076
+#: ../gtk/gtkwidget.c:3002
msgid "Aspect ratio with which to draw insertion cursor"
msgstr "La proporción con la cual dibujar el cursor de inserción"
-#: ../gtk/gtkwidget.c:3082
+#: ../gtk/gtkwidget.c:3008
msgid "Window dragging"
msgstr "Arrastre de ventana"
-#: ../gtk/gtkwidget.c:3083
+#: ../gtk/gtkwidget.c:3009
msgid "Whether windows can be dragged by clicking on empty areas"
msgstr "Indica si las ventanas se pueden arrastrar pulsando en áreas vacías"
-#: ../gtk/gtkwidget.c:3096
+#: ../gtk/gtkwidget.c:3022
msgid "Unvisited Link Color"
msgstr "Color del enlace no visitado"
-#: ../gtk/gtkwidget.c:3097
+#: ../gtk/gtkwidget.c:3023
msgid "Color of unvisited links"
msgstr "Color de los enlaces no visitados"
-#: ../gtk/gtkwidget.c:3110
+#: ../gtk/gtkwidget.c:3036
msgid "Visited Link Color"
msgstr "Color del enlace visitado"
-#: ../gtk/gtkwidget.c:3111
+#: ../gtk/gtkwidget.c:3037
msgid "Color of visited links"
msgstr "Color de los enlaces visitados"
-#: ../gtk/gtkwidget.c:3125
+#: ../gtk/gtkwidget.c:3051
msgid "Wide Separators"
msgstr "Separadores anchos"
-#: ../gtk/gtkwidget.c:3126
+#: ../gtk/gtkwidget.c:3052
msgid ""
"Whether separators have configurable width and should be drawn using a box "
"instead of a line"
@@ -7247,81 +7235,81 @@ msgstr ""
"Indica si los separadores tienen anchura configurable y deben dibujarse "
"usando una caja en lugar de una línea"
-#: ../gtk/gtkwidget.c:3140
+#: ../gtk/gtkwidget.c:3066
msgid "Separator Width"
msgstr "Anchura del separador"
-#: ../gtk/gtkwidget.c:3141
+#: ../gtk/gtkwidget.c:3067
msgid "The width of separators if wide-separators is TRUE"
msgstr "La anchura de los separadores si «wide-separators« es TRUE"
-#: ../gtk/gtkwidget.c:3155
+#: ../gtk/gtkwidget.c:3081
msgid "Separator Height"
msgstr "Altura del separador"
-#: ../gtk/gtkwidget.c:3156
+#: ../gtk/gtkwidget.c:3082
msgid "The height of separators if \"wide-separators\" is TRUE"
msgstr "La altura de los separadores si «wide-separators» es TRUE"
-#: ../gtk/gtkwidget.c:3170
+#: ../gtk/gtkwidget.c:3096
msgid "Horizontal Scroll Arrow Length"
msgstr "Longitud de la flecha de desplazamiento horizontal"
-#: ../gtk/gtkwidget.c:3171
+#: ../gtk/gtkwidget.c:3097
msgid "The length of horizontal scroll arrows"
msgstr "La longitud de las flechas de desplazamiento horizontal"
-#: ../gtk/gtkwidget.c:3185
+#: ../gtk/gtkwidget.c:3111
msgid "Vertical Scroll Arrow Length"
msgstr "Longitud de las flechas de desplazamiento vertical"
-#: ../gtk/gtkwidget.c:3186
+#: ../gtk/gtkwidget.c:3112
msgid "The length of vertical scroll arrows"
msgstr "La longitud de las flechas de desplazamiento vertical"
-#: ../gtk/gtkwindow.c:614
+#: ../gtk/gtkwindow.c:615
msgid "Window Type"
msgstr "Tipo de ventana"
-#: ../gtk/gtkwindow.c:615
+#: ../gtk/gtkwindow.c:616
msgid "The type of the window"
msgstr "El tipo de la ventana"
-#: ../gtk/gtkwindow.c:623
+#: ../gtk/gtkwindow.c:624
msgid "Window Title"
msgstr "Título de la ventana"
-#: ../gtk/gtkwindow.c:624
+#: ../gtk/gtkwindow.c:625
msgid "The title of the window"
msgstr "El título de la ventana"
-#: ../gtk/gtkwindow.c:631
+#: ../gtk/gtkwindow.c:632
msgid "Window Role"
msgstr "Rol de la ventana"
-#: ../gtk/gtkwindow.c:632
+#: ../gtk/gtkwindow.c:633
msgid "Unique identifier for the window to be used when restoring a session"
msgstr ""
"Identificador único para la ventana para usarlo al restaurar una sesión"
-#: ../gtk/gtkwindow.c:648
+#: ../gtk/gtkwindow.c:649
msgid "Startup ID"
msgstr "ID de inicio"
-#: ../gtk/gtkwindow.c:649
+#: ../gtk/gtkwindow.c:650
msgid "Unique startup identifier for the window used by startup-notification"
msgstr ""
"Identificador único de inicio para la ventana usado por startup-notification"
-#: ../gtk/gtkwindow.c:657
+#: ../gtk/gtkwindow.c:658
msgid "If TRUE, users can resize the window"
msgstr "Si es TRUE los usuario pueden redimensionar la ventana"
-#: ../gtk/gtkwindow.c:664
+#: ../gtk/gtkwindow.c:665
msgid "Modal"
msgstr "Modal"
-#: ../gtk/gtkwindow.c:665
+#: ../gtk/gtkwindow.c:666
msgid ""
"If TRUE, the window is modal (other windows are not usable while this one is "
"up)"
@@ -7329,80 +7317,80 @@ msgstr ""
"Si es TRUE, esta ventana es modal (no se pueden utilizar otras ventanas "
"mientras ésta este encima)"
-#: ../gtk/gtkwindow.c:672
+#: ../gtk/gtkwindow.c:673
msgid "Window Position"
msgstr "Posición de la ventana"
-#: ../gtk/gtkwindow.c:673
+#: ../gtk/gtkwindow.c:674
msgid "The initial position of the window"
msgstr "La posición inicial de la ventana"
-#: ../gtk/gtkwindow.c:681
+#: ../gtk/gtkwindow.c:682
msgid "Default Width"
msgstr "Anchura predeterminada"
-#: ../gtk/gtkwindow.c:682
+#: ../gtk/gtkwindow.c:683
msgid "The default width of the window, used when initially showing the window"
msgstr ""
"El ancho predeterminado de la ventana, utilizado cuando se muestra "
"inicialmente la ventana"
-#: ../gtk/gtkwindow.c:691
+#: ../gtk/gtkwindow.c:692
msgid "Default Height"
msgstr "Altura predeterminada"
-#: ../gtk/gtkwindow.c:692
+#: ../gtk/gtkwindow.c:693
msgid ""
"The default height of the window, used when initially showing the window"
msgstr ""
"La altura predeterminada de la ventana, utilizado cuando se muestra "
"inicialmente la ventana"
-#: ../gtk/gtkwindow.c:701
+#: ../gtk/gtkwindow.c:702
msgid "Destroy with Parent"
msgstr "Destruir con el padre"
-#: ../gtk/gtkwindow.c:702
+#: ../gtk/gtkwindow.c:703
msgid "If this window should be destroyed when the parent is destroyed"
msgstr "Indica si esta ventana debe ser destruida cuando el padre se destruye"
-#: ../gtk/gtkwindow.c:710
+#: ../gtk/gtkwindow.c:711
msgid "Icon for this window"
msgstr "Icono para esta ventana"
-#: ../gtk/gtkwindow.c:716
+#: ../gtk/gtkwindow.c:717
msgid "Mnemonics Visible"
msgstr "Mnemónicos visibles"
-#: ../gtk/gtkwindow.c:717
+#: ../gtk/gtkwindow.c:718
msgid "Whether mnemonics are currently visible in this window"
msgstr "Indica si los mnemónicos son visibles actualmente en esta ventana"
-#: ../gtk/gtkwindow.c:733
+#: ../gtk/gtkwindow.c:734
msgid "Name of the themed icon for this window"
msgstr "Nombre del icono del tema para esta ventana"
-#: ../gtk/gtkwindow.c:748
+#: ../gtk/gtkwindow.c:749
msgid "Is Active"
msgstr "Está activo"
-#: ../gtk/gtkwindow.c:749
+#: ../gtk/gtkwindow.c:750
msgid "Whether the toplevel is the current active window"
msgstr "Indica si el nivel superior es la ventana activa actual"
-#: ../gtk/gtkwindow.c:756
+#: ../gtk/gtkwindow.c:757
msgid "Focus in Toplevel"
msgstr "Foco en el nivel superior"
-#: ../gtk/gtkwindow.c:757
+#: ../gtk/gtkwindow.c:758
msgid "Whether the input focus is within this GtkWindow"
msgstr "Indica si el foco de entrada esta dentro de este GtkWindow"
-#: ../gtk/gtkwindow.c:764
+#: ../gtk/gtkwindow.c:765
msgid "Type hint"
msgstr "Pista de tipo"
-#: ../gtk/gtkwindow.c:765
+#: ../gtk/gtkwindow.c:766
msgid ""
"Hint to help the desktop environment understand what kind of window this is "
"and how to treat it."
@@ -7410,118 +7398,145 @@ msgstr ""
"Pista para ayudar al entorno de escritorio a entender qué clase de ventana "
"es ésta y cómo tratar con ella."
-#: ../gtk/gtkwindow.c:773
+#: ../gtk/gtkwindow.c:774
msgid "Skip taskbar"
msgstr "Ignorar barra de tareas"
-#: ../gtk/gtkwindow.c:774
+#: ../gtk/gtkwindow.c:775
msgid "TRUE if the window should not be in the task bar."
msgstr "TRUE si la ventana no debe estar en la barra de tareas."
-#: ../gtk/gtkwindow.c:781
+#: ../gtk/gtkwindow.c:782
msgid "Skip pager"
msgstr "Ignorar paginador"
-#: ../gtk/gtkwindow.c:782
+#: ../gtk/gtkwindow.c:783
msgid "TRUE if the window should not be in the pager."
msgstr "TRUE si la ventana no debe estar en el paginador."
-#: ../gtk/gtkwindow.c:789
+#: ../gtk/gtkwindow.c:790
msgid "Urgent"
msgstr "Urgente"
-#: ../gtk/gtkwindow.c:790
+#: ../gtk/gtkwindow.c:791
msgid "TRUE if the window should be brought to the user's attention."
msgstr "TRUE si la ventana debe llamar la atención del usuario."
-#: ../gtk/gtkwindow.c:804
+#: ../gtk/gtkwindow.c:805
msgid "Accept focus"
msgstr "Aceptar foco"
-#: ../gtk/gtkwindow.c:805
+#: ../gtk/gtkwindow.c:806
msgid "TRUE if the window should receive the input focus."
msgstr "TRUE si la ventana no debe recibir el foco de entrada."
-#: ../gtk/gtkwindow.c:819
+#: ../gtk/gtkwindow.c:820
msgid "Focus on map"
msgstr "Foco en el mapa"
-#: ../gtk/gtkwindow.c:820
+#: ../gtk/gtkwindow.c:821
msgid "TRUE if the window should receive the input focus when mapped."
msgstr "TRUE si la ventana debe recibir el foco de entrada al ser mapeada."
-#: ../gtk/gtkwindow.c:834
+#: ../gtk/gtkwindow.c:835
msgid "Decorated"
msgstr "Decorado"
-#: ../gtk/gtkwindow.c:835
+#: ../gtk/gtkwindow.c:836
msgid "Whether the window should be decorated by the window manager"
msgstr "Indica si la ventana debe ser decorada por el gestor de ventanas"
-#: ../gtk/gtkwindow.c:849
+#: ../gtk/gtkwindow.c:850
msgid "Deletable"
msgstr "Borrable"
-#: ../gtk/gtkwindow.c:850
+#: ../gtk/gtkwindow.c:851
msgid "Whether the window frame should have a close button"
msgstr "Indica si el marco de la ventana debe tener un botón de cierre"
-#: ../gtk/gtkwindow.c:869
+#: ../gtk/gtkwindow.c:870
msgid "Resize grip"
msgstr "Redimensionar tirador"
-#: ../gtk/gtkwindow.c:870
+#: ../gtk/gtkwindow.c:871
msgid "Specifies whether the window should have a resize grip"
msgstr "Especifica si la ventana debe tener un tirador de redimensión"
-#: ../gtk/gtkwindow.c:884
+#: ../gtk/gtkwindow.c:885
msgid "Resize grip is visible"
msgstr "El tirador de redimensión es visible"
-#: ../gtk/gtkwindow.c:885
+#: ../gtk/gtkwindow.c:886
msgid "Specifies whether the window's resize grip is visible."
msgstr "Indica si el tirador de redimensión de la ventana es visible."
-#: ../gtk/gtkwindow.c:901
+#: ../gtk/gtkwindow.c:902
msgid "Gravity"
msgstr "Gravedad"
-#: ../gtk/gtkwindow.c:902
+#: ../gtk/gtkwindow.c:903
msgid "The window gravity of the window"
msgstr "La gravedad de la ventana"
-#: ../gtk/gtkwindow.c:919
+#: ../gtk/gtkwindow.c:920
msgid "Transient for Window"
msgstr "Transitorio para la ventana"
-#: ../gtk/gtkwindow.c:920
+#: ../gtk/gtkwindow.c:921
msgid "The transient parent of the dialog"
msgstr "El padre transitorio del diálogo"
-#: ../gtk/gtkwindow.c:935
+#: ../gtk/gtkwindow.c:936
msgid "Opacity for Window"
msgstr "Opacidad para la ventana"
-#: ../gtk/gtkwindow.c:936
+#: ../gtk/gtkwindow.c:937
msgid "The opacity of the window, from 0 to 1"
msgstr "La opacidad de la ventana, desde 0 hasta 1"
-#: ../gtk/gtkwindow.c:946 ../gtk/gtkwindow.c:947
+#: ../gtk/gtkwindow.c:947 ../gtk/gtkwindow.c:948
msgid "Width of resize grip"
msgstr "Anchura del tirador de redimensión"
-#: ../gtk/gtkwindow.c:952 ../gtk/gtkwindow.c:953
+#: ../gtk/gtkwindow.c:953 ../gtk/gtkwindow.c:954
msgid "Height of resize grip"
msgstr "Altura del tirador de redimensión"
-#: ../gtk/gtkwindow.c:972
+#: ../gtk/gtkwindow.c:973
msgid "GtkApplication"
msgstr "GtkApplication"
-#: ../gtk/gtkwindow.c:973
+#: ../gtk/gtkwindow.c:974
msgid "The GtkApplication for the window"
msgstr "El GtkApplication para la ventana"
+#~ msgid "Lower"
+#~ msgstr "Inferior"
+
+#~ msgid "Lower limit of ruler"
+#~ msgstr "Límite inferior de la regla"
+
+#~ msgid "Upper"
+#~ msgstr "Superior"
+
+#~ msgid "Upper limit of ruler"
+#~ msgstr "Límite superior de la regla"
+
+#~ msgid "Position of mark on the ruler"
+#~ msgstr "Posición de la etiqueta en la regla"
+
+#~ msgid "Max Size"
+#~ msgstr "Tamaño máximo"
+
+#~ msgid "Maximum size of the ruler"
+#~ msgstr "Tamaño máximo de la regla"
+
+#~ msgid "Metric"
+#~ msgstr "Métrica"
+
+#~ msgid "The metric used for the ruler"
+#~ msgstr "La métrica de la regla"
+
#~ msgid "Horizontal adjustment"
#~ msgstr "Ajuste horizontal"
diff --git a/po-properties/he.po b/po-properties/he.po
index 10c6f6f94f..2bc6dc6ce6 100644
--- a/po-properties/he.po
+++ b/po-properties/he.po
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+.HEAD.he\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-10-26 08:24+0200\n"
-"PO-Revision-Date: 2010-10-26 08:31+0200\n"
+"POT-Creation-Date: 2010-12-04 15:26+0200\n"
+"PO-Revision-Date: 2010-12-04 15:27+0200\n"
"Last-Translator: Yaron Shahrabani <sh.yaron@gmail.com>\n"
"Language-Team: Hebrew <he@li.org>\n"
"MIME-Version: 1.0\n"
@@ -16,63 +16,63 @@ msgstr ""
"Language: he\n"
"X-Generator: KBabel 1.0\n"
-#: ../gdk/gdkdevice.c:99
+#: ../gdk/gdkdevice.c:113
msgid "Device Display"
msgstr "Device Display"
-#: ../gdk/gdkdevice.c:100
+#: ../gdk/gdkdevice.c:114
msgid "Display which the device belongs to"
msgstr "Display which the device belongs to"
-#: ../gdk/gdkdevice.c:114
+#: ../gdk/gdkdevice.c:128
msgid "Device manager"
msgstr "Device manager"
-#: ../gdk/gdkdevice.c:115
+#: ../gdk/gdkdevice.c:129
msgid "Device manager which the device belongs to"
msgstr "Device manager which the device belongs to"
-#: ../gdk/gdkdevice.c:129 ../gdk/gdkdevice.c:130
+#: ../gdk/gdkdevice.c:143 ../gdk/gdkdevice.c:144
msgid "Device name"
msgstr "Device name"
-#: ../gdk/gdkdevice.c:144
+#: ../gdk/gdkdevice.c:158
msgid "Device type"
msgstr "Device type"
-#: ../gdk/gdkdevice.c:145
+#: ../gdk/gdkdevice.c:159
msgid "Device role in the device manager"
msgstr "Device role in the device manager"
-#: ../gdk/gdkdevice.c:161
+#: ../gdk/gdkdevice.c:175
msgid "Associated device"
msgstr "Associated device"
-#: ../gdk/gdkdevice.c:162
+#: ../gdk/gdkdevice.c:176
msgid "Associated pointer or keyboard with this device"
msgstr "Associated pointer or keyboard with this device"
-#: ../gdk/gdkdevice.c:175
+#: ../gdk/gdkdevice.c:189
msgid "Input source"
msgstr "Input source"
-#: ../gdk/gdkdevice.c:176
+#: ../gdk/gdkdevice.c:190
msgid "Source type for the device"
msgstr "Source type for the device"
-#: ../gdk/gdkdevice.c:191 ../gdk/gdkdevice.c:192
+#: ../gdk/gdkdevice.c:205 ../gdk/gdkdevice.c:206
msgid "Input mode for the device"
msgstr "Input mode for the device"
-#: ../gdk/gdkdevice.c:207
+#: ../gdk/gdkdevice.c:221
msgid "Whether the device has a cursor"
msgstr "Whether the device has a cursor"
-#: ../gdk/gdkdevice.c:208
+#: ../gdk/gdkdevice.c:222
msgid "Whether there is a visible cursor following device motion"
msgstr "Whether there is a visible cursor following device motion"
-#: ../gdk/gdkdevice.c:222 ../gdk/gdkdevice.c:223
+#: ../gdk/gdkdevice.c:236 ../gdk/gdkdevice.c:237
msgid "Number of axes in the device"
msgstr "Number of axes in the device"
@@ -84,31 +84,31 @@ msgstr "Display"
msgid "Display for the device manager"
msgstr "Display for the device manager"
-#: ../gdk/gdkdisplaymanager.c:101
+#: ../gdk/gdkdisplaymanager.c:106
msgid "Default Display"
msgstr "Default Display"
-#: ../gdk/gdkdisplaymanager.c:102
+#: ../gdk/gdkdisplaymanager.c:107
msgid "The default display for GDK"
msgstr "The default display for GDK"
-#: ../gdk/gdkscreen.c:74
+#: ../gdk/gdkscreen.c:90
msgid "Font options"
msgstr "Font options"
-#: ../gdk/gdkscreen.c:75
+#: ../gdk/gdkscreen.c:91
msgid "The default font options for the screen"
msgstr "The default font options for the screen"
-#: ../gdk/gdkscreen.c:82
+#: ../gdk/gdkscreen.c:98
msgid "Font resolution"
msgstr "Font resolution"
-#: ../gdk/gdkscreen.c:83
+#: ../gdk/gdkscreen.c:99
msgid "The resolution for fonts on the screen"
msgstr "The resolution for fonts on the screen"
-#: ../gdk/gdkwindow.c:410 ../gdk/gdkwindow.c:411
+#: ../gdk/gdkwindow.c:393 ../gdk/gdkwindow.c:394
msgid "Cursor"
msgstr "Cursor"
@@ -280,9 +280,9 @@ msgstr "Name"
msgid "A unique name for the action."
msgstr "A unique name for the action."
-#: ../gtk/gtkaction.c:241 ../gtk/gtkbutton.c:238 ../gtk/gtkexpander.c:209
-#: ../gtk/gtkframe.c:130 ../gtk/gtklabel.c:549 ../gtk/gtkmenuitem.c:331
-#: ../gtk/gtktoolbutton.c:202 ../gtk/gtktoolitemgroup.c:1571
+#: ../gtk/gtkaction.c:241 ../gtk/gtkbutton.c:226 ../gtk/gtkexpander.c:209
+#: ../gtk/gtkframe.c:130 ../gtk/gtklabel.c:567 ../gtk/gtkmenuitem.c:331
+#: ../gtk/gtktoolbutton.c:202 ../gtk/gtktoolitemgroup.c:1588
msgid "Label"
msgstr "Label"
@@ -319,26 +319,26 @@ msgid "GIcon"
msgstr "GIcon"
#: ../gtk/gtkaction.c:305 ../gtk/gtkcellrendererpixbuf.c:215
-#: ../gtk/gtkimage.c:320 ../gtk/gtkstatusicon.c:253
+#: ../gtk/gtkimage.c:326 ../gtk/gtkstatusicon.c:253
msgid "The GIcon being displayed"
msgstr "The GIcon being displayed"
#: ../gtk/gtkaction.c:325 ../gtk/gtkcellrendererpixbuf.c:180
-#: ../gtk/gtkimage.c:302 ../gtk/gtkprinter.c:174 ../gtk/gtkstatusicon.c:236
+#: ../gtk/gtkimage.c:308 ../gtk/gtkprinter.c:174 ../gtk/gtkstatusicon.c:236
#: ../gtk/gtkwindow.c:733
msgid "Icon Name"
msgstr "Icon Name"
#: ../gtk/gtkaction.c:326 ../gtk/gtkcellrendererpixbuf.c:181
-#: ../gtk/gtkimage.c:303 ../gtk/gtkstatusicon.c:237
+#: ../gtk/gtkimage.c:309 ../gtk/gtkstatusicon.c:237
msgid "The name of the icon from the icon theme"
msgstr "The name of the icon from the icon theme"
-#: ../gtk/gtkaction.c:333 ../gtk/gtktoolitem.c:186
+#: ../gtk/gtkaction.c:333 ../gtk/gtktoolitem.c:195
msgid "Visible when horizontal"
msgstr "Visible when horizontal"
-#: ../gtk/gtkaction.c:334 ../gtk/gtktoolitem.c:187
+#: ../gtk/gtkaction.c:334 ../gtk/gtktoolitem.c:196
msgid ""
"Whether the toolbar item is visible when the toolbar is in a horizontal "
"orientation."
@@ -358,11 +358,11 @@ msgstr ""
"When TRUE, toolitem proxies for this action are represented in the toolbar "
"overflow menu."
-#: ../gtk/gtkaction.c:357 ../gtk/gtktoolitem.c:193
+#: ../gtk/gtkaction.c:357 ../gtk/gtktoolitem.c:202
msgid "Visible when vertical"
msgstr "Visible when vertical"
-#: ../gtk/gtkaction.c:358 ../gtk/gtktoolitem.c:194
+#: ../gtk/gtkaction.c:358 ../gtk/gtktoolitem.c:203
msgid ""
"Whether the toolbar item is visible when the toolbar is in a vertical "
"orientation."
@@ -370,7 +370,7 @@ msgstr ""
"Whether the toolbar item is visible when the toolbar is in a vertical "
"orientation."
-#: ../gtk/gtkaction.c:365 ../gtk/gtktoolitem.c:200
+#: ../gtk/gtkaction.c:365 ../gtk/gtktoolitem.c:209
msgid "Is important"
msgstr "Is important"
@@ -391,7 +391,7 @@ msgid "When TRUE, empty menu proxies for this action are hidden."
msgstr "When TRUE, empty menu proxies for this action are hidden."
#: ../gtk/gtkaction.c:381 ../gtk/gtkactiongroup.c:235
-#: ../gtk/gtkcellrenderer.c:243 ../gtk/gtkwidget.c:975
+#: ../gtk/gtkcellrenderer.c:282 ../gtk/gtkwidget.c:913
msgid "Sensitive"
msgstr "Sensitive"
@@ -401,7 +401,7 @@ msgstr "Whether the action is enabled."
#: ../gtk/gtkaction.c:388 ../gtk/gtkactiongroup.c:242
#: ../gtk/gtkstatusicon.c:287 ../gtk/gtktreeviewcolumn.c:213
-#: ../gtk/gtkwidget.c:968
+#: ../gtk/gtkwidget.c:906
msgid "Visible"
msgstr "Visible"
@@ -421,11 +421,11 @@ msgstr ""
"The GtkActionGroup this GtkAction is associated with, or NULL (for internal "
"use)."
-#: ../gtk/gtkaction.c:414 ../gtk/gtkimagemenuitem.c:172
+#: ../gtk/gtkaction.c:414 ../gtk/gtkimagemenuitem.c:182
msgid "Always show image"
msgstr "Always show image"
-#: ../gtk/gtkaction.c:415 ../gtk/gtkimagemenuitem.c:173
+#: ../gtk/gtkaction.c:415 ../gtk/gtkimagemenuitem.c:183
msgid "Whether the image will always be shown"
msgstr "Whether the image will always be shown"
@@ -458,7 +458,7 @@ msgid "Whether to use the related actions appearance properties"
msgstr "Whether to use the related actions appearance properties"
#: ../gtk/gtkadjustment.c:114 ../gtk/gtkcellrendererprogress.c:126
-#: ../gtk/gtkscalebutton.c:220 ../gtk/gtkspinbutton.c:289
+#: ../gtk/gtkscalebutton.c:220 ../gtk/gtkspinbutton.c:291
msgid "Value"
msgstr "Value"
@@ -510,7 +510,7 @@ msgstr "The page size of the adjustment"
msgid "Horizontal alignment"
msgstr "Horizontal alignment"
-#: ../gtk/gtkalignment.c:128 ../gtk/gtkbutton.c:289
+#: ../gtk/gtkalignment.c:128 ../gtk/gtkbutton.c:277
msgid ""
"Horizontal position of child in available space. 0.0 is left aligned, 1.0 is "
"right aligned"
@@ -522,7 +522,7 @@ msgstr ""
msgid "Vertical alignment"
msgstr "Vertical alignment"
-#: ../gtk/gtkalignment.c:138 ../gtk/gtkbutton.c:308
+#: ../gtk/gtkalignment.c:138 ../gtk/gtkbutton.c:296
msgid ""
"Vertical position of child in available space. 0.0 is top aligned, 1.0 is "
"bottom aligned"
@@ -602,7 +602,7 @@ msgstr "Arrow shadow"
msgid "Appearance of the shadow surrounding the arrow"
msgstr "Appearance of the shadow surrounding the arrow"
-#: ../gtk/gtkarrow.c:127 ../gtk/gtkmenu.c:730 ../gtk/gtkmenuitem.c:394
+#: ../gtk/gtkarrow.c:127 ../gtk/gtkmenu.c:731 ../gtk/gtkmenuitem.c:394
msgid "Arrow Scaling"
msgstr "Arrow Scaling"
@@ -610,7 +610,7 @@ msgstr "Arrow Scaling"
msgid "Amount of space used up by arrow"
msgstr "Amount of space used up by arrow"
-#: ../gtk/gtkaspectframe.c:109 ../gtk/gtkwidget.c:1171
+#: ../gtk/gtkaspectframe.c:109 ../gtk/gtkwidget.c:1109
msgid "Horizontal Alignment"
msgstr "Horizontal Alignment"
@@ -618,7 +618,7 @@ msgstr "Horizontal Alignment"
msgid "X alignment of the child"
msgstr "X alignment of the child"
-#: ../gtk/gtkaspectframe.c:116 ../gtk/gtkwidget.c:1187
+#: ../gtk/gtkaspectframe.c:116 ../gtk/gtkwidget.c:1125
msgid "Vertical Alignment"
msgstr "Vertical Alignment"
@@ -642,99 +642,99 @@ msgstr "Obey child"
msgid "Force aspect ratio to match that of the frame's child"
msgstr "Force aspect ratio to match that of the frame's child"
-#: ../gtk/gtkassistant.c:310
+#: ../gtk/gtkassistant.c:327
msgid "Header Padding"
msgstr "Header Padding"
-#: ../gtk/gtkassistant.c:311
+#: ../gtk/gtkassistant.c:328
msgid "Number of pixels around the header."
msgstr "Number of pixels around the header."
-#: ../gtk/gtkassistant.c:318
+#: ../gtk/gtkassistant.c:335
msgid "Content Padding"
msgstr "Content Padding"
-#: ../gtk/gtkassistant.c:319
+#: ../gtk/gtkassistant.c:336
msgid "Number of pixels around the content pages."
msgstr "Number of pixels around the content pages."
-#: ../gtk/gtkassistant.c:335
+#: ../gtk/gtkassistant.c:352
msgid "Page type"
msgstr "Page type"
-#: ../gtk/gtkassistant.c:336
+#: ../gtk/gtkassistant.c:353
msgid "The type of the assistant page"
msgstr "The type of the assistant page"
-#: ../gtk/gtkassistant.c:353
+#: ../gtk/gtkassistant.c:370
msgid "Page title"
msgstr "Page title"
-#: ../gtk/gtkassistant.c:354
+#: ../gtk/gtkassistant.c:371
msgid "The title of the assistant page"
msgstr "The title of the assistant page"
-#: ../gtk/gtkassistant.c:370
+#: ../gtk/gtkassistant.c:387
msgid "Header image"
msgstr "Header image"
-#: ../gtk/gtkassistant.c:371
+#: ../gtk/gtkassistant.c:388
msgid "Header image for the assistant page"
msgstr "Header image for the assistant page"
-#: ../gtk/gtkassistant.c:387
+#: ../gtk/gtkassistant.c:404
msgid "Sidebar image"
msgstr "Sidebar image"
-#: ../gtk/gtkassistant.c:388
+#: ../gtk/gtkassistant.c:405
msgid "Sidebar image for the assistant page"
msgstr "Sidebar image for the assistant page"
-#: ../gtk/gtkassistant.c:403
+#: ../gtk/gtkassistant.c:420
msgid "Page complete"
msgstr "Page complete"
-#: ../gtk/gtkassistant.c:404
+#: ../gtk/gtkassistant.c:421
msgid "Whether all required fields on the page have been filled out"
msgstr "Whether all required fields on the page have been filled out"
-#: ../gtk/gtkbbox.c:135
+#: ../gtk/gtkbbox.c:152
msgid "Minimum child width"
msgstr "Minimum child width"
-#: ../gtk/gtkbbox.c:136
+#: ../gtk/gtkbbox.c:153
msgid "Minimum width of buttons inside the box"
msgstr "Minimum width of buttons inside the box"
-#: ../gtk/gtkbbox.c:144
+#: ../gtk/gtkbbox.c:161
msgid "Minimum child height"
msgstr "Minimum child height"
-#: ../gtk/gtkbbox.c:145
+#: ../gtk/gtkbbox.c:162
msgid "Minimum height of buttons inside the box"
msgstr "Minimum height of buttons inside the box"
-#: ../gtk/gtkbbox.c:153
+#: ../gtk/gtkbbox.c:170
msgid "Child internal width padding"
msgstr "Child internal width padding"
-#: ../gtk/gtkbbox.c:154
+#: ../gtk/gtkbbox.c:171
msgid "Amount to increase child's size on either side"
msgstr "Amount to increase child's size on either side"
-#: ../gtk/gtkbbox.c:162
+#: ../gtk/gtkbbox.c:179
msgid "Child internal height padding"
msgstr "Child internal height padding"
-#: ../gtk/gtkbbox.c:163
+#: ../gtk/gtkbbox.c:180
msgid "Amount to increase child's size on the top and bottom"
msgstr "Amount to increase child's size on the top and bottom"
-#: ../gtk/gtkbbox.c:171
+#: ../gtk/gtkbbox.c:188
msgid "Layout style"
msgstr "Layout style"
-#: ../gtk/gtkbbox.c:172
+#: ../gtk/gtkbbox.c:189
msgid ""
"How to lay out the buttons in the box. Possible values are: spread, edge, "
"start and end"
@@ -742,11 +742,11 @@ msgstr ""
"How to lay out the buttons in the box. Possible values are: spread, edge, "
"start and end"
-#: ../gtk/gtkbbox.c:180
+#: ../gtk/gtkbbox.c:197
msgid "Secondary"
msgstr "Secondary"
-#: ../gtk/gtkbbox.c:181
+#: ../gtk/gtkbbox.c:198
msgid ""
"If TRUE, the child appears in a secondary group of children, suitable for, e."
"g., help buttons"
@@ -754,34 +754,34 @@ msgstr ""
"If TRUE, the child appears in a secondary group of children, suitable for, e."
"g., help buttons"
-#: ../gtk/gtkbox.c:237 ../gtk/gtkexpander.c:233 ../gtk/gtkiconview.c:691
+#: ../gtk/gtkbox.c:241 ../gtk/gtkexpander.c:233 ../gtk/gtkiconview.c:696
#: ../gtk/gtktreeviewcolumn.c:238
msgid "Spacing"
msgstr "Spacing"
-#: ../gtk/gtkbox.c:238
+#: ../gtk/gtkbox.c:242
msgid "The amount of space between children"
msgstr "The amount of space between children"
-#: ../gtk/gtkbox.c:247 ../gtk/gtktable.c:188 ../gtk/gtktoolbar.c:547
-#: ../gtk/gtktoolitemgroup.c:1624
+#: ../gtk/gtkbox.c:251 ../gtk/gtktable.c:193 ../gtk/gtktoolbar.c:553
+#: ../gtk/gtktoolitemgroup.c:1641
msgid "Homogeneous"
msgstr "Homogeneous"
-#: ../gtk/gtkbox.c:248
+#: ../gtk/gtkbox.c:252
msgid "Whether the children should all be the same size"
msgstr "Whether the children should all be the same size"
-#: ../gtk/gtkbox.c:264 ../gtk/gtktoolbar.c:539 ../gtk/gtktoolitemgroup.c:1631
-#: ../gtk/gtktoolpalette.c:1065 ../gtk/gtktreeviewcolumn.c:294
+#: ../gtk/gtkbox.c:268 ../gtk/gtktoolbar.c:545 ../gtk/gtktoolitemgroup.c:1648
+#: ../gtk/gtktoolpalette.c:1092 ../gtk/gtktreeviewcolumn.c:294
msgid "Expand"
msgstr "Expand"
-#: ../gtk/gtkbox.c:265
+#: ../gtk/gtkbox.c:269
msgid "Whether the child should receive extra space when the parent grows"
msgstr "Whether the child should receive extra space when the parent grows"
-#: ../gtk/gtkbox.c:281 ../gtk/gtktoolitemgroup.c:1638
+#: ../gtk/gtkbox.c:281 ../gtk/gtktoolitemgroup.c:1655
msgid "Fill"
msgstr "Fill"
@@ -805,7 +805,7 @@ msgstr "Extra space to put between the child and its neighbors, in pixels"
msgid "Pack type"
msgstr "Pack type"
-#: ../gtk/gtkbox.c:297 ../gtk/gtknotebook.c:786
+#: ../gtk/gtkbox.c:297 ../gtk/gtknotebook.c:793
msgid ""
"A GtkPackType indicating whether the child is packed with reference to the "
"start or end of the parent"
@@ -813,12 +813,12 @@ msgstr ""
"A GtkPackType indicating whether the child is packed with reference to the "
"start or end of the parent"
-#: ../gtk/gtkbox.c:303 ../gtk/gtknotebook.c:757 ../gtk/gtkpaned.c:271
-#: ../gtk/gtkruler.c:158 ../gtk/gtktoolitemgroup.c:1652
+#: ../gtk/gtkbox.c:303 ../gtk/gtknotebook.c:764 ../gtk/gtkpaned.c:327
+#: ../gtk/gtktoolitemgroup.c:1669
msgid "Position"
msgstr "Position"
-#: ../gtk/gtkbox.c:304 ../gtk/gtknotebook.c:758
+#: ../gtk/gtkbox.c:304 ../gtk/gtknotebook.c:765
msgid "The index of the child in the parent"
msgstr "The index of the child in the parent"
@@ -830,7 +830,7 @@ msgstr "Translation Domain"
msgid "The translation domain used by gettext"
msgstr "The translation domain used by gettext"
-#: ../gtk/gtkbutton.c:239
+#: ../gtk/gtkbutton.c:227
msgid ""
"Text of the label widget inside the button, if the button contains a label "
"widget"
@@ -838,12 +838,12 @@ msgstr ""
"Text of the label widget inside the button, if the button contains a label "
"widget"
-#: ../gtk/gtkbutton.c:246 ../gtk/gtkexpander.c:217 ../gtk/gtklabel.c:570
+#: ../gtk/gtkbutton.c:234 ../gtk/gtkexpander.c:217 ../gtk/gtklabel.c:588
#: ../gtk/gtkmenuitem.c:346 ../gtk/gtktoolbutton.c:209
msgid "Use underline"
msgstr "Use underline"
-#: ../gtk/gtkbutton.c:247 ../gtk/gtkexpander.c:218 ../gtk/gtklabel.c:571
+#: ../gtk/gtkbutton.c:235 ../gtk/gtkexpander.c:218 ../gtk/gtklabel.c:589
#: ../gtk/gtkmenuitem.c:347
msgid ""
"If set, an underline in the text indicates the next character should be used "
@@ -852,70 +852,70 @@ msgstr ""
"If set, an underline in the text indicates the next character should be used "
"for the mnemonic accelerator key"
-#: ../gtk/gtkbutton.c:254 ../gtk/gtkimagemenuitem.c:153
+#: ../gtk/gtkbutton.c:242 ../gtk/gtkimagemenuitem.c:163
msgid "Use stock"
msgstr "Use stock"
-#: ../gtk/gtkbutton.c:255
+#: ../gtk/gtkbutton.c:243
msgid ""
"If set, the label is used to pick a stock item instead of being displayed"
msgstr ""
"If set, the label is used to pick a stock item instead of being displayed"
-#: ../gtk/gtkbutton.c:262 ../gtk/gtkcombobox.c:861
+#: ../gtk/gtkbutton.c:250 ../gtk/gtkcombobox.c:865
#: ../gtk/gtkfilechooserbutton.c:383
msgid "Focus on click"
msgstr "Focus on click"
-#: ../gtk/gtkbutton.c:263 ../gtk/gtkfilechooserbutton.c:384
+#: ../gtk/gtkbutton.c:251 ../gtk/gtkfilechooserbutton.c:384
msgid "Whether the button grabs focus when it is clicked with the mouse"
msgstr "Whether the button grabs focus when it is clicked with the mouse"
-#: ../gtk/gtkbutton.c:270
+#: ../gtk/gtkbutton.c:258
msgid "Border relief"
msgstr "Border relief"
-#: ../gtk/gtkbutton.c:271
+#: ../gtk/gtkbutton.c:259
msgid "The border relief style"
msgstr "The border relief style"
-#: ../gtk/gtkbutton.c:288
+#: ../gtk/gtkbutton.c:276
msgid "Horizontal alignment for child"
msgstr "Horizontal alignment for child"
-#: ../gtk/gtkbutton.c:307
+#: ../gtk/gtkbutton.c:295
msgid "Vertical alignment for child"
msgstr "Vertical alignment for child"
-#: ../gtk/gtkbutton.c:324 ../gtk/gtkimagemenuitem.c:138
+#: ../gtk/gtkbutton.c:312 ../gtk/gtkimagemenuitem.c:148
msgid "Image widget"
msgstr "Image widget"
-#: ../gtk/gtkbutton.c:325
+#: ../gtk/gtkbutton.c:313
msgid "Child widget to appear next to the button text"
msgstr "Child widget to appear next to the button text"
-#: ../gtk/gtkbutton.c:339
+#: ../gtk/gtkbutton.c:327
msgid "Image position"
msgstr "Image position"
-#: ../gtk/gtkbutton.c:340
+#: ../gtk/gtkbutton.c:328
msgid "The position of the image relative to the text"
msgstr "The position of the image relative to the text"
-#: ../gtk/gtkbutton.c:460
+#: ../gtk/gtkbutton.c:448
msgid "Default Spacing"
msgstr "Default Spacing"
-#: ../gtk/gtkbutton.c:461
+#: ../gtk/gtkbutton.c:449
msgid "Extra space to add for GTK_CAN_DEFAULT buttons"
msgstr "Extra space to add for GTK_CAN_DEFAULT buttons"
-#: ../gtk/gtkbutton.c:475
+#: ../gtk/gtkbutton.c:463
msgid "Default Outside Spacing"
msgstr "Default Outside Spacing"
-#: ../gtk/gtkbutton.c:476
+#: ../gtk/gtkbutton.c:464
msgid ""
"Extra space to add for GTK_CAN_DEFAULT buttons that is always drawn outside "
"the border"
@@ -923,31 +923,31 @@ msgstr ""
"Extra space to add for GTK_CAN_DEFAULT buttons that is always drawn outside "
"the border"
-#: ../gtk/gtkbutton.c:481
+#: ../gtk/gtkbutton.c:469
msgid "Child X Displacement"
msgstr "Child X Displacement"
-#: ../gtk/gtkbutton.c:482
+#: ../gtk/gtkbutton.c:470
msgid ""
"How far in the x direction to move the child when the button is depressed"
msgstr ""
"How far in the x direction to move the child when the button is depressed"
-#: ../gtk/gtkbutton.c:489
+#: ../gtk/gtkbutton.c:477
msgid "Child Y Displacement"
msgstr "Child Y Displacement"
-#: ../gtk/gtkbutton.c:490
+#: ../gtk/gtkbutton.c:478
msgid ""
"How far in the y direction to move the child when the button is depressed"
msgstr ""
"How far in the y direction to move the child when the button is depressed"
-#: ../gtk/gtkbutton.c:506
+#: ../gtk/gtkbutton.c:494
msgid "Displace focus"
msgstr "Displace focus"
-#: ../gtk/gtkbutton.c:507
+#: ../gtk/gtkbutton.c:495
msgid ""
"Whether the child_displacement_x/_y properties should also affect the focus "
"rectangle"
@@ -955,43 +955,43 @@ msgstr ""
"Whether the child_displacement_x/_y properties should also affect the focus "
"rectangle"
-#: ../gtk/gtkbutton.c:520 ../gtk/gtkentry.c:695 ../gtk/gtkentry.c:1740
+#: ../gtk/gtkbutton.c:508 ../gtk/gtkentry.c:786 ../gtk/gtkentry.c:1831
msgid "Inner Border"
msgstr "Inner Border"
-#: ../gtk/gtkbutton.c:521
+#: ../gtk/gtkbutton.c:509
msgid "Border between button edges and child."
msgstr "Border between button edges and child."
-#: ../gtk/gtkbutton.c:534
+#: ../gtk/gtkbutton.c:522
msgid "Image spacing"
msgstr "Image spacing"
-#: ../gtk/gtkbutton.c:535
+#: ../gtk/gtkbutton.c:523
msgid "Spacing in pixels between the image and label"
msgstr "Spacing in pixels between the image and label"
-#: ../gtk/gtkcalendar.c:470
+#: ../gtk/gtkcalendar.c:475
msgid "Year"
msgstr "Year"
-#: ../gtk/gtkcalendar.c:471
+#: ../gtk/gtkcalendar.c:476
msgid "The selected year"
msgstr "The selected year"
-#: ../gtk/gtkcalendar.c:484
+#: ../gtk/gtkcalendar.c:489
msgid "Month"
msgstr "Month"
-#: ../gtk/gtkcalendar.c:485
+#: ../gtk/gtkcalendar.c:490
msgid "The selected month (as a number between 0 and 11)"
msgstr "The selected month (as a number between 0 and 11)"
-#: ../gtk/gtkcalendar.c:499
+#: ../gtk/gtkcalendar.c:504
msgid "Day"
msgstr "Day"
-#: ../gtk/gtkcalendar.c:500
+#: ../gtk/gtkcalendar.c:505
msgid ""
"The selected day (as a number between 1 and 31, or 0 to unselect the "
"currently selected day)"
@@ -999,83 +999,83 @@ msgstr ""
"The selected day (as a number between 1 and 31, or 0 to unselect the "
"currently selected day)"
-#: ../gtk/gtkcalendar.c:514
+#: ../gtk/gtkcalendar.c:519
msgid "Show Heading"
msgstr "Show Heading"
-#: ../gtk/gtkcalendar.c:515
+#: ../gtk/gtkcalendar.c:520
msgid "If TRUE, a heading is displayed"
msgstr "If TRUE, a heading is displayed"
-#: ../gtk/gtkcalendar.c:529
+#: ../gtk/gtkcalendar.c:534
msgid "Show Day Names"
msgstr "Show Day Names"
-#: ../gtk/gtkcalendar.c:530
+#: ../gtk/gtkcalendar.c:535
msgid "If TRUE, day names are displayed"
msgstr "If TRUE, day names are displayed"
-#: ../gtk/gtkcalendar.c:543
+#: ../gtk/gtkcalendar.c:548
msgid "No Month Change"
msgstr "No Month Change"
-#: ../gtk/gtkcalendar.c:544
+#: ../gtk/gtkcalendar.c:549
msgid "If TRUE, the selected month cannot be changed"
msgstr "If TRUE, the selected month cannot be changed"
-#: ../gtk/gtkcalendar.c:558
+#: ../gtk/gtkcalendar.c:563
msgid "Show Week Numbers"
msgstr "Show Week Numbers"
-#: ../gtk/gtkcalendar.c:559
+#: ../gtk/gtkcalendar.c:564
msgid "If TRUE, week numbers are displayed"
msgstr "If TRUE, week numbers are displayed"
-#: ../gtk/gtkcalendar.c:574
+#: ../gtk/gtkcalendar.c:579
msgid "Details Width"
msgstr "Details Width"
-#: ../gtk/gtkcalendar.c:575
+#: ../gtk/gtkcalendar.c:580
msgid "Details width in characters"
msgstr "Details width in characters"
-#: ../gtk/gtkcalendar.c:590
+#: ../gtk/gtkcalendar.c:595
msgid "Details Height"
msgstr "Details Height"
-#: ../gtk/gtkcalendar.c:591
+#: ../gtk/gtkcalendar.c:596
msgid "Details height in rows"
msgstr "Details height in rows"
-#: ../gtk/gtkcalendar.c:607
+#: ../gtk/gtkcalendar.c:612
msgid "Show Details"
msgstr "Show Details"
-#: ../gtk/gtkcalendar.c:608
+#: ../gtk/gtkcalendar.c:613
msgid "If TRUE, details are shown"
msgstr "If TRUE, details are shown"
-#: ../gtk/gtkcalendar.c:620
+#: ../gtk/gtkcalendar.c:625
msgid "Inner border"
msgstr "Inner border"
-#: ../gtk/gtkcalendar.c:621
+#: ../gtk/gtkcalendar.c:626
msgid "Inner border space"
msgstr "Inner border space"
-#: ../gtk/gtkcalendar.c:632
+#: ../gtk/gtkcalendar.c:637
msgid "Vertical separation"
msgstr "Vertical separation"
-#: ../gtk/gtkcalendar.c:633
+#: ../gtk/gtkcalendar.c:638
msgid "Space between day headers and main area"
msgstr "Space between day headers and main area"
-#: ../gtk/gtkcalendar.c:644
+#: ../gtk/gtkcalendar.c:649
msgid "Horizontal separation"
msgstr "Horizontal separation"
-#: ../gtk/gtkcalendar.c:645
+#: ../gtk/gtkcalendar.c:650
msgid "Space between week headers and main area"
msgstr "Space between week headers and main area"
@@ -1119,127 +1119,127 @@ msgstr "Accelerator Mode"
msgid "The type of accelerators"
msgstr "The type of accelerators"
-#: ../gtk/gtkcellrenderer.c:227
+#: ../gtk/gtkcellrenderer.c:266
msgid "mode"
msgstr "mode"
-#: ../gtk/gtkcellrenderer.c:228
+#: ../gtk/gtkcellrenderer.c:267
msgid "Editable mode of the CellRenderer"
msgstr "Editable mode of the CellRenderer"
-#: ../gtk/gtkcellrenderer.c:236
+#: ../gtk/gtkcellrenderer.c:275
msgid "visible"
msgstr "visible"
-#: ../gtk/gtkcellrenderer.c:237
+#: ../gtk/gtkcellrenderer.c:276
msgid "Display the cell"
msgstr "Display the cell"
-#: ../gtk/gtkcellrenderer.c:244
+#: ../gtk/gtkcellrenderer.c:283
msgid "Display the cell sensitive"
msgstr "Display the cell sensitive"
-#: ../gtk/gtkcellrenderer.c:251
+#: ../gtk/gtkcellrenderer.c:290
msgid "xalign"
msgstr "xalign"
-#: ../gtk/gtkcellrenderer.c:252
+#: ../gtk/gtkcellrenderer.c:291
msgid "The x-align"
msgstr "The x-align"
-#: ../gtk/gtkcellrenderer.c:261
+#: ../gtk/gtkcellrenderer.c:300
msgid "yalign"
msgstr "yalign"
-#: ../gtk/gtkcellrenderer.c:262
+#: ../gtk/gtkcellrenderer.c:301
msgid "The y-align"
msgstr "The y-align"
-#: ../gtk/gtkcellrenderer.c:271
+#: ../gtk/gtkcellrenderer.c:310
msgid "xpad"
msgstr "xpad"
-#: ../gtk/gtkcellrenderer.c:272
+#: ../gtk/gtkcellrenderer.c:311
msgid "The xpad"
msgstr "The xpad"
-#: ../gtk/gtkcellrenderer.c:281
+#: ../gtk/gtkcellrenderer.c:320
msgid "ypad"
msgstr "ypad"
-#: ../gtk/gtkcellrenderer.c:282
+#: ../gtk/gtkcellrenderer.c:321
msgid "The ypad"
msgstr "The ypad"
-#: ../gtk/gtkcellrenderer.c:291
+#: ../gtk/gtkcellrenderer.c:330
msgid "width"
msgstr "width"
-#: ../gtk/gtkcellrenderer.c:292
+#: ../gtk/gtkcellrenderer.c:331
msgid "The fixed width"
msgstr "The fixed width"
-#: ../gtk/gtkcellrenderer.c:301
+#: ../gtk/gtkcellrenderer.c:340
msgid "height"
msgstr "height"
-#: ../gtk/gtkcellrenderer.c:302
+#: ../gtk/gtkcellrenderer.c:341
msgid "The fixed height"
msgstr "The fixed height"
-#: ../gtk/gtkcellrenderer.c:311
+#: ../gtk/gtkcellrenderer.c:350
msgid "Is Expander"
msgstr "Is Expander"
-#: ../gtk/gtkcellrenderer.c:312
+#: ../gtk/gtkcellrenderer.c:351
msgid "Row has children"
msgstr "Row has children"
-#: ../gtk/gtkcellrenderer.c:320
+#: ../gtk/gtkcellrenderer.c:359
msgid "Is Expanded"
msgstr "Is Expanded"
-#: ../gtk/gtkcellrenderer.c:321
+#: ../gtk/gtkcellrenderer.c:360
msgid "Row is an expander row, and is expanded"
msgstr "Row is an expander row, and is expanded"
-#: ../gtk/gtkcellrenderer.c:328
+#: ../gtk/gtkcellrenderer.c:367
msgid "Cell background color name"
msgstr "Cell background color name"
-#: ../gtk/gtkcellrenderer.c:329
+#: ../gtk/gtkcellrenderer.c:368
msgid "Cell background color as a string"
msgstr "Cell background color as a string"
-#: ../gtk/gtkcellrenderer.c:336
+#: ../gtk/gtkcellrenderer.c:375
msgid "Cell background color"
msgstr "Cell background color"
-#: ../gtk/gtkcellrenderer.c:337
+#: ../gtk/gtkcellrenderer.c:376
msgid "Cell background color as a GdkColor"
msgstr "Cell background color as a GdkColor"
-#: ../gtk/gtkcellrenderer.c:350
+#: ../gtk/gtkcellrenderer.c:389
msgid "Cell background RGBA color"
msgstr "Cell background RGBA color"
-#: ../gtk/gtkcellrenderer.c:351
+#: ../gtk/gtkcellrenderer.c:390
msgid "Cell background color as a GdkRGBA"
msgstr "Cell background color as a GdkRGBA"
-#: ../gtk/gtkcellrenderer.c:358
+#: ../gtk/gtkcellrenderer.c:397
msgid "Editing"
msgstr "Editing"
-#: ../gtk/gtkcellrenderer.c:359
+#: ../gtk/gtkcellrenderer.c:398
msgid "Whether the cell renderer is currently in editing mode"
msgstr "Whether the cell renderer is currently in editing mode"
-#: ../gtk/gtkcellrenderer.c:367
+#: ../gtk/gtkcellrenderer.c:406
msgid "Cell background set"
msgstr "Cell background set"
-#: ../gtk/gtkcellrenderer.c:368
+#: ../gtk/gtkcellrenderer.c:407
msgid "Whether this tag affects the cell background color"
msgstr "Whether this tag affects the cell background color"
@@ -1259,7 +1259,7 @@ msgstr "Text Column"
msgid "A column in the data source model to get the strings from"
msgstr "A column in the data source model to get the strings from"
-#: ../gtk/gtkcellrenderercombo.c:150 ../gtk/gtkcombobox.c:928
+#: ../gtk/gtkcellrenderercombo.c:150 ../gtk/gtkcombobox.c:932
msgid "Has Entry"
msgstr "Has Entry"
@@ -1291,7 +1291,7 @@ msgstr "Pixbuf Expander Closed"
msgid "Pixbuf for closed expander"
msgstr "Pixbuf for closed expander"
-#: ../gtk/gtkcellrendererpixbuf.c:144 ../gtk/gtkimage.c:244
+#: ../gtk/gtkcellrendererpixbuf.c:144 ../gtk/gtkimage.c:250
#: ../gtk/gtkstatusicon.c:228
msgid "Stock ID"
msgstr "Stock ID"
@@ -1325,7 +1325,7 @@ msgstr "Follow State"
msgid "Whether the rendered pixbuf should be colorized according to the state"
msgstr "Whether the rendered pixbuf should be colorized according to the state"
-#: ../gtk/gtkcellrendererpixbuf.c:214 ../gtk/gtkimage.c:319
+#: ../gtk/gtkcellrendererpixbuf.c:214 ../gtk/gtkimage.c:325
#: ../gtk/gtkwindow.c:710
msgid "Icon"
msgstr "Icon"
@@ -1334,10 +1334,10 @@ msgstr "Icon"
msgid "Value of the progress bar"
msgstr "Value of the progress bar"
-#: ../gtk/gtkcellrendererprogress.c:144 ../gtk/gtkcellrenderertext.c:233
-#: ../gtk/gtkentry.c:738 ../gtk/gtkentrybuffer.c:352
-#: ../gtk/gtkmessagedialog.c:226 ../gtk/gtkprogressbar.c:145
-#: ../gtk/gtktextbuffer.c:210
+#: ../gtk/gtkcellrendererprogress.c:144 ../gtk/gtkcellrenderertext.c:247
+#: ../gtk/gtkentry.c:829 ../gtk/gtkentrybuffer.c:352
+#: ../gtk/gtkmessagedialog.c:226 ../gtk/gtkprogressbar.c:177
+#: ../gtk/gtktextbuffer.c:209
msgid "Text"
msgstr "Text"
@@ -1377,21 +1377,21 @@ msgstr "Text y alignment"
msgid "The vertical text alignment, from 0 (top) to 1 (bottom)."
msgstr "The vertical text alignment, from 0 (top) to 1 (bottom)."
-#: ../gtk/gtkcellrendererprogress.c:214 ../gtk/gtkprogressbar.c:121
-#: ../gtk/gtkrange.c:433
+#: ../gtk/gtkcellrendererprogress.c:214 ../gtk/gtkprogressbar.c:153
+#: ../gtk/gtkrange.c:440
msgid "Inverted"
msgstr "Inverted"
-#: ../gtk/gtkcellrendererprogress.c:215 ../gtk/gtkprogressbar.c:122
+#: ../gtk/gtkcellrendererprogress.c:215 ../gtk/gtkprogressbar.c:154
msgid "Invert the direction in which the progress bar grows"
msgstr "Invert the direction in which the progress bar grows"
-#: ../gtk/gtkcellrendererspin.c:91 ../gtk/gtkrange.c:425
-#: ../gtk/gtkscalebutton.c:239 ../gtk/gtkspinbutton.c:228
+#: ../gtk/gtkcellrendererspin.c:91 ../gtk/gtkrange.c:432
+#: ../gtk/gtkscalebutton.c:239 ../gtk/gtkspinbutton.c:230
msgid "Adjustment"
msgstr "Adjustment"
-#: ../gtk/gtkcellrendererspin.c:92 ../gtk/gtkspinbutton.c:229
+#: ../gtk/gtkcellrendererspin.c:92 ../gtk/gtkspinbutton.c:231
msgid "The adjustment that holds the value of the spin button"
msgstr "The adjustment that holds the value of the spin button"
@@ -1399,22 +1399,23 @@ msgstr "The adjustment that holds the value of the spin button"
msgid "Climb rate"
msgstr "Climb rate"
-#: ../gtk/gtkcellrendererspin.c:108 ../gtk/gtkspinbutton.c:237
+#: ../gtk/gtkcellrendererspin.c:108 ../gtk/gtkspinbutton.c:239
msgid "The acceleration rate when you hold down a button"
msgstr "The acceleration rate when you hold down a button"
-#: ../gtk/gtkcellrendererspin.c:121 ../gtk/gtkscale.c:244
-#: ../gtk/gtkspinbutton.c:246
+#: ../gtk/gtkcellrendererspin.c:121 ../gtk/gtkscale.c:254
+#: ../gtk/gtkspinbutton.c:248
msgid "Digits"
msgstr "Digits"
-#: ../gtk/gtkcellrendererspin.c:122 ../gtk/gtkspinbutton.c:247
+#: ../gtk/gtkcellrendererspin.c:122 ../gtk/gtkspinbutton.c:249
msgid "The number of decimal places to display"
msgstr "The number of decimal places to display"
#: ../gtk/gtkcellrendererspinner.c:119 ../gtk/gtkcheckmenuitem.c:105
-#: ../gtk/gtkmenu.c:520 ../gtk/gtkspinner.c:131 ../gtk/gtktoggleaction.c:133
-#: ../gtk/gtktogglebutton.c:122 ../gtk/gtktoggletoolbutton.c:112
+#: ../gtk/gtkmenu.c:521 ../gtk/gtkspinner.c:131 ../gtk/gtkswitch.c:738
+#: ../gtk/gtktoggleaction.c:133 ../gtk/gtktogglebutton.c:125
+#: ../gtk/gtktoggletoolbutton.c:112
msgid "Active"
msgstr "Active"
@@ -1430,189 +1431,189 @@ msgstr "Pulse of the spinner"
msgid "The GtkIconSize value that specifies the size of the rendered spinner"
msgstr "The GtkIconSize value that specifies the size of the rendered spinner"
-#: ../gtk/gtkcellrenderertext.c:234
+#: ../gtk/gtkcellrenderertext.c:248
msgid "Text to render"
msgstr "Text to render"
-#: ../gtk/gtkcellrenderertext.c:241
+#: ../gtk/gtkcellrenderertext.c:255
msgid "Markup"
msgstr "Markup"
-#: ../gtk/gtkcellrenderertext.c:242
+#: ../gtk/gtkcellrenderertext.c:256
msgid "Marked up text to render"
msgstr "Marked up text to render"
-#: ../gtk/gtkcellrenderertext.c:249 ../gtk/gtklabel.c:556
+#: ../gtk/gtkcellrenderertext.c:263 ../gtk/gtklabel.c:574
msgid "Attributes"
msgstr "Attributes"
-#: ../gtk/gtkcellrenderertext.c:250
+#: ../gtk/gtkcellrenderertext.c:264
msgid "A list of style attributes to apply to the text of the renderer"
msgstr "A list of style attributes to apply to the text of the renderer"
-#: ../gtk/gtkcellrenderertext.c:257
+#: ../gtk/gtkcellrenderertext.c:271
msgid "Single Paragraph Mode"
msgstr "Single Paragraph Mode"
-#: ../gtk/gtkcellrenderertext.c:258
+#: ../gtk/gtkcellrenderertext.c:272
msgid "Whether to keep all text in a single paragraph"
msgstr "Whether to keep all text in a single paragraph"
-#: ../gtk/gtkcellrenderertext.c:266 ../gtk/gtkcellview.c:179
+#: ../gtk/gtkcellrenderertext.c:280 ../gtk/gtkcellview.c:192
#: ../gtk/gtktexttag.c:178
msgid "Background color name"
msgstr "Background color name"
-#: ../gtk/gtkcellrenderertext.c:267 ../gtk/gtkcellview.c:180
+#: ../gtk/gtkcellrenderertext.c:281 ../gtk/gtkcellview.c:193
#: ../gtk/gtktexttag.c:179
msgid "Background color as a string"
msgstr "Background color as a string"
-#: ../gtk/gtkcellrenderertext.c:274 ../gtk/gtkcellview.c:186
+#: ../gtk/gtkcellrenderertext.c:288 ../gtk/gtkcellview.c:199
#: ../gtk/gtktexttag.c:186
msgid "Background color"
msgstr "Background color"
-#: ../gtk/gtkcellrenderertext.c:275 ../gtk/gtkcellview.c:187
+#: ../gtk/gtkcellrenderertext.c:289 ../gtk/gtkcellview.c:200
msgid "Background color as a GdkColor"
msgstr "Background color as a GdkColor"
-#: ../gtk/gtkcellrenderertext.c:289
+#: ../gtk/gtkcellrenderertext.c:303
msgid "Background color as RGBA"
msgstr "Background color as RGBA"
-#: ../gtk/gtkcellrenderertext.c:290 ../gtk/gtkcellview.c:201
+#: ../gtk/gtkcellrenderertext.c:304 ../gtk/gtkcellview.c:214
msgid "Background color as a GdkRGBA"
msgstr "Background color as a GdkRGBA"
-#: ../gtk/gtkcellrenderertext.c:296 ../gtk/gtktexttag.c:202
+#: ../gtk/gtkcellrenderertext.c:310 ../gtk/gtktexttag.c:202
msgid "Foreground color name"
msgstr "Foreground color name"
-#: ../gtk/gtkcellrenderertext.c:297 ../gtk/gtktexttag.c:203
+#: ../gtk/gtkcellrenderertext.c:311 ../gtk/gtktexttag.c:203
msgid "Foreground color as a string"
msgstr "Foreground color as a string"
-#: ../gtk/gtkcellrenderertext.c:304 ../gtk/gtktexttag.c:210
+#: ../gtk/gtkcellrenderertext.c:318 ../gtk/gtktexttag.c:210
#: ../gtk/gtktrayicon-x11.c:133
msgid "Foreground color"
msgstr "Foreground color"
-#: ../gtk/gtkcellrenderertext.c:305
+#: ../gtk/gtkcellrenderertext.c:319
msgid "Foreground color as a GdkColor"
msgstr "Foreground color as a GdkColor"
-#: ../gtk/gtkcellrenderertext.c:319
+#: ../gtk/gtkcellrenderertext.c:333
msgid "Foreground color as RGBA"
msgstr "Foreground color as RGBA"
-#: ../gtk/gtkcellrenderertext.c:320
+#: ../gtk/gtkcellrenderertext.c:334
msgid "Foreground color as a GdkRGBA"
msgstr "Foreground color as a GdkRGBA"
-#: ../gtk/gtkcellrenderertext.c:328 ../gtk/gtkentry.c:662
-#: ../gtk/gtktexttag.c:227 ../gtk/gtktextview.c:667
+#: ../gtk/gtkcellrenderertext.c:342 ../gtk/gtkentry.c:753
+#: ../gtk/gtktexttag.c:227 ../gtk/gtktextview.c:686
msgid "Editable"
msgstr "Editable"
-#: ../gtk/gtkcellrenderertext.c:329 ../gtk/gtktexttag.c:228
-#: ../gtk/gtktextview.c:668
+#: ../gtk/gtkcellrenderertext.c:343 ../gtk/gtktexttag.c:228
+#: ../gtk/gtktextview.c:687
msgid "Whether the text can be modified by the user"
msgstr "Whether the text can be modified by the user"
-#: ../gtk/gtkcellrenderertext.c:336 ../gtk/gtkcellrenderertext.c:344
+#: ../gtk/gtkcellrenderertext.c:350 ../gtk/gtkcellrenderertext.c:358
#: ../gtk/gtktexttag.c:243 ../gtk/gtktexttag.c:251
msgid "Font"
msgstr "Font"
-#: ../gtk/gtkcellrenderertext.c:337 ../gtk/gtktexttag.c:244
+#: ../gtk/gtkcellrenderertext.c:351 ../gtk/gtktexttag.c:244
msgid "Font description as a string, e.g. \"Sans Italic 12\""
msgstr "Font description as a string, e.g. \"Sans Italic 12\""
-#: ../gtk/gtkcellrenderertext.c:345 ../gtk/gtktexttag.c:252
+#: ../gtk/gtkcellrenderertext.c:359 ../gtk/gtktexttag.c:252
msgid "Font description as a PangoFontDescription struct"
msgstr "Font description as a PangoFontDescription struct"
-#: ../gtk/gtkcellrenderertext.c:353 ../gtk/gtktexttag.c:259
+#: ../gtk/gtkcellrenderertext.c:367 ../gtk/gtktexttag.c:259
msgid "Font family"
msgstr "Font family"
-#: ../gtk/gtkcellrenderertext.c:354 ../gtk/gtktexttag.c:260
+#: ../gtk/gtkcellrenderertext.c:368 ../gtk/gtktexttag.c:260
msgid "Name of the font family, e.g. Sans, Helvetica, Times, Monospace"
msgstr "Name of the font family, e.g. Sans, Helvetica, Times, Monospace"
-#: ../gtk/gtkcellrenderertext.c:361 ../gtk/gtkcellrenderertext.c:362
+#: ../gtk/gtkcellrenderertext.c:375 ../gtk/gtkcellrenderertext.c:376
#: ../gtk/gtktexttag.c:267
msgid "Font style"
msgstr "Font style"
-#: ../gtk/gtkcellrenderertext.c:370 ../gtk/gtkcellrenderertext.c:371
+#: ../gtk/gtkcellrenderertext.c:384 ../gtk/gtkcellrenderertext.c:385
#: ../gtk/gtktexttag.c:276
msgid "Font variant"
msgstr "Font variant"
-#: ../gtk/gtkcellrenderertext.c:379 ../gtk/gtkcellrenderertext.c:380
+#: ../gtk/gtkcellrenderertext.c:393 ../gtk/gtkcellrenderertext.c:394
#: ../gtk/gtktexttag.c:285
msgid "Font weight"
msgstr "Font weight"
-#: ../gtk/gtkcellrenderertext.c:389 ../gtk/gtkcellrenderertext.c:390
+#: ../gtk/gtkcellrenderertext.c:403 ../gtk/gtkcellrenderertext.c:404
#: ../gtk/gtktexttag.c:296
msgid "Font stretch"
msgstr "Font stretch"
-#: ../gtk/gtkcellrenderertext.c:398 ../gtk/gtkcellrenderertext.c:399
+#: ../gtk/gtkcellrenderertext.c:412 ../gtk/gtkcellrenderertext.c:413
#: ../gtk/gtktexttag.c:305
msgid "Font size"
msgstr "Font size"
-#: ../gtk/gtkcellrenderertext.c:408 ../gtk/gtktexttag.c:325
+#: ../gtk/gtkcellrenderertext.c:422 ../gtk/gtktexttag.c:325
msgid "Font points"
msgstr "Font points"
-#: ../gtk/gtkcellrenderertext.c:409 ../gtk/gtktexttag.c:326
+#: ../gtk/gtkcellrenderertext.c:423 ../gtk/gtktexttag.c:326
msgid "Font size in points"
msgstr "Font size in points"
-#: ../gtk/gtkcellrenderertext.c:418 ../gtk/gtktexttag.c:315
+#: ../gtk/gtkcellrenderertext.c:432 ../gtk/gtktexttag.c:315
msgid "Font scale"
msgstr "Font scale"
-#: ../gtk/gtkcellrenderertext.c:419
+#: ../gtk/gtkcellrenderertext.c:433
msgid "Font scaling factor"
msgstr "Font scaling factor"
-#: ../gtk/gtkcellrenderertext.c:428 ../gtk/gtktexttag.c:394
+#: ../gtk/gtkcellrenderertext.c:442 ../gtk/gtktexttag.c:394
msgid "Rise"
msgstr "Rise"
-#: ../gtk/gtkcellrenderertext.c:429
+#: ../gtk/gtkcellrenderertext.c:443
msgid ""
"Offset of text above the baseline (below the baseline if rise is negative)"
msgstr ""
"Offset of text above the baseline (below the baseline if rise is negative)"
-#: ../gtk/gtkcellrenderertext.c:440 ../gtk/gtktexttag.c:434
+#: ../gtk/gtkcellrenderertext.c:454 ../gtk/gtktexttag.c:434
msgid "Strikethrough"
msgstr "Strikethrough"
-#: ../gtk/gtkcellrenderertext.c:441 ../gtk/gtktexttag.c:435
+#: ../gtk/gtkcellrenderertext.c:455 ../gtk/gtktexttag.c:435
msgid "Whether to strike through the text"
msgstr "Whether to strike through the text"
-#: ../gtk/gtkcellrenderertext.c:448 ../gtk/gtktexttag.c:442
+#: ../gtk/gtkcellrenderertext.c:462 ../gtk/gtktexttag.c:442
msgid "Underline"
msgstr "Underline"
-#: ../gtk/gtkcellrenderertext.c:449 ../gtk/gtktexttag.c:443
+#: ../gtk/gtkcellrenderertext.c:463 ../gtk/gtktexttag.c:443
msgid "Style of underline for this text"
msgstr "Style of underline for this text"
-#: ../gtk/gtkcellrenderertext.c:457 ../gtk/gtktexttag.c:354
+#: ../gtk/gtkcellrenderertext.c:471 ../gtk/gtktexttag.c:354
msgid "Language"
msgstr "Language"
-#: ../gtk/gtkcellrenderertext.c:458
+#: ../gtk/gtkcellrenderertext.c:472
msgid ""
"The language this text is in, as an ISO code. Pango can use this as a hint "
"when rendering the text. If you don't understand this parameter, you "
@@ -1622,12 +1623,12 @@ msgstr ""
"when rendering the text. If you don't understand this parameter, you "
"probably don't need it"
-#: ../gtk/gtkcellrenderertext.c:478 ../gtk/gtklabel.c:681
-#: ../gtk/gtkprogressbar.c:175
+#: ../gtk/gtkcellrenderertext.c:492 ../gtk/gtklabel.c:699
+#: ../gtk/gtkprogressbar.c:207
msgid "Ellipsize"
msgstr "Ellipsize"
-#: ../gtk/gtkcellrenderertext.c:479
+#: ../gtk/gtkcellrenderertext.c:493
msgid ""
"The preferred place to ellipsize the string, if the cell renderer does not "
"have enough room to display the entire string"
@@ -1635,28 +1636,28 @@ msgstr ""
"The preferred place to ellipsize the string, if the cell renderer does not "
"have enough room to display the entire string"
-#: ../gtk/gtkcellrenderertext.c:498 ../gtk/gtkfilechooserbutton.c:411
-#: ../gtk/gtklabel.c:702
+#: ../gtk/gtkcellrenderertext.c:512 ../gtk/gtkfilechooserbutton.c:411
+#: ../gtk/gtklabel.c:720
msgid "Width In Characters"
msgstr "Width In Characters"
-#: ../gtk/gtkcellrenderertext.c:499 ../gtk/gtklabel.c:703
+#: ../gtk/gtkcellrenderertext.c:513 ../gtk/gtklabel.c:721
msgid "The desired width of the label, in characters"
msgstr "The desired width of the label, in characters"
-#: ../gtk/gtkcellrenderertext.c:523 ../gtk/gtklabel.c:763
+#: ../gtk/gtkcellrenderertext.c:537 ../gtk/gtklabel.c:781
msgid "Maximum Width In Characters"
msgstr "Maximum Width In Characters"
-#: ../gtk/gtkcellrenderertext.c:524
+#: ../gtk/gtkcellrenderertext.c:538
msgid "The maximum width of the cell, in characters"
msgstr "The maximum width of the cell, in characters"
-#: ../gtk/gtkcellrenderertext.c:542 ../gtk/gtktexttag.c:451
+#: ../gtk/gtkcellrenderertext.c:556 ../gtk/gtktexttag.c:451
msgid "Wrap mode"
msgstr "Wrap mode"
-#: ../gtk/gtkcellrenderertext.c:543
+#: ../gtk/gtkcellrenderertext.c:557
msgid ""
"How to break the string into multiple lines, if the cell renderer does not "
"have enough room to display the entire string"
@@ -1664,149 +1665,149 @@ msgstr ""
"How to break the string into multiple lines, if the cell renderer does not "
"have enough room to display the entire string"
-#: ../gtk/gtkcellrenderertext.c:562 ../gtk/gtkcombobox.c:750
+#: ../gtk/gtkcellrenderertext.c:576 ../gtk/gtkcombobox.c:754
msgid "Wrap width"
msgstr "Wrap width"
-#: ../gtk/gtkcellrenderertext.c:563
+#: ../gtk/gtkcellrenderertext.c:577
msgid "The width at which the text is wrapped"
msgstr "The width at which the text is wrapped"
-#: ../gtk/gtkcellrenderertext.c:583 ../gtk/gtktreeviewcolumn.c:319
+#: ../gtk/gtkcellrenderertext.c:597 ../gtk/gtktreeviewcolumn.c:319
msgid "Alignment"
msgstr "Alignment"
-#: ../gtk/gtkcellrenderertext.c:584
+#: ../gtk/gtkcellrenderertext.c:598
msgid "How to align the lines"
msgstr "How to draw the toolbar"
-#: ../gtk/gtkcellrenderertext.c:596 ../gtk/gtkcellview.c:223
+#: ../gtk/gtkcellrenderertext.c:610 ../gtk/gtkcellview.c:236
#: ../gtk/gtktexttag.c:540
msgid "Background set"
msgstr "Background set"
-#: ../gtk/gtkcellrenderertext.c:597 ../gtk/gtkcellview.c:224
+#: ../gtk/gtkcellrenderertext.c:611 ../gtk/gtkcellview.c:237
#: ../gtk/gtktexttag.c:541
msgid "Whether this tag affects the background color"
msgstr "Whether this tag affects the background color"
-#: ../gtk/gtkcellrenderertext.c:600 ../gtk/gtktexttag.c:548
+#: ../gtk/gtkcellrenderertext.c:614 ../gtk/gtktexttag.c:548
msgid "Foreground set"
msgstr "Foreground set"
-#: ../gtk/gtkcellrenderertext.c:601 ../gtk/gtktexttag.c:549
+#: ../gtk/gtkcellrenderertext.c:615 ../gtk/gtktexttag.c:549
msgid "Whether this tag affects the foreground color"
msgstr "Whether this tag affects the foreground color"
-#: ../gtk/gtkcellrenderertext.c:604 ../gtk/gtktexttag.c:552
+#: ../gtk/gtkcellrenderertext.c:618 ../gtk/gtktexttag.c:552
msgid "Editability set"
msgstr "Editability set"
-#: ../gtk/gtkcellrenderertext.c:605 ../gtk/gtktexttag.c:553
+#: ../gtk/gtkcellrenderertext.c:619 ../gtk/gtktexttag.c:553
msgid "Whether this tag affects text editability"
msgstr "Whether this tag affects text editability"
-#: ../gtk/gtkcellrenderertext.c:608 ../gtk/gtktexttag.c:556
+#: ../gtk/gtkcellrenderertext.c:622 ../gtk/gtktexttag.c:556
msgid "Font family set"
msgstr "Font family set"
-#: ../gtk/gtkcellrenderertext.c:609 ../gtk/gtktexttag.c:557
+#: ../gtk/gtkcellrenderertext.c:623 ../gtk/gtktexttag.c:557
msgid "Whether this tag affects the font family"
msgstr "Whether this tag affects the font family"
-#: ../gtk/gtkcellrenderertext.c:612 ../gtk/gtktexttag.c:560
+#: ../gtk/gtkcellrenderertext.c:626 ../gtk/gtktexttag.c:560
msgid "Font style set"
msgstr "Font style set"
-#: ../gtk/gtkcellrenderertext.c:613 ../gtk/gtktexttag.c:561
+#: ../gtk/gtkcellrenderertext.c:627 ../gtk/gtktexttag.c:561
msgid "Whether this tag affects the font style"
msgstr "Whether this tag affects the font style"
-#: ../gtk/gtkcellrenderertext.c:616 ../gtk/gtktexttag.c:564
+#: ../gtk/gtkcellrenderertext.c:630 ../gtk/gtktexttag.c:564
msgid "Font variant set"
msgstr "Font variant set"
-#: ../gtk/gtkcellrenderertext.c:617 ../gtk/gtktexttag.c:565
+#: ../gtk/gtkcellrenderertext.c:631 ../gtk/gtktexttag.c:565
msgid "Whether this tag affects the font variant"
msgstr "Whether this tag affects the font variant"
-#: ../gtk/gtkcellrenderertext.c:620 ../gtk/gtktexttag.c:568
+#: ../gtk/gtkcellrenderertext.c:634 ../gtk/gtktexttag.c:568
msgid "Font weight set"
msgstr "Font weight set"
-#: ../gtk/gtkcellrenderertext.c:621 ../gtk/gtktexttag.c:569
+#: ../gtk/gtkcellrenderertext.c:635 ../gtk/gtktexttag.c:569
msgid "Whether this tag affects the font weight"
msgstr "Whether this tag affects the font weight"
-#: ../gtk/gtkcellrenderertext.c:624 ../gtk/gtktexttag.c:572
+#: ../gtk/gtkcellrenderertext.c:638 ../gtk/gtktexttag.c:572
msgid "Font stretch set"
msgstr "Font stretch set"
-#: ../gtk/gtkcellrenderertext.c:625 ../gtk/gtktexttag.c:573
+#: ../gtk/gtkcellrenderertext.c:639 ../gtk/gtktexttag.c:573
msgid "Whether this tag affects the font stretch"
msgstr "Whether this tag affects the font stretch"
-#: ../gtk/gtkcellrenderertext.c:628 ../gtk/gtktexttag.c:576
+#: ../gtk/gtkcellrenderertext.c:642 ../gtk/gtktexttag.c:576
msgid "Font size set"
msgstr "Font size set"
-#: ../gtk/gtkcellrenderertext.c:629 ../gtk/gtktexttag.c:577
+#: ../gtk/gtkcellrenderertext.c:643 ../gtk/gtktexttag.c:577
msgid "Whether this tag affects the font size"
msgstr "Whether this tag affects the font size"
-#: ../gtk/gtkcellrenderertext.c:632 ../gtk/gtktexttag.c:580
+#: ../gtk/gtkcellrenderertext.c:646 ../gtk/gtktexttag.c:580
msgid "Font scale set"
msgstr "Font scale set"
-#: ../gtk/gtkcellrenderertext.c:633 ../gtk/gtktexttag.c:581
+#: ../gtk/gtkcellrenderertext.c:647 ../gtk/gtktexttag.c:581
msgid "Whether this tag scales the font size by a factor"
msgstr "Whether this tag scales the font size by a factor"
-#: ../gtk/gtkcellrenderertext.c:636 ../gtk/gtktexttag.c:600
+#: ../gtk/gtkcellrenderertext.c:650 ../gtk/gtktexttag.c:600
msgid "Rise set"
msgstr "Rise set"
-#: ../gtk/gtkcellrenderertext.c:637 ../gtk/gtktexttag.c:601
+#: ../gtk/gtkcellrenderertext.c:651 ../gtk/gtktexttag.c:601
msgid "Whether this tag affects the rise"
msgstr "Whether this tag affects the rise"
-#: ../gtk/gtkcellrenderertext.c:640 ../gtk/gtktexttag.c:616
+#: ../gtk/gtkcellrenderertext.c:654 ../gtk/gtktexttag.c:616
msgid "Strikethrough set"
msgstr "Strikethrough set"
-#: ../gtk/gtkcellrenderertext.c:641 ../gtk/gtktexttag.c:617
+#: ../gtk/gtkcellrenderertext.c:655 ../gtk/gtktexttag.c:617
msgid "Whether this tag affects strikethrough"
msgstr "Whether this tag affects strikethrough"
-#: ../gtk/gtkcellrenderertext.c:644 ../gtk/gtktexttag.c:624
+#: ../gtk/gtkcellrenderertext.c:658 ../gtk/gtktexttag.c:624
msgid "Underline set"
msgstr "Underline set"
-#: ../gtk/gtkcellrenderertext.c:645 ../gtk/gtktexttag.c:625
+#: ../gtk/gtkcellrenderertext.c:659 ../gtk/gtktexttag.c:625
msgid "Whether this tag affects underlining"
msgstr "Whether this tag affects underlining"
-#: ../gtk/gtkcellrenderertext.c:648 ../gtk/gtktexttag.c:588
+#: ../gtk/gtkcellrenderertext.c:662 ../gtk/gtktexttag.c:588
msgid "Language set"
msgstr "Language set"
-#: ../gtk/gtkcellrenderertext.c:649 ../gtk/gtktexttag.c:589
+#: ../gtk/gtkcellrenderertext.c:663 ../gtk/gtktexttag.c:589
msgid "Whether this tag affects the language the text is rendered as"
msgstr "Whether this tag affects the language the text is rendered as"
-#: ../gtk/gtkcellrenderertext.c:652
+#: ../gtk/gtkcellrenderertext.c:666
msgid "Ellipsize set"
msgstr "Ellipsize set"
-#: ../gtk/gtkcellrenderertext.c:653
+#: ../gtk/gtkcellrenderertext.c:667
msgid "Whether this tag affects the ellipsize mode"
msgstr "Whether this tag affects the ellipsize mode"
-#: ../gtk/gtkcellrenderertext.c:656
+#: ../gtk/gtkcellrenderertext.c:670
msgid "Align set"
msgstr "Align set"
-#: ../gtk/gtkcellrenderertext.c:657
+#: ../gtk/gtkcellrenderertext.c:671
msgid "Whether this tag affects the alignment mode"
msgstr "Whether this tag affects the alignment mode"
@@ -1846,32 +1847,32 @@ msgstr "Draw the toggle button as a radio button"
msgid "Indicator size"
msgstr "Indicator size"
-#: ../gtk/gtkcellrenderertoggle.c:161 ../gtk/gtkcheckbutton.c:72
+#: ../gtk/gtkcellrenderertoggle.c:161 ../gtk/gtkcheckbutton.c:78
#: ../gtk/gtkcheckmenuitem.c:129
msgid "Size of check or radio indicator"
msgstr "Size of check or radio indicator"
-#: ../gtk/gtkcellview.c:200
+#: ../gtk/gtkcellview.c:213
msgid "Background RGBA color"
msgstr "Background RGBA color"
-#: ../gtk/gtkcellview.c:215
+#: ../gtk/gtkcellview.c:228
msgid "CellView model"
msgstr "CellView model"
-#: ../gtk/gtkcellview.c:216
+#: ../gtk/gtkcellview.c:229
msgid "The model for cell view"
msgstr "The model for cell view"
-#: ../gtk/gtkcheckbutton.c:71 ../gtk/gtkcheckmenuitem.c:128
+#: ../gtk/gtkcheckbutton.c:77 ../gtk/gtkcheckmenuitem.c:128
msgid "Indicator Size"
msgstr "Indicator Size"
-#: ../gtk/gtkcheckbutton.c:79 ../gtk/gtkexpander.c:267
+#: ../gtk/gtkcheckbutton.c:85 ../gtk/gtkexpander.c:267
msgid "Indicator Spacing"
msgstr "Indicator Spacing"
-#: ../gtk/gtkcheckbutton.c:80
+#: ../gtk/gtkcheckbutton.c:86
msgid "Spacing around check or radio indicator"
msgstr "Spacing around check or radio indicator"
@@ -1879,7 +1880,7 @@ msgstr "Spacing around check or radio indicator"
msgid "Whether the menu item is checked"
msgstr "Whether the menu item is checked"
-#: ../gtk/gtkcheckmenuitem.c:113 ../gtk/gtktogglebutton.c:130
+#: ../gtk/gtkcheckmenuitem.c:113 ../gtk/gtktogglebutton.c:133
msgid "Inconsistent"
msgstr "Inconsistent"
@@ -1895,77 +1896,77 @@ msgstr "Draw as radio menu item"
msgid "Whether the menu item looks like a radio menu item"
msgstr "Whether the menu item looks like a radio menu item"
-#: ../gtk/gtkcolorbutton.c:158
+#: ../gtk/gtkcolorbutton.c:171
msgid "Use alpha"
msgstr "Use alpha"
-#: ../gtk/gtkcolorbutton.c:159
+#: ../gtk/gtkcolorbutton.c:172
msgid "Whether to give the color an alpha value"
msgstr "Whether to give the color an alpha value"
-#: ../gtk/gtkcolorbutton.c:173 ../gtk/gtkfilechooserbutton.c:397
+#: ../gtk/gtkcolorbutton.c:186 ../gtk/gtkfilechooserbutton.c:397
#: ../gtk/gtkfontbutton.c:140 ../gtk/gtkprintjob.c:115
#: ../gtk/gtkstatusicon.c:415 ../gtk/gtktreeviewcolumn.c:286
msgid "Title"
msgstr "Title"
-#: ../gtk/gtkcolorbutton.c:174
+#: ../gtk/gtkcolorbutton.c:187
msgid "The title of the color selection dialog"
msgstr "The title of the color selection dialog"
-#: ../gtk/gtkcolorbutton.c:188 ../gtk/gtkcolorsel.c:325
+#: ../gtk/gtkcolorbutton.c:201 ../gtk/gtkcolorsel.c:339
msgid "Current Color"
msgstr "Current Color"
-#: ../gtk/gtkcolorbutton.c:189
+#: ../gtk/gtkcolorbutton.c:202
msgid "The selected color"
msgstr "The selected color"
-#: ../gtk/gtkcolorbutton.c:203 ../gtk/gtkcolorsel.c:332
+#: ../gtk/gtkcolorbutton.c:216 ../gtk/gtkcolorsel.c:346
msgid "Current Alpha"
msgstr "Current Alpha"
-#: ../gtk/gtkcolorbutton.c:204
+#: ../gtk/gtkcolorbutton.c:217
msgid "The selected opacity value (0 fully transparent, 65535 fully opaque)"
msgstr "The selected opacity value (0 fully transparent, 65535 fully opaque)"
-#: ../gtk/gtkcolorbutton.c:218
+#: ../gtk/gtkcolorbutton.c:231
msgid "Current RGBA Color"
msgstr "Current RGBA Color"
-#: ../gtk/gtkcolorbutton.c:219
+#: ../gtk/gtkcolorbutton.c:232
msgid "The selected RGBA color"
msgstr "The selected RGBA color"
-#: ../gtk/gtkcolorsel.c:311
+#: ../gtk/gtkcolorsel.c:325
msgid "Has Opacity Control"
msgstr "Has Opacity Control"
-#: ../gtk/gtkcolorsel.c:312
+#: ../gtk/gtkcolorsel.c:326
msgid "Whether the color selector should allow setting opacity"
msgstr "Whether the color selector should allow setting opacity"
-#: ../gtk/gtkcolorsel.c:318
+#: ../gtk/gtkcolorsel.c:332
msgid "Has palette"
msgstr "Has palette"
-#: ../gtk/gtkcolorsel.c:319
+#: ../gtk/gtkcolorsel.c:333
msgid "Whether a palette should be used"
msgstr "Whether a palette should be used"
-#: ../gtk/gtkcolorsel.c:326
+#: ../gtk/gtkcolorsel.c:340
msgid "The current color"
msgstr "The current color"
-#: ../gtk/gtkcolorsel.c:333
+#: ../gtk/gtkcolorsel.c:347
msgid "The current opacity value (0 fully transparent, 65535 fully opaque)"
msgstr "The current opacity value (0 fully transparent, 65535 fully opaque)"
-#: ../gtk/gtkcolorsel.c:347
+#: ../gtk/gtkcolorsel.c:361
msgid "Current RGBA"
msgstr "Current RGBA"
-#: ../gtk/gtkcolorsel.c:348
+#: ../gtk/gtkcolorsel.c:362
msgid "The current RGBA color"
msgstr "The current RGBA color"
@@ -2001,67 +2002,67 @@ msgstr "Help Button"
msgid "The help button of the dialog."
msgstr "The help button of the dialog."
-#: ../gtk/gtkcombobox.c:733
+#: ../gtk/gtkcombobox.c:737
msgid "ComboBox model"
msgstr "ComboBox model"
-#: ../gtk/gtkcombobox.c:734
+#: ../gtk/gtkcombobox.c:738
msgid "The model for the combo box"
msgstr "The model for the combo box"
-#: ../gtk/gtkcombobox.c:751
+#: ../gtk/gtkcombobox.c:755
msgid "Wrap width for laying out the items in a grid"
msgstr "Wrap width for laying out the items in a grid"
-#: ../gtk/gtkcombobox.c:773
+#: ../gtk/gtkcombobox.c:777
msgid "Row span column"
msgstr "Row span column"
-#: ../gtk/gtkcombobox.c:774
+#: ../gtk/gtkcombobox.c:778
msgid "TreeModel column containing the row span values"
msgstr "TreeModel column containing the row span values"
-#: ../gtk/gtkcombobox.c:795
+#: ../gtk/gtkcombobox.c:799
msgid "Column span column"
msgstr "Column span column"
-#: ../gtk/gtkcombobox.c:796
+#: ../gtk/gtkcombobox.c:800
msgid "TreeModel column containing the column span values"
msgstr "TreeModel column containing the column span values"
-#: ../gtk/gtkcombobox.c:817
+#: ../gtk/gtkcombobox.c:821
msgid "Active item"
msgstr "Active item"
-#: ../gtk/gtkcombobox.c:818
+#: ../gtk/gtkcombobox.c:822
msgid "The item which is currently active"
msgstr "The item which is currently active"
-#: ../gtk/gtkcombobox.c:837 ../gtk/gtkuimanager.c:224
+#: ../gtk/gtkcombobox.c:841 ../gtk/gtkuimanager.c:224
msgid "Add tearoffs to menus"
msgstr "Add tearoffs to menus"
-#: ../gtk/gtkcombobox.c:838
+#: ../gtk/gtkcombobox.c:842
msgid "Whether dropdowns should have a tearoff menu item"
msgstr "Whether dropdowns should have a tearoff menu item"
-#: ../gtk/gtkcombobox.c:853 ../gtk/gtkentry.c:687
+#: ../gtk/gtkcombobox.c:857 ../gtk/gtkentry.c:778
msgid "Has Frame"
msgstr "Has Frame"
-#: ../gtk/gtkcombobox.c:854
+#: ../gtk/gtkcombobox.c:858
msgid "Whether the combo box draws a frame around the child"
msgstr "Whether the combo box draws a frame around the child"
-#: ../gtk/gtkcombobox.c:862
+#: ../gtk/gtkcombobox.c:866
msgid "Whether the combo box grabs focus when it is clicked with the mouse"
msgstr "Whether the combo box grabs focus when it is clicked with the mouse"
-#: ../gtk/gtkcombobox.c:877 ../gtk/gtkmenu.c:575
+#: ../gtk/gtkcombobox.c:881 ../gtk/gtkmenu.c:576
msgid "Tearoff Title"
msgstr "Tearoff Title"
-#: ../gtk/gtkcombobox.c:878
+#: ../gtk/gtkcombobox.c:882
msgid ""
"A title that may be displayed by the window manager when the popup is torn-"
"off"
@@ -2069,31 +2070,31 @@ msgstr ""
"A title that may be displayed by the window manager when the popup is torn-"
"off"
-#: ../gtk/gtkcombobox.c:895
+#: ../gtk/gtkcombobox.c:899
msgid "Popup shown"
msgstr "Popup shown"
-#: ../gtk/gtkcombobox.c:896
+#: ../gtk/gtkcombobox.c:900
msgid "Whether the combo's dropdown is shown"
msgstr "Whether the combo's dropdown is shown"
-#: ../gtk/gtkcombobox.c:912
+#: ../gtk/gtkcombobox.c:916
msgid "Button Sensitivity"
msgstr "Button Sensitivity"
-#: ../gtk/gtkcombobox.c:913
+#: ../gtk/gtkcombobox.c:917
msgid "Whether the dropdown button is sensitive when the model is empty"
msgstr "Whether the dropdown button is sensitive when the model is empty"
-#: ../gtk/gtkcombobox.c:929
+#: ../gtk/gtkcombobox.c:933
msgid "Whether combo box has an entry"
msgstr "Whether combo box has an entry"
-#: ../gtk/gtkcombobox.c:944
+#: ../gtk/gtkcombobox.c:948
msgid "Entry Text Column"
msgstr "Entry Text Column"
-#: ../gtk/gtkcombobox.c:945
+#: ../gtk/gtkcombobox.c:949
msgid ""
"The column in the combo box's model to associate with strings from the entry "
"if the combo was created with #GtkComboBox:has-entry = %TRUE"
@@ -2101,11 +2102,31 @@ msgstr ""
"The column in the combo box's model to associate with strings from the entry "
"if the combo was created with #GtkComboBox:has-entry = %TRUE"
-#: ../gtk/gtkcombobox.c:962
+#: ../gtk/gtkcombobox.c:966
+msgid "ID Column"
+msgstr "ID Column"
+
+#: ../gtk/gtkcombobox.c:967
+msgid ""
+"The column in the combo box's model that provides string IDs for the values "
+"in the model"
+msgstr ""
+"The column in the combo box's model that provides string IDs for the values "
+"in the model"
+
+#: ../gtk/gtkcombobox.c:982
+msgid "Active id"
+msgstr "Active id"
+
+#: ../gtk/gtkcombobox.c:983
+msgid "The value of the id column for the active row"
+msgstr "The value of the id column for the active row"
+
+#: ../gtk/gtkcombobox.c:998
msgid "Popup Fixed Width"
msgstr "Popup Fixed Width"
-#: ../gtk/gtkcombobox.c:963
+#: ../gtk/gtkcombobox.c:999
msgid ""
"Whether the popup's width should be a fixed width matching the allocated "
"width of the combo box"
@@ -2113,29 +2134,29 @@ msgstr ""
"Whether the popup's width should be a fixed width matching the allocated "
"width of the combo box"
-#: ../gtk/gtkcombobox.c:971
+#: ../gtk/gtkcombobox.c:1007
msgid "Appears as list"
msgstr "Appears as list"
-#: ../gtk/gtkcombobox.c:972
+#: ../gtk/gtkcombobox.c:1008
msgid "Whether dropdowns should look like lists rather than menus"
msgstr "Whether dropdowns should look like lists rather than menus"
-#: ../gtk/gtkcombobox.c:988
+#: ../gtk/gtkcombobox.c:1024
msgid "Arrow Size"
msgstr "Arrow Size"
-#: ../gtk/gtkcombobox.c:989
+#: ../gtk/gtkcombobox.c:1025
msgid "The minimum size of the arrow in the combo box"
msgstr "The minimum size of the arrow in the combo box"
-#: ../gtk/gtkcombobox.c:1004 ../gtk/gtkentry.c:787 ../gtk/gtkhandlebox.c:182
-#: ../gtk/gtkmenubar.c:189 ../gtk/gtkstatusbar.c:178 ../gtk/gtktoolbar.c:597
-#: ../gtk/gtkviewport.c:155
+#: ../gtk/gtkcombobox.c:1040 ../gtk/gtkentry.c:878 ../gtk/gtkhandlebox.c:188
+#: ../gtk/gtkmenubar.c:196 ../gtk/gtkstatusbar.c:180 ../gtk/gtktoolbar.c:603
+#: ../gtk/gtkviewport.c:154
msgid "Shadow type"
msgstr "Shadow type"
-#: ../gtk/gtkcombobox.c:1005
+#: ../gtk/gtkcombobox.c:1041
msgid "Which kind of shadow to draw around the combo box"
msgstr "Which kind of shadow to draw around the combo box"
@@ -2195,49 +2216,49 @@ msgstr "Action area border"
msgid "Width of border around the button area at the bottom of the dialog"
msgstr "Width of border around the button area at the bottom of the dialog"
-#: ../gtk/gtkentry.c:634
+#: ../gtk/gtkentry.c:725
msgid "Text Buffer"
msgstr "Text Buffer"
-#: ../gtk/gtkentry.c:635
+#: ../gtk/gtkentry.c:726
msgid "Text buffer object which actually stores entry text"
msgstr "Text buffer object which actually stores entry text"
-#: ../gtk/gtkentry.c:642 ../gtk/gtklabel.c:644
+#: ../gtk/gtkentry.c:733 ../gtk/gtklabel.c:662
msgid "Cursor Position"
msgstr "Cursor Position"
-#: ../gtk/gtkentry.c:643 ../gtk/gtklabel.c:645
+#: ../gtk/gtkentry.c:734 ../gtk/gtklabel.c:663
msgid "The current position of the insertion cursor in chars"
msgstr "The current position of the insertion cursor in chars"
-#: ../gtk/gtkentry.c:652 ../gtk/gtklabel.c:654
+#: ../gtk/gtkentry.c:743 ../gtk/gtklabel.c:672
msgid "Selection Bound"
msgstr "Selection Bound"
-#: ../gtk/gtkentry.c:653 ../gtk/gtklabel.c:655
+#: ../gtk/gtkentry.c:744 ../gtk/gtklabel.c:673
msgid ""
"The position of the opposite end of the selection from the cursor in chars"
msgstr ""
"The position of the opposite end of the selection from the cursor in chars"
-#: ../gtk/gtkentry.c:663
+#: ../gtk/gtkentry.c:754
msgid "Whether the entry contents can be edited"
msgstr "Whether the entry contents can be edited"
-#: ../gtk/gtkentry.c:670 ../gtk/gtkentrybuffer.c:382
+#: ../gtk/gtkentry.c:761 ../gtk/gtkentrybuffer.c:382
msgid "Maximum length"
msgstr "Maximum length"
-#: ../gtk/gtkentry.c:671 ../gtk/gtkentrybuffer.c:383
+#: ../gtk/gtkentry.c:762 ../gtk/gtkentrybuffer.c:383
msgid "Maximum number of characters for this entry. Zero if no maximum"
msgstr "Maximum number of characters for this entry. Zero if no maximum"
-#: ../gtk/gtkentry.c:679
+#: ../gtk/gtkentry.c:770
msgid "Visibility"
msgstr "Visibility"
-#: ../gtk/gtkentry.c:680
+#: ../gtk/gtkentry.c:771
msgid ""
"FALSE displays the \"invisible char\" instead of the actual text (password "
"mode)"
@@ -2245,30 +2266,30 @@ msgstr ""
"FALSE displays the \"invisible char\" instead of the actual text (password "
"mode)"
-#: ../gtk/gtkentry.c:688
+#: ../gtk/gtkentry.c:779
msgid "FALSE removes outside bevel from entry"
msgstr "FALSE removes outside bevel from entry"
-#: ../gtk/gtkentry.c:696
+#: ../gtk/gtkentry.c:787
msgid ""
"Border between text and frame. Overrides the inner-border style property"
msgstr ""
"Border between text and frame. Overrides the inner-border style property"
-#: ../gtk/gtkentry.c:703 ../gtk/gtkentry.c:1269
+#: ../gtk/gtkentry.c:794 ../gtk/gtkentry.c:1360
msgid "Invisible character"
msgstr "Invisible character"
-#: ../gtk/gtkentry.c:704 ../gtk/gtkentry.c:1270
+#: ../gtk/gtkentry.c:795 ../gtk/gtkentry.c:1361
msgid "The character to use when masking entry contents (in \"password mode\")"
msgstr ""
"The character to use when masking entry contents (in \"password mode\")"
-#: ../gtk/gtkentry.c:711
+#: ../gtk/gtkentry.c:802
msgid "Activates default"
msgstr "Activates default"
-#: ../gtk/gtkentry.c:712
+#: ../gtk/gtkentry.c:803
msgid ""
"Whether to activate the default widget (such as the default button in a "
"dialog) when Enter is pressed"
@@ -2276,31 +2297,31 @@ msgstr ""
"Whether to activate the default widget (such as the default button in a "
"dialog) when Enter is pressed"
-#: ../gtk/gtkentry.c:718
+#: ../gtk/gtkentry.c:809
msgid "Width in chars"
msgstr "Width in chars"
-#: ../gtk/gtkentry.c:719
+#: ../gtk/gtkentry.c:810
msgid "Number of characters to leave space for in the entry"
msgstr "Number of characters to leave space for in the entry"
-#: ../gtk/gtkentry.c:728
+#: ../gtk/gtkentry.c:819
msgid "Scroll offset"
msgstr "Scroll offset"
-#: ../gtk/gtkentry.c:729
+#: ../gtk/gtkentry.c:820
msgid "Number of pixels of the entry scrolled off the screen to the left"
msgstr "Number of pixels of the entry scrolled off the screen to the left"
-#: ../gtk/gtkentry.c:739
+#: ../gtk/gtkentry.c:830
msgid "The contents of the entry"
msgstr "The contents of the entry"
-#: ../gtk/gtkentry.c:754 ../gtk/gtkmisc.c:81
+#: ../gtk/gtkentry.c:845 ../gtk/gtkmisc.c:81
msgid "X align"
msgstr "X align"
-#: ../gtk/gtkentry.c:755 ../gtk/gtkmisc.c:82
+#: ../gtk/gtkentry.c:846 ../gtk/gtkmisc.c:82
msgid ""
"The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL "
"layouts."
@@ -2308,63 +2329,63 @@ msgstr ""
"The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL "
"layouts."
-#: ../gtk/gtkentry.c:771
+#: ../gtk/gtkentry.c:862
msgid "Truncate multiline"
msgstr "Truncate multiline"
-#: ../gtk/gtkentry.c:772
+#: ../gtk/gtkentry.c:863
msgid "Whether to truncate multiline pastes to one line."
msgstr "Whether to truncate multiline pastes to one line."
-#: ../gtk/gtkentry.c:788
+#: ../gtk/gtkentry.c:879
msgid "Which kind of shadow to draw around the entry when has-frame is set"
msgstr "Which kind of shadow to draw around the entry when has-frame is set"
-#: ../gtk/gtkentry.c:803 ../gtk/gtktextview.c:747
+#: ../gtk/gtkentry.c:894 ../gtk/gtktextview.c:766
msgid "Overwrite mode"
msgstr "Overwrite mode"
-#: ../gtk/gtkentry.c:804
+#: ../gtk/gtkentry.c:895
msgid "Whether new text overwrites existing text"
msgstr "Whether new text overwrites existing text"
-#: ../gtk/gtkentry.c:818 ../gtk/gtkentrybuffer.c:367
+#: ../gtk/gtkentry.c:909 ../gtk/gtkentrybuffer.c:367
msgid "Text length"
msgstr "Text length"
-#: ../gtk/gtkentry.c:819
+#: ../gtk/gtkentry.c:910
msgid "Length of the text currently in the entry"
msgstr "Length of the text currently in the entry"
-#: ../gtk/gtkentry.c:834
+#: ../gtk/gtkentry.c:925
msgid "Invisible character set"
msgstr "Invisible character set"
-#: ../gtk/gtkentry.c:835
+#: ../gtk/gtkentry.c:926
msgid "Whether the invisible character has been set"
msgstr "Whether the invisible character has been set"
-#: ../gtk/gtkentry.c:853
+#: ../gtk/gtkentry.c:944
msgid "Caps Lock warning"
msgstr "Caps Lock warning"
-#: ../gtk/gtkentry.c:854
+#: ../gtk/gtkentry.c:945
msgid "Whether password entries will show a warning when Caps Lock is on"
msgstr "Whether password entries will show a warning when Caps Lock is on"
-#: ../gtk/gtkentry.c:868
+#: ../gtk/gtkentry.c:959
msgid "Progress Fraction"
msgstr "Progress Fraction"
-#: ../gtk/gtkentry.c:869
+#: ../gtk/gtkentry.c:960
msgid "The current fraction of the task that's been completed"
msgstr "The current fraction of the task that's been completed"
-#: ../gtk/gtkentry.c:886
+#: ../gtk/gtkentry.c:977
msgid "Progress Pulse Step"
msgstr "Progress Pulse Step"
-#: ../gtk/gtkentry.c:887
+#: ../gtk/gtkentry.c:978
msgid ""
"The fraction of total entry width to move the progress bouncing block for "
"each call to gtk_entry_progress_pulse()"
@@ -2372,167 +2393,167 @@ msgstr ""
"The fraction of total entry width to move the progress bouncing block for "
"each call to gtk_entry_progress_pulse()"
-#: ../gtk/gtkentry.c:903
+#: ../gtk/gtkentry.c:994
msgid "Primary pixbuf"
msgstr "Primary pixbuf"
-#: ../gtk/gtkentry.c:904
+#: ../gtk/gtkentry.c:995
msgid "Primary pixbuf for the entry"
msgstr "Primary pixbuf for the entry"
-#: ../gtk/gtkentry.c:918
+#: ../gtk/gtkentry.c:1009
msgid "Secondary pixbuf"
msgstr "Secondary pixbuf"
-#: ../gtk/gtkentry.c:919
+#: ../gtk/gtkentry.c:1010
msgid "Secondary pixbuf for the entry"
msgstr "Secondary pixbuf for the entry"
-#: ../gtk/gtkentry.c:933
+#: ../gtk/gtkentry.c:1024
msgid "Primary stock ID"
msgstr "Primary stock ID"
-#: ../gtk/gtkentry.c:934
+#: ../gtk/gtkentry.c:1025
msgid "Stock ID for primary icon"
msgstr "Stock ID for primary icon"
-#: ../gtk/gtkentry.c:948
+#: ../gtk/gtkentry.c:1039
msgid "Secondary stock ID"
msgstr "Secondary stock ID"
-#: ../gtk/gtkentry.c:949
+#: ../gtk/gtkentry.c:1040
msgid "Stock ID for secondary icon"
msgstr "Stock ID for secondary icon"
-#: ../gtk/gtkentry.c:963
+#: ../gtk/gtkentry.c:1054
msgid "Primary icon name"
msgstr "Primary icon name"
-#: ../gtk/gtkentry.c:964
+#: ../gtk/gtkentry.c:1055
msgid "Icon name for primary icon"
msgstr "Icon name for primary icon"
-#: ../gtk/gtkentry.c:978
+#: ../gtk/gtkentry.c:1069
msgid "Secondary icon name"
msgstr "Secondary icon name"
-#: ../gtk/gtkentry.c:979
+#: ../gtk/gtkentry.c:1070
msgid "Icon name for secondary icon"
msgstr "Icon name for secondary icon"
-#: ../gtk/gtkentry.c:993
+#: ../gtk/gtkentry.c:1084
msgid "Primary GIcon"
msgstr "Primary GIcon"
-#: ../gtk/gtkentry.c:994
+#: ../gtk/gtkentry.c:1085
msgid "GIcon for primary icon"
msgstr "GIcon for primary icon"
-#: ../gtk/gtkentry.c:1008
+#: ../gtk/gtkentry.c:1099
msgid "Secondary GIcon"
msgstr "Secondary GIcon"
-#: ../gtk/gtkentry.c:1009
+#: ../gtk/gtkentry.c:1100
msgid "GIcon for secondary icon"
msgstr "GIcon for secondary icon"
-#: ../gtk/gtkentry.c:1023
+#: ../gtk/gtkentry.c:1114
msgid "Primary storage type"
msgstr "Primary storage type"
-#: ../gtk/gtkentry.c:1024
+#: ../gtk/gtkentry.c:1115
msgid "The representation being used for primary icon"
msgstr "The representation being used for primary icon"
-#: ../gtk/gtkentry.c:1039
+#: ../gtk/gtkentry.c:1130
msgid "Secondary storage type"
msgstr "Secondary storage type"
-#: ../gtk/gtkentry.c:1040
+#: ../gtk/gtkentry.c:1131
msgid "The representation being used for secondary icon"
msgstr "The representation being used for secondary icon"
-#: ../gtk/gtkentry.c:1061
+#: ../gtk/gtkentry.c:1152
msgid "Primary icon activatable"
msgstr "Primary icon activatable"
-#: ../gtk/gtkentry.c:1062
+#: ../gtk/gtkentry.c:1153
msgid "Whether the primary icon is activatable"
msgstr "Whether the primary icon is activatable"
-#: ../gtk/gtkentry.c:1082
+#: ../gtk/gtkentry.c:1173
msgid "Secondary icon activatable"
msgstr "Secondary icon activatable"
-#: ../gtk/gtkentry.c:1083
+#: ../gtk/gtkentry.c:1174
msgid "Whether the secondary icon is activatable"
msgstr "Whether the secondary icon is activatable"
-#: ../gtk/gtkentry.c:1105
+#: ../gtk/gtkentry.c:1196
msgid "Primary icon sensitive"
msgstr "Primary icon sensitive"
-#: ../gtk/gtkentry.c:1106
+#: ../gtk/gtkentry.c:1197
msgid "Whether the primary icon is sensitive"
msgstr "Whether the primary icon is sensitive"
-#: ../gtk/gtkentry.c:1127
+#: ../gtk/gtkentry.c:1218
msgid "Secondary icon sensitive"
msgstr "Secondary icon sensitive"
-#: ../gtk/gtkentry.c:1128
+#: ../gtk/gtkentry.c:1219
msgid "Whether the secondary icon is sensitive"
msgstr "Whether the secondary icon is sensitive"
-#: ../gtk/gtkentry.c:1144
+#: ../gtk/gtkentry.c:1235
msgid "Primary icon tooltip text"
msgstr "Primary icon tooltip text"
-#: ../gtk/gtkentry.c:1145 ../gtk/gtkentry.c:1181
+#: ../gtk/gtkentry.c:1236 ../gtk/gtkentry.c:1272
msgid "The contents of the tooltip on the primary icon"
msgstr "The contents of the tooltip on the primary icon"
-#: ../gtk/gtkentry.c:1161
+#: ../gtk/gtkentry.c:1252
msgid "Secondary icon tooltip text"
msgstr "Secondary icon tooltip text"
-#: ../gtk/gtkentry.c:1162 ../gtk/gtkentry.c:1200
+#: ../gtk/gtkentry.c:1253 ../gtk/gtkentry.c:1291
msgid "The contents of the tooltip on the secondary icon"
msgstr "The contents of the tooltip on the secondary icon"
-#: ../gtk/gtkentry.c:1180
+#: ../gtk/gtkentry.c:1271
msgid "Primary icon tooltip markup"
msgstr "Primary icon tooltip markup"
-#: ../gtk/gtkentry.c:1199
+#: ../gtk/gtkentry.c:1290
msgid "Secondary icon tooltip markup"
msgstr "Secondary icon tooltip markup"
-#: ../gtk/gtkentry.c:1219 ../gtk/gtktextview.c:775
+#: ../gtk/gtkentry.c:1310 ../gtk/gtktextview.c:794
msgid "IM module"
msgstr "IM module"
-#: ../gtk/gtkentry.c:1220 ../gtk/gtktextview.c:776
+#: ../gtk/gtkentry.c:1311 ../gtk/gtktextview.c:795
msgid "Which IM module should be used"
msgstr "Which IM module should be used"
-#: ../gtk/gtkentry.c:1234
+#: ../gtk/gtkentry.c:1325
msgid "Icon Prelight"
msgstr "Icon Prelight"
-#: ../gtk/gtkentry.c:1235
+#: ../gtk/gtkentry.c:1326
msgid "Whether activatable icons should prelight when hovered"
msgstr "Whether activatable icons should prelight when hovered"
-#: ../gtk/gtkentry.c:1248
+#: ../gtk/gtkentry.c:1339
msgid "Progress Border"
msgstr "Progress Border"
-#: ../gtk/gtkentry.c:1249
+#: ../gtk/gtkentry.c:1340
msgid "Border around the progress bar"
msgstr "Border around the progress bar"
-#: ../gtk/gtkentry.c:1741
+#: ../gtk/gtkentry.c:1832
msgid "Border between text and frame."
msgstr "Border between text and frame."
@@ -2560,7 +2581,7 @@ msgstr "Minimum Key Length"
msgid "Minimum length of the search key in order to look up matches"
msgstr "Minimum length of the search key in order to look up matches"
-#: ../gtk/gtkentrycompletion.c:304 ../gtk/gtkiconview.c:612
+#: ../gtk/gtkentrycompletion.c:304 ../gtk/gtkiconview.c:617
msgid "Text column"
msgstr "Text column"
@@ -2644,11 +2665,11 @@ msgstr "Whether the expander has been opened to reveal the child widget"
msgid "Text of the expander's label"
msgstr "Text of the expander's label"
-#: ../gtk/gtkexpander.c:225 ../gtk/gtklabel.c:563
+#: ../gtk/gtkexpander.c:225 ../gtk/gtklabel.c:581
msgid "Use markup"
msgstr "Use markup"
-#: ../gtk/gtkexpander.c:226 ../gtk/gtklabel.c:564
+#: ../gtk/gtkexpander.c:226 ../gtk/gtklabel.c:582
msgid "The text of the label includes XML markup. See pango_parse_markup()"
msgstr "The text of the label includes XML markup. See pango_parse_markup()"
@@ -2657,7 +2678,7 @@ msgid "Space to put between the label and the child"
msgstr "Space to put between the label and the child"
#: ../gtk/gtkexpander.c:243 ../gtk/gtkframe.c:165 ../gtk/gtktoolbutton.c:216
-#: ../gtk/gtktoolitemgroup.c:1578
+#: ../gtk/gtktoolitemgroup.c:1595
msgid "Label widget"
msgstr "Label widget"
@@ -2673,13 +2694,13 @@ msgstr "Label fill"
msgid "Whether the label widget should fill all available horizontal space"
msgstr "Whether the label widget should fill all available horizontal space"
-#: ../gtk/gtkexpander.c:258 ../gtk/gtktoolitemgroup.c:1606
-#: ../gtk/gtktreeview.c:770
+#: ../gtk/gtkexpander.c:258 ../gtk/gtktoolitemgroup.c:1623
+#: ../gtk/gtktreeview.c:863
msgid "Expander Size"
msgstr "Expander Size"
-#: ../gtk/gtkexpander.c:259 ../gtk/gtktoolitemgroup.c:1607
-#: ../gtk/gtktreeview.c:771
+#: ../gtk/gtkexpander.c:259 ../gtk/gtktoolitemgroup.c:1624
+#: ../gtk/gtktreeview.c:864
msgid "Size of the expander arrow"
msgstr "Size of the expander arrow"
@@ -2801,19 +2822,19 @@ msgstr ""
"Whether a file chooser not in open mode will offer the user to create new "
"folders."
-#: ../gtk/gtkfixed.c:98 ../gtk/gtklayout.c:610
+#: ../gtk/gtkfixed.c:103 ../gtk/gtklayout.c:633
msgid "X position"
msgstr "X position"
-#: ../gtk/gtkfixed.c:99 ../gtk/gtklayout.c:611
+#: ../gtk/gtkfixed.c:104 ../gtk/gtklayout.c:634
msgid "X position of child widget"
msgstr "X position of child widget"
-#: ../gtk/gtkfixed.c:108 ../gtk/gtklayout.c:620
+#: ../gtk/gtkfixed.c:111 ../gtk/gtklayout.c:643
msgid "Y position"
msgstr "Y position"
-#: ../gtk/gtkfixed.c:109 ../gtk/gtklayout.c:621
+#: ../gtk/gtkfixed.c:112 ../gtk/gtklayout.c:644
msgid "Y position of child widget"
msgstr "Y position of child widget"
@@ -2909,23 +2930,23 @@ msgstr "Appearance of the frame border"
msgid "A widget to display in place of the usual frame label"
msgstr "A widget to display in place of the usual frame label"
-#: ../gtk/gtkhandlebox.c:183
+#: ../gtk/gtkhandlebox.c:189
msgid "Appearance of the shadow that surrounds the container"
msgstr "Appearance of the shadow that surrounds the container"
-#: ../gtk/gtkhandlebox.c:191
+#: ../gtk/gtkhandlebox.c:197
msgid "Handle position"
msgstr "Handle position"
-#: ../gtk/gtkhandlebox.c:192
+#: ../gtk/gtkhandlebox.c:198
msgid "Position of the handle relative to the child widget"
msgstr "Position of the handle relative to the child widget"
-#: ../gtk/gtkhandlebox.c:200
+#: ../gtk/gtkhandlebox.c:206
msgid "Snap edge"
msgstr "Snap edge"
-#: ../gtk/gtkhandlebox.c:201
+#: ../gtk/gtkhandlebox.c:207
msgid ""
"Side of the handlebox that's lined up with the docking point to dock the "
"handlebox"
@@ -2933,11 +2954,11 @@ msgstr ""
"Side of the handlebox that's lined up with the docking point to dock the "
"handlebox"
-#: ../gtk/gtkhandlebox.c:209
+#: ../gtk/gtkhandlebox.c:215
msgid "Snap edge set"
msgstr "Snap edge set"
-#: ../gtk/gtkhandlebox.c:210
+#: ../gtk/gtkhandlebox.c:216
msgid ""
"Whether to use the value from the snap_edge property or a value derived from "
"handle_position"
@@ -2945,11 +2966,11 @@ msgstr ""
"Whether to use the value from the snap_edge property or a value derived from "
"handle_position"
-#: ../gtk/gtkhandlebox.c:217
+#: ../gtk/gtkhandlebox.c:223
msgid "Child Detached"
msgstr "Child Detached"
-#: ../gtk/gtkhandlebox.c:218
+#: ../gtk/gtkhandlebox.c:224
msgid ""
"A boolean value indicating whether the handlebox's child is attached or "
"detached."
@@ -2957,212 +2978,212 @@ msgstr ""
"A boolean value indicating whether the handlebox's child is attached or "
"detached."
-#: ../gtk/gtkiconview.c:575
+#: ../gtk/gtkiconview.c:580
msgid "Selection mode"
msgstr "Selection mode"
-#: ../gtk/gtkiconview.c:576
+#: ../gtk/gtkiconview.c:581
msgid "The selection mode"
msgstr "The selection mode"
-#: ../gtk/gtkiconview.c:594
+#: ../gtk/gtkiconview.c:599
msgid "Pixbuf column"
msgstr "Pixbuf column"
-#: ../gtk/gtkiconview.c:595
+#: ../gtk/gtkiconview.c:600
msgid "Model column used to retrieve the icon pixbuf from"
msgstr "Model column used to retrieve the icon pixbuf from"
-#: ../gtk/gtkiconview.c:613
+#: ../gtk/gtkiconview.c:618
msgid "Model column used to retrieve the text from"
msgstr "Model column used to retrieve the text from"
-#: ../gtk/gtkiconview.c:632
+#: ../gtk/gtkiconview.c:637
msgid "Markup column"
msgstr "Markup column"
-#: ../gtk/gtkiconview.c:633
+#: ../gtk/gtkiconview.c:638
msgid "Model column used to retrieve the text if using Pango markup"
msgstr "Model column used to retrieve the text if using Pango markup"
-#: ../gtk/gtkiconview.c:640
+#: ../gtk/gtkiconview.c:645
msgid "Icon View Model"
msgstr "Icon View Model"
-#: ../gtk/gtkiconview.c:641
+#: ../gtk/gtkiconview.c:646
msgid "The model for the icon view"
msgstr "The model for the icon view"
-#: ../gtk/gtkiconview.c:657
+#: ../gtk/gtkiconview.c:662
msgid "Number of columns"
msgstr "Number of columns"
-#: ../gtk/gtkiconview.c:658
+#: ../gtk/gtkiconview.c:663
msgid "Number of columns to display"
msgstr "Number of columns to display"
-#: ../gtk/gtkiconview.c:675
+#: ../gtk/gtkiconview.c:680
msgid "Width for each item"
msgstr "Width for each item"
-#: ../gtk/gtkiconview.c:676
+#: ../gtk/gtkiconview.c:681
msgid "The width used for each item"
msgstr "The width used for each item"
-#: ../gtk/gtkiconview.c:692
+#: ../gtk/gtkiconview.c:697
msgid "Space which is inserted between cells of an item"
msgstr "Space which is inserted between cells of an item"
-#: ../gtk/gtkiconview.c:707
+#: ../gtk/gtkiconview.c:712
msgid "Row Spacing"
msgstr "Row Spacing"
-#: ../gtk/gtkiconview.c:708
+#: ../gtk/gtkiconview.c:713
msgid "Space which is inserted between grid rows"
msgstr "Space which is inserted between grid rows"
-#: ../gtk/gtkiconview.c:723
+#: ../gtk/gtkiconview.c:728
msgid "Column Spacing"
msgstr "Column Spacing"
-#: ../gtk/gtkiconview.c:724
+#: ../gtk/gtkiconview.c:729
msgid "Space which is inserted between grid columns"
msgstr "Space which is inserted between grid columns"
-#: ../gtk/gtkiconview.c:739
+#: ../gtk/gtkiconview.c:744
msgid "Margin"
msgstr "Margin"
-#: ../gtk/gtkiconview.c:740
+#: ../gtk/gtkiconview.c:745
msgid "Space which is inserted at the edges of the icon view"
msgstr "Space which is inserted at the edges of the icon view"
-#: ../gtk/gtkiconview.c:755
+#: ../gtk/gtkiconview.c:760
msgid "Item Orientation"
msgstr "Item Orientation"
-#: ../gtk/gtkiconview.c:756
+#: ../gtk/gtkiconview.c:761
msgid ""
"How the text and icon of each item are positioned relative to each other"
msgstr ""
"How the text and icon of each item are positioned relative to each other"
-#: ../gtk/gtkiconview.c:772 ../gtk/gtktreeview.c:605
+#: ../gtk/gtkiconview.c:777 ../gtk/gtktreeview.c:698
#: ../gtk/gtktreeviewcolumn.c:329
msgid "Reorderable"
msgstr "Reorderable"
-#: ../gtk/gtkiconview.c:773 ../gtk/gtktreeview.c:606
+#: ../gtk/gtkiconview.c:778 ../gtk/gtktreeview.c:699
msgid "View is reorderable"
msgstr "View is reorderable"
-#: ../gtk/gtkiconview.c:780 ../gtk/gtktreeview.c:756
+#: ../gtk/gtkiconview.c:785 ../gtk/gtktreeview.c:849
msgid "Tooltip Column"
msgstr "Tooltip Column"
-#: ../gtk/gtkiconview.c:781
+#: ../gtk/gtkiconview.c:786
msgid "The column in the model containing the tooltip texts for the items"
msgstr "The column in the model containing the tooltip texts for the items"
-#: ../gtk/gtkiconview.c:798
+#: ../gtk/gtkiconview.c:803
msgid "Item Padding"
msgstr "Item Padding"
-#: ../gtk/gtkiconview.c:799
+#: ../gtk/gtkiconview.c:804
msgid "Padding around icon view items"
msgstr "Padding around icon view items"
-#: ../gtk/gtkiconview.c:812
+#: ../gtk/gtkiconview.c:817
msgid "Selection Box Color"
msgstr "Selection Box Color"
-#: ../gtk/gtkiconview.c:813
+#: ../gtk/gtkiconview.c:818
msgid "Color of the selection box"
msgstr "Color of the selection box"
-#: ../gtk/gtkiconview.c:819
+#: ../gtk/gtkiconview.c:824
msgid "Selection Box Alpha"
msgstr "Selection Box Alpha"
-#: ../gtk/gtkiconview.c:820
+#: ../gtk/gtkiconview.c:825
msgid "Opacity of the selection box"
msgstr "Opacity of the selection box"
-#: ../gtk/gtkimage.c:227 ../gtk/gtkstatusicon.c:212
+#: ../gtk/gtkimage.c:233 ../gtk/gtkstatusicon.c:212
msgid "Pixbuf"
msgstr "Pixbuf"
-#: ../gtk/gtkimage.c:228 ../gtk/gtkstatusicon.c:213
+#: ../gtk/gtkimage.c:234 ../gtk/gtkstatusicon.c:213
msgid "A GdkPixbuf to display"
msgstr "A GdkPixbuf to display"
-#: ../gtk/gtkimage.c:235 ../gtk/gtkrecentmanager.c:294
+#: ../gtk/gtkimage.c:241 ../gtk/gtkrecentmanager.c:294
#: ../gtk/gtkstatusicon.c:220
msgid "Filename"
msgstr "Filename"
-#: ../gtk/gtkimage.c:236 ../gtk/gtkstatusicon.c:221
+#: ../gtk/gtkimage.c:242 ../gtk/gtkstatusicon.c:221
msgid "Filename to load and display"
msgstr "Filename to load and display"
-#: ../gtk/gtkimage.c:245 ../gtk/gtkstatusicon.c:229
+#: ../gtk/gtkimage.c:251 ../gtk/gtkstatusicon.c:229
msgid "Stock ID for a stock image to display"
msgstr "Stock ID for a stock image to display"
-#: ../gtk/gtkimage.c:252
+#: ../gtk/gtkimage.c:258
msgid "Icon set"
msgstr "Icon set"
-#: ../gtk/gtkimage.c:253
+#: ../gtk/gtkimage.c:259
msgid "Icon set to display"
msgstr "Icon set to display"
-#: ../gtk/gtkimage.c:260 ../gtk/gtkscalebutton.c:230 ../gtk/gtktoolbar.c:514
-#: ../gtk/gtktoolpalette.c:1003
+#: ../gtk/gtkimage.c:266 ../gtk/gtkscalebutton.c:230 ../gtk/gtktoolbar.c:520
+#: ../gtk/gtktoolpalette.c:1030
msgid "Icon size"
msgstr "Icon size"
-#: ../gtk/gtkimage.c:261
+#: ../gtk/gtkimage.c:267
msgid "Symbolic size to use for stock icon, icon set or named icon"
msgstr "Symbolic size to use for stock icon, icon set or named icon"
-#: ../gtk/gtkimage.c:277
+#: ../gtk/gtkimage.c:283
msgid "Pixel size"
msgstr "Pixel size"
-#: ../gtk/gtkimage.c:278
+#: ../gtk/gtkimage.c:284
msgid "Pixel size to use for named icon"
msgstr "Pixel size to use for named icon"
-#: ../gtk/gtkimage.c:286
+#: ../gtk/gtkimage.c:292
msgid "Animation"
msgstr "Animation"
-#: ../gtk/gtkimage.c:287
+#: ../gtk/gtkimage.c:293
msgid "GdkPixbufAnimation to display"
msgstr "GdkPixbufAnimation to display"
-#: ../gtk/gtkimage.c:327 ../gtk/gtkstatusicon.c:260
+#: ../gtk/gtkimage.c:333 ../gtk/gtkstatusicon.c:260
msgid "Storage type"
msgstr "Storage type"
-#: ../gtk/gtkimage.c:328 ../gtk/gtkstatusicon.c:261
+#: ../gtk/gtkimage.c:334 ../gtk/gtkstatusicon.c:261
msgid "The representation being used for image data"
msgstr "The representation being used for image data"
-#: ../gtk/gtkimagemenuitem.c:139
+#: ../gtk/gtkimagemenuitem.c:149
msgid "Child widget to appear next to the menu text"
msgstr "Child widget to appear next to the menu text"
-#: ../gtk/gtkimagemenuitem.c:154
+#: ../gtk/gtkimagemenuitem.c:164
msgid "Whether to use the label text to create a stock menu item"
msgstr "Whether to use the label text to create a stock menu item"
-#: ../gtk/gtkimagemenuitem.c:187 ../gtk/gtkmenu.c:535
+#: ../gtk/gtkimagemenuitem.c:197 ../gtk/gtkmenu.c:536
msgid "Accel Group"
msgstr "Accel Group"
-#: ../gtk/gtkimagemenuitem.c:188
+#: ../gtk/gtkimagemenuitem.c:198
msgid "The Accel Group to use for stock accelerator keys"
msgstr "The Accel Group to use for stock accelerator keys"
@@ -3195,19 +3216,19 @@ msgstr "Screen"
msgid "The screen where this window will be displayed"
msgstr "The screen where this window will be displayed"
-#: ../gtk/gtklabel.c:550
+#: ../gtk/gtklabel.c:568
msgid "The text of the label"
msgstr "The text of the label"
-#: ../gtk/gtklabel.c:557
+#: ../gtk/gtklabel.c:575
msgid "A list of style attributes to apply to the text of the label"
msgstr "A list of style attributes to apply to the text of the label"
-#: ../gtk/gtklabel.c:578 ../gtk/gtktexttag.c:335 ../gtk/gtktextview.c:684
+#: ../gtk/gtklabel.c:596 ../gtk/gtktexttag.c:335 ../gtk/gtktextview.c:703
msgid "Justification"
msgstr "Justification"
-#: ../gtk/gtklabel.c:579
+#: ../gtk/gtklabel.c:597
msgid ""
"The alignment of the lines in the text of the label relative to each other. "
"This does NOT affect the alignment of the label within its allocation. See "
@@ -3217,11 +3238,11 @@ msgstr ""
"This does NOT affect the alignment of the label within its allocation. See "
"GtkMisc::xalign for that"
-#: ../gtk/gtklabel.c:587
+#: ../gtk/gtklabel.c:605
msgid "Pattern"
msgstr "Pattern"
-#: ../gtk/gtklabel.c:588
+#: ../gtk/gtklabel.c:606
msgid ""
"A string with _ characters in positions correspond to characters in the text "
"to underline"
@@ -3229,47 +3250,47 @@ msgstr ""
"A string with _ characters in positions correspond to characters in the text "
"to underline"
-#: ../gtk/gtklabel.c:595
+#: ../gtk/gtklabel.c:613
msgid "Line wrap"
msgstr "Line wrap"
-#: ../gtk/gtklabel.c:596
+#: ../gtk/gtklabel.c:614
msgid "If set, wrap lines if the text becomes too wide"
msgstr "If set, wrap lines if the text becomes too wide"
-#: ../gtk/gtklabel.c:611
+#: ../gtk/gtklabel.c:629
msgid "Line wrap mode"
msgstr "Line wrap mode"
-#: ../gtk/gtklabel.c:612
+#: ../gtk/gtklabel.c:630
msgid "If wrap is set, controls how linewrapping is done"
msgstr "If wrap is set, controls how linewrapping is done"
-#: ../gtk/gtklabel.c:619
+#: ../gtk/gtklabel.c:637
msgid "Selectable"
msgstr "Selectable"
-#: ../gtk/gtklabel.c:620
+#: ../gtk/gtklabel.c:638
msgid "Whether the label text can be selected with the mouse"
msgstr "Whether the label text can be selected with the mouse"
-#: ../gtk/gtklabel.c:626
+#: ../gtk/gtklabel.c:644
msgid "Mnemonic key"
msgstr "Mnemonic key"
-#: ../gtk/gtklabel.c:627
+#: ../gtk/gtklabel.c:645
msgid "The mnemonic accelerator key for this label"
msgstr "The mnemonic accelerator key for this label"
-#: ../gtk/gtklabel.c:635
+#: ../gtk/gtklabel.c:653
msgid "Mnemonic widget"
msgstr "Mnemonic widget"
-#: ../gtk/gtklabel.c:636
+#: ../gtk/gtklabel.c:654
msgid "The widget to be activated when the label's mnemonic key is pressed"
msgstr "The widget to be activated when the label's mnemonic key is pressed"
-#: ../gtk/gtklabel.c:682
+#: ../gtk/gtklabel.c:700
msgid ""
"The preferred place to ellipsize the string, if the label does not have "
"enough room to display the entire string"
@@ -3277,47 +3298,47 @@ msgstr ""
"The preferred place to ellipsize the string, if the label does not have "
"enough room to display the entire string"
-#: ../gtk/gtklabel.c:723
+#: ../gtk/gtklabel.c:741
msgid "Single Line Mode"
msgstr "Single Line Mode"
-#: ../gtk/gtklabel.c:724
+#: ../gtk/gtklabel.c:742
msgid "Whether the label is in single line mode"
msgstr "Whether the label is in single line mode"
-#: ../gtk/gtklabel.c:741
+#: ../gtk/gtklabel.c:759
msgid "Angle"
msgstr "Angle"
-#: ../gtk/gtklabel.c:742
+#: ../gtk/gtklabel.c:760
msgid "Angle at which the label is rotated"
msgstr "Angle at which the label is rotated"
-#: ../gtk/gtklabel.c:764
+#: ../gtk/gtklabel.c:782
msgid "The desired maximum width of the label, in characters"
msgstr "The desired maximum width of the label, in characters"
-#: ../gtk/gtklabel.c:782
+#: ../gtk/gtklabel.c:800
msgid "Track visited links"
msgstr "Track visited links"
-#: ../gtk/gtklabel.c:783
+#: ../gtk/gtklabel.c:801
msgid "Whether visited links should be tracked"
msgstr "Whether visited links should be tracked"
-#: ../gtk/gtklayout.c:636 ../gtk/gtktreeviewcolumn.c:229
+#: ../gtk/gtklayout.c:659 ../gtk/gtktreeviewcolumn.c:229
msgid "Width"
msgstr "Width"
-#: ../gtk/gtklayout.c:637
+#: ../gtk/gtklayout.c:660
msgid "The width of the layout"
msgstr "The width of the layout"
-#: ../gtk/gtklayout.c:645
+#: ../gtk/gtklayout.c:668
msgid "Height"
msgstr "Height"
-#: ../gtk/gtklayout.c:646
+#: ../gtk/gtklayout.c:669
msgid "The height of the layout"
msgstr "The height of the layout"
@@ -3337,60 +3358,60 @@ msgstr "Visited"
msgid "Whether this link has been visited."
msgstr "Whether this link has been visited."
-#: ../gtk/gtkmenubar.c:163
+#: ../gtk/gtkmenubar.c:170
msgid "Pack direction"
msgstr "Pack direction"
-#: ../gtk/gtkmenubar.c:164
+#: ../gtk/gtkmenubar.c:171
msgid "The pack direction of the menubar"
msgstr "The pack direction of the menubar"
-#: ../gtk/gtkmenubar.c:180
+#: ../gtk/gtkmenubar.c:187
msgid "Child Pack direction"
msgstr "Child Pack direction"
-#: ../gtk/gtkmenubar.c:181
+#: ../gtk/gtkmenubar.c:188
msgid "The child pack direction of the menubar"
msgstr "The child pack direction of the menubar"
-#: ../gtk/gtkmenubar.c:190
+#: ../gtk/gtkmenubar.c:197
msgid "Style of bevel around the menubar"
msgstr "Style of bevel around the menubar"
-#: ../gtk/gtkmenubar.c:197 ../gtk/gtktoolbar.c:564
+#: ../gtk/gtkmenubar.c:204 ../gtk/gtktoolbar.c:570
msgid "Internal padding"
msgstr "Internal padding"
-#: ../gtk/gtkmenubar.c:198
+#: ../gtk/gtkmenubar.c:205
msgid "Amount of border space between the menubar shadow and the menu items"
msgstr "Amount of border space between the menubar shadow and the menu items"
-#: ../gtk/gtkmenu.c:521
+#: ../gtk/gtkmenu.c:522
msgid "The currently selected menu item"
msgstr "The currently selected menu item"
-#: ../gtk/gtkmenu.c:536
+#: ../gtk/gtkmenu.c:537
msgid "The accel group holding accelerators for the menu"
msgstr "The accel group holding accelerators for the menu"
-#: ../gtk/gtkmenu.c:550 ../gtk/gtkmenuitem.c:316
+#: ../gtk/gtkmenu.c:551 ../gtk/gtkmenuitem.c:316
msgid "Accel Path"
msgstr "Accel Path"
-#: ../gtk/gtkmenu.c:551
+#: ../gtk/gtkmenu.c:552
msgid "An accel path used to conveniently construct accel paths of child items"
msgstr ""
"An accel path used to conveniently construct accel paths of child items"
-#: ../gtk/gtkmenu.c:567
+#: ../gtk/gtkmenu.c:568
msgid "Attach Widget"
msgstr "Attach Widget"
-#: ../gtk/gtkmenu.c:568
+#: ../gtk/gtkmenu.c:569
msgid "The widget the menu is attached to"
msgstr "The widget the menu is attached to"
-#: ../gtk/gtkmenu.c:576
+#: ../gtk/gtkmenu.c:577
msgid ""
"A title that may be displayed by the window manager when this menu is torn-"
"off"
@@ -3398,35 +3419,35 @@ msgstr ""
"A title that may be displayed by the window manager when this menu is torn-"
"off"
-#: ../gtk/gtkmenu.c:590
+#: ../gtk/gtkmenu.c:591
msgid "Tearoff State"
msgstr "Tearoff State"
-#: ../gtk/gtkmenu.c:591
+#: ../gtk/gtkmenu.c:592
msgid "A boolean that indicates whether the menu is torn-off"
msgstr "A boolean that indicates whether the menu is torn-off"
-#: ../gtk/gtkmenu.c:605
+#: ../gtk/gtkmenu.c:606
msgid "Monitor"
msgstr "Monitor"
-#: ../gtk/gtkmenu.c:606
+#: ../gtk/gtkmenu.c:607
msgid "The monitor the menu will be popped up on"
msgstr "The monitor the menu will be popped up on"
-#: ../gtk/gtkmenu.c:612
+#: ../gtk/gtkmenu.c:613
msgid "Vertical Padding"
msgstr "Vertical Padding"
-#: ../gtk/gtkmenu.c:613
+#: ../gtk/gtkmenu.c:614
msgid "Extra space at the top and bottom of the menu"
msgstr "Extra space at the top and bottom of the menu"
-#: ../gtk/gtkmenu.c:635
+#: ../gtk/gtkmenu.c:636
msgid "Reserve Toggle Size"
msgstr "Reserve Toggle Size"
-#: ../gtk/gtkmenu.c:636
+#: ../gtk/gtkmenu.c:637
msgid ""
"A boolean that indicates whether the menu reserves space for toggles and "
"icons"
@@ -3434,19 +3455,19 @@ msgstr ""
"A boolean that indicates whether the menu reserves space for toggles and "
"icons"
-#: ../gtk/gtkmenu.c:642
+#: ../gtk/gtkmenu.c:643
msgid "Horizontal Padding"
msgstr "Horizontal Padding"
-#: ../gtk/gtkmenu.c:643
+#: ../gtk/gtkmenu.c:644
msgid "Extra space at the left and right edges of the menu"
msgstr "Extra space at the left and right edges of the menu"
-#: ../gtk/gtkmenu.c:651
+#: ../gtk/gtkmenu.c:652
msgid "Vertical Offset"
msgstr "Vertical Offset"
-#: ../gtk/gtkmenu.c:652
+#: ../gtk/gtkmenu.c:653
msgid ""
"When the menu is a submenu, position it this number of pixels offset "
"vertically"
@@ -3454,11 +3475,11 @@ msgstr ""
"When the menu is a submenu, position it this number of pixels offset "
"vertically"
-#: ../gtk/gtkmenu.c:660
+#: ../gtk/gtkmenu.c:661
msgid "Horizontal Offset"
msgstr "Horizontal Offset"
-#: ../gtk/gtkmenu.c:661
+#: ../gtk/gtkmenu.c:662
msgid ""
"When the menu is a submenu, position it this number of pixels offset "
"horizontally"
@@ -3466,55 +3487,55 @@ msgstr ""
"When the menu is a submenu, position it this number of pixels offset "
"horizontally"
-#: ../gtk/gtkmenu.c:669
+#: ../gtk/gtkmenu.c:670
msgid "Double Arrows"
msgstr "Double Arrows"
-#: ../gtk/gtkmenu.c:670
+#: ../gtk/gtkmenu.c:671
msgid "When scrolling, always show both arrows."
msgstr "When scrolling, always show both arrows."
-#: ../gtk/gtkmenu.c:683
+#: ../gtk/gtkmenu.c:684
msgid "Arrow Placement"
msgstr "Arrow Placement"
-#: ../gtk/gtkmenu.c:684
+#: ../gtk/gtkmenu.c:685
msgid "Indicates where scroll arrows should be placed"
msgstr "Indicates where scroll arrows should be placed"
-#: ../gtk/gtkmenu.c:692
+#: ../gtk/gtkmenu.c:693
msgid "Left Attach"
msgstr "Left Attach"
-#: ../gtk/gtkmenu.c:693 ../gtk/gtktable.c:197
+#: ../gtk/gtkmenu.c:694 ../gtk/gtktable.c:202
msgid "The column number to attach the left side of the child to"
msgstr "The column number to attach the left side of the child to"
-#: ../gtk/gtkmenu.c:700
+#: ../gtk/gtkmenu.c:701
msgid "Right Attach"
msgstr "Right Attach"
-#: ../gtk/gtkmenu.c:701
+#: ../gtk/gtkmenu.c:702
msgid "The column number to attach the right side of the child to"
msgstr "The column number to attach the right side of the child to"
-#: ../gtk/gtkmenu.c:708
+#: ../gtk/gtkmenu.c:709
msgid "Top Attach"
msgstr "Top Attach"
-#: ../gtk/gtkmenu.c:709
+#: ../gtk/gtkmenu.c:710
msgid "The row number to attach the top of the child to"
msgstr "The row number to attach the top of the child to"
-#: ../gtk/gtkmenu.c:716
+#: ../gtk/gtkmenu.c:717
msgid "Bottom Attach"
msgstr "Bottom Attach"
-#: ../gtk/gtkmenu.c:717 ../gtk/gtktable.c:218
+#: ../gtk/gtkmenu.c:718 ../gtk/gtktable.c:223
msgid "The row number to attach the bottom of the child to"
msgstr "The row number to attach the bottom of the child to"
-#: ../gtk/gtkmenu.c:731
+#: ../gtk/gtkmenu.c:732
msgid "Arbitrary constant to scale down the size of the scroll arrow"
msgstr "Arbitrary constant to scale down the size of the scroll arrow"
@@ -3557,11 +3578,11 @@ msgstr "Width in Characters"
msgid "The minimum desired width of the menu item in characters"
msgstr "The minimum desired width of the menu item in characters"
-#: ../gtk/gtkmenushell.c:379
+#: ../gtk/gtkmenushell.c:381
msgid "Take Focus"
msgstr "Take Focus"
-#: ../gtk/gtkmenushell.c:380
+#: ../gtk/gtkmenushell.c:382
msgid "A boolean that determines whether the menu grabs the keyboard focus"
msgstr "A boolean that determines whether the menu grabs the keyboard focus"
@@ -3681,51 +3702,51 @@ msgstr "Are we showing a dialog"
msgid "The screen where this window will be displayed."
msgstr "The screen where this window will be displayed."
-#: ../gtk/gtknotebook.c:682
+#: ../gtk/gtknotebook.c:689
msgid "Page"
msgstr "Page"
-#: ../gtk/gtknotebook.c:683
+#: ../gtk/gtknotebook.c:690
msgid "The index of the current page"
msgstr "The index of the current page"
-#: ../gtk/gtknotebook.c:691
+#: ../gtk/gtknotebook.c:698
msgid "Tab Position"
msgstr "Tab Position"
-#: ../gtk/gtknotebook.c:692
+#: ../gtk/gtknotebook.c:699
msgid "Which side of the notebook holds the tabs"
msgstr "Which side of the notebook holds the tabs"
-#: ../gtk/gtknotebook.c:699
+#: ../gtk/gtknotebook.c:706
msgid "Show Tabs"
msgstr "Show Tabs"
-#: ../gtk/gtknotebook.c:700
+#: ../gtk/gtknotebook.c:707
msgid "Whether tabs should be shown"
msgstr "Whether tabs should be shown"
-#: ../gtk/gtknotebook.c:706
+#: ../gtk/gtknotebook.c:713
msgid "Show Border"
msgstr "Show Border"
-#: ../gtk/gtknotebook.c:707
+#: ../gtk/gtknotebook.c:714
msgid "Whether the border should be shown"
msgstr "Whether the border should be shown"
-#: ../gtk/gtknotebook.c:713
+#: ../gtk/gtknotebook.c:720
msgid "Scrollable"
msgstr "Scrollable"
-#: ../gtk/gtknotebook.c:714
+#: ../gtk/gtknotebook.c:721
msgid "If TRUE, scroll arrows are added if there are too many tabs to fit"
msgstr "If TRUE, scroll arrows are added if there are too many tabs to fit"
-#: ../gtk/gtknotebook.c:720
+#: ../gtk/gtknotebook.c:727
msgid "Enable Popup"
msgstr "Enable Popup"
-#: ../gtk/gtknotebook.c:721
+#: ../gtk/gtknotebook.c:728
msgid ""
"If TRUE, pressing the right mouse button on the notebook pops up a menu that "
"you can use to go to a page"
@@ -3733,123 +3754,123 @@ msgstr ""
"If TRUE, pressing the right mouse button on the notebook pops up a menu that "
"you can use to go to a page"
-#: ../gtk/gtknotebook.c:735
+#: ../gtk/gtknotebook.c:742
msgid "Group Name"
msgstr "Group Name"
-#: ../gtk/gtknotebook.c:736
+#: ../gtk/gtknotebook.c:743
msgid "Group name for tab drag and drop"
msgstr "Group name for tab drag and drop"
-#: ../gtk/gtknotebook.c:743
+#: ../gtk/gtknotebook.c:750
msgid "Tab label"
msgstr "Tab label"
-#: ../gtk/gtknotebook.c:744
+#: ../gtk/gtknotebook.c:751
msgid "The string displayed on the child's tab label"
msgstr "The string displayed on the child's tab label"
-#: ../gtk/gtknotebook.c:750
+#: ../gtk/gtknotebook.c:757
msgid "Menu label"
msgstr "Menu label"
-#: ../gtk/gtknotebook.c:751
+#: ../gtk/gtknotebook.c:758
msgid "The string displayed in the child's menu entry"
msgstr "The string displayed in the child's menu entry"
-#: ../gtk/gtknotebook.c:764
+#: ../gtk/gtknotebook.c:771
msgid "Tab expand"
msgstr "Tab expand"
-#: ../gtk/gtknotebook.c:765
+#: ../gtk/gtknotebook.c:772
msgid "Whether to expand the child's tab"
msgstr "Whether to expand the child's tab"
-#: ../gtk/gtknotebook.c:771
+#: ../gtk/gtknotebook.c:778
msgid "Tab fill"
msgstr "Tab fill"
-#: ../gtk/gtknotebook.c:772
+#: ../gtk/gtknotebook.c:779
msgid "Whether the child's tab should fill the allocated area"
msgstr "Whether the child's tab should fill the allocated area"
-#: ../gtk/gtknotebook.c:785
+#: ../gtk/gtknotebook.c:792
msgid "Tab pack type"
msgstr "Tab pack type"
-#: ../gtk/gtknotebook.c:792
+#: ../gtk/gtknotebook.c:799
msgid "Tab reorderable"
msgstr "Tab reorderable"
-#: ../gtk/gtknotebook.c:793
+#: ../gtk/gtknotebook.c:800
msgid "Whether the tab is reorderable by user action"
msgstr "Whether the tab is reorderable by user action"
-#: ../gtk/gtknotebook.c:799
+#: ../gtk/gtknotebook.c:806
msgid "Tab detachable"
msgstr "Tab detachable"
-#: ../gtk/gtknotebook.c:800
+#: ../gtk/gtknotebook.c:807
msgid "Whether the tab is detachable"
msgstr "Whether the tab is detachable"
-#: ../gtk/gtknotebook.c:815 ../gtk/gtkscrollbar.c:105
+#: ../gtk/gtknotebook.c:822 ../gtk/gtkscrollbar.c:105
msgid "Secondary backward stepper"
msgstr "Secondary backward stepper"
-#: ../gtk/gtknotebook.c:816
+#: ../gtk/gtknotebook.c:823
msgid ""
"Display a second backward arrow button on the opposite end of the tab area"
msgstr ""
"Display a second backward arrow button on the opposite end of the tab area"
-#: ../gtk/gtknotebook.c:831 ../gtk/gtkscrollbar.c:112
+#: ../gtk/gtknotebook.c:838 ../gtk/gtkscrollbar.c:112
msgid "Secondary forward stepper"
msgstr "Secondary forward stepper"
-#: ../gtk/gtknotebook.c:832
+#: ../gtk/gtknotebook.c:839
msgid ""
"Display a second forward arrow button on the opposite end of the tab area"
msgstr ""
"Display a second forward arrow button on the opposite end of the tab area"
-#: ../gtk/gtknotebook.c:846 ../gtk/gtkscrollbar.c:91
+#: ../gtk/gtknotebook.c:853 ../gtk/gtkscrollbar.c:91
msgid "Backward stepper"
msgstr "Backward stepper"
-#: ../gtk/gtknotebook.c:847 ../gtk/gtkscrollbar.c:92
+#: ../gtk/gtknotebook.c:854 ../gtk/gtkscrollbar.c:92
msgid "Display the standard backward arrow button"
msgstr "Display the standard backward arrow button"
-#: ../gtk/gtknotebook.c:861 ../gtk/gtkscrollbar.c:98
+#: ../gtk/gtknotebook.c:868 ../gtk/gtkscrollbar.c:98
msgid "Forward stepper"
msgstr "Forward stepper"
-#: ../gtk/gtknotebook.c:862 ../gtk/gtkscrollbar.c:99
+#: ../gtk/gtknotebook.c:869 ../gtk/gtkscrollbar.c:99
msgid "Display the standard forward arrow button"
msgstr "Display the standard forward arrow button"
-#: ../gtk/gtknotebook.c:876
+#: ../gtk/gtknotebook.c:883
msgid "Tab overlap"
msgstr "Tab overlap"
-#: ../gtk/gtknotebook.c:877
+#: ../gtk/gtknotebook.c:884
msgid "Size of tab overlap area"
msgstr "Size of tab overlap area"
-#: ../gtk/gtknotebook.c:892
+#: ../gtk/gtknotebook.c:899
msgid "Tab curvature"
msgstr "Tab curvature"
-#: ../gtk/gtknotebook.c:893
+#: ../gtk/gtknotebook.c:900
msgid "Size of tab curvature"
msgstr "Size of tab curvature"
-#: ../gtk/gtknotebook.c:909
+#: ../gtk/gtknotebook.c:916
msgid "Arrow spacing"
msgstr "Arrow spacing"
-#: ../gtk/gtknotebook.c:910
+#: ../gtk/gtknotebook.c:917
msgid "Scroll arrow spacing"
msgstr "Scroll arrow spacing"
@@ -3862,57 +3883,57 @@ msgstr "Orientation"
msgid "The orientation of the orientable"
msgstr "The orientation of the orientable"
-#: ../gtk/gtkpaned.c:272
+#: ../gtk/gtkpaned.c:328
msgid ""
"Position of paned separator in pixels (0 means all the way to the left/top)"
msgstr ""
"Position of paned separator in pixels (0 means all the way to the left/top)"
-#: ../gtk/gtkpaned.c:281
+#: ../gtk/gtkpaned.c:337
msgid "Position Set"
msgstr "Position Set"
-#: ../gtk/gtkpaned.c:282
+#: ../gtk/gtkpaned.c:338
msgid "TRUE if the Position property should be used"
msgstr "TRUE if the Position property should be used"
-#: ../gtk/gtkpaned.c:288
+#: ../gtk/gtkpaned.c:344
msgid "Handle Size"
msgstr "Handle Size"
-#: ../gtk/gtkpaned.c:289
+#: ../gtk/gtkpaned.c:345
msgid "Width of handle"
msgstr "Width of handle"
-#: ../gtk/gtkpaned.c:305
+#: ../gtk/gtkpaned.c:361
msgid "Minimal Position"
msgstr "Minimal Position"
-#: ../gtk/gtkpaned.c:306
+#: ../gtk/gtkpaned.c:362
msgid "Smallest possible value for the \"position\" property"
msgstr "Smallest possible value for the \"position\" property"
-#: ../gtk/gtkpaned.c:323
+#: ../gtk/gtkpaned.c:379
msgid "Maximal Position"
msgstr "Maximal Position"
-#: ../gtk/gtkpaned.c:324
+#: ../gtk/gtkpaned.c:380
msgid "Largest possible value for the \"position\" property"
msgstr "Largest possible value for the \"position\" property"
-#: ../gtk/gtkpaned.c:341
+#: ../gtk/gtkpaned.c:397
msgid "Resize"
msgstr "Resize"
-#: ../gtk/gtkpaned.c:342
+#: ../gtk/gtkpaned.c:398
msgid "If TRUE, the child expands and shrinks along with the paned widget"
msgstr "If TRUE, the child expands and shrinks along with the paned widget"
-#: ../gtk/gtkpaned.c:357
+#: ../gtk/gtkpaned.c:413
msgid "Shrink"
msgstr "Shrink"
-#: ../gtk/gtkpaned.c:358
+#: ../gtk/gtkpaned.c:414
msgid "If TRUE, the child can be made smaller than its requisition"
msgstr "If TRUE, the child can be made smaller than its requisition"
@@ -4233,35 +4254,35 @@ msgstr "Whether the application has a selection"
msgid "TRUE if page setup combos are embedded in GtkPrintUnixDialog"
msgstr "TRUE if page setup combos are embedded in GtkPrintUnixDialog"
-#: ../gtk/gtkprogressbar.c:129
+#: ../gtk/gtkprogressbar.c:161
msgid "Fraction"
msgstr "Fraction"
-#: ../gtk/gtkprogressbar.c:130
+#: ../gtk/gtkprogressbar.c:162
msgid "The fraction of total work that has been completed"
msgstr "The fraction of total work that has been completed"
-#: ../gtk/gtkprogressbar.c:137
+#: ../gtk/gtkprogressbar.c:169
msgid "Pulse Step"
msgstr "Pulse Step"
-#: ../gtk/gtkprogressbar.c:138
+#: ../gtk/gtkprogressbar.c:170
msgid "The fraction of total progress to move the bouncing block when pulsed"
msgstr "The fraction of total progress to move the bouncing block when pulsed"
-#: ../gtk/gtkprogressbar.c:146
+#: ../gtk/gtkprogressbar.c:178
msgid "Text to be displayed in the progress bar"
msgstr "Text to be displayed in the progress bar"
-#: ../gtk/gtkprogressbar.c:153
+#: ../gtk/gtkprogressbar.c:185
msgid "Show text"
msgstr "Show text"
-#: ../gtk/gtkprogressbar.c:154
+#: ../gtk/gtkprogressbar.c:186
msgid "Whether the progress is shown as text."
msgstr "Whether the progress is shown as text."
-#: ../gtk/gtkprogressbar.c:176
+#: ../gtk/gtkprogressbar.c:208
msgid ""
"The preferred place to ellipsize the string, if the progress bar does not "
"have enough room to display the entire string, if at all."
@@ -4269,51 +4290,51 @@ msgstr ""
"The preferred place to ellipsize the string, if the progress bar does not "
"have enough room to display the entire string, if at all."
-#: ../gtk/gtkprogressbar.c:183
+#: ../gtk/gtkprogressbar.c:215
msgid "X spacing"
msgstr "X spacing"
-#: ../gtk/gtkprogressbar.c:184
+#: ../gtk/gtkprogressbar.c:216
msgid "Extra spacing applied to the width of a progress bar."
msgstr "Extra spacing applied to the width of a progress bar."
-#: ../gtk/gtkprogressbar.c:189
+#: ../gtk/gtkprogressbar.c:221
msgid "Y spacing"
msgstr "Y spacing"
-#: ../gtk/gtkprogressbar.c:190
+#: ../gtk/gtkprogressbar.c:222
msgid "Extra spacing applied to the height of a progress bar."
msgstr "Extra spacing applied to the height of a progress bar."
-#: ../gtk/gtkprogressbar.c:203
+#: ../gtk/gtkprogressbar.c:235
msgid "Minimum horizontal bar width"
msgstr "Minimum horizontal bar width"
-#: ../gtk/gtkprogressbar.c:204
+#: ../gtk/gtkprogressbar.c:236
msgid "The minimum horizontal width of the progress bar"
msgstr "The minimum horizontal width of the progress bar"
-#: ../gtk/gtkprogressbar.c:216
+#: ../gtk/gtkprogressbar.c:248
msgid "Minimum horizontal bar height"
msgstr "Minimum horizontal bar height"
-#: ../gtk/gtkprogressbar.c:217
+#: ../gtk/gtkprogressbar.c:249
msgid "Minimum horizontal height of the progress bar"
msgstr "Minimum horizontal height of the progress bar"
-#: ../gtk/gtkprogressbar.c:229
+#: ../gtk/gtkprogressbar.c:261
msgid "Minimum vertical bar width"
msgstr "Minimum vertical bar width"
-#: ../gtk/gtkprogressbar.c:230
+#: ../gtk/gtkprogressbar.c:262
msgid "The minimum vertical width of the progress bar"
msgstr "The minimum vertical width of the progress bar"
-#: ../gtk/gtkprogressbar.c:242
+#: ../gtk/gtkprogressbar.c:274
msgid "Minimum vertical bar height"
msgstr "Minimum vertical bar height"
-#: ../gtk/gtkprogressbar.c:243
+#: ../gtk/gtkprogressbar.c:275
msgid "The minimum vertical height of the progress bar"
msgstr "The minimum vertical height of the progress bar"
@@ -4329,7 +4350,7 @@ msgstr ""
"The value returned by gtk_radio_action_get_current_value() when this action "
"is the current action of its group."
-#: ../gtk/gtkradioaction.c:135 ../gtk/gtkradiobutton.c:160
+#: ../gtk/gtkradioaction.c:135 ../gtk/gtkradiobutton.c:163
#: ../gtk/gtkradiomenuitem.c:373 ../gtk/gtkradiotoolbutton.c:65
msgid "Group"
msgstr "Group"
@@ -4350,7 +4371,7 @@ msgstr ""
"The value property of the currently active member of the group to which this "
"action belongs."
-#: ../gtk/gtkradiobutton.c:161
+#: ../gtk/gtkradiobutton.c:164
msgid "The radio button whose group this widget belongs to."
msgstr "The radio button whose group this widget belongs to."
@@ -4362,27 +4383,27 @@ msgstr "The radio menu item whose group this widget belongs to."
msgid "The radio tool button whose group this button belongs to."
msgstr "The radio tool button whose group this button belongs to."
-#: ../gtk/gtkrange.c:416
+#: ../gtk/gtkrange.c:423
msgid "Update policy"
msgstr "Update policy"
-#: ../gtk/gtkrange.c:417
+#: ../gtk/gtkrange.c:424
msgid "How the range should be updated on the screen"
msgstr "How the range should be updated on the screen"
-#: ../gtk/gtkrange.c:426
+#: ../gtk/gtkrange.c:433
msgid "The GtkAdjustment that contains the current value of this range object"
msgstr "The GtkAdjustment that contains the current value of this range object"
-#: ../gtk/gtkrange.c:434
+#: ../gtk/gtkrange.c:441
msgid "Invert direction slider moves to increase range value"
msgstr "Invert direction slider moves to increase range value"
-#: ../gtk/gtkrange.c:441
+#: ../gtk/gtkrange.c:448
msgid "Lower stepper sensitivity"
msgstr "Lower stepper sensitivity"
-#: ../gtk/gtkrange.c:442
+#: ../gtk/gtkrange.c:449
msgid ""
"The sensitivity policy for the stepper that points to the adjustment's lower "
"side"
@@ -4390,11 +4411,11 @@ msgstr ""
"The sensitivity policy for the stepper that points to the adjustment's lower "
"side"
-#: ../gtk/gtkrange.c:450
+#: ../gtk/gtkrange.c:457
msgid "Upper stepper sensitivity"
msgstr "Upper stepper sensitivity"
-#: ../gtk/gtkrange.c:451
+#: ../gtk/gtkrange.c:458
msgid ""
"The sensitivity policy for the stepper that points to the adjustment's upper "
"side"
@@ -4402,87 +4423,87 @@ msgstr ""
"The sensitivity policy for the stepper that points to the adjustment's upper "
"side"
-#: ../gtk/gtkrange.c:468
+#: ../gtk/gtkrange.c:475
msgid "Show Fill Level"
msgstr "Show Fill Level"
-#: ../gtk/gtkrange.c:469
+#: ../gtk/gtkrange.c:476
msgid "Whether to display a fill level indicator graphics on trough."
msgstr "Whether to display a fill level indicator graphics on trough."
-#: ../gtk/gtkrange.c:485
+#: ../gtk/gtkrange.c:492
msgid "Restrict to Fill Level"
msgstr "Restrict to Fill Level"
-#: ../gtk/gtkrange.c:486
+#: ../gtk/gtkrange.c:493
msgid "Whether to restrict the upper boundary to the fill level."
msgstr "Whether to restrict the upper boundary to the fill level."
-#: ../gtk/gtkrange.c:501
+#: ../gtk/gtkrange.c:508
msgid "Fill Level"
msgstr "Fill Level"
-#: ../gtk/gtkrange.c:502
+#: ../gtk/gtkrange.c:509
msgid "The fill level."
msgstr "The fill level."
-#: ../gtk/gtkrange.c:510
+#: ../gtk/gtkrange.c:517 ../gtk/gtkswitch.c:772
msgid "Slider Width"
msgstr "Slider Width"
-#: ../gtk/gtkrange.c:511
+#: ../gtk/gtkrange.c:518
msgid "Width of scrollbar or scale thumb"
msgstr "Width of scrollbar or scale thumb"
-#: ../gtk/gtkrange.c:518
+#: ../gtk/gtkrange.c:525
msgid "Trough Border"
msgstr "Trough Border"
-#: ../gtk/gtkrange.c:519
+#: ../gtk/gtkrange.c:526
msgid "Spacing between thumb/steppers and outer trough bevel"
msgstr "Spacing between thumb/steppers and outer trough bevel"
-#: ../gtk/gtkrange.c:526
+#: ../gtk/gtkrange.c:533
msgid "Stepper Size"
msgstr "Stepper Size"
-#: ../gtk/gtkrange.c:527
+#: ../gtk/gtkrange.c:534
msgid "Length of step buttons at ends"
msgstr "Length of step buttons at ends"
-#: ../gtk/gtkrange.c:542
+#: ../gtk/gtkrange.c:549
msgid "Stepper Spacing"
msgstr "Stepper Spacing"
-#: ../gtk/gtkrange.c:543
+#: ../gtk/gtkrange.c:550
msgid "Spacing between step buttons and thumb"
msgstr "Spacing between step buttons and thumb"
-#: ../gtk/gtkrange.c:550
+#: ../gtk/gtkrange.c:557
msgid "Arrow X Displacement"
msgstr "Arrow X Displacement"
-#: ../gtk/gtkrange.c:551
+#: ../gtk/gtkrange.c:558
msgid ""
"How far in the x direction to move the arrow when the button is depressed"
msgstr ""
"How far in the x direction to move the arrow when the button is depressed"
-#: ../gtk/gtkrange.c:558
+#: ../gtk/gtkrange.c:565
msgid "Arrow Y Displacement"
msgstr "Arrow Y Displacement"
-#: ../gtk/gtkrange.c:559
+#: ../gtk/gtkrange.c:566
msgid ""
"How far in the y direction to move the arrow when the button is depressed"
msgstr ""
"How far in the y direction to move the arrow when the button is depressed"
-#: ../gtk/gtkrange.c:577
+#: ../gtk/gtkrange.c:584
msgid "Trough Under Steppers"
msgstr "Trough Under Steppers"
-#: ../gtk/gtkrange.c:578
+#: ../gtk/gtkrange.c:585
msgid ""
"Whether to draw trough for full length of range or exclude the steppers and "
"spacing"
@@ -4490,11 +4511,11 @@ msgstr ""
"Whether to draw trough for full length of range or exclude the steppers and "
"spacing"
-#: ../gtk/gtkrange.c:591
+#: ../gtk/gtkrange.c:598
msgid "Arrow scaling"
msgstr "Arrow scaling"
-#: ../gtk/gtkrange.c:592
+#: ../gtk/gtkrange.c:599
msgid "Arrow scaling with regard to scroll button size"
msgstr "Arrow scaling with regard to scroll button size"
@@ -4587,42 +4608,6 @@ msgstr "The full path to the file to be used to store and read the list"
msgid "The size of the recently used resources list"
msgstr "The size of the recently used resources list"
-#: ../gtk/gtkruler.c:138
-msgid "Lower"
-msgstr "Lower"
-
-#: ../gtk/gtkruler.c:139
-msgid "Lower limit of ruler"
-msgstr "Lower limit of ruler"
-
-#: ../gtk/gtkruler.c:148
-msgid "Upper"
-msgstr "Upper"
-
-#: ../gtk/gtkruler.c:149
-msgid "Upper limit of ruler"
-msgstr "Upper limit of ruler"
-
-#: ../gtk/gtkruler.c:159
-msgid "Position of mark on the ruler"
-msgstr "Position of mark on the ruler"
-
-#: ../gtk/gtkruler.c:168
-msgid "Max Size"
-msgstr "Max Size"
-
-#: ../gtk/gtkruler.c:169
-msgid "Maximum size of the ruler"
-msgstr "Maximum size of the ruler"
-
-#: ../gtk/gtkruler.c:184
-msgid "Metric"
-msgstr "Metric"
-
-#: ../gtk/gtkruler.c:185
-msgid "The metric used for the ruler"
-msgstr "The metric used for the ruler"
-
#: ../gtk/gtkscalebutton.c:221
msgid "The value of the scale"
msgstr "The value of the scale"
@@ -4645,39 +4630,39 @@ msgstr "Icons"
msgid "List of icon names"
msgstr "List of icon names"
-#: ../gtk/gtkscale.c:245
+#: ../gtk/gtkscale.c:255
msgid "The number of decimal places that are displayed in the value"
msgstr "The number of decimal places that are displayed in the value"
-#: ../gtk/gtkscale.c:254
+#: ../gtk/gtkscale.c:264
msgid "Draw Value"
msgstr "Draw Value"
-#: ../gtk/gtkscale.c:255
+#: ../gtk/gtkscale.c:265
msgid "Whether the current value is displayed as a string next to the slider"
msgstr "Whether the current value is displayed as a string next to the slider"
-#: ../gtk/gtkscale.c:262
+#: ../gtk/gtkscale.c:272
msgid "Value Position"
msgstr "Value Position"
-#: ../gtk/gtkscale.c:263
+#: ../gtk/gtkscale.c:273
msgid "The position in which the current value is displayed"
msgstr "The position in which the current value is displayed"
-#: ../gtk/gtkscale.c:270
+#: ../gtk/gtkscale.c:280
msgid "Slider Length"
msgstr "Slider Length"
-#: ../gtk/gtkscale.c:271
+#: ../gtk/gtkscale.c:281
msgid "Length of scale's slider"
msgstr "Length of scale's slider"
-#: ../gtk/gtkscale.c:279
+#: ../gtk/gtkscale.c:289
msgid "Value spacing"
msgstr "Value spacing"
-#: ../gtk/gtkscale.c:280
+#: ../gtk/gtkscale.c:290
msgid "Space between value text and the slider/trough area"
msgstr "Space between value text and the slider/trough area"
@@ -4808,19 +4793,19 @@ msgid ""
msgstr ""
"The minimum height that the scrolled window will allocate to its content"
-#: ../gtk/gtkseparatortoolitem.c:138
+#: ../gtk/gtkseparatortoolitem.c:143
msgid "Draw"
msgstr "Draw"
-#: ../gtk/gtkseparatortoolitem.c:139
+#: ../gtk/gtkseparatortoolitem.c:144
msgid "Whether the separator is drawn, or just blank"
msgstr "Whether the separator is drawn, or just blank"
-#: ../gtk/gtksettings.c:241
+#: ../gtk/gtksettings.c:277
msgid "Double Click Time"
msgstr "Double Click Time"
-#: ../gtk/gtksettings.c:242
+#: ../gtk/gtksettings.c:278
msgid ""
"Maximum time allowed between two clicks for them to be considered a double "
"click (in milliseconds)"
@@ -4828,11 +4813,11 @@ msgstr ""
"Maximum time allowed between two clicks for them to be considered a double "
"click (in milliseconds)"
-#: ../gtk/gtksettings.c:249
+#: ../gtk/gtksettings.c:285
msgid "Double Click Distance"
msgstr "Double Click Distance"
-#: ../gtk/gtksettings.c:250
+#: ../gtk/gtksettings.c:286
msgid ""
"Maximum distance allowed between two clicks for them to be considered a "
"double click (in pixels)"
@@ -4840,35 +4825,35 @@ msgstr ""
"Maximum distance allowed between two clicks for them to be considered a "
"double click (in pixels)"
-#: ../gtk/gtksettings.c:266
+#: ../gtk/gtksettings.c:302
msgid "Cursor Blink"
msgstr "Cursor Blink"
-#: ../gtk/gtksettings.c:267
+#: ../gtk/gtksettings.c:303
msgid "Whether the cursor should blink"
msgstr "Whether the cursor should blink"
-#: ../gtk/gtksettings.c:274
+#: ../gtk/gtksettings.c:310
msgid "Cursor Blink Time"
msgstr "Cursor Blink Time"
-#: ../gtk/gtksettings.c:275
+#: ../gtk/gtksettings.c:311
msgid "Length of the cursor blink cycle, in milliseconds"
msgstr "Length of the cursor blink cycle, in milliseconds"
-#: ../gtk/gtksettings.c:294
+#: ../gtk/gtksettings.c:330
msgid "Cursor Blink Timeout"
msgstr "Cursor Blink Timeout"
-#: ../gtk/gtksettings.c:295
+#: ../gtk/gtksettings.c:331
msgid "Time after which the cursor stops blinking, in seconds"
msgstr "Time after which the cursor stops blinking, in seconds"
-#: ../gtk/gtksettings.c:302
+#: ../gtk/gtksettings.c:338
msgid "Split Cursor"
msgstr "Split Cursor"
-#: ../gtk/gtksettings.c:303
+#: ../gtk/gtksettings.c:339
msgid ""
"Whether two cursors should be displayed for mixed left-to-right and right-to-"
"left text"
@@ -4876,149 +4861,149 @@ msgstr ""
"Whether two cursors should be displayed for mixed left-to-right and right-to-"
"left text"
-#: ../gtk/gtksettings.c:310
+#: ../gtk/gtksettings.c:346
msgid "Theme Name"
msgstr "Theme Name"
-#: ../gtk/gtksettings.c:311
+#: ../gtk/gtksettings.c:347
msgid "Name of theme RC file to load"
msgstr "Name of theme RC file to load"
-#: ../gtk/gtksettings.c:319
+#: ../gtk/gtksettings.c:355
msgid "Icon Theme Name"
msgstr "Icon Theme Name"
-#: ../gtk/gtksettings.c:320
+#: ../gtk/gtksettings.c:356
msgid "Name of icon theme to use"
msgstr "Name of icon theme to use"
-#: ../gtk/gtksettings.c:328
+#: ../gtk/gtksettings.c:364
msgid "Fallback Icon Theme Name"
msgstr "Fallback Icon Theme Name"
-#: ../gtk/gtksettings.c:329
+#: ../gtk/gtksettings.c:365
msgid "Name of a icon theme to fall back to"
msgstr "Name of a icon theme to fall back to"
-#: ../gtk/gtksettings.c:337
+#: ../gtk/gtksettings.c:373
msgid "Key Theme Name"
msgstr "Key Theme Name"
-#: ../gtk/gtksettings.c:338
+#: ../gtk/gtksettings.c:374
msgid "Name of key theme RC file to load"
msgstr "Name of key theme RC file to load"
-#: ../gtk/gtksettings.c:346
+#: ../gtk/gtksettings.c:382
msgid "Menu bar accelerator"
msgstr "Menu bar accelerator"
-#: ../gtk/gtksettings.c:347
+#: ../gtk/gtksettings.c:383
msgid "Keybinding to activate the menu bar"
msgstr "Keybinding to activate the menu bar"
-#: ../gtk/gtksettings.c:355
+#: ../gtk/gtksettings.c:391
msgid "Drag threshold"
msgstr "Drag threshold"
-#: ../gtk/gtksettings.c:356
+#: ../gtk/gtksettings.c:392
msgid "Number of pixels the cursor can move before dragging"
msgstr "Number of pixels the cursor can move before dragging"
-#: ../gtk/gtksettings.c:364
+#: ../gtk/gtksettings.c:400
msgid "Font Name"
msgstr "Font Name"
-#: ../gtk/gtksettings.c:365
+#: ../gtk/gtksettings.c:401
msgid "Name of default font to use"
msgstr "Name of default font to use"
-#: ../gtk/gtksettings.c:387
+#: ../gtk/gtksettings.c:423
msgid "Icon Sizes"
msgstr "Icon Sizes"
-#: ../gtk/gtksettings.c:388
+#: ../gtk/gtksettings.c:424
msgid "List of icon sizes (gtk-menu=16,16:gtk-button=20,20..."
msgstr "List of icon sizes (gtk-menu=16,16:gtk-button=20,20..."
-#: ../gtk/gtksettings.c:396
+#: ../gtk/gtksettings.c:432
msgid "GTK Modules"
msgstr "GTK Modules"
-#: ../gtk/gtksettings.c:397
+#: ../gtk/gtksettings.c:433
msgid "List of currently active GTK modules"
msgstr "List of currently active GTK modules"
-#: ../gtk/gtksettings.c:406
+#: ../gtk/gtksettings.c:442
msgid "Xft Antialias"
msgstr "Xft Antialias"
-#: ../gtk/gtksettings.c:407
+#: ../gtk/gtksettings.c:443
msgid "Whether to antialias Xft fonts; 0=no, 1=yes, -1=default"
msgstr "Whether to antialias Xft fonts; 0=no, 1=yes, -1=default"
-#: ../gtk/gtksettings.c:416
+#: ../gtk/gtksettings.c:452
msgid "Xft Hinting"
msgstr "Xft Hinting"
-#: ../gtk/gtksettings.c:417
+#: ../gtk/gtksettings.c:453
msgid "Whether to hint Xft fonts; 0=no, 1=yes, -1=default"
msgstr "Whether to hint Xft fonts; 0=no, 1=yes, -1=default"
-#: ../gtk/gtksettings.c:426
+#: ../gtk/gtksettings.c:462
msgid "Xft Hint Style"
msgstr "Xft Hint Style"
-#: ../gtk/gtksettings.c:427
+#: ../gtk/gtksettings.c:463
msgid ""
"What degree of hinting to use; hintnone, hintslight, hintmedium, or hintfull"
msgstr ""
"What degree of hinting to use; hintnone, hintslight, hintmedium, or hintfull"
-#: ../gtk/gtksettings.c:436
+#: ../gtk/gtksettings.c:472
msgid "Xft RGBA"
msgstr "Xft RGBA"
-#: ../gtk/gtksettings.c:437
+#: ../gtk/gtksettings.c:473
msgid "Type of subpixel antialiasing; none, rgb, bgr, vrgb, vbgr"
msgstr "Type of subpixel antialiasing; none, rgb, bgr, vrgb, vbgr"
-#: ../gtk/gtksettings.c:446
+#: ../gtk/gtksettings.c:482
msgid "Xft DPI"
msgstr "Xft DPI"
-#: ../gtk/gtksettings.c:447
+#: ../gtk/gtksettings.c:483
msgid "Resolution for Xft, in 1024 * dots/inch. -1 to use default value"
msgstr "Resolution for Xft, in 1024 * dots/inch. -1 to use default value"
-#: ../gtk/gtksettings.c:456
+#: ../gtk/gtksettings.c:492
msgid "Cursor theme name"
msgstr "Cursor theme name"
-#: ../gtk/gtksettings.c:457
+#: ../gtk/gtksettings.c:493
msgid "Name of the cursor theme to use, or NULL to use the default theme"
msgstr "Name of the cursor theme to use, or NULL to use the default theme"
-#: ../gtk/gtksettings.c:465
+#: ../gtk/gtksettings.c:501
msgid "Cursor theme size"
msgstr "Cursor theme size"
-#: ../gtk/gtksettings.c:466
+#: ../gtk/gtksettings.c:502
msgid "Size to use for cursors, or 0 to use the default size"
msgstr "Size to use for cursors, or 0 to use the default size"
-#: ../gtk/gtksettings.c:476
+#: ../gtk/gtksettings.c:512
msgid "Alternative button order"
msgstr "Alternative button order"
-#: ../gtk/gtksettings.c:477
+#: ../gtk/gtksettings.c:513
msgid "Whether buttons in dialogs should use the alternative button order"
msgstr "Whether buttons in dialogs should use the alternative button order"
-#: ../gtk/gtksettings.c:494
+#: ../gtk/gtksettings.c:530
msgid "Alternative sort indicator direction"
msgstr "Alternative sort indicator direction"
-#: ../gtk/gtksettings.c:495
+#: ../gtk/gtksettings.c:531
msgid ""
"Whether the direction of the sort indicators in list and tree views is "
"inverted compared to the default (where down means ascending)"
@@ -5026,11 +5011,11 @@ msgstr ""
"Whether the direction of the sort indicators in list and tree views is "
"inverted compared to the default (where down means ascending)"
-#: ../gtk/gtksettings.c:503
+#: ../gtk/gtksettings.c:539
msgid "Show the 'Input Methods' menu"
msgstr "Show the 'Input Methods' menu"
-#: ../gtk/gtksettings.c:504
+#: ../gtk/gtksettings.c:540
msgid ""
"Whether the context menus of entries and text views should offer to change "
"the input method"
@@ -5038,11 +5023,11 @@ msgstr ""
"Whether the context menus of entries and text views should offer to change "
"the input method"
-#: ../gtk/gtksettings.c:512
+#: ../gtk/gtksettings.c:548
msgid "Show the 'Insert Unicode Control Character' menu"
msgstr "Show the 'Insert Unicode Control Character' menu"
-#: ../gtk/gtksettings.c:513
+#: ../gtk/gtksettings.c:549
msgid ""
"Whether the context menus of entries and text views should offer to insert "
"control characters"
@@ -5050,238 +5035,238 @@ msgstr ""
"Whether the context menus of entries and text views should offer to insert "
"control characters"
-#: ../gtk/gtksettings.c:521
+#: ../gtk/gtksettings.c:557
msgid "Start timeout"
msgstr "Start timeout"
-#: ../gtk/gtksettings.c:522
+#: ../gtk/gtksettings.c:558
msgid "Starting value for timeouts, when button is pressed"
msgstr "Starting value for timeouts, when button is pressed"
-#: ../gtk/gtksettings.c:531
+#: ../gtk/gtksettings.c:567
msgid "Repeat timeout"
msgstr "Repeat timeout"
-#: ../gtk/gtksettings.c:532
+#: ../gtk/gtksettings.c:568
msgid "Repeat value for timeouts, when button is pressed"
msgstr "Repeat value for timeouts, when button is pressed"
-#: ../gtk/gtksettings.c:541
+#: ../gtk/gtksettings.c:577
msgid "Expand timeout"
msgstr "Expand timeout"
-#: ../gtk/gtksettings.c:542
+#: ../gtk/gtksettings.c:578
msgid "Expand value for timeouts, when a widget is expanding a new region"
msgstr "Expand value for timeouts, when a widget is expanding a new region"
-#: ../gtk/gtksettings.c:577
+#: ../gtk/gtksettings.c:613
msgid "Color scheme"
msgstr "Color scheme"
-#: ../gtk/gtksettings.c:578
+#: ../gtk/gtksettings.c:614
msgid "A palette of named colors for use in themes"
msgstr "A palette of named colors for use in themes"
-#: ../gtk/gtksettings.c:587
+#: ../gtk/gtksettings.c:623
msgid "Enable Animations"
msgstr "Enable Animations"
-#: ../gtk/gtksettings.c:588
+#: ../gtk/gtksettings.c:624
msgid "Whether to enable toolkit-wide animations."
msgstr "Whether to enable toolkit-wide animations."
-#: ../gtk/gtksettings.c:606
+#: ../gtk/gtksettings.c:642
msgid "Enable Touchscreen Mode"
msgstr "Enable Touchscreen Mode"
-#: ../gtk/gtksettings.c:607
+#: ../gtk/gtksettings.c:643
msgid "When TRUE, there are no motion notify events delivered on this screen"
msgstr "When TRUE, there are no motion notify events delivered on this screen"
-#: ../gtk/gtksettings.c:624
+#: ../gtk/gtksettings.c:660
msgid "Tooltip timeout"
msgstr "Tooltip timeout"
-#: ../gtk/gtksettings.c:625
+#: ../gtk/gtksettings.c:661
msgid "Timeout before tooltip is shown"
msgstr "Timeout before tooltip is shown"
-#: ../gtk/gtksettings.c:650
+#: ../gtk/gtksettings.c:686
msgid "Tooltip browse timeout"
msgstr "Tooltip browse timeout"
-#: ../gtk/gtksettings.c:651
+#: ../gtk/gtksettings.c:687
msgid "Timeout before tooltip is shown when browse mode is enabled"
msgstr "Timeout before tooltip is shown when browse mode is enabled"
-#: ../gtk/gtksettings.c:672
+#: ../gtk/gtksettings.c:708
msgid "Tooltip browse mode timeout"
msgstr "Tooltip browse mode timeout"
-#: ../gtk/gtksettings.c:673
+#: ../gtk/gtksettings.c:709
msgid "Timeout after which browse mode is disabled"
msgstr "Timeout after which browse mode is disabled"
-#: ../gtk/gtksettings.c:692
+#: ../gtk/gtksettings.c:728
msgid "Keynav Cursor Only"
msgstr "Keynav Cursor Only"
-#: ../gtk/gtksettings.c:693
+#: ../gtk/gtksettings.c:729
msgid "When TRUE, there are only cursor keys available to navigate widgets"
msgstr "When TRUE, there are only cursor keys available to navigate widgets"
-#: ../gtk/gtksettings.c:710
+#: ../gtk/gtksettings.c:746
msgid "Keynav Wrap Around"
msgstr "Keynav Wrap Around"
-#: ../gtk/gtksettings.c:711
+#: ../gtk/gtksettings.c:747
msgid "Whether to wrap around when keyboard-navigating widgets"
msgstr "Whether to wrap around when keyboard-navigating widgets"
-#: ../gtk/gtksettings.c:731
+#: ../gtk/gtksettings.c:767
msgid "Error Bell"
msgstr "Error Bell"
-#: ../gtk/gtksettings.c:732
+#: ../gtk/gtksettings.c:768
msgid "When TRUE, keyboard navigation and other errors will cause a beep"
msgstr "When TRUE, keyboard navigation and other errors will cause a beep"
-#: ../gtk/gtksettings.c:749
+#: ../gtk/gtksettings.c:785
msgid "Color Hash"
msgstr "Color Hash"
-#: ../gtk/gtksettings.c:750
+#: ../gtk/gtksettings.c:786
msgid "A hash table representation of the color scheme."
msgstr "A hash table representation of the color scheme."
-#: ../gtk/gtksettings.c:758
+#: ../gtk/gtksettings.c:794
msgid "Default file chooser backend"
msgstr "Default file chooser backend"
-#: ../gtk/gtksettings.c:759
+#: ../gtk/gtksettings.c:795
msgid "Name of the GtkFileChooser backend to use by default"
msgstr "Name of the GtkFileChooser backend to use by default"
-#: ../gtk/gtksettings.c:776
+#: ../gtk/gtksettings.c:812
msgid "Default print backend"
msgstr "Default print backend"
-#: ../gtk/gtksettings.c:777
+#: ../gtk/gtksettings.c:813
msgid "List of the GtkPrintBackend backends to use by default"
msgstr "List of the GtkPrintBackend backends to use by default"
-#: ../gtk/gtksettings.c:800
+#: ../gtk/gtksettings.c:836
msgid "Default command to run when displaying a print preview"
msgstr "Default command to run when displaying a print preview"
-#: ../gtk/gtksettings.c:801
+#: ../gtk/gtksettings.c:837
msgid "Command to run when displaying a print preview"
msgstr "Command to run when displaying a print preview"
-#: ../gtk/gtksettings.c:817
+#: ../gtk/gtksettings.c:853
msgid "Enable Mnemonics"
msgstr "Enable Mnemonics"
-#: ../gtk/gtksettings.c:818
+#: ../gtk/gtksettings.c:854
msgid "Whether labels should have mnemonics"
msgstr "Whether labels should have mnemonics"
-#: ../gtk/gtksettings.c:834
+#: ../gtk/gtksettings.c:870
msgid "Enable Accelerators"
msgstr "Enable Accelerators"
-#: ../gtk/gtksettings.c:835
+#: ../gtk/gtksettings.c:871
msgid "Whether menu items should have accelerators"
msgstr "Whether menu items should have accelerators"
-#: ../gtk/gtksettings.c:852
+#: ../gtk/gtksettings.c:888
msgid "Recent Files Limit"
msgstr "Recent Files Limit"
-#: ../gtk/gtksettings.c:853
+#: ../gtk/gtksettings.c:889
msgid "Number of recently used files"
msgstr "Number of recently used files"
-#: ../gtk/gtksettings.c:871
+#: ../gtk/gtksettings.c:907
msgid "Default IM module"
msgstr "Default IM module"
-#: ../gtk/gtksettings.c:872
+#: ../gtk/gtksettings.c:908
msgid "Which IM module should be used by default"
msgstr "Which IM module should be used by default"
-#: ../gtk/gtksettings.c:890
+#: ../gtk/gtksettings.c:926
msgid "Recent Files Max Age"
msgstr "Recent Files Max Age"
-#: ../gtk/gtksettings.c:891
+#: ../gtk/gtksettings.c:927
msgid "Maximum age of recently used files, in days"
msgstr "Maximum age of recently used files, in days"
-#: ../gtk/gtksettings.c:900
+#: ../gtk/gtksettings.c:936
msgid "Fontconfig configuration timestamp"
msgstr "Fontconfig configuration timestamp"
-#: ../gtk/gtksettings.c:901
+#: ../gtk/gtksettings.c:937
msgid "Timestamp of current fontconfig configuration"
msgstr "Timestamp of current fontconfig configuration"
-#: ../gtk/gtksettings.c:923
+#: ../gtk/gtksettings.c:959
msgid "Sound Theme Name"
msgstr "Sound Theme Name"
-#: ../gtk/gtksettings.c:924
+#: ../gtk/gtksettings.c:960
msgid "XDG sound theme name"
msgstr "XDG sound theme name"
#. Translators: this means sounds that are played as feedback to user input
-#: ../gtk/gtksettings.c:946
+#: ../gtk/gtksettings.c:982
msgid "Audible Input Feedback"
msgstr "Audible Input Feedback"
-#: ../gtk/gtksettings.c:947
+#: ../gtk/gtksettings.c:983
msgid "Whether to play event sounds as feedback to user input"
msgstr "Whether to play event sounds as feedback to user input"
-#: ../gtk/gtksettings.c:968
+#: ../gtk/gtksettings.c:1004
msgid "Enable Event Sounds"
msgstr "Enable Event Sounds"
-#: ../gtk/gtksettings.c:969
+#: ../gtk/gtksettings.c:1005
msgid "Whether to play any event sounds at all"
msgstr "Whether to play any event sounds at all"
-#: ../gtk/gtksettings.c:984
+#: ../gtk/gtksettings.c:1020
msgid "Enable Tooltips"
msgstr "Enable Tooltips"
-#: ../gtk/gtksettings.c:985
+#: ../gtk/gtksettings.c:1021
msgid "Whether tooltips should be shown on widgets"
msgstr "Whether tooltips should be shown on widgets"
-#: ../gtk/gtksettings.c:998
+#: ../gtk/gtksettings.c:1034
msgid "Toolbar style"
msgstr "Toolbar style"
-#: ../gtk/gtksettings.c:999
+#: ../gtk/gtksettings.c:1035
msgid ""
"Whether default toolbars have text only, text and icons, icons only, etc."
msgstr ""
"Whether default toolbars have text only, text and icons, icons only, etc."
-#: ../gtk/gtksettings.c:1013
+#: ../gtk/gtksettings.c:1049
msgid "Toolbar Icon Size"
msgstr "Toolbar Icon Size"
-#: ../gtk/gtksettings.c:1014
+#: ../gtk/gtksettings.c:1050
msgid "The size of icons in default toolbars."
msgstr "The size of icons in default toolbars."
-#: ../gtk/gtksettings.c:1031
+#: ../gtk/gtksettings.c:1067
msgid "Auto Mnemonics"
msgstr "Auto Mnemonics"
-#: ../gtk/gtksettings.c:1032
+#: ../gtk/gtksettings.c:1068
msgid ""
"Whether mnemonics should be automatically shown and hidden when the user "
"presses the mnemonic activator."
@@ -5289,59 +5274,59 @@ msgstr ""
"Whether mnemonics should be automatically shown and hidden when the user "
"presses the mnemonic activator."
-#: ../gtk/gtksettings.c:1057
+#: ../gtk/gtksettings.c:1093
msgid "Application prefers a dark theme"
msgstr "Application prefers a dark theme"
-#: ../gtk/gtksettings.c:1058
+#: ../gtk/gtksettings.c:1094
msgid "Whether the application prefers to have a dark theme."
msgstr "Whether the application prefers to have a dark theme."
-#: ../gtk/gtksettings.c:1073
+#: ../gtk/gtksettings.c:1109
msgid "Show button images"
msgstr "Show button images"
-#: ../gtk/gtksettings.c:1074
+#: ../gtk/gtksettings.c:1110
msgid "Whether images should be shown on buttons"
msgstr "Whether images should be shown on buttons"
-#: ../gtk/gtksettings.c:1082 ../gtk/gtksettings.c:1176
+#: ../gtk/gtksettings.c:1118 ../gtk/gtksettings.c:1212
msgid "Select on focus"
msgstr "Select on focus"
-#: ../gtk/gtksettings.c:1083
+#: ../gtk/gtksettings.c:1119
msgid "Whether to select the contents of an entry when it is focused"
msgstr "Whether to select the contents of an entry when it is focused"
-#: ../gtk/gtksettings.c:1100
+#: ../gtk/gtksettings.c:1136
msgid "Password Hint Timeout"
msgstr "Password Hint Timeout"
-#: ../gtk/gtksettings.c:1101
+#: ../gtk/gtksettings.c:1137
msgid "How long to show the last input character in hidden entries"
msgstr "How long to show the last input character in hidden entries"
-#: ../gtk/gtksettings.c:1110
+#: ../gtk/gtksettings.c:1146
msgid "Show menu images"
msgstr "Show menu images"
-#: ../gtk/gtksettings.c:1111
+#: ../gtk/gtksettings.c:1147
msgid "Whether images should be shown in menus"
msgstr "Whether images should be shown in menus"
-#: ../gtk/gtksettings.c:1119
+#: ../gtk/gtksettings.c:1155
msgid "Delay before drop down menus appear"
msgstr "Delay before drop down menus appear"
-#: ../gtk/gtksettings.c:1120
+#: ../gtk/gtksettings.c:1156
msgid "Delay before the submenus of a menu bar appear"
msgstr "Delay before the submenus of a menu bar appear"
-#: ../gtk/gtksettings.c:1137
+#: ../gtk/gtksettings.c:1173
msgid "Scrolled Window Placement"
msgstr "Scrolled Window Placement"
-#: ../gtk/gtksettings.c:1138
+#: ../gtk/gtksettings.c:1174
msgid ""
"Where the contents of scrolled windows are located with respect to the "
"scrollbars, if not overridden by the scrolled window's own placement."
@@ -5349,31 +5334,31 @@ msgstr ""
"Where the contents of scrolled windows are located with respect to the "
"scrollbars, if not overridden by the scrolled window's own placement."
-#: ../gtk/gtksettings.c:1147
+#: ../gtk/gtksettings.c:1183
msgid "Can change accelerators"
msgstr "Can change accelerators"
-#: ../gtk/gtksettings.c:1148
+#: ../gtk/gtksettings.c:1184
msgid ""
"Whether menu accelerators can be changed by pressing a key over the menu item"
msgstr ""
"Whether menu accelerators can be changed by pressing a key over the menu item"
-#: ../gtk/gtksettings.c:1156
+#: ../gtk/gtksettings.c:1192
msgid "Delay before submenus appear"
msgstr "Delay before submenus appear"
-#: ../gtk/gtksettings.c:1157
+#: ../gtk/gtksettings.c:1193
msgid ""
"Minimum time the pointer must stay over a menu item before the submenu appear"
msgstr ""
"Minimum time the pointer must stay over a menu item before the submenu appear"
-#: ../gtk/gtksettings.c:1166
+#: ../gtk/gtksettings.c:1202
msgid "Delay before hiding a submenu"
msgstr "Delay before hiding a submenu"
-#: ../gtk/gtksettings.c:1167
+#: ../gtk/gtksettings.c:1203
msgid ""
"The time before hiding a submenu when the pointer is moving towards the "
"submenu"
@@ -5381,32 +5366,32 @@ msgstr ""
"The time before hiding a submenu when the pointer is moving towards the "
"submenu"
-#: ../gtk/gtksettings.c:1177
+#: ../gtk/gtksettings.c:1213
msgid "Whether to select the contents of a selectable label when it is focused"
msgstr ""
"Whether to select the contents of a selectable label when it is focused"
-#: ../gtk/gtksettings.c:1185
+#: ../gtk/gtksettings.c:1221
msgid "Custom palette"
msgstr "Custom palette"
-#: ../gtk/gtksettings.c:1186
+#: ../gtk/gtksettings.c:1222
msgid "Palette to use in the color selector"
msgstr "Palette to use in the color selector"
-#: ../gtk/gtksettings.c:1194
+#: ../gtk/gtksettings.c:1230
msgid "IM Preedit style"
msgstr "IM Preedit style"
-#: ../gtk/gtksettings.c:1195
+#: ../gtk/gtksettings.c:1231
msgid "How to draw the input method preedit string"
msgstr "How to draw the input method preedit string"
-#: ../gtk/gtksettings.c:1204
+#: ../gtk/gtksettings.c:1240
msgid "IM Status style"
msgstr "IM Status style"
-#: ../gtk/gtksettings.c:1205
+#: ../gtk/gtksettings.c:1241
msgid "How to draw the input method statusbar"
msgstr "How to draw the input method statusbar"
@@ -5432,15 +5417,15 @@ msgid ""
msgstr ""
"If TRUE, unmapped widgets are ignored when determining the size of the group"
-#: ../gtk/gtkspinbutton.c:236
+#: ../gtk/gtkspinbutton.c:238
msgid "Climb Rate"
msgstr "Climb Rate"
-#: ../gtk/gtkspinbutton.c:256
+#: ../gtk/gtkspinbutton.c:258
msgid "Snap to Ticks"
msgstr "Snap to Ticks"
-#: ../gtk/gtkspinbutton.c:257
+#: ../gtk/gtkspinbutton.c:259
msgid ""
"Whether erroneous values are automatically changed to a spin button's "
"nearest step increment"
@@ -5448,37 +5433,37 @@ msgstr ""
"Whether erroneous values are automatically changed to a spin button's "
"nearest step increment"
-#: ../gtk/gtkspinbutton.c:264
+#: ../gtk/gtkspinbutton.c:266
msgid "Numeric"
msgstr "Numeric"
-#: ../gtk/gtkspinbutton.c:265
+#: ../gtk/gtkspinbutton.c:267
msgid "Whether non-numeric characters should be ignored"
msgstr "Whether non-numeric characters should be ignored"
-#: ../gtk/gtkspinbutton.c:272
+#: ../gtk/gtkspinbutton.c:274
msgid "Wrap"
msgstr "Wrap"
-#: ../gtk/gtkspinbutton.c:273
+#: ../gtk/gtkspinbutton.c:275
msgid "Whether a spin button should wrap upon reaching its limits"
msgstr "Whether a spin button should wrap upon reaching its limits"
-#: ../gtk/gtkspinbutton.c:280
+#: ../gtk/gtkspinbutton.c:282
msgid "Update Policy"
msgstr "Update Policy"
-#: ../gtk/gtkspinbutton.c:281
+#: ../gtk/gtkspinbutton.c:283
msgid ""
"Whether the spin button should update always, or only when the value is legal"
msgstr ""
"Whether the spin button should update always, or only when the value is legal"
-#: ../gtk/gtkspinbutton.c:290
+#: ../gtk/gtkspinbutton.c:292
msgid "Reads the current value, or sets a new value"
msgstr "Reads the current value, or sets a new value"
-#: ../gtk/gtkspinbutton.c:299
+#: ../gtk/gtkspinbutton.c:301
msgid "Style of bevel around the spin button"
msgstr "Style of bevel around the spin button"
@@ -5510,7 +5495,7 @@ msgid ""
msgstr ""
"The length of time in milliseconds for the spinner to complete a full loop"
-#: ../gtk/gtkstatusbar.c:179
+#: ../gtk/gtkstatusbar.c:181
msgid "Style of bevel around the statusbar text"
msgstr "Style of bevel around the statusbar text"
@@ -5534,7 +5519,7 @@ msgstr "Whether the status icon is embedded"
msgid "The orientation of the tray"
msgstr "The orientation of the tray"
-#: ../gtk/gtkstatusicon.c:347 ../gtk/gtkwidget.c:1084
+#: ../gtk/gtkstatusicon.c:347 ../gtk/gtkwidget.c:1022
msgid "Has tooltip"
msgstr "Has tooltip"
@@ -5542,15 +5527,15 @@ msgstr "Has tooltip"
msgid "Whether this tray icon has a tooltip"
msgstr "Whether this tray icon has a tooltip"
-#: ../gtk/gtkstatusicon.c:373 ../gtk/gtkwidget.c:1105
+#: ../gtk/gtkstatusicon.c:373 ../gtk/gtkwidget.c:1043
msgid "Tooltip Text"
msgstr "Tooltip Text"
-#: ../gtk/gtkstatusicon.c:374 ../gtk/gtkwidget.c:1106 ../gtk/gtkwidget.c:1127
+#: ../gtk/gtkstatusicon.c:374 ../gtk/gtkwidget.c:1044 ../gtk/gtkwidget.c:1065
msgid "The contents of the tooltip for this widget"
msgstr "The contents of the tooltip for this widget"
-#: ../gtk/gtkstatusicon.c:397 ../gtk/gtkwidget.c:1126
+#: ../gtk/gtkstatusicon.c:397 ../gtk/gtkwidget.c:1064
msgid "Tooltip markup"
msgstr "Tooltip markup"
@@ -5562,87 +5547,95 @@ msgstr "The contents of the tooltip for this tray icon"
msgid "The title of this tray icon"
msgstr "The title of this tray icon"
-#: ../gtk/gtktable.c:152
+#: ../gtk/gtkswitch.c:739
+msgid "Whether the switch is on or off"
+msgstr "Whether the switch is on or off"
+
+#: ../gtk/gtkswitch.c:773
+msgid "The minimum width of the handle"
+msgstr "The minimum width of the handle"
+
+#: ../gtk/gtktable.c:157
msgid "Rows"
msgstr "Rows"
-#: ../gtk/gtktable.c:153
+#: ../gtk/gtktable.c:158
msgid "The number of rows in the table"
msgstr "The number of rows in the table"
-#: ../gtk/gtktable.c:161
+#: ../gtk/gtktable.c:166
msgid "Columns"
msgstr "Columns"
-#: ../gtk/gtktable.c:162
+#: ../gtk/gtktable.c:167
msgid "The number of columns in the table"
msgstr "The number of columns in the table"
-#: ../gtk/gtktable.c:170
+#: ../gtk/gtktable.c:175
msgid "Row spacing"
msgstr "Row spacing"
-#: ../gtk/gtktable.c:171
+#: ../gtk/gtktable.c:176
msgid "The amount of space between two consecutive rows"
msgstr "The amount of space between two consecutive rows"
-#: ../gtk/gtktable.c:179
+#: ../gtk/gtktable.c:184
msgid "Column spacing"
msgstr "Column spacing"
-#: ../gtk/gtktable.c:180
+#: ../gtk/gtktable.c:185
msgid "The amount of space between two consecutive columns"
msgstr "The amount of space between two consecutive columns"
-#: ../gtk/gtktable.c:189
+#: ../gtk/gtktable.c:194
msgid "If TRUE, the table cells are all the same width/height"
msgstr "If TRUE, the table cells are all the same width/height"
-#: ../gtk/gtktable.c:196
+#: ../gtk/gtktable.c:201
msgid "Left attachment"
msgstr "Left attachment"
-#: ../gtk/gtktable.c:203
+#: ../gtk/gtktable.c:208
msgid "Right attachment"
msgstr "Right attachment"
-#: ../gtk/gtktable.c:204
+#: ../gtk/gtktable.c:209
msgid "The column number to attach the right side of a child widget to"
msgstr "The column number to attach the right side of a child widget to"
-#: ../gtk/gtktable.c:210
+#: ../gtk/gtktable.c:215
msgid "Top attachment"
msgstr "Top attachment"
-#: ../gtk/gtktable.c:211
+#: ../gtk/gtktable.c:216
msgid "The row number to attach the top of a child widget to"
msgstr "The row number to attach the top of a child widget to"
-#: ../gtk/gtktable.c:217
+#: ../gtk/gtktable.c:222
msgid "Bottom attachment"
msgstr "Bottom attachment"
-#: ../gtk/gtktable.c:224
+#: ../gtk/gtktable.c:229
msgid "Horizontal options"
msgstr "Horizontal options"
-#: ../gtk/gtktable.c:225
+#: ../gtk/gtktable.c:230
msgid "Options specifying the horizontal behaviour of the child"
msgstr "Options specifying the horizontal behaviour of the child"
-#: ../gtk/gtktable.c:231
+#: ../gtk/gtktable.c:236
msgid "Vertical options"
msgstr "Vertical options"
-#: ../gtk/gtktable.c:232
+#: ../gtk/gtktable.c:237
msgid "Options specifying the vertical behaviour of the child"
msgstr "Options specifying the vertical behaviour of the child"
-#: ../gtk/gtktable.c:238
+#: ../gtk/gtktable.c:243
msgid "Horizontal padding"
msgstr "Horizontal padding"
-#: ../gtk/gtktable.c:239
+#: ../gtk/gtktable.c:244
msgid ""
"Extra space to put between the child and its left and right neighbors, in "
"pixels"
@@ -5650,11 +5643,11 @@ msgstr ""
"Extra space to put between the child and its left and right neighbors, in "
"pixels"
-#: ../gtk/gtktable.c:245
+#: ../gtk/gtktable.c:250
msgid "Vertical padding"
msgstr "Vertical padding"
-#: ../gtk/gtktable.c:246
+#: ../gtk/gtktable.c:251
msgid ""
"Extra space to put between the child and its upper and lower neighbors, in "
"pixels"
@@ -5662,51 +5655,51 @@ msgstr ""
"Extra space to put between the child and its upper and lower neighbors, in "
"pixels"
-#: ../gtk/gtktextbuffer.c:192
+#: ../gtk/gtktextbuffer.c:191
msgid "Tag Table"
msgstr "Tag Table"
-#: ../gtk/gtktextbuffer.c:193
+#: ../gtk/gtktextbuffer.c:192
msgid "Text Tag Table"
msgstr "Text Tag Table"
-#: ../gtk/gtktextbuffer.c:211
+#: ../gtk/gtktextbuffer.c:210
msgid "Current text of the buffer"
msgstr "Current text of the buffer"
-#: ../gtk/gtktextbuffer.c:225
+#: ../gtk/gtktextbuffer.c:224
msgid "Has selection"
msgstr "Has selection"
-#: ../gtk/gtktextbuffer.c:226
+#: ../gtk/gtktextbuffer.c:225
msgid "Whether the buffer has some text currently selected"
msgstr "Whether the buffer has some text currently selected"
-#: ../gtk/gtktextbuffer.c:242
+#: ../gtk/gtktextbuffer.c:241
msgid "Cursor position"
msgstr "Cursor position"
-#: ../gtk/gtktextbuffer.c:243
+#: ../gtk/gtktextbuffer.c:242
msgid ""
"The position of the insert mark (as offset from the beginning of the buffer)"
msgstr ""
"The position of the insert mark (as offset from the beginning of the buffer)"
-#: ../gtk/gtktextbuffer.c:258
+#: ../gtk/gtktextbuffer.c:257
msgid "Copy target list"
msgstr "Copy target list"
-#: ../gtk/gtktextbuffer.c:259
+#: ../gtk/gtktextbuffer.c:258
msgid ""
"The list of targets this buffer supports for clipboard copying and DND source"
msgstr ""
"The list of targets this buffer supports for clipboard copying and DND source"
-#: ../gtk/gtktextbuffer.c:274
+#: ../gtk/gtktextbuffer.c:273
msgid "Paste target list"
msgstr "Paste target list"
-#: ../gtk/gtktextbuffer.c:275
+#: ../gtk/gtktextbuffer.c:274
msgid ""
"The list of targets this buffer supports for clipboard pasting and DND "
"destination"
@@ -5796,7 +5789,7 @@ msgstr ""
"adapts to theme changes etc. so is recommended. Pango predefines some scales "
"such as PANGO_SCALE_X_LARGE"
-#: ../gtk/gtktexttag.c:336 ../gtk/gtktextview.c:685
+#: ../gtk/gtktexttag.c:336 ../gtk/gtktextview.c:704
msgid "Left, right, or center justification"
msgstr "Left, right, or center justification"
@@ -5812,7 +5805,7 @@ msgstr ""
msgid "Left margin"
msgstr "Left margin"
-#: ../gtk/gtktexttag.c:363 ../gtk/gtktextview.c:694
+#: ../gtk/gtktexttag.c:363 ../gtk/gtktextview.c:713
msgid "Width of the left margin in pixels"
msgstr "Width of the left margin in pixels"
@@ -5820,15 +5813,15 @@ msgstr "Width of the left margin in pixels"
msgid "Right margin"
msgstr "Right margin"
-#: ../gtk/gtktexttag.c:373 ../gtk/gtktextview.c:704
+#: ../gtk/gtktexttag.c:373 ../gtk/gtktextview.c:723
msgid "Width of the right margin in pixels"
msgstr "Width of the right margin in pixels"
-#: ../gtk/gtktexttag.c:383 ../gtk/gtktextview.c:713
+#: ../gtk/gtktexttag.c:383 ../gtk/gtktextview.c:732
msgid "Indent"
msgstr "Indent"
-#: ../gtk/gtktexttag.c:384 ../gtk/gtktextview.c:714
+#: ../gtk/gtktexttag.c:384 ../gtk/gtktextview.c:733
msgid "Amount to indent the paragraph, in pixels"
msgstr "Amount to indent the paragraph, in pixels"
@@ -5844,7 +5837,7 @@ msgstr ""
msgid "Pixels above lines"
msgstr "Pixels above lines"
-#: ../gtk/gtktexttag.c:405 ../gtk/gtktextview.c:638
+#: ../gtk/gtktexttag.c:405 ../gtk/gtktextview.c:657
msgid "Pixels of blank space above paragraphs"
msgstr "Pixels of blank space above paragraphs"
@@ -5852,7 +5845,7 @@ msgstr "Pixels of blank space above paragraphs"
msgid "Pixels below lines"
msgstr "Pixels below lines"
-#: ../gtk/gtktexttag.c:415 ../gtk/gtktextview.c:648
+#: ../gtk/gtktexttag.c:415 ../gtk/gtktextview.c:667
msgid "Pixels of blank space below paragraphs"
msgstr "Pixels of blank space below paragraphs"
@@ -5860,21 +5853,21 @@ msgstr "Pixels of blank space below paragraphs"
msgid "Pixels inside wrap"
msgstr "Pixels inside wrap"
-#: ../gtk/gtktexttag.c:425 ../gtk/gtktextview.c:658
+#: ../gtk/gtktexttag.c:425 ../gtk/gtktextview.c:677
msgid "Pixels of blank space between wrapped lines in a paragraph"
msgstr "Pixels of blank space between wrapped lines in a paragraph"
-#: ../gtk/gtktexttag.c:452 ../gtk/gtktextview.c:676
+#: ../gtk/gtktexttag.c:452 ../gtk/gtktextview.c:695
msgid ""
"Whether to wrap lines never, at word boundaries, or at character boundaries"
msgstr ""
"Whether to wrap lines never, at word boundaries, or at character boundaries"
-#: ../gtk/gtktexttag.c:461 ../gtk/gtktextview.c:723
+#: ../gtk/gtktexttag.c:461 ../gtk/gtktextview.c:742
msgid "Tabs"
msgstr "Tabs"
-#: ../gtk/gtktexttag.c:462 ../gtk/gtktextview.c:724
+#: ../gtk/gtktexttag.c:462 ../gtk/gtktextview.c:743
msgid "Custom tabs for this text"
msgstr "Custom tabs for this text"
@@ -6002,63 +5995,63 @@ msgstr "Paragraph background set"
msgid "Whether this tag affects the paragraph background color"
msgstr "Whether this tag affects the paragraph background color"
-#: ../gtk/gtktextview.c:637
+#: ../gtk/gtktextview.c:656
msgid "Pixels Above Lines"
msgstr "Pixels Above Lines"
-#: ../gtk/gtktextview.c:647
+#: ../gtk/gtktextview.c:666
msgid "Pixels Below Lines"
msgstr "Pixels Below Lines"
-#: ../gtk/gtktextview.c:657
+#: ../gtk/gtktextview.c:676
msgid "Pixels Inside Wrap"
msgstr "Pixels Inside Wrap"
-#: ../gtk/gtktextview.c:675
+#: ../gtk/gtktextview.c:694
msgid "Wrap Mode"
msgstr "Wrap Mode"
-#: ../gtk/gtktextview.c:693
+#: ../gtk/gtktextview.c:712
msgid "Left Margin"
msgstr "Left Margin"
-#: ../gtk/gtktextview.c:703
+#: ../gtk/gtktextview.c:722
msgid "Right Margin"
msgstr "Right Margin"
-#: ../gtk/gtktextview.c:731
+#: ../gtk/gtktextview.c:750
msgid "Cursor Visible"
msgstr "Cursor Visible"
-#: ../gtk/gtktextview.c:732
+#: ../gtk/gtktextview.c:751
msgid "If the insertion cursor is shown"
msgstr "If the insertion cursor is shown"
-#: ../gtk/gtktextview.c:739
+#: ../gtk/gtktextview.c:758
msgid "Buffer"
msgstr "Buffer"
-#: ../gtk/gtktextview.c:740
+#: ../gtk/gtktextview.c:759
msgid "The buffer which is displayed"
msgstr "The buffer which is displayed"
-#: ../gtk/gtktextview.c:748
+#: ../gtk/gtktextview.c:767
msgid "Whether entered text overwrites existing contents"
msgstr "Whether entered text overwrites existing contents"
-#: ../gtk/gtktextview.c:755
+#: ../gtk/gtktextview.c:774
msgid "Accepts tab"
msgstr "Accepts tab"
-#: ../gtk/gtktextview.c:756
+#: ../gtk/gtktextview.c:775
msgid "Whether Tab will result in a tab character being entered"
msgstr "Whether Tab will result in a tab character being entered"
-#: ../gtk/gtktextview.c:791
+#: ../gtk/gtktextview.c:810
msgid "Error underline color"
msgstr "Error underline color"
-#: ../gtk/gtktextview.c:792
+#: ../gtk/gtktextview.c:811
msgid "Color with which to draw error-indication underlines"
msgstr "Color with which to draw error-indication underlines"
@@ -6074,95 +6067,95 @@ msgstr "Whether the proxies for this action look like radio action proxies"
msgid "Whether the toggle action should be active"
msgstr "Whether the toggle action should be active"
-#: ../gtk/gtktogglebutton.c:123 ../gtk/gtktoggletoolbutton.c:113
+#: ../gtk/gtktogglebutton.c:126 ../gtk/gtktoggletoolbutton.c:113
msgid "If the toggle button should be pressed in"
msgstr "If the toggle button should be pressed in"
-#: ../gtk/gtktogglebutton.c:131
+#: ../gtk/gtktogglebutton.c:134
msgid "If the toggle button is in an \"in between\" state"
msgstr "If the toggle button is in an \"in between\" state"
-#: ../gtk/gtktogglebutton.c:138
+#: ../gtk/gtktogglebutton.c:141
msgid "Draw Indicator"
msgstr "Draw Indicator"
-#: ../gtk/gtktogglebutton.c:139
+#: ../gtk/gtktogglebutton.c:142
msgid "If the toggle part of the button is displayed"
msgstr "If the toggle part of the button is displayed"
-#: ../gtk/gtktoolbar.c:485 ../gtk/gtktoolpalette.c:1033
+#: ../gtk/gtktoolbar.c:491 ../gtk/gtktoolpalette.c:1060
msgid "Toolbar Style"
msgstr "Toolbar Style"
-#: ../gtk/gtktoolbar.c:486
+#: ../gtk/gtktoolbar.c:492
msgid "How to draw the toolbar"
msgstr "How to draw the toolbar"
-#: ../gtk/gtktoolbar.c:493
+#: ../gtk/gtktoolbar.c:499
msgid "Show Arrow"
msgstr "Show Arrow"
-#: ../gtk/gtktoolbar.c:494
+#: ../gtk/gtktoolbar.c:500
msgid "If an arrow should be shown if the toolbar doesn't fit"
msgstr "If an arrow should be shown if the toolbar doesn't fit"
-#: ../gtk/gtktoolbar.c:515
+#: ../gtk/gtktoolbar.c:521
msgid "Size of icons in this toolbar"
msgstr "Size of icons in this toolbar"
-#: ../gtk/gtktoolbar.c:530 ../gtk/gtktoolpalette.c:1019
+#: ../gtk/gtktoolbar.c:536 ../gtk/gtktoolpalette.c:1046
msgid "Icon size set"
msgstr "Icon size set"
-#: ../gtk/gtktoolbar.c:531 ../gtk/gtktoolpalette.c:1020
+#: ../gtk/gtktoolbar.c:537 ../gtk/gtktoolpalette.c:1047
msgid "Whether the icon-size property has been set"
msgstr "Whether the icon-size property has been set"
-#: ../gtk/gtktoolbar.c:540
+#: ../gtk/gtktoolbar.c:546
msgid "Whether the item should receive extra space when the toolbar grows"
msgstr "Whether the item should receive extra space when the toolbar grows"
-#: ../gtk/gtktoolbar.c:548 ../gtk/gtktoolitemgroup.c:1625
+#: ../gtk/gtktoolbar.c:554 ../gtk/gtktoolitemgroup.c:1642
msgid "Whether the item should be the same size as other homogeneous items"
msgstr "Whether the item should be the same size as other homogeneous items"
-#: ../gtk/gtktoolbar.c:555
+#: ../gtk/gtktoolbar.c:561
msgid "Spacer size"
msgstr "Spacer size"
-#: ../gtk/gtktoolbar.c:556
+#: ../gtk/gtktoolbar.c:562
msgid "Size of spacers"
msgstr "Size of spacers"
-#: ../gtk/gtktoolbar.c:565
+#: ../gtk/gtktoolbar.c:571
msgid "Amount of border space between the toolbar shadow and the buttons"
msgstr "Amount of border space between the toolbar shadow and the buttons"
-#: ../gtk/gtktoolbar.c:573
+#: ../gtk/gtktoolbar.c:579
msgid "Maximum child expand"
msgstr "Maximum child expand"
-#: ../gtk/gtktoolbar.c:574
+#: ../gtk/gtktoolbar.c:580
msgid "Maximum amount of space an expandable item will be given"
msgstr "Maximum amount of space an expandable item will be given"
-#: ../gtk/gtktoolbar.c:582
+#: ../gtk/gtktoolbar.c:588
msgid "Space style"
msgstr "Space style"
-#: ../gtk/gtktoolbar.c:583
+#: ../gtk/gtktoolbar.c:589
msgid "Whether spacers are vertical lines or just blank"
msgstr "Whether spacers are vertical lines or just blank"
-#: ../gtk/gtktoolbar.c:590
+#: ../gtk/gtktoolbar.c:596
msgid "Button relief"
msgstr "Button relief"
-#: ../gtk/gtktoolbar.c:591
+#: ../gtk/gtktoolbar.c:597
msgid "Type of bevel around toolbar buttons"
msgstr "Type of bevel around toolbar buttons"
-#: ../gtk/gtktoolbar.c:598
+#: ../gtk/gtktoolbar.c:604
msgid "Style of bevel around the toolbar"
msgstr "Style of bevel around the toolbar"
@@ -6214,7 +6207,7 @@ msgstr "Icon spacing"
msgid "Spacing in pixels between the icon and label"
msgstr "Spacing in pixels between the icon and label"
-#: ../gtk/gtktoolitem.c:201
+#: ../gtk/gtktoolitem.c:210
msgid ""
"Whether the toolbar item is considered important. When TRUE, toolbar buttons "
"show text in GTK_TOOLBAR_BOTH_HORIZ mode"
@@ -6222,83 +6215,83 @@ msgstr ""
"Whether the toolbar item is considered important. When TRUE, toolbar buttons "
"show text in GTK_TOOLBAR_BOTH_HORIZ mode"
-#: ../gtk/gtktoolitemgroup.c:1572
+#: ../gtk/gtktoolitemgroup.c:1589
msgid "The human-readable title of this item group"
msgstr "The human-readable title of this item group"
-#: ../gtk/gtktoolitemgroup.c:1579
+#: ../gtk/gtktoolitemgroup.c:1596
msgid "A widget to display in place of the usual label"
msgstr "A widget to display in place of the usual label"
-#: ../gtk/gtktoolitemgroup.c:1585
+#: ../gtk/gtktoolitemgroup.c:1602
msgid "Collapsed"
msgstr "Collapsed"
-#: ../gtk/gtktoolitemgroup.c:1586
+#: ../gtk/gtktoolitemgroup.c:1603
msgid "Whether the group has been collapsed and items are hidden"
msgstr "Whether the group has been collapsed and items are hidden"
-#: ../gtk/gtktoolitemgroup.c:1592
+#: ../gtk/gtktoolitemgroup.c:1609
msgid "ellipsize"
msgstr "ellipsize"
-#: ../gtk/gtktoolitemgroup.c:1593
+#: ../gtk/gtktoolitemgroup.c:1610
msgid "Ellipsize for item group headers"
msgstr "Ellipsize for item group headers"
-#: ../gtk/gtktoolitemgroup.c:1599
+#: ../gtk/gtktoolitemgroup.c:1616
msgid "Header Relief"
msgstr "Header Relief"
-#: ../gtk/gtktoolitemgroup.c:1600
+#: ../gtk/gtktoolitemgroup.c:1617
msgid "Relief of the group header button"
msgstr "Relief of the group header button"
-#: ../gtk/gtktoolitemgroup.c:1615
+#: ../gtk/gtktoolitemgroup.c:1632
msgid "Header Spacing"
msgstr "Header Spacing"
-#: ../gtk/gtktoolitemgroup.c:1616
+#: ../gtk/gtktoolitemgroup.c:1633
msgid "Spacing between expander arrow and caption"
msgstr "Spacing between expander arrow and caption"
-#: ../gtk/gtktoolitemgroup.c:1632
+#: ../gtk/gtktoolitemgroup.c:1649
msgid "Whether the item should receive extra space when the group grows"
msgstr "Whether the item should receive extra space when the group grows"
-#: ../gtk/gtktoolitemgroup.c:1639
+#: ../gtk/gtktoolitemgroup.c:1656
msgid "Whether the item should fill the available space"
msgstr "Whether the item should fill the available space"
-#: ../gtk/gtktoolitemgroup.c:1645
+#: ../gtk/gtktoolitemgroup.c:1662
msgid "New Row"
msgstr "New Row"
-#: ../gtk/gtktoolitemgroup.c:1646
+#: ../gtk/gtktoolitemgroup.c:1663
msgid "Whether the item should start a new row"
msgstr "Whether the item should start a new row"
-#: ../gtk/gtktoolitemgroup.c:1653
+#: ../gtk/gtktoolitemgroup.c:1670
msgid "Position of the item within this group"
msgstr "Position of the item within this group"
-#: ../gtk/gtktoolpalette.c:1004
+#: ../gtk/gtktoolpalette.c:1031
msgid "Size of icons in this tool palette"
msgstr "Size of icons in this tool palette"
-#: ../gtk/gtktoolpalette.c:1034
+#: ../gtk/gtktoolpalette.c:1061
msgid "Style of items in the tool palette"
msgstr "Style of items in the tool palette"
-#: ../gtk/gtktoolpalette.c:1050
+#: ../gtk/gtktoolpalette.c:1077
msgid "Exclusive"
msgstr "Exclusive"
-#: ../gtk/gtktoolpalette.c:1051
+#: ../gtk/gtktoolpalette.c:1078
msgid "Whether the item group should be the only expanded at a given time"
msgstr "Whether the item group should be the only expanded at a given time"
-#: ../gtk/gtktoolpalette.c:1066
+#: ../gtk/gtktoolpalette.c:1093
msgid ""
"Whether the item group should receive extra space when the palette grows"
msgstr ""
@@ -6344,211 +6337,211 @@ msgstr "TreeModelSort Model"
msgid "The model for the TreeModelSort to sort"
msgstr "The model for the TreeModelSort to sort"
-#: ../gtk/gtktreeview.c:568
+#: ../gtk/gtktreeview.c:661
msgid "TreeView Model"
msgstr "TreeView Model"
-#: ../gtk/gtktreeview.c:569
+#: ../gtk/gtktreeview.c:662
msgid "The model for the tree view"
msgstr "The model for the tree view"
-#: ../gtk/gtktreeview.c:581
+#: ../gtk/gtktreeview.c:674
msgid "Headers Visible"
msgstr "Headers Visible"
-#: ../gtk/gtktreeview.c:582
+#: ../gtk/gtktreeview.c:675
msgid "Show the column header buttons"
msgstr "Show the column header buttons"
-#: ../gtk/gtktreeview.c:589
+#: ../gtk/gtktreeview.c:682
msgid "Headers Clickable"
msgstr "Headers Clickable"
-#: ../gtk/gtktreeview.c:590
+#: ../gtk/gtktreeview.c:683
msgid "Column headers respond to click events"
msgstr "Column headers respond to click events"
-#: ../gtk/gtktreeview.c:597
+#: ../gtk/gtktreeview.c:690
msgid "Expander Column"
msgstr "Expander Column"
-#: ../gtk/gtktreeview.c:598
+#: ../gtk/gtktreeview.c:691
msgid "Set the column for the expander column"
msgstr "Set the column for the expander column"
-#: ../gtk/gtktreeview.c:613
+#: ../gtk/gtktreeview.c:706
msgid "Rules Hint"
msgstr "Rules Hint"
-#: ../gtk/gtktreeview.c:614
+#: ../gtk/gtktreeview.c:707
msgid "Set a hint to the theme engine to draw rows in alternating colors"
msgstr "Set a hint to the theme engine to draw rows in alternating colors"
-#: ../gtk/gtktreeview.c:621
+#: ../gtk/gtktreeview.c:714
msgid "Enable Search"
msgstr "Enable Search"
-#: ../gtk/gtktreeview.c:622
+#: ../gtk/gtktreeview.c:715
msgid "View allows user to search through columns interactively"
msgstr "View allows user to search through columns interactively"
-#: ../gtk/gtktreeview.c:629
+#: ../gtk/gtktreeview.c:722
msgid "Search Column"
msgstr "Search Column"
-#: ../gtk/gtktreeview.c:630
+#: ../gtk/gtktreeview.c:723
msgid "Model column to search through during interactive search"
msgstr "Model column to search through during interactive search"
-#: ../gtk/gtktreeview.c:650
+#: ../gtk/gtktreeview.c:743
msgid "Fixed Height Mode"
msgstr "Fixed Height Mode"
-#: ../gtk/gtktreeview.c:651
+#: ../gtk/gtktreeview.c:744
msgid "Speeds up GtkTreeView by assuming that all rows have the same height"
msgstr "Speeds up GtkTreeView by assuming that all rows have the same height"
-#: ../gtk/gtktreeview.c:671
+#: ../gtk/gtktreeview.c:764
msgid "Hover Selection"
msgstr "Hover Selection"
-#: ../gtk/gtktreeview.c:672
+#: ../gtk/gtktreeview.c:765
msgid "Whether the selection should follow the pointer"
msgstr "Whether the selection should follow the pointer"
-#: ../gtk/gtktreeview.c:691
+#: ../gtk/gtktreeview.c:784
msgid "Hover Expand"
msgstr "Hover Expand"
-#: ../gtk/gtktreeview.c:692
+#: ../gtk/gtktreeview.c:785
msgid ""
"Whether rows should be expanded/collapsed when the pointer moves over them"
msgstr ""
"Whether rows should be expanded/collapsed when the pointer moves over them"
-#: ../gtk/gtktreeview.c:706
+#: ../gtk/gtktreeview.c:799
msgid "Show Expanders"
msgstr "Show Expanders"
-#: ../gtk/gtktreeview.c:707
+#: ../gtk/gtktreeview.c:800
msgid "View has expanders"
msgstr "View has expanders"
-#: ../gtk/gtktreeview.c:721
+#: ../gtk/gtktreeview.c:814
msgid "Level Indentation"
msgstr "Level Indentation"
-#: ../gtk/gtktreeview.c:722
+#: ../gtk/gtktreeview.c:815
msgid "Extra indentation for each level"
msgstr "Extra indentation for each level"
-#: ../gtk/gtktreeview.c:731
+#: ../gtk/gtktreeview.c:824
msgid "Rubber Banding"
msgstr "Rubber Banding"
-#: ../gtk/gtktreeview.c:732
+#: ../gtk/gtktreeview.c:825
msgid ""
"Whether to enable selection of multiple items by dragging the mouse pointer"
msgstr ""
"Whether to enable selection of multiple items by dragging the mouse pointer"
-#: ../gtk/gtktreeview.c:739
+#: ../gtk/gtktreeview.c:832
msgid "Enable Grid Lines"
msgstr "Enable Grid Lines"
-#: ../gtk/gtktreeview.c:740
+#: ../gtk/gtktreeview.c:833
msgid "Whether grid lines should be drawn in the tree view"
msgstr "Whether grid lines should be drawn in the tree view"
-#: ../gtk/gtktreeview.c:748
+#: ../gtk/gtktreeview.c:841
msgid "Enable Tree Lines"
msgstr "Enable Tree Lines"
-#: ../gtk/gtktreeview.c:749
+#: ../gtk/gtktreeview.c:842
msgid "Whether tree lines should be drawn in the tree view"
msgstr "Whether tree lines should be drawn in the tree view"
-#: ../gtk/gtktreeview.c:757
+#: ../gtk/gtktreeview.c:850
msgid "The column in the model containing the tooltip texts for the rows"
msgstr "The column in the model containing the tooltip texts for the rows"
-#: ../gtk/gtktreeview.c:779
+#: ../gtk/gtktreeview.c:872
msgid "Vertical Separator Width"
msgstr "Vertical Separator Width"
-#: ../gtk/gtktreeview.c:780
+#: ../gtk/gtktreeview.c:873
msgid "Vertical space between cells. Must be an even number"
msgstr "Vertical space between cells. Must be an even number"
-#: ../gtk/gtktreeview.c:788
+#: ../gtk/gtktreeview.c:881
msgid "Horizontal Separator Width"
msgstr "Horizontal Separator Width"
-#: ../gtk/gtktreeview.c:789
+#: ../gtk/gtktreeview.c:882
msgid "Horizontal space between cells. Must be an even number"
msgstr "Horizontal space between cells. Must be an even number"
-#: ../gtk/gtktreeview.c:797
+#: ../gtk/gtktreeview.c:890
msgid "Allow Rules"
msgstr "Allow Rules"
-#: ../gtk/gtktreeview.c:798
+#: ../gtk/gtktreeview.c:891
msgid "Allow drawing of alternating color rows"
msgstr "Allow drawing of alternating color rows"
-#: ../gtk/gtktreeview.c:804
+#: ../gtk/gtktreeview.c:897
msgid "Indent Expanders"
msgstr "Indent Expanders"
-#: ../gtk/gtktreeview.c:805
+#: ../gtk/gtktreeview.c:898
msgid "Make the expanders indented"
msgstr "Make the expanders indented"
-#: ../gtk/gtktreeview.c:811
+#: ../gtk/gtktreeview.c:904
msgid "Even Row Color"
msgstr "Even Row Color"
-#: ../gtk/gtktreeview.c:812
+#: ../gtk/gtktreeview.c:905
msgid "Color to use for even rows"
msgstr "Color to use for even rows"
-#: ../gtk/gtktreeview.c:818
+#: ../gtk/gtktreeview.c:911
msgid "Odd Row Color"
msgstr "Odd Row Color"
-#: ../gtk/gtktreeview.c:819
+#: ../gtk/gtktreeview.c:912
msgid "Color to use for odd rows"
msgstr "Color to use for odd rows"
-#: ../gtk/gtktreeview.c:825
+#: ../gtk/gtktreeview.c:918
msgid "Grid line width"
msgstr "Grid line width"
-#: ../gtk/gtktreeview.c:826
+#: ../gtk/gtktreeview.c:919
msgid "Width, in pixels, of the tree view grid lines"
msgstr "Width, in pixels, of the tree view grid lines"
-#: ../gtk/gtktreeview.c:832
+#: ../gtk/gtktreeview.c:925
msgid "Tree line width"
msgstr "Tree line width"
-#: ../gtk/gtktreeview.c:833
+#: ../gtk/gtktreeview.c:926
msgid "Width, in pixels, of the tree view lines"
msgstr "Width, in pixels, of the tree view lines"
-#: ../gtk/gtktreeview.c:839
+#: ../gtk/gtktreeview.c:932
msgid "Grid line pattern"
msgstr "Grid line pattern"
-#: ../gtk/gtktreeview.c:840
+#: ../gtk/gtktreeview.c:933
msgid "Dash pattern used to draw the tree view grid lines"
msgstr "Dash pattern used to draw the tree view grid lines"
-#: ../gtk/gtktreeview.c:846
+#: ../gtk/gtktreeview.c:939
msgid "Tree line pattern"
msgstr "Tree line pattern"
-#: ../gtk/gtktreeview.c:847
+#: ../gtk/gtktreeview.c:940
msgid "Dash pattern used to draw the tree view lines"
msgstr "Dash pattern used to draw the tree view lines"
@@ -6672,31 +6665,31 @@ msgstr "Merged UI definition"
msgid "An XML string describing the merged UI"
msgstr "An XML string describing the merged UI"
-#: ../gtk/gtkviewport.c:156
+#: ../gtk/gtkviewport.c:155
msgid "Determines how the shadowed box around the viewport is drawn"
msgstr "Determines how the shadowed box around the viewport is drawn"
-#: ../gtk/gtkwidget.c:935
+#: ../gtk/gtkwidget.c:873
msgid "Widget name"
msgstr "Widget name"
-#: ../gtk/gtkwidget.c:936
+#: ../gtk/gtkwidget.c:874
msgid "The name of the widget"
msgstr "The name of the widget"
-#: ../gtk/gtkwidget.c:942
+#: ../gtk/gtkwidget.c:880
msgid "Parent widget"
msgstr "Parent widget"
-#: ../gtk/gtkwidget.c:943
+#: ../gtk/gtkwidget.c:881
msgid "The parent widget of this widget. Must be a Container widget"
msgstr "The parent widget of this widget. Must be a Container widget"
-#: ../gtk/gtkwidget.c:950
+#: ../gtk/gtkwidget.c:888
msgid "Width request"
msgstr "Width request"
-#: ../gtk/gtkwidget.c:951
+#: ../gtk/gtkwidget.c:889
msgid ""
"Override for width request of the widget, or -1 if natural request should be "
"used"
@@ -6704,11 +6697,11 @@ msgstr ""
"Override for width request of the widget, or -1 if natural request should be "
"used"
-#: ../gtk/gtkwidget.c:959
+#: ../gtk/gtkwidget.c:897
msgid "Height request"
msgstr "Height request"
-#: ../gtk/gtkwidget.c:960
+#: ../gtk/gtkwidget.c:898
msgid ""
"Override for height request of the widget, or -1 if natural request should "
"be used"
@@ -6716,83 +6709,83 @@ msgstr ""
"Override for height request of the widget, or -1 if natural request should "
"be used"
-#: ../gtk/gtkwidget.c:969
+#: ../gtk/gtkwidget.c:907
msgid "Whether the widget is visible"
msgstr "Whether the widget is visible"
-#: ../gtk/gtkwidget.c:976
+#: ../gtk/gtkwidget.c:914
msgid "Whether the widget responds to input"
msgstr "Whether the widget responds to input"
-#: ../gtk/gtkwidget.c:982
+#: ../gtk/gtkwidget.c:920
msgid "Application paintable"
msgstr "Application paintable"
-#: ../gtk/gtkwidget.c:983
+#: ../gtk/gtkwidget.c:921
msgid "Whether the application will paint directly on the widget"
msgstr "Whether the application will paint directly on the widget"
-#: ../gtk/gtkwidget.c:989
+#: ../gtk/gtkwidget.c:927
msgid "Can focus"
msgstr "Can focus"
-#: ../gtk/gtkwidget.c:990
+#: ../gtk/gtkwidget.c:928
msgid "Whether the widget can accept the input focus"
msgstr "Whether the widget can accept the input focus"
-#: ../gtk/gtkwidget.c:996
+#: ../gtk/gtkwidget.c:934
msgid "Has focus"
msgstr "Has focus"
-#: ../gtk/gtkwidget.c:997
+#: ../gtk/gtkwidget.c:935
msgid "Whether the widget has the input focus"
msgstr "Whether the widget has the input focus"
-#: ../gtk/gtkwidget.c:1003
+#: ../gtk/gtkwidget.c:941
msgid "Is focus"
msgstr "Is focus"
-#: ../gtk/gtkwidget.c:1004
+#: ../gtk/gtkwidget.c:942
msgid "Whether the widget is the focus widget within the toplevel"
msgstr "Whether the widget is the focus widget within the toplevel"
-#: ../gtk/gtkwidget.c:1010
+#: ../gtk/gtkwidget.c:948
msgid "Can default"
msgstr "Can default"
-#: ../gtk/gtkwidget.c:1011
+#: ../gtk/gtkwidget.c:949
msgid "Whether the widget can be the default widget"
msgstr "Whether the widget can be the default widget"
-#: ../gtk/gtkwidget.c:1017
+#: ../gtk/gtkwidget.c:955
msgid "Has default"
msgstr "Has default"
-#: ../gtk/gtkwidget.c:1018
+#: ../gtk/gtkwidget.c:956
msgid "Whether the widget is the default widget"
msgstr "Whether the widget is the default widget"
-#: ../gtk/gtkwidget.c:1024
+#: ../gtk/gtkwidget.c:962
msgid "Receives default"
msgstr "Receives default"
-#: ../gtk/gtkwidget.c:1025
+#: ../gtk/gtkwidget.c:963
msgid "If TRUE, the widget will receive the default action when it is focused"
msgstr "If TRUE, the widget will receive the default action when it is focused"
-#: ../gtk/gtkwidget.c:1031
+#: ../gtk/gtkwidget.c:969
msgid "Composite child"
msgstr "Composite child"
-#: ../gtk/gtkwidget.c:1032
+#: ../gtk/gtkwidget.c:970
msgid "Whether the widget is part of a composite widget"
msgstr "Whether the widget is part of a composite widget"
-#: ../gtk/gtkwidget.c:1038
+#: ../gtk/gtkwidget.c:976
msgid "Style"
msgstr "Style"
-#: ../gtk/gtkwidget.c:1039
+#: ../gtk/gtkwidget.c:977
msgid ""
"The style of the widget, which contains information about how it will look "
"(colors etc)"
@@ -6800,183 +6793,183 @@ msgstr ""
"The style of the widget, which contains information about how it will look "
"(colors etc)"
-#: ../gtk/gtkwidget.c:1045
+#: ../gtk/gtkwidget.c:983
msgid "Events"
msgstr "Events"
-#: ../gtk/gtkwidget.c:1046
+#: ../gtk/gtkwidget.c:984
msgid "The event mask that decides what kind of GdkEvents this widget gets"
msgstr "The event mask that decides what kind of GdkEvents this widget gets"
-#: ../gtk/gtkwidget.c:1053
+#: ../gtk/gtkwidget.c:991
msgid "Extension events"
msgstr "Extension events"
-#: ../gtk/gtkwidget.c:1054
+#: ../gtk/gtkwidget.c:992
msgid "The mask that decides what kind of extension events this widget gets"
msgstr "The mask that decides what kind of extension events this widget gets"
-#: ../gtk/gtkwidget.c:1061
+#: ../gtk/gtkwidget.c:999
msgid "No show all"
msgstr "No show all"
-#: ../gtk/gtkwidget.c:1062
+#: ../gtk/gtkwidget.c:1000
msgid "Whether gtk_widget_show_all() should not affect this widget"
msgstr "Whether gtk_widget_show_all() should not affect this widget"
-#: ../gtk/gtkwidget.c:1085
+#: ../gtk/gtkwidget.c:1023
msgid "Whether this widget has a tooltip"
msgstr "Whether this widget has a tooltip"
-#: ../gtk/gtkwidget.c:1141
+#: ../gtk/gtkwidget.c:1079
msgid "Window"
msgstr "Window"
-#: ../gtk/gtkwidget.c:1142
+#: ../gtk/gtkwidget.c:1080
msgid "The widget's window if it is realized"
msgstr "The widget's window if it is realized"
-#: ../gtk/gtkwidget.c:1156
+#: ../gtk/gtkwidget.c:1094
msgid "Double Buffered"
msgstr "Double Buffered"
-#: ../gtk/gtkwidget.c:1157
+#: ../gtk/gtkwidget.c:1095
msgid "Whether the widget is double buffered"
msgstr "Whether the widget is double buffered"
-#: ../gtk/gtkwidget.c:1172
+#: ../gtk/gtkwidget.c:1110
msgid "How to position in extra horizontal space"
msgstr "How to position in extra horizontal space"
-#: ../gtk/gtkwidget.c:1188
+#: ../gtk/gtkwidget.c:1126
msgid "How to position in extra vertical space"
msgstr "How to position in extra vertical space"
-#: ../gtk/gtkwidget.c:1207
+#: ../gtk/gtkwidget.c:1145
msgid "Margin on Left"
msgstr "Margin on Left"
-#: ../gtk/gtkwidget.c:1208
+#: ../gtk/gtkwidget.c:1146
msgid "Pixels of extra space on the left side"
msgstr "Pixels of extra space on the left side"
-#: ../gtk/gtkwidget.c:1228
+#: ../gtk/gtkwidget.c:1166
msgid "Margin on Right"
msgstr "Margin on Right"
-#: ../gtk/gtkwidget.c:1229
+#: ../gtk/gtkwidget.c:1167
msgid "Pixels of extra space on the right side"
msgstr "Pixels of extra space on the right side"
-#: ../gtk/gtkwidget.c:1249
+#: ../gtk/gtkwidget.c:1187
msgid "Margin on Top"
msgstr "Margin on Top"
-#: ../gtk/gtkwidget.c:1250
+#: ../gtk/gtkwidget.c:1188
msgid "Pixels of extra space on the top side"
msgstr "Pixels of extra space on the top side"
-#: ../gtk/gtkwidget.c:1270
+#: ../gtk/gtkwidget.c:1208
msgid "Margin on Bottom"
msgstr "Margin on Bottom"
-#: ../gtk/gtkwidget.c:1271
+#: ../gtk/gtkwidget.c:1209
msgid "Pixels of extra space on the bottom side"
msgstr "Pixels of extra space on the bottom side"
-#: ../gtk/gtkwidget.c:1288
+#: ../gtk/gtkwidget.c:1226
msgid "All Margins"
msgstr "All Margins"
-#: ../gtk/gtkwidget.c:1289
+#: ../gtk/gtkwidget.c:1227
msgid "Pixels of extra space on all four sides"
msgstr "Pixels of extra space on all four sides"
-#: ../gtk/gtkwidget.c:1322
+#: ../gtk/gtkwidget.c:1260
msgid "Horizontal Expand"
msgstr "Horizontal Expand"
-#: ../gtk/gtkwidget.c:1323
+#: ../gtk/gtkwidget.c:1261
msgid "Whether widget wants more horizontal space"
msgstr "Whether widget wants more horizontal space"
-#: ../gtk/gtkwidget.c:1337
+#: ../gtk/gtkwidget.c:1275
msgid "Horizontal Expand Set"
msgstr "Horizontal Expand Set"
-#: ../gtk/gtkwidget.c:1338
+#: ../gtk/gtkwidget.c:1276
msgid "Whether to use the hexpand property"
msgstr "Whether to use the hexpand property"
-#: ../gtk/gtkwidget.c:1352
+#: ../gtk/gtkwidget.c:1290
msgid "Vertical Expand"
msgstr "Vertical Expand"
-#: ../gtk/gtkwidget.c:1353
+#: ../gtk/gtkwidget.c:1291
msgid "Whether widget wants more vertical space"
msgstr "Whether widget wants more vertical space"
-#: ../gtk/gtkwidget.c:1367
+#: ../gtk/gtkwidget.c:1305
msgid "Vertical Expand Set"
msgstr "Vertical Expand Set"
-#: ../gtk/gtkwidget.c:1368
+#: ../gtk/gtkwidget.c:1306
msgid "Whether to use the vexpand property"
msgstr "Whether to use the vexpand property"
-#: ../gtk/gtkwidget.c:1382
+#: ../gtk/gtkwidget.c:1320
msgid "Expand Both"
msgstr "Expand Both"
-#: ../gtk/gtkwidget.c:1383
+#: ../gtk/gtkwidget.c:1321
msgid "Whether widget wants to expand in both directions"
msgstr "Whether widget wants to expand in both directions"
-#: ../gtk/gtkwidget.c:3037
+#: ../gtk/gtkwidget.c:2936
msgid "Interior Focus"
msgstr "Interior Focus"
-#: ../gtk/gtkwidget.c:3038
+#: ../gtk/gtkwidget.c:2937
msgid "Whether to draw the focus indicator inside widgets"
msgstr "Whether to draw the focus indicator inside widgets"
-#: ../gtk/gtkwidget.c:3044
+#: ../gtk/gtkwidget.c:2943
msgid "Focus linewidth"
msgstr "Focus linewidth"
-#: ../gtk/gtkwidget.c:3045
+#: ../gtk/gtkwidget.c:2944
msgid "Width, in pixels, of the focus indicator line"
msgstr "Width, in pixels, of the focus indicator line"
-#: ../gtk/gtkwidget.c:3051
+#: ../gtk/gtkwidget.c:2950
msgid "Focus line dash pattern"
msgstr "Focus line dash pattern"
-#: ../gtk/gtkwidget.c:3052
+#: ../gtk/gtkwidget.c:2951
msgid "Dash pattern used to draw the focus indicator"
msgstr "Dash pattern used to draw the focus indicator"
-#: ../gtk/gtkwidget.c:3057
+#: ../gtk/gtkwidget.c:2956
msgid "Focus padding"
msgstr "Focus padding"
-#: ../gtk/gtkwidget.c:3058
+#: ../gtk/gtkwidget.c:2957
msgid "Width, in pixels, between focus indicator and the widget 'box'"
msgstr "Width, in pixels, between focus indicator and the widget 'box'"
-#: ../gtk/gtkwidget.c:3063
+#: ../gtk/gtkwidget.c:2962
msgid "Cursor color"
msgstr "Cursor color"
-#: ../gtk/gtkwidget.c:3064
+#: ../gtk/gtkwidget.c:2963
msgid "Color with which to draw insertion cursor"
msgstr "Color with which to draw insertion cursor"
-#: ../gtk/gtkwidget.c:3069
+#: ../gtk/gtkwidget.c:2968
msgid "Secondary cursor color"
msgstr "Secondary cursor color"
-#: ../gtk/gtkwidget.c:3070
+#: ../gtk/gtkwidget.c:2969
msgid ""
"Color with which to draw the secondary insertion cursor when editing mixed "
"right-to-left and left-to-right text"
@@ -6984,43 +6977,43 @@ msgstr ""
"Color with which to draw the secondary insertion cursor when editing mixed "
"right-to-left and left-to-right text"
-#: ../gtk/gtkwidget.c:3075
+#: ../gtk/gtkwidget.c:2974
msgid "Cursor line aspect ratio"
msgstr "Cursor line aspect ratio"
-#: ../gtk/gtkwidget.c:3076
+#: ../gtk/gtkwidget.c:2975
msgid "Aspect ratio with which to draw insertion cursor"
msgstr "Aspect ratio with which to draw insertion cursor"
-#: ../gtk/gtkwidget.c:3082
+#: ../gtk/gtkwidget.c:2981
msgid "Window dragging"
msgstr "Window dragging"
-#: ../gtk/gtkwidget.c:3083
+#: ../gtk/gtkwidget.c:2982
msgid "Whether windows can be dragged by clicking on empty areas"
msgstr "Whether windows can be dragged by clicking on empty areas"
-#: ../gtk/gtkwidget.c:3096
+#: ../gtk/gtkwidget.c:2995
msgid "Unvisited Link Color"
msgstr "Unvisited Link Color"
-#: ../gtk/gtkwidget.c:3097
+#: ../gtk/gtkwidget.c:2996
msgid "Color of unvisited links"
msgstr "Color of unvisited links"
-#: ../gtk/gtkwidget.c:3110
+#: ../gtk/gtkwidget.c:3009
msgid "Visited Link Color"
msgstr "Visited Link Color"
-#: ../gtk/gtkwidget.c:3111
+#: ../gtk/gtkwidget.c:3010
msgid "Color of visited links"
msgstr "Color of visited links"
-#: ../gtk/gtkwidget.c:3125
+#: ../gtk/gtkwidget.c:3024
msgid "Wide Separators"
msgstr "Wide Separators"
-#: ../gtk/gtkwidget.c:3126
+#: ../gtk/gtkwidget.c:3025
msgid ""
"Whether separators have configurable width and should be drawn using a box "
"instead of a line"
@@ -7028,35 +7021,35 @@ msgstr ""
"Whether separators have configurable width and should be drawn using a box "
"instead of a line"
-#: ../gtk/gtkwidget.c:3140
+#: ../gtk/gtkwidget.c:3039
msgid "Separator Width"
msgstr "Separator Width"
-#: ../gtk/gtkwidget.c:3141
+#: ../gtk/gtkwidget.c:3040
msgid "The width of separators if wide-separators is TRUE"
msgstr "The width of separators if wide-separators is TRUE"
-#: ../gtk/gtkwidget.c:3155
+#: ../gtk/gtkwidget.c:3054
msgid "Separator Height"
msgstr "Separator Height"
-#: ../gtk/gtkwidget.c:3156
+#: ../gtk/gtkwidget.c:3055
msgid "The height of separators if \"wide-separators\" is TRUE"
msgstr "The height of separators if \"wide-separators\" is TRUE"
-#: ../gtk/gtkwidget.c:3170
+#: ../gtk/gtkwidget.c:3069
msgid "Horizontal Scroll Arrow Length"
msgstr "Horizontal Scroll Arrow Length"
-#: ../gtk/gtkwidget.c:3171
+#: ../gtk/gtkwidget.c:3070
msgid "The length of horizontal scroll arrows"
msgstr "The length of horizontal scroll arrows"
-#: ../gtk/gtkwidget.c:3185
+#: ../gtk/gtkwidget.c:3084
msgid "Vertical Scroll Arrow Length"
msgstr "Vertical Scroll Arrow Length"
-#: ../gtk/gtkwidget.c:3186
+#: ../gtk/gtkwidget.c:3085
msgid "The length of vertical scroll arrows"
msgstr "The length of vertical scroll arrows"
@@ -7299,6 +7292,33 @@ msgstr "GtkApplication"
msgid "The GtkApplication for the window"
msgstr "The GtkApplication for the window"
+#~ msgid "Lower"
+#~ msgstr "Lower"
+
+#~ msgid "Lower limit of ruler"
+#~ msgstr "Lower limit of ruler"
+
+#~ msgid "Upper"
+#~ msgstr "Upper"
+
+#~ msgid "Upper limit of ruler"
+#~ msgstr "Upper limit of ruler"
+
+#~ msgid "Position of mark on the ruler"
+#~ msgstr "Position of mark on the ruler"
+
+#~ msgid "Max Size"
+#~ msgstr "Max Size"
+
+#~ msgid "Maximum size of the ruler"
+#~ msgstr "Maximum size of the ruler"
+
+#~ msgid "Metric"
+#~ msgstr "Metric"
+
+#~ msgid "The metric used for the ruler"
+#~ msgstr "The metric used for the ruler"
+
#~ msgid "Horizontal adjustment"
#~ msgstr "Horizontal adjustment"
diff --git a/po/es.po b/po/es.po
index 8b5ba0437d..1934a51173 100644
--- a/po/es.po
+++ b/po/es.po
@@ -16,8 +16,8 @@ msgstr ""
"Project-Id-Version: gtk+.master\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gtk"
"%2b&component=general\n"
-"POT-Creation-Date: 2010-10-22 15:08+0000\n"
-"PO-Revision-Date: 2010-10-23 14:18+0200\n"
+"POT-Creation-Date: 2010-11-29 20:28+0000\n"
+"PO-Revision-Date: 2010-12-02 19:10+0100\n"
"Last-Translator: Jorge González <jorgegonz@svn.gnome.org>\n"
"Language-Team: Español <gnome-es-list@gnome.org>\n"
"MIME-Version: 1.0\n"
@@ -27,58 +27,58 @@ msgstr ""
"X-Generator: KBabel 1.11.4\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: ../gdk/gdk.c:104
+#: ../gdk/gdk.c:115
#, c-format
msgid "Error parsing option --gdk-debug"
msgstr "Error al analizar la opción --gdk-debug"
-#: ../gdk/gdk.c:124
+#: ../gdk/gdk.c:135
#, c-format
msgid "Error parsing option --gdk-no-debug"
msgstr "Error al analizar la opción --gdk-no-debug"
#. Description of --class=CLASS in --help output
-#: ../gdk/gdk.c:152
+#: ../gdk/gdk.c:163
msgid "Program class as used by the window manager"
msgstr "Clase del programa tal como la usa el gestor de ventanas"
#. Placeholder in --class=CLASS in --help output
-#: ../gdk/gdk.c:153
+#: ../gdk/gdk.c:164
msgid "CLASS"
msgstr "CLASE"
#. Description of --name=NAME in --help output
-#: ../gdk/gdk.c:155
+#: ../gdk/gdk.c:166
msgid "Program name as used by the window manager"
msgstr "Nombre del programa tal como lo usa el gestor de ventanas"
#. Placeholder in --name=NAME in --help output
-#: ../gdk/gdk.c:156
+#: ../gdk/gdk.c:167
msgid "NAME"
msgstr "NOMBRE"
#. Description of --display=DISPLAY in --help output
-#: ../gdk/gdk.c:158
+#: ../gdk/gdk.c:169
msgid "X display to use"
msgstr "Visor [display] X que usar"
#. Placeholder in --display=DISPLAY in --help output
-#: ../gdk/gdk.c:159
+#: ../gdk/gdk.c:170
msgid "DISPLAY"
msgstr "VISOR"
#. Description of --screen=SCREEN in --help output
-#: ../gdk/gdk.c:161
+#: ../gdk/gdk.c:172
msgid "X screen to use"
msgstr "Pantalla [screen] X que usar"
#. Placeholder in --screen=SCREEN in --help output
-#: ../gdk/gdk.c:162
+#: ../gdk/gdk.c:173
msgid "SCREEN"
msgstr "PANTALLA"
#. Description of --gdk-debug=FLAGS in --help output
-#: ../gdk/gdk.c:165
+#: ../gdk/gdk.c:176
msgid "GDK debugging flags to set"
msgstr "Opciones de depuración GTK+ que establecer"
@@ -86,12 +86,12 @@ msgstr "Opciones de depuración GTK+ que establecer"
#. Placeholder in --gdk-no-debug=FLAGS in --help output
#. Placeholder in --gtk-debug=FLAGS in --help output
#. Placeholder in --gtk-no-debug=FLAGS in --help output
-#: ../gdk/gdk.c:166 ../gdk/gdk.c:169 ../gtk/gtkmain.c:534 ../gtk/gtkmain.c:537
+#: ../gdk/gdk.c:177 ../gdk/gdk.c:180 ../gtk/gtkmain.c:525 ../gtk/gtkmain.c:528
msgid "FLAGS"
msgstr "OPCIONES"
#. Description of --gdk-no-debug=FLAGS in --help output
-#: ../gdk/gdk.c:168
+#: ../gdk/gdk.c:179
msgid "GDK debugging flags to unset"
msgstr "Opciones de depuración GTK+ que quitar"
@@ -310,17 +310,17 @@ msgstr "Tamaño de la paleta en modo 8 bits"
msgid "COLORS"
msgstr "COLORES"
-#: ../gdk/x11/gdkapplaunchcontext-x11.c:312
+#: ../gdk/x11/gdkapplaunchcontext-x11.c:305
#, c-format
msgid "Starting %s"
msgstr "Iniciando %s"
-#: ../gdk/x11/gdkapplaunchcontext-x11.c:316
+#: ../gdk/x11/gdkapplaunchcontext-x11.c:318
#, c-format
msgid "Opening %s"
msgstr "Abriendo %s"
-#: ../gdk/x11/gdkapplaunchcontext-x11.c:321
+#: ../gdk/x11/gdkapplaunchcontext-x11.c:323
#, c-format
msgid "Opening %d Item"
msgid_plural "Opening %d Items"
@@ -341,7 +341,7 @@ msgid "This program comes with ABSOLUTELY NO WARRANTY; for details, visit %s"
msgstr ""
"Este programa viene SIN NINGUNA GARANTÍA; para obtener más detalles visite %s"
-#: ../gtk/gtkaboutdialog.c:339 ../gtk/gtkaboutdialog.c:2232
+#: ../gtk/gtkaboutdialog.c:339 ../gtk/gtkaboutdialog.c:2233
msgid "License"
msgstr "Licencia"
@@ -350,41 +350,41 @@ msgid "The license of the program"
msgstr "La licencia del programa"
#. Add the credits button
-#: ../gtk/gtkaboutdialog.c:621
+#: ../gtk/gtkaboutdialog.c:622
msgid "C_redits"
msgstr "C_réditos"
#. Add the license button
-#: ../gtk/gtkaboutdialog.c:635
+#: ../gtk/gtkaboutdialog.c:636
msgid "_License"
msgstr "_Licencia"
-#: ../gtk/gtkaboutdialog.c:839
+#: ../gtk/gtkaboutdialog.c:840
msgid "Could not show link"
msgstr "No se pudo mostrar el enlace"
-#: ../gtk/gtkaboutdialog.c:932
+#: ../gtk/gtkaboutdialog.c:933
#, c-format
msgid "About %s"
msgstr "Acerca de %s"
-#: ../gtk/gtkaboutdialog.c:2150
+#: ../gtk/gtkaboutdialog.c:2151
msgid "Credits"
msgstr "Créditos"
-#: ../gtk/gtkaboutdialog.c:2182
+#: ../gtk/gtkaboutdialog.c:2183
msgid "Written by"
msgstr "Escrito por"
-#: ../gtk/gtkaboutdialog.c:2185
+#: ../gtk/gtkaboutdialog.c:2186
msgid "Documented by"
msgstr "Documentado por"
-#: ../gtk/gtkaboutdialog.c:2197
+#: ../gtk/gtkaboutdialog.c:2198
msgid "Translated by"
msgstr "Traducido por"
-#: ../gtk/gtkaboutdialog.c:2201
+#: ../gtk/gtkaboutdialog.c:2202
msgid "Artwork by"
msgstr "Arte por"
@@ -489,7 +489,7 @@ msgstr "Etiqueta no soportada: «%s»"
#. * text direction of RTL and specify "calendar:YM", then the year
#. * will appear to the right of the month.
#.
-#: ../gtk/gtkcalendar.c:883
+#: ../gtk/gtkcalendar.c:878
msgid "calendar:MY"
msgstr "calendar:MY"
@@ -497,7 +497,7 @@ msgstr "calendar:MY"
#. * first day of the week to calendar:week_start:1 if you want Monday
#. * to be the first day of the week, and so on.
#.
-#: ../gtk/gtkcalendar.c:921
+#: ../gtk/gtkcalendar.c:916
msgid "calendar:week_start:0"
msgstr "calendar:week_start:1"
@@ -506,7 +506,7 @@ msgstr "calendar:week_start:1"
#. *
#. * If you don't understand this, leave it as "2000"
#.
-#: ../gtk/gtkcalendar.c:2006
+#: ../gtk/gtkcalendar.c:1848
msgctxt "year measurement template"
msgid "2000"
msgstr "2000"
@@ -521,7 +521,7 @@ msgstr "2000"
#. * digits. That needs support from your system and locale definition
#. * too.
#.
-#: ../gtk/gtkcalendar.c:2037 ../gtk/gtkcalendar.c:2719
+#: ../gtk/gtkcalendar.c:1879 ../gtk/gtkcalendar.c:2564
#, c-format
msgctxt "calendar:day:digits"
msgid "%d"
@@ -537,7 +537,7 @@ msgstr "%d"
#. * digits. That needs support from your system and locale definition
#. * too.
#.
-#: ../gtk/gtkcalendar.c:2069 ../gtk/gtkcalendar.c:2579
+#: ../gtk/gtkcalendar.c:1911 ../gtk/gtkcalendar.c:2432
#, c-format
msgctxt "calendar:week:digits"
msgid "%d"
@@ -553,7 +553,7 @@ msgstr "%Id"
#. *
#. * "%Y" is appropriate for most locales.
#.
-#: ../gtk/gtkcalendar.c:2361
+#: ../gtk/gtkcalendar.c:2197
msgctxt "calendar year format"
msgid "%Y"
msgstr "%Y"
@@ -589,15 +589,15 @@ msgctxt "progress bar label"
msgid "%d %%"
msgstr "%d %%"
-#: ../gtk/gtkcolorbutton.c:176 ../gtk/gtkcolorbutton.c:445
+#: ../gtk/gtkcolorbutton.c:188 ../gtk/gtkcolorbutton.c:473
msgid "Pick a Color"
msgstr "Escoja un color"
-#: ../gtk/gtkcolorbutton.c:336
+#: ../gtk/gtkcolorbutton.c:363
msgid "Received invalid color data\n"
msgstr "Se recibió un dato de color no válido\n"
-#: ../gtk/gtkcolorsel.c:379
+#: ../gtk/gtkcolorsel.c:416
msgid ""
"Select the color you want from the outer ring. Select the darkness or "
"lightness of that color using the inner triangle."
@@ -605,7 +605,7 @@ msgstr ""
"Seleccionar el color que desea desde el anillo exterior. Seleccionar la "
"oscuridad o luminosidad de ese color usando el triángulo interior."
-#: ../gtk/gtkcolorsel.c:403
+#: ../gtk/gtkcolorsel.c:440
msgid ""
"Click the eyedropper, then click a color anywhere on your screen to select "
"that color."
@@ -613,67 +613,67 @@ msgstr ""
"Pulse en el gotero, luego pulse sobre cualquier color que haya en su "
"pantalla para seleccionar ese color."
-#: ../gtk/gtkcolorsel.c:412
+#: ../gtk/gtkcolorsel.c:449
msgid "_Hue:"
msgstr "_Matiz:"
-#: ../gtk/gtkcolorsel.c:413
+#: ../gtk/gtkcolorsel.c:450
msgid "Position on the color wheel."
msgstr "Posición en la rueda de colores."
-#: ../gtk/gtkcolorsel.c:415
+#: ../gtk/gtkcolorsel.c:452
msgid "_Saturation:"
msgstr "_Saturación:"
-#: ../gtk/gtkcolorsel.c:416
+#: ../gtk/gtkcolorsel.c:453
msgid "Intensity of the color."
msgstr "Intensidad del color."
-#: ../gtk/gtkcolorsel.c:417
+#: ../gtk/gtkcolorsel.c:454
msgid "_Value:"
msgstr "_Valor:"
-#: ../gtk/gtkcolorsel.c:418
+#: ../gtk/gtkcolorsel.c:455
msgid "Brightness of the color."
msgstr "Brillo del color."
-#: ../gtk/gtkcolorsel.c:419
+#: ../gtk/gtkcolorsel.c:456
msgid "_Red:"
msgstr "_Rojo:"
-#: ../gtk/gtkcolorsel.c:420
+#: ../gtk/gtkcolorsel.c:457
msgid "Amount of red light in the color."
msgstr "Cantidad de luz roja en el color."
-#: ../gtk/gtkcolorsel.c:421
+#: ../gtk/gtkcolorsel.c:458
msgid "_Green:"
msgstr "_Verde:"
-#: ../gtk/gtkcolorsel.c:422
+#: ../gtk/gtkcolorsel.c:459
msgid "Amount of green light in the color."
msgstr "Cantidad de luz verde en el color."
-#: ../gtk/gtkcolorsel.c:423
+#: ../gtk/gtkcolorsel.c:460
msgid "_Blue:"
msgstr "_Azul:"
-#: ../gtk/gtkcolorsel.c:424
+#: ../gtk/gtkcolorsel.c:461
msgid "Amount of blue light in the color."
msgstr "Cantidad de luz azul en el color."
-#: ../gtk/gtkcolorsel.c:427
+#: ../gtk/gtkcolorsel.c:464
msgid "Op_acity:"
msgstr "_Opacidad:"
-#: ../gtk/gtkcolorsel.c:434 ../gtk/gtkcolorsel.c:444
+#: ../gtk/gtkcolorsel.c:471 ../gtk/gtkcolorsel.c:481
msgid "Transparency of the color."
msgstr "Transparencia del color."
-#: ../gtk/gtkcolorsel.c:451
+#: ../gtk/gtkcolorsel.c:488
msgid "Color _name:"
msgstr "_Nombre del color:"
-#: ../gtk/gtkcolorsel.c:465
+#: ../gtk/gtkcolorsel.c:502
msgid ""
"You can enter an HTML-style hexadecimal color value, or simply a color name "
"such as 'orange' in this entry."
@@ -681,15 +681,15 @@ msgstr ""
"Puede introducir en esta entrada un valor de color en estilo HTML "
"hexadecimal, o simplemente un nombre de color como «orange»."
-#: ../gtk/gtkcolorsel.c:495
+#: ../gtk/gtkcolorsel.c:532
msgid "_Palette:"
msgstr "_Paleta:"
-#: ../gtk/gtkcolorsel.c:524
+#: ../gtk/gtkcolorsel.c:561
msgid "Color Wheel"
msgstr "Rueda de color"
-#: ../gtk/gtkcolorsel.c:983
+#: ../gtk/gtkcolorsel.c:1031
msgid ""
"The previously-selected color, for comparison to the color you're selecting "
"now. You can drag this color to a palette entry, or select this color as "
@@ -700,7 +700,7 @@ msgstr ""
"seleccionar este color como actual arrastrándolo al otro color a lo largo de "
"la muestra."
-#: ../gtk/gtkcolorsel.c:986
+#: ../gtk/gtkcolorsel.c:1034
msgid ""
"The color you've chosen. You can drag this color to a palette entry to save "
"it for use in the future."
@@ -708,7 +708,7 @@ msgstr ""
"El color elegido. Puede arrastrar este color a una entrada de la paleta para "
"guardarlo para usarlo en el futuro."
-#: ../gtk/gtkcolorsel.c:991
+#: ../gtk/gtkcolorsel.c:1039
msgid ""
"The previously-selected color, for comparison to the color you're selecting "
"now."
@@ -716,15 +716,15 @@ msgstr ""
"El color anteriormente seleccionado, para compararlo con el color que está "
"seleccionando ahora"
-#: ../gtk/gtkcolorsel.c:994
+#: ../gtk/gtkcolorsel.c:1042
msgid "The color you've chosen."
msgstr "El color que ha elegido."
-#: ../gtk/gtkcolorsel.c:1394
+#: ../gtk/gtkcolorsel.c:1442
msgid "_Save color here"
msgstr "_Guardar color aquí"
-#: ../gtk/gtkcolorsel.c:1599
+#: ../gtk/gtkcolorsel.c:1647
msgid ""
"Click this palette entry to make it the current color. To change this entry, "
"drag a color swatch here or right-click it and select \"Save color here.\""
@@ -801,23 +801,23 @@ msgstr "_Derecho:"
msgid "Paper Margins"
msgstr "Márgenes del papel"
-#: ../gtk/gtkentry.c:8565 ../gtk/gtktextview.c:8183
+#: ../gtk/gtkentry.c:8794 ../gtk/gtktextview.c:8229
msgid "Input _Methods"
msgstr "_Métodos de entrada"
-#: ../gtk/gtkentry.c:8579 ../gtk/gtktextview.c:8197
+#: ../gtk/gtkentry.c:8808 ../gtk/gtktextview.c:8243
msgid "_Insert Unicode Control Character"
msgstr "_Insertar un carácter de control Unicode"
-#: ../gtk/gtkentry.c:9979
+#: ../gtk/gtkentry.c:10208
msgid "Caps Lock and Num Lock are on"
msgstr "Bloq Mayús y Bloq Num están activados"
-#: ../gtk/gtkentry.c:9981
+#: ../gtk/gtkentry.c:10210
msgid "Num Lock is on"
msgstr "Bloq Num está activado"
-#: ../gtk/gtkentry.c:9983
+#: ../gtk/gtkentry.c:10212
msgid "Caps Lock is on"
msgstr "Bloq Mayús está activado"
@@ -837,7 +837,7 @@ msgstr "Escritorio"
msgid "(None)"
msgstr "(Ninguno)"
-#: ../gtk/gtkfilechooserbutton.c:1997
+#: ../gtk/gtkfilechooserbutton.c:2001
msgid "Other..."
msgstr "Otra…"
@@ -898,194 +898,194 @@ msgstr "%1$s en %2$s"
msgid "Search"
msgstr "Buscar"
-#: ../gtk/gtkfilechooserdefault.c:1776 ../gtk/gtkfilechooserdefault.c:9382
+#: ../gtk/gtkfilechooserdefault.c:1776 ../gtk/gtkfilechooserdefault.c:9417
msgid "Recently Used"
msgstr "Usados recientemente"
-#: ../gtk/gtkfilechooserdefault.c:2430
+#: ../gtk/gtkfilechooserdefault.c:2437
msgid "Select which types of files are shown"
msgstr "Seleccionar qué tipos de archivos se muestran"
-#: ../gtk/gtkfilechooserdefault.c:2789
+#: ../gtk/gtkfilechooserdefault.c:2796
#, c-format
msgid "Add the folder '%s' to the bookmarks"
msgstr "Añadir la carpeta «%s» a los marcadores"
-#: ../gtk/gtkfilechooserdefault.c:2833
+#: ../gtk/gtkfilechooserdefault.c:2840
#, c-format
msgid "Add the current folder to the bookmarks"
msgstr "Añadir la carpeta actual a los marcadores"
-#: ../gtk/gtkfilechooserdefault.c:2835
+#: ../gtk/gtkfilechooserdefault.c:2842
#, c-format
msgid "Add the selected folders to the bookmarks"
msgstr "Añadir las carpetas seleccionadas a los marcadores"
-#: ../gtk/gtkfilechooserdefault.c:2873
+#: ../gtk/gtkfilechooserdefault.c:2880
#, c-format
msgid "Remove the bookmark '%s'"
msgstr "Quitar el marcador «%s»"
-#: ../gtk/gtkfilechooserdefault.c:2875
+#: ../gtk/gtkfilechooserdefault.c:2882
#, c-format
msgid "Bookmark '%s' cannot be removed"
msgstr "No se puede quitar el marcador «%s»"
-#: ../gtk/gtkfilechooserdefault.c:2882 ../gtk/gtkfilechooserdefault.c:3746
+#: ../gtk/gtkfilechooserdefault.c:2889 ../gtk/gtkfilechooserdefault.c:3750
msgid "Remove the selected bookmark"
msgstr "Quitar el marcador seleccionado"
-#: ../gtk/gtkfilechooserdefault.c:3442
+#: ../gtk/gtkfilechooserdefault.c:3445
msgid "Remove"
msgstr "Quitar"
-#: ../gtk/gtkfilechooserdefault.c:3451
+#: ../gtk/gtkfilechooserdefault.c:3454
msgid "Rename..."
msgstr "Renombrar…"
#. Accessible object name for the file chooser's shortcuts pane
-#: ../gtk/gtkfilechooserdefault.c:3614
+#: ../gtk/gtkfilechooserdefault.c:3617
msgid "Places"
msgstr "Lugares"
#. Column header for the file chooser's shortcuts pane
-#: ../gtk/gtkfilechooserdefault.c:3671
+#: ../gtk/gtkfilechooserdefault.c:3674
msgid "_Places"
msgstr "_Lugares"
-#: ../gtk/gtkfilechooserdefault.c:3727
+#: ../gtk/gtkfilechooserdefault.c:3731
msgid "_Add"
msgstr "_Añadir"
-#: ../gtk/gtkfilechooserdefault.c:3734
+#: ../gtk/gtkfilechooserdefault.c:3738
msgid "Add the selected folder to the Bookmarks"
msgstr "Añade la carpeta seleccionada a los marcadores"
-#: ../gtk/gtkfilechooserdefault.c:3739
+#: ../gtk/gtkfilechooserdefault.c:3743
msgid "_Remove"
msgstr "_Quitar"
-#: ../gtk/gtkfilechooserdefault.c:3881
+#: ../gtk/gtkfilechooserdefault.c:3885
msgid "Could not select file"
msgstr "No se pudo seleccionar el archivo"
-#: ../gtk/gtkfilechooserdefault.c:4056
+#: ../gtk/gtkfilechooserdefault.c:4060
msgid "_Add to Bookmarks"
msgstr "_Añadir a los marcadores"
-#: ../gtk/gtkfilechooserdefault.c:4069
+#: ../gtk/gtkfilechooserdefault.c:4073
msgid "Show _Hidden Files"
msgstr "Mostrar archivos _ocultos"
-#: ../gtk/gtkfilechooserdefault.c:4076
+#: ../gtk/gtkfilechooserdefault.c:4080
msgid "Show _Size Column"
msgstr "Mostrar columna de _tamaño"
-#: ../gtk/gtkfilechooserdefault.c:4302
+#: ../gtk/gtkfilechooserdefault.c:4306
msgid "Files"
msgstr "Archivos"
-#: ../gtk/gtkfilechooserdefault.c:4353
+#: ../gtk/gtkfilechooserdefault.c:4357
msgid "Name"
msgstr "Nombre"
-#: ../gtk/gtkfilechooserdefault.c:4376
+#: ../gtk/gtkfilechooserdefault.c:4380
msgid "Size"
msgstr "Tamaño"
-#: ../gtk/gtkfilechooserdefault.c:4390
+#: ../gtk/gtkfilechooserdefault.c:4394
msgid "Modified"
msgstr "Modificado"
#. Label
-#: ../gtk/gtkfilechooserdefault.c:4645 ../gtk/gtkprinteroptionwidget.c:793
+#: ../gtk/gtkfilechooserdefault.c:4649 ../gtk/gtkprinteroptionwidget.c:793
msgid "_Name:"
msgstr "_Nombre:"
-#: ../gtk/gtkfilechooserdefault.c:4688
+#: ../gtk/gtkfilechooserdefault.c:4692
msgid "_Browse for other folders"
msgstr "_Buscar otras carpetas"
-#: ../gtk/gtkfilechooserdefault.c:4958
+#: ../gtk/gtkfilechooserdefault.c:4962
msgid "Type a file name"
msgstr "Teclee un nombre de archivo"
# C en conflicto con Cancelar
#. Create Folder
-#: ../gtk/gtkfilechooserdefault.c:5001
+#: ../gtk/gtkfilechooserdefault.c:5005
msgid "Create Fo_lder"
msgstr "Crear car_peta"
-#: ../gtk/gtkfilechooserdefault.c:5011
+#: ../gtk/gtkfilechooserdefault.c:5015
msgid "_Location:"
msgstr "_Lugar:"
# El acelerador c entra en conflicto con cancelar
-#: ../gtk/gtkfilechooserdefault.c:5215
+#: ../gtk/gtkfilechooserdefault.c:5219
msgid "Save in _folder:"
msgstr "_Guardar en la carpeta:"
-#: ../gtk/gtkfilechooserdefault.c:5217
+#: ../gtk/gtkfilechooserdefault.c:5221
msgid "Create in _folder:"
msgstr "Crear en la _carpeta:"
-#: ../gtk/gtkfilechooserdefault.c:6286
+#: ../gtk/gtkfilechooserdefault.c:6290
#, c-format
msgid "Could not read the contents of %s"
msgstr "No se pudo leer el contenido de %s"
-#: ../gtk/gtkfilechooserdefault.c:6290
+#: ../gtk/gtkfilechooserdefault.c:6294
msgid "Could not read the contents of the folder"
msgstr "No se pudo leer el contenido del la carpeta"
-#: ../gtk/gtkfilechooserdefault.c:6383 ../gtk/gtkfilechooserdefault.c:6451
-#: ../gtk/gtkfilechooserdefault.c:6596
+#: ../gtk/gtkfilechooserdefault.c:6387 ../gtk/gtkfilechooserdefault.c:6455
+#: ../gtk/gtkfilechooserdefault.c:6600
msgid "Unknown"
msgstr "Desconocido"
-#: ../gtk/gtkfilechooserdefault.c:6398
+#: ../gtk/gtkfilechooserdefault.c:6402
msgid "%H:%M"
msgstr "%H:%M"
-#: ../gtk/gtkfilechooserdefault.c:6400
+#: ../gtk/gtkfilechooserdefault.c:6404
msgid "Yesterday at %H:%M"
msgstr "Ayer a las %H:%M"
-#: ../gtk/gtkfilechooserdefault.c:7066
+#: ../gtk/gtkfilechooserdefault.c:7070
msgid "Cannot change to folder because it is not local"
msgstr "No se pudo cambiar a la carpeta porque no es local"
-#: ../gtk/gtkfilechooserdefault.c:7663 ../gtk/gtkfilechooserdefault.c:7684
+#: ../gtk/gtkfilechooserdefault.c:7667 ../gtk/gtkfilechooserdefault.c:7688
#, c-format
msgid "Shortcut %s already exists"
msgstr "La combinación %s ya existe"
-#: ../gtk/gtkfilechooserdefault.c:7774
+#: ../gtk/gtkfilechooserdefault.c:7778
#, c-format
msgid "Shortcut %s does not exist"
msgstr "La combinación %s no existe"
-#: ../gtk/gtkfilechooserdefault.c:8035 ../gtk/gtkprintunixdialog.c:480
+#: ../gtk/gtkfilechooserdefault.c:8039 ../gtk/gtkprintunixdialog.c:480
#, c-format
msgid "A file named \"%s\" already exists. Do you want to replace it?"
msgstr "Ya existe un archivo llamado «%s». ¿Quiere reemplazarlo?"
-#: ../gtk/gtkfilechooserdefault.c:8038 ../gtk/gtkprintunixdialog.c:484
+#: ../gtk/gtkfilechooserdefault.c:8042 ../gtk/gtkprintunixdialog.c:484
#, c-format
msgid ""
"The file already exists in \"%s\". Replacing it will overwrite its contents."
msgstr ""
"El archivo ya existe en «%s». Si lo reemplaza sobreescribirá su contenido."
-#: ../gtk/gtkfilechooserdefault.c:8043 ../gtk/gtkprintunixdialog.c:491
+#: ../gtk/gtkfilechooserdefault.c:8047 ../gtk/gtkprintunixdialog.c:491
msgid "_Replace"
msgstr "_Reemplazar"
-#: ../gtk/gtkfilechooserdefault.c:8751
+#: ../gtk/gtkfilechooserdefault.c:8755
msgid "Could not start the search process"
msgstr "No se ha podido iniciar el proceso de búsqueda"
-#: ../gtk/gtkfilechooserdefault.c:8752
+#: ../gtk/gtkfilechooserdefault.c:8756
msgid ""
"The program was not able to create a connection to the indexer daemon. "
"Please make sure it is running."
@@ -1093,36 +1093,36 @@ msgstr ""
"El programa no fue capaz de crear una conexión con el demonio indexador. Por "
"favor asegúrese de que se está ejecutando."
-#: ../gtk/gtkfilechooserdefault.c:8766
+#: ../gtk/gtkfilechooserdefault.c:8770
msgid "Could not send the search request"
msgstr "No se ha podido enviar la petición de búsqueda"
-#: ../gtk/gtkfilechooserdefault.c:8954
+#: ../gtk/gtkfilechooserdefault.c:8989
msgid "Search:"
msgstr "Buscar:"
-#: ../gtk/gtkfilechooserdefault.c:9559
+#: ../gtk/gtkfilechooserdefault.c:9594
#, c-format
msgid "Could not mount %s"
msgstr "No se pudo montar %s"
#. Translators: this is shown in the feedback for Tab-completion in a file
#. * chooser's text entry, when the user enters an invalid path.
-#: ../gtk/gtkfilechooserentry.c:702 ../gtk/gtkfilechooserentry.c:1169
+#: ../gtk/gtkfilechooserentry.c:702 ../gtk/gtkfilechooserentry.c:1172
msgid "Invalid path"
msgstr "Ruta no válida"
#. translators: this text is shown when there are no completions
#. * for something the user typed in a file chooser entry
#.
-#: ../gtk/gtkfilechooserentry.c:1101
+#: ../gtk/gtkfilechooserentry.c:1104
msgid "No match"
msgstr "No hay coincidencias"
#. translators: this text is shown when there is exactly one completion
#. * for something the user typed in a file chooser entry
#.
-#: ../gtk/gtkfilechooserentry.c:1112
+#: ../gtk/gtkfilechooserentry.c:1115
msgid "Sole completion"
msgstr "Completado único"
@@ -1130,13 +1130,13 @@ msgstr "Completado único"
#. * entry is a complete filename, but could be continued to find
#. * a longer match
#.
-#: ../gtk/gtkfilechooserentry.c:1128
+#: ../gtk/gtkfilechooserentry.c:1131
msgid "Complete, but not unique"
msgstr "Completado, pero no único"
#. Translators: this text is shown while the system is searching
#. * for possible completions for filenames in a file chooser entry.
-#: ../gtk/gtkfilechooserentry.c:1160
+#: ../gtk/gtkfilechooserentry.c:1163
msgid "Completing..."
msgstr "Completando…"
@@ -1144,7 +1144,7 @@ msgstr "Completando…"
#. Translators: this is shown in the feedback for Tab-completion in a
#. * file chooser's text entry when the user enters something like
#. * "sftp://blahblah" in an app that only supports local filenames.
-#: ../gtk/gtkfilechooserentry.c:1182 ../gtk/gtkfilechooserentry.c:1207
+#: ../gtk/gtkfilechooserentry.c:1185 ../gtk/gtkfilechooserentry.c:1210
msgid "Only local files may be selected"
msgstr "Sólo se pueden seleccionar archivos locales"
@@ -1152,14 +1152,14 @@ msgstr "Sólo se pueden seleccionar archivos locales"
#. Translators: this is shown in the feedback for Tab-completion in a
#. * file chooser's text entry when the user hasn't entered the first '/'
#. * after a hostname and yet hits Tab (such as "sftp://blahblah[Tab]")
-#: ../gtk/gtkfilechooserentry.c:1191
+#: ../gtk/gtkfilechooserentry.c:1194
msgid "Incomplete hostname; end it with '/'"
msgstr "Nombre de equipo incompleto; termínelo con «/»"
#. Translators: this is shown in the feedback for Tab-completion in a file
#. * chooser's text entry when the user enters a path that does not exist
#. * and then hits Tab
-#: ../gtk/gtkfilechooserentry.c:1202
+#: ../gtk/gtkfilechooserentry.c:1205
msgid "Path does not exist"
msgstr "La ruta no existe"
@@ -1206,11 +1206,11 @@ msgid "Si_ze:"
msgstr "_Tamaño:"
#. create the text entry widget
-#: ../gtk/gtkfontsel.c:559
+#: ../gtk/gtkfontsel.c:558
msgid "_Preview:"
msgstr "_Vista previa:"
-#: ../gtk/gtkfontsel.c:1659
+#: ../gtk/gtkfontsel.c:1658
msgid "Font Selection"
msgstr "Selección de tipografías"
@@ -1222,7 +1222,7 @@ msgstr "Selección de tipografías"
msgid "Error loading icon: %s"
msgstr "Ocurrió un error al cargar el icono: %s"
-#: ../gtk/gtkicontheme.c:1354
+#: ../gtk/gtkicontheme.c:1355
#, c-format
msgid ""
"Could not find the icon '%s'. The '%s' theme\n"
@@ -1235,12 +1235,12 @@ msgstr ""
"Puede obtener una copia desde:\n"
"\t%s"
-#: ../gtk/gtkicontheme.c:1535
+#: ../gtk/gtkicontheme.c:1536
#, c-format
msgid "Icon '%s' not present in theme"
msgstr "El icono «%s» no está presente en el tema"
-#: ../gtk/gtkicontheme.c:3048
+#: ../gtk/gtkicontheme.c:3057
msgid "Failed to load icon"
msgstr "No se pudo cargar el icono"
@@ -1266,12 +1266,12 @@ msgid "System (%s)"
msgstr "Sistema (%s)"
#. Open Link
-#: ../gtk/gtklabel.c:6196
+#: ../gtk/gtklabel.c:6214
msgid "_Open Link"
msgstr "_Abrir enlace"
#. Copy Link Address
-#: ../gtk/gtklabel.c:6208
+#: ../gtk/gtklabel.c:6226
msgid "Copy _Link Address"
msgstr "Copiar la dirección del _enlace"
@@ -1284,27 +1284,27 @@ msgid "Invalid URI"
msgstr "URI inválida"
#. Description of --gtk-module=MODULES in --help output
-#: ../gtk/gtkmain.c:527
+#: ../gtk/gtkmain.c:518
msgid "Load additional GTK+ modules"
msgstr "Cargar módulos adicionales GTK+"
#. Placeholder in --gtk-module=MODULES in --help output
-#: ../gtk/gtkmain.c:528
+#: ../gtk/gtkmain.c:519
msgid "MODULES"
msgstr "MÓDULOS"
#. Description of --g-fatal-warnings in --help output
-#: ../gtk/gtkmain.c:530
+#: ../gtk/gtkmain.c:521
msgid "Make all warnings fatal"
msgstr "Hacer todas las advertencias fatales"
#. Description of --gtk-debug=FLAGS in --help output
-#: ../gtk/gtkmain.c:533
+#: ../gtk/gtkmain.c:524
msgid "GTK+ debugging flags to set"
msgstr "Opciones de depuración GTK+ a poner"
#. Description of --gtk-no-debug=FLAGS in --help output
-#: ../gtk/gtkmain.c:536
+#: ../gtk/gtkmain.c:527
msgid "GTK+ debugging flags to unset"
msgstr "Opciones de depuración GTK+ a quitar"
@@ -1313,20 +1313,20 @@ msgstr "Opciones de depuración GTK+ a quitar"
#. * Do *not* translate it to "predefinito:LTR", if it
#. * it isn't default:LTR or default:RTL it will not work
#.
-#: ../gtk/gtkmain.c:799
+#: ../gtk/gtkmain.c:790
msgid "default:LTR"
msgstr "default:LTR"
-#: ../gtk/gtkmain.c:864
+#: ../gtk/gtkmain.c:855
#, c-format
msgid "Cannot open display: %s"
msgstr "No se puede abrir el visor: %s"
-#: ../gtk/gtkmain.c:923
+#: ../gtk/gtkmain.c:914
msgid "GTK+ Options"
msgstr "Opciones GTK+"
-#: ../gtk/gtkmain.c:923
+#: ../gtk/gtkmain.c:914
msgid "Show GTK+ Options"
msgstr "Mostrar opciones GTK+"
@@ -1411,12 +1411,12 @@ msgstr "Shell Z"
msgid "Cannot end process with PID %d: %s"
msgstr "No se puede finalizar el proceso con PID %d: %s"
-#: ../gtk/gtknotebook.c:4724 ../gtk/gtknotebook.c:7287
+#: ../gtk/gtknotebook.c:4756 ../gtk/gtknotebook.c:7319
#, c-format
msgid "Page %u"
msgstr "Página %u"
-#: ../gtk/gtkpagesetup.c:596 ../gtk/gtkpapersize.c:838
+#: ../gtk/gtkpagesetup.c:648 ../gtk/gtkpapersize.c:838
#: ../gtk/gtkpapersize.c:880
msgid "Not a valid page setup file"
msgstr "No es un archivo válido de configuración de página"
@@ -1464,15 +1464,15 @@ msgstr "_Orientación:"
msgid "Page Setup"
msgstr "Configuración de página"
-#: ../gtk/gtkpathbar.c:154
+#: ../gtk/gtkpathbar.c:158
msgid "Up Path"
msgstr "Ruta superior"
-#: ../gtk/gtkpathbar.c:156
+#: ../gtk/gtkpathbar.c:160
msgid "Down Path"
msgstr "Ruta inferior"
-#: ../gtk/gtkpathbar.c:1490
+#: ../gtk/gtkpathbar.c:1523
msgid "File System Root"
msgstr "Sistema de archivos raíz"
@@ -2055,15 +2055,15 @@ msgctxt "recent menu label"
msgid "%d. %s"
msgstr "%d. %s"
-#: ../gtk/gtkrecentmanager.c:986 ../gtk/gtkrecentmanager.c:999
-#: ../gtk/gtkrecentmanager.c:1137 ../gtk/gtkrecentmanager.c:1147
-#: ../gtk/gtkrecentmanager.c:1200 ../gtk/gtkrecentmanager.c:1209
-#: ../gtk/gtkrecentmanager.c:1224
+#: ../gtk/gtkrecentmanager.c:1000 ../gtk/gtkrecentmanager.c:1013
+#: ../gtk/gtkrecentmanager.c:1150 ../gtk/gtkrecentmanager.c:1160
+#: ../gtk/gtkrecentmanager.c:1213 ../gtk/gtkrecentmanager.c:1222
+#: ../gtk/gtkrecentmanager.c:1237
#, c-format
msgid "Unable to find an item with URI '%s'"
msgstr "No se ha podido encontrar un elemento con el URI «%s»"
-#: ../gtk/gtkrecentmanager.c:2394
+#: ../gtk/gtkrecentmanager.c:2437
#, c-format
msgid "No registered application with name '%s' for item with URI '%s' found"
msgstr ""
@@ -2585,6 +2585,33 @@ msgctxt "Stock label"
msgid "Zoom _Out"
msgstr "_Reducir"
+#. Translators: if the "on" state label requires more than three
+#. * glyphs then use MEDIUM VERTICAL BAR (U+2759) as the text for
+#. * the state
+#.
+#: ../gtk/gtkswitch.c:297 ../gtk/gtkswitch.c:340 ../gtk/gtkswitch.c:532
+msgctxt "switch"
+msgid "ON"
+msgstr "ENCENDIDO"
+
+#. Translators: if the "off" state label requires more than three
+#. * glyphs then use WHITE CIRCLE (U+25CB) as the text for the state
+#.
+#: ../gtk/gtkswitch.c:305 ../gtk/gtkswitch.c:341 ../gtk/gtkswitch.c:553
+msgctxt "switch"
+msgid "OFF"
+msgstr "APAGADO"
+
+#: ../gtk/gtkswitch.c:938
+#| msgid "inch"
+msgctxt "light switch widget"
+msgid "Switch"
+msgstr "Interruptor"
+
+#: ../gtk/gtkswitch.c:939
+msgid "Switches between on and off states"
+msgstr "Cambia entre los estados encendido y apagado"
+
#: ../gtk/gtktextbufferrichtext.c:650
#, c-format
msgid "Unknown error when trying to deserialize %s"
@@ -2595,108 +2622,108 @@ msgstr "Error desconocido al intentar deserializar %s"
msgid "No deserialize function found for format %s"
msgstr "No se encontró función de deserialización para el formato %s"
-#: ../gtk/gtktextbufferserialize.c:795 ../gtk/gtktextbufferserialize.c:821
+#: ../gtk/gtktextbufferserialize.c:803 ../gtk/gtktextbufferserialize.c:829
#, c-format
msgid "Both \"id\" and \"name\" were found on the <%s> element"
msgstr "Se encontraron tanto «id» como «name» en el elemento <%s>"
-#: ../gtk/gtktextbufferserialize.c:805 ../gtk/gtktextbufferserialize.c:831
+#: ../gtk/gtktextbufferserialize.c:813 ../gtk/gtktextbufferserialize.c:839
#, c-format
msgid "The attribute \"%s\" was found twice on the <%s> element"
msgstr "Se encontró el atributo «%s» dos veces en el elemento <%s>"
-#: ../gtk/gtktextbufferserialize.c:845
+#: ../gtk/gtktextbufferserialize.c:855
#, c-format
msgid "<%s> element has invalid ID \"%s\""
msgstr "El elemento <%s> tiene el ID inválido «%s»"
-#: ../gtk/gtktextbufferserialize.c:855
+#: ../gtk/gtktextbufferserialize.c:865
#, c-format
msgid "<%s> element has neither a \"name\" nor an \"id\" attribute"
msgstr "El elemento <%s> no tiene ni un elemento «name» ni un elemento «id»"
-#: ../gtk/gtktextbufferserialize.c:942
+#: ../gtk/gtktextbufferserialize.c:952
#, c-format
msgid "Attribute \"%s\" repeated twice on the same <%s> element"
msgstr "El atributo «%s» se repite dos veces en el mismo elemento <%s>"
-#: ../gtk/gtktextbufferserialize.c:960 ../gtk/gtktextbufferserialize.c:985
+#: ../gtk/gtktextbufferserialize.c:970 ../gtk/gtktextbufferserialize.c:995
#, c-format
msgid "Attribute \"%s\" is invalid on <%s> element in this context"
msgstr "El atributo «%s» es inválido en el elemento <%s> en este contexto"
-#: ../gtk/gtktextbufferserialize.c:1024
+#: ../gtk/gtktextbufferserialize.c:1034
#, c-format
msgid "Tag \"%s\" has not been defined."
msgstr "La etiqueta «%s» no ha sido definida."
-#: ../gtk/gtktextbufferserialize.c:1036
+#: ../gtk/gtktextbufferserialize.c:1046
msgid "Anonymous tag found and tags can not be created."
msgstr "Se encontró una etiqueta anónima y las etiquetas no se pueden crear."
-#: ../gtk/gtktextbufferserialize.c:1047
+#: ../gtk/gtktextbufferserialize.c:1057
#, c-format
msgid "Tag \"%s\" does not exist in buffer and tags can not be created."
msgstr ""
"La etiqueta «%s» no existe en el búfer y las etiquetas no se pueden crear."
-#: ../gtk/gtktextbufferserialize.c:1146 ../gtk/gtktextbufferserialize.c:1221
-#: ../gtk/gtktextbufferserialize.c:1324 ../gtk/gtktextbufferserialize.c:1398
+#: ../gtk/gtktextbufferserialize.c:1156 ../gtk/gtktextbufferserialize.c:1231
+#: ../gtk/gtktextbufferserialize.c:1336 ../gtk/gtktextbufferserialize.c:1410
#, c-format
msgid "Element <%s> is not allowed below <%s>"
msgstr "El elemento <%s» no se permite debajo de <%s>"
-#: ../gtk/gtktextbufferserialize.c:1177
+#: ../gtk/gtktextbufferserialize.c:1187
#, c-format
msgid "\"%s\" is not a valid attribute type"
msgstr "«%s» no es un tipo de atributo válido"
-#: ../gtk/gtktextbufferserialize.c:1185
+#: ../gtk/gtktextbufferserialize.c:1195
#, c-format
msgid "\"%s\" is not a valid attribute name"
msgstr "«%s» no es un nombre de atributo válido"
-#: ../gtk/gtktextbufferserialize.c:1195
+#: ../gtk/gtktextbufferserialize.c:1205
#, c-format
msgid ""
"\"%s\" could not be converted to a value of type \"%s\" for attribute \"%s\""
msgstr "«%s» no se pudo convertir a un valor de tipo «%s»para el atributo «%s»"
-#: ../gtk/gtktextbufferserialize.c:1204
+#: ../gtk/gtktextbufferserialize.c:1214
#, c-format
msgid "\"%s\" is not a valid value for attribute \"%s\""
msgstr "«%s» no es un valor válido para el atributo «%s»"
-#: ../gtk/gtktextbufferserialize.c:1289
+#: ../gtk/gtktextbufferserialize.c:1299
#, c-format
msgid "Tag \"%s\" already defined"
msgstr "La etiqueta «%s» ya está definida"
-#: ../gtk/gtktextbufferserialize.c:1300
+#: ../gtk/gtktextbufferserialize.c:1312
#, c-format
msgid "Tag \"%s\" has invalid priority \"%s\""
msgstr "La etiqueta «%s» tiene prioridad «%s» inválida"
-#: ../gtk/gtktextbufferserialize.c:1353
+#: ../gtk/gtktextbufferserialize.c:1365
#, c-format
msgid "Outermost element in text must be <text_view_markup> not <%s>"
msgstr ""
"El elemento más externo en el texto debe ser <text_view_markup> no <%s>"
-#: ../gtk/gtktextbufferserialize.c:1362 ../gtk/gtktextbufferserialize.c:1378
+#: ../gtk/gtktextbufferserialize.c:1374 ../gtk/gtktextbufferserialize.c:1390
#, c-format
msgid "A <%s> element has already been specified"
msgstr "Ya se ha especificado un elemento <%s>"
-#: ../gtk/gtktextbufferserialize.c:1384
+#: ../gtk/gtktextbufferserialize.c:1396
msgid "A <text> element can't occur before a <tags> element"
msgstr "Un elemento <text> no puede estar antes de un elemento <tags>"
-#: ../gtk/gtktextbufferserialize.c:1784
+#: ../gtk/gtktextbufferserialize.c:1796
msgid "Serialized data is malformed"
msgstr "Los datos serializados están mal formados"
-#: ../gtk/gtktextbufferserialize.c:1862
+#: ../gtk/gtktextbufferserialize.c:1874
msgid ""
"Serialized data is malformed. First section isn't GTKTEXTBUFFERCONTENTS-0001"
msgstr ""
@@ -3656,81 +3683,81 @@ msgstr "No se ha podido escribir el índice de la carpeta\n"
msgid "Failed to rewrite header\n"
msgstr "No se ha podido reescribir la cabecera\n"
-#: ../gtk/updateiconcache.c:1463
+#: ../gtk/updateiconcache.c:1488
#, c-format
msgid "Failed to open file %s : %s\n"
msgstr "No se ha podido abrir el archivo «%s»: %s\n"
-#: ../gtk/updateiconcache.c:1471
+#: ../gtk/updateiconcache.c:1496 ../gtk/updateiconcache.c:1526
#, c-format
msgid "Failed to write cache file: %s\n"
msgstr "No se ha podido escribir el archivo de caché: %s\n"
-#: ../gtk/updateiconcache.c:1507
+#: ../gtk/updateiconcache.c:1537
#, c-format
msgid "The generated cache was invalid.\n"
msgstr "La caché generada no es válida.\n"
-#: ../gtk/updateiconcache.c:1521
+#: ../gtk/updateiconcache.c:1551
#, c-format
msgid "Could not rename %s to %s: %s, removing %s then.\n"
msgstr "No se pudo renombrar %s a %s: %s, eliminando %s entonces.\n"
-#: ../gtk/updateiconcache.c:1535
+#: ../gtk/updateiconcache.c:1565
#, c-format
msgid "Could not rename %s to %s: %s\n"
msgstr "No se pudo renombrar %s a %s: %s\n"
-#: ../gtk/updateiconcache.c:1545
+#: ../gtk/updateiconcache.c:1575
#, c-format
msgid "Could not rename %s back to %s: %s.\n"
msgstr "No se pudo renombrar %s de nuevo a %s: %s.\n"
-#: ../gtk/updateiconcache.c:1572
+#: ../gtk/updateiconcache.c:1602
#, c-format
msgid "Cache file created successfully.\n"
msgstr "Archivo de caché creado con éxito.\n"
-#: ../gtk/updateiconcache.c:1611
+#: ../gtk/updateiconcache.c:1641
msgid "Overwrite an existing cache, even if up to date"
msgstr "Sobreescribir un caché existente, incluso si está actualizado"
-#: ../gtk/updateiconcache.c:1612
+#: ../gtk/updateiconcache.c:1642
msgid "Don't check for the existence of index.theme"
msgstr "No comprobar la existencia de index.theme"
-#: ../gtk/updateiconcache.c:1613
+#: ../gtk/updateiconcache.c:1643
msgid "Don't include image data in the cache"
msgstr "No incluir los datos de la imagen en el caché"
-#: ../gtk/updateiconcache.c:1614
+#: ../gtk/updateiconcache.c:1644
msgid "Output a C header file"
msgstr "Sacar un archivo de cabecera C"
-#: ../gtk/updateiconcache.c:1615
+#: ../gtk/updateiconcache.c:1645
msgid "Turn off verbose output"
msgstr "Desactivar la salida prolija"
-#: ../gtk/updateiconcache.c:1616
+#: ../gtk/updateiconcache.c:1646
msgid "Validate existing icon cache"
msgstr "Validar la caché de iconos existente"
-#: ../gtk/updateiconcache.c:1683
+#: ../gtk/updateiconcache.c:1713
#, c-format
msgid "File not found: %s\n"
msgstr "Archivo no encontrado: %s\n"
-#: ../gtk/updateiconcache.c:1689
+#: ../gtk/updateiconcache.c:1719
#, c-format
msgid "Not a valid icon cache: %s\n"
msgstr "No es una caché de iconos válida: %s\n"
-#: ../gtk/updateiconcache.c:1702
+#: ../gtk/updateiconcache.c:1732
#, c-format
msgid "No theme index file.\n"
msgstr "No existe el archivo índice del tema.\n"
-#: ../gtk/updateiconcache.c:1706
+#: ../gtk/updateiconcache.c:1736
#, c-format
msgid ""
"No theme index file in '%s'.\n"
@@ -4148,32 +4175,32 @@ msgstr "Personalizado %sx%s"
msgid "output.%s"
msgstr "salida.%s"
-#: ../modules/printbackends/file/gtkprintbackendfile.c:493
+#: ../modules/printbackends/file/gtkprintbackendfile.c:501
msgid "Print to File"
msgstr "Imprimir a un archivo"
-#: ../modules/printbackends/file/gtkprintbackendfile.c:570
+#: ../modules/printbackends/file/gtkprintbackendfile.c:578
msgid "PDF"
msgstr "PDF"
-#: ../modules/printbackends/file/gtkprintbackendfile.c:570
+#: ../modules/printbackends/file/gtkprintbackendfile.c:578
msgid "Postscript"
msgstr "Postscript"
-#: ../modules/printbackends/file/gtkprintbackendfile.c:570
+#: ../modules/printbackends/file/gtkprintbackendfile.c:578
msgid "SVG"
msgstr "SVG"
-#: ../modules/printbackends/file/gtkprintbackendfile.c:582
+#: ../modules/printbackends/file/gtkprintbackendfile.c:590
#: ../modules/printbackends/test/gtkprintbackendtest.c:503
msgid "Pages per _sheet:"
msgstr "Páginas por _hoja:"
-#: ../modules/printbackends/file/gtkprintbackendfile.c:641
+#: ../modules/printbackends/file/gtkprintbackendfile.c:649
msgid "File"
msgstr "Archivo"
-#: ../modules/printbackends/file/gtkprintbackendfile.c:651
+#: ../modules/printbackends/file/gtkprintbackendfile.c:659
msgid "_Output format"
msgstr "Formato de _salida"
diff --git a/po/he.po b/po/he.po
index d4a9fbe596..4f465b6de0 100644
--- a/po/he.po
+++ b/po/he.po
@@ -10,8 +10,8 @@ msgid ""
msgstr ""
"Project-Id-Version: gtk+.HEAD.he\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-10-23 02:38+0200\n"
-"PO-Revision-Date: 2010-10-23 02:40+0200\n"
+"POT-Creation-Date: 2010-12-04 15:16+0200\n"
+"PO-Revision-Date: 2010-12-04 15:25+0200\n"
"Last-Translator: Yaron Shahrabani <sh.yaron@gmail.com>\n"
"Language-Team: Hebrew <he@li.org>\n"
"MIME-Version: 1.0\n"
@@ -20,58 +20,58 @@ msgstr ""
"Language: he\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: ../gdk/gdk.c:104
+#: ../gdk/gdk.c:115
#, c-format
msgid "Error parsing option --gdk-debug"
msgstr "Error parsing option --gdk-debug"
-#: ../gdk/gdk.c:124
+#: ../gdk/gdk.c:135
#, c-format
msgid "Error parsing option --gdk-no-debug"
msgstr "Error parsing option --gdk-no-debug"
#. Description of --class=CLASS in --help output
-#: ../gdk/gdk.c:152
+#: ../gdk/gdk.c:163
msgid "Program class as used by the window manager"
msgstr "Program class as used by the window manager"
#. Placeholder in --class=CLASS in --help output
-#: ../gdk/gdk.c:153
+#: ../gdk/gdk.c:164
msgid "CLASS"
msgstr "CLASS"
#. Description of --name=NAME in --help output
-#: ../gdk/gdk.c:155
+#: ../gdk/gdk.c:166
msgid "Program name as used by the window manager"
msgstr "Program name as used by the window manager"
#. Placeholder in --name=NAME in --help output
-#: ../gdk/gdk.c:156
+#: ../gdk/gdk.c:167
msgid "NAME"
msgstr "NAME"
#. Description of --display=DISPLAY in --help output
-#: ../gdk/gdk.c:158
+#: ../gdk/gdk.c:169
msgid "X display to use"
msgstr "X display to use"
#. Placeholder in --display=DISPLAY in --help output
-#: ../gdk/gdk.c:159
+#: ../gdk/gdk.c:170
msgid "DISPLAY"
msgstr "DISPLAY"
#. Description of --screen=SCREEN in --help output
-#: ../gdk/gdk.c:161
+#: ../gdk/gdk.c:172
msgid "X screen to use"
msgstr "X screen to use"
#. Placeholder in --screen=SCREEN in --help output
-#: ../gdk/gdk.c:162
+#: ../gdk/gdk.c:173
msgid "SCREEN"
msgstr "SCREEN"
#. Description of --gdk-debug=FLAGS in --help output
-#: ../gdk/gdk.c:165
+#: ../gdk/gdk.c:176
msgid "GDK debugging flags to set"
msgstr "GDK debugging flags to set"
@@ -79,12 +79,12 @@ msgstr "GDK debugging flags to set"
#. Placeholder in --gdk-no-debug=FLAGS in --help output
#. Placeholder in --gtk-debug=FLAGS in --help output
#. Placeholder in --gtk-no-debug=FLAGS in --help output
-#: ../gdk/gdk.c:166 ../gdk/gdk.c:169 ../gtk/gtkmain.c:534 ../gtk/gtkmain.c:537
+#: ../gdk/gdk.c:177 ../gdk/gdk.c:180 ../gtk/gtkmain.c:523 ../gtk/gtkmain.c:526
msgid "FLAGS"
msgstr "FLAGS"
#. Description of --gdk-no-debug=FLAGS in --help output
-#: ../gdk/gdk.c:168
+#: ../gdk/gdk.c:179
msgid "GDK debugging flags to unset"
msgstr "GDK debugging flags to unset"
@@ -305,17 +305,17 @@ msgstr "Size of the palette in 8 bit mode"
msgid "COLORS"
msgstr "COLORS"
-#: ../gdk/x11/gdkapplaunchcontext-x11.c:312
+#: ../gdk/x11/gdkapplaunchcontext-x11.c:305
#, c-format
msgid "Starting %s"
msgstr "מתחיל את %s"
-#: ../gdk/x11/gdkapplaunchcontext-x11.c:316
+#: ../gdk/x11/gdkapplaunchcontext-x11.c:318
#, c-format
msgid "Opening %s"
msgstr "פותח את %s"
-#: ../gdk/x11/gdkapplaunchcontext-x11.c:321
+#: ../gdk/x11/gdkapplaunchcontext-x11.c:323
#, c-format
msgid "Opening %d Item"
msgid_plural "Opening %d Items"
@@ -335,7 +335,7 @@ msgstr "Make X calls synchronous"
msgid "This program comes with ABSOLUTELY NO WARRANTY; for details, visit %s"
msgstr "תכנית זו מופצת ללא שום אחריות; לפרטים נא לבקר בכתובת %s"
-#: ../gtk/gtkaboutdialog.c:339 ../gtk/gtkaboutdialog.c:2232
+#: ../gtk/gtkaboutdialog.c:339 ../gtk/gtkaboutdialog.c:2233
msgid "License"
msgstr "רישיון"
@@ -344,41 +344,41 @@ msgid "The license of the program"
msgstr "רישיון השימוש בתוכנה"
#. Add the credits button
-#: ../gtk/gtkaboutdialog.c:621
+#: ../gtk/gtkaboutdialog.c:622
msgid "C_redits"
msgstr "_תודות"
#. Add the license button
-#: ../gtk/gtkaboutdialog.c:635
+#: ../gtk/gtkaboutdialog.c:636
msgid "_License"
msgstr "_רישיון"
-#: ../gtk/gtkaboutdialog.c:839
+#: ../gtk/gtkaboutdialog.c:840
msgid "Could not show link"
msgstr "לא ניתן להציג את הקישור"
-#: ../gtk/gtkaboutdialog.c:932
+#: ../gtk/gtkaboutdialog.c:933
#, c-format
msgid "About %s"
msgstr "על אודות %s"
-#: ../gtk/gtkaboutdialog.c:2150
+#: ../gtk/gtkaboutdialog.c:2151
msgid "Credits"
msgstr "תודות"
-#: ../gtk/gtkaboutdialog.c:2182
+#: ../gtk/gtkaboutdialog.c:2183
msgid "Written by"
msgstr "נכתב על ידי"
-#: ../gtk/gtkaboutdialog.c:2185
+#: ../gtk/gtkaboutdialog.c:2186
msgid "Documented by"
msgstr "תועד על ידי"
-#: ../gtk/gtkaboutdialog.c:2197
+#: ../gtk/gtkaboutdialog.c:2198
msgid "Translated by"
msgstr "תורגם על ידי"
-#: ../gtk/gtkaboutdialog.c:2201
+#: ../gtk/gtkaboutdialog.c:2202
msgid "Artwork by"
msgstr "אומנות על ידי"
@@ -482,7 +482,7 @@ msgstr "תגית בלתי מטופלת: '%s'"
#. * text direction of RTL and specify "calendar:YM", then the year
#. * will appear to the right of the month.
#.
-#: ../gtk/gtkcalendar.c:883
+#: ../gtk/gtkcalendar.c:878
msgid "calendar:MY"
msgstr "calendar:YM"
@@ -490,7 +490,7 @@ msgstr "calendar:YM"
#. * first day of the week to calendar:week_start:1 if you want Monday
#. * to be the first day of the week, and so on.
#.
-#: ../gtk/gtkcalendar.c:921
+#: ../gtk/gtkcalendar.c:916
msgid "calendar:week_start:0"
msgstr "calendar:week_start:0"
@@ -499,7 +499,7 @@ msgstr "calendar:week_start:0"
#. *
#. * If you don't understand this, leave it as "2000"
#.
-#: ../gtk/gtkcalendar.c:2006
+#: ../gtk/gtkcalendar.c:1848
msgctxt "year measurement template"
msgid "2000"
msgstr "2000"
@@ -514,7 +514,7 @@ msgstr "2000"
#. * digits. That needs support from your system and locale definition
#. * too.
#.
-#: ../gtk/gtkcalendar.c:2037 ../gtk/gtkcalendar.c:2719
+#: ../gtk/gtkcalendar.c:1879 ../gtk/gtkcalendar.c:2564
#, c-format
msgctxt "calendar:day:digits"
msgid "%d"
@@ -530,7 +530,7 @@ msgstr "%d"
#. * digits. That needs support from your system and locale definition
#. * too.
#.
-#: ../gtk/gtkcalendar.c:2069 ../gtk/gtkcalendar.c:2579
+#: ../gtk/gtkcalendar.c:1911 ../gtk/gtkcalendar.c:2432
#, c-format
msgctxt "calendar:week:digits"
msgid "%d"
@@ -546,7 +546,7 @@ msgstr "%d"
#. *
#. * "%Y" is appropriate for most locales.
#.
-#: ../gtk/gtkcalendar.c:2361
+#: ../gtk/gtkcalendar.c:2197
msgctxt "calendar year format"
msgid "%Y"
msgstr "%Y"
@@ -582,15 +582,15 @@ msgctxt "progress bar label"
msgid "%d %%"
msgstr "%d %%"
-#: ../gtk/gtkcolorbutton.c:175 ../gtk/gtkcolorbutton.c:460
+#: ../gtk/gtkcolorbutton.c:188 ../gtk/gtkcolorbutton.c:473
msgid "Pick a Color"
msgstr "בחירת צבע"
-#: ../gtk/gtkcolorbutton.c:350
+#: ../gtk/gtkcolorbutton.c:363
msgid "Received invalid color data\n"
msgstr "התקבלו נתוני צבע בלתי תקינים\n"
-#: ../gtk/gtkcolorsel.c:395
+#: ../gtk/gtkcolorsel.c:416
msgid ""
"Select the color you want from the outer ring. Select the darkness or "
"lightness of that color using the inner triangle."
@@ -598,73 +598,73 @@ msgstr ""
"יש לבחור את הצבע הרצוי מהטבעת החיצונית. ניתן לבחור כמה כהה או בהיר יהיה צבע "
"זה בעזרת המשולש הפנימי."
-#: ../gtk/gtkcolorsel.c:419
+#: ../gtk/gtkcolorsel.c:440
msgid ""
"Click the eyedropper, then click a color anywhere on your screen to select "
"that color."
msgstr "יש ללחוץ על הטפטפת ואז ללחוץ על צבע כלשהו במסך לבחירת אותו הצבע."
-#: ../gtk/gtkcolorsel.c:428
+#: ../gtk/gtkcolorsel.c:449
msgid "_Hue:"
msgstr "_גוון:"
-#: ../gtk/gtkcolorsel.c:429
+#: ../gtk/gtkcolorsel.c:450
msgid "Position on the color wheel."
msgstr "מיקום על גלגל הצבעים."
-#: ../gtk/gtkcolorsel.c:431
+#: ../gtk/gtkcolorsel.c:452
msgid "_Saturation:"
msgstr "_רוויה:"
-#: ../gtk/gtkcolorsel.c:432
+#: ../gtk/gtkcolorsel.c:453
msgid "Intensity of the color."
msgstr "חוזק הצבע."
-#: ../gtk/gtkcolorsel.c:433
+#: ../gtk/gtkcolorsel.c:454
msgid "_Value:"
msgstr "_ערך:"
-#: ../gtk/gtkcolorsel.c:434
+#: ../gtk/gtkcolorsel.c:455
msgid "Brightness of the color."
msgstr "בהירות הצבע."
-#: ../gtk/gtkcolorsel.c:435
+#: ../gtk/gtkcolorsel.c:456
msgid "_Red:"
msgstr "_אדום:"
-#: ../gtk/gtkcolorsel.c:436
+#: ../gtk/gtkcolorsel.c:457
msgid "Amount of red light in the color."
msgstr "כמות האור האדום בצבע."
-#: ../gtk/gtkcolorsel.c:437
+#: ../gtk/gtkcolorsel.c:458
msgid "_Green:"
msgstr "_ירוק:"
-#: ../gtk/gtkcolorsel.c:438
+#: ../gtk/gtkcolorsel.c:459
msgid "Amount of green light in the color."
msgstr "כמות האור הירוק בצבע."
-#: ../gtk/gtkcolorsel.c:439
+#: ../gtk/gtkcolorsel.c:460
msgid "_Blue:"
msgstr "_כחול:"
-#: ../gtk/gtkcolorsel.c:440
+#: ../gtk/gtkcolorsel.c:461
msgid "Amount of blue light in the color."
msgstr "כמות האור הכחול בצבע."
-#: ../gtk/gtkcolorsel.c:443
+#: ../gtk/gtkcolorsel.c:464
msgid "Op_acity:"
msgstr "_אטימות:"
-#: ../gtk/gtkcolorsel.c:450 ../gtk/gtkcolorsel.c:460
+#: ../gtk/gtkcolorsel.c:471 ../gtk/gtkcolorsel.c:481
msgid "Transparency of the color."
msgstr "אטימות הצבע."
-#: ../gtk/gtkcolorsel.c:467
+#: ../gtk/gtkcolorsel.c:488
msgid "Color _name:"
msgstr "_שם הצבע:"
-#: ../gtk/gtkcolorsel.c:481
+#: ../gtk/gtkcolorsel.c:502
msgid ""
"You can enter an HTML-style hexadecimal color value, or simply a color name "
"such as 'orange' in this entry."
@@ -672,15 +672,15 @@ msgstr ""
"ניתן להזין ערך צבע הקסדצימלי בסגנון HTML, או פשוט לכתוב שם צבע באנגלית כמו "
"'orange' ברשומה זו."
-#: ../gtk/gtkcolorsel.c:511
+#: ../gtk/gtkcolorsel.c:532
msgid "_Palette:"
msgstr "_פלטה:"
-#: ../gtk/gtkcolorsel.c:540
+#: ../gtk/gtkcolorsel.c:561
msgid "Color Wheel"
msgstr "גלגל הצבעים"
-#: ../gtk/gtkcolorsel.c:1010
+#: ../gtk/gtkcolorsel.c:1031
msgid ""
"The previously-selected color, for comparison to the color you're selecting "
"now. You can drag this color to a palette entry, or select this color as "
@@ -689,27 +689,27 @@ msgstr ""
"הצבע הקודם שנבחר, להשוואה עם הצבע הנבחר כעת. ניתן לגרור צבע זה לרשומה בפלטה, "
"או לבחור צבע זה כנוכחי על־ידי גרירתו לפיסת הצבע השנייה שלצידו."
-#: ../gtk/gtkcolorsel.c:1013
+#: ../gtk/gtkcolorsel.c:1034
msgid ""
"The color you've chosen. You can drag this color to a palette entry to save "
"it for use in the future."
msgstr "הצבע שנבחר. ניתן לגרור צבע זה לרשומת פלטה כדי לשמור אותו לשימוש בעתיד."
-#: ../gtk/gtkcolorsel.c:1018
+#: ../gtk/gtkcolorsel.c:1039
msgid ""
"The previously-selected color, for comparison to the color you're selecting "
"now."
msgstr "הצבע הקודם שנבחר, להשוואה עם הצבע שנבחר כעת."
-#: ../gtk/gtkcolorsel.c:1021
+#: ../gtk/gtkcolorsel.c:1042
msgid "The color you've chosen."
msgstr "הצבע שנבחר."
-#: ../gtk/gtkcolorsel.c:1421
+#: ../gtk/gtkcolorsel.c:1442
msgid "_Save color here"
msgstr "_שמירת הצבע כאן"
-#: ../gtk/gtkcolorsel.c:1626
+#: ../gtk/gtkcolorsel.c:1647
msgid ""
"Click this palette entry to make it the current color. To change this entry, "
"drag a color swatch here or right-click it and select \"Save color here.\""
@@ -785,23 +785,23 @@ msgstr "_ימין:"
msgid "Paper Margins"
msgstr "שולי נייר"
-#: ../gtk/gtkentry.c:8565 ../gtk/gtktextview.c:8158
+#: ../gtk/gtkentry.c:8794 ../gtk/gtktextview.c:8229
msgid "Input _Methods"
msgstr "_שיטות קלט"
-#: ../gtk/gtkentry.c:8579 ../gtk/gtktextview.c:8172
+#: ../gtk/gtkentry.c:8808 ../gtk/gtktextview.c:8243
msgid "_Insert Unicode Control Character"
msgstr "_הזנת תו בקרה יוניקוד"
-#: ../gtk/gtkentry.c:9979
+#: ../gtk/gtkentry.c:10208
msgid "Caps Lock and Num Lock are on"
msgstr "ה־Caps Lock וה־Num Lock פעילים"
-#: ../gtk/gtkentry.c:9981
+#: ../gtk/gtkentry.c:10210
msgid "Num Lock is on"
msgstr "ה־Num Lock פעיל"
-#: ../gtk/gtkentry.c:9983
+#: ../gtk/gtkentry.c:10212
msgid "Caps Lock is on"
msgstr "ה־Caps Lock פעיל"
@@ -820,7 +820,7 @@ msgstr "שולחן עבודה"
msgid "(None)"
msgstr "(ללא)"
-#: ../gtk/gtkfilechooserbutton.c:1997
+#: ../gtk/gtkfilechooserbutton.c:2001
msgid "Other..."
msgstr "אחר..."
@@ -880,228 +880,228 @@ msgstr "‏%1$s ב־%2$s"
msgid "Search"
msgstr "חיפוש"
-#: ../gtk/gtkfilechooserdefault.c:1776 ../gtk/gtkfilechooserdefault.c:9382
+#: ../gtk/gtkfilechooserdefault.c:1776 ../gtk/gtkfilechooserdefault.c:9417
msgid "Recently Used"
msgstr "בשימוש לאחרונה"
-#: ../gtk/gtkfilechooserdefault.c:2430
+#: ../gtk/gtkfilechooserdefault.c:2437
msgid "Select which types of files are shown"
msgstr "בחירה בסוגי הקבצים שיוצגו"
-#: ../gtk/gtkfilechooserdefault.c:2789
+#: ../gtk/gtkfilechooserdefault.c:2796
#, c-format
msgid "Add the folder '%s' to the bookmarks"
msgstr "הוסף את התיקייה '%s' לסימניות"
-#: ../gtk/gtkfilechooserdefault.c:2833
+#: ../gtk/gtkfilechooserdefault.c:2840
#, c-format
msgid "Add the current folder to the bookmarks"
msgstr "הוסף את התיקייה הנוכחית לסימניות"
-#: ../gtk/gtkfilechooserdefault.c:2835
+#: ../gtk/gtkfilechooserdefault.c:2842
#, c-format
msgid "Add the selected folders to the bookmarks"
msgstr "הוסף את התיקיות הנבחרות לסימניות"
-#: ../gtk/gtkfilechooserdefault.c:2873
+#: ../gtk/gtkfilechooserdefault.c:2880
#, c-format
msgid "Remove the bookmark '%s'"
msgstr "הסרת הסימנייה '%s'"
-#: ../gtk/gtkfilechooserdefault.c:2875
+#: ../gtk/gtkfilechooserdefault.c:2882
#, c-format
msgid "Bookmark '%s' cannot be removed"
msgstr "לא ניתן להסיר את הסימנייה '%s'"
-#: ../gtk/gtkfilechooserdefault.c:2882 ../gtk/gtkfilechooserdefault.c:3746
+#: ../gtk/gtkfilechooserdefault.c:2889 ../gtk/gtkfilechooserdefault.c:3750
msgid "Remove the selected bookmark"
msgstr "הסרת הסימנייה הנבחרת"
-#: ../gtk/gtkfilechooserdefault.c:3442
+#: ../gtk/gtkfilechooserdefault.c:3445
msgid "Remove"
msgstr "הסרה"
-#: ../gtk/gtkfilechooserdefault.c:3451
+#: ../gtk/gtkfilechooserdefault.c:3454
msgid "Rename..."
msgstr "שינוי שם..."
#. Accessible object name for the file chooser's shortcuts pane
-#: ../gtk/gtkfilechooserdefault.c:3614
+#: ../gtk/gtkfilechooserdefault.c:3617
msgid "Places"
msgstr "מקומות"
#. Column header for the file chooser's shortcuts pane
-#: ../gtk/gtkfilechooserdefault.c:3671
+#: ../gtk/gtkfilechooserdefault.c:3674
msgid "_Places"
msgstr "_מקומות"
-#: ../gtk/gtkfilechooserdefault.c:3727
+#: ../gtk/gtkfilechooserdefault.c:3731
msgid "_Add"
msgstr "_הוספה"
-#: ../gtk/gtkfilechooserdefault.c:3734
+#: ../gtk/gtkfilechooserdefault.c:3738
msgid "Add the selected folder to the Bookmarks"
msgstr "הוספת התיקייה הנבחרת לסימניות"
-#: ../gtk/gtkfilechooserdefault.c:3739
+#: ../gtk/gtkfilechooserdefault.c:3743
msgid "_Remove"
msgstr "_הסרה"
-#: ../gtk/gtkfilechooserdefault.c:3881
+#: ../gtk/gtkfilechooserdefault.c:3885
msgid "Could not select file"
msgstr "לא ניתן לבחור את הקובץ"
-#: ../gtk/gtkfilechooserdefault.c:4056
+#: ../gtk/gtkfilechooserdefault.c:4060
msgid "_Add to Bookmarks"
msgstr "_הוספה לסימניות"
-#: ../gtk/gtkfilechooserdefault.c:4069
+#: ../gtk/gtkfilechooserdefault.c:4073
msgid "Show _Hidden Files"
msgstr "הצגת קבצים _נסתרים"
-#: ../gtk/gtkfilechooserdefault.c:4076
+#: ../gtk/gtkfilechooserdefault.c:4080
msgid "Show _Size Column"
msgstr "הצגת _רוחב העמודה"
# hebrew note: "תיקייה" is "folder", but there is no better word for
# "directory"
-#: ../gtk/gtkfilechooserdefault.c:4302
+#: ../gtk/gtkfilechooserdefault.c:4306
msgid "Files"
msgstr "קבצים"
-#: ../gtk/gtkfilechooserdefault.c:4353
+#: ../gtk/gtkfilechooserdefault.c:4357
msgid "Name"
msgstr "שם"
-#: ../gtk/gtkfilechooserdefault.c:4376
+#: ../gtk/gtkfilechooserdefault.c:4380
msgid "Size"
msgstr "גודל"
-#: ../gtk/gtkfilechooserdefault.c:4390
+#: ../gtk/gtkfilechooserdefault.c:4394
msgid "Modified"
msgstr "שונה"
#. Label
-#: ../gtk/gtkfilechooserdefault.c:4645 ../gtk/gtkprinteroptionwidget.c:793
+#: ../gtk/gtkfilechooserdefault.c:4649 ../gtk/gtkprinteroptionwidget.c:793
msgid "_Name:"
msgstr "_שם:"
-#: ../gtk/gtkfilechooserdefault.c:4688
+#: ../gtk/gtkfilechooserdefault.c:4692
msgid "_Browse for other folders"
msgstr "_דפדוף לתיקיות אחרות"
-#: ../gtk/gtkfilechooserdefault.c:4958
+#: ../gtk/gtkfilechooserdefault.c:4962
msgid "Type a file name"
msgstr "הזנת שם קובץ"
#. Create Folder
-#: ../gtk/gtkfilechooserdefault.c:5001
+#: ../gtk/gtkfilechooserdefault.c:5005
msgid "Create Fo_lder"
msgstr "יצירת _תיקייה"
-#: ../gtk/gtkfilechooserdefault.c:5011
+#: ../gtk/gtkfilechooserdefault.c:5015
msgid "_Location:"
msgstr "_מיקום:"
-#: ../gtk/gtkfilechooserdefault.c:5215
+#: ../gtk/gtkfilechooserdefault.c:5219
msgid "Save in _folder:"
msgstr "שמירה ב_תיקייה:"
-#: ../gtk/gtkfilechooserdefault.c:5217
+#: ../gtk/gtkfilechooserdefault.c:5221
msgid "Create in _folder:"
msgstr "יצירה ב_תיקייה:"
-#: ../gtk/gtkfilechooserdefault.c:6286
+#: ../gtk/gtkfilechooserdefault.c:6290
#, c-format
msgid "Could not read the contents of %s"
msgstr "לא ניתן לקרוא את התוכן של %s"
-#: ../gtk/gtkfilechooserdefault.c:6290
+#: ../gtk/gtkfilechooserdefault.c:6294
msgid "Could not read the contents of the folder"
msgstr "לא ניתן לקרוא את תכני התיקייה"
-#: ../gtk/gtkfilechooserdefault.c:6383 ../gtk/gtkfilechooserdefault.c:6451
-#: ../gtk/gtkfilechooserdefault.c:6596
+#: ../gtk/gtkfilechooserdefault.c:6387 ../gtk/gtkfilechooserdefault.c:6455
+#: ../gtk/gtkfilechooserdefault.c:6600
msgid "Unknown"
msgstr "לא ידוע"
-#: ../gtk/gtkfilechooserdefault.c:6398
+#: ../gtk/gtkfilechooserdefault.c:6402
msgid "%H:%M"
msgstr "%H:%M"
-#: ../gtk/gtkfilechooserdefault.c:6400
+#: ../gtk/gtkfilechooserdefault.c:6404
msgid "Yesterday at %H:%M"
msgstr "אתמול ב־%H:%M"
-#: ../gtk/gtkfilechooserdefault.c:7066
+#: ../gtk/gtkfilechooserdefault.c:7070
msgid "Cannot change to folder because it is not local"
msgstr "לא ניתן לשנות תיקייה כיוון שהיא איננה מקומית"
-#: ../gtk/gtkfilechooserdefault.c:7663 ../gtk/gtkfilechooserdefault.c:7684
+#: ../gtk/gtkfilechooserdefault.c:7667 ../gtk/gtkfilechooserdefault.c:7688
#, c-format
msgid "Shortcut %s already exists"
msgstr "הקיצור %s כבר קיים"
-#: ../gtk/gtkfilechooserdefault.c:7774
+#: ../gtk/gtkfilechooserdefault.c:7778
#, c-format
msgid "Shortcut %s does not exist"
msgstr "הקיצור %s אינו קיים"
-#: ../gtk/gtkfilechooserdefault.c:8035 ../gtk/gtkprintunixdialog.c:480
+#: ../gtk/gtkfilechooserdefault.c:8039 ../gtk/gtkprintunixdialog.c:480
#, c-format
msgid "A file named \"%s\" already exists. Do you want to replace it?"
msgstr "קובץ בשם \"%s\" כבר קיים. האם ברצונך להחליפו?"
-#: ../gtk/gtkfilechooserdefault.c:8038 ../gtk/gtkprintunixdialog.c:484
+#: ../gtk/gtkfilechooserdefault.c:8042 ../gtk/gtkprintunixdialog.c:484
#, c-format
msgid ""
"The file already exists in \"%s\". Replacing it will overwrite its contents."
msgstr "הקובץ כבר קיים ב-\"%s\". החלפתו תגרום לאיבוד תוכנו."
-#: ../gtk/gtkfilechooserdefault.c:8043 ../gtk/gtkprintunixdialog.c:491
+#: ../gtk/gtkfilechooserdefault.c:8047 ../gtk/gtkprintunixdialog.c:491
msgid "_Replace"
msgstr "ה_חלפה"
-#: ../gtk/gtkfilechooserdefault.c:8751
+#: ../gtk/gtkfilechooserdefault.c:8755
msgid "Could not start the search process"
msgstr "לא ניתן להתחיל את תהליך החיפוש"
-#: ../gtk/gtkfilechooserdefault.c:8752
+#: ../gtk/gtkfilechooserdefault.c:8756
msgid ""
"The program was not able to create a connection to the indexer daemon. "
"Please make sure it is running."
msgstr "התנית לא הצליחה ליצור חיבור אל סוכן האינדקס. יש לוודא כי הוא פעיל."
-#: ../gtk/gtkfilechooserdefault.c:8766
+#: ../gtk/gtkfilechooserdefault.c:8770
msgid "Could not send the search request"
msgstr "לא ניתן לשלוח את בקשת החיפוש"
-#: ../gtk/gtkfilechooserdefault.c:8954
+#: ../gtk/gtkfilechooserdefault.c:8989
msgid "Search:"
msgstr "חיפוש:"
-#: ../gtk/gtkfilechooserdefault.c:9559
+#: ../gtk/gtkfilechooserdefault.c:9594
#, c-format
msgid "Could not mount %s"
msgstr "לא ניתן לעגון את %s"
#. Translators: this is shown in the feedback for Tab-completion in a file
#. * chooser's text entry, when the user enters an invalid path.
-#: ../gtk/gtkfilechooserentry.c:702 ../gtk/gtkfilechooserentry.c:1169
+#: ../gtk/gtkfilechooserentry.c:702 ../gtk/gtkfilechooserentry.c:1172
msgid "Invalid path"
msgstr "נתיב לא תקין"
#. translators: this text is shown when there are no completions
#. * for something the user typed in a file chooser entry
#.
-#: ../gtk/gtkfilechooserentry.c:1101
+#: ../gtk/gtkfilechooserentry.c:1104
msgid "No match"
msgstr "אין התאמה"
#. translators: this text is shown when there is exactly one completion
#. * for something the user typed in a file chooser entry
#.
-#: ../gtk/gtkfilechooserentry.c:1112
+#: ../gtk/gtkfilechooserentry.c:1115
msgid "Sole completion"
msgstr "השלמה יחידה"
@@ -1109,13 +1109,13 @@ msgstr "השלמה יחידה"
#. * entry is a complete filename, but could be continued to find
#. * a longer match
#.
-#: ../gtk/gtkfilechooserentry.c:1128
+#: ../gtk/gtkfilechooserentry.c:1131
msgid "Complete, but not unique"
msgstr "שלם, אבל לא ייחודי"
#. Translators: this text is shown while the system is searching
#. * for possible completions for filenames in a file chooser entry.
-#: ../gtk/gtkfilechooserentry.c:1160
+#: ../gtk/gtkfilechooserentry.c:1163
msgid "Completing..."
msgstr "משלים..."
@@ -1123,7 +1123,7 @@ msgstr "משלים..."
#. Translators: this is shown in the feedback for Tab-completion in a
#. * file chooser's text entry when the user enters something like
#. * "sftp://blahblah" in an app that only supports local filenames.
-#: ../gtk/gtkfilechooserentry.c:1182 ../gtk/gtkfilechooserentry.c:1207
+#: ../gtk/gtkfilechooserentry.c:1185 ../gtk/gtkfilechooserentry.c:1210
msgid "Only local files may be selected"
msgstr "ניתן לבחור קבצים מקומיים בלבד"
@@ -1131,14 +1131,14 @@ msgstr "ניתן לבחור קבצים מקומיים בלבד"
#. Translators: this is shown in the feedback for Tab-completion in a
#. * file chooser's text entry when the user hasn't entered the first '/'
#. * after a hostname and yet hits Tab (such as "sftp://blahblah[Tab]")
-#: ../gtk/gtkfilechooserentry.c:1191
+#: ../gtk/gtkfilechooserentry.c:1194
msgid "Incomplete hostname; end it with '/'"
msgstr "שם המארח אינו מלא; יש לסיימו ב־'/'"
#. Translators: this is shown in the feedback for Tab-completion in a file
#. * chooser's text entry when the user enters a path that does not exist
#. * and then hits Tab
-#: ../gtk/gtkfilechooserentry.c:1202
+#: ../gtk/gtkfilechooserentry.c:1205
msgid "Path does not exist"
msgstr "נתיב לא קיים"
@@ -1185,11 +1185,11 @@ msgid "Si_ze:"
msgstr "_גודל:"
#. create the text entry widget
-#: ../gtk/gtkfontsel.c:559
+#: ../gtk/gtkfontsel.c:558
msgid "_Preview:"
msgstr "_תצוגה מקדימה:"
-#: ../gtk/gtkfontsel.c:1659
+#: ../gtk/gtkfontsel.c:1658
msgid "Font Selection"
msgstr "בחירת גופן"
@@ -1201,7 +1201,7 @@ msgstr "בחירת גופן"
msgid "Error loading icon: %s"
msgstr "שגיאה בטעינת סמל: %s"
-#: ../gtk/gtkicontheme.c:1354
+#: ../gtk/gtkicontheme.c:1355
#, c-format
msgid ""
"Could not find the icon '%s'. The '%s' theme\n"
@@ -1214,12 +1214,12 @@ msgstr ""
"אתה יכול לקבל עותק מ:\n"
"\t%s"
-#: ../gtk/gtkicontheme.c:1535
+#: ../gtk/gtkicontheme.c:1536
#, c-format
msgid "Icon '%s' not present in theme"
msgstr "הסמל '%s' לא קיים בערכת הנושא"
-#: ../gtk/gtkicontheme.c:3048
+#: ../gtk/gtkicontheme.c:3057
msgid "Failed to load icon"
msgstr "ארע כשל בטעינת סמל"
@@ -1246,12 +1246,12 @@ msgid "System (%s)"
msgstr "מערכת (%s)"
#. Open Link
-#: ../gtk/gtklabel.c:6196
+#: ../gtk/gtklabel.c:6215
msgid "_Open Link"
msgstr "_פתיחת קישור"
#. Copy Link Address
-#: ../gtk/gtklabel.c:6208
+#: ../gtk/gtklabel.c:6227
msgid "Copy _Link Address"
msgstr "העתקת כתובת ה_קישור"
@@ -1264,27 +1264,27 @@ msgid "Invalid URI"
msgstr "כתובת לא תקנית"
#. Description of --gtk-module=MODULES in --help output
-#: ../gtk/gtkmain.c:527
+#: ../gtk/gtkmain.c:516
msgid "Load additional GTK+ modules"
msgstr "Load additional GTK+ modules"
#. Placeholder in --gtk-module=MODULES in --help output
-#: ../gtk/gtkmain.c:528
+#: ../gtk/gtkmain.c:517
msgid "MODULES"
msgstr "MODULES"
#. Description of --g-fatal-warnings in --help output
-#: ../gtk/gtkmain.c:530
+#: ../gtk/gtkmain.c:519
msgid "Make all warnings fatal"
msgstr "Make all warnings fatal"
#. Description of --gtk-debug=FLAGS in --help output
-#: ../gtk/gtkmain.c:533
+#: ../gtk/gtkmain.c:522
msgid "GTK+ debugging flags to set"
msgstr "GTK+ debugging flags to set"
#. Description of --gtk-no-debug=FLAGS in --help output
-#: ../gtk/gtkmain.c:536
+#: ../gtk/gtkmain.c:525
msgid "GTK+ debugging flags to unset"
msgstr "GTK+ debugging flags to unset"
@@ -1293,20 +1293,20 @@ msgstr "GTK+ debugging flags to unset"
#. * Do *not* translate it to "predefinito:LTR", if it
#. * it isn't default:LTR or default:RTL it will not work
#.
-#: ../gtk/gtkmain.c:799
+#: ../gtk/gtkmain.c:788
msgid "default:LTR"
msgstr "default:RTL"
-#: ../gtk/gtkmain.c:864
+#: ../gtk/gtkmain.c:853
#, c-format
msgid "Cannot open display: %s"
msgstr "Cannot open display: %s"
-#: ../gtk/gtkmain.c:923
+#: ../gtk/gtkmain.c:912
msgid "GTK+ Options"
msgstr "GTK+ Options"
-#: ../gtk/gtkmain.c:923
+#: ../gtk/gtkmain.c:912
msgid "Show GTK+ Options"
msgstr "Show GTK+ Options"
@@ -1390,12 +1390,12 @@ msgstr "מעטפת Z"
msgid "Cannot end process with PID %d: %s"
msgstr "לא ניתן לסיים את התהליך בעל המזהה %d: ‏%s"
-#: ../gtk/gtknotebook.c:4724 ../gtk/gtknotebook.c:7287
+#: ../gtk/gtknotebook.c:4756 ../gtk/gtknotebook.c:7319
#, c-format
msgid "Page %u"
msgstr "עמוד %u"
-#: ../gtk/gtkpagesetup.c:596 ../gtk/gtkpapersize.c:838
+#: ../gtk/gtkpagesetup.c:648 ../gtk/gtkpapersize.c:838
#: ../gtk/gtkpapersize.c:880
msgid "Not a valid page setup file"
msgstr "קובץ הגדרות עמוד לא תקין"
@@ -1443,17 +1443,17 @@ msgstr "_כיווניות:"
msgid "Page Setup"
msgstr "הגדרות עמוד"
-#: ../gtk/gtkpathbar.c:154
+#: ../gtk/gtkpathbar.c:158
msgid "Up Path"
msgstr "נתיב מעלה"
-#: ../gtk/gtkpathbar.c:156
+#: ../gtk/gtkpathbar.c:160
msgid "Down Path"
msgstr "נתיב מטה"
# hebrew note: "תיקייה" is "folder", but there is no better word for
# "directory"
-#: ../gtk/gtkpathbar.c:1490
+#: ../gtk/gtkpathbar.c:1523
msgid "File System Root"
msgstr "שורש מערכת הקבצים"
@@ -2049,12 +2049,12 @@ msgstr "לא ניתן למצוא פריט עם כתובת '%s'"
msgid "No registered application with name '%s' for item with URI '%s' found"
msgstr "לא נמצא יישום הרשום בשם '%s' עבור הפריט בעל הכתובת '%s'"
-#: ../gtk/gtkspinner.c:456
+#: ../gtk/gtkspinner.c:439
msgctxt "throbbing progress animation widget"
msgid "Spinner"
msgstr "הנפשת המתנה"
-#: ../gtk/gtkspinner.c:457
+#: ../gtk/gtkspinner.c:440
msgid "Provides visual indication of progress"
msgstr "אספקת חיווי חזותי של התהליך"
@@ -2567,6 +2567,32 @@ msgctxt "Stock label"
msgid "Zoom _Out"
msgstr "הת_רחקות"
+#. Translators: if the "on" state label requires more than three
+#. * glyphs then use MEDIUM VERTICAL BAR (U+2759) as the text for
+#. * the state
+#.
+#: ../gtk/gtkswitch.c:296 ../gtk/gtkswitch.c:339 ../gtk/gtkswitch.c:531
+msgctxt "switch"
+msgid "ON"
+msgstr "❙"
+
+#. Translators: if the "off" state label requires more than three
+#. * glyphs then use WHITE CIRCLE (U+25CB) as the text for the state
+#.
+#: ../gtk/gtkswitch.c:304 ../gtk/gtkswitch.c:340 ../gtk/gtkswitch.c:552
+msgctxt "switch"
+msgid "OFF"
+msgstr "○"
+
+#: ../gtk/gtkswitch.c:943
+msgctxt "light switch widget"
+msgid "Switch"
+msgstr "החלפה"
+
+#: ../gtk/gtkswitch.c:944
+msgid "Switches between on and off states"
+msgstr "החלפה בין המצבים פעיל ולא פעיל"
+
#: ../gtk/gtktextbufferrichtext.c:650
#, c-format
msgid "Unknown error when trying to deserialize %s"
@@ -2577,107 +2603,107 @@ msgstr "Unknown error when trying to deserialize %s"
msgid "No deserialize function found for format %s"
msgstr "No deserialize function found for format %s"
-#: ../gtk/gtktextbufferserialize.c:795 ../gtk/gtktextbufferserialize.c:821
+#: ../gtk/gtktextbufferserialize.c:799 ../gtk/gtktextbufferserialize.c:825
#, c-format
msgid "Both \"id\" and \"name\" were found on the <%s> element"
msgstr "Both \"id\" and \"name\" were found on the <%s> element"
-#: ../gtk/gtktextbufferserialize.c:805 ../gtk/gtktextbufferserialize.c:831
+#: ../gtk/gtktextbufferserialize.c:809 ../gtk/gtktextbufferserialize.c:835
#, c-format
msgid "The attribute \"%s\" was found twice on the <%s> element"
msgstr "The attribute \"%s\" was found twice on the <%s> element"
-#: ../gtk/gtktextbufferserialize.c:845
+#: ../gtk/gtktextbufferserialize.c:851
#, c-format
msgid "<%s> element has invalid ID \"%s\""
msgstr "<%s> element has invalid ID \"%s\""
-#: ../gtk/gtktextbufferserialize.c:855
+#: ../gtk/gtktextbufferserialize.c:861
#, c-format
msgid "<%s> element has neither a \"name\" nor an \"id\" attribute"
msgstr "<%s> element has neither a \"name\" nor an \"id\" attribute"
-#: ../gtk/gtktextbufferserialize.c:942
+#: ../gtk/gtktextbufferserialize.c:948
#, c-format
msgid "Attribute \"%s\" repeated twice on the same <%s> element"
msgstr "Attribute \"%s\" repeated twice on the same <%s> element"
-#: ../gtk/gtktextbufferserialize.c:960 ../gtk/gtktextbufferserialize.c:985
+#: ../gtk/gtktextbufferserialize.c:966 ../gtk/gtktextbufferserialize.c:991
#, c-format
msgid "Attribute \"%s\" is invalid on <%s> element in this context"
msgstr "Attribute \"%s\" is invalid on <%s> element in this context"
-#: ../gtk/gtktextbufferserialize.c:1024
+#: ../gtk/gtktextbufferserialize.c:1030
#, c-format
msgid "Tag \"%s\" has not been defined."
msgstr "Tag \"%s\" has not been defined."
-#: ../gtk/gtktextbufferserialize.c:1036
+#: ../gtk/gtktextbufferserialize.c:1042
msgid "Anonymous tag found and tags can not be created."
msgstr "Anonymous tag found and tags can not be created."
-#: ../gtk/gtktextbufferserialize.c:1047
+#: ../gtk/gtktextbufferserialize.c:1053
#, c-format
msgid "Tag \"%s\" does not exist in buffer and tags can not be created."
msgstr "Tag \"%s\" does not exist in buffer and tags can not be created."
-#: ../gtk/gtktextbufferserialize.c:1146 ../gtk/gtktextbufferserialize.c:1221
-#: ../gtk/gtktextbufferserialize.c:1324 ../gtk/gtktextbufferserialize.c:1398
+#: ../gtk/gtktextbufferserialize.c:1152 ../gtk/gtktextbufferserialize.c:1227
+#: ../gtk/gtktextbufferserialize.c:1332 ../gtk/gtktextbufferserialize.c:1406
#, c-format
msgid "Element <%s> is not allowed below <%s>"
msgstr "Element <%s> is not allowed below <%s>"
-#: ../gtk/gtktextbufferserialize.c:1177
+#: ../gtk/gtktextbufferserialize.c:1183
#, c-format
msgid "\"%s\" is not a valid attribute type"
msgstr "\"%s\" is not a valid attribute type"
-#: ../gtk/gtktextbufferserialize.c:1185
+#: ../gtk/gtktextbufferserialize.c:1191
#, c-format
msgid "\"%s\" is not a valid attribute name"
msgstr "\"%s\" is not a valid attribute name"
-#: ../gtk/gtktextbufferserialize.c:1195
+#: ../gtk/gtktextbufferserialize.c:1201
#, c-format
msgid ""
"\"%s\" could not be converted to a value of type \"%s\" for attribute \"%s\""
msgstr ""
"\"%s\" could not be converted to a value of type \"%s\" for attribute \"%s\""
-#: ../gtk/gtktextbufferserialize.c:1204
+#: ../gtk/gtktextbufferserialize.c:1210
#, c-format
msgid "\"%s\" is not a valid value for attribute \"%s\""
msgstr "\"%s\" is not a valid value for attribute \"%s\""
-#: ../gtk/gtktextbufferserialize.c:1289
+#: ../gtk/gtktextbufferserialize.c:1295
#, c-format
msgid "Tag \"%s\" already defined"
msgstr "Tag \"%s\" already defined"
-#: ../gtk/gtktextbufferserialize.c:1300
+#: ../gtk/gtktextbufferserialize.c:1308
#, c-format
msgid "Tag \"%s\" has invalid priority \"%s\""
msgstr "Tag \"%s\" has invalid priority \"%s\""
-#: ../gtk/gtktextbufferserialize.c:1353
+#: ../gtk/gtktextbufferserialize.c:1361
#, c-format
msgid "Outermost element in text must be <text_view_markup> not <%s>"
msgstr "Outermost element in text must be <text_view_markup> not <%s>"
-#: ../gtk/gtktextbufferserialize.c:1362 ../gtk/gtktextbufferserialize.c:1378
+#: ../gtk/gtktextbufferserialize.c:1370 ../gtk/gtktextbufferserialize.c:1386
#, c-format
msgid "A <%s> element has already been specified"
msgstr "A <%s> element has already been specified"
-#: ../gtk/gtktextbufferserialize.c:1384
+#: ../gtk/gtktextbufferserialize.c:1392
msgid "A <text> element can't occur before a <tags> element"
msgstr "A <text> element can't occur before a <tags> element"
-#: ../gtk/gtktextbufferserialize.c:1784
+#: ../gtk/gtktextbufferserialize.c:1792
msgid "Serialized data is malformed"
msgstr "Serialized data is malformed"
-#: ../gtk/gtktextbufferserialize.c:1862
+#: ../gtk/gtktextbufferserialize.c:1870
msgid ""
"Serialized data is malformed. First section isn't GTKTEXTBUFFERCONTENTS-0001"
msgstr ""
@@ -3634,81 +3660,81 @@ msgstr "Failed to write folder index\n"
msgid "Failed to rewrite header\n"
msgstr "Failed to rewrite header\n"
-#: ../gtk/updateiconcache.c:1463
+#: ../gtk/updateiconcache.c:1488
#, c-format
msgid "Failed to open file %s : %s\n"
msgstr "Failed to open file %s : %s\n"
-#: ../gtk/updateiconcache.c:1471
+#: ../gtk/updateiconcache.c:1496 ../gtk/updateiconcache.c:1526
#, c-format
msgid "Failed to write cache file: %s\n"
msgstr "Failed to write cache file: %s\n"
-#: ../gtk/updateiconcache.c:1507
+#: ../gtk/updateiconcache.c:1537
#, c-format
msgid "The generated cache was invalid.\n"
msgstr "The generated cache was invalid.\n"
-#: ../gtk/updateiconcache.c:1521
+#: ../gtk/updateiconcache.c:1551
#, c-format
msgid "Could not rename %s to %s: %s, removing %s then.\n"
msgstr "Could not rename %s to %s: %s, removing %s then.\n"
-#: ../gtk/updateiconcache.c:1535
+#: ../gtk/updateiconcache.c:1565
#, c-format
msgid "Could not rename %s to %s: %s\n"
msgstr "Could not rename %s to %s: %s\n"
-#: ../gtk/updateiconcache.c:1545
+#: ../gtk/updateiconcache.c:1575
#, c-format
msgid "Could not rename %s back to %s: %s.\n"
msgstr "Could not rename %s back to %s: %s.\n"
-#: ../gtk/updateiconcache.c:1572
+#: ../gtk/updateiconcache.c:1602
#, c-format
msgid "Cache file created successfully.\n"
msgstr "Cache file created successfully.\n"
-#: ../gtk/updateiconcache.c:1611
+#: ../gtk/updateiconcache.c:1641
msgid "Overwrite an existing cache, even if up to date"
msgstr "Overwrite an existing cache, even if up to date"
-#: ../gtk/updateiconcache.c:1612
+#: ../gtk/updateiconcache.c:1642
msgid "Don't check for the existence of index.theme"
msgstr "Don't check for the existence of index.theme"
-#: ../gtk/updateiconcache.c:1613
+#: ../gtk/updateiconcache.c:1643
msgid "Don't include image data in the cache"
msgstr "Don't include image data in the cache"
-#: ../gtk/updateiconcache.c:1614
+#: ../gtk/updateiconcache.c:1644
msgid "Output a C header file"
msgstr "Output a C header file"
-#: ../gtk/updateiconcache.c:1615
+#: ../gtk/updateiconcache.c:1645
msgid "Turn off verbose output"
msgstr "Turn off verbose output"
-#: ../gtk/updateiconcache.c:1616
+#: ../gtk/updateiconcache.c:1646
msgid "Validate existing icon cache"
msgstr "Validate existing icon cache"
-#: ../gtk/updateiconcache.c:1683
+#: ../gtk/updateiconcache.c:1713
#, c-format
msgid "File not found: %s\n"
msgstr "File not found: %s\n"
-#: ../gtk/updateiconcache.c:1689
+#: ../gtk/updateiconcache.c:1719
#, c-format
msgid "Not a valid icon cache: %s\n"
msgstr "Not a valid icon cache: %s\n"
-#: ../gtk/updateiconcache.c:1702
+#: ../gtk/updateiconcache.c:1732
#, c-format
msgid "No theme index file.\n"
msgstr "No theme index file.\n"
-#: ../gtk/updateiconcache.c:1706
+#: ../gtk/updateiconcache.c:1736
#, c-format
msgid ""
"No theme index file in '%s'.\n"
@@ -4120,34 +4146,34 @@ msgstr "מותאם אישית %sx%s"
msgid "output.%s"
msgstr "פלט.%s"
-#: ../modules/printbackends/file/gtkprintbackendfile.c:493
+#: ../modules/printbackends/file/gtkprintbackendfile.c:501
msgid "Print to File"
msgstr "הדפסה לקובץ"
-#: ../modules/printbackends/file/gtkprintbackendfile.c:570
+#: ../modules/printbackends/file/gtkprintbackendfile.c:578
msgid "PDF"
msgstr "PDF"
-#: ../modules/printbackends/file/gtkprintbackendfile.c:570
+#: ../modules/printbackends/file/gtkprintbackendfile.c:578
msgid "Postscript"
msgstr "Postscript"
-#: ../modules/printbackends/file/gtkprintbackendfile.c:570
+#: ../modules/printbackends/file/gtkprintbackendfile.c:578
msgid "SVG"
msgstr "SVG"
-#: ../modules/printbackends/file/gtkprintbackendfile.c:582
+#: ../modules/printbackends/file/gtkprintbackendfile.c:590
#: ../modules/printbackends/test/gtkprintbackendtest.c:503
msgid "Pages per _sheet:"
msgstr "מספר העמודים ב_דף"
# hebrew note: "תיקייה" is "folder", but there is no better word for
# "directory"
-#: ../modules/printbackends/file/gtkprintbackendfile.c:641
+#: ../modules/printbackends/file/gtkprintbackendfile.c:649
msgid "File"
msgstr "קובץ"
-#: ../modules/printbackends/file/gtkprintbackendfile.c:651
+#: ../modules/printbackends/file/gtkprintbackendfile.c:659
msgid "_Output format"
msgstr "_תצורת הפלט"
diff --git a/po/sl.po b/po/sl.po
index 061aed40ee..4a15b81251 100644
--- a/po/sl.po
+++ b/po/sl.po
@@ -12,7 +12,7 @@ msgstr ""
"Project-Id-Version: gtk+ master\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gtk%2b&component=general\n"
"POT-Creation-Date: 2010-10-12 17:16+0000\n"
-"PO-Revision-Date: 2010-11-29 09:32+0100\n"
+"PO-Revision-Date: 2010-12-01 12:38+0100\n"
"Last-Translator: Andrej Žnidaršič <andrej.znidarsic@gmail.com>\n"
"Language-Team: Slovenian GNOME Translation Team <gnome-si@googlegroups.com>\n"
"Language: \n"
@@ -388,7 +388,7 @@ msgstr "Prevedli"
#: ../gtk/gtkaboutdialog.c:2201
msgid "Artwork by"
-msgstr "Grafična podobo oblikovali"
+msgstr "Grafično podobo oblikovali"
#. This is the text that should appear next to menu accelerators
#. * that use the shift key. If the text on this key isn't typically
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 283285311b..3bfd2ac397 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -99,7 +99,8 @@ noinst_PROGRAMS = $(TEST_PROGS) \
testvolumebutton \
testscrolledwindow \
testcellarea \
- testswitch
+ testswitch \
+ styleexamples
if USE_X11
noinst_PROGRAMS += testerrors
@@ -170,7 +171,6 @@ testsocket_DEPENDENCIES = $(DEPS)
testsocket_child_DEPENDENCIES = $(DEPS)
testspinbutton_DEPENDENCIES = $(TEST_DEPS)
teststatusicon_DEPENDENCIES = $(TEST_DEPS)
-#testtext_DEPENDENCIES = $(TEST_DEPS)
testtreeedit_DEPENDENCIES = $(DEPS)
testtreemodel_DEPENDENCIES = $(DEPS)
testtreeview_DEPENDENCIES = $(DEPS)
@@ -192,6 +192,7 @@ testwindows_DEPENDENCIES = $(TEST_DEPS)
testexpand_DEPENDENCIES = $(TEST_DEPS)
testexpander_DEPENDENCIES = $(TEST_DEPS)
testswitch_DEPENDENCIES = $(TEST_DEPS)
+styleexamples_DEPENDENCIES = $(TEST_DEPS)
flicker_LDADD = $(LDADDS)
simple_LDADD = $(LDADDS)
@@ -256,7 +257,6 @@ testtreeflow_LDADD = $(LDADDS)
testtreecolumns_LDADD = $(LDADDS)
testtreecolumnsizing_LDADD = $(LDADDS)
testtreesort_LDADD = $(LDADDS)
-#testtext_LDADD = $(LDADDS)
treestoretest_LDADD = $(LDADDS)
testxinerama_LDADD = $(LDADDS)
testmerge_LDADD = $(LDADDS)
@@ -270,6 +270,7 @@ testwindows_LDADD = $(LDADDS)
testexpand_LDADD = $(LDADDS)
testexpander_LDADD = $(LDADDS)
testswitch_LDADD = $(LDADDS)
+styleexamples_LDADD = $(LDADDS)
testentrycompletion_SOURCES = \
prop-editor.c \
@@ -304,10 +305,6 @@ testtreeview_SOURCES = \
prop-editor.c \
testtreeview.c
-#testtext_SOURCES = \
-# prop-editor.c \
-# testtext.c
-
testtoolbar_SOURCES = \
testtoolbar.c \
prop-editor.c
@@ -406,12 +403,13 @@ testexpand_SOURCES = testexpand.c
testexpander_SOURCES = testexpander.c
testswitch_SOURCES = testswitch.c
+styleexamples_SOURCES = styleexamples.c
EXTRA_DIST += \
prop-editor.h \
testgtk.1 \
- testgtkrc \
- testgtkrc2 \
+ testgtk.css \
+ testgtk2.css \
3DRings.xpm \
FilesQueue.xpm \
Modeller.xpm \
diff --git a/tests/gtkoffscreenbox.c b/tests/gtkoffscreenbox.c
index 01ba8ef30d..0afaa0b84d 100644
--- a/tests/gtkoffscreenbox.c
+++ b/tests/gtkoffscreenbox.c
@@ -252,7 +252,7 @@ gtk_offscreen_box_realize (GtkWidget *widget)
{
GtkOffscreenBox *offscreen_box = GTK_OFFSCREEN_BOX (widget);
GtkAllocation allocation, child_area;
- GtkStyle *style;
+ GtkStyleContext *context;
GdkWindow *window;
GdkWindowAttr attributes;
gint attributes_mask;
@@ -346,10 +346,10 @@ gtk_offscreen_box_realize (GtkWidget *widget)
G_CALLBACK (offscreen_window_from_parent2), offscreen_box);
gtk_widget_style_attach (widget);
- style = gtk_widget_get_style (widget);
- gtk_style_set_background (style, window, GTK_STATE_NORMAL);
- gtk_style_set_background (style, offscreen_box->offscreen_window1, GTK_STATE_NORMAL);
- gtk_style_set_background (style, offscreen_box->offscreen_window2, GTK_STATE_NORMAL);
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_set_background (context, window);
+ gtk_style_context_set_background (context, offscreen_box->offscreen_window1);
+ gtk_style_context_set_background (context, offscreen_box->offscreen_window2);
gdk_window_show (offscreen_box->offscreen_window1);
gdk_window_show (offscreen_box->offscreen_window2);
@@ -672,12 +672,11 @@ gtk_offscreen_box_draw (GtkWidget *widget,
}
else if (gtk_cairo_should_draw_window (cr, offscreen_box->offscreen_window1))
{
- gtk_paint_flat_box (gtk_widget_get_style (widget), cr,
- GTK_STATE_NORMAL, GTK_SHADOW_NONE,
- widget, "blah",
- 0, 0,
- gdk_window_get_width (offscreen_box->offscreen_window1),
- gdk_window_get_height (offscreen_box->offscreen_window1));
+ gtk_render_background (gtk_widget_get_style_context (widget), cr,
+ 0, 0,
+
+ gdk_window_get_width (offscreen_box->offscreen_window1),
+ gdk_window_get_height (offscreen_box->offscreen_window1));
if (offscreen_box->child1)
gtk_container_propagate_draw (GTK_CONTAINER (widget),
@@ -686,12 +685,10 @@ gtk_offscreen_box_draw (GtkWidget *widget,
}
else if (gtk_cairo_should_draw_window (cr, offscreen_box->offscreen_window2))
{
- gtk_paint_flat_box (gtk_widget_get_style (widget), cr,
- GTK_STATE_NORMAL, GTK_SHADOW_NONE,
- widget, "blah",
- 0, 0,
- gdk_window_get_width (offscreen_box->offscreen_window2),
- gdk_window_get_height (offscreen_box->offscreen_window2));
+ gtk_render_background (gtk_widget_get_style_context (widget), cr,
+ 0, 0,
+ gdk_window_get_width (offscreen_box->offscreen_window2),
+ gdk_window_get_height (offscreen_box->offscreen_window2));
if (offscreen_box->child2)
gtk_container_propagate_draw (GTK_CONTAINER (widget),
diff --git a/tests/styleexamples.c b/tests/styleexamples.c
new file mode 100644
index 0000000000..75350ddd2d
--- /dev/null
+++ b/tests/styleexamples.c
@@ -0,0 +1,384 @@
+#include <string.h>
+#include <gtk/gtk.h>
+
+static gboolean
+draw_cb_checks (GtkWidget *widget, cairo_t *cr)
+{
+ GtkStyleContext *context;
+
+ context = gtk_widget_get_style_context (widget);
+
+ gtk_style_context_save (context);
+
+ gtk_style_context_add_class (context, "check");
+ gtk_style_context_set_state (context, 0);
+ gtk_render_check (context, cr, 12, 12, 12, 12);
+ gtk_style_context_set_state (context, GTK_STATE_FLAG_ACTIVE);
+ gtk_render_check (context, cr, 36, 12, 12, 12);
+ gtk_style_context_set_state (context, GTK_STATE_FLAG_INCONSISTENT);
+ gtk_render_check (context, cr, 60, 12, 12, 12);
+ gtk_style_context_set_state (context, GTK_STATE_FLAG_INSENSITIVE);
+ gtk_render_check (context, cr, 84, 12, 12, 12);
+
+ gtk_style_context_restore (context);
+
+ return TRUE;
+}
+
+
+static gboolean
+draw_cb_options (GtkWidget *widget, cairo_t *cr)
+{
+ GtkStyleContext *context;
+
+ context = gtk_widget_get_style_context (widget);
+
+ gtk_style_context_save (context);
+
+ gtk_style_context_add_class (context, "radio");
+ gtk_style_context_set_state (context, 0);
+ gtk_render_option (context, cr, 12, 12, 12, 12);
+ gtk_style_context_set_state (context, GTK_STATE_FLAG_ACTIVE);
+ gtk_render_option (context, cr, 36, 12, 12, 12);
+ gtk_style_context_set_state (context, GTK_STATE_FLAG_INCONSISTENT);
+ gtk_render_option (context, cr, 60, 12, 12, 12);
+ gtk_style_context_set_state (context, GTK_STATE_FLAG_INSENSITIVE);
+ gtk_render_option (context, cr, 84, 12, 12, 12);
+
+ gtk_style_context_restore (context);
+
+ return TRUE;
+}
+
+static gboolean
+draw_cb_arrows (GtkWidget *widget, cairo_t *cr)
+{
+ GtkStyleContext *context;
+
+ context = gtk_widget_get_style_context (widget);
+
+ gtk_style_context_save (context);
+
+ gtk_style_context_set_state (context, 0);
+ gtk_render_arrow (context, cr, 0, 12, 12, 12);
+ gtk_render_arrow (context, cr, G_PI/2, 36, 12, 12);
+ gtk_render_arrow (context, cr, G_PI, 60, 12, 12);
+ gtk_render_arrow (context, cr, G_PI*3/2, 84, 12, 12);
+
+ gtk_style_context_restore (context);
+
+ return TRUE;
+}
+
+static gboolean
+draw_cb_expanders (GtkWidget *widget, cairo_t *cr)
+{
+ GtkStyleContext *context;
+
+ context = gtk_widget_get_style_context (widget);
+
+ gtk_style_context_save (context);
+
+ gtk_style_context_add_class (context, "expander");
+ gtk_style_context_set_state (context, 0);
+ gtk_render_expander (context, cr, 12, 12, 12, 12);
+ gtk_style_context_set_state (context, GTK_STATE_FLAG_PRELIGHT);
+ gtk_render_expander (context, cr, 36, 12, 12, 12);
+ gtk_style_context_set_state (context, GTK_STATE_FLAG_ACTIVE);
+ gtk_render_expander (context, cr, 60, 12, 12, 12);
+ gtk_style_context_set_state (context, GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_ACTIVE);
+ gtk_render_expander (context, cr, 84, 12, 12, 12);
+
+ gtk_style_context_restore (context);
+
+ return TRUE;
+}
+
+static gboolean
+draw_cb_background (GtkWidget *widget, cairo_t *cr)
+{
+ GtkStyleProvider *provider;
+ GtkStyleContext *context;
+
+ context = gtk_widget_get_style_context (widget);
+
+ gtk_style_context_save (context);
+
+ provider = (GtkStyleProvider *)gtk_css_provider_new ();
+ gtk_css_provider_load_from_data (GTK_CSS_PROVIDER (provider),
+ "* {\n"
+ " border-radius: 10;\n"
+ " border-width: 0;\n"
+ " background-image: -gtk-gradient (linear, left top, right bottom, from(#ff00ff), to(#aabbcc));\n"
+ "}\n", -1, NULL);
+ gtk_style_context_add_provider (context, provider, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ gtk_style_context_set_junction_sides (context, 0);
+ gtk_render_background (context, cr, 12, 12, 100, 100);
+ gtk_style_context_remove_provider (context, provider);
+ gtk_style_context_restore (context);
+
+ return TRUE;
+}
+
+static gboolean
+draw_cb_frame (GtkWidget *widget, cairo_t *cr)
+{
+ GtkStyleProvider *provider;
+ GtkStyleContext *context;
+
+ context = gtk_widget_get_style_context (widget);
+
+ gtk_style_context_save (context);
+
+ provider = (GtkStyleProvider *)gtk_css_provider_new ();
+ gtk_css_provider_load_from_data (GTK_CSS_PROVIDER (provider),
+ ".frame1 {\n"
+ " border-image: url('gradient1.png') 10 10 10 10 stretch;\n"
+ "}\n"
+ ".frame2 {\n"
+ " border-style: solid;\n"
+ " border-color: rgb(255,0,0);\n"
+ " border-width: 10;\n"
+ " border-radius: 10;\n"
+ "}\n"
+ ".frame3 {\n"
+ " border-style: solid;\n"
+ " border-color: rgb(0,0,0);\n"
+ " border-width: 2;\n"
+ " border-radius: 10;\n"
+ "}\n",
+ -1, NULL);
+ gtk_style_context_add_provider (context, provider, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+
+ gtk_style_context_add_class (context, "frame1");
+ gtk_style_context_set_junction_sides (context, 0);
+ gtk_render_frame (context, cr, 12, 12, 50, 50);
+ gtk_style_context_remove_class (context, "frame1");
+
+ gtk_style_context_add_class (context, "frame2");
+ gtk_render_frame (context, cr, 74, 12, 50, 50);
+ gtk_style_context_remove_class (context, "frame2");
+
+ gtk_style_context_add_class (context, "frame3");
+ gtk_style_context_set_junction_sides (context, GTK_JUNCTION_RIGHT);
+ gtk_render_frame (context, cr, 12, 74, 56, 50);
+ gtk_style_context_set_junction_sides (context, GTK_JUNCTION_LEFT);
+ gtk_render_frame (context, cr, 68, 74, 56, 50);
+ gtk_style_context_remove_class (context, "frame3");
+
+ gtk_style_context_remove_provider (context, provider);
+ gtk_style_context_restore (context);
+
+ return TRUE;
+}
+
+/* FIXME: this doesn't work */
+static gboolean
+draw_cb_activity (GtkWidget *widget, cairo_t *cr)
+{
+ GtkStyleContext *context;
+ GtkWidgetPath *path;
+
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_notify_state_change (context,
+ gtk_widget_get_window (widget),
+ NULL,
+ GTK_STATE_FLAG_ACTIVE,
+ TRUE);
+
+ gtk_style_context_save (context);
+
+ path = gtk_widget_path_new ();
+ gtk_widget_path_append_type (path, GTK_TYPE_SPINNER);
+ gtk_widget_path_iter_add_class (path, 0, "spinner");
+ gtk_style_context_set_path (context, path);
+ gtk_widget_path_free (path);
+
+ gtk_style_context_set_state (context, GTK_STATE_FLAG_ACTIVE);
+ gtk_render_activity (context, cr, 12, 12, 12, 12);
+
+ gtk_style_context_restore (context);
+
+ return TRUE;
+}
+
+static gboolean
+draw_cb_slider (GtkWidget *widget, cairo_t *cr)
+{
+ GtkStyleContext *context;
+ GtkWidgetPath *path;
+
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_save (context);
+
+ path = gtk_widget_path_new ();
+ gtk_widget_path_append_type (path, GTK_TYPE_SCALE);
+ gtk_widget_path_iter_add_class (path, 0, "slider");
+ gtk_widget_path_iter_add_class (path, 0, "scale");
+ gtk_style_context_set_path (context, path);
+ gtk_widget_path_free (path);
+
+ gtk_render_slider (context, cr, 12, 22, 30, 10, GTK_ORIENTATION_HORIZONTAL);
+ gtk_render_slider (context, cr, 54, 12, 10, 30, GTK_ORIENTATION_VERTICAL);
+
+ gtk_style_context_restore (context);
+
+ return TRUE;
+}
+
+static gboolean
+draw_cb_focus (GtkWidget *widget, cairo_t *cr)
+{
+ GtkStyleContext *context;
+
+ context = gtk_widget_get_style_context (widget);
+
+ gtk_style_context_save (context);
+
+ gtk_render_focus (context, cr, 12, 12, 50, 50);
+
+ gtk_style_context_restore (context);
+
+ return TRUE;
+}
+
+static gboolean
+draw_cb_extension (GtkWidget *widget, cairo_t *cr)
+{
+ GtkStyleContext *context;
+
+ context = gtk_widget_get_style_context (widget);
+
+ gtk_style_context_save (context);
+
+ gtk_style_context_add_class (context, "notebook");
+ gtk_style_context_add_region (context, GTK_STYLE_REGION_TAB, 0);
+
+ gtk_style_context_set_state (context, 0);
+ gtk_render_extension (context, cr, 26, 12, 24, 12, GTK_POS_BOTTOM);
+ gtk_render_extension (context, cr, 12, 26, 12, 24, GTK_POS_RIGHT);
+ gtk_render_extension (context, cr, 26, 52, 24, 12, GTK_POS_TOP);
+ gtk_render_extension (context, cr, 52, 26, 12, 24, GTK_POS_LEFT);
+
+ gtk_style_context_restore (context);
+
+ return TRUE;
+}
+
+static gboolean
+draw_cb_frame_gap (GtkWidget *widget, cairo_t *cr)
+{
+ GtkStyleContext *context;
+ GtkStyleProvider *provider;
+
+ context = gtk_widget_get_style_context (widget);
+
+ gtk_style_context_save (context);
+
+ provider = (GtkStyleProvider *)gtk_css_provider_new ();
+ gtk_css_provider_load_from_data (GTK_CSS_PROVIDER (provider),
+ ".frame {\n"
+ " border-style: solid;\n"
+ " border-width: 1;\n"
+ " border-radius: 0;\n"
+ "}\n",
+ -1, NULL);
+ gtk_style_context_add_provider (context, provider, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+
+ gtk_style_context_add_class (context, "frame");
+ gtk_style_context_set_junction_sides (context, 0);
+ gtk_render_frame_gap (context, cr, 12, 12, 50, 50, GTK_POS_TOP, 15, 35);
+ gtk_style_context_remove_class (context, "frame");
+
+ gtk_style_context_remove_provider (context, provider);
+
+ gtk_style_context_restore (context);
+
+ return TRUE;
+}
+
+static gboolean
+draw_cb_handles (GtkWidget *widget, cairo_t *cr)
+{
+ GtkStyleContext *context;
+
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_save (context);
+
+ gtk_style_context_add_class (context, "paned");
+ gtk_render_handle (context, cr, 12, 22, 20, 10);
+ gtk_render_handle (context, cr, 44, 12, 10, 20);
+ gtk_style_context_remove_class (context, "paned");
+
+ gtk_style_context_add_class (context, "grip");
+ gtk_style_context_set_junction_sides (context, GTK_JUNCTION_CORNER_BOTTOMLEFT);
+ gtk_render_handle (context, cr, 12, 48, 12, 12);
+
+ gtk_style_context_set_junction_sides (context, GTK_JUNCTION_CORNER_BOTTOMRIGHT);
+ gtk_render_handle (context, cr, 40, 48, 12, 12);
+
+ gtk_style_context_restore (context);
+
+ return TRUE;
+}
+
+static char *what;
+
+static gboolean
+draw_cb (GtkWidget *widget, cairo_t *cr)
+{
+ if (strcmp (what, "check") == 0)
+ return draw_cb_checks (widget, cr);
+ else if (strcmp (what, "option") == 0)
+ return draw_cb_options (widget, cr);
+ else if (strcmp (what, "arrow") == 0)
+ return draw_cb_arrows (widget, cr);
+ else if (strcmp (what, "expander") == 0)
+ return draw_cb_expanders (widget, cr);
+ else if (strcmp (what, "background") == 0)
+ return draw_cb_background (widget, cr);
+ else if (strcmp (what, "frame") == 0)
+ return draw_cb_frame (widget, cr);
+ else if (strcmp (what, "activity") == 0)
+ return draw_cb_activity (widget, cr);
+ else if (strcmp (what, "slider") == 0)
+ return draw_cb_slider (widget, cr);
+ else if (strcmp (what, "focus") == 0)
+ return draw_cb_focus (widget, cr);
+ else if (strcmp (what, "extension") == 0)
+ return draw_cb_extension (widget, cr);
+ else if (strcmp (what, "frame-gap") == 0)
+ return draw_cb_frame_gap (widget, cr);
+ else if (strcmp (what, "handle") == 0)
+ return draw_cb_handles (widget, cr);
+
+ return FALSE;
+}
+
+int main (int argc, char *argv[])
+{
+ GtkWidget *window;
+ GtkWidget *ebox;
+
+ gtk_init (&argc, &argv);
+
+ if (argc > 1)
+ what = argv[1];
+ else
+ what = "check";
+
+ window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ gtk_window_set_has_resize_grip (GTK_WINDOW (window), FALSE);
+ ebox = gtk_event_box_new ();
+ gtk_event_box_set_visible_window (GTK_EVENT_BOX (ebox), TRUE);
+ gtk_container_add (GTK_CONTAINER (window), ebox);
+ gtk_widget_set_name (ebox, "ebox");
+ g_signal_connect_after (ebox, "draw", G_CALLBACK (draw_cb), NULL);
+
+ gtk_widget_show_all (window);
+
+ gtk_main ();
+
+ return 0;
+}
+
diff --git a/tests/testadjustsize.c b/tests/testadjustsize.c
index f82b966266..c45522ad33 100644
--- a/tests/testadjustsize.c
+++ b/tests/testadjustsize.c
@@ -236,23 +236,23 @@ create_widget_visible_border (const char *text)
GtkWidget *inner_box;
GtkWidget *test_widget;
GtkWidget *label;
- GdkColor color;
+ GdkRGBA color;
outer_box = gtk_event_box_new ();
- gdk_color_parse ("black", &color);
- gtk_widget_modify_bg (outer_box, GTK_STATE_NORMAL, &color);
+ gdk_rgba_parse (&color, "black");
+ gtk_widget_override_background_color (outer_box, 0, &color);
inner_box = gtk_event_box_new ();
gtk_container_set_border_width (GTK_CONTAINER (inner_box), 5);
- gdk_color_parse ("blue", &color);
- gtk_widget_modify_bg (inner_box, GTK_STATE_NORMAL, &color);
+ gdk_rgba_parse (&color, "blue");
+ gtk_widget_override_background_color (inner_box, 0, &color);
gtk_container_add (GTK_CONTAINER (outer_box), inner_box);
test_widget = gtk_event_box_new ();
- gdk_color_parse ("red", &color);
- gtk_widget_modify_bg (test_widget, GTK_STATE_NORMAL, &color);
+ gdk_rgba_parse (&color, "red");
+ gtk_widget_override_background_color (test_widget, 0, &color);
gtk_container_add (GTK_CONTAINER (inner_box), test_widget);
diff --git a/tests/testcalendar.c b/tests/testcalendar.c
index 1960c5e0e4..a0292760a2 100644
--- a/tests/testcalendar.c
+++ b/tests/testcalendar.c
@@ -243,18 +243,15 @@ void calendar_select_font (GtkWidget *button,
CalendarData *calendar)
{
const char *font = NULL;
- GtkRcStyle *style;
+ PangoFontDescription *font_desc;
if (calendar->window)
- font = gtk_font_button_get_font_name (GTK_FONT_BUTTON (button));
-
- if (font)
- {
- style = gtk_rc_style_new ();
- pango_font_description_free (style->font_desc);
- style->font_desc = pango_font_description_from_string (font);
- gtk_widget_modify_style (calendar->window, style);
- }
+ {
+ font = gtk_font_button_get_font_name (GTK_FONT_BUTTON (button));
+ font_desc = pango_font_description_from_string (font);
+ gtk_widget_override_font (calendar->window, font_desc);
+ pango_font_description_free (font_desc);
+ }
}
static gchar*
@@ -399,7 +396,8 @@ create_calendar(void)
GtkWidget *frame, *label, *bbox, *align, *details;
GtkSizeGroup *size;
- GtkStyle *style;
+ GtkStyleContext *context;
+ PangoFontDescription *font_desc;
gchar *font;
gint i;
@@ -478,10 +476,11 @@ create_calendar(void)
gtk_box_pack_start (GTK_BOX (rpane), frame, FALSE, TRUE, 0);
size = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
- gtk_widget_ensure_style (calendar);
- style = gtk_widget_get_style (calendar);
- font = pango_font_description_to_string (style->font_desc);
+ context = gtk_widget_get_style_context (calendar);
+ gtk_style_context_get (context, 0, "font", &font_desc, NULL);
+ font = pango_font_description_to_string (font_desc);
button = gtk_font_button_new_with_font (font);
+ pango_font_description_free (font_desc);
g_free (font);
g_signal_connect (button, "font-set",
diff --git a/tests/testcombochange.c b/tests/testcombochange.c
index c9da758796..042c4bfd1b 100644
--- a/tests/testcombochange.c
+++ b/tests/testcombochange.c
@@ -94,16 +94,9 @@ create_combo (const char *name,
{
GtkCellRenderer *cell_renderer;
GtkWidget *combo;
- char *rc_string;
-
- rc_string = g_strdup_printf ("style \"%s-style\" {\n"
- " GtkComboBox::appears-as-list = %d\n"
- "}\n"
- "\n"
- "widget \"*.%s\" style \"%s-style\"",
- name, is_list, name, name);
- gtk_rc_parse_string (rc_string);
- g_free (rc_string);
+ GtkCssProvider *provider;
+ GtkStyleContext *context;
+ gchar *css_data;
combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (model));
cell_renderer = gtk_cell_renderer_text_new ();
@@ -112,7 +105,19 @@ create_combo (const char *name,
"text", 0, NULL);
gtk_widget_set_name (combo, name);
-
+
+ context = gtk_widget_get_style_context (combo);
+
+ provider = gtk_css_provider_new ();
+ css_data = g_strdup_printf ("#%s { -GtkComboBox-appears-as-list: %s }",
+ name, is_list ? "true" : "false");
+ gtk_css_provider_load_from_data (provider, css_data, -1, NULL);
+ g_free (css_data);
+
+ gtk_style_context_add_provider (context,
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+
return combo;
}
diff --git a/tests/testexpand.c b/tests/testexpand.c
index 937b8110d7..e7f0d99cd5 100644
--- a/tests/testexpand.c
+++ b/tests/testexpand.c
@@ -58,7 +58,7 @@ create_box_window (void)
GtkWidget *toggle;
GtkWidget *alignment;
GtkWidget *colorbox;
- GdkColor red, blue;
+ GdkRGBA red, blue;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Boxes");
@@ -94,11 +94,11 @@ create_box_window (void)
gtk_label_new ("VBox 3 Bottom"),
FALSE, FALSE, 0);
- gdk_color_parse ("red", &red);
- gdk_color_parse ("blue", &blue);
+ gdk_rgba_parse (&red, "red");
+ gdk_rgba_parse (&blue, "blue");
colorbox = gtk_event_box_new ();
- gtk_widget_modify_bg (colorbox, GTK_STATE_NORMAL, &red);
+ gtk_widget_override_background_color (colorbox, 0, &red);
alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 5, 5, 5, 5);
@@ -114,7 +114,7 @@ create_box_window (void)
FALSE, TRUE, 0);
colorbox = gtk_event_box_new ();
- gtk_widget_modify_bg (colorbox, GTK_STATE_NORMAL, &blue);
+ gtk_widget_override_background_color (colorbox, 0, &blue);
alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 5, 5, 5, 5);
@@ -140,7 +140,7 @@ create_table_window (void)
GtkWidget *toggle;
GtkWidget *alignment;
GtkWidget *colorbox;
- GdkColor red, blue;
+ GdkRGBA red, blue;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Table");
@@ -164,11 +164,11 @@ create_table_window (void)
2, 3, 1, 3,
GTK_FILL, GTK_FILL, 0, 0);
- gdk_color_parse ("red", &red);
- gdk_color_parse ("blue", &blue);
+ gdk_rgba_parse (&red, "red");
+ gdk_rgba_parse (&blue, "blue");
colorbox = gtk_event_box_new ();
- gtk_widget_modify_bg (colorbox, GTK_STATE_NORMAL, &red);
+ gtk_widget_override_background_color (colorbox, GTK_STATE_NORMAL, &red);
alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 5, 5, 5, 5);
@@ -185,7 +185,7 @@ create_table_window (void)
GTK_FILL, GTK_FILL, 0, 0);
colorbox = gtk_event_box_new ();
- gtk_widget_modify_bg (colorbox, GTK_STATE_NORMAL, &blue);
+ gtk_widget_override_background_color (colorbox, 0, &blue);
alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 5, 5, 5, 5);
diff --git a/tests/testframe.c b/tests/testframe.c
index 1ab6e2902f..0070f5a3a9 100644
--- a/tests/testframe.c
+++ b/tests/testframe.c
@@ -24,28 +24,68 @@ static void
spin_ythickness_cb (GtkSpinButton *spin, gpointer user_data)
{
GtkWidget *frame = user_data;
- GtkRcStyle *rcstyle;
-
- rcstyle = gtk_rc_style_new ();
- rcstyle->xthickness = gtk_widget_get_style (frame)->xthickness;
- rcstyle->ythickness = gtk_spin_button_get_value (spin);
- gtk_widget_modify_style (frame, rcstyle);
-
- g_object_unref (rcstyle);
+ GtkCssProvider *provider;
+ GtkStyleContext *context;
+ gchar *data;
+ GtkBorder *pad;
+
+ context = gtk_widget_get_style_context (frame);
+ provider = g_object_get_data (G_OBJECT (frame), "provider");
+ if (provider == NULL)
+ {
+ provider = gtk_css_provider_new ();
+ g_object_set_data (G_OBJECT (frame), "provider", provider);
+ gtk_style_context_add_provider (context,
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ }
+
+ gtk_style_context_get (context, 0, "padding", &pad, NULL);
+
+ data = g_strdup_printf ("GtkFrame { padding: %d %d }",
+ pad->top,
+ (gint)gtk_spin_button_get_value (spin));
+
+ gtk_css_provider_load_from_data (provider, data, -1, NULL);
+ g_free (data);
+ gtk_border_free (pad);
+
+ gtk_style_context_invalidate (context);
+ gtk_widget_queue_resize (frame);
}
static void
spin_xthickness_cb (GtkSpinButton *spin, gpointer user_data)
{
GtkWidget *frame = user_data;
- GtkRcStyle *rcstyle;
-
- rcstyle = gtk_rc_style_new ();
- rcstyle->xthickness = gtk_spin_button_get_value (spin);
- rcstyle->ythickness = gtk_widget_get_style (frame)->ythickness;
- gtk_widget_modify_style (frame, rcstyle);
-
- g_object_unref (rcstyle);
+ GtkCssProvider *provider;
+ GtkStyleContext *context;
+ gchar *data;
+ GtkBorder *pad;
+
+ context = gtk_widget_get_style_context (frame);
+ provider = g_object_get_data (G_OBJECT (frame), "provider");
+ if (provider == NULL)
+ {
+ provider = gtk_css_provider_new ();
+ g_object_set_data (G_OBJECT (frame), "provider", provider);
+ gtk_style_context_add_provider (context,
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ }
+
+ gtk_style_context_get (context, 0, "padding", &pad, NULL);
+
+ data = g_strdup_printf ("GtkFrame { padding: %d %d }",
+ (gint)gtk_spin_button_get_value (spin),
+ pad->left);
+
+ gtk_css_provider_load_from_data (provider, data, -1, NULL);
+ g_free (data);
+ gtk_border_free (pad);
+
+ gtk_style_context_invalidate (context);
+ gtk_widget_queue_resize (frame);
}
/* Function to normalize rounding errors in FP arithmetic to
@@ -88,7 +128,8 @@ spin_yalign_cb (GtkSpinButton *spin, GtkFrame *frame)
int main (int argc, char **argv)
{
- GtkStyle *style;
+ GtkStyleContext *context;
+ GtkBorder *pad;
GtkWidget *window, *frame, *xthickness_spin, *ythickness_spin, *vbox;
GtkWidget *xalign_spin, *yalign_spin, *button, *table, *label;
gfloat xalign, yalign;
@@ -113,7 +154,8 @@ int main (int argc, char **argv)
table = gtk_table_new (4, 2, FALSE);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
- style = gtk_widget_get_style (frame);
+ context = gtk_widget_get_style_context (frame);
+ gtk_style_context_get (context, 0, "padding", &pad, NULL);
/* Spin to control xthickness */
label = gtk_label_new ("xthickness: ");
@@ -121,7 +163,7 @@ int main (int argc, char **argv)
xthickness_spin = gtk_spin_button_new_with_range (0, 250, 1);
g_signal_connect (G_OBJECT (xthickness_spin), "value-changed", G_CALLBACK (spin_xthickness_cb), frame);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (xthickness_spin), style->xthickness);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (xthickness_spin), pad->left);
gtk_table_attach_defaults (GTK_TABLE (table), xthickness_spin, 1, 2, 0, 1);
/* Spin to control ythickness */
@@ -130,9 +172,11 @@ int main (int argc, char **argv)
ythickness_spin = gtk_spin_button_new_with_range (0, 250, 1);
g_signal_connect (G_OBJECT (ythickness_spin), "value-changed", G_CALLBACK (spin_ythickness_cb), frame);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (ythickness_spin), style->ythickness);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (ythickness_spin), pad->top);
gtk_table_attach_defaults (GTK_TABLE (table), ythickness_spin, 1, 2, 1, 2);
+ gtk_border_free (pad);
+
gtk_frame_get_label_align (GTK_FRAME (frame), &xalign, &yalign);
/* Spin to control label xalign */
diff --git a/tests/testgrid.c b/tests/testgrid.c
index d576848e98..9c1b38a9be 100644
--- a/tests/testgrid.c
+++ b/tests/testgrid.c
@@ -5,13 +5,13 @@ oriented_test_widget (const gchar *label, const gchar *color, gdouble angle)
{
GtkWidget *box;
GtkWidget *widget;
- GdkColor c;
+ GdkRGBA c;
widget = gtk_label_new (label);
gtk_label_set_angle (GTK_LABEL (widget), angle);
box = gtk_event_box_new ();
- gdk_color_parse (color, &c);
- gtk_widget_modify_bg (box, GTK_STATE_NORMAL, &c);
+ gdk_rgba_parse (color, &c);
+ gtk_widget_override_background_color (box, 0, &c);
gtk_container_add (GTK_CONTAINER (box), widget);
return box;
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 7e0a7e7cd5..76d68387f7 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -399,7 +399,7 @@ create_composited_window (GtkWidget *widget)
if (!window)
{
GtkWidget *event, *button;
- GdkColor red;
+ GdkRGBA red;
/* make the widgets */
button = gtk_button_new_with_label ("A Button");
@@ -411,8 +411,8 @@ create_composited_window (GtkWidget *widget)
&window);
/* put a red background on the window */
- gdk_color_parse ("red", &red);
- gtk_widget_modify_bg (window, GTK_STATE_NORMAL, &red);
+ gdk_rgba_parse (&red, "red");
+ gtk_widget_override_background_color (window, 0, &red);
/* set our event box to have a fully-transparent background
* drawn on it. currently there is no way to simply tell gtk
@@ -1202,8 +1202,7 @@ create_button_box (GtkWidget *widget)
static GtkWidget*
new_pixbuf (char *filename,
- GdkWindow *window,
- GdkColor *background)
+ GdkWindow *window)
{
GtkWidget *widget;
GdkPixbuf *pixbuf;
@@ -1379,8 +1378,7 @@ create_toolbar (GtkWidget *widget)
{
GtkWidget *icon;
- icon = new_pixbuf ("test.xpm", gtk_widget_get_window (window),
- &gtk_widget_get_style (window)->bg[GTK_STATE_NORMAL]);
+ icon = new_pixbuf ("test.xpm", gtk_widget_get_window (window));
toolitem = gtk_tool_button_new (icon, create_toolbar_items[i].label);
}
if (create_toolbar_items[i].callback)
@@ -1450,8 +1448,7 @@ make_toolbar (GtkWidget *window)
toolitem = gtk_separator_tool_item_new ();
continue;
}
- icon = new_pixbuf ("test.xpm", gtk_widget_get_window (window),
- &gtk_widget_get_style (window)->bg[GTK_STATE_NORMAL]);
+ icon = new_pixbuf ("test.xpm", gtk_widget_get_window (window));
toolitem = gtk_tool_button_new (icon, make_toolbar_items[i].label);
gtk_tool_item_set_tooltip_text (toolitem, make_toolbar_items[i].tooltip);
if (make_toolbar_items[i].callback != NULL)
@@ -2200,7 +2197,7 @@ create_rotated_text (GtkWidget *widget)
if (!window)
{
- const GdkColor white = { 0, 0xffff, 0xffff, 0xffff };
+ const GdkRGBA white = { 1.0, 1.0, 1.0, 1.0 };
GtkRequisition requisition;
GtkWidget *content_area;
GtkWidget *drawing_area;
@@ -2225,7 +2222,7 @@ create_rotated_text (GtkWidget *widget)
drawing_area = gtk_drawing_area_new ();
gtk_box_pack_start (GTK_BOX (content_area), drawing_area, TRUE, TRUE, 0);
- gtk_widget_modify_bg (drawing_area, GTK_STATE_NORMAL, &white);
+ gtk_widget_override_background_color (drawing_area, 0, &white);
tile_pixbuf = gdk_pixbuf_new_from_file ("marble.xpm", NULL);
@@ -2400,15 +2397,47 @@ grippy_button_press (GtkWidget *area, GdkEventButton *event, GdkWindowEdge edge)
static gboolean
grippy_draw (GtkWidget *area, cairo_t *cr, GdkWindowEdge edge)
{
- gtk_paint_resize_grip (gtk_widget_get_style (area),
- cr,
- gtk_widget_get_state (area),
- area,
- "statusbar",
- edge,
- 0, 0,
- gtk_widget_get_allocated_width (area),
- gtk_widget_get_allocated_height (area));
+ GtkStyleContext *context;
+ GtkJunctionSides sides;
+
+ switch (edge)
+ {
+ case GDK_WINDOW_EDGE_NORTH_WEST:
+ sides = GTK_JUNCTION_CORNER_TOPLEFT;
+ break;
+ case GDK_WINDOW_EDGE_NORTH:
+ sides = GTK_JUNCTION_TOP;
+ break;
+ case GDK_WINDOW_EDGE_NORTH_EAST:
+ sides = GTK_JUNCTION_CORNER_TOPRIGHT;
+ break;
+ case GDK_WINDOW_EDGE_WEST:
+ sides = GTK_JUNCTION_LEFT;
+ break;
+ case GDK_WINDOW_EDGE_EAST:
+ sides = GTK_JUNCTION_RIGHT;
+ break;
+ case GDK_WINDOW_EDGE_SOUTH_WEST:
+ sides = GTK_JUNCTION_CORNER_BOTTOMLEFT;
+ break;
+ case GDK_WINDOW_EDGE_SOUTH:
+ sides = GTK_JUNCTION_BOTTOM;
+ break;
+ case GDK_WINDOW_EDGE_SOUTH_EAST:
+ sides = GTK_JUNCTION_CORNER_BOTTOMRIGHT;
+ break;
+ }
+
+ context = gtk_widget_get_style_context (area);
+ gtk_style_context_save (context);
+ gtk_style_context_add_class (context, "grip");
+ gtk_style_context_set_junction_sides (context, sides);
+ gtk_render_handle (context, cr,
+ 0, 0,
+ gtk_widget_get_allocated_width (area),
+ gtk_widget_get_allocated_height (area));
+
+ gtk_style_context_restore (context);
return TRUE;
}
@@ -2708,7 +2737,7 @@ create_pixbuf (GtkWidget *widget)
gdk_window = gtk_widget_get_window (window);
- pixbufwid = new_pixbuf ("test.xpm", gdk_window, NULL);
+ pixbufwid = new_pixbuf ("test.xpm", gdk_window);
label = gtk_label_new ("Pixbuf\ntest");
box3 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
@@ -2720,7 +2749,7 @@ create_pixbuf (GtkWidget *widget)
button = gtk_button_new ();
gtk_box_pack_start (GTK_BOX (box2), button, FALSE, FALSE, 0);
- pixbufwid = new_pixbuf ("test.xpm", gdk_window, NULL);
+ pixbufwid = new_pixbuf ("test.xpm", gdk_window);
label = gtk_label_new ("Pixbuf\ntest");
box3 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
@@ -4148,13 +4177,14 @@ create_event_box (GtkWidget *widget)
GtkWidget *label;
GtkWidget *visible_window_check;
GtkWidget *above_child_check;
- GdkColor color;
+ GdkRGBA color;
if (!window)
{
color.red = 0;
- color.blue = 65535;
+ color.blue = 1;
color.green = 0;
+ color.alpha = 1;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
@@ -4169,7 +4199,7 @@ create_event_box (GtkWidget *widget)
box1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (window), box1);
- gtk_widget_modify_bg (window, GTK_STATE_NORMAL, &color);
+ gtk_widget_override_background_color (window, 0, &color);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (box1), hbox, TRUE, FALSE, 0);
@@ -4796,6 +4826,8 @@ cursor_draw (GtkWidget *widget,
gpointer user_data)
{
int width, height;
+ GtkStyleContext *context;
+ GdkRGBA *bg;
width = gtk_widget_get_allocated_width (widget);
height = gtk_widget_get_allocated_height (widget);
@@ -4808,7 +4840,10 @@ cursor_draw (GtkWidget *widget,
cairo_rectangle (cr, 0, height / 2, width, height / 2);
cairo_fill (cr);
- gdk_cairo_set_source_color (cr, &gtk_widget_get_style (widget)->bg[GTK_STATE_NORMAL]);
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_get (context, 0, "background-color", &bg, NULL);
+ gdk_cairo_set_source_rgba (cr, bg);
+ gdk_rgba_free (bg);
cairo_rectangle (cr, width / 3, height / 3, width / 3, height / 3);
cairo_fill (cr);
@@ -9546,8 +9581,9 @@ create_rc_file (GtkWidget *widget)
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
button = gtk_button_new_with_label ("Reload");
- g_signal_connect (button, "clicked",
- G_CALLBACK (gtk_rc_reparse_all), NULL);
+ g_signal_connect_swapped (button, "clicked",
+ G_CALLBACK (gtk_style_context_reset_widgets),
+ gtk_widget_get_screen (button));
gtk_widget_set_can_default (button, TRUE);
gtk_box_pack_start (GTK_BOX (action_area), button, TRUE, TRUE, 0);
gtk_widget_grab_default (button);
@@ -9760,6 +9796,8 @@ void create_layout (GtkWidget *widget)
gtk_widget_destroy (window);
}
+#if 0
+/* FIXME: need to completely redo this for GtkStyleContext */
void
create_styles (GtkWidget *widget)
{
@@ -9769,11 +9807,11 @@ create_styles (GtkWidget *widget)
GtkWidget *button;
GtkWidget *entry;
GtkWidget *vbox;
- static GdkColor red = { 0, 0xffff, 0, 0 };
- static GdkColor green = { 0, 0, 0xffff, 0 };
- static GdkColor blue = { 0, 0, 0, 0xffff };
- static GdkColor yellow = { 0, 0xffff, 0xffff, 0 };
- static GdkColor cyan = { 0, 0 , 0xffff, 0xffff };
+ static GdkRGBA red = { 1,0,0,1 };
+ static GdkRGBA green = { 0,1,0,1 };
+ static GdkRGBA blue = { 0,0,1,1 };
+ static GdkRGBA yellow = { 1,1,0,1 };
+ static GdkRGBA cyan = { 0,1,1,1 };
PangoFontDescription *font_desc;
GtkRcStyle *rc_style;
@@ -9810,8 +9848,7 @@ create_styles (GtkWidget *widget)
font_desc = pango_font_description_from_string ("Helvetica,Sans Oblique 18");
button = gtk_button_new_with_label ("Some Text");
- gtk_widget_modify_font (gtk_bin_get_child (GTK_BIN (button)),
- font_desc);
+ gtk_widget_override_font (gtk_bin_get_child (GTK_BIN (button)), font_desc);
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
label = gtk_label_new ("Foreground:");
@@ -9819,8 +9856,7 @@ create_styles (GtkWidget *widget)
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
button = gtk_button_new_with_label ("Some Text");
- gtk_widget_modify_fg (gtk_bin_get_child (GTK_BIN (button)),
- GTK_STATE_NORMAL, &red);
+ gtk_widget_override_color (gtk_bin_get_child (GTK_BIN (button)), 0, &red);
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
label = gtk_label_new ("Background:");
@@ -9828,7 +9864,7 @@ create_styles (GtkWidget *widget)
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
button = gtk_button_new_with_label ("Some Text");
- gtk_widget_modify_bg (button, GTK_STATE_NORMAL, &green);
+ gtk_widget_override_background_color (button, 0, &green);
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
label = gtk_label_new ("Text:");
@@ -9837,7 +9873,7 @@ create_styles (GtkWidget *widget)
entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (entry), "Some Text");
- gtk_widget_modify_text (entry, GTK_STATE_NORMAL, &blue);
+ gtk_widget_override_color (entry, 0, &blue);
gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0);
label = gtk_label_new ("Base:");
@@ -9846,7 +9882,7 @@ create_styles (GtkWidget *widget)
entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (entry), "Some Text");
- gtk_widget_modify_base (entry, GTK_STATE_NORMAL, &yellow);
+ gtk_widget_override_background_color (entry, 0, &yellow);
gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0);
label = gtk_label_new ("Cursor:");
@@ -9892,6 +9928,7 @@ create_styles (GtkWidget *widget)
else
gtk_widget_destroy (window);
}
+#endif
/*
* Main Window and Exit
@@ -9955,7 +9992,9 @@ struct {
{ "snapshot", create_snapshot },
{ "spinbutton", create_spins },
{ "statusbar", create_statusbar },
+#if 0
{ "styles", create_styles },
+#endif
{ "test idle", create_idle_test },
{ "test mainloop", create_mainloop, TRUE },
{ "test scrolling", create_scroll_test },
@@ -9985,7 +10024,7 @@ create_main_window (void)
int i;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_widget_set_name (window, "main window");
+ gtk_widget_set_name (window, "main_window");
gtk_window_move (GTK_WINDOW (window), 50, 20);
gtk_window_set_default_size (GTK_WINDOW (window), -1, 400);
@@ -10188,6 +10227,9 @@ usage (void)
int
main (int argc, char *argv[])
{
+ GtkCssProvider *provider, *memory_provider;
+ GdkDisplay *display;
+ GdkScreen *screen;
GtkBindingSet *binding_set;
int i;
gboolean done_benchmarks = FALSE;
@@ -10196,19 +10238,28 @@ main (int argc, char *argv[])
test_init ();
+ g_set_application_name ("GTK+ Test Program");
+
+ gtk_init (&argc, &argv);
+
+ provider = gtk_css_provider_new ();
+
/* Check to see if we are being run from the correct
* directory.
*/
- if (file_exists ("testgtkrc"))
- gtk_rc_add_default_file ("testgtkrc");
- else if (file_exists ("tests/testgtkrc"))
- gtk_rc_add_default_file ("tests/testgtkrc");
+ if (file_exists ("testgtk.css"))
+ gtk_css_provider_load_from_path (provider, "testgtk.css", NULL);
+ else if (file_exists ("tests/testgtk.css"))
+ gtk_css_provider_load_from_path (provider, "tests/testgtk.css", NULL);
else
- g_warning ("Couldn't find file \"testgtkrc\".");
+ g_warning ("Couldn't find file \"testgtk.css\".");
- g_set_application_name ("GTK+ Test Program");
+ display = gdk_display_get_default ();
+ screen = gdk_display_get_default_screen (display);
- gtk_init (&argc, &argv);
+ gtk_style_context_add_provider_for_screen (screen, GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ g_object_unref (provider);
gtk_accelerator_set_default_mod_mask (GDK_SHIFT_MASK |
GDK_CONTROL_MASK |
@@ -10268,17 +10319,17 @@ main (int argc, char *argv[])
"debug_msg",
1,
G_TYPE_STRING, "GtkWidgetClass <ctrl><release>9 test");
-
- /* We use gtk_rc_parse_string() here so we can make sure it works across theme
- * changes
- */
- gtk_rc_parse_string ("style \"testgtk-version-label\" { "
- " fg[NORMAL] = \"#ff0000\"\n"
- " font = \"Sans 18\"\n"
- "}\n"
- "widget \"*.testgtk-version-label\" style \"testgtk-version-label\"");
-
+ memory_provider = gtk_css_provider_new ();
+ gtk_css_provider_load_from_data (memory_provider,
+ "#testgtk-version-label {\n"
+ " color: #f00;\n"
+ " font: Sans 18;\n"
+ "}",
+ -1, NULL);
+ gtk_style_context_add_provider_for_screen (screen, GTK_STYLE_PROVIDER (memory_provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION + 1);
+
create_main_window ();
gtk_main ();
diff --git a/tests/testgtk.css b/tests/testgtk.css
new file mode 100644
index 0000000000..24ed65547c
--- /dev/null
+++ b/tests/testgtk.css
@@ -0,0 +1,33 @@
+/* testgtk2.css sets all the buttons in the main window to blue by default */
+@import url("testgtk2.css");
+
+* {
+ -GtkButton-child-displacement-x: 1;
+ -GtkButton-child-displacement-y: 1;
+
+ -GtkToolbar-space-size: 10;
+ -GtkToolbar-space-style: line;
+ -GtkToolbar-button-relief: none;
+ -GtkButtonBox-child-min-width: 0;
+ -GtkButtonBox-child-min-height: 0;
+ -GtkArrow-arrow-scaling: 1.0;
+ -GtkEntry-invisible-char: 10046;
+
+ font: Sans 12;
+
+ -Gtest-foo: 47;
+ -Gtest-bar: 47;
+}
+
+GtkLabel:selected {
+ background-color: gray;
+}
+
+GtkLabel:prelight {
+ background-color: mix (#a0a0a0, rgb (75%, 200, 0%), 0.9);
+}
+
+/* override testgtk2, introduce the green color in the button list */
+#main_window GtkScrolledWindow GtkButton:prelight {
+ background-color: rgb (0%, 75%, 0);
+}
diff --git a/tests/testgtk2.css b/tests/testgtk2.css
new file mode 100644
index 0000000000..a51ec2a100
--- /dev/null
+++ b/tests/testgtk2.css
@@ -0,0 +1,9 @@
+/* this file gets included from testgtk.css */
+
+#main_window GtkButton {
+ font: Monospace 10;
+}
+
+#main_window GtkButton:hover {
+ background-color: rgba(0%, 0%, 75%, 0.1);
+}
diff --git a/tests/testgtkrc b/tests/testgtkrc
deleted file mode 100644
index 990a322492..0000000000
--- a/tests/testgtkrc
+++ /dev/null
@@ -1,228 +0,0 @@
-# pixmap_path "<dir 1>:<dir 2>:<dir 3>:..."
-#
-# include "rc-file"
-#
-# style <name> [= <name>]
-# {
-# <option>
-# }
-#
-# widget <widget_set> style <style_name>
-# widget_class <widget_class_set> style <style_name>
-
-# testgtkrc2 sets all the buttons in the main window to blue by default
-include "testgtkrc2"
-
-double-click_timeout = 42
-bell-duration = 39
-bell_duration = 40
-
-# gtk-cursor-blink-time = 200
-# gtk-menu-bar-accel = F10
-
-style "global-style-properties"
-{
-# xthickness = 20
- GtkButton::child_displacement_x = 1
- GtkButton::child_displacement_y = 1
-# GtkWidget::cursor_color = "#ff0000"
- GtkToolbar::space_size = 10
- GtkToolbar::space_style = line
- GtkToolbar::button_relief = none
- GtkButtonBox::child_min_width = 0
- GtkButtonBox::child_min_height = 0
- GtkArrow::arrow-scaling = 1.0
- GtkEntry::invisible-char = 10046
-}
-
-class "GtkWidget" style "global-style-properties"
-
-style "defaultfont"
-{
- font_name = "Sans 12"
-
- Gtest::foo = 47
- Gtest::bar = 47
-# GtkScrollbar::spacing = 33
-# GtkButton::color = { 3, 2,45, 6, 6, 4, 23 }
-}
-
-style "myicons"
-{
- stock["gtk-dialog-warning"] =
- {
- { "3DRings.xpm", *, *, *}
- }
-}
-
-class "GtkImage" style "myicons"
-
-# common default
-class "GtkWidget" style "defaultfont"
-
-style "window"
-{
-# bg_pixmap[NORMAL] = "marble.xpm"
-}
-
-style "scale"
-{
- fg[NORMAL] = { 1.0, 0, 0 }
- bg_pixmap[NORMAL] = "<parent>"
-}
-
-style "button" = "default"
-{
-# fg[PRELIGHT] = { 1.0, 1.0, 1.0 }
-# bg[PRELIGHT] = { 0, 0, 0.75 }
-# bg[PRELIGHT] = { 0.75, 0, 0x00 }
-}
-
-style "label" = "default"
-{
- base[PRELIGHT] = "gray"
- base[ACTIVE] = mix (0.9, "gray", "purple")
-}
-
-class "GtkLabel" style "label"
-
-style "toggle_button" = "button"
-{
- fg[NORMAL] = { 1.0, 0, 0 }
- fg[ACTIVE] = { 1.0, 0, 0 }
-# bg_pixmap[ACTIVE] = "check-y.xpm"
-# bg_pixmap[NORMAL] = "check-n.xpm"
-}
-
-style "text"
-{
- bg_pixmap[NORMAL] = "marble.xpm"
- text[NORMAL] = { 1.0, 1.0, 1.0 }
- fg[NORMAL] = { 1.0, 1.0, 1.0 }
- base[NORMAL] = { 0.0, 0.0, 0.0 }
-}
-
-style "slider"
-{
- fg[NORMAL] = { 1.0, 1.0, 1.0 }
- bg[NORMAL] = { 0.0, 0.0, 1.0 }
- bg[ACTIVE] = { 0.0 ,0.0, 0.5 }
- bg[PRELIGHT] = { 0.75 ,0.75, 1.0 }
-}
-
-style "ruler"
-{
- font_name = 'Sans 8'
-}
-
-style "curve"
-{
- fg[NORMAL] = { 58000, 0, 0 } # red
-}
-
-style "red-bar-parent"
-{
- color["my-red"] = "red"
- color["my-other-red"] = { 0.95, .55, 0.55 }
-}
-
-style "red-bar" = "red-bar-parent"
-{
- color["my-light-red"] = lighter (lighter (@my-red))
-
- bg[PRELIGHT] = @my-light-red
-}
-
-# override testgtk2, introduce the green color in the button list
-style 'button_list' = 'button'
-{
- font_name = "Monospace 10"
- bg[PRELIGHT] = { 0, 0.75, 0x00 }
-}
-widget "main window.*GtkScrolledWindow.*GtkButton*" style "button_list"
-
-style "checkbutton" {
-# GtkCheckButton::indicator-size = 27
-}
-
-class "GtkCheckButton" style "checkbutton"
-
-
-class "GtkScrollbar" style "red-bar"
-
-widget_class "GtkWindow" style "window"
-widget_class "GtkDialog" style "window"
-widget_class "GtkFileSelection" style "window"
-widget_class "*Gtk*Scale" style "scale"
-widget_class "*GtkCheckButton*" style "toggle_button"
-widget_class "*GtkRadioButton*" style "toggle_button"
-widget_class "*GtkButton*" style "button"
-widget_class "*Ruler" style "ruler"
-widget_class "*GtkText" style "text"
-
-binding "test1"
-{
- bind "<ctrl>1" {
- "debug-msg" ("jup!")
- }
-}
-
-binding "test2"
-{
- bind "<ctrl>1" {
- "debug-msg" ("hallo and")
- "debug-msg" ("huhu")
- }
-}
-
-# possible priorities are (in ascending order):
-# lowest
-# gtk (used by gtk for internal class bindings)
-# application (for hard coded bindings on application basis)
-# rc (used implicitel by rc files)
-# highest
-class "GtkCList" binding "test1" # implicit : rc
-#class "GtkWindow" binding : highest "test2" # override "rc" priority
-
-binding "clist-test"
-{
- bind "j" {
- "scroll-vertical" (step-backward, 0.0)
- }
- bind "k" {
- "scroll-vertical" (step-forward, 0.0)
- }
-}
-
-class "GtkCList" binding "clist-test"
-
-style "testthickness" {
- xthickness = 15
- ythickness = 15
-}
-
-#class "GtkFrame" style "testthickness"
-
-# Test ordering of RC file priorities
-
-style "testgtk-red-style" {
- fg[NORMAL] = "red"
-}
-
-style "testgtk-green-style" {
- fg[NORMAL] = "green"
-}
-
-style "testgtk-blue-style" {
- fg[NORMAL] = "blue"
-}
-
-
-widget_class "*.GtkAspectFrame.*.GtkLabel" style "testgtk-green-style"
-widget_class "*.GtkAspectFrame.*.GtkLabel" style "testgtk-blue-style" # override because it's later
-
-widget "*.testgtk-red-label" style "testgtk-red-style" # override because it's widget, not widget_class
-
-widget "*.testgtk-green-label" style : highest "testgtk-green-style"
-# overrides the following, because it is higher priority
-widget "*.testgtk-green-label" style "testgtk-red-style"
diff --git a/tests/testgtkrc2 b/tests/testgtkrc2
deleted file mode 100644
index 62b3a1c7b8..0000000000
--- a/tests/testgtkrc2
+++ /dev/null
@@ -1,21 +0,0 @@
-# pixmap_path "<dir 1>:<dir 2>:<dir 3>:..."
-#
-# include "rc-file"
-#
-# style <name> [= <name>]
-# {
-# <option>
-# }
-#
-# widget <widget_set> style <style_name>
-# widget_class <widget_class_set> style <style_name>
-
-# this file gets included from testgtkrc
-
-style 'main_buttons' = 'button'
-{
- font_name = "Monospace 10"
- bg[PRELIGHT] = { 0, 0, 0.75 }
-}
-
-widget "main window.*GtkButton*" style "main_buttons"
diff --git a/tests/testtext.c b/tests/testtext.c
deleted file mode 100644
index 84159822ca..0000000000
--- a/tests/testtext.c
+++ /dev/null
@@ -1,3082 +0,0 @@
-/* testtext.c
- * Copyright (C) 2000 Red Hat, Inc
- * Author: Havoc Pennington
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include "config.h"
-#include <stdio.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
-
-#include "prop-editor.h"
-
-typedef struct _Buffer Buffer;
-typedef struct _View View;
-
-static gint untitled_serial = 1;
-
-GSList *active_window_stack = NULL;
-
-struct _Buffer
-{
- gint refcount;
- GtkTextBuffer *buffer;
- char *filename;
- gint untitled_serial;
- GtkTextTag *invisible_tag;
- GtkTextTag *not_editable_tag;
- GtkTextTag *found_text_tag;
- GtkTextTag *rise_tag;
- GtkTextTag *large_tag;
- GtkTextTag *indent_tag;
- GtkTextTag *margin_tag;
- GtkTextTag *custom_tabs_tag;
- GSList *color_tags;
- guint color_cycle_timeout;
- gdouble start_hue;
-};
-
-struct _View
-{
- GtkWidget *window;
- GtkWidget *text_view;
- GtkAccelGroup *accel_group;
- GtkItemFactory *item_factory;
- Buffer *buffer;
-};
-
-static void push_active_window (GtkWindow *window);
-static void pop_active_window (void);
-static GtkWindow *get_active_window (void);
-
-static Buffer * create_buffer (void);
-static gboolean check_buffer_saved (Buffer *buffer);
-static gboolean save_buffer (Buffer *buffer);
-static gboolean save_as_buffer (Buffer *buffer);
-static char * buffer_pretty_name (Buffer *buffer);
-static void buffer_filename_set (Buffer *buffer);
-static void buffer_search_forward (Buffer *buffer,
- const char *str,
- View *view);
-static void buffer_search_backward (Buffer *buffer,
- const char *str,
- View *view);
-static void buffer_set_colors (Buffer *buffer,
- gboolean enabled);
-static void buffer_cycle_colors (Buffer *buffer);
-
-static View *view_from_widget (GtkWidget *widget);
-
-static View *create_view (Buffer *buffer);
-static void check_close_view (View *view);
-static void close_view (View *view);
-static void view_set_title (View *view);
-static void view_init_menus (View *view);
-static void view_add_example_widgets (View *view);
-
-GSList *buffers = NULL;
-GSList *views = NULL;
-
-static void
-push_active_window (GtkWindow *window)
-{
- g_object_ref (window);
- active_window_stack = g_slist_prepend (active_window_stack, window);
-}
-
-static void
-pop_active_window (void)
-{
- g_object_unref (active_window_stack->data);
- active_window_stack = g_slist_delete_link (active_window_stack, active_window_stack);
-}
-
-static GtkWindow *
-get_active_window (void)
-{
- if (active_window_stack)
- return active_window_stack->data;
- else
- return NULL;
-}
-
-/*
- * Filesel utility function
- */
-
-typedef gboolean (*FileselOKFunc) (const char *filename, gpointer data);
-
-static void
-filesel_ok_cb (GtkWidget *button, GtkWidget *filesel)
-{
- FileselOKFunc ok_func = (FileselOKFunc)g_object_get_data (G_OBJECT (filesel), "ok-func");
- gpointer data = g_object_get_data (G_OBJECT (filesel), "ok-data");
- gint *result = g_object_get_data (G_OBJECT (filesel), "ok-result");
-
- gtk_widget_hide (filesel);
-
- if ((*ok_func) (gtk_file_selection_get_filename (GTK_FILE_SELECTION (filesel)), data))
- {
- gtk_widget_destroy (filesel);
- *result = TRUE;
- }
- else
- gtk_widget_show (filesel);
-}
-
-gboolean
-filesel_run (GtkWindow *parent,
- const char *title,
- const char *start_file,
- FileselOKFunc func,
- gpointer data)
-{
- GtkWidget *filesel = gtk_file_selection_new (title);
- gboolean result = FALSE;
-
- if (!parent)
- parent = get_active_window ();
-
- if (parent)
- gtk_window_set_transient_for (GTK_WINDOW (filesel), parent);
-
- if (start_file)
- gtk_file_selection_set_filename (GTK_FILE_SELECTION (filesel), start_file);
-
-
- g_object_set_data (G_OBJECT (filesel), "ok-func", func);
- g_object_set_data (G_OBJECT (filesel), "ok-data", data);
- g_object_set_data (G_OBJECT (filesel), "ok-result", &result);
-
- g_signal_connect (GTK_FILE_SELECTION (filesel)->ok_button,
- "clicked",
- G_CALLBACK (filesel_ok_cb), filesel);
- g_signal_connect_swapped (GTK_FILE_SELECTION (filesel)->cancel_button,
- "clicked",
- G_CALLBACK (gtk_widget_destroy), filesel);
-
- g_signal_connect (filesel, "destroy",
- G_CALLBACK (gtk_main_quit), NULL);
- gtk_window_set_modal (GTK_WINDOW (filesel), TRUE);
-
- gtk_widget_show (filesel);
- gtk_main ();
-
- return result;
-}
-
-/*
- * MsgBox utility functions
- */
-
-static void
-msgbox_yes_cb (GtkWidget *widget, gboolean *result)
-{
- *result = 0;
- gtk_widget_destroy (gtk_widget_get_toplevel (widget));
-}
-
-static void
-msgbox_no_cb (GtkWidget *widget, gboolean *result)
-{
- *result = 1;
- gtk_widget_destroy (gtk_widget_get_toplevel (widget));
-}
-
-static gboolean
-msgbox_key_press_cb (GtkWidget *widget, GdkEventKey *event, gpointer data)
-{
- if (event->keyval == GDK_Escape)
- {
- g_signal_stop_emission_by_name (widget, "key_press_event");
- gtk_widget_destroy (widget);
- return TRUE;
- }
-
- return FALSE;
-}
-
-/* Don't copy this example, it's all crack-smoking - you can just use
- * GtkMessageDialog now
- */
-gint
-msgbox_run (GtkWindow *parent,
- const char *message,
- const char *yes_button,
- const char *no_button,
- const char *cancel_button,
- gint default_index)
-{
- gboolean result = -1;
- GtkWidget *dialog;
- GtkWidget *button;
- GtkWidget *label;
- GtkWidget *vbox;
- GtkWidget *button_box;
- GtkWidget *separator;
-
- g_return_val_if_fail (message != NULL, FALSE);
- g_return_val_if_fail (default_index >= 0 && default_index <= 1, FALSE);
-
- if (!parent)
- parent = get_active_window ();
-
- /* Create a dialog
- */
- dialog = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
- if (parent)
- gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
- gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
-
- /* Quit our recursive main loop when the dialog is destroyed.
- */
- g_signal_connect (dialog, "destroy",
- G_CALLBACK (gtk_main_quit), NULL);
-
- /* Catch Escape key presses and have them destroy the dialog
- */
- g_signal_connect (dialog, "key_press_event",
- G_CALLBACK (msgbox_key_press_cb), NULL);
-
- /* Fill in the contents of the widget
- */
- vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE, 0);
- gtk_container_add (GTK_CONTAINER (dialog), vbox);
-
- label = gtk_label_new (message);
- gtk_misc_set_padding (GTK_MISC (label), 12, 12);
- gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
- gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
-
- separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
- gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, FALSE, 0);
-
- button_box = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
- gtk_box_pack_start (GTK_BOX (vbox), button_box, FALSE, FALSE, 0);
- gtk_container_set_border_width (GTK_CONTAINER (button_box), 8);
-
-
- /* When Yes is clicked, call the msgbox_yes_cb
- * This sets the result variable and destroys the dialog
- */
- if (yes_button)
- {
- button = gtk_button_new_with_label (yes_button);
- gtk_widget_set_can_default (button, TRUE);
- gtk_container_add (GTK_CONTAINER (button_box), button);
-
- if (default_index == 0)
- gtk_widget_grab_default (button);
-
- g_signal_connect (button, "clicked",
- G_CALLBACK (msgbox_yes_cb), &result);
- }
-
- /* When No is clicked, call the msgbox_no_cb
- * This sets the result variable and destroys the dialog
- */
- if (no_button)
- {
- button = gtk_button_new_with_label (no_button);
- gtk_widget_set_can_default (button, TRUE);
- gtk_container_add (GTK_CONTAINER (button_box), button);
-
- if (default_index == 0)
- gtk_widget_grab_default (button);
-
- g_signal_connect (button, "clicked",
- G_CALLBACK (msgbox_no_cb), &result);
- }
-
- /* When Cancel is clicked, destroy the dialog
- */
- if (cancel_button)
- {
- button = gtk_button_new_with_label (cancel_button);
- gtk_widget_set_can_default (button, TRUE);
- gtk_container_add (GTK_CONTAINER (button_box), button);
-
- if (default_index == 1)
- gtk_widget_grab_default (button);
-
- g_signal_connect_swapped (button, "clicked",
- G_CALLBACK (gtk_object_destroy), dialog);
- }
-
- gtk_widget_show_all (dialog);
-
- /* Run a recursive main loop until a button is clicked
- * or the user destroys the dialog through the window mananger */
- gtk_main ();
-
- return result;
-}
-
-#ifdef DO_BLINK
-/*
- * Example buffer filling code
- */
-static gint
-blink_timeout (gpointer data)
-{
- GtkTextTag *tag;
- static gboolean flip = FALSE;
-
- tag = GTK_TEXT_TAG (data);
-
- g_object_set (tag,
- "foreground", flip ? "blue" : "purple",
- NULL);
-
- flip = !flip;
-
- return TRUE;
-}
-#endif
-
-static gint
-tag_event_handler (GtkTextTag *tag, GtkWidget *widget, GdkEvent *event,
- const GtkTextIter *iter, gpointer user_data)
-{
- gint char_index;
-
- char_index = gtk_text_iter_get_offset (iter);
-
- switch (event->type)
- {
- case GDK_MOTION_NOTIFY:
- printf ("Motion event at char %d tag `%s'\n",
- char_index, tag->name);
- break;
-
- case GDK_BUTTON_PRESS:
- printf ("Button press at char %d tag `%s'\n",
- char_index, tag->name);
- break;
-
- case GDK_2BUTTON_PRESS:
- printf ("Double click at char %d tag `%s'\n",
- char_index, tag->name);
- break;
-
- case GDK_3BUTTON_PRESS:
- printf ("Triple click at char %d tag `%s'\n",
- char_index, tag->name);
- break;
-
- case GDK_BUTTON_RELEASE:
- printf ("Button release at char %d tag `%s'\n",
- char_index, tag->name);
- break;
-
- case GDK_KEY_PRESS:
- case GDK_KEY_RELEASE:
- printf ("Key event at char %d tag `%s'\n",
- char_index, tag->name);
- break;
-
- case GDK_ENTER_NOTIFY:
- case GDK_LEAVE_NOTIFY:
- case GDK_PROPERTY_NOTIFY:
- case GDK_SELECTION_CLEAR:
- case GDK_SELECTION_REQUEST:
- case GDK_SELECTION_NOTIFY:
- case GDK_PROXIMITY_IN:
- case GDK_PROXIMITY_OUT:
- case GDK_DRAG_ENTER:
- case GDK_DRAG_LEAVE:
- case GDK_DRAG_MOTION:
- case GDK_DRAG_STATUS:
- case GDK_DROP_START:
- case GDK_DROP_FINISHED:
- default:
- break;
- }
-
- return FALSE;
-}
-
-static void
-setup_tag (GtkTextTag *tag)
-{
- g_signal_connect (tag,
- "event",
- G_CALLBACK (tag_event_handler),
- NULL);
-}
-
-static const char *book_closed_xpm[] = {
-"16 16 6 1",
-" c None s None",
-". c black",
-"X c red",
-"o c yellow",
-"O c #808080",
-"# c white",
-" ",
-" .. ",
-" ..XX. ",
-" ..XXXXX. ",
-" ..XXXXXXXX. ",
-".ooXXXXXXXXX. ",
-"..ooXXXXXXXXX. ",
-".X.ooXXXXXXXXX. ",
-".XX.ooXXXXXX.. ",
-" .XX.ooXXX..#O ",
-" .XX.oo..##OO. ",
-" .XX..##OO.. ",
-" .X.#OO.. ",
-" ..O.. ",
-" .. ",
-" "};
-
-void
-fill_example_buffer (GtkTextBuffer *buffer)
-{
- GtkTextIter iter, iter2;
- GtkTextTag *tag;
- GtkTextChildAnchor *anchor;
- GdkColor color;
- GdkColor color2;
- GdkPixbuf *pixbuf;
- int i;
- char *str;
-
- /* FIXME this is broken if called twice on a buffer, since
- * we try to create tags a second time.
- */
-
- tag = gtk_text_buffer_create_tag (buffer, "fg_blue", NULL);
-
-#ifdef DO_BLINK
- g_timeout_add (1000, (GSourceFunc)blink_timeout, tag);
-#endif
-
- setup_tag (tag);
-
- color.red = color.green = 0;
- color.blue = 0xffff;
- color2.red = 0xfff;
- color2.blue = 0x0;
- color2.green = 0;
- g_object_set (tag,
- "foreground_gdk", &color,
- "background_gdk", &color2,
- "size_points", 24.0,
- NULL);
-
- tag = gtk_text_buffer_create_tag (buffer, "fg_red", NULL);
-
- setup_tag (tag);
-
- color.blue = color.green = 0;
- color.red = 0xffff;
- g_object_set (tag,
- "rise", -4 * PANGO_SCALE,
- "foreground_gdk", &color,
- NULL);
-
- tag = gtk_text_buffer_create_tag (buffer, "bg_green", NULL);
-
- setup_tag (tag);
-
- color.blue = color.red = 0;
- color.green = 0xffff;
- g_object_set (tag,
- "background_gdk", &color,
- "size_points", 10.0,
- NULL);
-
- tag = gtk_text_buffer_create_tag (buffer, "strikethrough", NULL);
-
- setup_tag (tag);
-
- g_object_set (tag,
- "strikethrough", TRUE,
- NULL);
-
-
- tag = gtk_text_buffer_create_tag (buffer, "underline", NULL);
-
- setup_tag (tag);
-
- g_object_set (tag,
- "underline", PANGO_UNDERLINE_SINGLE,
- NULL);
-
- tag = gtk_text_buffer_create_tag (buffer, "underline_error", NULL);
-
- setup_tag (tag);
-
- g_object_set (tag,
- "underline", PANGO_UNDERLINE_ERROR,
- NULL);
-
- tag = gtk_text_buffer_create_tag (buffer, "centered", NULL);
-
- g_object_set (tag,
- "justification", GTK_JUSTIFY_CENTER,
- NULL);
-
- tag = gtk_text_buffer_create_tag (buffer, "rtl_quote", NULL);
-
- g_object_set (tag,
- "wrap_mode", GTK_WRAP_WORD,
- "direction", GTK_TEXT_DIR_RTL,
- "indent", 30,
- "left_margin", 20,
- "right_margin", 20,
- NULL);
-
-
- tag = gtk_text_buffer_create_tag (buffer, "negative_indent", NULL);
-
- g_object_set (tag,
- "indent", -25,
- NULL);
-
- gtk_text_buffer_get_iter_at_offset (buffer, &iter, 0);
-
- anchor = gtk_text_buffer_create_child_anchor (buffer, &iter);
-
- g_object_ref (anchor);
-
- g_object_set_data_full (G_OBJECT (buffer), "anchor", anchor,
- (GDestroyNotify) g_object_unref);
-
- pixbuf = gdk_pixbuf_new_from_xpm_data (book_closed_xpm);
-
- i = 0;
- while (i < 100)
- {
- GtkTextMark * temp_mark;
-
- gtk_text_buffer_get_iter_at_offset (buffer, &iter, 0);
-
- gtk_text_buffer_insert_pixbuf (buffer, &iter, pixbuf);
-
- str = g_strdup_printf ("%d Hello World! blah blah blah blah blah blah blah blah blah blah blah blah\nwoo woo woo woo woo woo woo woo woo woo woo woo woo woo woo\n",
- i);
-
- gtk_text_buffer_insert (buffer, &iter, str, -1);
-
- g_free (str);
-
- gtk_text_buffer_get_iter_at_line_offset (buffer, &iter, 0, 5);
-
- gtk_text_buffer_insert (buffer, &iter,
- "(Hello World!)\nfoo foo Hello this is some text we are using to text word wrap. It has punctuation! gee; blah - hmm, great.\nnew line with a significant quantity of text on it. This line really does contain some text. More text! More text! More text!\n"
- /* This is UTF8 stuff, Emacs doesn't
- really know how to display it */
- "German (Deutsch S\303\274d) Gr\303\274\303\237 Gott Greek (\316\225\316\273\316\273\316\267\316\275\316\271\316\272\316\254) \316\223\316\265\316\271\316\254 \317\203\316\261\317\202 Hebrew(\327\251\327\234\327\225\327\235) Hebrew punctuation(\xd6\xbf\327\251\xd6\xbb\xd6\xbc\xd6\xbb\xd6\xbf\327\234\xd6\xbc\327\225\xd6\xbc\xd6\xbb\xd6\xbb\xd6\xbf\327\235\xd6\xbc\xd6\xbb\xd6\xbf) Japanese (\346\227\245\346\234\254\350\252\236) Thai (\340\270\252\340\270\247\340\270\261\340\270\252\340\270\224\340\270\265\340\270\204\340\270\243\340\270\261\340\270\232) Thai wrong spelling (\340\270\204\340\270\263\340\270\225\340\271\210\340\270\255\340\271\204\340\270\233\340\270\231\340\270\267\340\271\210\340\270\252\340\270\260\340\270\201\340\270\224\340\270\234\340\270\264\340\270\224 \340\270\236\340\270\261\340\270\261\340\271\211\340\270\261\340\270\261\340\271\210\340\270\207\340\271\202\340\270\201\340\270\260)\n", -1);
-
- temp_mark =
- gtk_text_buffer_create_mark (buffer, "tmp_mark", &iter, TRUE);
-
-#if 1
- gtk_text_buffer_get_iter_at_line_offset (buffer, &iter, 0, 6);
- gtk_text_buffer_get_iter_at_line_offset (buffer, &iter2, 0, 13);
-
- gtk_text_buffer_apply_tag_by_name (buffer, "fg_blue", &iter, &iter2);
-
- gtk_text_buffer_get_iter_at_line_offset (buffer, &iter, 1, 10);
- gtk_text_buffer_get_iter_at_line_offset (buffer, &iter2, 1, 16);
-
- gtk_text_buffer_apply_tag_by_name (buffer, "underline", &iter, &iter2);
-
- gtk_text_buffer_get_iter_at_line_offset (buffer, &iter, 1, 4);
- gtk_text_buffer_get_iter_at_line_offset (buffer, &iter2, 1, 7);
-
- gtk_text_buffer_apply_tag_by_name (buffer, "underline_error", &iter, &iter2);
-
- gtk_text_buffer_get_iter_at_line_offset (buffer, &iter, 1, 14);
- gtk_text_buffer_get_iter_at_line_offset (buffer, &iter2, 1, 24);
-
- gtk_text_buffer_apply_tag_by_name (buffer, "strikethrough", &iter, &iter2);
-
- gtk_text_buffer_get_iter_at_line_offset (buffer, &iter, 0, 9);
- gtk_text_buffer_get_iter_at_line_offset (buffer, &iter2, 0, 16);
-
- gtk_text_buffer_apply_tag_by_name (buffer, "bg_green", &iter, &iter2);
-
- gtk_text_buffer_get_iter_at_line_offset (buffer, &iter, 4, 2);
- gtk_text_buffer_get_iter_at_line_offset (buffer, &iter2, 4, 10);
-
- gtk_text_buffer_apply_tag_by_name (buffer, "bg_green", &iter, &iter2);
-
- gtk_text_buffer_get_iter_at_line_offset (buffer, &iter, 4, 8);
- gtk_text_buffer_get_iter_at_line_offset (buffer, &iter2, 4, 15);
-
- gtk_text_buffer_apply_tag_by_name (buffer, "fg_red", &iter, &iter2);
-#endif
-
- gtk_text_buffer_get_iter_at_mark (buffer, &iter, temp_mark);
- gtk_text_buffer_insert (buffer, &iter, "Centered text!\n", -1);
-
- gtk_text_buffer_get_iter_at_mark (buffer, &iter2, temp_mark);
- gtk_text_buffer_apply_tag_by_name (buffer, "centered", &iter2, &iter);
-
- gtk_text_buffer_move_mark (buffer, temp_mark, &iter);
- gtk_text_buffer_insert (buffer, &iter, "Word wrapped, Right-to-left Quote\n", -1);
- gtk_text_buffer_insert (buffer, &iter, "\331\210\331\202\330\257 \330\250\330\257\330\243 \330\253\331\204\330\247\330\253 \331\205\331\206 \330\243\331\203\330\253\330\261 \330\247\331\204\331\205\330\244\330\263\330\263\330\247\330\252 \330\252\331\202\330\257\331\205\330\247 \331\201\331\212 \330\264\330\250\331\203\330\251 \330\247\331\203\330\263\331\212\331\210\331\206 \330\250\330\261\330\247\331\205\330\254\331\207\330\247 \331\203\331\205\331\206\330\270\331\205\330\247\330\252 \331\204\330\247 \330\252\330\263\330\271\331\211 \331\204\331\204\330\261\330\250\330\255\330\214 \330\253\331\205 \330\252\330\255\331\210\331\204\330\252 \331\201\331\212 \330\247\331\204\330\263\331\206\331\210\330\247\330\252 \330\247\331\204\330\256\331\205\330\263 \330\247\331\204\331\205\330\247\330\266\331\212\330\251 \330\245\331\204\331\211 \331\205\330\244\330\263\330\263\330\247\330\252 \331\205\330\247\331\204\331\212\330\251 \331\205\331\206\330\270\331\205\330\251\330\214 \331\210\330\250\330\247\330\252\330\252 \330\254\330\262\330\241\330\247 \331\205\331\206 \330\247\331\204\331\206\330\270\330\247\331\205 \330\247\331\204\331\205\330\247\331\204\331\212 \331\201\331\212 \330\250\331\204\330\257\330\247\331\206\331\207\330\247\330\214 \331\210\331\204\331\203\331\206\331\207\330\247 \330\252\330\252\330\256\330\265\330\265 \331\201\331\212 \330\256\330\257\331\205\330\251 \331\202\330\267\330\247\330\271 \330\247\331\204\331\205\330\264\330\261\331\210\330\271\330\247\330\252 \330\247\331\204\330\265\330\272\331\212\330\261\330\251. \331\210\330\243\330\255\330\257 \330\243\331\203\330\253\330\261 \331\207\330\260\331\207 \330\247\331\204\331\205\330\244\330\263\330\263\330\247\330\252 \331\206\330\254\330\247\330\255\330\247 \331\207\331\210 \302\273\330\250\330\247\331\206\331\203\331\210\330\263\331\210\331\204\302\253 \331\201\331\212 \330\250\331\210\331\204\331\212\331\201\331\212\330\247.\n", -1);
- gtk_text_buffer_get_iter_at_mark (buffer, &iter2, temp_mark);
- gtk_text_buffer_apply_tag_by_name (buffer, "rtl_quote", &iter2, &iter);
-
- gtk_text_buffer_insert_with_tags (buffer, &iter,
- "Paragraph with negative indentation. blah blah blah blah blah. The quick brown fox jumped over the lazy dog.\n",
- -1,
- gtk_text_tag_table_lookup (gtk_text_buffer_get_tag_table (buffer),
- "negative_indent"),
- NULL);
-
- ++i;
- }
-
- g_object_unref (pixbuf);
-
- printf ("%d lines %d chars\n",
- gtk_text_buffer_get_line_count (buffer),
- gtk_text_buffer_get_char_count (buffer));
-
- /* Move cursor to start */
- gtk_text_buffer_get_iter_at_offset (buffer, &iter, 0);
- gtk_text_buffer_place_cursor (buffer, &iter);
-
- gtk_text_buffer_set_modified (buffer, FALSE);
-}
-
-gboolean
-fill_file_buffer (GtkTextBuffer *buffer, const char *filename)
-{
- FILE* f;
- gchar buf[2048];
- gint remaining = 0;
- GtkTextIter iter, end;
-
- f = fopen (filename, "r");
-
- if (f == NULL)
- {
- gchar *err = g_strdup_printf ("Cannot open file '%s': %s",
- filename, g_strerror (errno));
- msgbox_run (NULL, err, "OK", NULL, NULL, 0);
- g_free (err);
- return FALSE;
- }
-
- gtk_text_buffer_get_iter_at_offset (buffer, &iter, 0);
- while (!feof (f))
- {
- gint count;
- const char *leftover;
- int to_read = 2047 - remaining;
-
- count = fread (buf + remaining, 1, to_read, f);
- buf[count + remaining] = '\0';
-
- g_utf8_validate (buf, count + remaining, &leftover);
-
- g_assert (g_utf8_validate (buf, leftover - buf, NULL));
- gtk_text_buffer_insert (buffer, &iter, buf, leftover - buf);
-
- remaining = (buf + remaining + count) - leftover;
- g_memmove (buf, leftover, remaining);
-
- if (remaining > 6 || count < to_read)
- break;
- }
-
- if (remaining)
- {
- gchar *err = g_strdup_printf ("Invalid UTF-8 data encountered reading file '%s'", filename);
- msgbox_run (NULL, err, "OK", NULL, NULL, 0);
- g_free (err);
- }
-
- /* We had a newline in the buffer to begin with. (The buffer always contains
- * a newline, so we delete to the end of the buffer to clean up.
- */
- gtk_text_buffer_get_end_iter (buffer, &end);
- gtk_text_buffer_delete (buffer, &iter, &end);
-
- gtk_text_buffer_set_modified (buffer, FALSE);
-
- return TRUE;
-}
-
-static gint
-delete_event_cb (GtkWidget *window, GdkEventAny *event, gpointer data)
-{
- View *view = view_from_widget (window);
-
- push_active_window (GTK_WINDOW (window));
- check_close_view (view);
- pop_active_window ();
-
- return TRUE;
-}
-
-/*
- * Menu callbacks
- */
-
-static View *
-get_empty_view (View *view)
-{
- if (!view->buffer->filename &&
- !gtk_text_buffer_get_modified (view->buffer->buffer))
- return view;
- else
- return create_view (create_buffer ());
-}
-
-static View *
-view_from_widget (GtkWidget *widget)
-{
- if (GTK_IS_MENU_ITEM (widget))
- {
- GtkItemFactory *item_factory = gtk_item_factory_from_widget (widget);
- return g_object_get_data (G_OBJECT (item_factory), "view");
- }
- else
- {
- GtkWidget *app = gtk_widget_get_toplevel (widget);
- return g_object_get_data (G_OBJECT (app), "view");
- }
-}
-
-static void
-do_new (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- create_view (create_buffer ());
-}
-
-static void
-do_new_view (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
-
- create_view (view->buffer);
-}
-
-gboolean
-open_ok_func (const char *filename, gpointer data)
-{
- View *view = data;
- View *new_view = get_empty_view (view);
-
- if (!fill_file_buffer (new_view->buffer->buffer, filename))
- {
- if (new_view != view)
- close_view (new_view);
- return FALSE;
- }
- else
- {
- g_free (new_view->buffer->filename);
- new_view->buffer->filename = g_strdup (filename);
- buffer_filename_set (new_view->buffer);
-
- return TRUE;
- }
-}
-
-static void
-do_open (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
-
- push_active_window (GTK_WINDOW (view->window));
- filesel_run (NULL, "Open File", NULL, open_ok_func, view);
- pop_active_window ();
-}
-
-static void
-do_save_as (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
-
- push_active_window (GTK_WINDOW (view->window));
- save_as_buffer (view->buffer);
- pop_active_window ();
-}
-
-static void
-do_save (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
-
- push_active_window (GTK_WINDOW (view->window));
- if (!view->buffer->filename)
- do_save_as (callback_data, callback_action, widget);
- else
- save_buffer (view->buffer);
- pop_active_window ();
-}
-
-static void
-do_close (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
-
- push_active_window (GTK_WINDOW (view->window));
- check_close_view (view);
- pop_active_window ();
-}
-
-static void
-do_exit (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
-
- GSList *tmp_list = buffers;
-
- push_active_window (GTK_WINDOW (view->window));
- while (tmp_list)
- {
- if (!check_buffer_saved (tmp_list->data))
- return;
-
- tmp_list = tmp_list->next;
- }
-
- gtk_main_quit ();
- pop_active_window ();
-}
-
-static void
-do_example (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
- View *new_view;
-
- new_view = get_empty_view (view);
-
- fill_example_buffer (new_view->buffer->buffer);
-
- view_add_example_widgets (new_view);
-}
-
-
-static void
-do_insert_and_scroll (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
- GtkTextBuffer *buffer;
- GtkTextIter start, end;
- GtkTextMark *mark;
-
- buffer = view->buffer->buffer;
-
- gtk_text_buffer_get_bounds (buffer, &start, &end);
- mark = gtk_text_buffer_create_mark (buffer, NULL, &end, /* right grav */ FALSE);
-
- gtk_text_buffer_insert (buffer, &end,
- "Hello this is multiple lines of text\n"
- "Line 1\n" "Line 2\n"
- "Line 3\n" "Line 4\n"
- "Line 5\n",
- -1);
-
- gtk_text_view_scroll_to_mark (GTK_TEXT_VIEW (view->text_view), mark,
- 0, TRUE, 0.0, 1.0);
- gtk_text_buffer_delete_mark (buffer, mark);
-}
-
-static void
-do_wrap_changed (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
-
- gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view->text_view), callback_action);
-}
-
-static void
-do_direction_changed (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
-
- gtk_widget_set_direction (view->text_view, callback_action);
- gtk_widget_queue_resize (view->text_view);
-}
-
-
-static void
-do_spacing_changed (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
-
- if (callback_action)
- {
- gtk_text_view_set_pixels_above_lines (GTK_TEXT_VIEW (view->text_view),
- 23);
- gtk_text_view_set_pixels_below_lines (GTK_TEXT_VIEW (view->text_view),
- 21);
- gtk_text_view_set_pixels_inside_wrap (GTK_TEXT_VIEW (view->text_view),
- 9);
- }
- else
- {
- gtk_text_view_set_pixels_above_lines (GTK_TEXT_VIEW (view->text_view),
- 0);
- gtk_text_view_set_pixels_below_lines (GTK_TEXT_VIEW (view->text_view),
- 0);
- gtk_text_view_set_pixels_inside_wrap (GTK_TEXT_VIEW (view->text_view),
- 0);
- }
-}
-
-static void
-do_editable_changed (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
-
- gtk_text_view_set_editable (GTK_TEXT_VIEW (view->text_view), callback_action);
-}
-
-static void
-change_cursor_color (GtkWidget *widget,
- gboolean set)
-{
- if (set)
- {
- GdkColor red = {0, 65535, 0, 0};
- gtk_widget_modify_cursor (widget, &red, &red);
- }
- else
- gtk_widget_modify_cursor (widget, NULL, NULL);
-}
-
-static void
-do_cursor_visible_changed (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
-
- switch (callback_action)
- {
- case 0:
- gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view->text_view), FALSE);
- break;
- case 1:
- gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view->text_view), TRUE);
- change_cursor_color (view->text_view, FALSE);
- break;
- case 2:
- gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view->text_view), TRUE);
- change_cursor_color (view->text_view, TRUE);
- break;
- }
-}
-
-static void
-do_color_cycle_changed (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
-
- buffer_set_colors (view->buffer, callback_action);
-}
-
-static void
-do_apply_editable (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
- GtkTextIter start;
- GtkTextIter end;
-
- if (gtk_text_buffer_get_selection_bounds (view->buffer->buffer,
- &start, &end))
- {
- if (callback_action)
- {
- gtk_text_buffer_remove_tag (view->buffer->buffer,
- view->buffer->not_editable_tag,
- &start, &end);
- }
- else
- {
- gtk_text_buffer_apply_tag (view->buffer->buffer,
- view->buffer->not_editable_tag,
- &start, &end);
- }
- }
-}
-
-static void
-do_apply_invisible (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
- GtkTextIter start;
- GtkTextIter end;
-
- if (gtk_text_buffer_get_selection_bounds (view->buffer->buffer,
- &start, &end))
- {
- if (callback_action)
- {
- gtk_text_buffer_remove_tag (view->buffer->buffer,
- view->buffer->invisible_tag,
- &start, &end);
- }
- else
- {
- gtk_text_buffer_apply_tag (view->buffer->buffer,
- view->buffer->invisible_tag,
- &start, &end);
- }
- }
-}
-
-static void
-do_apply_rise (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
- GtkTextIter start;
- GtkTextIter end;
-
- if (gtk_text_buffer_get_selection_bounds (view->buffer->buffer,
- &start, &end))
- {
- if (callback_action)
- {
- gtk_text_buffer_remove_tag (view->buffer->buffer,
- view->buffer->rise_tag,
- &start, &end);
- }
- else
- {
- gtk_text_buffer_apply_tag (view->buffer->buffer,
- view->buffer->rise_tag,
- &start, &end);
- }
- }
-}
-
-static void
-do_apply_large (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
- GtkTextIter start;
- GtkTextIter end;
-
- if (gtk_text_buffer_get_selection_bounds (view->buffer->buffer,
- &start, &end))
- {
- if (callback_action)
- {
- gtk_text_buffer_remove_tag (view->buffer->buffer,
- view->buffer->large_tag,
- &start, &end);
- }
- else
- {
- gtk_text_buffer_apply_tag (view->buffer->buffer,
- view->buffer->large_tag,
- &start, &end);
- }
- }
-}
-
-static void
-do_apply_indent (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
- GtkTextIter start;
- GtkTextIter end;
-
- if (gtk_text_buffer_get_selection_bounds (view->buffer->buffer,
- &start, &end))
- {
- if (callback_action)
- {
- gtk_text_buffer_remove_tag (view->buffer->buffer,
- view->buffer->indent_tag,
- &start, &end);
- }
- else
- {
- gtk_text_buffer_apply_tag (view->buffer->buffer,
- view->buffer->indent_tag,
- &start, &end);
- }
- }
-}
-
-static void
-do_apply_margin (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
- GtkTextIter start;
- GtkTextIter end;
-
- if (gtk_text_buffer_get_selection_bounds (view->buffer->buffer,
- &start, &end))
- {
- if (callback_action)
- {
- gtk_text_buffer_remove_tag (view->buffer->buffer,
- view->buffer->margin_tag,
- &start, &end);
- }
- else
- {
- gtk_text_buffer_apply_tag (view->buffer->buffer,
- view->buffer->margin_tag,
- &start, &end);
- }
- }
-}
-
-static void
-do_apply_tabs (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
- GtkTextIter start;
- GtkTextIter end;
-
- if (gtk_text_buffer_get_selection_bounds (view->buffer->buffer,
- &start, &end))
- {
- if (callback_action)
- {
- gtk_text_buffer_remove_tag (view->buffer->buffer,
- view->buffer->custom_tabs_tag,
- &start, &end);
- }
- else
- {
- gtk_text_buffer_apply_tag (view->buffer->buffer,
- view->buffer->custom_tabs_tag,
- &start, &end);
- }
- }
-}
-
-static void
-do_apply_colors (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
- Buffer *buffer = view->buffer;
- GtkTextIter start;
- GtkTextIter end;
-
- if (gtk_text_buffer_get_selection_bounds (view->buffer->buffer,
- &start, &end))
- {
- if (!callback_action)
- {
- GSList *tmp;
-
- tmp = buffer->color_tags;
- while (tmp != NULL)
- {
- gtk_text_buffer_remove_tag (view->buffer->buffer,
- tmp->data,
- &start, &end);
- tmp = g_slist_next (tmp);
- }
- }
- else
- {
- GSList *tmp;
-
- tmp = buffer->color_tags;
- while (TRUE)
- {
- GtkTextIter next;
- gboolean done = FALSE;
-
- next = start;
- gtk_text_iter_forward_char (&next);
- gtk_text_iter_forward_char (&next);
-
- if (gtk_text_iter_compare (&next, &end) >= 0)
- {
- next = end;
- done = TRUE;
- }
-
- gtk_text_buffer_apply_tag (view->buffer->buffer,
- tmp->data,
- &start, &next);
-
- start = next;
-
- if (done)
- return;
-
- tmp = g_slist_next (tmp);
- if (tmp == NULL)
- tmp = buffer->color_tags;
- }
- }
- }
-}
-
-static void
-do_remove_tags (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
- GtkTextIter start;
- GtkTextIter end;
-
- if (gtk_text_buffer_get_selection_bounds (view->buffer->buffer,
- &start, &end))
- {
- gtk_text_buffer_remove_all_tags (view->buffer->buffer,
- &start, &end);
- }
-}
-
-static void
-do_properties (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
-
- create_prop_editor (G_OBJECT (view->text_view), 0);
-}
-
-static void
-rich_text_store_populate (GtkListStore *store,
- GtkTextBuffer *buffer,
- gboolean deserialize)
-{
- GdkAtom *formats;
- gint n_formats;
- gint i;
-
- gtk_list_store_clear (store);
-
- if (deserialize)
- formats = gtk_text_buffer_get_deserialize_formats (buffer, &n_formats);
- else
- formats = gtk_text_buffer_get_serialize_formats (buffer, &n_formats);
-
- for (i = 0; i < n_formats; i++)
- {
- GtkTreeIter iter;
- gchar *mime_type;
- gboolean can_create_tags = FALSE;
-
- mime_type = gdk_atom_name (formats[i]);
-
- if (deserialize)
- can_create_tags =
- gtk_text_buffer_deserialize_get_can_create_tags (buffer, formats[i]);
-
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter,
- 0, formats[i],
- 1, mime_type,
- 2, can_create_tags,
- -1);
-
- g_free (mime_type);
- }
-
- g_free (formats);
-}
-
-static void
-rich_text_paste_target_list_notify (GtkTextBuffer *buffer,
- const GParamSpec *pspec,
- GtkListStore *store)
-{
- rich_text_store_populate (store, buffer, TRUE);
-}
-
-static void
-rich_text_copy_target_list_notify (GtkTextBuffer *buffer,
- const GParamSpec *pspec,
- GtkListStore *store)
-{
- rich_text_store_populate (store, buffer, FALSE);
-}
-
-static void
-rich_text_can_create_tags_toggled (GtkCellRendererToggle *toggle,
- const gchar *path,
- GtkTreeModel *model)
-{
- GtkTreeIter iter;
-
- if (gtk_tree_model_get_iter_from_string (model, &iter, path))
- {
- GtkTextBuffer *buffer;
- GdkAtom format;
- gboolean can_create_tags;
-
- buffer = g_object_get_data (G_OBJECT (model), "buffer");
-
- gtk_tree_model_get (model, &iter,
- 0, &format,
- 2, &can_create_tags,
- -1);
-
- gtk_text_buffer_deserialize_set_can_create_tags (buffer, format,
- !can_create_tags);
-
- gtk_list_store_set (GTK_LIST_STORE (model), &iter,
- 2, !can_create_tags,
- -1);
- }
-}
-
-static void
-rich_text_unregister_clicked (GtkWidget *button,
- GtkTreeView *tv)
-{
- GtkTreeSelection *sel = gtk_tree_view_get_selection (tv);
- GtkTreeModel *model;
- GtkTreeIter iter;
-
- if (gtk_tree_selection_get_selected (sel, &model, &iter))
- {
- GtkTextBuffer *buffer;
- gboolean deserialize;
- GdkAtom format;
-
- buffer = g_object_get_data (G_OBJECT (model), "buffer");
- deserialize = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (model),
- "deserialize"));
-
- gtk_tree_model_get (model, &iter,
- 0, &format,
- -1);
-
- if (deserialize)
- gtk_text_buffer_unregister_deserialize_format (buffer, format);
- else
- gtk_text_buffer_unregister_serialize_format (buffer, format);
- }
-}
-
-static void
-rich_text_register_clicked (GtkWidget *button,
- GtkTreeView *tv)
-{
- GtkWidget *dialog;
- GtkWidget *label;
- GtkWidget *entry;
-
- dialog = gtk_dialog_new_with_buttons ("Register new Tagset",
- GTK_WINDOW (gtk_widget_get_toplevel (button)),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
- label = gtk_label_new ("Enter tagset name or leave blank for "
- "unrestricted internal format:");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), label,
- FALSE, FALSE, 0);
-
- entry = gtk_entry_new ();
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), entry,
- FALSE, FALSE, 0);
-
- gtk_widget_show_all (dialog);
-
- if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK)
- {
- GtkTreeModel *model = gtk_tree_view_get_model (tv);
- GtkTextBuffer *buffer = g_object_get_data (G_OBJECT (model), "buffer");
- const gchar *tagset = gtk_entry_get_text (GTK_ENTRY (entry));
- gboolean deserialize;
-
- deserialize = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (model),
- "deserialize"));
-
- if (tagset && ! strlen (tagset))
- tagset = NULL;
-
- if (deserialize)
- gtk_text_buffer_register_deserialize_tagset (buffer, tagset);
- else
- gtk_text_buffer_register_serialize_tagset (buffer, tagset);
- }
-
- gtk_widget_destroy (dialog);
-}
-
-static void
-do_rich_text (gpointer callback_data,
- guint deserialize,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
- GtkTextBuffer *buffer;
- GtkWidget *dialog;
- GtkWidget *tv;
- GtkWidget *sw;
- GtkWidget *hbox;
- GtkWidget *button;
- GtkListStore *store;
-
- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view->text_view));
-
- dialog = gtk_dialog_new_with_buttons (deserialize ?
- "Rich Text Paste & Drop" :
- "Rich Text Copy & Drag",
- GTK_WINDOW (view->window),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_STOCK_CLOSE, 0,
- NULL);
- g_signal_connect (dialog, "response",
- G_CALLBACK (gtk_widget_destroy),
- NULL);
-
- store = gtk_list_store_new (3,
- G_TYPE_POINTER,
- G_TYPE_STRING,
- G_TYPE_BOOLEAN);
-
- g_object_set_data (G_OBJECT (store), "buffer", buffer);
- g_object_set_data (G_OBJECT (store), "deserialize",
- GUINT_TO_POINTER (deserialize));
-
- tv = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
- g_object_unref (store);
-
- gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tv),
- 0, "Rich Text Format",
- gtk_cell_renderer_text_new (),
- "text", 1,
- NULL);
-
- if (deserialize)
- {
- GtkCellRenderer *renderer = gtk_cell_renderer_toggle_new ();
-
- gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tv),
- 1, "Can Create Tags",
- renderer,
- "active", 2,
- NULL);
-
- g_signal_connect (renderer, "toggled",
- G_CALLBACK (rich_text_can_create_tags_toggled),
- store);
- }
-
- sw = gtk_scrolled_window_new (NULL, NULL);
- gtk_widget_set_size_request (sw, 300, 100);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), sw);
-
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw), tv);
-
- hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 6);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox,
- FALSE, FALSE, 0);
-
- button = gtk_button_new_with_label ("Unregister Selected Format");
- gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
-
- g_signal_connect (button, "clicked",
- G_CALLBACK (rich_text_unregister_clicked),
- tv);
-
- button = gtk_button_new_with_label ("Register New Tagset\n"
- "for the Internal Format");
- gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
-
- g_signal_connect (button, "clicked",
- G_CALLBACK (rich_text_register_clicked),
- tv);
-
- if (deserialize)
- g_signal_connect_object (buffer, "notify::paste-target-list",
- G_CALLBACK (rich_text_paste_target_list_notify),
- G_OBJECT (store), 0);
- else
- g_signal_connect_object (buffer, "notify::copy-target-list",
- G_CALLBACK (rich_text_copy_target_list_notify),
- G_OBJECT (store), 0);
-
- rich_text_store_populate (store, buffer, deserialize);
-
- gtk_widget_show_all (dialog);
-}
-
-enum
-{
- RESPONSE_FORWARD,
- RESPONSE_BACKWARD
-};
-
-static void
-dialog_response_callback (GtkWidget *dialog, gint response_id, gpointer data)
-{
- GtkTextBuffer *buffer;
- View *view = data;
- GtkTextIter start, end;
- gchar *search_string;
-
- if (response_id != RESPONSE_FORWARD &&
- response_id != RESPONSE_BACKWARD)
- {
- gtk_widget_destroy (dialog);
- return;
- }
-
- buffer = g_object_get_data (G_OBJECT (dialog), "buffer");
-
- gtk_text_buffer_get_bounds (buffer, &start, &end);
-
- search_string = gtk_text_iter_get_text (&start, &end);
-
- g_print ("Searching for `%s'\n", search_string);
-
- if (response_id == RESPONSE_FORWARD)
- buffer_search_forward (view->buffer, search_string, view);
- else if (response_id == RESPONSE_BACKWARD)
- buffer_search_backward (view->buffer, search_string, view);
-
- g_free (search_string);
-
- gtk_widget_destroy (dialog);
-}
-
-static void
-do_copy (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
- GtkTextBuffer *buffer;
-
- buffer = view->buffer->buffer;
-
- gtk_text_buffer_copy_clipboard (buffer,
- gtk_clipboard_get (GDK_NONE));
-}
-
-static void
-do_search (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
- GtkWidget *dialog;
- GtkWidget *search_text;
- GtkTextBuffer *buffer;
-
- dialog = gtk_dialog_new_with_buttons ("Search",
- GTK_WINDOW (view->window),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- "Forward", RESPONSE_FORWARD,
- "Backward", RESPONSE_BACKWARD,
- GTK_STOCK_CANCEL,
- GTK_RESPONSE_NONE, NULL);
-
-
- buffer = gtk_text_buffer_new (NULL);
-
- search_text = gtk_text_view_new_with_buffer (buffer);
-
- g_object_unref (buffer);
-
- gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog)->vbox),
- search_text,
- TRUE, TRUE, 0);
-
- g_object_set_data (G_OBJECT (dialog), "buffer", buffer);
-
- g_signal_connect (dialog,
- "response",
- G_CALLBACK (dialog_response_callback),
- view);
-
- gtk_widget_show (search_text);
-
- gtk_widget_grab_focus (search_text);
-
- gtk_widget_show_all (dialog);
-}
-
-static void
-do_select_all (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
- GtkTextBuffer *buffer;
- GtkTextIter start, end;
-
- buffer = view->buffer->buffer;
-
- gtk_text_buffer_get_bounds (buffer, &start, &end);
- gtk_text_buffer_select_range (buffer, &start, &end);
-}
-
-typedef struct
-{
- /* position is in coordinate system of text_view_move_child */
- int click_x;
- int click_y;
- int start_x;
- int start_y;
- int button;
-} ChildMoveInfo;
-
-static gboolean
-movable_child_callback (GtkWidget *child,
- GdkEvent *event,
- gpointer data)
-{
- ChildMoveInfo *info;
- GtkTextView *text_view;
-
- text_view = GTK_TEXT_VIEW (data);
-
- g_return_val_if_fail (GTK_IS_EVENT_BOX (child), FALSE);
- g_return_val_if_fail (gtk_widget_get_parent (child) == GTK_WIDGET (text_view), FALSE);
-
- info = g_object_get_data (G_OBJECT (child),
- "testtext-move-info");
-
- if (info == NULL)
- {
- info = g_new (ChildMoveInfo, 1);
- info->start_x = -1;
- info->start_y = -1;
- info->button = -1;
- g_object_set_data_full (G_OBJECT (child),
- "testtext-move-info",
- info,
- g_free);
- }
-
- switch (event->type)
- {
- case GDK_BUTTON_PRESS:
- if (info->button < 0)
- {
- if (gdk_pointer_grab (event->button.window,
- FALSE,
- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
- GDK_BUTTON_RELEASE_MASK,
- NULL,
- NULL,
- event->button.time) != GDK_GRAB_SUCCESS)
- return FALSE;
-
- info->button = event->button.button;
-
- info->start_x = child->allocation.x;
- info->start_y = child->allocation.y;
- info->click_x = child->allocation.x + event->button.x;
- info->click_y = child->allocation.y + event->button.y;
- }
- break;
-
- case GDK_BUTTON_RELEASE:
- if (info->button < 0)
- return FALSE;
-
- if (info->button == event->button.button)
- {
- int x, y;
-
- gdk_pointer_ungrab (event->button.time);
- info->button = -1;
-
- /* convert to window coords from event box coords */
- x = info->start_x + (event->button.x + child->allocation.x - info->click_x);
- y = info->start_y + (event->button.y + child->allocation.y - info->click_y);
-
- gtk_text_view_move_child (text_view,
- child,
- x, y);
- }
- break;
-
- case GDK_MOTION_NOTIFY:
- {
- int x, y;
-
- if (info->button < 0)
- return FALSE;
-
- gdk_window_get_pointer (child->window, &x, &y, NULL); /* ensure more events */
-
- /* to window coords from event box coords */
- x += child->allocation.x;
- y += child->allocation.y;
-
- x = info->start_x + (x - info->click_x);
- y = info->start_y + (y - info->click_y);
-
- gtk_text_view_move_child (text_view,
- child,
- x, y);
- }
- break;
-
- default:
- break;
- }
-
- return FALSE;
-}
-
-static void
-add_movable_child (GtkTextView *text_view,
- GtkTextWindowType window)
-{
- GtkWidget *event_box;
- GtkWidget *label;
- GdkColor color;
-
- label = gtk_label_new ("Drag me around");
-
- event_box = gtk_event_box_new ();
- gtk_widget_add_events (event_box,
- GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK);
-
- color.red = 0xffff;
- color.green = color.blue = 0;
- gtk_widget_modify_bg (event_box, GTK_STATE_NORMAL, &color);
-
- gtk_container_add (GTK_CONTAINER (event_box), label);
-
- gtk_widget_show_all (event_box);
-
- g_signal_connect (event_box, "event",
- G_CALLBACK (movable_child_callback),
- text_view);
-
- gtk_text_view_add_child_in_window (text_view,
- event_box,
- window,
- 0, 0);
-}
-
-static void
-do_add_children (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
-
- add_movable_child (GTK_TEXT_VIEW (view->text_view),
- GTK_TEXT_WINDOW_WIDGET);
- add_movable_child (GTK_TEXT_VIEW (view->text_view),
- GTK_TEXT_WINDOW_LEFT);
- add_movable_child (GTK_TEXT_VIEW (view->text_view),
- GTK_TEXT_WINDOW_RIGHT);
-}
-
-static void
-do_add_focus_children (gpointer callback_data,
- guint callback_action,
- GtkWidget *widget)
-{
- View *view = view_from_widget (widget);
- GtkWidget *child;
- GtkTextChildAnchor *anchor;
- GtkTextIter iter;
- GtkTextView *text_view;
-
- text_view = GTK_TEXT_VIEW (view->text_view);
-
- child = gtk_button_new_with_mnemonic ("Button _A in widget->window");
-
- gtk_text_view_add_child_in_window (text_view,
- child,
- GTK_TEXT_WINDOW_WIDGET,
- 200, 200);
-
- child = gtk_button_new_with_mnemonic ("Button _B in widget->window");
-
- gtk_text_view_add_child_in_window (text_view,
- child,
- GTK_TEXT_WINDOW_WIDGET,
- 350, 300);
-
- child = gtk_button_new_with_mnemonic ("Button _C in left window");
-
- gtk_text_view_add_child_in_window (text_view,
- child,
- GTK_TEXT_WINDOW_LEFT,
- 0, 0);
-
- child = gtk_button_new_with_mnemonic ("Button _D in right window");
-
- gtk_text_view_add_child_in_window (text_view,
- child,
- GTK_TEXT_WINDOW_RIGHT,
- 0, 0);
-
- gtk_text_buffer_get_start_iter (view->buffer->buffer, &iter);
-
- anchor = gtk_text_buffer_create_child_anchor (view->buffer->buffer, &iter);
-
- child = gtk_button_new_with_mnemonic ("Button _E in buffer");
-
- gtk_text_view_add_child_at_anchor (text_view, child, anchor);
-
- anchor = gtk_text_buffer_create_child_anchor (view->buffer->buffer, &iter);
-
- child = gtk_button_new_with_mnemonic ("Button _F in buffer");
-
- gtk_text_view_add_child_at_anchor (text_view, child, anchor);
-
- anchor = gtk_text_buffer_create_child_anchor (view->buffer->buffer, &iter);
-
- child = gtk_button_new_with_mnemonic ("Button _G in buffer");
-
- gtk_text_view_add_child_at_anchor (text_view, child, anchor);
-
- /* show all the buttons */
- gtk_widget_show_all (view->text_view);
-}
-
-static void
-view_init_menus (View *view)
-{
- GtkTextDirection direction = gtk_widget_get_direction (view->text_view);
- GtkWrapMode wrap_mode = gtk_text_view_get_wrap_mode (GTK_TEXT_VIEW (view->text_view));
- GtkWidget *menu_item = NULL;
-
- switch (direction)
- {
- case GTK_TEXT_DIR_LTR:
- menu_item = gtk_item_factory_get_widget (view->item_factory, "/Settings/Left-to-Right");
- break;
- case GTK_TEXT_DIR_RTL:
- menu_item = gtk_item_factory_get_widget (view->item_factory, "/Settings/Right-to-Left");
- break;
- default:
- break;
- }
-
- if (menu_item)
- gtk_menu_item_activate (GTK_MENU_ITEM (menu_item));
-
- switch (wrap_mode)
- {
- case GTK_WRAP_NONE:
- menu_item = gtk_item_factory_get_widget (view->item_factory, "/Settings/Wrap Off");
- break;
- case GTK_WRAP_WORD:
- menu_item = gtk_item_factory_get_widget (view->item_factory, "/Settings/Wrap Words");
- break;
- case GTK_WRAP_CHAR:
- menu_item = gtk_item_factory_get_widget (view->item_factory, "/Settings/Wrap Chars");
- break;
- default:
- break;
- }
-
- if (menu_item)
- gtk_menu_item_activate (GTK_MENU_ITEM (menu_item));
-}
-
-static GtkItemFactoryEntry menu_items[] =
-{
- { "/_File", NULL, NULL, 0, "<Branch>" },
- { "/File/_New", "<control>N", do_new, 0, NULL },
- { "/File/New _View", NULL, do_new_view, 0, NULL },
- { "/File/_Open", "<control>O", do_open, 0, NULL },
- { "/File/_Save", "<control>S", do_save, 0, NULL },
- { "/File/Save _As...", NULL, do_save_as, 0, NULL },
- { "/File/sep1", NULL, NULL, 0, "<Separator>" },
- { "/File/_Close", "<control>W" , do_close, 0, NULL },
- { "/File/E_xit", "<control>Q" , do_exit, 0, NULL },
-
- { "/_Edit", NULL, 0, 0, "<Branch>" },
- { "/Edit/Copy", NULL, do_copy, 0, NULL },
- { "/Edit/sep1", NULL, NULL, 0, "<Separator>" },
- { "/Edit/Find...", NULL, do_search, 0, NULL },
- { "/Edit/Select All", "<control>A", do_select_all, 0, NULL },
-
- { "/_Settings", NULL, NULL, 0, "<Branch>" },
- { "/Settings/Wrap _Off", NULL, do_wrap_changed, GTK_WRAP_NONE, "<RadioItem>" },
- { "/Settings/Wrap _Words", NULL, do_wrap_changed, GTK_WRAP_WORD, "/Settings/Wrap Off" },
- { "/Settings/Wrap _Chars", NULL, do_wrap_changed, GTK_WRAP_CHAR, "/Settings/Wrap Off" },
- { "/Settings/sep1", NULL, NULL, 0, "<Separator>" },
- { "/Settings/Editable", NULL, do_editable_changed, TRUE, "<RadioItem>" },
- { "/Settings/Not editable", NULL, do_editable_changed, FALSE, "/Settings/Editable" },
- { "/Settings/sep1", NULL, NULL, 0, "<Separator>" },
-
- { "/Settings/Cursor normal", NULL, do_cursor_visible_changed, 1, "<RadioItem>" },
- { "/Settings/Cursor not visible", NULL, do_cursor_visible_changed, 0, "/Settings/Cursor normal" },
- { "/Settings/Cursor colored", NULL, do_cursor_visible_changed, 2, "/Settings/Cursor normal" },
- { "/Settings/sep1", NULL, NULL, 0, "<Separator>" },
-
- { "/Settings/Left-to-Right", NULL, do_direction_changed, GTK_TEXT_DIR_LTR, "<RadioItem>" },
- { "/Settings/Right-to-Left", NULL, do_direction_changed, GTK_TEXT_DIR_RTL, "/Settings/Left-to-Right" },
-
- { "/Settings/sep1", NULL, NULL, 0, "<Separator>" },
- { "/Settings/Sane spacing", NULL, do_spacing_changed, FALSE, "<RadioItem>" },
- { "/Settings/Funky spacing", NULL, do_spacing_changed, TRUE, "/Settings/Sane spacing" },
- { "/Settings/sep1", NULL, NULL, 0, "<Separator>" },
- { "/Settings/Don't cycle color tags", NULL, do_color_cycle_changed, FALSE, "<RadioItem>" },
- { "/Settings/Cycle colors", NULL, do_color_cycle_changed, TRUE, "/Settings/Don't cycle color tags" },
- { "/_Attributes", NULL, NULL, 0, "<Branch>" },
- { "/Attributes/Editable", NULL, do_apply_editable, TRUE, NULL },
- { "/Attributes/Not editable", NULL, do_apply_editable, FALSE, NULL },
- { "/Attributes/Invisible", NULL, do_apply_invisible, FALSE, NULL },
- { "/Attributes/Visible", NULL, do_apply_invisible, TRUE, NULL },
- { "/Attributes/Rise", NULL, do_apply_rise, FALSE, NULL },
- { "/Attributes/Large", NULL, do_apply_large, FALSE, NULL },
- { "/Attributes/Indent", NULL, do_apply_indent, FALSE, NULL },
- { "/Attributes/Margins", NULL, do_apply_margin, FALSE, NULL },
- { "/Attributes/Custom tabs", NULL, do_apply_tabs, FALSE, NULL },
- { "/Attributes/Default tabs", NULL, do_apply_tabs, TRUE, NULL },
- { "/Attributes/Color cycles", NULL, do_apply_colors, TRUE, NULL },
- { "/Attributes/No colors", NULL, do_apply_colors, FALSE, NULL },
- { "/Attributes/Remove all tags", NULL, do_remove_tags, 0, NULL },
- { "/Attributes/Properties", NULL, do_properties, 0, NULL },
- { "/Attributes/Rich Text copy & drag", NULL, do_rich_text, 0, NULL },
- { "/Attributes/Rich Text paste & drop", NULL, do_rich_text, 1, NULL },
- { "/_Test", NULL, NULL, 0, "<Branch>" },
- { "/Test/_Example", NULL, do_example, 0, NULL },
- { "/Test/_Insert and scroll", NULL, do_insert_and_scroll, 0, NULL },
- { "/Test/_Add fixed children", NULL, do_add_children, 0, NULL },
- { "/Test/A_dd focusable children", NULL, do_add_focus_children, 0, NULL },
-};
-
-static gboolean
-save_buffer (Buffer *buffer)
-{
- GtkTextIter start, end;
- gchar *chars;
- gboolean result = FALSE;
- gboolean have_backup = FALSE;
- gchar *bak_filename;
- FILE *file;
-
- g_return_val_if_fail (buffer->filename != NULL, FALSE);
-
- bak_filename = g_strconcat (buffer->filename, "~", NULL);
-
- if (rename (buffer->filename, bak_filename) != 0)
- {
- if (errno != ENOENT)
- {
- gchar *err = g_strdup_printf ("Cannot back up '%s' to '%s': %s",
- buffer->filename, bak_filename, g_strerror (errno));
- msgbox_run (NULL, err, "OK", NULL, NULL, 0);
- g_free (err);
- return FALSE;
- }
- }
- else
- have_backup = TRUE;
-
- file = fopen (buffer->filename, "w");
- if (!file)
- {
- gchar *err = g_strdup_printf ("Cannot back up '%s' to '%s': %s",
- buffer->filename, bak_filename, g_strerror (errno));
- msgbox_run (NULL, err, "OK", NULL, NULL, 0);
- }
- else
- {
- gtk_text_buffer_get_iter_at_offset (buffer->buffer, &start, 0);
- gtk_text_buffer_get_end_iter (buffer->buffer, &end);
-
- chars = gtk_text_buffer_get_slice (buffer->buffer, &start, &end, FALSE);
-
- if (fputs (chars, file) == EOF ||
- fclose (file) == EOF)
- {
- gchar *err = g_strdup_printf ("Error writing to '%s': %s",
- buffer->filename, g_strerror (errno));
- msgbox_run (NULL, err, "OK", NULL, NULL, 0);
- g_free (err);
- }
- else
- {
- /* Success
- */
- result = TRUE;
- gtk_text_buffer_set_modified (buffer->buffer, FALSE);
- }
-
- g_free (chars);
- }
-
- if (!result && have_backup)
- {
- if (rename (bak_filename, buffer->filename) != 0)
- {
- gchar *err = g_strdup_printf ("Error restoring backup file '%s' to '%s': %s\nBackup left as '%s'",
- buffer->filename, bak_filename, g_strerror (errno), bak_filename);
- msgbox_run (NULL, err, "OK", NULL, NULL, 0);
- g_free (err);
- }
- }
-
- g_free (bak_filename);
-
- return result;
-}
-
-static gboolean
-save_as_ok_func (const char *filename, gpointer data)
-{
- Buffer *buffer = data;
- char *old_filename = buffer->filename;
-
- if (!buffer->filename || strcmp (filename, buffer->filename) != 0)
- {
- struct stat statbuf;
-
- if (stat (filename, &statbuf) == 0)
- {
- gchar *err = g_strdup_printf ("Ovewrite existing file '%s'?", filename);
- gint result = msgbox_run (NULL, err, "Yes", "No", NULL, 1);
- g_free (err);
-
- if (result != 0)
- return FALSE;
- }
- }
-
- buffer->filename = g_strdup (filename);
-
- if (save_buffer (buffer))
- {
- g_free (old_filename);
- buffer_filename_set (buffer);
- return TRUE;
- }
- else
- {
- g_free (buffer->filename);
- buffer->filename = old_filename;
- return FALSE;
- }
-}
-
-static gboolean
-save_as_buffer (Buffer *buffer)
-{
- return filesel_run (NULL, "Save File", NULL, save_as_ok_func, buffer);
-}
-
-static gboolean
-check_buffer_saved (Buffer *buffer)
-{
- if (gtk_text_buffer_get_modified (buffer->buffer))
- {
- char *pretty_name = buffer_pretty_name (buffer);
- char *msg = g_strdup_printf ("Save changes to '%s'?", pretty_name);
- gint result;
-
- g_free (pretty_name);
-
- result = msgbox_run (NULL, msg, "Yes", "No", "Cancel", 0);
- g_free (msg);
-
- if (result == 0)
- return save_as_buffer (buffer);
- else if (result == 1)
- return TRUE;
- else
- return FALSE;
- }
- else
- return TRUE;
-}
-
-#define N_COLORS 16
-
-static Buffer *
-create_buffer (void)
-{
- Buffer *buffer;
- PangoTabArray *tabs;
- gint i;
-
- buffer = g_new (Buffer, 1);
-
- buffer->buffer = gtk_text_buffer_new (NULL);
-
- buffer->refcount = 1;
- buffer->filename = NULL;
- buffer->untitled_serial = -1;
-
- buffer->color_tags = NULL;
- buffer->color_cycle_timeout = 0;
- buffer->start_hue = 0.0;
-
- i = 0;
- while (i < N_COLORS)
- {
- GtkTextTag *tag;
-
- tag = gtk_text_buffer_create_tag (buffer->buffer, NULL, NULL);
-
- buffer->color_tags = g_slist_prepend (buffer->color_tags, tag);
-
- ++i;
- }
-
-#if 1
- buffer->invisible_tag = gtk_text_buffer_create_tag (buffer->buffer, NULL,
- "invisible", TRUE, NULL);
-#endif
-
- buffer->not_editable_tag =
- gtk_text_buffer_create_tag (buffer->buffer, NULL,
- "editable", FALSE,
- "foreground", "purple", NULL);
-
- buffer->found_text_tag = gtk_text_buffer_create_tag (buffer->buffer, NULL,
- "foreground", "red", NULL);
-
- buffer->rise_tag = gtk_text_buffer_create_tag (buffer->buffer, NULL,
- "rise", 10 * PANGO_SCALE, NULL);
-
- buffer->large_tag = gtk_text_buffer_create_tag (buffer->buffer, NULL,
- "scale", PANGO_SCALE_X_LARGE, NULL);
-
- buffer->indent_tag = gtk_text_buffer_create_tag (buffer->buffer, NULL,
- "indent", 20, NULL);
-
- buffer->margin_tag = gtk_text_buffer_create_tag (buffer->buffer, NULL,
- "left_margin", 20, "right_margin", 20, NULL);
-
- tabs = pango_tab_array_new_with_positions (4,
- TRUE,
- PANGO_TAB_LEFT, 10,
- PANGO_TAB_LEFT, 30,
- PANGO_TAB_LEFT, 60,
- PANGO_TAB_LEFT, 120);
-
- buffer->custom_tabs_tag = gtk_text_buffer_create_tag (buffer->buffer, NULL,
- "tabs", tabs,
- "foreground", "green", NULL);
-
- pango_tab_array_free (tabs);
-
- buffers = g_slist_prepend (buffers, buffer);
-
- return buffer;
-}
-
-static char *
-buffer_pretty_name (Buffer *buffer)
-{
- if (buffer->filename)
- {
- char *p;
- char *result = g_path_get_basename (buffer->filename);
- p = strchr (result, '/');
- if (p)
- *p = '\0';
-
- return result;
- }
- else
- {
- if (buffer->untitled_serial == -1)
- buffer->untitled_serial = untitled_serial++;
-
- if (buffer->untitled_serial == 1)
- return g_strdup ("Untitled");
- else
- return g_strdup_printf ("Untitled #%d", buffer->untitled_serial);
- }
-}
-
-static void
-buffer_filename_set (Buffer *buffer)
-{
- GSList *tmp_list = views;
-
- while (tmp_list)
- {
- View *view = tmp_list->data;
-
- if (view->buffer == buffer)
- view_set_title (view);
-
- tmp_list = tmp_list->next;
- }
-}
-
-static void
-buffer_search (Buffer *buffer,
- const char *str,
- View *view,
- gboolean forward)
-{
- GtkTextIter iter;
- GtkTextIter start, end;
- GtkWidget *dialog;
- int i;
-
- /* remove tag from whole buffer */
- gtk_text_buffer_get_bounds (buffer->buffer, &start, &end);
- gtk_text_buffer_remove_tag (buffer->buffer, buffer->found_text_tag,
- &start, &end );
-
- gtk_text_buffer_get_iter_at_mark (buffer->buffer, &iter,
- gtk_text_buffer_get_mark (buffer->buffer,
- "insert"));
-
- i = 0;
- if (*str != '\0')
- {
- GtkTextIter match_start, match_end;
-
- if (forward)
- {
- while (gtk_text_iter_forward_search (&iter, str,
- GTK_TEXT_SEARCH_VISIBLE_ONLY |
- GTK_TEXT_SEARCH_TEXT_ONLY,
- &match_start, &match_end,
- NULL))
- {
- ++i;
- gtk_text_buffer_apply_tag (buffer->buffer, buffer->found_text_tag,
- &match_start, &match_end);
-
- iter = match_end;
- }
- }
- else
- {
- while (gtk_text_iter_backward_search (&iter, str,
- GTK_TEXT_SEARCH_VISIBLE_ONLY |
- GTK_TEXT_SEARCH_TEXT_ONLY,
- &match_start, &match_end,
- NULL))
- {
- ++i;
- gtk_text_buffer_apply_tag (buffer->buffer, buffer->found_text_tag,
- &match_start, &match_end);
-
- iter = match_start;
- }
- }
- }
-
- dialog = gtk_message_dialog_new (GTK_WINDOW (view->window),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_INFO,
- GTK_BUTTONS_OK,
- "%d strings found and marked in red",
- i);
-
- g_signal_connect_swapped (dialog,
- "response",
- G_CALLBACK (gtk_widget_destroy), dialog);
-
- gtk_widget_show (dialog);
-}
-
-static void
-buffer_search_forward (Buffer *buffer, const char *str,
- View *view)
-{
- buffer_search (buffer, str, view, TRUE);
-}
-
-static void
-buffer_search_backward (Buffer *buffer, const char *str,
- View *view)
-{
- buffer_search (buffer, str, view, FALSE);
-}
-
-static void
-buffer_ref (Buffer *buffer)
-{
- buffer->refcount++;
-}
-
-static void
-buffer_unref (Buffer *buffer)
-{
- buffer->refcount--;
- if (buffer->refcount == 0)
- {
- buffer_set_colors (buffer, FALSE);
- buffers = g_slist_remove (buffers, buffer);
- g_object_unref (buffer->buffer);
- g_free (buffer->filename);
- g_free (buffer);
- }
-}
-
-static void
-hsv_to_rgb (gdouble *h,
- gdouble *s,
- gdouble *v)
-{
- gdouble hue, saturation, value;
- gdouble f, p, q, t;
-
- if (*s == 0.0)
- {
- *h = *v;
- *s = *v;
- *v = *v; /* heh */
- }
- else
- {
- hue = *h * 6.0;
- saturation = *s;
- value = *v;
-
- if (hue >= 6.0)
- hue = 0.0;
-
- f = hue - (int) hue;
- p = value * (1.0 - saturation);
- q = value * (1.0 - saturation * f);
- t = value * (1.0 - saturation * (1.0 - f));
-
- switch ((int) hue)
- {
- case 0:
- *h = value;
- *s = t;
- *v = p;
- break;
-
- case 1:
- *h = q;
- *s = value;
- *v = p;
- break;
-
- case 2:
- *h = p;
- *s = value;
- *v = t;
- break;
-
- case 3:
- *h = p;
- *s = q;
- *v = value;
- break;
-
- case 4:
- *h = t;
- *s = p;
- *v = value;
- break;
-
- case 5:
- *h = value;
- *s = p;
- *v = q;
- break;
-
- default:
- g_assert_not_reached ();
- }
- }
-}
-
-static void
-hue_to_color (gdouble hue,
- GdkColor *color)
-{
- gdouble h, s, v;
-
- h = hue;
- s = 1.0;
- v = 1.0;
-
- g_return_if_fail (hue <= 1.0);
-
- hsv_to_rgb (&h, &s, &v);
-
- color->red = h * 65535;
- color->green = s * 65535;
- color->blue = v * 65535;
-}
-
-
-static gint
-color_cycle_timeout (gpointer data)
-{
- Buffer *buffer = data;
-
- buffer_cycle_colors (buffer);
-
- return TRUE;
-}
-
-static void
-buffer_set_colors (Buffer *buffer,
- gboolean enabled)
-{
- GSList *tmp;
- gdouble hue = 0.0;
-
- if (enabled && buffer->color_cycle_timeout == 0)
- buffer->color_cycle_timeout = gdk_threads_add_timeout (200, color_cycle_timeout, buffer);
- else if (!enabled && buffer->color_cycle_timeout != 0)
- {
- g_source_remove (buffer->color_cycle_timeout);
- buffer->color_cycle_timeout = 0;
- }
-
- tmp = buffer->color_tags;
- while (tmp != NULL)
- {
- if (enabled)
- {
- GdkColor color;
-
- hue_to_color (hue, &color);
-
- g_object_set (tmp->data,
- "foreground_gdk", &color,
- NULL);
- }
- else
- g_object_set (tmp->data,
- "foreground_set", FALSE,
- NULL);
-
- hue += 1.0 / N_COLORS;
-
- tmp = g_slist_next (tmp);
- }
-}
-
-static void
-buffer_cycle_colors (Buffer *buffer)
-{
- GSList *tmp;
- gdouble hue = buffer->start_hue;
-
- tmp = buffer->color_tags;
- while (tmp != NULL)
- {
- GdkColor color;
-
- hue_to_color (hue, &color);
-
- g_object_set (tmp->data,
- "foreground_gdk", &color,
- NULL);
-
- hue += 1.0 / N_COLORS;
- if (hue > 1.0)
- hue = 0.0;
-
- tmp = g_slist_next (tmp);
- }
-
- buffer->start_hue += 1.0 / N_COLORS;
- if (buffer->start_hue > 1.0)
- buffer->start_hue = 0.0;
-}
-
-static void
-close_view (View *view)
-{
- views = g_slist_remove (views, view);
- buffer_unref (view->buffer);
- gtk_widget_destroy (view->window);
- g_object_unref (view->item_factory);
-
- g_free (view);
-
- if (!views)
- gtk_main_quit ();
-}
-
-static void
-check_close_view (View *view)
-{
- if (view->buffer->refcount > 1 ||
- check_buffer_saved (view->buffer))
- close_view (view);
-}
-
-static void
-view_set_title (View *view)
-{
- char *pretty_name = buffer_pretty_name (view->buffer);
- char *title = g_strconcat ("testtext - ", pretty_name, NULL);
-
- gtk_window_set_title (GTK_WINDOW (view->window), title);
-
- g_free (pretty_name);
- g_free (title);
-}
-
-static void
-cursor_set_callback (GtkTextBuffer *buffer,
- const GtkTextIter *location,
- GtkTextMark *mark,
- gpointer user_data)
-{
- GtkTextView *text_view;
-
- /* Redraw tab windows if the cursor moves
- * on the mapped widget (windows may not exist before realization...
- */
-
- text_view = GTK_TEXT_VIEW (user_data);
-
- if (gtk_widget_get_mapped (GTK_WIDGET (text_view)) &&
- mark == gtk_text_buffer_get_insert (buffer))
- {
- GdkWindow *tab_window;
-
- tab_window = gtk_text_view_get_window (text_view,
- GTK_TEXT_WINDOW_TOP);
-
- gdk_window_invalidate_rect (tab_window, NULL, FALSE);
-
- tab_window = gtk_text_view_get_window (text_view,
- GTK_TEXT_WINDOW_BOTTOM);
-
- gdk_window_invalidate_rect (tab_window, NULL, FALSE);
- }
-}
-
-static gint
-tab_stops_expose (GtkWidget *widget,
- GdkEventExpose *event,
- gpointer user_data)
-{
- gint first_x;
- gint last_x;
- gint i;
- GdkWindow *top_win;
- GdkWindow *bottom_win;
- GtkTextView *text_view;
- GtkTextWindowType type;
- GdkDrawable *target;
- gint *positions = NULL;
- gint size;
- GtkTextAttributes *attrs;
- GtkTextIter insert;
- GtkTextBuffer *buffer;
- gboolean in_pixels;
-
- text_view = GTK_TEXT_VIEW (widget);
-
- /* See if this expose is on the tab stop window */
- top_win = gtk_text_view_get_window (text_view,
- GTK_TEXT_WINDOW_TOP);
-
- bottom_win = gtk_text_view_get_window (text_view,
- GTK_TEXT_WINDOW_BOTTOM);
-
- if (event->window == top_win)
- {
- type = GTK_TEXT_WINDOW_TOP;
- target = top_win;
- }
- else if (event->window == bottom_win)
- {
- type = GTK_TEXT_WINDOW_BOTTOM;
- target = bottom_win;
- }
- else
- return FALSE;
-
- first_x = event->area.x;
- last_x = first_x + event->area.width;
-
- gtk_text_view_window_to_buffer_coords (text_view,
- type,
- first_x,
- 0,
- &first_x,
- NULL);
-
- gtk_text_view_window_to_buffer_coords (text_view,
- type,
- last_x,
- 0,
- &last_x,
- NULL);
-
- buffer = gtk_text_view_get_buffer (text_view);
-
- gtk_text_buffer_get_iter_at_mark (buffer,
- &insert,
- gtk_text_buffer_get_mark (buffer,
- "insert"));
-
- attrs = gtk_text_attributes_new ();
-
- gtk_text_iter_get_attributes (&insert, attrs);
-
- if (attrs->tabs)
- {
- size = pango_tab_array_get_size (attrs->tabs);
-
- pango_tab_array_get_tabs (attrs->tabs,
- NULL,
- &positions);
-
- in_pixels = pango_tab_array_get_positions_in_pixels (attrs->tabs);
- }
- else
- {
- size = 0;
- in_pixels = FALSE;
- }
-
- gtk_text_attributes_unref (attrs);
-
- i = 0;
- while (i < size)
- {
- gint pos;
-
- if (!in_pixels)
- positions[i] = PANGO_PIXELS (positions[i]);
-
- gtk_text_view_buffer_to_window_coords (text_view,
- type,
- positions[i],
- 0,
- &pos,
- NULL);
-
- gdk_draw_line (target,
- widget->style->fg_gc [widget->state],
- pos, 0,
- pos, 15);
-
- ++i;
- }
-
- g_free (positions);
-
- return TRUE;
-}
-
-static void
-get_lines (GtkTextView *text_view,
- gint first_y,
- gint last_y,
- GArray *buffer_coords,
- GArray *numbers,
- gint *countp)
-{
- GtkTextIter iter;
- gint count;
- gint size;
-
- g_array_set_size (buffer_coords, 0);
- g_array_set_size (numbers, 0);
-
- /* Get iter at first y */
- gtk_text_view_get_line_at_y (text_view, &iter, first_y, NULL);
-
- /* For each iter, get its location and add it to the arrays.
- * Stop when we pass last_y
- */
- count = 0;
- size = 0;
-
- while (!gtk_text_iter_is_end (&iter))
- {
- gint y, height;
- gint line_num;
-
- gtk_text_view_get_line_yrange (text_view, &iter, &y, &height);
-
- g_array_append_val (buffer_coords, y);
- line_num = gtk_text_iter_get_line (&iter);
- g_array_append_val (numbers, line_num);
-
- ++count;
-
- if ((y + height) >= last_y)
- break;
-
- gtk_text_iter_forward_line (&iter);
- }
-
- *countp = count;
-}
-
-static gint
-line_numbers_expose (GtkWidget *widget,
- GdkEventExpose *event,
- gpointer user_data)
-{
- gint count;
- GArray *numbers;
- GArray *pixels;
- gint first_y;
- gint last_y;
- gint i;
- GdkWindow *left_win;
- GdkWindow *right_win;
- PangoLayout *layout;
- GtkTextView *text_view;
- GtkTextWindowType type;
- GdkDrawable *target;
-
- text_view = GTK_TEXT_VIEW (widget);
-
- /* See if this expose is on the line numbers window */
- left_win = gtk_text_view_get_window (text_view,
- GTK_TEXT_WINDOW_LEFT);
-
- right_win = gtk_text_view_get_window (text_view,
- GTK_TEXT_WINDOW_RIGHT);
-
- if (event->window == left_win)
- {
- type = GTK_TEXT_WINDOW_LEFT;
- target = left_win;
- }
- else if (event->window == right_win)
- {
- type = GTK_TEXT_WINDOW_RIGHT;
- target = right_win;
- }
- else
- return FALSE;
-
- first_y = event->area.y;
- last_y = first_y + event->area.height;
-
- gtk_text_view_window_to_buffer_coords (text_view,
- type,
- 0,
- first_y,
- NULL,
- &first_y);
-
- gtk_text_view_window_to_buffer_coords (text_view,
- type,
- 0,
- last_y,
- NULL,
- &last_y);
-
- numbers = g_array_new (FALSE, FALSE, sizeof (gint));
- pixels = g_array_new (FALSE, FALSE, sizeof (gint));
-
- get_lines (text_view,
- first_y,
- last_y,
- pixels,
- numbers,
- &count);
-
- /* Draw fully internationalized numbers! */
-
- layout = gtk_widget_create_pango_layout (widget, "");
-
- i = 0;
- while (i < count)
- {
- gint pos;
- gchar *str;
-
- gtk_text_view_buffer_to_window_coords (text_view,
- type,
- 0,
- g_array_index (pixels, gint, i),
- NULL,
- &pos);
-
- str = g_strdup_printf ("%d", g_array_index (numbers, gint, i));
-
- pango_layout_set_text (layout, str, -1);
-
- gtk_paint_layout (widget->style,
- target,
- gtk_widget_get_state (widget),
- FALSE,
- NULL,
- widget,
- NULL,
- 2, pos + 2,
- layout);
-
- g_free (str);
-
- ++i;
- }
-
- g_array_free (pixels, TRUE);
- g_array_free (numbers, TRUE);
-
- g_object_unref (layout);
-
- /* don't stop emission, need to draw children */
- return FALSE;
-}
-
-static void
-selection_changed (GtkTextBuffer *buffer,
- GParamSpec *pspec,
- GtkWidget *copy_menu)
-{
- gtk_widget_set_sensitive (copy_menu, gtk_text_buffer_get_has_selection (buffer));
-}
-
-static View *
-create_view (Buffer *buffer)
-{
- View *view;
- GtkWidget *copy_menu;
- GtkWidget *sw;
- GtkWidget *vbox;
-
- view = g_new0 (View, 1);
- views = g_slist_prepend (views, view);
-
- view->buffer = buffer;
- buffer_ref (buffer);
-
- view->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- g_object_set_data (G_OBJECT (view->window), "view", view);
-
- g_signal_connect (view->window, "delete_event",
- G_CALLBACK (delete_event_cb), NULL);
-
- view->accel_group = gtk_accel_group_new ();
- view->item_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<main>", view->accel_group);
- g_object_set_data (G_OBJECT (view->item_factory), "view", view);
-
- gtk_item_factory_create_items (view->item_factory, G_N_ELEMENTS (menu_items), menu_items, view);
-
- /* make the Copy menu item sensitivity update according to the selection */
- copy_menu = gtk_item_factory_get_item (view->item_factory, "<main>/Edit/Copy");
- gtk_widget_set_sensitive (copy_menu, gtk_text_buffer_get_has_selection (view->buffer->buffer));
- g_signal_connect (view->buffer->buffer,
- "notify::has-selection",
- G_CALLBACK (selection_changed),
- copy_menu);
-
- gtk_window_add_accel_group (GTK_WINDOW (view->window), view->accel_group);
-
- vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE, 0);
- gtk_container_add (GTK_CONTAINER (view->window), vbox);
-
- gtk_box_pack_start (GTK_BOX (vbox),
- gtk_item_factory_get_widget (view->item_factory, "<main>"),
- FALSE, FALSE, 0);
-
- sw = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
-
- view->text_view = gtk_text_view_new_with_buffer (buffer->buffer);
- gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view->text_view),
- GTK_WRAP_WORD);
-
- /* Make sure border width works, no real reason to do this other than testing */
- gtk_container_set_border_width (GTK_CONTAINER (view->text_view),
- 10);
-
- /* Draw tab stops in the top and bottom windows. */
-
- gtk_text_view_set_border_window_size (GTK_TEXT_VIEW (view->text_view),
- GTK_TEXT_WINDOW_TOP,
- 15);
-
- gtk_text_view_set_border_window_size (GTK_TEXT_VIEW (view->text_view),
- GTK_TEXT_WINDOW_BOTTOM,
- 15);
-
- g_signal_connect (view->text_view,
- "expose_event",
- G_CALLBACK (tab_stops_expose),
- NULL);
-
- g_signal_connect (view->buffer->buffer,
- "mark_set",
- G_CALLBACK (cursor_set_callback),
- view->text_view);
-
- /* Draw line numbers in the side windows; we should really be
- * more scientific about what width we set them to.
- */
- gtk_text_view_set_border_window_size (GTK_TEXT_VIEW (view->text_view),
- GTK_TEXT_WINDOW_RIGHT,
- 30);
-
- gtk_text_view_set_border_window_size (GTK_TEXT_VIEW (view->text_view),
- GTK_TEXT_WINDOW_LEFT,
- 30);
-
- g_signal_connect (view->text_view,
- "expose_event",
- G_CALLBACK (line_numbers_expose),
- NULL);
-
- gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE, 0);
- gtk_container_add (GTK_CONTAINER (sw), view->text_view);
-
- gtk_window_set_default_size (GTK_WINDOW (view->window), 500, 500);
-
- gtk_widget_grab_focus (view->text_view);
-
- view_set_title (view);
- view_init_menus (view);
-
- view_add_example_widgets (view);
-
- gtk_widget_show_all (view->window);
- return view;
-}
-
-static void
-view_add_example_widgets (View *view)
-{
- GtkTextChildAnchor *anchor;
- Buffer *buffer;
-
- buffer = view->buffer;
-
- anchor = g_object_get_data (G_OBJECT (buffer->buffer),
- "anchor");
-
- if (anchor && !gtk_text_child_anchor_get_deleted (anchor))
- {
- GtkWidget *widget;
-
- widget = gtk_button_new_with_label ("Foo");
-
- gtk_text_view_add_child_at_anchor (GTK_TEXT_VIEW (view->text_view),
- widget,
- anchor);
-
- gtk_widget_show (widget);
- }
-}
-
-void
-test_init (void)
-{
- if (g_file_test ("../gdk-pixbuf/libpixbufloader-pnm.la",
- G_FILE_TEST_EXISTS))
- {
- g_setenv ("GDK_PIXBUF_MODULE_FILE", "../gdk-pixbuf/loaders.cache", TRUE);
- g_setenv ("GTK_IM_MODULE_FILE", "../modules/input/immodules.cache", TRUE);
- }
-}
-
-int
-main (int argc, char** argv)
-{
- Buffer *buffer;
- View *view;
- int i;
-
- test_init ();
- gtk_init (&argc, &argv);
-
- buffer = create_buffer ();
- view = create_view (buffer);
- buffer_unref (buffer);
-
- push_active_window (GTK_WINDOW (view->window));
- for (i=1; i < argc; i++)
- {
- char *filename;
-
- /* Quick and dirty canonicalization - better should be in GLib
- */
-
- if (!g_path_is_absolute (argv[i]))
- {
- char *cwd = g_get_current_dir ();
- filename = g_strconcat (cwd, "/", argv[i], NULL);
- g_free (cwd);
- }
- else
- filename = argv[i];
-
- open_ok_func (filename, view);
-
- if (filename != argv[i])
- g_free (filename);
- }
- pop_active_window ();
-
- gtk_main ();
-
- return 0;
-}
-
-
diff --git a/tests/testtooltips.c b/tests/testtooltips.c
index 9cb1fcc055..54c2e05b88 100644
--- a/tests/testtooltips.c
+++ b/tests/testtooltips.c
@@ -46,10 +46,10 @@ query_tooltip_custom_cb (GtkWidget *widget,
GtkTooltip *tooltip,
gpointer data)
{
- GdkColor color = { 0, 0, 65535 };
+ GdkRGBA color = { 0, 0, 1, 1 };
GtkWindow *window = gtk_widget_get_tooltip_window (widget);
- gtk_widget_modify_bg (GTK_WIDGET (window), GTK_STATE_NORMAL, &color);
+ gtk_widget_override_background_color (GTK_WIDGET (window), 0, &color);
return TRUE;
}
diff --git a/tests/testwindows.c b/tests/testwindows.c
index e3e9ab26c4..82aa57ed1b 100644
--- a/tests/testwindows.c
+++ b/tests/testwindows.c
@@ -788,7 +788,7 @@ main (int argc, char **argv)
GtkWidget *button, *scrolled, *table;
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;
- GdkColor black = {0};
+ GdkRGBA black = {0,0,0,1};
GFile *file;
gtk_init (&argc, &argv);
@@ -821,8 +821,7 @@ main (int argc, char **argv)
gtk_container_add (GTK_CONTAINER (frame), darea);
gtk_widget_realize (darea);
gtk_widget_show (darea);
- gtk_widget_modify_bg (darea, GTK_STATE_NORMAL,
- &black);
+ gtk_widget_override_background_color (darea, 0, &black);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);