aboutsummaryrefslogtreecommitdiffstats
path: root/matchbox/core/mb-wm-props.h
blob: 05d9bfba9e370cd44e44fb24cc0c78ed937964ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
 *  Matchbox Window Manager II - A lightweight window manager not for the
 *                               desktop.
 *
 *  Authored By Matthew Allum <mallum@o-hand.com>
 *
 *  Copyright (c) 2005 OpenedHand Ltd - http://o-hand.com
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 *
 */

#ifndef _HAVE_MB_WM_PROPS_H
#define _HAVE_MB_WM_PROPS_H

MBWMCookie
mb_wm_property_req (MBWindowManager *wm,
		    Window           win,
		    Atom             property,
		    long             offset,
		    long             length,
		    Bool             delete,
		    Atom             req_type);

Status
mb_wm_property_reply (MBWindowManager  *wm,
		      MBWMCookie        cookie,
		      Atom             *actual_type_return,
		      int              *actual_format_return,
		      unsigned long    *nitems_return,
		      unsigned long    *bytes_after_return,
		      unsigned char   **prop_return,
		      int              *x_error_code);

void*
mb_wm_property_get_reply_and_validate (MBWindowManager  *wm,
				       MBWMCookie        cookie,
				       Atom              expected_type,
				       int               expected_format,
				       int               expected_n_items,
				       int              *n_items_ret,
				       int              *x_error_code);
Bool
mb_wm_property_have_reply (MBWindowManager     *wm,
			   MBWMCookie           cookie);

/* FIXME: mb_wm_xwin_* calls to go else where */

MBWMCookie
mb_wm_xwin_get_attributes (MBWindowManager   *wm,
			   Window             win);

MBWMCookie
mb_wm_xwin_get_geometry (MBWindowManager   *wm,
			 Drawable            d);

MBWMClientWindowAttributes*
mb_wm_xwin_get_attributes_reply (MBWindowManager   *wm,
				 MBWMCookie         cookie,
				 int               *x_error_code);
Status
mb_wm_xwin_get_geometry_reply (MBWindowManager   *wm,
			       XasCookie          cookie,
			       MBGeometry        *geom_return,
			       unsigned int      *border_width_return,
			       unsigned int      *depth_return,
			       int               *x_error_code);

void
mb_wm_props_send_x_message (MBWindowManager *wm,
			    Window           xwin_src,
			    Window           xwin_dest,
			    Atom             delivery_atom,
			    unsigned long    data0,
			    unsigned long    data1,
			    unsigned long    data2,
			    unsigned long    data3,
			    unsigned long    data4,
			    unsigned long    mask);

/* Utils */

#define mb_wm_property_cardinal_req(wm, win, prop)                   \
         mb_wm_property_req ((wm),                                   \
			     (win),                                  \
			     (prop),                                 \
			     0,     /* offset */                     \
			     1024L, /* Length, FIXME: Check this */  \
			     False,                                  \
			     XA_CARDINAL);

#define mb_wm_property_atom_req(wm, win, prop)                       \
         mb_wm_property_req ((wm),                                   \
			     (win),                                  \
			     (prop),                                 \
			     0,     /* offset */                     \
			     1024L, /* Length, FIXME: Check this */  \
			     False,                                  \
			     XA_ATOM);

#define mb_wm_property_utf8_req(wm, win, prop)                       \
         mb_wm_property_req ((wm),                                   \
			     (win),                                  \
			     (prop),                                 \
			     0,     /* offset */                     \
			     1024L, /* Length, FIXME: Check this */  \
			     False,                                  \
			     (wm)->atoms[MBWM_ATOM_UTF8_STRING]);

#endif