gtktexttagtable.h 2.79 KB
Newer Older
1 2 3
#ifndef GTK_TEXT_TAG_TABLE_H
#define GTK_TEXT_TAG_TABLE_H

4 5
#include <gtk/gtktexttag.h>

6 7 8 9
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

10 11 12 13
#include <gtk/gtktexttag.h>

typedef void (* GtkTextTagTableForeach) (GtkTextTag *tag, gpointer data);

14
#define GTK_TYPE_TEXT_TAG_TABLE            (gtk_text_tag_table_get_type ())
15 16 17 18 19
#define GTK_TEXT_TAG_TABLE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TEXT_TAG_TABLE, GtkTextTagTable))
#define GTK_TEXT_TAG_TABLE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TEXT_TAG_TABLE, GtkTextTagTableClass))
#define GTK_IS_TEXT_TAG_TABLE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TEXT_TAG_TABLE))
#define GTK_IS_TEXT_TAG_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TEXT_TAG_TABLE))
#define GTK_TEXT_TAG_TABLE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TEXT_TAG_TABLE, GtkTextTagTableClass))
20 21 22

typedef struct _GtkTextTagTableClass GtkTextTagTableClass;

23 24
struct _GtkTextTagTable
{
25
  GObject parent_instance;
26

27
  GHashTable *hash;
28 29
  GSList *anonymous;
  gint anon_count;
30 31

  GSList *buffers;
32 33
};

34 35
struct _GtkTextTagTableClass
{
36
  GObjectClass parent_class;
37

38 39 40
  void (* tag_changed) (GtkTextTagTable *table, GtkTextTag *tag, gboolean size_changed);
  void (* tag_added) (GtkTextTagTable *table, GtkTextTag *tag);
  void (* tag_removed) (GtkTextTagTable *table, GtkTextTag *tag);
41

42 43 44 45 46
  /* Padding for future expansion */
  void (*_gtk_reserved1) (void);
  void (*_gtk_reserved2) (void);
  void (*_gtk_reserved3) (void);
  void (*_gtk_reserved4) (void);
47 48
};

49
GType          gtk_text_tag_table_get_type (void) G_GNUC_CONST;
50 51

GtkTextTagTable *gtk_text_tag_table_new      (void);
52 53 54 55 56 57 58 59 60
void             gtk_text_tag_table_add      (GtkTextTagTable        *table,
                                              GtkTextTag             *tag);
void             gtk_text_tag_table_remove   (GtkTextTagTable        *table,
                                              GtkTextTag             *tag);
GtkTextTag      *gtk_text_tag_table_lookup   (GtkTextTagTable        *table,
                                              const gchar            *name);
void             gtk_text_tag_table_foreach  (GtkTextTagTable        *table,
                                              GtkTextTagTableForeach  func,
                                              gpointer                data);
61
gint             gtk_text_tag_table_get_size (GtkTextTagTable        *table);
62

63

64 65 66 67 68 69 70 71
/* INTERNAL private stuff - not even exported from the library on
 * many platforms
 */
void _gtk_text_tag_table_add_buffer    (GtkTextTagTable *table,
                                        gpointer         buffer);
void _gtk_text_tag_table_remove_buffer (GtkTextTagTable *table,
                                        gpointer         buffer);

72 73 74 75 76 77
#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif