wmaker: Improve drag-nd-drop support
[wmaker-crm.git] / src / xdnd.h
blobbaaf92ff165aac02f1a1d5bbb1ed96663eb9519e
1 /*
2 * Window Maker window manager
4 * Copyright (c) 1997-2003 Alfredo K. Kojima
5 * Copyright (c) 2014 Window Maker Team
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation
21 #ifndef _XDND_H_
22 #define _XDND_H_
24 void wXDNDInitializeAtoms(void);
25 Bool wXDNDProcessSelection(XEvent *event);
26 Bool wXDNDProcessClientMessage(XClientMessageEvent *event);
27 void wXDNDMakeAwareness(Window window);
29 #define XDND_VERSION 3L
31 #define XDND_ENTER_SOURCE_WIN(e) ((e)->data.l[0])
32 #define XDND_ENTER_THREE_TYPES(e) (((e)->data.l[1] & 0x1UL) == 0)
33 #define XDND_ENTER_TYPE(e, i) ((e)->data.l[2 + i]) /* i => (0, 1, 2) */
35 /* XdndPosition */
36 #define XDND_POSITION_SOURCE_WIN(e) ((e)->data.l[0])
38 /* XdndStatus */
39 #define XDND_STATUS_TARGET_WIN(e) ((e)->xclient.data.l[0])
40 #define XDND_STATUS_WILL_ACCEPT_SET(e, b) (e)->xclient.data.l[1] = ((e)->xclient.data.l[1] & ~0x1UL) | (((b) == 0) ? 0 : 0x1UL)
41 #define XDND_STATUS_WANT_POSITION_SET(e, b) (e)->xclient.data.l[1] = ((e)->xclient.data.l[1] & ~0x2UL) | (((b) == 0) ? 0 : 0x2UL)
42 #define XDND_STATUS_RECT_SET(e, x, y, w, h) {(e)->xclient.data.l[2] = ((x) << 16) | ((y) & 0xFFFFUL); (e)->xclient.data.l[3] = ((w) << 16) | ((h) & 0xFFFFUL); }
43 #define XDND_STATUS_ACTION(e) ((e)->xclient.data.l[4])
45 /* XdndDrop */
46 #define XDND_DROP_SOURCE_WIN(e) ((e)->data.l[0])
48 /* XdndFinished */
49 #define XDND_FINISHED_TARGET_WIN(e) ((e)->xclient.data.l[0])
51 #endif