edelib  2.1.0
XSettingsCommon.h
1 /*
2  * $Id: XSettingsCommon.h 2839 2009-09-28 11:36:20Z karijes $
3  *
4  * Common stuff for 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_XSETTINGSCOMMON_H__
23 #define __EDELIB_XSETTINGSCOMMON_H__
24 
25 #include "edelib-global.h"
26 #include <X11/Xlib.h>
27 
28 #define XSETTINGS_PAD(n, p) ((n + p - 1) & (~(p - 1)))
29 
30 EDELIB_NS_BEGIN
31 
40 };
41 
48  unsigned short red;
50  unsigned short green;
52  unsigned short blue;
54  unsigned short alpha;
55 };
56 
63  char* name;
66 
68  union {
69  int v_int;
70  char* v_string;
71  XSettingsColor v_color;
72  } data;
73 
75  unsigned long last_change_serial;
76 };
77 
82 struct XSettingsList {
87 };
88 
124  Display* display;
126  int screen;
127 
130 
133 
136 
139 
142 
144  unsigned long serial;
145 };
146 
147 #ifndef SKIP_DOCS
148 struct XSettingsBuffer {
149  char byte_order;
150  int len;
151  unsigned char* data;
152  unsigned char* pos;
153 };
154 #endif
155 
159 EDELIB_API bool xsettings_list_add(XSettingsList** list, XSettingsSetting* setting);
160 
164 EDELIB_API bool xsettings_list_remove(XSettingsList** list, const char* name);
165 
169 EDELIB_API XSettingsSetting* xsettings_list_find(XSettingsList* list, const char* name);
170 
174 EDELIB_API void xsettings_list_free(XSettingsList* list);
175 
176 
177 
181 EDELIB_API XSettingsSetting* xsettings_setting_copy(XSettingsSetting* setting);
182 
186 EDELIB_API void xsettings_setting_free(XSettingsSetting* setting);
187 
191 EDELIB_API bool xsettings_setting_equal(XSettingsSetting* s1, XSettingsSetting* s2);
192 
196 EDELIB_API int xsettings_setting_len(const XSettingsSetting* setting);
197 
201 EDELIB_API char xsettings_byte_order(void);
202 
203 
208 EDELIB_API XSettingsList* xsettings_decode(unsigned char* data, /*size_t*/ int len, unsigned long* serial);
209 
213 EDELIB_API void xsettings_encode(const XSettingsSetting* setting, XSettingsBuffer* buffer);
214 
215 
216 #ifndef SKIP_DOCS
217 void xsettings_manager_notify(XSettingsData* data);
218 void xsettings_manager_set_setting(XSettingsData* data, XSettingsSetting* setting);
219 void xsettings_manager_delete_setting(XSettingsData* data, const char* name);
220 #endif
221 
222 EDELIB_NS_END
223 #endif
char * name
Definition: XSettingsCommon.h:63
Atom selection_atom
Definition: XSettingsCommon.h:132
unsigned short alpha
Definition: XSettingsCommon.h:54
Atom manager_atom
Definition: XSettingsCommon.h:135
string (char*) type
Definition: XSettingsCommon.h:38
List internaly used by XSETTINGS classes.
Definition: XSettingsCommon.h:82
int screen
Definition: XSettingsCommon.h:126
int type
Definition: XSettingsCommon.h:37
Window class.
Definition: Window.h:73
XSettingsList * settings
Definition: XSettingsCommon.h:141
RGBA type.
Definition: XSettingsCommon.h:39
XSettingsList * next
Definition: XSettingsCommon.h:86
Main data shared between client and manager.
Definition: XSettingsCommon.h:122
unsigned long last_change_serial
Definition: XSettingsCommon.h:75
unsigned long serial
Definition: XSettingsCommon.h:144
XSettingsType
Types used for XSETTINGS.
Definition: XSettingsCommon.h:36
Structure for tracking XSETTINGS values.
Definition: XSettingsCommon.h:61
XSettingsSetting * setting
Definition: XSettingsCommon.h:84
unsigned short blue
Definition: XSettingsCommon.h:52
XSettingsType type
Definition: XSettingsCommon.h:65
unsigned short red
Definition: XSettingsCommon.h:48
Color data for XSETTINGS.
Definition: XSettingsCommon.h:46
Window manager_win
Definition: XSettingsCommon.h:129
unsigned short green
Definition: XSettingsCommon.h:50
Atom xsettings_atom
Definition: XSettingsCommon.h:138
Display * display
Definition: XSettingsCommon.h:124