Lumiera  0.pre.03
»edit your freedom«
interfaceregistry.h
Go to the documentation of this file.
1 /*
2  INTERFACEREGISTRY.h - Lumiera interface registry
3 
4  Copyright (C) Lumiera.org
5  2008, Christian Thaeter <ct@pipapo.org>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
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.
16 
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., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 */
22 
23 
31 #ifndef LUMIERA_INTERFACEREGISTRY_H
32 #define LUMIERA_INTERFACEREGISTRY_H
33 
34 #include "lib/mutex.h"
35 #include "lib/recmutex.h"
36 #include "lib/psplay.h"
37 
38 #include "common/interface.h"
39 #include "common/plugin.h"
40 
41 #include <nobug.h>
42 
43 
44 extern PSplay lumiera_interfaceregistry;
45 extern lumiera_recmutex lumiera_interface_mutex;
46 
47 
53 typedef struct lumiera_interfacenode_struct lumiera_interfacenode;
54 typedef lumiera_interfacenode* LumieraInterfacenode;
55 
57 {
59  psplaynode node;
60 
62  LumieraInterface interface;
63 
65  unsigned refcnt;
66 
68  LumieraPlugin plugin;
69 
71  LumieraInterfacenode lnk;
72 
74  size_t deps_size;
75 
77  LumieraInterfacenode* deps;
78 };
79 
80 
84 void
86 
87 void
88 lumiera_interfaceregistry_destroy (void);
89 
90 
91 void
92 lumiera_interfaceregistry_register_interface (LumieraInterface self, LumieraPlugin plugin);
93 
94 void
95 lumiera_interfaceregistry_bulkregister_interfaces (LumieraInterface* self, LumieraPlugin plugin);
96 
97 void
98 lumiera_interfaceregistry_remove_interface (LumieraInterface self);
99 
100 void
101 lumiera_interfaceregistry_bulkremove_interfaces (LumieraInterface* self);
102 
103 LumieraInterfacenode
104 lumiera_interfaceregistry_interfacenode_find (const char* interface, unsigned version, const char* name);
105 
106 LumieraInterface
107 lumiera_interfaceregistry_interface_find (const char* interface, unsigned version, const char* name);
108 
109 
110 
111 
112 #endif /* LUMIERA_INTERFACEREGISTRY_H */
113 /*
114 // Local Variables:
115 // mode: C
116 // c-file-style: "gnu"
117 // indent-tabs-mode: nil
118 // End:
119 */
LumieraInterface interface
the interface itself
Lumiera plugins define &#39;interfaces&#39; as shown in interface.h, the plugin system handles the loading of...
void lumiera_interfaceregistry_init(void)
Initialise the interface registry.
Mutual exclusion locking, header.
size_t deps_size
allocated size of the following dependency table
Lumiera interface macros and structures.
LumieraPlugin plugin
backreference to its plugin if it comes from a plugin, else NULL
Probabilistic splay tree.
psplaynode node
all known interfaces are registered in a tree
Mutual exclusion locking, header.
LumieraInterfacenode * deps
NULL terminated table of all dependencies (interfaces opened on initialisation)
LumieraInterfacenode lnk
temporary used to stack interfaces when recursively opening/closing them
Interface management node.
ElementBoxWidget::Config::Qualifier name(string id)
define the name-ID displayed in the caption
unsigned refcnt
reference counters and link used for internal reference management