[gtk+] Split out private style context api into a private header



commit a12dad75a288425702095f30008d55185f7f13e0
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jan 23 18:29:07 2011 -0500

    Split out private style context api into a private header

 gtk/Makefile.am              |    3 +-
 gtk/gtkcssprovider.c         |    7 +-
 gtk/gtkstyle.c               |    1 +
 gtk/gtkstylecontext.c        |    2 +-
 gtk/gtkstylecontext.h        |  207 ++++++++++++++++++++----------------------
 gtk/gtkstylecontextprivate.h |   40 ++++++++
 gtk/gtkwidget.c              |    2 +-
 gtk/gtkwidgetpath.c          |    1 +
 8 files changed, 148 insertions(+), 115 deletions(-)
---
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index ca787fd..b95a5d4 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -174,7 +174,6 @@ gtk_public_h_sources = 		\
 	gtkcellarea.h		\
 	gtkcellareacontext.h	\
 	gtkcellareabox.h	\
-	gtkcellareaboxcontextprivate.h	\
 	gtkcelleditable.h	\
 	gtkcelllayout.h		\
 	gtkcellrenderer.h	\
@@ -383,6 +382,7 @@ gtk_private_h_sources =		\
 	gtkappchooseronline.h	\
 	gtkbuilderprivate.h	\
 	gtkbuttonprivate.h	\
+	gtkcellareaboxcontextprivate.h	\
 	gtkcustompaperunixdialog.h \
 	gtkdndcursors.h		\
 	gtkentryprivate.h	\
@@ -422,6 +422,7 @@ gtk_private_h_sources =		\
 	gtksettingsprivate.h	\
 	gtksizegroup-private.h	\
 	gtksocketprivate.h	\
+	gtkstylecontextprivate.h \
 	gtktextbtree.h		\
 	gtktextbufferserialize.h \
 	gtktextchildprivate.h	\
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index 48349b4..95dd068 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -21,14 +21,17 @@
 
 #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 "gtkgradient.h"
+#include "gtkthemingengine.h"
+#include "gtkstyleprovider.h"
 #include "gtkcssprovider.h"
+#include "gtkstylecontextprivate.h"
 #include "gtkprivate.h"
 
 /**
diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c
index a73ebf0..e7b87aa 100644
--- a/gtk/gtkstyle.c
+++ b/gtk/gtkstyle.c
@@ -34,6 +34,7 @@
 #include "gtkrc.h"
 #include "gtkspinbutton.h"
 #include "gtkstyle.h"
+#include "gtkstylecontextprivate.h"
 #include "gtkwidget.h"
 #include "gtkiconfactory.h"
 #include "gtkintl.h"
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 1ca794b..896a98a 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -23,7 +23,7 @@
 #include <stdlib.h>
 #include <gobject/gvaluecollector.h>
 
-#include "gtkstylecontext.h"
+#include "gtkstylecontextprivate.h"
 #include "gtktypebuiltins.h"
 #include "gtkthemingengine.h"
 #include "gtkintl.h"
diff --git a/gtk/gtkstylecontext.h b/gtk/gtkstylecontext.h
index 42eed4b..5064afc 100644
--- a/gtk/gtkstylecontext.h
+++ b/gtk/gtkstylecontext.h
@@ -526,7 +526,7 @@ void gtk_style_context_get_style          (GtkStyleContext *context,
                                            ...);
 
 GtkIconSet * gtk_style_context_lookup_icon_set (GtkStyleContext *context,
-						const gchar     *stock_id);
+                                                const gchar     *stock_id);
 GdkPixbuf  * gtk_icon_set_render_icon_pixbuf   (GtkIconSet      *icon_set,
                                                 GtkStyleContext *context,
                                                 GtkIconSize      size);
@@ -540,7 +540,7 @@ void             gtk_style_context_set_direction (GtkStyleContext  *context,
 GtkTextDirection gtk_style_context_get_direction (GtkStyleContext  *context);
 
 void             gtk_style_context_set_junction_sides (GtkStyleContext  *context,
-						       GtkJunctionSides  sides);
+                                                       GtkJunctionSides  sides);
 GtkJunctionSides gtk_style_context_get_junction_sides (GtkStyleContext  *context);
 
 gboolean gtk_style_context_lookup_color (GtkStyleContext *context,
@@ -573,10 +573,9 @@ void gtk_style_context_get_background_color (GtkStyleContext *context,
 void gtk_style_context_get_border_color     (GtkStyleContext *context,
                                              GtkStateFlags    state,
                                              GdkRGBA         *color);
-
-const PangoFontDescription * gtk_style_context_get_font (GtkStyleContext *context,
-                                                    GtkStateFlags    state);
-
+const PangoFontDescription *
+     gtk_style_context_get_font             (GtkStyleContext *context,
+                                             GtkStateFlags    state);
 void gtk_style_context_get_border           (GtkStyleContext *context,
                                              GtkStateFlags    state,
                                              GtkBorder       *border);
@@ -587,113 +586,101 @@ 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,
-							      GtkWidget       *widget);
-gboolean       _gtk_style_context_check_region_name   (const gchar     *str);
-
+void gtk_style_context_invalidate           (GtkStyleContext *context);
+void gtk_style_context_reset_widgets        (GdkScreen       *screen);
 
-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);
+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);
-
+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);
diff --git a/gtk/gtkstylecontextprivate.h b/gtk/gtkstylecontextprivate.h
new file mode 100644
index 0000000..de70308
--- /dev/null
+++ b/gtk/gtkstylecontextprivate.h
@@ -0,0 +1,40 @@
+/* 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_STYLE_CONTEXT_PRIVATE_H__
+#define __GTK_STYLE_CONTEXT_PRIVATE_H__
+
+#include "gtkstylecontext.h"
+
+G_BEGIN_DECLS
+
+
+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,
+                                                              GtkWidget       *widget);
+gboolean       _gtk_style_context_check_region_name          (const gchar     *str);
+
+
+G_END_DECLS
+
+#endif /* __GTK_STYLE_CONTEXT_PRIVATE_H__ */
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 37316be..7558b76 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -56,7 +56,7 @@
 #include "gtkbuildable.h"
 #include "gtkbuilderprivate.h"
 #include "gtksizerequest.h"
-#include "gtkstylecontext.h"
+#include "gtkstylecontextprivate.h"
 #include "gtksymboliccolor.h"
 #include "gtkcssprovider.h"
 #include "gtkanimationdescription.h"
diff --git a/gtk/gtkwidgetpath.c b/gtk/gtkwidgetpath.c
index 40f1cac..431cc4b 100644
--- a/gtk/gtkwidgetpath.c
+++ b/gtk/gtkwidgetpath.c
@@ -23,6 +23,7 @@
 
 #include "gtkwidget.h"
 #include "gtkwidgetpath.h"
+#include "gtkstylecontextprivate.h"
 
 /**
  * SECTION:gtkwidgetpath



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