]> Dogcows Code - chaz/tint2/blob - src/launcher/xsettings-common.h
launcher : limit launcher_icon_theme to 1 theme. Add XSETTINGS client and read launch...
[chaz/tint2] / src / launcher / xsettings-common.h
1 /*
2 * Copyright © 2001 Red Hat, Inc.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation, and that the name of Red Hat not be used in advertising or
9 * publicity pertaining to distribution of the software without specific,
10 * written prior permission. Red Hat makes no representations about the
11 * suitability of this software for any purpose. It is provided "as is"
12 * without express or implied warranty.
13 *
14 * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
16 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
18 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
19 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 *
21 * Author: Owen Taylor, Red Hat, Inc.
22 */
23 #ifndef XSETTINGS_COMMON_H
24 #define XSETTINGS_COMMON_H
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif /* __cplusplus */
29
30 typedef struct _XSettingsBuffer XSettingsBuffer;
31 typedef struct _XSettingsColor XSettingsColor;
32 typedef struct _XSettingsList XSettingsList;
33 typedef struct _XSettingsSetting XSettingsSetting;
34
35 /* Types of settings possible. Enum values correspond to
36 * protocol values.
37 */
38 typedef enum
39 {
40 XSETTINGS_TYPE_INT = 0,
41 XSETTINGS_TYPE_STRING = 1,
42 XSETTINGS_TYPE_COLOR = 2,
43 XSETTINGS_TYPE_NONE = 0xff
44 } XSettingsType;
45
46 typedef enum
47 {
48 XSETTINGS_SUCCESS,
49 XSETTINGS_NO_MEM,
50 XSETTINGS_ACCESS,
51 XSETTINGS_FAILED,
52 XSETTINGS_NO_ENTRY,
53 XSETTINGS_DUPLICATE_ENTRY
54 } XSettingsResult;
55
56 struct _XSettingsBuffer
57 {
58 char byte_order;
59 size_t len;
60 unsigned char *data;
61 unsigned char *pos;
62 };
63
64 struct _XSettingsColor
65 {
66 unsigned short red, green, blue, alpha;
67 };
68
69 struct _XSettingsList
70 {
71 XSettingsSetting *setting;
72 XSettingsList *next;
73 };
74
75 struct _XSettingsSetting
76 {
77 char *name;
78 XSettingsType type;
79
80 union {
81 int v_int;
82 char *v_string;
83 XSettingsColor v_color;
84 } data;
85
86 unsigned long last_change_serial;
87 };
88
89 XSettingsSetting *xsettings_setting_copy (XSettingsSetting *setting);
90 void xsettings_setting_free (XSettingsSetting *setting);
91 int xsettings_setting_equal (XSettingsSetting *setting_a,
92 XSettingsSetting *setting_b);
93
94 void xsettings_list_free (XSettingsList *list);
95 XSettingsList *xsettings_list_copy (XSettingsList *list);
96 XSettingsResult xsettings_list_insert (XSettingsList **list,
97 XSettingsSetting *setting);
98 XSettingsSetting *xsettings_list_lookup (XSettingsList *list,
99 const char *name);
100 XSettingsResult xsettings_list_delete (XSettingsList **list,
101 const char *name);
102
103 char xsettings_byte_order (void);
104
105 #define XSETTINGS_PAD(n,m) ((n + m - 1) & (~(m-1)))
106
107 #ifdef __cplusplus
108 }
109 #endif /* __cplusplus */
110
111 #endif /* XSETTINGS_COMMON_H */
This page took 0.03435 seconds and 4 git commands to generate.