XSettingsClient.h
/*
* $Id: XSettingsClient.h 2839 2009-09-28 11:36:20Z karijes $
*
* Client part of XSETTINGS protocol
* Based on implementation from Owen Tylor, copyright (c) 2001 Red Hat, inc.
* Copyright (c) 2005-2007 edelib authors
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __EDELIB_XSETTINGSCLIENT_H__
#define __EDELIB_XSETTINGSCLIENT_H__
#include "XSettingsCommon.h"
EDELIB_NS_BEGIN
enum XSettingsAction {
XSETTINGS_ACTION_NEW = 0,
XSETTINGS_ACTION_CHANGED,
XSETTINGS_ACTION_DELETED
};
#ifndef SKIP_DOCS
typedef void (*XSettingsCallback)(const char* name, XSettingsAction action, XSettingsSetting* setting, void* data);
#endif
class EDELIB_API XSettingsClient {
private:
XSettingsData* client_data;
XSettingsCallback settings_cb;
void* settings_cb_data;
void check_manager_window(void);
void read_settings(void);
E_DISABLE_CLASS_COPY(XSettingsClient)
public:
XSettingsClient();
~XSettingsClient();
bool init(Display* dpy, int screen, XSettingsCallback cb = 0, void* data = 0);
void clear(void);
static bool manager_running(Display* dpy, int screen);
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, const char* val);
void set(const char* name, unsigned short red, unsigned short green, unsigned short blue, unsigned short alpha);
void manager_notify(void);
};
EDELIB_NS_END
#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