]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtktexttag.h
allow shrinking the image window to test that we clip to allocation.
[~andy/gtk] / gtk / gtktexttag.h
index 992f31556c0c164581b156c60af59b183ddee050..ea30059b75cccb862ab024f49c4206f82321adeb 100644 (file)
@@ -12,28 +12,21 @@ typedef struct _GtkTextIter GtkTextIter;
 typedef struct _GtkTextBTreeNode GtkTextBTreeNode;
 typedef struct _GtkTextTagTable GtkTextTagTable;
 
-typedef enum
-{
-  GTK_WRAPMODE_NONE,
-  GTK_WRAPMODE_CHAR,
-  GTK_WRAPMODE_WORD
-} GtkWrapMode;
-
 typedef struct _GtkTextAttributes GtkTextAttributes;
 
 #define GTK_TYPE_TEXT_TAG            (gtk_text_tag_get_type ())
-#define GTK_TEXT_TAG(obj)            (GTK_CHECK_CAST ((obj), GTK_TYPE_TEXT_TAG, GtkTextTag))
-#define GTK_TEXT_TAG_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TEXT_TAG, GtkTextTagClass))
-#define GTK_IS_TEXT_TAG(obj)         (GTK_CHECK_TYPE ((obj), GTK_TYPE_TEXT_TAG))
-#define GTK_IS_TEXT_TAG_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TEXT_TAG))
-#define GTK_TEXT_TAG_GET_CLASS(obj)  (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_TEXT_TAG, GtkTextTagClass))
+#define GTK_TEXT_TAG(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TEXT_TAG, GtkTextTag))
+#define GTK_TEXT_TAG_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TEXT_TAG, GtkTextTagClass))
+#define GTK_IS_TEXT_TAG(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TEXT_TAG))
+#define GTK_IS_TEXT_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TEXT_TAG))
+#define GTK_TEXT_TAG_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TEXT_TAG, GtkTextTagClass))
 
 typedef struct _GtkTextTag GtkTextTag;
 typedef struct _GtkTextTagClass GtkTextTagClass;
 
 struct _GtkTextTag
 {
-  GtkObject parent_instance;
+  GObject parent_instance;
 
   GtkTextTagTable *table;
 
@@ -61,12 +54,17 @@ struct _GtkTextTag
   guint bg_color_set : 1;
   guint bg_stipple_set : 1;
   guint fg_color_set : 1;
-  guint font_set : 1;
+  guint family_set : 1;
+  guint style_set : 1;
+  guint variant_set : 1;
+  guint weight_set : 1;
+  guint stretch_set : 1;
+  guint size_set : 1;
   guint fg_stipple_set : 1;
-  guint justify_set : 1;
+  guint justification_set : 1;
   guint left_margin_set : 1;
   guint indent_set : 1;
-  guint offset_set : 1;
+  guint rise_set : 1;
   guint strikethrough_set : 1;
   guint right_margin_set : 1;
   guint pixels_above_lines_set : 1;
@@ -84,21 +82,22 @@ struct _GtkTextTag
   guint pad3 : 1;
 };
 
-struct _GtkTextTagClass {
-  GtkObjectClass parent_class;
+struct _GtkTextTagClass 
+{
+  GObjectClass parent_class;
 
-  gint (* event) (GtkTextTag *tag,
-                  GObject *event_object,           /* widget, canvas item, whatever */
-                  GdkEvent *event,                 /* the event itself */
-                  const GtkTextIter *iter);        /* location of event in buffer */
+  gboolean (* event) (GtkTextTag        *tag,
+                      GObject           *event_object, /* widget, canvas item, whatever */
+                      GdkEvent          *event,        /* the event itself */
+                      const GtkTextIter *iter);        /* location of event in buffer */
 };
 
-GtkType      gtk_text_tag_get_type     (void) G_GNUC_CONST;
+GType        gtk_text_tag_get_type     (void) G_GNUC_CONST;
 GtkTextTag  *gtk_text_tag_new          (const gchar       *name);
 gint         gtk_text_tag_get_priority (GtkTextTag        *tag);
 void         gtk_text_tag_set_priority (GtkTextTag        *tag,
                                         gint               priority);
-gint         gtk_text_tag_event        (GtkTextTag        *tag,
+gboolean     gtk_text_tag_event        (GtkTextTag        *tag,
                                         GObject           *event_object,
                                         GdkEvent          *event,
                                         const GtkTextIter *iter);
@@ -116,6 +115,9 @@ struct _GtkTextAppearance
   GdkBitmap *bg_stipple;
   GdkBitmap *fg_stipple;
 
+  /* super/subscript rise, can be negative */
+  gint rise;
+  
   guint underline : 4;          /* PangoUnderline */
   guint strikethrough : 1;
 
@@ -125,12 +127,13 @@ struct _GtkTextAppearance
    * had background stuff set.
    */
   guint draw_bg : 1;
-
-  /* This is only used when we are actually laying out and rendering
+  
+  /* These are only used when we are actually laying out and rendering
    * a paragraph; not when a GtkTextAppearance is part of a
    * GtkTextAttributes.
    */
   guint inside_selection : 1;
+  guint is_text : 1;
 };
 
 struct _GtkTextAttributes
@@ -139,17 +142,15 @@ struct _GtkTextAttributes
 
   GtkTextAppearance appearance;
 
-  GtkJustification justify;
+  GtkJustification justification;
   GtkTextDirection direction;
 
-  PangoFontDescription *font_desc;
+  /* Individual chunks of this can be set/unset as a group */
+  PangoFontDescription font;
 
   gint left_margin;
 
-  gint indent;
-  
-  /* super/subscript offset, can be negative */
-  gint offset;
+  gint indent;  
 
   gint right_margin;
 
@@ -188,12 +189,13 @@ struct _GtkTextAttributes
   guint pad4 : 1;
 };
 
-/* FIXME _copy() has the wrong signature */
-GtkTextAttributes  *gtk_text_attributes_new       (void);
-void                gtk_text_attributes_copy      (GtkTextAttributes *src,
-                                                   GtkTextAttributes *dest);
-void                gtk_text_attributes_unref     (GtkTextAttributes *values);
-void                gtk_text_attributes_ref       (GtkTextAttributes *values);
+GtkTextAttributes* gtk_text_attributes_new         (void);
+GtkTextAttributes* gtk_text_attributes_copy        (GtkTextAttributes *src);
+void               gtk_text_attributes_copy_values (GtkTextAttributes *src,
+                                                    GtkTextAttributes *dest);
+void               gtk_text_attributes_unref       (GtkTextAttributes *values);
+void               gtk_text_attributes_ref         (GtkTextAttributes *values);
+
 
 #ifdef __cplusplus
 }