Google

NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+ ">

nd_prefs

Name

nd_prefs -- 

Description

Details

ND_DOM_NETDUDE

#define ND_DOM_NETDUDE   "Netdude"


enum ND_PrefsType

typedef enum
{
  ND_PREFS_INT = 1,
  ND_PREFS_FLT = 2,
  ND_PREFS_STR = 3,
  ND_PREFS_UNK = 4
} ND_PrefsType;


ND_PrefsApplyCallback ()

void        (*ND_PrefsApplyCallback)        (GtkWidget *container,
                                             ND_PrefsEntry *entries,
                                             int num_entries);


ND_UNUSED

#define ND_UNUSED 0


nd_prefs_init ()

void        nd_prefs_init                   (void);


nd_prefs_load ()

void        nd_prefs_load                   (void);

This initializes the preferences as they're found in the user's config file, which is created if it doesn't yet exist. Called during Netdude startup. You don't need this.


nd_prefs_get_netdude_dir ()

const char* nd_prefs_get_netdude_dir        (void);

The function returns a pointer to static memory containing the directory to the user's Netdude directory, where preferences and locally-installed plugins are stored.


nd_prefs_get_config_file ()

const char* nd_prefs_get_config_file        (void);

The function returns a pointer to static memory containing the name of the user's Netdude config file.


nd_prefs_get_plugin_dir_global ()

const char* nd_prefs_get_plugin_dir_global  (void);

The function returns a pointer to static memory containing the name of the system-wide feature plugin directory.


nd_prefs_get_plugin_dir_user ()

const char* nd_prefs_get_plugin_dir_user    (void);

The function returns a pointer to static memory containing the name of the user's feature plugin directory.


nd_prefs_get_proto_dir_global ()

const char* nd_prefs_get_proto_dir_global   (void);

The function returns a pointer to static memory containing the name of the system-wide protocol plugin directory.


nd_prefs_get_proto_dir_user ()

const char* nd_prefs_get_proto_dir_user     (void);

The function returns a pointer to static memory containing the name of the user's protocol plugin directory.


nd_prefs_add_domain ()

void        nd_prefs_add_domain             (const char *domain,
                                             GtkWidget *container,
                                             GtkWidget *gui,
                                             ND_PrefsEntry *entries,
                                             int num_entries,
                                             ND_PrefsApplyCallback apply_cb);

The function registers a new preferences domain. Each domain gets displayed in its own tab in the preferences dialog and is stored with its own prefix in the config file. container is a widget from which all other preference widgets can be retrieved via gtk_object_get_data(), such as a toplevel window when using Glade. gui is the widget containing the actual preferences widgets, usually something like a GtkVBox. entries is an array of statically initialized ND_PrefsEntry items. apply_cb is called when the user applies new preferences settings and is supposed to contain actions that need to be carried out when preferences for this domain change. As an example of all this, see the TCP plugin in nd_tcp_prefs.c.


nd_prefs_save ()

int         nd_prefs_save                   (void);


nd_prefs_save_general ()

void        nd_prefs_save_general           (void);

The function saves to disk general settings that are not directly manipulated by the user through the preferences dialog, such as load/save directories, recently used files etc.


nd_prefs_set_str_item ()

void        nd_prefs_set_str_item           (const char *domain,
                                             const char *key,
                                             const char *data);

The function stores data as the value of key in the preferences database.


nd_prefs_set_flt_item ()

void        nd_prefs_set_flt_item           (const char *domain,
                                             const char *key,
                                             float data);

The function stores data as the value of key in the preferences database.


nd_prefs_set_int_item ()

void        nd_prefs_set_int_item           (const char *domain,
                                             const char *key,
                                             int data);

The function stores data as the value of key in the preferences database.


nd_prefs_del_item ()

void        nd_prefs_del_item               (const char *domain,
                                             const char *key);

The function removes the preference item from the database.


nd_prefs_get_str_item ()

gboolean    nd_prefs_get_str_item           (const char *domain,
                                             const char *key,
                                             char **result);

The function retrieves the specified preference item and stores it in result.


nd_prefs_get_flt_item ()

gboolean    nd_prefs_get_flt_item           (const char *domain,
                                             const char *key,
                                             float *result);

The function retrieves the specified preference item and stores it in result.


nd_prefs_get_int_item ()

gboolean    nd_prefs_get_int_item           (const char *domain,
                                             const char *key,
                                             int *result);

The function retrieves the specified preference item and stores it in result.


nd_prefs_dialog_show ()

void        nd_prefs_dialog_show            (void);


nd_prefs_dialog_sync ()

void        nd_prefs_dialog_sync            (void);