2010-03-27 15:25:51 +01:00
|
|
|
/*
|
2011-10-25 22:19:38 +02: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 15:25:51 +01: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 21:32:04 +02:00
|
|
|
#include <math.h>
|
2011-08-04 00:10:04 +02:00
|
|
|
#include <limits.h>
|
2010-03-27 15:25:51 +01:00
|
|
|
|
|
|
|
#include <xcb/xcb.h>
|
|
|
|
#include <xcb/xcb_aux.h>
|
|
|
|
#include <xcb/xcb_keysyms.h>
|
|
|
|
#include <xcb/xcb_icccm.h>
|
|
|
|
|
2011-03-18 14:36:36 +01:00
|
|
|
/* Contains compatibility definitions for old libxcb versions */
|
|
|
|
#ifdef XCB_COMPAT
|
|
|
|
#include "xcb_compat.h"
|
|
|
|
#endif
|
|
|
|
|
2011-05-02 23:29:26 +02:00
|
|
|
#include "data.h"
|
2010-03-27 15:25:51 +01: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 17:22:34 +02:00
|
|
|
#include "window.h"
|
2010-04-17 17:47:07 +02:00
|
|
|
#include "match.h"
|
2010-07-17 15:15:37 +02:00
|
|
|
#include "cmdparse.h"
|
2010-11-27 00:26:51 +01:00
|
|
|
#include "xcursor.h"
|
2010-11-29 10:56:16 +01:00
|
|
|
#include "resize.h"
|
2010-12-30 21:09:32 +01:00
|
|
|
#include "sighandler.h"
|
2011-02-14 23:05:20 +01:00
|
|
|
#include "move.h"
|
2011-02-21 01:43:39 +01:00
|
|
|
#include "output.h"
|
2011-03-14 01:09:32 +01:00
|
|
|
#include "ewmh.h"
|
2011-05-15 20:10:25 +02:00
|
|
|
#include "assignments.h"
|
2011-09-11 00:53:11 +02:00
|
|
|
#include "regex.h"
|
2011-10-02 17:12:10 +02:00
|
|
|
#include "libi3.h"
|
2011-10-10 12:36:21 +02:00
|
|
|
#include "startup.h"
|
2011-12-22 00:15:32 +01:00
|
|
|
#include "scratchpad.h"
|
2012-01-14 16:02:30 +01: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 20:53:29 +01:00
|
|
|
#include "commands_parser.h"
|
2010-03-27 15:25:51 +01:00
|
|
|
|
|
|
|
#endif
|