user_prefs.c File Reference

Users preference may be somewhere around here. More...

#include <libheraia.h>
Include dependency graph for user_prefs.c:

Go to the source code of this file.

Functions

static void verify_preference_file_path_presence (gchar *pathname)
 verify preference file path presence and creates it if it does not already exists
static void verify_preference_file_name_presence (gchar *filename)
 Verify preference file's presence and creates it if it does not exists already.
static void save_window_preferences (GKeyFile *file, gchar *name, window_prop_t *window_prop)
 Window preferences.
static void save_mp_file_preferences_options (heraia_struct_t *main_struct)
 Save only file preferences related options.
static void save_mp_display_preferences_options (heraia_struct_t *main_struct)
 Save only display related preferences.
static void save_di_preferences (heraia_struct_t *main_struct)
 Saves data interpretor state and preferences.
static void save_mpwp_preferences (heraia_struct_t *main_struct)
 Saves main preferences window state and preferences.
static void load_window_preferences (GKeyFile *file, gchar *name, window_prop_t *window_prop)
 window preferences
static void load_mp_file_preferences_options (heraia_struct_t *main_struct)
 Load only main preferences related options.
static void load_mp_display_preferences_options (heraia_struct_t *main_struct)
 Load display related preferences.
static void load_di_preferences (heraia_struct_t *main_struct)
 Load data interpretor state and preferences.
void verify_preference_file (gchar *pathname, gchar *filename)
 Verify preference file presence and creates it if it does not already exists.
void init_preference_struct (heraia_struct_t *main_struct)
 Look out if the preference structure exists or not.
void save_preferences (heraia_struct_t *main_struct)
 Save all preferences to the user preference file.
static void load_mpwp_preferences (heraia_struct_t *main_struct)
 Load main preferences window state and preferences.
void load_preferences (heraia_struct_t *main_struct)
 Sets up the preferences as loaded in the preference file.

Detailed Description

Users preference may be somewhere around here.

Definition in file user_prefs.c.


Function Documentation

void init_preference_struct ( heraia_struct_t main_struct  ) 

Look out if the preference structure exists or not.

If not it creates it.

See also:
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
Parameters:
main_struct the main structure

Definition at line 121 of file user_prefs.c.

References prefs_t::file, prefs_t::filename, prefs_t::pathname, and heraia_struct_t::prefs.

Referenced by heraia_init_main_struct().

Here is the caller graph for this function:

static void load_di_preferences ( heraia_struct_t main_struct  )  [static]

Load data interpretor state and preferences.

Parameters:
main_struct : main structure

< data interpretor's notebook

< Selected tab in data interpretor's window

< Stream size in data interpretor's window

< Endianness in data interpretor's window

< structure for preferences

Definition at line 424 of file user_prefs.c.

References heraia_struct_t::current_DW, di_set_endianness(), di_set_selected_tab(), di_set_stream_size(), prefs_t::file, GN_DI_PREFS, KN_DI_ENDIANNESS, KN_DI_SELECTED_TAB, KN_DI_STREAM_SIZE, xml_t::main, heraia_struct_t::prefs, and heraia_struct_t::xmls.

Referenced by load_preferences().

Here is the call graph for this function:

Here is the caller graph for this function:

static void load_mp_display_preferences_options ( heraia_struct_t main_struct  )  [static]

Load display related preferences.

Parameters:
main_struct the main structure

Definition at line 397 of file user_prefs.c.

References prefs_t::file, GN_DISPLAY_PREFS, heraia_get_widget(), KN_DISP_OFFSETS, KN_DISP_THOUSAND, xml_t::main, heraia_struct_t::prefs, and heraia_struct_t::xmls.

Referenced by load_preferences().

Here is the call graph for this function:

Here is the caller graph for this function:

static void load_mp_file_preferences_options ( heraia_struct_t main_struct  )  [static]
static void load_mpwp_preferences ( heraia_struct_t main_struct  )  [static]

Load main preferences window state and preferences.

Parameters:
main_struct : main structure

< main preferences's notebook

< tool button from the toolbar

< Selected tab in data interpretor's window

< structure for preferences

Definition at line 452 of file user_prefs.c.

References heraia_struct_t::current_DW, prefs_t::file, GN_MPWP_PREFS, heraia_get_widget(), KN_MPWP_SELECTED_TAB, xml_t::main, heraia_struct_t::prefs, and heraia_struct_t::xmls.

Referenced by load_preferences().

Here is the call graph for this function:

Here is the caller graph for this function:

void load_preferences ( heraia_struct_t main_struct  ) 

Sets up the preferences as loaded in the preference file.

Parameters:
main_struct the main structure

Definition at line 494 of file user_prefs.c.

References load_di_preferences(), load_mp_display_preferences_options(), load_mp_file_preferences_options(), and load_mpwp_preferences().

Referenced by load_heraia_ui().

Here is the call graph for this function:

Here is the caller graph for this function:

static void load_window_preferences ( GKeyFile *  file,
gchar *  name,
window_prop_t window_prop 
) [static]

window preferences

Parameters:
file a GKeyFile where values are stored
name a keyname (basically a window name)
window_prop all window properties to save (structure window_prop_t)

Definition at line 332 of file user_prefs.c.

References window_prop_t::displayed, GN_GLOBAL_PREFS, window_prop_t::height, window_prop_t::width, window_prop_t::x, and window_prop_t::y.

Referenced by load_mp_file_preferences_options().

Here is the caller graph for this function:

static void save_di_preferences ( heraia_struct_t main_struct  )  [static]

Saves data interpretor state and preferences.

Parameters:
main_struct : main structure

< Selected tab in data interpretor's window

< Stream size in data interpretor's window

< Endianness in data interpretor's window

< structure for preferences

Definition at line 236 of file user_prefs.c.

References heraia_struct_t::current_DW, di_get_endianness(), di_get_selected_tab(), di_get_stream_size(), prefs_t::file, GN_DI_PREFS, KN_DI_ENDIANNESS, KN_DI_SELECTED_TAB, KN_DI_STREAM_SIZE, and heraia_struct_t::prefs.

Referenced by save_preferences().

Here is the call graph for this function:

Here is the caller graph for this function:

static void save_mp_display_preferences_options ( heraia_struct_t main_struct  )  [static]

Save only display related preferences.

Parameters:
main_struct : main structure

Definition at line 212 of file user_prefs.c.

References prefs_t::file, GN_DISPLAY_PREFS, is_toggle_button_activated(), KN_DISP_OFFSETS, KN_DISP_THOUSAND, xml_t::main, heraia_struct_t::prefs, and heraia_struct_t::xmls.

Referenced by save_preferences().

Here is the call graph for this function:

Here is the caller graph for this function:

static void save_mp_file_preferences_options ( heraia_struct_t main_struct  )  [static]
static void save_mpwp_preferences ( heraia_struct_t main_struct  )  [static]

Saves main preferences window state and preferences.

Parameters:
main_struct : main structure

< main preferences's notebook

< Selected tab in data interpretor's window

< structure for preferences

Definition at line 272 of file user_prefs.c.

References heraia_struct_t::current_DW, prefs_t::file, GN_MPWP_PREFS, heraia_get_widget(), KN_MPWP_SELECTED_TAB, xml_t::main, heraia_struct_t::prefs, and heraia_struct_t::xmls.

Referenced by save_preferences().

Here is the call graph for this function:

Here is the caller graph for this function:

void save_preferences ( heraia_struct_t main_struct  ) 

Save all preferences to the user preference file.

Parameters:
main_struct the main structure

Definition at line 301 of file user_prefs.c.

References heraia_struct_t::prefs, save_di_preferences(), save_mp_display_preferences_options(), save_mp_file_preferences_options(), save_mpwp_preferences(), and save_preferences_to_file().

Referenced by close_heraia(), and pref_window_delete().

Here is the call graph for this function:

Here is the caller graph for this function:

static void save_window_preferences ( GKeyFile *  file,
gchar *  name,
window_prop_t window_prop 
) [static]

Window preferences.

Parameters:
file a GKeyFile where values are stored
name a keyname (basically a window name)
window_prop all window properties to save (structure window_prop_t)

Definition at line 150 of file user_prefs.c.

References window_prop_t::displayed, GN_GLOBAL_PREFS, window_prop_t::height, window_prop_t::width, window_prop_t::x, and window_prop_t::y.

Referenced by save_mp_file_preferences_options().

Here is the caller graph for this function:

void verify_preference_file ( gchar *  pathname,
gchar *  filename 
)

Verify preference file presence and creates it if it does not already exists.

Parameters:
pathname is the full pathname
filename is the filename containing the path itself

Definition at line 108 of file user_prefs.c.

References verify_preference_file_name_presence(), and verify_preference_file_path_presence().

Referenced by heraia_init_main_struct().

Here is the call graph for this function:

Here is the caller graph for this function:

static void verify_preference_file_name_presence ( gchar *  filename  )  [static]

Verify preference file's presence and creates it if it does not exists already.

Parameters:
filename is a name of a file to look presence for

Definition at line 76 of file user_prefs.c.

Referenced by verify_preference_file().

Here is the caller graph for this function:

static void verify_preference_file_path_presence ( gchar *  pathname  )  [static]

verify preference file path presence and creates it if it does not already exists

Parameters:
pathname is a path to look presence for

Definition at line 56 of file user_prefs.c.

Referenced by verify_preference_file().

Here is the caller graph for this function:

Generated on Fri Aug 20 09:16:05 2010 for Heraia by  doxygen 1.6.3