FLTK 1.4.4: Fl_Plugin.H Source File

FLTK 1.4.4

Loading...
Searching...
No Matches
Fl_Plugin.H
1//
2// A Plugin system for FLTK, implemented in Fl_Preferences.cxx.
3//
4// Copyright 2002-2023 by Matthias Melcher.
5//
6// This library is free software. Distribution and use rights are outlined in
7// the file "COPYING" which should have been included with this file. If this
8// file is missing or damaged, see the license at:
9//
10// https://www.fltk.org/COPYING.php
11//
12// Please see the following page on how to report bugs and issues:
13//
14// https://www.fltk.org/bugs.php
15//
16
17/* \file
18 Fl_Plugin class . */
19
20#ifndef Fl_Plugin_H
21# define Fl_Plugin_H
22
23# include "Fl_Preferences.H"
24
25
59 class FL_EXPORT Fl_Plugin {
60 Fl_Preferences::ID id;
61public:
62 Fl_Plugin(const char *klass, const char *name);
63 virtual ~Fl_Plugin();
64};
65
66
71 class FL_EXPORT Fl_Plugin_Manager : public Fl_Preferences {
72public:
73 Fl_Plugin_Manager(const char *klass);
74 ~Fl_Plugin_Manager();
75
78 int plugins() { return groups(); }
79 Fl_Plugin *plugin(int index);
80 Fl_Plugin *plugin(const char *name);
81 Fl_Preferences::ID addPlugin(const char *name, Fl_Plugin *plugin);
82
83 static void removePlugin(Fl_Preferences::ID id);
84 static int load(const char *filename);
85 static int loadAll(const char *dirpath, const char *pattern=0);
86};
87
88
89#endif // !Fl_Preferences_H
Fl_Plugin_Manager::plugins
int plugins()
Return the number of plugins in the klass.
Definition Fl_Plugin.H:78
Fl_Plugin_Manager::Fl_Plugin_Manager
Fl_Plugin_Manager(const char *klass)
Manage all plugins belonging to one class.
Definition Fl_Preferences.cxx:1980
Fl_Plugin
Fl_Plugin allows link-time and run-time integration of binary modules.
Definition Fl_Plugin.H:59
Fl_Plugin::Fl_Plugin
Fl_Plugin(const char *klass, const char *name)
Create a plugin.
Definition Fl_Preferences.cxx:1956
Fl_Preferences::ID
void * ID
Every Fl_Preferences-Group has a unique ID.
Definition Fl_Preferences.H:156
Fl_Preferences::groups
int groups()
Returns the number of groups that are contained within a group.
Definition Fl_Preferences.cxx:618
Fl_Preferences::Fl_Preferences
Fl_Preferences(Root root, const char *vendor, const char *application)
The constructor creates a group that manages key/value pairs and child groups.
Definition Fl_Preferences.cxx:365