2 * Copyright (c) 2020 Omar Polo <op@omarpolo.com>
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 #ifndef STAR_PLATINUM_H
18 #define STAR_PLATINUM_H
20 /* XXX: why I need to define this to get XK_space/...?
21 * is this a bad idea? there is another way? */
30 void yyerror(const char*, ...);
33 unsigned int modifier;
53 void do_action(struct action, Window, XKeyEvent*);
54 void free_action(struct action);
64 struct match *new_match(int, char*);
65 void recfree_match(struct match*);
66 int match_window(struct match*, Window);
74 struct rule *new_rule(struct key, struct action);
75 void recfree_rule(struct rule*);
76 int rule_matched(struct rule*, struct key);
79 struct match *matches;
84 extern struct group *config;
86 struct group *new_group(struct match*, struct rule*);
87 void recfree_group(struct group*);
88 void process_event(struct group*, XKeyEvent*);
89 int group_match(struct group*, Window);
92 int error_handler(Display*, XErrorEvent*);
93 void grabkey(struct key, Window);
94 void grab_matching_keys(Window);
95 int grabkey_matching_windows();
96 KeySym keycode_to_keysym(unsigned int);
97 Window focused_window();
98 void send_fake(Window, struct key, XKeyEvent*);
99 int window_match_class(Window, const char*);
102 void printkey(struct key);
103 void printaction(struct action);
104 void printmatch(struct match*);
105 void printrule(struct rule*);
106 void printgroup(struct group*);
108 #endif /* STAR_PLATINUM_H */