diff options
Diffstat (limited to 'documentation')
| -rw-r--r-- | documentation/Fl_Preferences.html | 184 | ||||
| -rw-r--r-- | documentation/Makefile | 263 |
2 files changed, 346 insertions, 101 deletions
diff --git a/documentation/Fl_Preferences.html b/documentation/Fl_Preferences.html new file mode 100644 index 000000000..966cf08e2 --- /dev/null +++ b/documentation/Fl_Preferences.html @@ -0,0 +1,184 @@ +<html> +<body> + +<!-- NEW PAGE --> + +<h2>class Fl_Preferences</h2> + +<hr> + +<h3>Class Hierarchy</h3> + +<ul><pre> +<b>Fl_Preferences</a></H4> +</pre></ul> + +<h3>Include Files</h3> + +<ul><pre> +#include <FL/Fl_Preferences.H> +</pre></ul> + +<h3>Description</h3> + +<P><tt>Fl_Preferences </tt>provides methods to store user +setting between application starts. It is similar to the +Registry on WIN32 and Preferences on MacOS, and provides a +simple configuration mechanism for UNIX. + +<P><tt>Fl_Preferences </tt>uses a hierarchy to store data. It +bundles similar data into groups and manages entries into those +groups as name/value pairs. + +<P>Preferences are stored in text files that can be edited +manually. The file format is easy to read and relatively +forgiving. Preferences files are the same on all platforms. User +comments in preference files are preserved. Filenames are unique +for each application by using a vendor/application naming +scheme. The user must provide default values for all entries to +ensure proper operation should preferences be corrupted or not +yet exist. + +<P>Entries can be of any length. However, the size of each +preferences file should be kept under 100k for performance +reasons. One application can have multiple preferences files. +Extensive binary data however should be stored in seperate +files; see the <A +href="#Fl_Preferences.getUserdataPath"><tt>getUserdataPath()</tt></A> +method. + +<h3>Methods</h3> + +<ul> + + <li><a href="#Fl_Preferences.Fl_Preferences">Fl_Preferences</a></li> + <li><a href="#Fl_Preferences.~Fl_Preferences">~Fl_Preferences</a></li> + <li><a href="#Fl_Preferences.deleteEntry">deleteEntry</a></li> + <li><a href="#Fl_Preferences.deleteGroup">deleteGroup</a></li> + <li><a href="#Fl_Preferences.entries">entries</a></li> + <li><a href="#Fl_Preferences.entry">entry</a></li> + <li><a href="#Fl_Preferences.entryExists">entryExists</a></li> + <li><a href="#Fl_Preferences.get">get</a></li> + <li><a href="#Fl_Preferences.getUserdataPath">getUserdataPath</a></li> + <li><a href="#Fl_Preferences.group">group</a></li> + <li><a href="#Fl_Preferences.groupExists">groupExists</a></li> + <li><a href="#Fl_Preferences.groups">groups</a></li> + <li><a href="#Fl_Preferences.set">set</a></li> + <li><a href="#Fl_Preferences.size">size</a></li> + +</ul> + +<H4><a name="Fl_Preferences.Fl_Preferences">Fl_Preferences(enum Root root, +const char *vendor, const char *application)<BR> +Fl_Preferences(Fl_Preferences &p, const char *groupname)</a></H4> + +<P>The constructor creates a group that manages name/value pairs and +child groups. Groups are ready for reading and writing at any time. +The <tt>root</tt> argument is either <tt>Fl_Preferences::USER</tt> +or <tt>Fl_Preferences::SYSTEM</tt>. + +<P>The first format creates the <i>base</i> instance for all +following entries and reads existing databases into memory. The +<tt>vendor</tt> argument is a unique text string identifying the +development team or vendor of an application. A domain name or +an EMail address are great unique names, e.g. +"researchATmatthiasm.com" or "fltk.org". The +<tt>application</tt> argument can be the working title or final +name of your application. Both <tt>vendor</tt> and +<tt>application</tt> must be valid relative UNIX pathnames and +may contain '/'s to create deeper file structures. + +<P>The <tt>groupname</tt> argument identifies a group of +entries. It can contain '/'s to get quick access to individual +elements inside the hierarchy. + +<H4><a name="Fl_Preferences.~Fl_Preferences">~Fl_Preferences()</a></H4> + +<P>The destructor removes allocated resources. When used on the +<i>base</i> preferences group, the destructor flushes all +changes to the preferences file and deletes all internal +databases. + +<H4><a name="Fl_Preferences.deleteEntry">int Fl_Preferences::deleteEntry(const char *entry)</a></H4> + +<P>Removes a single entry (name/value pair). + +<H4><a name="Fl_Preferences.deleteGroup">int Fl_Preferences::deleteGroup(const char *groupname)</a></H4> + +<P>Deletes a group. + +<H4><a name="Fl_Preferences.entries">int Fl_Preferences::entries()</a></H4> + +<P>Returns the number of entries (name/value) pairs in a group. + +<H4><a name="Fl_Preferences.entry">const char *Fl_Preferences::entry(int ix)</a></H4> + +<P>Returns the name of an entry. There is no guaranteed order of +entry names. The index must be within the range given by +<tt>entries()</tt>. + +<H4><a name="Fl_Preferences.entryExists">int Fl_Preferences::entryExists(const char *entry)</a></H4> + +<P>Returns non-zero if an entry with this name exists. + +<H4><a name="Fl_Preferences.flush">void Fl_Preferences::flush()</a></H4> + +<P>Write all preferences to disk. This function works only with +the base preference group. This function is rarely used as +deleting the base preferences flushes automatically. + +<H4><a name="Fl_Preferences.getUserdataPath">int Fl_Preferences::getUserdataPath(char *path)</a></H4> + +<P>Creates a path that is related to the preferences file and +that is usable for application data beyond what is covered by +<tt>Fl_Preferences</tt>. + +<H4><a name="Fl_Preferences.get">int get(const char *entry, int &value, int defaultValue)<BR> +int get(const char *entry, int &value, int defaultValue)<BR> +int get(const char *entry, float &value, float defaultValue)<BR> +int get(const char *entry, double &value, double defaultValue ) +int get(const char *entry, char *&value, const char *defaultValue)<BR> +int get(const char *entry, char *value, const char *defaultValue, +int maxSize)</a></H4> + +<P>Reads an entry from the group. A default value must be +supplied. The return value indicates if the value was available +(non-zero) or the default was used (0). If the '<tt>char +*&value</tt>' form is used, the resulting text must be freed +with '<tt>free(value)</tt>'. + +<H4><a name="Fl_Preferences.group">const char +*Fl_Preferences::group(int ix)</a></H4> + +<P>Returns the name of the Nth group. There is no guaranteed +order of group names. The index must be within the range given +by <tt>groups()</tt>. + +<H4><a name="Fl_Preferences.groupExists">int Fl_Preferences::groupExists(const char *groupname)</a></H4> + +<P>Returns non-zero if a group with this name exists. + +<H4><a name="Fl_Preferences.groups">int Fl_Preferences::groups()</a></H4> + +<P>Returns the number of groups that are contained within a +group. + +<H4><a name="Fl_Preferences.set">int set(const char *entry, int value)<BR> +int set(const char *entry, int value)<BR> +int set(const char *entry, float value)<BR> +int set(const char *entry, double value)<BR> +int set(const char *entry, const char *value)</a></H4> + +<P>Sets an entry (name/value pair). Text data must not contain +any '\n' or '\r' characters. The return value indicates if there +was a problem storing the data in memory. However it does not +reflect if the value was actually stored in the preferences +file. + +<H4><a name="Fl_Preferences.size">int Fl_Preferences::size(const char *key)</a></H4> + +<P>Returns the size of the value part of an entry. + + +</body> +</html> diff --git a/documentation/Makefile b/documentation/Makefile index f90e821b1..7d8074145 100644 --- a/documentation/Makefile +++ b/documentation/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile,v 1.9.2.10.2.13 2002/04/20 21:07:18 easysw Exp $" +# "$Id: Makefile,v 1.9.2.10.2.14 2002/04/28 16:41:16 easysw Exp $" # # Documentation makefile for the Fast Light Tool Kit (FLTK). # @@ -42,102 +42,163 @@ MEDIA = --size universal # These are the HTML "source" files... HTMLFILES = \ - basics.html \ - common.html \ - drawing.html \ - editor.html \ - enumerations.html \ - events.html \ - Fl.html \ - Fl_Adjuster.html \ - Fl_Bitmap.html \ - Fl_BMP_Image.html \ - Fl_Box.html \ - Fl_Browser_.html \ - Fl_Browser.html \ - Fl_Button.html \ - Fl_Chart.html \ - Fl_Check_Button.html \ - Fl_Choice.html \ - Fl_Clock.html \ - Fl_Color_Chooser.html \ - Fl_Counter.html \ - Fl_Dial.html \ - Fl_Double_Window.html \ - Fl_End.html \ - Fl_File_Browser.html \ - Fl_File_Chooser.html \ - Fl_File_Icon.html \ - Fl_Float_Input.html \ - Fl_Free.html \ - Fl_GIF_Image.html \ - Fl_Gl_Window.html \ - Fl_Group.html \ - Fl_Help_Dialog.html \ - Fl_Help_View.html \ - Fl_Hold_Browser.html \ - Fl_Image.html \ - Fl_Input_.html \ - Fl_Input.html \ - Fl_Int_Input.html \ - Fl_JPEG_Image.html \ - Fl_Light_Button.html \ - Fl_Menu_Bar.html \ - Fl_Menu_Button.html \ - Fl_Menu_.html \ - Fl_Menu_Item.html \ - Fl_Menu_Window.html \ - Fl_Multi_Browser.html \ - Fl_Multiline_Input.html \ - Fl_Multiline_Output.html \ - Fl_Output.html \ - Fl_Overlay_Window.html \ - Fl_Pack.html \ - Fl_Pixmap.html \ - Fl_PNG_Image.html \ - Fl_PNM_Image.html \ - Fl_Positioner.html \ - Fl_Repeat_Button.html \ - Fl_Return_Button.html \ - Fl_RGB_Image.html \ - Fl_Roller.html \ - Fl_Round_Button.html \ - Fl_Scrollbar.html \ - Fl_Scroll.html \ - Fl_Secret_Input.html \ - Fl_Select_Browser.html \ - Fl_Shared_Image.html \ - Fl_Single_Window.html \ - Fl_Slider.html \ - Fl_Tabs.html \ - Fl_Text_Buffer.html \ - Fl_Text_Display.html \ - Fl_Text_Editor.html \ - Fl_Tiled_Image.html \ - Fl_Tile.html \ - Fl_Timer.html \ - Fl_Tooltip.html \ - fluid.html \ - Fl_Valuator.html \ - Fl_Value_Input.html \ - Fl_Value_Output.html \ - Fl_Value_Slider.html \ - Fl_Widget.html \ - Fl_Window.html \ - Fl_Wizard.html \ - Fl_XBM_Image.html \ - Fl_XPM_Image.html \ - forms.html \ - functions.html \ - glut.html \ - intro.html \ - license.html \ - migration.html \ - opengl.html \ - osissues.html \ - preface.html \ - subclassing.html \ - widgets.html + preface.html \ + intro.html \ + basics.html \ + common.html \ + editor.html \ + drawing.html \ + events.html \ + subclassing.html \ + opengl.html \ + fluid.html \ + widgets.html \ + Fl.html \ + Fl_Adjuster.html \ + Fl_Bitmap.html \ + Fl_BMP_Image.html \ + Fl_Box.html \ + Fl_Browser_.html \ + Fl_Browser.html \ + Fl_Button.html \ + Fl_Chart.html \ + Fl_Check_Button.html \ + Fl_Choice.html \ + Fl_Clock.html \ + Fl_Color_Chooser.html \ + Fl_Counter.html \ + Fl_Dial.html \ + Fl_Double_Window.html \ + Fl_End.html \ + Fl_File_Browser.html \ + Fl_File_Chooser.html \ + Fl_File_Icon.html \ + Fl_Float_Input.html \ + Fl_Free.html \ + Fl_GIF_Image.html \ + Fl_Gl_Window.html \ + Fl_Group.html \ + Fl_Help_Dialog.html \ + Fl_Help_View.html \ + Fl_Hold_Browser.html \ + Fl_Image.html \ + Fl_Input.html \ + Fl_Input_.html \ + Fl_Int_Input.html \ + Fl_JPEG_Image.html \ + Fl_Light_Button.html \ + Fl_Menu_.html \ + Fl_Menu_Bar.html \ + Fl_Menu_Button.html \ + Fl_Menu_Item.html \ + Fl_Menu_Window.html \ + Fl_Multi_Browser.html \ + Fl_Multiline_Input.html \ + Fl_Multiline_Output.html \ + Fl_Output.html \ + Fl_Overlay_Window.html \ + Fl_Pack.html \ + Fl_Pixmap.html \ + Fl_PNG_Image.html \ + Fl_PNM_Image.html \ + Fl_Positioner.html \ + Fl_Progress.html \ + Fl_Repeat_Button.html \ + Fl_RGB_Image.html \ + Fl_Return_Button.html \ + Fl_Roller.html \ + Fl_Round_Button.html \ + Fl_Scroll.html \ + Fl_Scrollbar.html \ + Fl_Secret_Input.html \ + Fl_Select_Browser.html \ + Fl_Single_Window.html \ + Fl_Slider.html \ + Fl_Tabs.html \ + Fl_Text_Buffer.html \ + Fl_Text_Display.html \ + Fl_Text_Editor.html \ + Fl_Tile.html \ + Fl_Tiled_Image.html \ + Fl_Timer.html \ + Fl_Tooltip.html \ + Fl_Valuator.html \ + Fl_Value_Input.html \ + Fl_Value_Output.html \ + Fl_Value_Slider.html \ + Fl_Widget.html \ + Fl_Window.html \ + Fl_Wizard.html \ + Fl_XBM_Image.html \ + Fl_XPM_Image.html \ + functions.html \ + enumerations.html \ + glut.html \ + forms.html \ + osissues.html \ + migration.html \ + license.html + +IMAGEFILES = \ + adjuster1.gif \ + boxtypes.gif \ + buttons.gif \ + charts.gif \ + choice.gif \ + clock.gif \ + counter.gif \ + cubeview.gif \ + dial.gif \ + editor.gif \ + editor-replace.gif \ + filechooser.gif \ + fl_alert.gif \ + fl_ask.gif \ + Fl_Check_Button.gif \ + fl_choice.gif \ + fl_color_chooser.jpg \ + FL.gif \ + Fl_Help_Dialog.gif \ + fl_input.gif \ + Fl_Light_Button.gif \ + fl_message.gif \ + fl_password.gif \ + Fl_Return_Button.gif \ + Fl_Roller.gif \ + Fl_Round_Button.gif \ + Fl_Scroll.gif \ + fl_show_colormap.gif \ + Fl_Tile.gif \ + fluid1.gif \ + fluid2.gif \ + fluid3-cxx.gif \ + fluid3-gui.gif \ + fluid3-style.gif \ + fluid4.gif \ + fluid-catgets.gif \ + fluid-gettext.gif \ + fluid-org.gif \ + fluid_prefs.gif \ + fluid_widget_cxx.gif \ + fluid_widget_gui.gif \ + fluid_widget_style.gif \ + Fl_Value_Input.gif \ + Fl_Value_Output.gif \ + hello.C.gif \ + menubar.gif \ + menu_button.gif \ + menu.gif \ + positioner.gif \ + resizebox1.gif \ + resizebox2.gif \ + round_clock.gif \ + scrollbar.gif \ + slider.gif \ + symbols.gif \ + tabs.gif \ + text.gif \ + valuators.gif \ + value_slider.gif MANPAGES = fltk.$(CAT3EXT) fltk-config.$(CAT1EXT) fluid.$(CAT1EXT) @@ -192,22 +253,22 @@ uninstall: # Base html files are now the readable ones, so this target is not make by # default... -fltk.d/index.html: $(HTMLFILES) +fltk.d/index.html: $(HTMLFILES) $(IMAGEFILES) echo "Generating HTML documentation..." -mkdir fltk.d -rm -f fltk.d/* $(HTMLDOC) --verbose --batch fltk.book -d fltk.d -t html -fltk.ps: $(HTMLFILES) +fltk.ps: $(HTMLFILES) $(IMAGEFILES) echo "Generating PostScript documentation..." rm -f fltk.ps $(HTMLDOC) --verbose --batch fltk.book $(MEDIA) -f fltk.ps -fltk.pdf: $(HTMLFILES) +fltk.pdf: $(HTMLFILES) $(IMAGEFILES) echo "Generating PDF documentation..." rm -f fltk.pdf $(HTMLDOC) --verbose --batch fltk.book $(MEDIA) -f fltk.pdf # -# End of "$Id: Makefile,v 1.9.2.10.2.13 2002/04/20 21:07:18 easysw Exp $". +# End of "$Id: Makefile,v 1.9.2.10.2.14 2002/04/28 16:41:16 easysw Exp $". # |
