* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only <gtk/gtk.h> can be included directly."
-#endif
-
#ifndef __GTK_BUILDER_H__
#define __GTK_BUILDER_H__
-#include <glib-object.h>
+#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
+#error "Only <gtk/gtk.h> can be included directly."
+#endif
+
+#include <gtk/gtkwidget.h>
G_BEGIN_DECLS
typedef struct _GtkBuilderClass GtkBuilderClass;
typedef struct _GtkBuilderPrivate GtkBuilderPrivate;
+/**
+ * GtkBuilderError:
+ * @GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION: A type-func attribute didn't name
+ * a function that returns a #GType.
+ * @GTK_BUILDER_ERROR_UNHANDLED_TAG: The input contained a tag that #GtkBuilder
+ * can't handle.
+ * @GTK_BUILDER_ERROR_MISSING_ATTRIBUTE: An attribute that is required by
+ * #GtkBuilder was missing.
+ * @GTK_BUILDER_ERROR_INVALID_ATTRIBUTE: #GtkBuilder found an attribute that
+ * it doesn't understand.
+ * @GTK_BUILDER_ERROR_INVALID_TAG: #GtkBuilder found a tag that
+ * it doesn't understand.
+ * @GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE: A required property value was
+ * missing.
+ * @GTK_BUILDER_ERROR_INVALID_VALUE: #GtkBuilder couldn't parse
+ * some attribute value.
+ * @GTK_BUILDER_ERROR_VERSION_MISMATCH: The input file requires a newer version
+ * of GTK+.
+ * @GTK_BUILDER_ERROR_DUPLICATE_ID: An object id occurred twice.
+ *
+ * Error codes that identify various errors that can occur while using
+ * #GtkBuilder.
+ */
typedef enum
{
- GTK_BUILDER_ERROR_VERSION_MISMATCH,
GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION,
GTK_BUILDER_ERROR_UNHANDLED_TAG,
GTK_BUILDER_ERROR_MISSING_ATTRIBUTE,
GTK_BUILDER_ERROR_INVALID_ATTRIBUTE,
GTK_BUILDER_ERROR_INVALID_TAG,
GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE,
- GTK_BUILDER_ERROR_INVALID_VALUE
+ GTK_BUILDER_ERROR_INVALID_VALUE,
+ GTK_BUILDER_ERROR_VERSION_MISMATCH,
+ GTK_BUILDER_ERROR_DUPLICATE_ID
} GtkBuilderError;
GQuark gtk_builder_error_quark (void);
guint gtk_builder_add_from_file (GtkBuilder *builder,
const gchar *filename,
GError **error);
+guint gtk_builder_add_from_resource (GtkBuilder *builder,
+ const gchar *resource_path,
+ GError **error);
guint gtk_builder_add_from_string (GtkBuilder *builder,
const gchar *buffer,
gsize length,
GError **error);
+guint gtk_builder_add_objects_from_file (GtkBuilder *builder,
+ const gchar *filename,
+ gchar **object_ids,
+ GError **error);
+GDK_AVAILABLE_IN_3_4
+guint gtk_builder_add_objects_from_resource(GtkBuilder *builder,
+ const gchar *resource_path,
+ gchar **object_ids,
+ GError **error);
+guint gtk_builder_add_objects_from_string (GtkBuilder *builder,
+ const gchar *buffer,
+ gsize length,
+ gchar **object_ids,
+ GError **error);
GObject* gtk_builder_get_object (GtkBuilder *builder,
const gchar *name);
GSList* gtk_builder_get_objects (GtkBuilder *builder);
+GDK_AVAILABLE_IN_3_8
+void gtk_builder_expose_object (GtkBuilder *builder,
+ const gchar *name,
+ GObject *object);
void gtk_builder_connect_signals (GtkBuilder *builder,
gpointer user_data);
void gtk_builder_connect_signals_full (GtkBuilder *builder,
GValue *value,
GError **error);
+/**
+ * GTK_BUILDER_WARN_INVALID_CHILD_TYPE:
+ * @object: the #GtkBuildable on which the warning ocurred
+ * @type: the unexpected type value
+ *
+ * This macro should be used to emit a warning about and unexpected @type value
+ * in a #GtkBuildable add_child implementation.
+ */
#define GTK_BUILDER_WARN_INVALID_CHILD_TYPE(object, type) \
- g_warning ("'%s' is not a valid child type of '%s'", type, g_type_name (G_OBJECT_TYPE (type)))
+ g_warning ("'%s' is not a valid child type of '%s'", type, g_type_name (G_OBJECT_TYPE (object)))
G_END_DECLS