Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /* GTK - The GIMP Toolkit
  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. #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
  21. #error "Only <gtk/gtk.h> can be included directly."
  22. #endif
  23. #ifndef __GTK_BUILDER_H__
  24. #define __GTK_BUILDER_H__
  25. #include <gdkconfig.h>
  26. #include <glib-object.h>
  27. G_BEGIN_DECLS
  28. #define GTK_TYPE_BUILDER (gtk_builder_get_type ())
  29. #define GTK_BUILDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_BUILDER, GtkBuilder))
  30. #define GTK_BUILDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_BUILDER, GtkBuilderClass))
  31. #define GTK_IS_BUILDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_BUILDER))
  32. #define GTK_IS_BUILDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BUILDER))
  33. #define GTK_BUILDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_BUILDER, GtkBuilderClass))
  34. #define GTK_BUILDER_ERROR (gtk_builder_error_quark ())
  35. typedef struct _GtkBuilder GtkBuilder;
  36. typedef struct _GtkBuilderClass GtkBuilderClass;
  37. typedef struct _GtkBuilderPrivate GtkBuilderPrivate;
  38. typedef enum
  39. {
  40. GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION,
  41. GTK_BUILDER_ERROR_UNHANDLED_TAG,
  42. GTK_BUILDER_ERROR_MISSING_ATTRIBUTE,
  43. GTK_BUILDER_ERROR_INVALID_ATTRIBUTE,
  44. GTK_BUILDER_ERROR_INVALID_TAG,
  45. GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE,
  46. GTK_BUILDER_ERROR_INVALID_VALUE,
  47. GTK_BUILDER_ERROR_VERSION_MISMATCH,
  48. GTK_BUILDER_ERROR_DUPLICATE_ID
  49. } GtkBuilderError;
  50. GQuark gtk_builder_error_quark (void);
  51. struct _GtkBuilder
  52. {
  53. GObject parent_instance;
  54. GtkBuilderPrivate *GSEAL (priv);
  55. };
  56. struct _GtkBuilderClass
  57. {
  58. GObjectClass parent_class;
  59. GType (* get_type_from_name) (GtkBuilder *builder,
  60. const char *type_name);
  61. /* Padding for future expansion */
  62. void (*_gtk_reserved1) (void);
  63. void (*_gtk_reserved2) (void);
  64. void (*_gtk_reserved3) (void);
  65. void (*_gtk_reserved4) (void);
  66. void (*_gtk_reserved5) (void);
  67. void (*_gtk_reserved6) (void);
  68. void (*_gtk_reserved7) (void);
  69. void (*_gtk_reserved8) (void);
  70. };
  71. typedef void (*GtkBuilderConnectFunc) (GtkBuilder *builder,
  72. GObject *object,
  73. const gchar *signal_name,
  74. const gchar *handler_name,
  75. GObject *connect_object,
  76. GConnectFlags flags,
  77. gpointer user_data);
  78. GType gtk_builder_get_type (void) G_GNUC_CONST;
  79. GtkBuilder* gtk_builder_new (void);
  80. guint gtk_builder_add_from_file (GtkBuilder *builder,
  81. const gchar *filename,
  82. GError **error);
  83. guint gtk_builder_add_from_string (GtkBuilder *builder,
  84. const gchar *buffer,
  85. gsize length,
  86. GError **error);
  87. guint gtk_builder_add_objects_from_file (GtkBuilder *builder,
  88. const gchar *filename,
  89. gchar **object_ids,
  90. GError **error);
  91. guint gtk_builder_add_objects_from_string (GtkBuilder *builder,
  92. const gchar *buffer,
  93. gsize length,
  94. gchar **object_ids,
  95. GError **error);
  96. GObject* gtk_builder_get_object (GtkBuilder *builder,
  97. const gchar *name);
  98. GSList* gtk_builder_get_objects (GtkBuilder *builder);
  99. void gtk_builder_connect_signals (GtkBuilder *builder,
  100. gpointer user_data);
  101. void gtk_builder_connect_signals_full (GtkBuilder *builder,
  102. GtkBuilderConnectFunc func,
  103. gpointer user_data);
  104. void gtk_builder_set_translation_domain (GtkBuilder *builder,
  105. const gchar *domain);
  106. const gchar* gtk_builder_get_translation_domain (GtkBuilder *builder);
  107. GType gtk_builder_get_type_from_name (GtkBuilder *builder,
  108. const char *type_name);
  109. gboolean gtk_builder_value_from_string (GtkBuilder *builder,
  110. GParamSpec *pspec,
  111. const gchar *string,
  112. GValue *value,
  113. GError **error);
  114. gboolean gtk_builder_value_from_string_type (GtkBuilder *builder,
  115. GType type,
  116. const gchar *string,
  117. GValue *value,
  118. GError **error);
  119. #define GTK_BUILDER_WARN_INVALID_CHILD_TYPE(object, type) \
  120. g_warning ("'%s' is not a valid child type of '%s'", type, g_type_name (G_OBJECT_TYPE (object)))
  121. G_END_DECLS
  122. #endif /* __GTK_BUILDER_H__ */