i3
drag.h
Go to the documentation of this file.
1/*
2 * vim:ts=4:sw=4:expandtab
3 *
4 * i3 - an improved tiling window manager
5 * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
6 *
7 * drag.c: click and drag.
8 *
9 */
10#pragma once
11
12#include <config.h>
13
15typedef void (*callback_t)(Con *, Rect *, uint32_t, uint32_t,
16 const xcb_button_press_event_t *, const void *);
17
19#define DRAGGING_CB(name) \
20 static void name(Con *con, Rect *old_rect, uint32_t new_x, uint32_t new_y, \
21 const xcb_button_press_event_t *event, const void *extra)
22
45
58drag_result_t drag_pointer(Con *con, const xcb_button_press_event_t *event,
59 xcb_window_t confine_to, int cursor,
60 bool use_threshold, callback_t callback,
61 const void *extra);
void(* callback_t)(Con *, Rect *, uint32_t, uint32_t, const xcb_button_press_event_t *, const void *)
Callback for dragging.
Definition drag.h:15
drag_result_t
This is the return value of a drag operation like drag_pointer.
Definition drag.h:39
@ DRAG_SUCCESS
Definition drag.h:41
@ DRAG_ABORT
Definition drag.h:43
@ DRAGGING
Definition drag.h:40
@ DRAG_REVERT
Definition drag.h:42
drag_result_t drag_pointer(Con *con, const xcb_button_press_event_t *event, xcb_window_t confine_to, int cursor, bool use_threshold, callback_t callback, const void *extra)
This function grabs your pointer and keyboard and lets you drag stuff around (borders).
Definition drag.c:176
Stores a rectangle, for example the size of a window, the child window etc.
Definition data.h:185
A 'Con' represents everything from the X11 root window down to a single X11 window.
Definition data.h:643