]> Pileus Git - ~andy/gtk/blob - gtk/gtkbuilderprivate.h
70c9f7941f8c37e85eb7166e502159418e7ebc54
[~andy/gtk] / gtk / gtkbuilderprivate.h
1 /* gtkbuilderprivate.h
2  * Copyright (C) 2006-2007 Async Open Source,
3  *                         Johan Dahlin <jdahlin@async.com.br>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20
21 #ifndef __GTK_BUILDER_PRIVATE_H__
22 #define __GTK_BUILDER_PRIVATE_H__
23
24 #include <glib/gmarkup.h>
25 #include <glib/gslist.h>
26
27 #include <glib-object.h>
28 #include "gtkbuilder.h"
29
30 typedef struct {
31   const gchar *name;
32 } TagInfo;
33
34 typedef struct {
35   TagInfo tag;
36 } CommonInfo;
37
38 typedef struct {
39   TagInfo tag;
40   gchar *class_name;
41   gchar *id;
42   gchar *constructor;
43   GSList *properties;
44   GSList *signals;
45   GObject *object;
46   CommonInfo *parent;
47 } ObjectInfo;
48
49 typedef struct {
50   TagInfo tag;
51   GSList *packing_properties;
52   GObject *object;
53   CommonInfo *parent;
54   gchar *type;
55   gchar *internal_child;
56   gboolean added;
57 } ChildInfo;
58
59 typedef struct {
60   TagInfo tag;
61   gchar *name;
62   gchar *data;
63   gboolean translatable;
64 } PropertyInfo;
65
66 typedef struct {
67   TagInfo tag;
68   gchar *object_name;
69   gchar *name;
70   gchar *handler;
71   GConnectFlags flags;
72   gchar *connect_object_name;
73 } SignalInfo;
74
75 typedef struct {
76   GMarkupParser *parser;
77   gchar *tagname;
78   const gchar *start;
79   gpointer data;
80   GObject *object;
81   GObject *child;
82 } SubParser;
83
84 typedef struct {
85   const gchar *last_element;
86   GtkBuilder *builder;
87   gchar *domain;
88   GSList *stack;
89   SubParser *subparser;
90   GMarkupParseContext *ctx;
91   const gchar *filename;
92   GSList *finalizers;
93   GSList *custom_finalizers;
94 } ParserData;
95
96 typedef GType (*GTypeGetFunc) (void);
97
98 void _gtk_builder_parser_parse_buffer (GtkBuilder *builder,
99                                        const gchar *filename,
100                                        const gchar *buffer,
101                                        gsize length,
102                                        GError **error);
103 GObject * _gtk_builder_construct (GtkBuilder *builder,
104                                   ObjectInfo *info);
105 void      _gtk_builder_add (GtkBuilder *builder,
106                             ChildInfo *child_info);
107 void      _gtk_builder_finish (GtkBuilder *builder);
108 void _free_signal_info (SignalInfo *info,
109                         gpointer user_data);
110 gboolean _gtk_builder_boolean_from_string (const gchar  *string,
111                                            gboolean     *value,
112                                            GError      **error);
113 gboolean  _gtk_builder_flags_from_string (GType       type,
114                                           const char *string,
115                                           gint       *value,
116                                           GError    **error);
117
118 #endif /* __GTK_BUILDER_PRIVATE_H__ */