edelib: edelib/XSettingsClient.h Source File

edelib 1.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List

XSettingsClient.h
1 /*
2 * $Id: XSettingsClient.h 2839 2009-09-28 11:36:20Z karijes $
3 *
4 * Client part of XSETTINGS protocol
5 * Based on implementation from Owen Tylor, copyright (c) 2001 Red Hat, inc.
6 * Copyright (c) 2005-2007 edelib authors
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this library. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22 #ifndef __EDELIB_XSETTINGSCLIENT_H__
23 #define __EDELIB_XSETTINGSCLIENT_H__
24
25 #include "XSettingsCommon.h"
26
27 EDELIB_NS_BEGIN
28
33 enum XSettingsAction {
34 XSETTINGS_ACTION_NEW = 0,
35 XSETTINGS_ACTION_CHANGED,
36 XSETTINGS_ACTION_DELETED
37 };
38
39 #ifndef SKIP_DOCS
40 typedef void (*XSettingsCallback)(const char* name, XSettingsAction action, XSettingsSetting* setting, void* data);
41 #endif
42
109 class EDELIB_API XSettingsClient {
110 private:
111 XSettingsData* client_data;
112 XSettingsCallback settings_cb;
113 void* settings_cb_data;
114
115 void check_manager_window(void);
116 void read_settings(void);
117
118 E_DISABLE_CLASS_COPY(XSettingsClient)
119 public:
123 XSettingsClient();
124
128 ~XSettingsClient();
129
138 bool init(Display* dpy, int screen, XSettingsCallback cb = 0, void* data = 0);
139
144 void clear(void);
145
152 static bool manager_running(Display* dpy, int screen);
153
159 void callback(XSettingsCallback cb, void* data = 0);
160
164 int process_xevent(const XEvent* xev);
165
171 void set(const char* name, int val);
172
178 void set(const char* name, const char* val);
179
188 void set(const char* name, unsigned short red, unsigned short green, unsigned short blue, unsigned short alpha);
189
193 void manager_notify(void);
194 };
195
196 EDELIB_NS_END
197 #endif
edelib::XSettingsAction
XSettingsAction
Flags telling what was done with setting.
Definition: XSettingsClient.h:33
edelib::XSETTINGS_ACTION_CHANGED
One of the settings changed.
Definition: XSettingsClient.h:35
edelib::XSettingsData
Main data shared between client and manager.
Definition: XSettingsCommon.h:122
edelib::XSETTINGS_ACTION_DELETED
One of the settings deleted.
Definition: XSettingsClient.h:36
edelib::XSettingsSetting
Structure for tracking XSETTINGS values.
Definition: XSettingsCommon.h:61
E_DISABLE_CLASS_COPY
#define E_DISABLE_CLASS_COPY(klass)
Definition: edelib-global.h:161
edelib::XSETTINGS_ACTION_NEW
New setting added.
Definition: XSettingsClient.h:34
edelib::XSettingsClient
Client part of XSETTINGS protocol.
Definition: XSettingsClient.h:109