FLTK 1.4.0
|
Fl_Plugin_Manager manages link-time and run-time plugin binaries. More...
#include <Fl_Plugin.H>
Public Member Functions | |
Fl_Preferences::ID | addPlugin (const char *name, Fl_Plugin *plugin) |
This function adds a new plugin to the database. | |
Fl_Plugin_Manager (const char *klass) | |
Manage all plugins belonging to one class. | |
Fl_Plugin * | plugin (const char *name) |
Return the address of a plugin by name. | |
Fl_Plugin * | plugin (int index) |
Return the address of a plugin by index. | |
int | plugins () |
Return the number of plugins in the klass. | |
~Fl_Plugin_Manager () | |
Remove the plugin manager. | |
Public Member Functions inherited from Fl_Preferences | |
char | clear () |
Delete all groups and all entries. | |
char | delete_all_entries () |
Delete all entries. | |
char | delete_all_groups () |
Delete all groups. | |
char | delete_entry (const char *entry) |
Deletes a single name/value pair. | |
char | delete_group (const char *group) |
Deletes a group. | |
int | dirty () |
Check if there were changes to the database that need to be written to disk. | |
int | entries () |
Returns the number of entries (name/value pairs) in a group. | |
const char * | entry (int index) |
Returns the name of an entry. | |
char | entry_exists (const char *key) |
Returns non-zero if an entry with this name exists. | |
Root | filename (char *buffer, size_t buffer_size) |
Return the file name and path to the preference file. | |
Fl_Preferences (const char *path, const char *vendor, const char *application) | |
Deprecated: Use this constructor to create or read a preference file at an arbitrary position in the file system. | |
Fl_Preferences (const char *path, const char *vendor, const char *application, Root flags) | |
Use this constructor to create or read a preference file at an arbitrary position in the file system. | |
Fl_Preferences (const Fl_Preferences &) | |
Create another reference to a Preferences group. | |
Fl_Preferences (Fl_Preferences &parent, const char *group) | |
Generate or read a new group of entries within another group. | |
Fl_Preferences (Fl_Preferences &parent, int groupIndex) | |
Open a child group using a given index. | |
Fl_Preferences (Fl_Preferences *parent, const char *group) | |
Create or access a group of preferences using a name. | |
Fl_Preferences (Fl_Preferences *parent, int groupIndex) | |
Fl_Preferences (ID id) | |
Create a new dataset access point using a dataset ID. | |
Fl_Preferences (Root root, const char *vendor, const char *application) | |
The constructor creates a group that manages key/value pairs and child groups. | |
int | flush () |
Writes preferences to disk if they were modified. | |
char | get (const char *entry, char *&value, const char *defaultValue) |
Reads an entry from the group. | |
char | get (const char *entry, char *value, const char *defaultValue, int maxSize) |
Reads an entry from the group. | |
char | get (const char *entry, double &value, double defaultValue) |
Reads an entry from the group. | |
char | get (const char *entry, float &value, float defaultValue) |
Reads an entry from the group. | |
char | get (const char *entry, int &value, int defaultValue) |
Reads an entry from the group. | |
char | get (const char *entry, void *&value, const void *defaultValue, int defaultSize) |
Reads an entry from the group. | |
char | get (const char *entry, void *value, const void *defaultValue, int defaultSize, int *size) |
Reads a binary entry from the group, encoded in hexadecimal blocks. | |
char | get (const char *entry, void *value, const void *defaultValue, int defaultSize, int maxSize) |
Reads a binary entry from the group, encoded in hexadecimal blocks. | |
char | get_userdata_path (char *path, int pathlen) |
Creates a path that is related to the preference file and that is usable for additional application data. | |
const char * | group (int num_group) |
Returns the name of the Nth (num_group ) group. | |
char | group_exists (const char *key) |
Returns non-zero if a group with this name exists. | |
int | groups () |
Returns the number of groups that are contained within a group. | |
ID | id () |
Return an ID that can later be reused to open more references to this dataset. | |
const char * | name () |
Return the name of this entry. | |
const char * | path () |
Return the full path to this entry. | |
char | set (const char *entry, const char *value) |
Sets an entry (name/value pair). | |
char | set (const char *entry, const void *value, int size) |
Sets an entry (name/value pair). | |
char | set (const char *entry, double value) |
Sets an entry (name/value pair). | |
char | set (const char *entry, double value, int precision) |
Sets an entry (name/value pair). | |
char | set (const char *entry, float value) |
Sets an entry (name/value pair). | |
char | set (const char *entry, float value, int precision) |
Sets an entry (name/value pair). | |
char | set (const char *entry, int value) |
Sets an entry (name/value pair). | |
int | size (const char *entry) |
Returns the size of the value part of an entry. | |
virtual | ~Fl_Preferences () |
The destructor removes allocated resources. | |
Static Public Member Functions | |
static int | load (const char *filename) |
Load a module from disk. | |
static int | loadAll (const char *dirpath, const char *pattern=0) |
Use this function to load a whole directory full of modules. | |
static void | removePlugin (Fl_Preferences::ID id) |
Remove any plugin. | |
Static Public Member Functions inherited from Fl_Preferences | |
static unsigned int | file_access () |
Return the current file access permissions for the FLTK preferences system. | |
static void | file_access (unsigned int flags) |
Tell the FLTK preferences system which files in the file system it may read, create, or write. | |
static Root | filename (char *buffer, size_t buffer_size, Root root, const char *vendor, const char *application) |
Determine the file name and path to preferences that would be openend with these parameters. | |
static const char * | new_UUID () |
Returns a UUID as generated by the system. | |
static char | remove (ID id_) |
Remove the group with this ID from a database. | |
Additional Inherited Members | |
Public Types inherited from Fl_Preferences | |
typedef void * | ID |
Every Fl_Preferences-Group has a unique ID. | |
enum | Root { UNKNOWN_ROOT_TYPE = -1 , SYSTEM = 0 , USER , MEMORY , ROOT_MASK = 0x00FF , CORE = 0x0100 , C_LOCALE = 0x1000 , CLEAR = 0x2000 , SYSTEM_L = SYSTEM | C_LOCALE , USER_L = USER | C_LOCALE , CORE_SYSTEM_L = CORE | SYSTEM_L , CORE_USER_L = CORE | USER_L , CORE_SYSTEM = CORE | SYSTEM , CORE_USER = CORE | USER } |
Define the scope of the preferences. More... | |
Static Public Attributes inherited from Fl_Preferences | |
static const unsigned int | ALL = ALL_READ_OK | ALL_WRITE_OK |
Set this to give FLTK and applications permission to read, write, and create preference files. | |
static const unsigned int | ALL_READ_OK = USER_READ_OK | SYSTEM_READ_OK | CORE_READ_OK |
Set this to allow FLTK and applications to read preference files. | |
static const unsigned int | ALL_WRITE_OK = USER_WRITE_OK | SYSTEM_WRITE_OK | CORE_WRITE_OK |
Set this to allow FLTK and applications to create and write preference files. | |
static const unsigned int | APP_OK = SYSTEM_OK | USER_OK |
Set this if it is OK for applications to read, create, and write any kind of preference files. | |
static const unsigned int | CORE_OK = CORE_READ_OK | CORE_WRITE_OK |
Set this if it is OK for FLTK to read, create, or write preference files. | |
static const unsigned int | CORE_READ_OK = 0x0010 |
Set this if it is OK for FLTK to read preference files. | |
static const unsigned int | CORE_WRITE_OK = 0x0020 |
Set this if it is OK for FLTK to create or write preference files. | |
static const unsigned int | NONE = 0x0000 |
Set this if no call to Fl_Preferences shall access the file system. | |
static const unsigned int | SYSTEM_OK = SYSTEM_READ_OK | SYSTEM_WRITE_OK |
Set this if it is OK for applications to read, create, and write system wide preference files. | |
static const unsigned int | SYSTEM_READ_OK = 0x0004 |
Set this if it is OK for applications to read system wide preference files. | |
static const unsigned int | SYSTEM_WRITE_OK = 0x0008 |
Set this if it is OK for applications to create and write system wide preference files. | |
static const unsigned int | USER_OK = USER_READ_OK | USER_WRITE_OK |
Set this if it is OK for applications to read, create, and write user preference files. | |
static const unsigned int | USER_READ_OK = 0x0001 |
Set this if it is OK for applications to read user preference files. | |
static const unsigned int | USER_WRITE_OK = 0x0002 |
Set this if it is OK for applications to create and write user preference files. | |
Protected Attributes inherited from Fl_Preferences | |
Node * | node |
RootNode * | rootNode |
Fl_Plugin_Manager manages link-time and run-time plugin binaries.
Fl_Plugin_Manager::~Fl_Plugin_Manager | ( | ) |
Remove the plugin manager.
Calling this does not remove the database itself or any plugins. It just removes the reference to the database.
Fl_Preferences::ID Fl_Plugin_Manager::addPlugin | ( | const char * | name, |
Fl_Plugin * | plugin | ||
) |
This function adds a new plugin to the database.
There is no need to call this function explicitly. Every Fl_Plugin constructor will call this function at initialization time.
|
static |
Load a module from disk.
A module must be a dynamically linkable file for the given operating system. When loading a module, its +init function will be called which in turn calls the constructor of all statically initialized Fl_Plugin classes and adds them to the database.
|
static |
Use this function to load a whole directory full of modules.
dirpath | Pathname of a directory. It must end with the platform's directory separator character (i.e., '\' under Windows, '/' otherwise). |
pattern | A filename pattern to catch all modules of interest in the targeted directory (e.g., "{*.so,*.dll,*.dylib}"), or NULL to catch all files in the directory. |
|
static |
Remove any plugin.
There is no need to call this function explicitly. Every Fl_Plugin destructor will call this function at destruction time.