2006-12-03 Dimitris Glezos <dimitris@glezos.com>
[dia.git] / lib / dynamic_obj.h
blobaa9c3f1b0cfb7165c84ae73e93e79edc54f10a5a
1 /* Dia -- an diagram creation/manipulation program
2 * Copyright (C) 1998 Alexander Larsson
4 * List of "dynamic" (animated) objects, and their refresh rates
5 * Copyright (C) 2002 Cyrille Chépélov
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 #ifndef DYNAMIC_OBJ_H
23 #define DYNAMIC_OBJ_H
25 #include <glib.h>
26 #include "object.h"
28 /* Adds an object to the list of "periodic dynobj" objects. The period
29 is an advisory figure in miliseconds; dia can perform dynobjes at a faster
30 or at a slower rate, at its own convenience.
32 It is strongly advised against dynobj rates below 1000ms. */
33 void dynobj_list_add_object(DiaObject *obj, guint timeout);
35 /* Removes an object from the list of "periodic dynobj" objects. It is
36 critical that an object gets removed from that list before it is destroyed.
38 There is no harmful effect in removing an object which was not in the
39 dynobj list beforehand.
41 void dynobj_list_remove_object(DiaObject *obj);
43 /* Performs an object dynobj; called by dynobj_list_perform() */
44 typedef void (*ObjectDynobjFunc) (DiaObject *obj, gpointer data);
46 /* Performs a dynobj of the whole dynobj list.
48 Calls (*orf)(obj,data) for each obj.
50 void dynobj_list_foreach(ObjectDynobjFunc orf, gpointer data);
52 /* Returns the dynobj rate collectively resulting from the dynamic objects'
53 advices. 0 is a special value meaning "no objects, no need
54 to have a timer" */
55 guint dynobj_list_get_dynobj_rate(void);
58 #endif /* DYNAMIC_OBJ_H */