77
77
gobj->finalize = indicate_indicator_finalize;
80
IndicateIndicator::display:
81
@arg0: The #IndicateIndicator object
83
Emitted when the user has clicked on this indicator. In the
84
messaging indicator this would be when someone clicks on the
85
menu item for the indicator.
79
87
signals[USER_DISPLAY] = g_signal_new(INDICATE_INDICATOR_SIGNAL_DISPLAY,
80
88
G_TYPE_FROM_CLASS(class),
84
92
g_cclosure_marshal_VOID__VOID,
95
IndicateIndicator::hide:
96
@arg0: The #IndicateIndicator object
98
Emitted every time this indicator is hidden. This
99
is mostly used by #IndicateServer.
101
Typically this results in an emition of #IndicateServer::indicator-removed.
86
103
signals[HIDE] = g_signal_new(INDICATE_INDICATOR_SIGNAL_HIDE,
87
104
G_TYPE_FROM_CLASS(class),
88
105
G_SIGNAL_RUN_LAST,
91
108
g_cclosure_marshal_VOID__VOID,
111
IndicateIndicator::show:
112
@arg0: The #IndicateIndicator object
114
Emitted every time this indicator is shown. This
115
is mostly used by #IndicateServer.
117
Typically this results in an emition of #IndicateServer::indicator-added.
93
119
signals[SHOW] = g_signal_new(INDICATE_INDICATOR_SIGNAL_SHOW,
94
120
G_TYPE_FROM_CLASS(class),
95
121
G_SIGNAL_RUN_LAST,
98
124
g_cclosure_marshal_VOID__VOID,
127
IndicateIndicator::modified:
128
@arg0: The #IndicateIndicator object
129
@arg1: The name of the property that changed.
131
Emitted every time an indicator property is changed.
132
This is mostly used by #IndicateServer.
134
Typically this results in an emition of #IndicateServer::indicator-modified.
100
136
signals[MODIFIED] = g_signal_new(INDICATE_INDICATOR_SIGNAL_MODIFIED,
101
137
G_TYPE_FROM_CLASS(class),
102
138
G_SIGNAL_RUN_LAST,
185
indicate_indicator_get_type:
187
Gets a unique #GType for the #IndicateIndicator objects.
189
Return value: A unique #GType value.
193
indicate_indicator_new:
195
Builds a new indicator object using g_object_new().
197
Return value: A pointer to a new #IndicateIndicator object.
148
199
IndicateIndicator *
149
200
indicate_indicator_new (void)
152
203
return indicator;
207
indicate_indicator_new_with_server:
208
@server: The server that should be associated with this indicator.
210
Builds a new indicator object using g_object_new() and sets
211
the server to the specified server. Also, adds a reference
214
Return value: A pointer to a new #IndicateIndicator object.
217
indicate_indicator_new_with_server (IndicateServer * server)
219
g_return_val_if_fail(server != NULL, NULL);
221
IndicateIndicator * indicator = g_object_new(INDICATE_TYPE_INDICATOR, NULL);
223
IndicateIndicatorPrivate * priv = INDICATE_INDICATOR_GET_PRIVATE(indicator);
224
if (priv->server != NULL) {
225
g_object_unref(priv->server);
229
priv->server = server;
230
g_object_ref(priv->server);
237
indicate_indicator_show:
238
@indicator: a #IndicateIndicator to act on
240
Shows this indicator on the bus. If the #IndicateServer that it's
241
connected to is not shown itself this function will show the server
242
as well using #indicate_server_show.
156
245
indicate_indicator_show (IndicateIndicator * indicator)
286
indicate_indicator_is_visible:
287
@indicator: a #IndicateIndicator to act on
289
Checkes the visibility status of @indicator.
291
Return value: %TRUE if the indicator is visible else %FALSE.
190
294
indicate_indicator_is_visible (IndicateIndicator * indicator)
194
298
return priv->is_visible;
302
indicate_indicator_get_id:
303
@indicator: a #IndicateIndicator to act on
305
Gets the ID value of the @indicator.
307
Return value: The ID of the indicator. Can not be zero.
308
Zero represents an error.
198
311
indicate_indicator_get_id (IndicateIndicator * indicator)
319
indicate_indicator_get_indicator_type:
320
@indicator: a #IndicateIndicator to act on
322
Returns the type of @indicator. This is largely set by the subclass
323
that the indicator was built with and should not be free'd.
325
Return value: A string defining the type or NULL for no type.
206
328
indicate_indicator_get_indicator_type (IndicateIndicator * indicator)
341
indicate_indicator_user_display:
342
@indicator: a #IndicateIndicator to act on
344
Emits the #IndicateIndicator::user-display signal simliar to a user
345
clicking on @indicator over the bus. Signal will not be sent if the
346
@indicator is not visible.
219
349
indicate_indicator_user_display (IndicateIndicator * indicator)
361
indicate_indicator_set_property:
362
@indicator: a #IndicateIndicator to act on
363
@key: name of the property
364
@data: value of the property
366
Sets a simple string property on @indicator. If the property
367
had previously been set it will replace it with the new value,
368
otherwise it will create the property. This will include an
369
emition of #IndicateIndicator::modified if the property value
231
373
indicate_indicator_set_property (IndicateIndicator * indicator, const gchar * key, const gchar * data)
238
380
return class->set_property(indicator, key, data);
242
indicate_indicator_set_property_icon (IndicateIndicator * indicator, const gchar * key, const GdkPixbuf * data)
244
if (!GDK_IS_PIXBUF(data)) {
245
g_warning("Invalide GdkPixbuf");
249
GError * error = NULL;
253
if (!gdk_pixbuf_save_to_buffer((GdkPixbuf *)data, &png_data, &png_data_len, "png", &error, NULL)) {
255
g_warning("Unable to create pixbuf data stream: %d", png_data_len);
257
g_warning("Unable to create pixbuf data stream: %s", error->message);
265
gchar * prop_str = g_base64_encode((guchar *)png_data, png_data_len);
266
indicate_indicator_set_property(indicator, key, prop_str);
384
indicate_indicator_set_property_time:
385
@indicator: a #IndicateIndicator to act on
386
@key: name of the property
387
@time: time to set property with
389
This is a helper function that wraps around #indicate_indicator_set_property
390
but takes an #GTimeVal parameter. It then takes the @data
391
parameter converts it to an ISO 8601 time string and
392
uses that data to call #indicate_indicator_set_property.
275
395
indicate_indicator_set_property_time (IndicateIndicator * indicator, const gchar * key, GTimeVal * time)
406
indicate_indicator_get_property:
407
@indicator: a #IndicateIndicator to act on
408
@key: name of the property
410
Returns the value that is set for a property or %NULL if that
413
Return value: A constant string or NULL.
286
416
indicate_indicator_get_property (IndicateIndicator * indicator, const gchar * key)
293
423
return class->get_property(indicator, key);
427
indicate_indicator_list_properties:
428
@indicator: a #IndicateIndicator to act on
430
This function gets a list of all the properties that exist
431
on a @indicator. The array may have zero entries but almost
432
always at least has 'type' in it.
434
Return value: An array of strings that is the keys of all
435
the properties on this indicator.
297
438
indicate_indicator_list_properties (IndicateIndicator * indicator)