-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcoolwm.h
123 lines (101 loc) · 2.49 KB
/
coolwm.h
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
121
122
123
#ifndef WM_H
#define WM_H
#include <stdlib.h>
#include <X11/Xlib.h>
#include "window_list.h"
#define MOVE_AMOUNT 20
#define FOCUSED_COLOR 0xcfe0fc
#define UNFOCUSED_COLOR 0x103268
#define BORDER_WIDTH 5
#define DEBUG 1
Display * dpy;
Window root;
XWindowAttributes attr;
XEvent ev;
typedef struct {
KeyCode keycode;
char *keystring;
char modstrings[3][2];
unsigned int modmasks;
void (*callback)();
} keybinding;
keybinding keybindings[27];
typedef struct {
window_list *windows;
Window active;
} group;
struct {
group groups[3];
group *current_group;
} context;
void launch_term();
void launch_clock();
void move_window();
void move_left();
void move_right();
void move_up();
void move_down();
void big_move_left();
void big_move_right();
void big_move_up();
void big_move_down();
void resize_window();
void resize_left();
void resize_right();
void resize_up();
void resize_down();
void big_resize_left();
void big_resize_right();
void big_resize_up();
void big_resize_down();
void cycle();
void quit();
void add_to_group();
void hide_group(group *);
void show_group(group *);
void switch_group();
void remove_from_groups(Window);
void draw_border(Window, unsigned int);
void draw_borders(window_list *, unsigned int);
void handle_map(Window);
void handle_destroy(Window);
void handle_enter(Window);
void set_active(Window);
void parse_conf(char *);
void wm_init();
void init_keybindings();
void init_groups();
void wm_event_loop();
static int error_handler(Display *, XErrorEvent *);
void test();
void keycode_callback(KeyCode, unsigned int);
void (*name_to_func(char *))();
struct {
char *name;
void (*func)();
} name_to_funcs[] = {
{"launch_term", &launch_term},
{"launch_clock", &launch_clock},
{"move_down", &move_down},
{"move_up", &move_up},
{"move_left", &move_left},
{"move_right", &move_right},
{"big_move_down", &big_move_down},
{"big_move_up", &big_move_up},
{"big_move_left", &big_move_left},
{"big_move_right", &big_move_right},
{"resize_down", &resize_down},
{"resize_up", &resize_up},
{"resize_left", &resize_left},
{"resize_right", &resize_right},
{"big_resize_down", &big_resize_down},
{"big_resize_up", &big_resize_up},
{"big_resize_left", &big_resize_left},
{"big_resize_right", &big_resize_right},
{"cycle", &cycle},
{"add_to_group", &add_to_group},
{"switch_group", &switch_group},
{"quit", &quit},
{"test", &test}
};
#endif