~ubuntu-branches/ubuntu/quantal/libbonobo/quantal-201207170711

« back to all changes in this revision

Viewing changes to doc/api/tmpl/bonobo-property-bag.sgml

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2005-02-18 14:40:51 UTC
  • mto: (3.1.1 etch) (1.1.25 upstream)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20050218144051-fo4h9qh2gim8x3wt
Tags: upstream-2.8.1
ImportĀ upstreamĀ versionĀ 2.8.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
supply the property. Similarly, when a property changes
21
21
value inside your object you need to notify the property
22
22
bag's listeners that it has changed with a call to
23
 
<function>bonobo_property_bag_notify_listeners</function>.
 
23
<function>bonobo_event_source_notify_listeners_full</function>.
24
24
</para>
25
25
 
26
26
<para>
27
27
Here is a simple example use of the property bag:
28
28
  <example>
29
 
     <title>Callbacks</title>
 
29
     <title>PropertyBag Callbacks</title>
30
30
     <programlisting>
31
31
enum {
32
32
        PROP_RUNNING,
94
94
Then to instantiate the property bag interface and associate it with
95
95
a control perhaps we do:
96
96
  <example>
97
 
     <title></title>
 
97
     <title>Adding a PropertyBag to a control</title>
98
98
     <programlisting>
99
99
        BonoboPropertyBag *pb;
100
100
 
117
117
And finally we need to notify listeners of changes in various properties
118
118
so we could perhaps do:
119
119
  <example>
120
 
     <title></title>
 
120
     <title>Notifying proterty bag listeners</title>
121
121
     <programlisting>
122
122
static void
123
123
signal_handler (GtkClock *clock, BonoboPropertyBag *pb)
126
126
 
127
127
        BONOBO_ARG_SET_STRING (arg, gtk_clock_get_color (clock));
128
128
 
129
 
        bonobo_property_bag_notify_listeners (
130
 
                pb, "colour", arg, NULL);
131
 
 
 
129
        bonobo_event_source_notify_listeners_full (pb->es, 
 
130
                                                   "Bonobo/Property",
 
131
                                                   "change",
 
132
                                                   "colour",
 
133
                                                   arg, NULL);
132
134
        bonobo_arg_release (arg);
133
135
}
134
136
...
144
146
 
145
147
</para>
146
148
 
 
149
<!-- ##### STRUCT BonoboPropertyBagClass ##### -->
 
150
<para>
 
151
 
 
152
</para>
 
153
 
 
154
@parent: 
 
155
@epv: 
 
156
 
 
157
<!-- ##### STRUCT BonoboPropertyBag ##### -->
 
158
<para>
 
159
 
 
160
</para>
 
161
 
 
162
@parent: 
 
163
@priv: 
 
164
@es: 
 
165
 
147
166
<!-- ##### MACRO BONOBO_PROPERTY_READABLE ##### -->
148
167
<para>
149
 
 
 
168
    If this flag is set, the property allows consulting its value.
150
169
</para>
151
170
 
152
171
 
153
172
 
154
173
<!-- ##### MACRO BONOBO_PROPERTY_WRITEABLE ##### -->
155
174
<para>
156
 
 
 
175
    If this flag is set, the property supports modification of its value.
 
176
</para>
 
177
 
 
178
 
 
179
 
 
180
<!-- ##### MACRO BONOBO_PROPERTY_WRITABLE ##### -->
 
181
<para>
 
182
    Misspelling of #BONOBO_PROPERTY_WRITEABLE.
157
183
</para>
158
184
 
159
185
 
160
186
 
161
187
<!-- ##### MACRO BONOBO_PROPERTY_NO_LISTENING ##### -->
162
188
<para>
163
 
 
 
189
    If this flag set, when the property changes its value its
 
190
    listeners will *not* be notified.
164
191
</para>
165
192
 
166
193
 
167
194
 
168
195
<!-- ##### MACRO BONOBO_PROPERTY_NO_AUTONOTIFY ##### -->
169
196
<para>
170
 
 
171
 
</para>
172
 
 
173
 
 
174
 
 
175
 
<!-- ##### STRUCT BonoboPropertyBagPrivate ##### -->
176
 
<para>
177
 
 
178
 
</para>
179
 
 
180
 
 
181
 
<!-- ##### STRUCT BonoboPropertyBag ##### -->
182
 
<para>
183
 
 
184
 
</para>
185
 
 
186
 
@parent: 
187
 
@priv: 
188
 
@es: 
 
197
    If this flag set, when the property changes its value its
 
198
    listeners will *not* be notified.
 
199
</para>
 
200
 
 
201
 
189
202
 
190
203
<!-- ##### STRUCT BonoboProperty ##### -->
191
204
<para>
192
 
 
193
 
</para>
194
 
 
195
 
@name: 
196
 
@idx: 
197
 
@type: 
198
 
@default_value: 
199
 
@doctitle: 
200
 
@docstring: 
201
 
@flags: 
202
 
@priv: 
203
 
 
204
 
<!-- ##### STRUCT BonoboPropertyPrivate ##### -->
205
 
<para>
206
 
 
207
 
</para>
208
 
 
 
205
Structure that holds information about a property in a #BonoboPropertyBag.
 
206
</para>
 
207
 
 
208
@name: the canonic name of the property
 
209
@idx: unique numeric identifier of the property within the property bag
 
210
@type: type of value contained by this property
 
211
@default_value: the default value
 
212
@doctitle: documentation string title
 
213
@docstring: documentation string
 
214
@flags: property flags (read/write, etc.)
 
215
@priv: implementation private data
209
216
 
210
217
<!-- ##### USER_FUNCTION BonoboPropertyGetFn ##### -->
211
218
<para>
212
 
 
 
219
Property getter function.
213
220
</para>
214
221
 
215
 
@bag: 
216
 
@arg: 
217
 
@arg_id: 
218
 
@ev: 
219
 
@user_data: 
 
222
@bag: the property bag
 
223
@arg: output parameter; the caller must place here the property value
 
224
@arg_id: unique numeric identifier of the property within the property bag
 
225
@ev: the relevant CORBA environment
 
226
@user_data: user data
220
227
 
221
228
 
222
229
<!-- ##### USER_FUNCTION BonoboPropertySetFn ##### -->
223
230
<para>
224
 
 
225
 
</para>
226
 
 
227
 
@bag: 
228
 
@arg: 
229
 
@arg_id: 
230
 
@ev: 
231
 
@user_data: 
232
 
 
233
 
 
234
 
<!-- ##### TYPEDEF BonoboPropertyBagClass ##### -->
235
 
<para>
236
 
 
237
 
</para>
238
 
 
239
 
 
240
 
<!-- ##### MACRO BONOBO_PROPERTY_BAG_TYPE ##### -->
241
 
<para>
242
 
 
243
 
</para>
244
 
 
 
231
Property setter function.
 
232
</para>
 
233
 
 
234
@bag: the property bag
 
235
@arg: the new property value to be set
 
236
@arg_id: unique numeric identifier of the property within the property bag
 
237
@ev: the relevant CORBA environment
 
238
@user_data: user data
245
239
 
246
240
 
247
241
<!-- ##### FUNCTION bonobo_property_bag_new ##### -->
275
269
 
276
270
@get_prop: 
277
271
@set_prop: 
278
 
@event_source: 
 
272
@es: 
279
273
@Returns: 
280
274
<!-- # Unused Parameters # -->
 
275
@event_source: 
281
276
@user_data: 
282
277
 
283
278
 
289
284
@pb: 
290
285
@get_prop: 
291
286
@set_prop: 
292
 
@event_source: 
 
287
@es: 
293
288
@Returns: 
294
289
<!-- # Unused Parameters # -->
 
290
@event_source: 
295
291
@user_data: 
296
292
 
297
293