2
* Functions to keep a listing of all modules in the system. Has its
3
* own file mostly for abstraction reasons, but is pretty simple
7
* Ted Gould <ted@gould.cx>
8
* Lauris Kaplinski <lauris@kaplinski.com>
10
* Copyright (C) 2002-2004 Authors
12
* Released under GNU GPL, read the file 'COPYING' for more information
15
#ifndef __MODULES_DB_H__
16
#define __MODULES_DB_H__
22
#include "extension/extension.h"
29
/** A string comparison function to be used in the moduledict
30
to find the different extensions in the hash map. */
32
bool operator()(const char* s1, const char* s2) const {
33
if ( (s1 == NULL) && (s2 != NULL) ) {
35
} else if (s1 == NULL || s2 == NULL) {
38
return strcmp(s1, s2) < 0;
42
/** This is the actual database. It has all of the modules in it,
43
indexed by their ids. It's a hash table for faster lookups */
44
std::map <const char *, Extension *, ltstr> moduledict;
45
/** Maintain an ordered list of modules for generating the extension
46
lists via "foreach" */
47
std::list <Extension *> modulelist;
49
static void foreach_internal (gpointer in_key, gpointer in_value, gpointer in_data);
53
Extension * get (const gchar *key);
54
void register_ext (Extension *module);
55
void unregister_ext (Extension *module);
56
void foreach (void (*in_func)(Extension * in_plug, gpointer in_data), gpointer in_data);
59
static void input_internal (Extension * in_plug, gpointer data);
60
static void output_internal (Extension * in_plug, gpointer data);
61
static void effect_internal (Extension * in_plug, gpointer data);
64
typedef std::list<Output *> OutputList;
65
typedef std::list<Input *> InputList;
66
typedef std::list<Effect *> EffectList;
68
InputList &get_input_list (InputList &ou_list);
69
OutputList &get_output_list (OutputList &ou_list);
70
EffectList &get_effect_list (EffectList &ou_list);
75
} } /* namespace Extension, Inkscape */
77
#endif /* __MODULES_DB_H__ */
82
c-file-style:"stroustrup"
83
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
88
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :