aboutsummaryrefslogtreecommitdiff
path: root/src/border.h
blob: 052492dfb978d905a846a1f8045ec000b7f4cf16 (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
/**
 * @file border.h
 * @author Joe Wingbermuehle
 * @date 2004-2006
 *
 * @brief Header file for border functions.
 *
 */

#ifndef BORDER_H
#define BORDER_H

struct ClientNode;

/** Flags to determine what action to take on the border. */
typedef enum {
	BA_NONE      = 0,      /**< Do nothing. */
	BA_RESIZE    = 1,      /**< Resize the window. */
	BA_MOVE      = 2,      /**< Move the window. */
	BA_CLOSE     = 3,      /**< Close the window. */
	BA_MAXIMIZE  = 4,      /**< Maximize the window. */
	BA_MINIMIZE  = 5,      /**< Minimize the window. */
	BA_MENU      = 6,      /**< Show the window menu. */
	BA_RESIZE_N  = 0x10,   /**< Resize north. */
	BA_RESIZE_S  = 0x20,   /**< Resize south. */
	BA_RESIZE_E  = 0x40,   /**< Resize east. */
	BA_RESIZE_W  = 0x80    /**< Resize west. */
} BorderActionType;

/** Currently pressed border button. */
BorderActionType PressedBorderButton;

/*@{*/
void InitializeBorders();
void StartupBorders();
void ShutdownBorders();
void DestroyBorders();
/*@}*/

/** Determine the action to take for a client.
 * @param np The client.
 * @param x The x-coordinate of the mouse (frame relative).
 * @param y The y-coordinate of the mouse (frame relative).
 * @return The action to take.
 */
BorderActionType GetBorderActionType(const struct ClientNode *np, int x, int y);

/** Draw a window border.
 * @param np The client whose frame to draw.
 * @param expose The expose event causing the redraw (or NULL).
 */
void DrawBorder(const struct ClientNode *np, const XExposeEvent *expose);

/** Get the size of a border icon.
 * @return The size in pixels (note that icons are square).
 */
int GetBorderIconSize();

/** Get the size of a window border.
 * @param np The client.
 * @param north Pointer to the value to contain the north border size.
 * @param south Pointer to the value to contain the south border size.
 * @param east Pointer to the value to contain the east border size.
 * @param west Pointer to the value to contain the west border size.
 */
void GetBorderSize(const struct ClientNode *np,
	int *north, int *south, int *east, int *west);

/** Set the size of window borders.
 * @param str The size to use in string form.
 */
void SetBorderWidth(const char *str);

/** Set the size of window title bars.
 * @param str The size to use in string form.
 */
void SetTitleHeight(const char *str);

/** Redraw all borders on the current desktop. */
void ExposeCurrentDesktop();

#endif