1 /* Copyright (C) 2007-2008 by Xyhthyx <xyhthyx@gmail.com>
2  *
3  * This file is part of Parcellite.
4  *
5  * Parcellite is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * Parcellite is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef PREFERENCES_H
20 #define PREFERENCES_H
21 
22 G_BEGIN_DECLS
23 
24 #define ACTIONS_FILE          "parcellite/actions"
25 #define FIFO_FILE_C          "parcellite/fifo_c"
26 #define FIFO_FILE_P          "parcellite/fifo_p"
27 #define FIFO_FILE_CMD          "parcellite/fifo_cmd"
28 #define FIFO_FILE_DAT         "parcellite/fifo_data"
29 #define PREFERENCES_FILE      "parcellite/parcelliterc"
30 
31 struct keys {
32 	gchar *name;
33 	gchar *keyval;
34 	void *keyfunc;
35 };
36 struct pref2int {
37 	gchar *name;
38 	int *val;
39 };
40 struct tool_flag {
41 	int flag;
42 	gchar *name;
43 };
44 
45 /**for our mapper  */
46 #define PM_INIT 0
47 #define PM_UPDATE 1
48 
49 #define TOOL_XDOTOOL 0x01
50 extern struct tool_flag tool_flags[];
51 extern struct keys keylist[];
52 /*struct pref_item* get_pref(char *name); */
53 void check_for_tools( void );
54 int get_first_pref(int section);
55 void pref_mapper (struct pref2int *m, int mode);
56 int init_pref( void );
57 int set_pref_widget (char *name, GtkWidget *w);
58 GtkWidget *get_pref_widget (char *name);
59 gint32 set_pref_int32(char *name, gint32 val);
60 gint32 get_pref_int32 (char *name);
61 int set_pref_string (char *name, char *string);
62 gchar *get_pref_string (char *name);
63 void bind_itemkey(char *name, void (fhk)(char *, gpointer) );
64 void read_preferences(int mode);
65 
66 void show_preferences(gint tab);
67 
68 G_END_DECLS
69 
70 #endif
71