edelib 2.0.0
|
00001 /* 00002 * $Id: XSettingsManager.h 2839 2009-09-28 11:36:20Z karijes $ 00003 * 00004 * Manager part of XSETTINGS protocol 00005 * Based on implementation from Owen Tylor, copyright (c) 2001 Red Hat, inc. 00006 * Copyright (c) 2005-2007 edelib authors 00007 * 00008 * This library is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Lesser General Public 00010 * License as published by the Free Software Foundation; either 00011 * version 2 of the License, or (at your option) any later version. 00012 * 00013 * This library is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public License 00019 * along with this library. If not, see <http://www.gnu.org/licenses/>. 00020 */ 00021 00022 #ifndef __EDELIB_XSETTINGSMANAGER_H__ 00023 #define __EDELIB_XSETTINGSMANAGER_H__ 00024 00025 #include "XSettingsCommon.h" 00026 00027 EDELIB_NS_BEGIN 00028 00038 class EDELIB_API XSettingsManager { 00039 private: 00040 E_DISABLE_CLASS_COPY(XSettingsManager) 00041 00042 protected: 00044 XSettingsData* manager_data; 00045 00046 public: 00050 XSettingsManager() : manager_data(NULL) { } 00051 00055 ~XSettingsManager() { clear(); } 00056 00063 bool init(Display* dpy, int screen); 00064 00069 void clear(void); 00070 00077 static bool manager_running(Display* dpy, int screen); 00078 00084 bool should_terminate(const XEvent* xev); 00085 00091 void set(const char* name, int val); 00092 00098 void set(const char* name, const char* val); 00099 00108 void set(const char* name, unsigned short red, unsigned short green, unsigned short blue, unsigned short alpha); 00109 00113 void notify(void); 00114 }; 00115 00116 EDELIB_NS_END 00117 #endif