Heraia  0.1.8
user_prefs.h
Go to the documentation of this file.
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /*
3  user_prefs.h
4  heraia - an hexadecimal file editor and analyser based on ghex
5 
6  (C) Copyright 2008 - 2011 Olivier Delhomme
7  e-mail : heraia@delhomme.org
8  URL : http://heraia.tuxfamily.org
9 
10  This program is free software; you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation; either version 2, or (at your option)
13  any later version.
14 
15  This program is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with this program; if not, write to the Free Software
22  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
23 /**
24  * @file user_prefs.h
25  * Header file for user preferences
26  */
27 #ifndef _LIBHERAIA_USER_PREFS_H_
28 #define _LIBHERAIA_USER_PREFS_H_
29 
30 /**
31  * @note
32  * GN == Group Name
33  * KN == Key Name
34  * Thoses variables are the ones to use in main preference file and projects
35  * Please do not translate them !
36  */
37 #define GN_GLOBAL_PREFS "Global Preferences"
38 #define GN_DISPLAY_PREFS "Display Preferences"
39 #define GN_DI_PREFS "Data Interpretor Preferences"
40 #define GN_MPWP_PREFS "Main Preferences Window Preferences"
41 
42 #define KN_SAVE_WINDOW_PREFS "Save Window Preferences"
43 #define KN_ABOUT_BOX "About Box"
44 #define KN_DATA_INTERPRETOR "Data Interpretor"
45 #define KN_LOG_BOX "Log Box"
46 #define KN_MAIN_DIALOG "Main Dialog"
47 #define KN_PLUGIN_LIST "Plugin List"
48 #define KN_LDT "List Data Types"
49 #define KN_MAIN_PREFS "Main Preferences"
50 #define KN_GOTO_DIALOG "Goto Dialog"
51 #define KN_RESULT_WINDOW "Result Window"
52 #define KN_FIND_WINDOW "Find Window"
53 #define KN_FR_WINDOW "Find and Replace Window"
54 #define KN_FDFT_WINDOW "Find data from type Window"
55 
56 #define KN_SAVE_OPENED_FILES_FILENAMES "Opened files filenames"
57 #define KN_FILES_FILENAMES "Files filenames"
58 #define KN_FILES_CURSOR_POSITIONS "Files cursor positions"
59 #define KN_CURRENT_TAB "Main current tab"
60 
61 
62 #define KN_DISP_THOUSAND "Thousand"
63 #define KN_DISP_OFFSETS "Offsets"
64 
65 #define KN_DI_SELECTED_TAB "Selected Tab"
66 #define KN_DI_STREAM_SIZE "Stream Size"
67 #define KN_DI_ENDIANNESS "Endianness"
68 
69 #define KN_MPWP_SELECTED_TAB "Selected Tab"
70 
71 extern void verify_preference_file(prefs_t *prefs);
72 
73 extern prefs_t *init_preference_struct(gchar *pathname, gchar *filename);
74 extern void free_preference_struct(prefs_t *prefs);
75 
76 extern void save_preferences(heraia_struct_t *main_struct, prefs_t *prefs);
77 extern void load_preferences(heraia_struct_t *main_struct, prefs_t *prefs);
78 
79 #endif /* _LIBHERAIA_USER_PREFS_H_ */
This is the main structure.
Definition: libheraia.h:332
prefs_t * init_preference_struct(gchar *pathname, gchar *filename)
Look out if the preference structure exists or not.
Definition: user_prefs.c:130
Data type related to preferences.
Definition: libheraia.h:280
void free_preference_struct(prefs_t *prefs)
Destroys a preference structure.
Definition: user_prefs.c:148
void save_preferences(heraia_struct_t *main_struct, prefs_t *prefs)
Save all preferences to the user preference file.
Definition: user_prefs.c:376
void verify_preference_file(prefs_t *prefs)
Verify preference file presence and creates it if it does not already exists.
Definition: user_prefs.c:113
void load_preferences(heraia_struct_t *main_struct, prefs_t *prefs)
Sets up the preferences as loaded in the preference file.
Definition: user_prefs.c:620