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
|
2015-04-04 02:17:56 +02:00
|
|
|
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
|
2011-10-25 22:19:38 +02:00
|
|
|
*
|
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.
|
|
|
|
*
|
|
|
|
*/
|
2016-10-11 09:13:35 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <config.h>
|
2010-03-27 15:25:51 +01:00
|
|
|
|
|
|
|
#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>
|
2017-09-30 19:16:21 +02:00
|
|
|
#include <inttypes.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>
|
|
|
|
|
2012-05-02 22:01:50 +02:00
|
|
|
#include <yajl/yajl_gen.h>
|
|
|
|
#include <yajl/yajl_version.h>
|
|
|
|
|
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"
|
2012-08-02 17:43:00 +02:00
|
|
|
#include "key_press.h"
|
2010-03-27 15:25:51 +01:00
|
|
|
#include "floating.h"
|
2018-12-12 05:01:36 +01:00
|
|
|
#include "drag.h"
|
2016-10-07 13:33:58 +02:00
|
|
|
#include "configuration.h"
|
2010-03-27 15:25:51 +01:00
|
|
|
#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"
|
2014-01-28 04:45:01 +01:00
|
|
|
#include "bindings.h"
|
2012-10-07 16:32:50 +02:00
|
|
|
#include "config_directives.h"
|
2012-10-08 13:26:42 +02:00
|
|
|
#include "config_parser.h"
|
2012-04-09 14:27:33 +02:00
|
|
|
#include "fake_outputs.h"
|
2012-08-12 15:10:13 +02:00
|
|
|
#include "display_version.h"
|
2013-12-14 22:49:33 +01:00
|
|
|
#include "restore_layout.h"
|
2018-03-30 21:05:32 +02:00
|
|
|
#include "sync.h"
|
2013-12-15 17:30:06 +01:00
|
|
|
#include "main.h"
|