2010-03-27 10:25:51 -04:00
|
|
|
/*
|
2011-10-25 16:19:38 -04:00
|
|
|
* vim:ts=4:sw=4:expandtab
|
|
|
|
*
|
|
|
|
* i3 - an improved dynamic tiling window manager
|
|
|
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
|
|
|
*
|
2010-03-27 10:25:51 -04:00
|
|
|
* This header file includes all relevant files of i3 and the most often used
|
|
|
|
* system header files. This reduces boilerplate (the amount of code duplicated
|
|
|
|
* at the beginning of each source file) and is not significantly slower at
|
|
|
|
* compile-time.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#ifndef _ALL_H
|
|
|
|
#define _ALL_H
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <locale.h>
|
|
|
|
#include <getopt.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <glob.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <err.h>
|
|
|
|
#include <stdint.h>
|
2010-10-11 15:32:04 -04:00
|
|
|
#include <math.h>
|
2011-08-03 18:10:04 -04:00
|
|
|
#include <limits.h>
|
2010-03-27 10:25:51 -04:00
|
|
|
|
|
|
|
#include <xcb/xcb.h>
|
|
|
|
#include <xcb/xcb_aux.h>
|
|
|
|
#include <xcb/xcb_keysyms.h>
|
|
|
|
#include <xcb/xcb_icccm.h>
|
|
|
|
|
2011-03-18 09:36:36 -04:00
|
|
|
/* Contains compatibility definitions for old libxcb versions */
|
|
|
|
#ifdef XCB_COMPAT
|
|
|
|
#include "xcb_compat.h"
|
|
|
|
#endif
|
|
|
|
|
2011-05-02 17:29:26 -04:00
|
|
|
#include "data.h"
|
2010-03-27 10:25:51 -04:00
|
|
|
#include "util.h"
|
|
|
|
#include "ipc.h"
|
|
|
|
#include "tree.h"
|
|
|
|
#include "log.h"
|
|
|
|
#include "xcb.h"
|
|
|
|
#include "manage.h"
|
|
|
|
#include "workspace.h"
|
|
|
|
#include "i3.h"
|
|
|
|
#include "x.h"
|
|
|
|
#include "click.h"
|
|
|
|
#include "floating.h"
|
|
|
|
#include "config.h"
|
|
|
|
#include "handlers.h"
|
|
|
|
#include "randr.h"
|
|
|
|
#include "xinerama.h"
|
|
|
|
#include "con.h"
|
|
|
|
#include "load_layout.h"
|
|
|
|
#include "render.h"
|
2010-04-13 11:22:34 -04:00
|
|
|
#include "window.h"
|
2010-04-17 11:47:07 -04:00
|
|
|
#include "match.h"
|
2010-07-17 09:15:37 -04:00
|
|
|
#include "cmdparse.h"
|
2010-11-26 18:26:51 -05:00
|
|
|
#include "xcursor.h"
|
2010-11-29 04:56:16 -05:00
|
|
|
#include "resize.h"
|
2010-12-30 15:09:32 -05:00
|
|
|
#include "sighandler.h"
|
2011-02-14 17:05:20 -05:00
|
|
|
#include "move.h"
|
2011-02-20 19:43:39 -05:00
|
|
|
#include "output.h"
|
2011-03-13 20:09:32 -04:00
|
|
|
#include "ewmh.h"
|
2011-05-15 14:10:25 -04:00
|
|
|
#include "assignments.h"
|
2011-09-10 18:53:11 -04:00
|
|
|
#include "regex.h"
|
2011-10-02 11:12:10 -04:00
|
|
|
#include "libi3.h"
|
2011-10-10 06:36:21 -04:00
|
|
|
#include "startup.h"
|
2011-12-21 18:15:32 -05:00
|
|
|
#include "scratchpad.h"
|
2012-01-14 10:02:30 -05:00
|
|
|
#include "commands.h"
|
Implement a new parser for commands. (+test)
On the rationale of using a custom parser instead of a lex/yacc one, see this
quote from src/commands_parser.c:
We use a hand-written parser instead of lex/yacc because our commands are
easy for humans, not for computers. Thus, it’s quite hard to specify a
context-free grammar for the commands. A PEG grammar would be easier, but
there’s downsides to every PEG parser generator I have come accross so far.
This parser is basically a state machine which looks for literals or strings
and can push either on a stack. After identifying a literal or string, it
will either transition to the current state, to a different state, or call a
function (like cmd_move()).
Special care has been taken that error messages are useful and the code is
well testable (when compiled with -DTEST_PARSER it will output to stdout
instead of actually calling any function).
During the migration phase (I plan to completely switch to this parser before
4.2 will be released), the new parser will parse every command you send to
i3 and save the resulting call stack. Then, the old parser will parse your
input and actually execute the commands. Afterwards, both call stacks will be
compared and any differences will be logged.
The new parser works with 100% of the test suite and produces identical call
stacks.
2012-01-14 14:53:29 -05:00
|
|
|
#include "commands_parser.h"
|
2010-03-27 10:25:51 -04:00
|
|
|
|
|
|
|
#endif
|