edelib 2.1.0
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
27EDELIB_NS_BEGIN
28
38
39#ifndef SKIP_DOCS
40typedef void (*XSettingsCallback)(const char* name, XSettingsAction action, XSettingsSetting* setting, void* data);
41#endif
42
109class EDELIB_API XSettingsClient {
110private:
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
119public:
124
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
196EDELIB_NS_END
197#endif
Client part of XSETTINGS protocol.
Definition XSettingsClient.h:109
static bool manager_running(Display *dpy, int screen)
bool init(Display *dpy, int screen, XSettingsCallback cb=0, void *data=0)
void set(const char *name, const char *val)
void callback(XSettingsCallback cb, void *data=0)
int process_xevent(const XEvent *xev)
void set(const char *name, int val)
void set(const char *name, unsigned short red, unsigned short green, unsigned short blue, unsigned short alpha)
#define E_DISABLE_CLASS_COPY(klass)
Definition edelib-global.h:161
XSettingsAction
Flags telling what was done with setting.
Definition XSettingsClient.h:33
@ XSETTINGS_ACTION_CHANGED
One of the settings changed.
Definition XSettingsClient.h:35
@ XSETTINGS_ACTION_DELETED
One of the settings deleted.
Definition XSettingsClient.h:36
@ XSETTINGS_ACTION_NEW
New setting added.
Definition XSettingsClient.h:34
Main data shared between client and manager.
Definition XSettingsCommon.h:122