diff options
Diffstat (limited to 'src/include/gnunet_gtk.h')
-rw-r--r-- | src/include/gnunet_gtk.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/src/include/gnunet_gtk.h b/src/include/gnunet_gtk.h index f340f03f..67caaf1b 100644 --- a/src/include/gnunet_gtk.h +++ b/src/include/gnunet_gtk.h | |||
@@ -254,6 +254,82 @@ void | |||
254 | GNUNET_GTK_main_loop_quit (struct GNUNET_GTK_MainLoop *ml); | 254 | GNUNET_GTK_main_loop_quit (struct GNUNET_GTK_MainLoop *ml); |
255 | 255 | ||
256 | 256 | ||
257 | /* ******************** animations ******************* */ | ||
258 | |||
259 | |||
260 | /** | ||
261 | * Handle for an animation. Each animation file should only | ||
262 | * be loaded once and can then be used in multiple tree views. | ||
263 | */ | ||
264 | struct GNUNET_FS_AnimationContext; | ||
265 | |||
266 | |||
267 | /** | ||
268 | * Handle to a tree view (and column) that contains animations. | ||
269 | * Whenever an animation is added to a tree view, this module | ||
270 | * must be told about the tree view and column for the animations | ||
271 | * to work. | ||
272 | */ | ||
273 | struct GNUNET_FS_AnimationTreeViewHandle; | ||
274 | |||
275 | |||
276 | /** | ||
277 | * Create an animation context. Usually animation contexts are | ||
278 | * created during the startup of the application and kept around | ||
279 | * until shutdown. | ||
280 | * | ||
281 | * @param filename name of the file with the animation to show | ||
282 | * @return context to use to get the animated pixbuf, NULL on error | ||
283 | */ | ||
284 | struct GNUNET_FS_AnimationContext * | ||
285 | GNUNET_GTK_animation_context_create (const char *filename); | ||
286 | |||
287 | |||
288 | /** | ||
289 | * Destroy an animation context. Should only be called after the | ||
290 | * respective pixbufs are no longer needed. | ||
291 | * | ||
292 | * @param ac animation context to destroy. | ||
293 | */ | ||
294 | void | ||
295 | GNUNET_GTK_animation_context_destroy (struct GNUNET_FS_AnimationContext *ac); | ||
296 | |||
297 | |||
298 | /** | ||
299 | * Obtain the animated pixbuf from an animation context. Note | ||
300 | * that the pixbuf will only properly work within GtkTreeViews | ||
301 | * where the column with the image has been registered using | ||
302 | * GNUNET_GTK_animation_tree_view_register. | ||
303 | * | ||
304 | * @param ac animation context to query | ||
305 | * @return pixbuf of the AC, NULL on error loading the pixbuf | ||
306 | */ | ||
307 | GdkPixbuf * | ||
308 | GNUNET_GTK_animation_context_get_pixbuf (struct GNUNET_FS_AnimationContext *ac); | ||
309 | |||
310 | |||
311 | /** | ||
312 | * Register a tree view column with the animation subsystem. This | ||
313 | * column may contain animated pixbufs and thus needs to be periodically | ||
314 | * redrawn. | ||
315 | * | ||
316 | * @param tv tree view to register | ||
317 | * @param image_col column in the tree view with the animated pixbufs | ||
318 | * @return handle to unregister the tree view later | ||
319 | */ | ||
320 | struct GNUNET_FS_AnimationTreeViewHandle * | ||
321 | GNUNET_GTK_animation_tree_view_register (GtkTreeView *tv, | ||
322 | GtkTreeViewColumn *image_col); | ||
323 | |||
324 | |||
325 | /** | ||
326 | * Unregister a tree view, it no longer needs to be updated. | ||
327 | * | ||
328 | * @param atv tree view to unregister | ||
329 | */ | ||
330 | void | ||
331 | GNUNET_GTK_animation_tree_view_unregister (struct GNUNET_FS_AnimationTreeViewHandle *atv); | ||
332 | |||
257 | 333 | ||
258 | #endif | 334 | #endif |
259 | /* end of gnunet_gtk.h */ | 335 | /* end of gnunet_gtk.h */ |