00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __EDELIB_XSETTINGSCLIENT_H__
00023 #define __EDELIB_XSETTINGSCLIENT_H__
00024
00025 #include "XSettingsCommon.h"
00026
00027 EDELIB_NS_BEGIN
00028
00033 enum XSettingsAction {
00034 XSETTINGS_ACTION_NEW = 0,
00035 XSETTINGS_ACTION_CHANGED,
00036 XSETTINGS_ACTION_DELETED
00037 };
00038
00039 #ifndef SKIP_DOCS
00040 typedef void (*XSettingsCallback)(const char* name, XSettingsAction action, XSettingsSetting* setting, void* data);
00041 #endif
00042
00109 class EDELIB_API XSettingsClient {
00110 private:
00111 XSettingsData* client_data;
00112 XSettingsCallback settings_cb;
00113 void* settings_cb_data;
00114
00115 void check_manager_window(void);
00116 void read_settings(void);
00117
00118 E_DISABLE_CLASS_COPY(XSettingsClient)
00119 public:
00123 XSettingsClient();
00124
00128 ~XSettingsClient();
00129
00138 bool init(Display* dpy, int screen, XSettingsCallback cb = 0, void* data = 0);
00139
00144 void clear(void);
00145
00152 static bool manager_running(Display* dpy, int screen);
00153
00159 void callback(XSettingsCallback cb, void* data = 0);
00160
00164 int process_xevent(const XEvent* xev);
00165
00171 void set(const char* name, int val);
00172
00178 void set(const char* name, const char* val);
00179
00188 void set(const char* name, unsigned short red, unsigned short green, unsigned short blue, unsigned short alpha);
00189
00193 void manager_notify(void);
00194 };
00195
00196 EDELIB_NS_END
00197 #endif