aboutsummaryrefslogtreecommitdiffstats
path: root/matchbox/core/xas.h
blob: 8d27cfdffd9d9c85b22f437a3909db6780878988 (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
111
112
113
114
115
116
/* Asynchronous Xlib hack utiltys lib
 *
 * Copyright (c) 2005 Matthew Allum
 * 
 * Contains portions of code from Metacity and Xlib.
 *
 * Copyright (C) 2002 Havoc Pennington
 * Copyright (C) 1986, 1998  The Open Group
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 *
 * Permission to use, copy, modify, distribute, and sell this software
 * and its documentation for any purpose is hereby granted without
 * fee, provided that the above copyright notice appear in all copies
 * and that both that copyright notice and this permission notice
 * appear in supporting documentation.
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT.  IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR
 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 * Except as contained in this notice, the name of The Open Group shall not be
 * used in advertising or otherwise to promote the sale, use or other dealings
 * in this Software without prior written authorization from The Open Group.
 */

#ifndef _HAVE_XAS_H
#define _HAVE_XAS_H

#include <X11/Xlib.h>
#include <X11/Xutil.h>

typedef struct  XasContext XasContext;
typedef unsigned long      XasCookie;
typedef struct XasWindowAttributes XasWindowAttributes;

/* XWindowAttributes without geom info */
struct XasWindowAttributes {
  Visual *visual;         
  Window root;            
  int class;              
  int bit_gravity;        
  int win_gravity;        
  int backing_store;      
  unsigned long backing_planes;
  unsigned long backing_pixel;
  Bool save_under;
  Colormap colormap;
  Bool map_installed;
  int map_state;
  long all_event_masks;
  long your_event_mask;
  long do_not_propagate_mask;
  Bool override_redirect;
};

XasContext*
xas_context_new(Display *xdpy);

void
xas_context_destroy(XasContext *ctx);

XasCookie
xas_get_property(XasContext *ctx,
		 Window      win,
		 Atom        property,
		 long        offset,
		 long        length,
		 Bool        delete,
		 Atom        req_type);

Status
xas_get_property_reply(XasContext          *ctx, 
		       XasCookie            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);

XasCookie
xas_get_window_attributes(XasContext        *ctx,
			  Window             win);

XasWindowAttributes*
xas_get_window_attributes_reply(XasContext          *ctx, 
				XasCookie            cookie,
				int                 *x_error_code);

XasCookie
xas_get_geometry(XasContext        *ctx,
		 Drawable           d);

Status 
xas_get_geometry_reply (XasContext   *ctx, 
			XasCookie     cookie,  
			int          *x_return, 
			int          *y_return, 
			unsigned int *width_return,
			unsigned int *height_return, 
			unsigned int *border_width_return,
			unsigned int *depth_return,
			int          *x_error_code);
Bool
xas_have_reply(XasContext          *ctx, 
	       XasCookie            cookie);

#endif