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;
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;
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);
GdkBitmap *bg_stipple;
GdkBitmap *fg_stipple;
+ /* super/subscript rise, can be negative */
+ gint rise;
+
guint underline : 4; /* PangoUnderline */
guint strikethrough : 1;
* 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
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;
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
}