2
by onli
moved sources from unstable-svn-branch to here |
1 |
/*
|
2 |
* Copyright 2007 Simone Della Longa <simonedll@yahoo.it>
|
|
3 |
*
|
|
4 |
* This program is free software; you can redistribute it and/or modify
|
|
5 |
* it under the terms of the GNU General Public License as published by
|
|
6 |
* the Free Software Foundation; either version 2 of the License, or
|
|
7 |
* (at your option) any later version.
|
|
8 |
*
|
|
9 |
* This program is distributed in the hope that it will be useful,
|
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12 |
* GNU General Public License for more details.
|
|
13 |
*
|
|
14 |
* You should have received a copy of the GNU General Public License
|
|
15 |
* along with this program; if not, write to the Free Software
|
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
17 |
*/
|
|
18 |
||
19 |
#include "sim_gconf.h" |
|
20 |
#include "gconf_settings.h" |
|
21 |
||
22 |
using namespace std; |
|
23 |
||
24 |
||
25 |
||
29
by onli
Replace settings with struct |
26 |
void simGconf_loadSettings (simSettings* data) |
2
by onli
moved sources from unstable-svn-branch to here |
27 |
{
|
28 |
||
29 |
GConfClient *client = SimGconf::GetClient (); |
|
30 |
||
31 |
SimGconf::GetInt(client, APPLICATION_PATH GCONF_LEFT_BORDER, &data->LEFT_BORDER); |
|
32 |
SimGconf::GetInt(client, APPLICATION_PATH GCONF_RIGHT_BORDER, &data->RIGHT_BORDER); |
|
33 |
SimGconf::GetInt(client, APPLICATION_PATH GCONF_BOTTOM_BORDER, &data->BOTTOM_BORDER); |
|
34 |
SimGconf::GetInt(client, APPLICATION_PATH GCONF_ICON_WIDTH, &data->ICONW); |
|
35 |
SimGconf::GetInt(client, APPLICATION_PATH GCONF_ICON_HEIGHT, &data->ICONH); |
|
36 |
SimGconf::GetInt(client, APPLICATION_PATH GCONF_ZOOM, &data->PERCENT); |
|
37 |
SimGconf::GetInt(client, APPLICATION_PATH GCONF_RANGE, &data->RANGE); |
|
38 |
SimGconf::GetInt(client, APPLICATION_PATH GCONF_BG_HEIGHT, &data->BG_HEIGHT); |
|
39 |
SimGconf::GetInt(client, APPLICATION_PATH GCONF_SPACER, &data->SPACER); |
|
37
by onli
Make blur animation speed configurable |
40 |
SimGconf::GetInt(client, APPLICATION_PATH GCONF_BLUR_TIMEOUT, &data->BLUR_TIMEOUT); |
2
by onli
moved sources from unstable-svn-branch to here |
41 |
SimGconf::GetString(client, APPLICATION_PATH GCONF_BG_URL, &data->BG_PATH); |
42 |
||
43 |
SimGconf::GetBool(client, APPLICATION_PATH GCONF_SHOW_REFLEXES, &data->SHOW_REFLEXES); |
|
44 |
SimGconf::GetInt(client, APPLICATION_PATH GCONF_REFLEX_SCALING, &data->REFLEX_SCALING); |
|
45 |
SimGconf::GetInt(client, APPLICATION_PATH GCONF_REFLEX_ALPHA, &data->REFLEX_ALPHA); |
|
46 |
SimGconf::GetBool(client, APPLICATION_PATH GCONF_AUTO_POSITION, &data->AUTO_POSITION); |
|
47 |
SimGconf::GetBool(client, APPLICATION_PATH GCONF_ENABLE_TASKS, &data->ENABLE_TASKS); |
|
48 |
||
10
by onli
better menu-position, minimizing, icon-refresh on close |
49 |
SimGconf::GetBool(client, APPLICATION_PATH GCONF_ENABLE_MINIMIZE, &data->ENABLE_MINIMIZE); |
62
by onli
add toggle for fast animations (default) |
50 |
SimGconf::GetBool(client, APPLICATION_PATH GCONF_FAST_ANIMATIONS, &data->FAST_ANIMATIONS); |
10
by onli
better menu-position, minimizing, icon-refresh on close |
51 |
|
62
by onli
add toggle for fast animations (default) |
52 |
g_object_unref (client); |
2
by onli
moved sources from unstable-svn-branch to here |
53 |
}
|
54 |
||
55 |
void simGconf_loadPosition (int* x, int* y) |
|
56 |
{
|
|
57 |
GConfClient *client = SimGconf::GetClient (); |
|
58 |
||
59 |
SimGconf::GetInt(client, APPLICATION_PATH GCONF_SETTINGS_X, x); |
|
60 |
SimGconf::GetInt(client, APPLICATION_PATH GCONF_SETTINGS_Y, y); |
|
61 |
||
62 |
g_object_unref (client); |
|
63 |
}
|
|
64 |
||
65 |
void
|
|
66 |
simGconf_saveSettings (struct simSettings* data) |
|
67 |
{
|
|
68 |
GConfClient *client = SimGconf::GetClient (); |
|
69 |
||
70 |
SimGconf::SetInt(client, APPLICATION_PATH GCONF_LEFT_BORDER, &data->LEFT_BORDER); |
|
71 |
SimGconf::SetInt(client, APPLICATION_PATH GCONF_RIGHT_BORDER, &data->RIGHT_BORDER); |
|
72 |
SimGconf::SetInt(client, APPLICATION_PATH GCONF_BOTTOM_BORDER, &data->BOTTOM_BORDER); |
|
73 |
SimGconf::SetInt(client, APPLICATION_PATH GCONF_ICON_WIDTH, &data->ICONW); |
|
74 |
SimGconf::SetInt(client, APPLICATION_PATH GCONF_ICON_HEIGHT, &data->ICONH); |
|
75 |
SimGconf::SetInt(client, APPLICATION_PATH GCONF_ZOOM, &data->PERCENT); |
|
76 |
SimGconf::SetInt(client, APPLICATION_PATH GCONF_RANGE, &data->RANGE); |
|
77 |
SimGconf::SetInt(client, APPLICATION_PATH GCONF_BG_HEIGHT, &data->BG_HEIGHT); |
|
78 |
SimGconf::SetInt(client, APPLICATION_PATH GCONF_SPACER, &data->SPACER); |
|
37
by onli
Make blur animation speed configurable |
79 |
SimGconf::SetInt(client, APPLICATION_PATH GCONF_BLUR_TIMEOUT, &data->BLUR_TIMEOUT); |
2
by onli
moved sources from unstable-svn-branch to here |
80 |
SimGconf::SetString(client, APPLICATION_PATH GCONF_BG_URL, &data->BG_PATH); |
81 |
SimGconf::SetBool(client, APPLICATION_PATH GCONF_SHOW_REFLEXES, &data->SHOW_REFLEXES); |
|
82 |
SimGconf::SetInt(client, APPLICATION_PATH GCONF_REFLEX_SCALING, &data->REFLEX_SCALING); |
|
83 |
SimGconf::SetInt(client, APPLICATION_PATH GCONF_REFLEX_ALPHA, &data->REFLEX_ALPHA); |
|
84 |
SimGconf::SetBool(client, APPLICATION_PATH GCONF_AUTO_POSITION, &data->AUTO_POSITION); |
|
85 |
SimGconf::SetBool(client, APPLICATION_PATH GCONF_ENABLE_TASKS, &data->ENABLE_TASKS); |
|
10
by onli
better menu-position, minimizing, icon-refresh on close |
86 |
|
87 |
SimGconf::SetBool(client, APPLICATION_PATH GCONF_ENABLE_MINIMIZE, &data->ENABLE_MINIMIZE); |
|
62
by onli
add toggle for fast animations (default) |
88 |
SimGconf::SetBool(client, APPLICATION_PATH GCONF_FAST_ANIMATIONS, &data->FAST_ANIMATIONS); |
2
by onli
moved sources from unstable-svn-branch to here |
89 |
|
90 |
g_object_unref (client); |
|
91 |
||
92 |
}
|
|
93 |
||
94 |
void simGconf_savePosition(int x, int y) |
|
95 |
{
|
|
96 |
GConfClient *client = SimGconf::GetClient (); |
|
97 |
||
98 |
SimGconf::SetInt(client, APPLICATION_PATH GCONF_SETTINGS_X, &x); |
|
99 |
SimGconf::SetInt(client, APPLICATION_PATH GCONF_SETTINGS_Y, &y); |
|
100 |
||
101 |
g_object_unref (client); |
|
102 |
}
|