File: bonobo-ui-engine.h

package info (click to toggle)
bonobo 1.0.22-2.2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 13,412 kB
  • ctags: 5,445
  • sloc: ansic: 51,714; sh: 7,733; makefile: 1,425; yacc: 318; xml: 266; sed: 16
file content (196 lines) | stat: -rw-r--r-- 7,850 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
 * bonobo-ui-engine.h: The Bonobo UI/XML Sync engine.
 *
 * Author:
 *	Michael Meeks (michael@helixcode.com)
 *
 * Copyright 2000 Helix Code, Inc.
 */

#ifndef _BONOBO_UI_ENGINE_H_
#define _BONOBO_UI_ENGINE_H_

#include <libgnome/gnome-defs.h>
#include <bonobo/bonobo-object.h>

typedef struct _BonoboUIEngine BonoboUIEngine;

typedef enum {
	BONOBO_UI_ERROR_OK = 0,
	BONOBO_UI_ERROR_BAD_PARAM,
	BONOBO_UI_ERROR_INVALID_PATH,
	BONOBO_UI_ERROR_INVALID_XML
} BonoboUIError;

#include <bonobo/bonobo-ui-sync.h>

BEGIN_GNOME_DECLS

#define BONOBO_TYPE_UI_ENGINE            (bonobo_ui_engine_get_type ())
#define BONOBO_UI_ENGINE(obj)            (GTK_CHECK_CAST ((obj), BONOBO_TYPE_UI_ENGINE, BonoboUIEngine))
#define BONOBO_UI_ENGINE_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), BONOBO_TYPE_UI_ENGINE, BonoboUIEngineClass))
#define BONOBO_IS_UI_ENGINE(obj)         (GTK_CHECK_TYPE ((obj), BONOBO_TYPE_UI_ENGINE))
#define BONOBO_IS_UI_ENGINE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), BONOBO_TYPE_UI_ENGINE))

typedef struct _BonoboUIEnginePrivate BonoboUIEnginePrivate;

struct _BonoboUIEngine {
	GtkObject parent;

	BonoboUIEnginePrivate *priv;
};

typedef struct {
	GtkObjectClass parent_class;

	/* Signals */
	void (*add_hint)      (BonoboUIEngine *engine,
			       const char     *str);
	void (*remove_hint)   (BonoboUIEngine *engine);

	void (*emit_verb_on)  (BonoboUIEngine *engine,
			       BonoboUINode   *node);

	void (*emit_event_on) (BonoboUIEngine *engine,
			       BonoboUINode   *node,
			       const char     *state);
} BonoboUIEngineClass;

GtkType         bonobo_ui_engine_get_type      (void);
BonoboUIEngine *bonobo_ui_engine_construct     (BonoboUIEngine   *engine);
BonoboUIEngine *bonobo_ui_engine_new           (void);

void          bonobo_ui_engine_config_set_path (BonoboUIEngine *engine,
						const char     *path);
const char   *bonobo_ui_engine_config_get_path (BonoboUIEngine *engine);

void          bonobo_ui_engine_add_sync        (BonoboUIEngine   *engine,
						BonoboUISync     *sync);
void          bonobo_ui_engine_remove_sync     (BonoboUIEngine   *engine,
						BonoboUISync     *sync);
GSList       *bonobo_ui_engine_get_syncs       (BonoboUIEngine   *engine);

void          bonobo_ui_engine_update          (BonoboUIEngine   *engine);
void          bonobo_ui_engine_update_node     (BonoboUIEngine   *engine,
						BonoboUINode     *node);
void          bonobo_ui_engine_queue_update    (BonoboUIEngine   *engine,
						GtkWidget        *widget,
						BonoboUINode     *node,
						BonoboUINode     *cmd_node);

GtkWidget    *bonobo_ui_engine_build_control   (BonoboUIEngine   *engine,
						BonoboUINode     *node);

BonoboUINode *bonobo_ui_engine_widget_get_node   (GtkWidget        *widget);
void          bonobo_ui_engine_widget_set_node   (BonoboUIEngine   *engine,
						  GtkWidget        *widget,
						  BonoboUINode     *node);
void          bonobo_ui_engine_prune_widget_info (BonoboUIEngine   *engine,
						  BonoboUINode     *node,
						  gboolean          save_custom);

BonoboUINode *bonobo_ui_engine_get_path        (BonoboUIEngine   *engine,
						const char       *path);
void          bonobo_ui_engine_dirty_tree      (BonoboUIEngine   *engine,
						BonoboUINode     *node);
void          bonobo_ui_engine_clean_tree      (BonoboUIEngine   *engine,
						BonoboUINode     *node);
void          bonobo_ui_engine_dump            (BonoboUIEngine   *engine,
						FILE             *out,
						const char       *msg);

/* Extra Node data accessors */
CORBA_Object  bonobo_ui_engine_node_get_object (BonoboUIEngine   *engine,
						BonoboUINode     *node);
gboolean      bonobo_ui_engine_node_is_dirty   (BonoboUIEngine   *engine,
						BonoboUINode     *node);
GtkWidget    *bonobo_ui_engine_node_get_widget (BonoboUIEngine   *engine,
						BonoboUINode     *node);
const char   *bonobo_ui_engine_node_get_id     (BonoboUIEngine   *engine,
						BonoboUINode     *node);
BonoboUINode *bonobo_ui_engine_get_cmd_node    (BonoboUIEngine   *engine,
						BonoboUINode     *from_node);
void          bonobo_ui_engine_node_set_dirty  (BonoboUIEngine   *engine,
						BonoboUINode     *node,
						gboolean          dirty);
void          bonobo_ui_engine_stamp_custom    (BonoboUIEngine *engine,
						BonoboUINode   *node);
void          bonobo_ui_engine_stamp_root      (BonoboUIEngine *engine,
						BonoboUINode   *node,
						GtkWidget      *widget);
/* Signal firers */
void          bonobo_ui_engine_add_hint        (BonoboUIEngine   *engine,
						const char       *str);
void          bonobo_ui_engine_remove_hint     (BonoboUIEngine   *engine);
void          bonobo_ui_engine_emit_verb_on    (BonoboUIEngine   *engine,
						BonoboUINode     *node);
void          bonobo_ui_engine_emit_event_on   (BonoboUIEngine   *engine,
						BonoboUINode     *node,
						const char       *state);
void          bonobo_ui_engine_emit_verb_on_w  (BonoboUIEngine   *engine,
						GtkWidget        *widget);
void          bonobo_ui_engine_emit_event_on_w (BonoboUIEngine   *engine,
						GtkWidget        *widget,
						const char       *state);


/* Helpers */
char         *bonobo_ui_engine_get_attr           (BonoboUINode     *node,
						   BonoboUINode     *cmd_node,
						   const char       *attr);
void          bonobo_ui_engine_widget_attach_node (GtkWidget        *widget,
						   BonoboUINode     *node);

/* Various useful bits */
void bonobo_ui_engine_deregister_dead_components     (BonoboUIEngine *engine);
void bonobo_ui_engine_deregister_component_by_ref    (BonoboUIEngine *engine,
						      Bonobo_Unknown  ref);
void bonobo_ui_engine_deregister_component           (BonoboUIEngine *engine,
						      const char     *name);
void bonobo_ui_engine_register_component             (BonoboUIEngine *engine,
						      const char     *name,
						      Bonobo_Unknown  component);

GList         *bonobo_ui_engine_get_component_names  (BonoboUIEngine *engine);
Bonobo_Unknown bonobo_ui_engine_get_component        (BonoboUIEngine *engine,
						      const char     *name);

/* Interface used by UIContainer maps to BonoboUIXml */
CORBA_char      *bonobo_ui_engine_xml_get         (BonoboUIEngine   *engine,
						   const char       *path,
						   gboolean          node_only);
CORBA_char      *bonobo_ui_engine_xml_get_prop    (BonoboUIEngine   *engine,
						   const char       *path,
						   const char       *property);
gboolean         bonobo_ui_engine_xml_node_exists (BonoboUIEngine   *engine,
						   const char       *path);
BonoboUIError    bonobo_ui_engine_xml_set_prop    (BonoboUIEngine    *engine,
						   const char        *path,
						   const char        *property,
						   const char        *value,
						   const char        *component);
BonoboUIError    bonobo_ui_engine_xml_merge_tree  (BonoboUIEngine    *engine,
						   const char        *path,
						   BonoboUINode      *tree,
						   const char        *component);
BonoboUIError    bonobo_ui_engine_xml_rm          (BonoboUIEngine    *engine,
						   const char        *path,
						   const char        *by_component);
BonoboUIError    bonobo_ui_engine_object_set      (BonoboUIEngine   *engine,
						   const char       *path,
						   Bonobo_Unknown    object,
						   CORBA_Environment *ev);
BonoboUIError    bonobo_ui_engine_object_get      (BonoboUIEngine    *engine,
						   const char        *path,
						   Bonobo_Unknown    *object,
						   CORBA_Environment *ev);
void             bonobo_ui_engine_set_ui_container(BonoboUIEngine    *engine,
						   BonoboObject      *ui_container);

void             bonobo_ui_engine_freeze          (BonoboUIEngine    *engine);
void             bonobo_ui_engine_thaw            (BonoboUIEngine    *engine);

END_GNOME_DECLS

#endif /* _BONOBO_UI_ENGINE_H_ */