aboutsummaryrefslogtreecommitdiffstats
path: root/LIBAXL_REQUEST_TRANSLATE_COORDINATES.3
blob: 93b6ca2086da97a0fdab661b05ee1d07145374ef (plain) (blame)
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
117
118
119
120
.TH LIBAXL_REQUEST_TRANSLATE_COORDINATES 3 libaxl
.SH NAME
LIBAXL_REQUEST_TRANSLATE_COORDINATES - Get coordinates relative to another window and hit child
.SH SYNOPSIS
.nf
#include <libaxl.h>

#define LIBAXL_REQUEST_TRANSLATE_COORDINATES 17
struct libaxl_request_translate_coordinates {
        uint8_t         \fIopcode\fP;
        uint8_t         \fI__pad\fP;
        uint16_t        \fI_request_length\fP;
        libaxl_window_t \fIsrc_window\fP;
        libaxl_window_t \fIdest_window\fP;
        int16_t         \fIsrc_x\fP;
        int16_t         \fIsrc_y\fP;
};
.fi
.SH DESCRIPTION
The display server shall return the coordinates
.RI ( src_x ", " src_y ),
which are given as relative to top left corner
of the window whose ID is specified in the
.I src_window
field, as relative to the top left corner
of the window whose ID is specified in the
.I dest_window
field. That is, if the top left corner of
the window
.I src_window
is
.RI ( x1 ", " y1 )
and the the top left corner of
the window
.I src_window
is
.RI ( x2 ", " y2 ),
then then returned coordinate is
.RI ( dest_x ", " dest_y ),
where
.I dest_x
is
.I src_x-x1+x2
and
.I dest_y
is
.IR src_y-y1+y2 .
.PP
The display server shall also return an
immediate, mapped child window, of the window
whose ID is specified in the
.I dest_window
field, in which the coordinate is contained,
if there is any.
\" TODO Is there a rule for which child?
.PP
The value of the
.I opcode
field shall be
.I LIBAXL_REQUEST_TRANSLATE_COORDINATES
to signify that the request is of the
request described in this document.
.PP
Other fields are filled in automatically by the
.BR libaxl_send_request (3)
function.
.SH ERRORS
.TP
.BR LIBAXL_ERROR_WINDOW (3)
One of the specified window IDs does not exist.
.SH REPLIES
.nf
struct libaxl_reply_translate_coordinates {
        uint8_t         \fI__one\fP;
        libaxl_bool_t   \fIsame_screen\fP;
        uint16_t        \fIsequence_number\fP;
        uint32_t        \fI_reply_length\fP;
        libaxl_window_t \fIchild\fP;
        int16_t         \fIdest_x\fP;
        int16_t         \fIdest_y\fP;
        uint8_t         \fI__unused\fP[16];
};
.fi
.PP
The display server shall, unless it returns an
error, return one
.B "struct libaxl_reply_translate_coordinates"
with the
.I same_screen
field set 1 if both windows in the request
belong to the same screen, and if so also the
.I dest_x
and
.I dest_y
fields set to the resulting coordinates as
described in the
.B DESCRIPTION
section and the
.I child
field set to an immediate, mapped child of the
window whose ID is specified in the
.I dest_window
field in the request, in which the coordinate
is contained, if there is any, or to
.I LIBAXL_NONE
otherwise; but if the windows are not in the same
screen, the
.IR same_screen ,
.IR dest_x ,
and
.I dest y
fields are set to 0, and the
.I child
field is set to
.IR LIBAXL_NONE .
\" TODO The value of the child field here is an assumption
.SH SEE ALSO
.BR libaxl_send_request (3),
.BR libaxl_receive (3),
.BR LIBAXL_REQUEST_INTERN_ATOM (3)