1
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
3
/* Marco X property convenience routines */
6
* Copyright (C) 2001 Havoc Pennington
8
* This program is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU General Public License as
10
* published by the Free Software Foundation; either version 2 of the
11
* License, or (at your option) any later version.
13
* This program is distributed in the hope that it will be useful, but
14
* WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
30
#include <X11/Xutil.h>
33
#include <X11/extensions/sync.h>
36
/* Copied from Lesstif by way of GTK. Rudimentary docs can be
37
* found in some Motif reference guides online.
41
unsigned long functions;
42
unsigned long decorations;
45
} MotifWmHints, MwmHints;
47
#define MWM_HINTS_FUNCTIONS (1L << 0)
48
#define MWM_HINTS_DECORATIONS (1L << 1)
49
#define MWM_HINTS_INPUT_MODE (1L << 2)
50
#define MWM_HINTS_STATUS (1L << 3)
52
#define MWM_FUNC_ALL (1L << 0)
53
#define MWM_FUNC_RESIZE (1L << 1)
54
#define MWM_FUNC_MOVE (1L << 2)
55
#define MWM_FUNC_MINIMIZE (1L << 3)
56
#define MWM_FUNC_MAXIMIZE (1L << 4)
57
#define MWM_FUNC_CLOSE (1L << 5)
59
#define MWM_DECOR_ALL (1L << 0)
60
#define MWM_DECOR_BORDER (1L << 1)
61
#define MWM_DECOR_RESIZEH (1L << 2)
62
#define MWM_DECOR_TITLE (1L << 3)
63
#define MWM_DECOR_MENU (1L << 4)
64
#define MWM_DECOR_MINIMIZE (1L << 5)
65
#define MWM_DECOR_MAXIMIZE (1L << 6)
67
#define MWM_INPUT_MODELESS 0
68
#define MWM_INPUT_PRIMARY_APPLICATION_MODAL 1
69
#define MWM_INPUT_SYSTEM_MODAL 2
70
#define MWM_INPUT_FULL_APPLICATION_MODAL 3
71
#define MWM_INPUT_APPLICATION_MODAL MWM_INPUT_PRIMARY_APPLICATION_MODAL
73
#define MWM_TEAROFF_WINDOW (1L<<0)
75
/* These all return the memory from Xlib, so require an XFree()
76
* when they return TRUE. They return TRUE on success.
78
gboolean meta_prop_get_atom_list (MetaDisplay *display,
83
gboolean meta_prop_get_motif_hints (MetaDisplay *display,
86
MotifWmHints **hints_p);
87
gboolean meta_prop_get_cardinal_list (MetaDisplay *display,
92
gboolean meta_prop_get_latin1_string (MetaDisplay *display,
96
gboolean meta_prop_get_utf8_string (MetaDisplay *display,
100
gboolean meta_prop_get_utf8_list (MetaDisplay *display,
105
void meta_prop_set_utf8_string_hint
106
(MetaDisplay *display,
110
gboolean meta_prop_get_window (MetaDisplay *display,
114
gboolean meta_prop_get_cardinal (MetaDisplay *display,
118
gboolean meta_prop_get_cardinal_with_atom_type (MetaDisplay *display,
123
gboolean meta_prop_get_text_property (MetaDisplay *display,
128
gboolean meta_prop_get_wm_hints (MetaDisplay *display,
133
gboolean meta_prop_get_class_hint (MetaDisplay *display,
136
XClassHint *class_hint);
138
gboolean meta_prop_get_size_hints (MetaDisplay *display,
141
XSizeHints **hints_p,
146
META_PROP_VALUE_INVALID,
147
META_PROP_VALUE_UTF8,
148
META_PROP_VALUE_STRING,
149
META_PROP_VALUE_STRING_AS_UTF8,
150
META_PROP_VALUE_MOTIF_HINTS,
151
META_PROP_VALUE_CARDINAL,
152
META_PROP_VALUE_WINDOW,
153
META_PROP_VALUE_CARDINAL_LIST,
154
META_PROP_VALUE_UTF8_LIST,
155
META_PROP_VALUE_ATOM_LIST,
156
META_PROP_VALUE_TEXT_PROPERTY, /* comes back as UTF-8 string */
157
META_PROP_VALUE_WM_HINTS,
158
META_PROP_VALUE_CLASS_HINT,
159
META_PROP_VALUE_SIZE_HINTS,
160
META_PROP_VALUE_SYNC_COUNTER /* comes back as CARDINAL */
163
/* used to request/return/store property values */
166
MetaPropValueType type;
168
Atom required_type; /* autofilled if None */
173
MotifWmHints *motif_hints;
177
XClassHint class_hint;
179
XSyncCounter xcounter;
210
/* Each value has type and atom initialized. If there's an error,
211
* or property is unset, type comes back as INVALID;
212
* else type comes back as it originated, and the data
215
void meta_prop_get_values (MetaDisplay *display,
217
MetaPropValue *values,
220
void meta_prop_free_values (MetaPropValue *values,