aboutsummaryrefslogtreecommitdiff
path: root/src/move.h
blob: 0922a0786021c5cecb174d86d4cc359e04d710f2 (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
/**
 * @file move.h
 * @author Joe Wingbermuehle
 * @date 2004-2006
 *
 * @brief Header for client window move functions.
 *
 */

#ifndef MOVE_H
#define MOVE_H

struct ClientNode;

/** Window snap modes. */
typedef enum {
	SNAP_NONE                 = 0,  /**< Don't snap. */
	SNAP_SCREEN               = 1,  /**< Snap to the edges of the screen. */
	SNAP_BORDER               = 2   /**< Snap to all borders. */
} SnapModeType;

/** Window move modes. */
typedef enum {
	MOVE_OPAQUE,   /**< Show window contents while moving. */
	MOVE_OUTLINE   /**< Show an outline while moving. */
} MoveModeType;

/** Move a client window.
 * @param np The client to move.
 * @param startx The starting mouse x-coordinate (window relative).
 * @param starty The starting mouse y-coordinate (window relative).
 * @return 1 if the client moved, 0 otherwise.
 */
int MoveClient(struct ClientNode *np, int startx, int starty);

/** Move a client window using the keyboard (mouse optional).
 * @param np The client to move.
 * @return 1 if the client moved, 0 otherwise.
 */
int MoveClientKeyboard(struct ClientNode *np);

/** Set the snap mode to use.
 * @param mode The snap mode to use.
 */
void SetSnapMode(SnapModeType mode);

/** Set the snap distance to use.
 * @param value A string representation of the distance to use.
 */
void SetSnapDistance(const char *value);

/** Set the snap distance to the default. */
void SetDefaultSnapDistance();

/** Set the move mode to use.
 * @param mode The move mode to use.
 */
void SetMoveMode(MoveModeType mode);

/** Make the client return to the screen/tray bounds.
 * @param mode The client node to affect.
 */
void ReturnToBorder(struct ClientNode *np, int north, int west);

#endif