[gtk+/gtk-style-context: 159/347] GtkStyleContext: Add gtk_style_context_[gs]et_junction_sides().



commit 23fd13d302c26c871d6f06f03997c8320f459cd0
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Aug 3 20:33:53 2010 +0200

    GtkStyleContext: Add gtk_style_context_[gs]et_junction_sides().
    
    These functions will help widgets specify how does one element being painted
    relate to other contiguous elements.

 gtk/gtkstylecontext.c |   31 +++++++++++++++++++++++++++++++
 gtk/gtkstylecontext.h |    4 ++++
 2 files changed, 35 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 591094b..c896bc9 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -61,6 +61,7 @@ struct GtkStyleRegion
 {
   GArray *style_classes;
   GArray *child_style_classes;
+  GtkJunctionSides junction_sides;
 };
 
 struct GtkStyleContextPrivate
@@ -166,6 +167,9 @@ style_region_copy (const GtkStyleRegion *region)
   g_array_insert_vals (copy->child_style_classes, 0,
                        region->child_style_classes->data,
                        region->child_style_classes->len);
+
+  copy->junction_sides = region->junction_sides;
+
   return copy;
 }
 
@@ -1255,6 +1259,33 @@ gtk_style_context_get_direction (GtkStyleContext *context)
   return priv->direction;
 }
 
+void
+gtk_style_context_set_junction_sides (GtkStyleContext  *context,
+				      GtkJunctionSides  sides)
+{
+  GtkStyleContextPrivate *priv;
+  GtkStyleRegion *region;
+
+  g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+
+  priv = context->priv;
+  region = priv->regions->data;
+  region->junction_sides = sides;
+}
+
+GtkJunctionSides
+gtk_style_context_get_junction_sides (GtkStyleContext *context)
+{
+  GtkStyleContextPrivate *priv;
+  GtkStyleRegion *region;
+
+  g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), 0);
+
+  priv = context->priv;
+  region = priv->regions->data;
+  return region->junction_sides;
+}
+
 gboolean
 gtk_style_context_lookup_color (GtkStyleContext *context,
                                 const gchar     *color_name,
diff --git a/gtk/gtkstylecontext.h b/gtk/gtkstylecontext.h
index 133f357..73a3e9f 100644
--- a/gtk/gtkstylecontext.h
+++ b/gtk/gtkstylecontext.h
@@ -118,6 +118,10 @@ 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,
                                          GdkColor        *color);



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