]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkstylecontext.h
textview: Use GtkSelectionWindow for touch text selection
[~andy/gtk] / gtk / gtkstylecontext.h
index 634c31adfd6026c5b145e883f0142b1c4a6a29e4..35655f28d6ffdb97d2136280ffc7b70f65797dd3 100644 (file)
  * 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.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifndef __GTK_STYLE_CONTEXT_H__
+#define __GTK_STYLE_CONTEXT_H__
+
 #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>
+#include <gtk/gtkcsssection.h>
+#include <gtk/gtkstyleprovider.h>
+#include <gtk/gtktypes.h>
 #include <atk/atk.h>
 
 G_BEGIN_DECLS
@@ -39,7 +37,6 @@ G_BEGIN_DECLS
 #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;
 typedef struct _GtkStyleContextPrivate GtkStyleContextPrivate;
 
@@ -160,6 +157,16 @@ struct _GtkStyleContextClass
  */
 #define GTK_STYLE_CLASS_CELL "cell"
 
+/**
+ * GTK_STYLE_CLASS_DIM_LABEL:
+ *
+ * A CSS class to match dimmed labels.
+ *
+ * This should be used for toning down right aligned labels as
+ * compared to the entry value.
+ */
+#define GTK_STYLE_CLASS_DIM_LABEL "dim-label"
+
 /**
  * GTK_STYLE_CLASS_ENTRY:
  *
@@ -333,6 +340,16 @@ struct _GtkStyleContextClass
  */
 #define GTK_STYLE_CLASS_SCROLLBAR "scrollbar"
 
+/**
+ * GTK_STYLE_CLASS_SCROLLBARS_JUNCTION:
+ *
+ * A CSS class to match the junction area between an horizontal
+ * and vertical scrollbar, when they're both shown.
+ * 
+ * This is used in #GtkScrolledWindow.
+ */
+#define GTK_STYLE_CLASS_SCROLLBARS_JUNCTION "scrollbars-junction"
+
 /**
  * GTK_STYLE_CLASS_SCALE:
  *
@@ -388,6 +405,14 @@ struct _GtkStyleContextClass
  */
 #define GTK_STYLE_CLASS_RAISED "raised"
 
+/**
+ * GTK_STYLE_CLASS_LINKED:
+ *
+ * A CSS class to match a linked area, such as a box containing buttons
+ * belonging to the same control.
+ */
+#define GTK_STYLE_CLASS_LINKED "linked"
+
 /**
  * GTK_STYLE_CLASS_GRIP:
  *
@@ -639,6 +664,60 @@ struct _GtkStyleContextClass
  */
 #define GTK_STYLE_CLASS_RIGHT "right"
 
+/**
+ * GTK_STYLE_CLASS_PULSE:
+ *
+ * A CSS class to use when rendering a pulse in an indeterminate progress bar.
+ *
+ * This is used by #GtkProgressBar and #GtkEntry.
+ */
+#define GTK_STYLE_CLASS_PULSE "pulse"
+
+/**
+ * GTK_STYLE_CLASS_ARROW:
+ *
+ * A CSS class used when rendering an arrow element.
+ *
+ * Note that #gtk_render_arrow automatically adds this style class
+ * to the style context when rendering an arrow element.
+ */
+#define GTK_STYLE_CLASS_ARROW "arrow"
+
+/**
+ * GTK_STYLE_CLASS_OSD:
+ *
+ * A CSS class used when rendering an OSD (On Screen Display) element,
+ * on top of another container.
+ */
+#define GTK_STYLE_CLASS_OSD "osd"
+
+/**
+ * GTK_STYLE_CLASS_LEVEL_BAR:
+ *
+ * A CSS class used when rendering a level indicator, such
+ * as a battery charge level, or a password strength.
+ *
+ * This is used by #GtkLevelBar.
+ */
+#define GTK_STYLE_CLASS_LEVEL_BAR "level-bar"
+
+/**
+ * GTK_STYLE_CLASS_CURSOR_HANDLE:
+ *
+ * A CSS class used when rendering a drag handle for
+ * text selection.
+ */
+#define GTK_STYLE_CLASS_CURSOR_HANDLE "cursor-handle"
+
+/**
+ * GTK_STYLE_CLASS_INSERTION_CURSOR:
+ *
+ * A CSS class used when rendering a drag handle for
+ * the insertion cursor position.
+ */
+#define GTK_STYLE_CLASS_INSERTION_CURSOR "insertion-cursor"
+
+
 /* Predefined set of widget regions */
 
 /**
@@ -669,7 +748,6 @@ struct _GtkStyleContextClass
  */
 #define GTK_STYLE_REGION_TAB "tab"
 
-
 GType gtk_style_context_get_type (void) G_GNUC_CONST;
 
 GtkStyleContext * gtk_style_context_new (void);
@@ -690,6 +768,8 @@ void gtk_style_context_remove_provider (GtkStyleContext  *context,
 void gtk_style_context_save    (GtkStyleContext *context);
 void gtk_style_context_restore (GtkStyleContext *context);
 
+GtkCssSection * gtk_style_context_get_section (GtkStyleContext *context,
+                                               const gchar     *property);
 void gtk_style_context_get_property (GtkStyleContext *context,
                                      const gchar     *property,
                                      GtkStateFlags    state,
@@ -705,6 +785,7 @@ void          gtk_style_context_set_state    (GtkStyleContext *context,
                                               GtkStateFlags    flags);
 GtkStateFlags gtk_style_context_get_state    (GtkStyleContext *context);
 
+GDK_DEPRECATED_IN_3_6
 gboolean      gtk_style_context_state_is_running (GtkStyleContext *context,
                                                   GtkStateType     state,
                                                   gdouble         *progress);
@@ -712,6 +793,10 @@ gboolean      gtk_style_context_state_is_running (GtkStyleContext *context,
 void          gtk_style_context_set_path     (GtkStyleContext *context,
                                               GtkWidgetPath   *path);
 const GtkWidgetPath * gtk_style_context_get_path (GtkStyleContext *context);
+GDK_AVAILABLE_IN_3_4
+void          gtk_style_context_set_parent   (GtkStyleContext *context,
+                                              GtkStyleContext *parent);
+GtkStyleContext *gtk_style_context_get_parent (GtkStyleContext *context);
 
 GList *  gtk_style_context_list_classes (GtkStyleContext *context);
 
@@ -751,8 +836,17 @@ void        gtk_style_context_set_screen (GtkStyleContext *context,
                                           GdkScreen       *screen);
 GdkScreen * gtk_style_context_get_screen (GtkStyleContext *context);
 
+GDK_AVAILABLE_IN_3_8
+void           gtk_style_context_set_frame_clock (GtkStyleContext *context,
+                                                  GdkFrameClock   *frame_clock);
+GDK_AVAILABLE_IN_3_8
+GdkFrameClock *gtk_style_context_get_frame_clock (GtkStyleContext *context);
+
+
+GDK_DEPRECATED_IN_3_8_FOR(gtk_style_context_set_state)
 void             gtk_style_context_set_direction (GtkStyleContext  *context,
                                                   GtkTextDirection  direction);
+GDK_DEPRECATED_IN_3_8_FOR(gtk_style_context_get_state)
 GtkTextDirection gtk_style_context_get_direction (GtkStyleContext  *context);
 
 void             gtk_style_context_set_junction_sides (GtkStyleContext  *context,
@@ -763,20 +857,25 @@ gboolean gtk_style_context_lookup_color (GtkStyleContext *context,
                                          const gchar     *color_name,
                                          GdkRGBA         *color);
 
+GDK_DEPRECATED_IN_3_6
 void  gtk_style_context_notify_state_change (GtkStyleContext *context,
                                              GdkWindow       *window,
                                              gpointer         region_id,
                                              GtkStateType     state,
                                              gboolean         state_value);
+GDK_DEPRECATED_IN_3_6
 void  gtk_style_context_cancel_animations   (GtkStyleContext *context,
                                              gpointer         region_id);
+GDK_DEPRECATED_IN_3_6
 void  gtk_style_context_scroll_animations   (GtkStyleContext *context,
                                              GdkWindow       *window,
                                              gint             dx,
                                              gint             dy);
 
+GDK_DEPRECATED_IN_3_6
 void gtk_style_context_push_animatable_region (GtkStyleContext *context,
                                                gpointer         region_id);
+GDK_DEPRECATED_IN_3_6
 void gtk_style_context_pop_animatable_region  (GtkStyleContext *context);
 
 /* Some helper functions to retrieve most common properties */
@@ -789,6 +888,8 @@ void gtk_style_context_get_background_color (GtkStyleContext *context,
 void gtk_style_context_get_border_color     (GtkStyleContext *context,
                                              GtkStateFlags    state,
                                              GdkRGBA         *color);
+
+GDK_DEPRECATED_IN_3_8_FOR(gtk_style_context_get)
 const PangoFontDescription *
      gtk_style_context_get_font             (GtkStyleContext *context,
                                              GtkStateFlags    state);
@@ -900,12 +1001,22 @@ void        gtk_render_activity    (GtkStyleContext     *context,
 GdkPixbuf * gtk_render_icon_pixbuf (GtkStyleContext     *context,
                                     const GtkIconSource *source,
                                     GtkIconSize          size);
+GDK_AVAILABLE_IN_3_2
 void        gtk_render_icon        (GtkStyleContext     *context,
                                     cairo_t             *cr,
                                     GdkPixbuf           *pixbuf,
                                     gdouble              x,
                                     gdouble              y);
-
+GDK_AVAILABLE_IN_3_4
+void        gtk_render_insertion_cursor
+                                   (GtkStyleContext     *context,
+                                    cairo_t             *cr,
+                                    gdouble              x,
+                                    gdouble              y,
+                                    PangoLayout         *layout,
+                                    int                  index,
+                                    PangoDirection       direction);
+GDK_DEPRECATED_IN_3_4
 void   gtk_draw_insertion_cursor    (GtkWidget          *widget,
                                      cairo_t            *cr,
                                      const GdkRectangle *location,