options.h File Reference

Interface to the ROX options system. More...

#include <libxml/parser.h>

Data Structures

struct  ROXOption

Typedefs

typedef ROXOption ROXOption
typedef ROXOption Option
typedef void ROXOptionNotify (void)
typedef ROXOptionNotify OptionNotify
typedef GList *(*) ROXOptionBuildFn (Option *option, xmlNode *node, gchar *label)
typedef ROXOptionBuildFn OptionBuildFn

Functions

void rox_options_init (const char *project)
void rox_options_init_with_domain (const char *project, const char *domain)
void rox_option_register_widget (char *name, ROXOptionBuildFn builder)
void rox_option_check_widget (ROXOption *option)
void rox_option_add_int (ROXOption *option, const gchar *key, int value)
void rox_option_add_string (ROXOption *option, const gchar *key, const gchar *value)
void rox_options_notify (void)
void rox_option_add_notify (ROXOptionNotify *callback)
void rox_option_add_saver (ROXOptionNotify *callback)
GtkWidget * rox_options_show (void)
void options_init (const char *project)
void options_init_with_domain (const char *project, const char *domain)
void option_check_widget (Option *option)
void option_add_int (Option *option, const gchar *key, int value)
void option_add_string (Option *option, const gchar *key, const gchar *value)
void options_notify (void)
GtkWidget * options_show (void)


Detailed Description

Interface to the ROX options system.

Manage a programs options in the same way as ROX-Filer does.

Derived from code written by Thomas Leonard, <tal197@users.sourceforge.net>.

How it works:

On startup:

When the user opens the Options box:

When the user changes an option or clicks on Revert:

When OK is clicked:

Author:
Thomas Leonard, Stephen Watson
Version:
Id
options.h,v 1.8 2005/10/15 10:48:49 stephen Exp

Typedef Documentation

typedef struct ROXOption Option

Deprecated:
use ROXOption

typedef ROXOptionBuildFn OptionBuildFn

Deprecated:
use ROXOptionBuildFn

typedef ROXOptionNotify OptionNotify

Deprecated:
use ROXOptionNotify

typedef struct ROXOption ROXOption

An option, stored as a string. It may have an integer value

typedef GList*(*) ROXOptionBuildFn(Option *option, xmlNode *node, gchar *label)

Type of function used to build custom option widgets

Parameters:
[in,out] option option being constructed
[in] node element of the Options.xml file to use in construction
[in] label label to attach to the widget

typedef void ROXOptionNotify(void)

Type of function called when the options change


Function Documentation

void option_add_int ( ROXOption option,
const gchar *  key,
int  value 
)

Initialise and register a new integer option

Parameters:
[in,out] option option to initialize
[in] key name of the option
[in] value default value
Deprecated:
Use rox_option_add_int().

void option_add_string ( ROXOption option,
const gchar *  key,
const gchar *  value 
)

Initialise and register a new string option

Parameters:
[in,out] option option to initialize
[in] key name of the option
[in] value default value
Deprecated:
Use rox_option_add_int().

void option_check_widget ( ROXOption option  ) 

This is called when the widget's value is modified by the user. Reads the new value of the widget into the option and calls the notify callbacks.

Parameters:
[in,out] option option to be updated.
Deprecated:
Use rox_option_check_widget().

void options_init ( const char *  project  ) 

Initialize the options system, normally called by rox_init().

Deprecated:
Use rox_options_init_with_domain() instead.
Parameters:
[in] project name of program

void options_init_with_domain ( const char *  project,
const char *  domain 
)

Initialize the options system, normally called by rox_init_with_domain() if it detects Options.xml in $APP_DIR.

Parameters:
[in] project name of program
[in] domain domain under the control of the programmer.
Deprecated:
Use rox_options_init_with_domain() instead.

void options_notify ( void   ) 

Call all the notify callbacks. This should happen after any options have their values changed. Set each option->has_changed flag before calling this function.

Deprecated:
Use rox_options_notify().

GtkWidget* options_show ( void   ) 

Allow the user to edit the options. Returns the window widget (you don't normally need this). NULL if already open.

Returns:
the options window
Deprecated:
Use rox_options_show().

void rox_option_add_int ( ROXOption option,
const gchar *  key,
int  value 
)

Initialise and register a new integer option

Parameters:
[in,out] option option to initialize
[in] key name of the option
[in] value default value

void rox_option_add_notify ( ROXOptionNotify callback  ) 

Add a callback which will be called after any options have changed their values. If several options change at once, this is called after all changes.

Parameters:
[in] callback funtion to call if options change

void rox_option_add_saver ( ROXOptionNotify callback  ) 

Call 'callback' after all the options have been saved

Parameters:
[in] callback funtion to call when options have been saved

void rox_option_add_string ( ROXOption option,
const gchar *  key,
const gchar *  value 
)

Initialise and register a new string option

Parameters:
[in,out] option option to initialize
[in] key name of the option
[in] value default value

void rox_option_check_widget ( ROXOption option  ) 

This is called when the widget's value is modified by the user. Reads the new value of the widget into the option and calls the notify callbacks.

Parameters:
[in,out] option option to be updated

void rox_option_register_widget ( char *  name,
ROXOptionBuildFn  builder 
)

When parsing the XML file, process an element named 'name' by calling 'builder(option, xml_node, label)'. builder returns the new widgets to add to the options box. name should be a static string. Call rox_option_check_widget() when the widget's value is modified.

Functions to set or get the widget's state can be stored in 'option'. If the option doesn't have a name attribute in Options.xml then ui will be NULL on entry (this is used for buttons).

Parameters:
[in] name name of the type of widget as used in the Options.xml element
[in] builder function called to build the option

void rox_options_init ( const char *  project  ) 

Initialize the options system, normally called by rox_init().

Deprecated:
Use rox_options_init_with_domain() instead.
Parameters:
[in] project name of program

void rox_options_init_with_domain ( const char *  project,
const char *  domain 
)

Initialize the options system, normally called by rox_init_with_domain() if it detects Options.xml in $APP_DIR.

Parameters:
[in] project name of program
[in] domain domain under the control of the programmer.

void rox_options_notify ( void   ) 

Call all the notify callbacks. This should happen after any options have their values changed. Set each option->has_changed flag before calling this function.

GtkWidget* rox_options_show ( void   ) 

Allow the user to edit the options. Returns the window widget (you don't normally need this).

Returns:
the options window or NULL if already open.


Generated on Sat Oct 13 17:22:45 2007 for ROX-CLib by  doxygen 1.5.0