Heraia  0.1.8
user_prefs.h File Reference

Header file for user preferences. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define GN_GLOBAL_PREFS   "Global Preferences"
 
#define GN_DISPLAY_PREFS   "Display Preferences"
 
#define GN_DI_PREFS   "Data Interpretor Preferences"
 
#define GN_MPWP_PREFS   "Main Preferences Window Preferences"
 
#define KN_SAVE_WINDOW_PREFS   "Save Window Preferences"
 
#define KN_ABOUT_BOX   "About Box"
 
#define KN_DATA_INTERPRETOR   "Data Interpretor"
 
#define KN_LOG_BOX   "Log Box"
 
#define KN_MAIN_DIALOG   "Main Dialog"
 
#define KN_PLUGIN_LIST   "Plugin List"
 
#define KN_LDT   "List Data Types"
 
#define KN_MAIN_PREFS   "Main Preferences"
 
#define KN_GOTO_DIALOG   "Goto Dialog"
 
#define KN_RESULT_WINDOW   "Result Window"
 
#define KN_FIND_WINDOW   "Find Window"
 
#define KN_FR_WINDOW   "Find and Replace Window"
 
#define KN_FDFT_WINDOW   "Find data from type Window"
 
#define KN_SAVE_OPENED_FILES_FILENAMES   "Opened files filenames"
 
#define KN_FILES_FILENAMES   "Files filenames"
 
#define KN_FILES_CURSOR_POSITIONS   "Files cursor positions"
 
#define KN_CURRENT_TAB   "Main current tab"
 
#define KN_DISP_THOUSAND   "Thousand"
 
#define KN_DISP_OFFSETS   "Offsets"
 
#define KN_DI_SELECTED_TAB   "Selected Tab"
 
#define KN_DI_STREAM_SIZE   "Stream Size"
 
#define KN_DI_ENDIANNESS   "Endianness"
 
#define KN_MPWP_SELECTED_TAB   "Selected Tab"
 

Functions

void verify_preference_file (prefs_t *prefs)
 Verify preference file presence and creates it if it does not already exists. More...
 
prefs_tinit_preference_struct (gchar *pathname, gchar *filename)
 Look out if the preference structure exists or not. More...
 
void free_preference_struct (prefs_t *prefs)
 Destroys a preference structure. More...
 
void save_preferences (heraia_struct_t *main_struct, prefs_t *prefs)
 Save all preferences to the user preference file. More...
 
void load_preferences (heraia_struct_t *main_struct, prefs_t *prefs)
 Sets up the preferences as loaded in the preference file. More...
 

Detailed Description

Header file for user preferences.

Definition in file user_prefs.h.

Macro Definition Documentation

#define GN_DI_PREFS   "Data Interpretor Preferences"

Definition at line 39 of file user_prefs.h.

Referenced by load_di_preferences(), and save_di_preferences().

#define GN_DISPLAY_PREFS   "Display Preferences"
#define GN_GLOBAL_PREFS   "Global Preferences"
Note
GN == Group Name KN == Key Name Thoses variables are the ones to use in main preference file and projects Please do not translate them !

Definition at line 37 of file user_prefs.h.

Referenced by load_mp_file_preferences_options(), load_mp_files_filenames(), load_window_preferences(), save_mp_file_preferences_options(), save_mp_files_filenames(), and save_window_preferences().

#define GN_MPWP_PREFS   "Main Preferences Window Preferences"

Definition at line 40 of file user_prefs.h.

Referenced by load_mpwp_preferences(), and save_mpwp_preferences().

#define KN_ABOUT_BOX   "About Box"
#define KN_CURRENT_TAB   "Main current tab"

Definition at line 59 of file user_prefs.h.

Referenced by load_mp_files_filenames(), and save_mp_files_filenames().

#define KN_DATA_INTERPRETOR   "Data Interpretor"
#define KN_DI_ENDIANNESS   "Endianness"

Definition at line 67 of file user_prefs.h.

Referenced by load_di_preferences(), and save_di_preferences().

#define KN_DI_SELECTED_TAB   "Selected Tab"

Definition at line 65 of file user_prefs.h.

Referenced by load_di_preferences(), and save_di_preferences().

#define KN_DI_STREAM_SIZE   "Stream Size"

Definition at line 66 of file user_prefs.h.

Referenced by load_di_preferences(), and save_di_preferences().

#define KN_DISP_OFFSETS   "Offsets"
#define KN_DISP_THOUSAND   "Thousand"
#define KN_FDFT_WINDOW   "Find data from type Window"
#define KN_FILES_CURSOR_POSITIONS   "Files cursor positions"

Definition at line 58 of file user_prefs.h.

Referenced by load_mp_files_filenames(), and save_mp_files_filenames().

#define KN_FILES_FILENAMES   "Files filenames"

Definition at line 57 of file user_prefs.h.

Referenced by load_mp_files_filenames(), and save_mp_files_filenames().

#define KN_FIND_WINDOW   "Find Window"
#define KN_FR_WINDOW   "Find and Replace Window"
#define KN_GOTO_DIALOG   "Goto Dialog"
#define KN_LDT   "List Data Types"
#define KN_LOG_BOX   "Log Box"
#define KN_MAIN_DIALOG   "Main Dialog"
#define KN_MAIN_PREFS   "Main Preferences"
#define KN_MPWP_SELECTED_TAB   "Selected Tab"

Definition at line 69 of file user_prefs.h.

Referenced by load_mpwp_preferences(), and save_mpwp_preferences().

#define KN_PLUGIN_LIST   "Plugin List"
#define KN_RESULT_WINDOW   "Result Window"
#define KN_SAVE_OPENED_FILES_FILENAMES   "Opened files filenames"
#define KN_SAVE_WINDOW_PREFS   "Save Window Preferences"

Function Documentation

void free_preference_struct ( prefs_t prefs)

Destroys a preference structure.

Parameters
prefsthe preference structure to be freed

Definition at line 148 of file user_prefs.c.

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

Referenced by close_a_project(), and on_projects_save_as_activate().

Here is the caller graph for this function:

prefs_t* init_preference_struct ( gchar *  pathname,
gchar *  filename 
)

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
pathnameis the pathname where the preference file is
filenameis the filename of the preference file itself

Definition at line 130 of file user_prefs.c.

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

Referenced by heraia_init_main_struct(), on_projects_open_activate(), and on_projects_save_as_activate().

Here is the caller graph for this function:

void load_preferences ( heraia_struct_t main_struct,
prefs_t prefs 
)

Sets up the preferences as loaded in the preference file.

Parameters
main_structthe main structure
prefsis a 'prefs_t *' filled preference structure

Definition at line 620 of file user_prefs.c.

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

Referenced by load_heraia_ui(), and on_projects_open_activate().

Here is the call graph for this function:

Here is the caller graph for this function:

void save_preferences ( heraia_struct_t main_struct,
prefs_t prefs 
)

Save all preferences to the user preference file.

Parameters
main_structthe main structure
prefsis a 'prefs_t *' filled preference structure

Definition at line 376 of file user_prefs.c.

References save_di_preferences(), save_mp_display_preferences_options(), save_mp_file_preferences_options(), save_mpwp_preferences(), and save_preferences_to_file().

Referenced by close_a_project(), on_projects_save_as_activate(), and pref_window_delete().

Here is the call graph for this function:

Here is the caller graph for this function:

void verify_preference_file ( prefs_t prefs)

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

Parameters
prefsis a 'prefs_t *' filled preference structure

Definition at line 113 of file user_prefs.c.

References prefs_t::filename, prefs_t::pathname, 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: