]> Pileus Git - ~andy/gtk/blob - gdk/x11/xsettings-common.h
xsettings: Remove XSettingsList type
[~andy/gtk] / gdk / x11 / 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 #include <glib.h>
27 #include <sys/types.h>
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif /* __cplusplus */
32
33 /* Renames for GDK inclusion */
34
35 #define xsettings_client_destroy         _gdk_x11_xsettings_client_destroy
36 #define xsettings_client_get_setting     _gdk_x11_xsettings_client_get_setting
37 #define xsettings_client_new             _gdk_x11_xsettings_client_new
38 #define xsettings_client_set_grab_func   _gdk_x11_xsettings_client_set_grab_func
39 #define xsettings_client_set_ungrab_func _gdk_x11_xsettings_client_set_ungrab_func
40 #define xsettings_client_process_event   _gdk_x11_xsettings_client_process_event
41 #define xsettings_setting_copy           _gdk_x11_xsettings_setting_copy
42 #define xsettings_setting_equal          _gdk_x11_xsettings_setting_equal
43 #define xsettings_setting_free           _gdk_x11_xsettings_setting_free
44
45 typedef struct _XSettingsBuffer  XSettingsBuffer;
46 typedef struct _XSettingsColor   XSettingsColor;
47 typedef struct _XSettingsSetting XSettingsSetting;
48
49 /* Types of settings possible. Enum values correspond to
50  * protocol values.
51  */
52 typedef enum 
53 {
54   XSETTINGS_TYPE_INT     = 0,
55   XSETTINGS_TYPE_STRING  = 1,
56   XSETTINGS_TYPE_COLOR   = 2
57 } XSettingsType;
58
59 typedef enum
60 {
61   XSETTINGS_SUCCESS,
62   XSETTINGS_NO_MEM,
63   XSETTINGS_ACCESS,
64   XSETTINGS_FAILED,
65   XSETTINGS_NO_ENTRY,
66   XSETTINGS_DUPLICATE_ENTRY
67 } XSettingsResult;
68
69 struct _XSettingsBuffer
70 {
71   char byte_order;
72   size_t len;
73   unsigned char *data;
74   unsigned char *pos;
75 };
76
77 struct _XSettingsColor
78 {
79   unsigned short red, green, blue, alpha;
80 };
81
82 struct _XSettingsSetting
83 {
84   char *name;
85   XSettingsType type;
86   
87   union {
88     int v_int;
89     char *v_string;
90     XSettingsColor v_color;
91   } data;
92
93   unsigned long last_change_serial;
94 };
95
96 XSettingsSetting *xsettings_setting_copy  (XSettingsSetting *setting);
97 void              xsettings_setting_free  (XSettingsSetting *setting);
98 int               xsettings_setting_equal (XSettingsSetting *setting_a,
99                                            XSettingsSetting *setting_b);
100
101 #define XSETTINGS_PAD(n,m) ((n + m - 1) & (~(m-1)))
102
103 #ifdef __cplusplus
104 }
105 #endif /* __cplusplus */
106
107 #endif /* XSETTINGS_COMMON_H */