]> Pileus Git - ~andy/gtk/blob - gtk/gtkbuilderprivate.h
Add GtkSpinner::animation-duration style property
[~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 "gtkbuilder.h"
25
26 typedef struct {
27   const gchar *name;
28 } TagInfo;
29
30 typedef struct {
31   TagInfo tag;
32 } CommonInfo;
33
34 typedef struct {
35   TagInfo tag;
36   gchar *class_name;
37   gchar *id;
38   gchar *constructor;
39   GSList *properties;
40   GSList *signals;
41   GObject *object;
42   CommonInfo *parent;
43 } ObjectInfo;
44
45 typedef struct {
46   TagInfo tag;
47   GSList *packing_properties;
48   GObject *object;
49   CommonInfo *parent;
50   gchar *type;
51   gchar *internal_child;
52   gboolean added;
53 } ChildInfo;
54
55 typedef struct {
56   TagInfo tag;
57   gchar *name;
58   GString *text;
59   gchar *data;
60   gboolean translatable;
61   gchar *context;
62 } PropertyInfo;
63
64 typedef struct {
65   TagInfo tag;
66   gchar *object_name;
67   gchar *name;
68   gchar *handler;
69   GConnectFlags flags;
70   gchar *connect_object_name;
71 } SignalInfo;
72
73 typedef struct {
74   TagInfo  tag;
75   gchar   *library;
76   gint     major;
77   gint     minor;
78 } RequiresInfo;
79
80 typedef struct {
81   GMarkupParser *parser;
82   gchar *tagname;
83   const gchar *start;
84   gpointer data;
85   GObject *object;
86   GObject *child;
87 } SubParser;
88
89 typedef struct {
90   const gchar *last_element;
91   GtkBuilder *builder;
92   gchar *domain;
93   GSList *stack;
94   SubParser *subparser;
95   GMarkupParseContext *ctx;
96   const gchar *filename;
97   GSList *finalizers;
98   GSList *custom_finalizers;
99
100   GSList *requested_objects; /* NULL if all the objects are requested */
101   gboolean inside_requested_object;
102   gint requested_object_level;
103   gint cur_object_level;
104
105   GHashTable *object_ids;
106 } ParserData;
107
108 typedef GType (*GTypeGetFunc) (void);
109
110 /* Things only GtkBuilder should use */
111 void _gtk_builder_parser_parse_buffer (GtkBuilder *builder,
112                                        const gchar *filename,
113                                        const gchar *buffer,
114                                        gsize length,
115                                        gchar **requested_objs,
116                                        GError **error);
117 GObject * _gtk_builder_construct (GtkBuilder *builder,
118                                   ObjectInfo *info,
119                                   GError    **error);
120 void      _gtk_builder_add (GtkBuilder *builder,
121                             ChildInfo *child_info);
122 void      _gtk_builder_add_signals (GtkBuilder *builder,
123                                     GSList     *signals);
124 void      _gtk_builder_finish (GtkBuilder *builder);
125 void _free_signal_info (SignalInfo *info,
126                         gpointer user_data);
127
128 /* Internal API which might be made public at some point */
129 gboolean _gtk_builder_boolean_from_string (const gchar  *string,
130                                            gboolean     *value,
131                                            GError      **error);
132 gboolean _gtk_builder_enum_from_string (GType         type,
133                                         const gchar  *string,
134                                         gint         *enum_value,
135                                         GError      **error);
136 gboolean  _gtk_builder_flags_from_string (GType       type,
137                                           const char *string,
138                                           guint      *value,
139                                           GError    **error);
140 gchar * _gtk_builder_parser_translate (const gchar *domain,
141                                        const gchar *context,
142                                        const gchar *text);
143 gchar *   _gtk_builder_get_absolute_filename (GtkBuilder *builder,
144                                               const gchar *string);
145
146 #endif /* __GTK_BUILDER_PRIVATE_H__ */