summaryrefslogtreecommitdiff
path: root/gladeui/glade-editor-property.h
diff options
context:
space:
mode:
authorTristan Van Berkom <tvb@src.gnome.org>2008-04-03 19:52:40 +0000
committerTristan Van Berkom <tvb@src.gnome.org>2008-04-03 19:52:40 +0000
commit64bb8141c669ab3f36a713885472045c6c2ba035 (patch)
treee612211b16213e3ca79cfa3aac10ebbeed50ae79 /gladeui/glade-editor-property.h
parent1b84fad310e3f98deb960fc09bc6ad6ba9169671 (diff)
downloadglade-64bb8141c669ab3f36a713885472045c6c2ba035.tar.gz
merging builder branch into trunk
A plugins/gtk+/glade-keysyms.c M plugins/gtk+/glade-gtk.c M plugins/gtk+/gtk+.xml.in A plugins/gtk+/glade-accels.c M plugins/gtk+/Makefile.am A plugins/gtk+/glade-accels.h M ChangeLog M gladeui/glade-editor.c M gladeui/glade-editor-property.c M gladeui/glade-editor-property.h M gladeui/glade-widget.c M gladeui/glade-widget.h M gladeui/glade-widget-adaptor.c M gladeui/glade-command.c M gladeui/glade-widget-adaptor.h M gladeui/glade-parser.c M gladeui/glade-xml-utils.c M gladeui/glade-base-editor.c M gladeui/glade-utils.c D gladeui/glade-parser.h M gladeui/glade-signal-editor.c M gladeui/glade-xml-utils.h D gladeui/glade-keysyms.c M gladeui/glade-property.c M gladeui/glade-property-class.c M gladeui/glade-property.h M gladeui/glade-builtins.c M gladeui/glade-property-class.h M gladeui/glade-builtins.h M gladeui/glade-project.c M gladeui/glade-signal.c M gladeui/Makefile.am M gladeui/glade-signal.h svn path=/trunk/; revision=1764
Diffstat (limited to 'gladeui/glade-editor-property.h')
-rw-r--r--gladeui/glade-editor-property.h104
1 files changed, 92 insertions, 12 deletions
diff --git a/gladeui/glade-editor-property.h b/gladeui/glade-editor-property.h
index c9fce8b6..b8edfe6a 100644
--- a/gladeui/glade-editor-property.h
+++ b/gladeui/glade-editor-property.h
@@ -2,8 +2,69 @@
#ifndef __GLADE_EDITOR_PROPERTY_H__
#define __GLADE_EDITOR_PROPERTY_H__
+#include <gtk/gtk.h>
+
G_BEGIN_DECLS
+
+
+/*******************************************************************************
+ Boiler plate macros (inspired from glade-command.c)
+ *******************************************************************************/
+/* XXX document me ! */
+
+#define GLADE_MAKE_EPROP_TYPE(func, type, parent) \
+GType \
+func ## _get_type (void) \
+{ \
+ static GType cmd_type = 0; \
+ \
+ if (!cmd_type) \
+ { \
+ static const GTypeInfo info = \
+ { \
+ sizeof (type ## Class), \
+ (GBaseInitFunc) NULL, \
+ (GBaseFinalizeFunc) NULL, \
+ (GClassInitFunc) func ## _class_init, \
+ (GClassFinalizeFunc) NULL, \
+ NULL, \
+ sizeof (type), \
+ 0, \
+ (GInstanceInitFunc) NULL \
+ }; \
+ \
+ cmd_type = g_type_register_static (parent, #type, &info, 0); \
+ } \
+ \
+ return cmd_type; \
+} \
+
+
+#define GLADE_MAKE_EPROP(type, func) \
+static void \
+func ## _finalize (GObject *object); \
+static void \
+func ## _load (GladeEditorProperty *me, GladeProperty *property); \
+static GtkWidget * \
+func ## _create_input (GladeEditorProperty *me); \
+static void \
+func ## _class_init (gpointer parent_tmp, gpointer notused) \
+{ \
+ GladeEditorPropertyClass *parent = parent_tmp; \
+ GObjectClass* object_class; \
+ object_class = G_OBJECT_CLASS (parent); \
+ parent->load = func ## _load; \
+ parent->create_input = func ## _create_input; \
+ object_class->finalize = func ## _finalize; \
+} \
+typedef struct { \
+ GladeEditorPropertyClass cmd; \
+} type ## Class; \
+GLADE_MAKE_EPROP_TYPE(func, type, GLADE_TYPE_EDITOR_PROPERTY)
+
+
+
#define GLADE_TYPE_EDITOR_PROPERTY (glade_editor_property_get_type())
#define GLADE_EDITOR_PROPERTY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_EDITOR_PROPERTY, GladeEditorProperty))
#define GLADE_EDITOR_PROPERTY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_EDITOR_PROPERTY, GladeEditorPropertyClass))
@@ -59,7 +120,6 @@ struct _GladeEditorPropertyClass {
void (* load) (GladeEditorProperty *, GladeProperty *);
- /* private */
GtkWidget *(* create_input) (GladeEditorProperty *);
void (* gtk_doc_search)(GladeEditorProperty *,
@@ -71,15 +131,7 @@ struct _GladeEditorPropertyClass {
-GType glade_editor_property_get_type (void);
-
-GladeEditorProperty *glade_editor_property_new (GladePropertyClass *klass,
- gboolean use_command);
-
-GladeEditorProperty *glade_editor_property_new_from_widget (GladeWidget *widget,
- const gchar *property,
- gboolean packing,
- gboolean use_command);
+GType glade_editor_property_get_type (void) G_GNUC_CONST;
void glade_editor_property_load (GladeEditorProperty *eprop,
GladeProperty *property);
@@ -87,12 +139,40 @@ void glade_editor_property_load (GladeEditorProperty *
void glade_editor_property_load_by_widget (GladeEditorProperty *eprop,
GladeWidget *widget);
-gboolean glade_editor_property_supported (GParamSpec *pspec);
-
void glade_editor_property_show_info (GladeEditorProperty *eprop);
void glade_editor_property_hide_info (GladeEditorProperty *eprop);
+void glade_editor_property_commit (GladeEditorProperty *eprop,
+ GValue *value);
+
+
+/* Generic eprops */
+#define GLADE_TYPE_EPROP_NUMERIC (glade_eprop_numeric_get_type())
+#define GLADE_TYPE_EPROP_ENUM (glade_eprop_enum_get_type())
+#define GLADE_TYPE_EPROP_FLAGS (glade_eprop_flags_get_type())
+#define GLADE_TYPE_EPROP_COLOR (glade_eprop_color_get_type())
+#define GLADE_TYPE_EPROP_NAMED_ICON (glade_eprop_named_icon_get_type())
+#define GLADE_TYPE_EPROP_TEXT (glade_eprop_text_get_type())
+#define GLADE_TYPE_EPROP_BOOL (glade_eprop_bool_get_type())
+#define GLADE_TYPE_EPROP_UNICHAR (glade_eprop_unichar_get_type())
+#define GLADE_TYPE_EPROP_RESOURCE (glade_eprop_resource_get_type())
+#define GLADE_TYPE_EPROP_OBJECT (glade_eprop_object_get_type())
+#define GLADE_TYPE_EPROP_OBJECTS (glade_eprop_objects_get_type())
+#define GLADE_TYPE_EPROP_ADJUSTMENT (glade_eprop_adjustment_get_type())
+GType glade_eprop_numeric_get_type (void) G_GNUC_CONST;
+GType glade_eprop_enum_get_type (void) G_GNUC_CONST;
+GType glade_eprop_flags_get_type (void) G_GNUC_CONST;
+GType glade_eprop_color_get_type (void) G_GNUC_CONST;
+GType glade_eprop_named_icon_get_type (void) G_GNUC_CONST;
+GType glade_eprop_text_get_type (void) G_GNUC_CONST;
+GType glade_eprop_bool_get_type (void) G_GNUC_CONST;
+GType glade_eprop_unichar_get_type (void) G_GNUC_CONST;
+GType glade_eprop_resource_get_type (void) G_GNUC_CONST;
+GType glade_eprop_object_get_type (void) G_GNUC_CONST;
+GType glade_eprop_objects_get_type (void) G_GNUC_CONST;
+GType glade_eprop_adjustment_get_type (void) G_GNUC_CONST;
+
G_END_DECLS