From 416f5b0dcd3e2cf4993acf4dff02a7477be835e2 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sun, 24 Jan 2010 00:16:33 +0000 Subject: Still not having added Fl_Tree and Fl_Table to Fluid, I remembered the plugin concept we had early on. It occured to me that writing plugins must not be difficult, and that FLTK already has everything needed. So here it is, a plugin implementation for FLTK. The MSWindows/Cygwin implementation is untested due to lack of a machine. The dynamic loading still needs a test implementation. Comments welcome. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7023 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/Fl_Preferences.H | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'FL/Fl_Preferences.H') diff --git a/FL/Fl_Preferences.H b/FL/Fl_Preferences.H index 44d007f90..798e421d6 100644 --- a/FL/Fl_Preferences.H +++ b/FL/Fl_Preferences.H @@ -61,7 +61,7 @@ reasons. One application can have multiple preferences files. Extensive binary data however should be stored in separate files: see getUserdataPath(). - + \note Starting with FLTK 1.3, preference databases are expected to be in utf8 encoding. Previous databases were stored in the current chracter set or code page which renders them incompatible @@ -97,12 +97,17 @@ public: Fl_Preferences( Fl_Preferences *parent, const char *group ); Fl_Preferences( Fl_Preferences &parent, int groupIndex ); Fl_Preferences( Fl_Preferences *parent, int groupIndex ); + Fl_Preferences(const Fl_Preferences&); Fl_Preferences( ID id ); ~Fl_Preferences(); /** Return an ID that can later be reused to open more references to this dataset. */ ID id() { return (ID)node; } + + /** Remove the group with this ID from a databse. + */ + static char remove(ID id) { return ((Node*)id)->remove(); } /** Return the name of this entry. */ @@ -189,13 +194,12 @@ public: private: - // make the following functions unavailable - Fl_Preferences(); - Fl_Preferences(const Fl_Preferences&); + Fl_Preferences() : node(0), rootNode(0) { } Fl_Preferences &operator=(const Fl_Preferences&); static char nameBuffer[128]; static char uuidBuffer[40]; + static Fl_Preferences *runtimePrefs; class RootNode; @@ -253,6 +257,7 @@ private: public: RootNode( Fl_Preferences *, Root root, const char *vendor, const char *application ); RootNode( Fl_Preferences *, const char *path, const char *vendor, const char *application ); + RootNode( Fl_Preferences * ); ~RootNode(); int read(); int write(); @@ -260,9 +265,10 @@ private: }; friend class RootNode; +protected: + Node *node; RootNode *rootNode; - }; -- cgit v1.2.3