Ensure all *.[ch] files include config.h
Including config.h is necessary to get e.g. the _GNU_SOURCE define and
any other definitions that autoconf declares. Hence, config.h needs to
be included as the first header in each file.
This is done either via:
1. Including "common.h" (i3bar)
2. Including "libi3.h"
3. Including "all.h" (i3)
4. Including <config.h> directly
Also remove now-unused I3__FILE__, add copyright/license statement
where missing and switch include/all.h to #pragma once.
Michael Stapelberg
7 years ago
7 | 7 |
* keysyms.
|
8 | 8 |
*
|
9 | 9 |
*/
|
|
10 |
#include <config.h>
|
|
11 |
|
10 | 12 |
#if defined(__FreeBSD__)
|
11 | 13 |
#include <sys/param.h>
|
12 | 14 |
#endif
|
6 | 6 |
* i3-dump-log/main.c: Dumps the i3 SHM log to stdout.
|
7 | 7 |
*
|
8 | 8 |
*/
|
|
9 |
#include <config.h>
|
|
10 |
|
9 | 11 |
#include <stdio.h>
|
10 | 12 |
#include <stdbool.h>
|
11 | 13 |
#include <sys/types.h>
|
0 | 0 |
#pragma once
|
|
1 |
|
|
2 |
#include <config.h>
|
1 | 3 |
|
2 | 4 |
#include <err.h>
|
3 | 5 |
|
7 | 7 |
* to i3.
|
8 | 8 |
*
|
9 | 9 |
*/
|
|
10 |
#include "libi3.h"
|
|
11 |
|
10 | 12 |
#include <stdio.h>
|
11 | 13 |
#include <sys/types.h>
|
12 | 14 |
#include <stdlib.h>
|
|
29 | 31 |
#include "keysym2ucs.h"
|
30 | 32 |
|
31 | 33 |
#include "i3-input.h"
|
32 | |
|
33 | |
#include "libi3.h"
|
34 | 34 |
|
35 | 35 |
/* IPC format string. %s will be replaced with what the user entered, then
|
36 | 36 |
* the command will be sent to i3 */
|
13 | 13 |
* Additionally, it’s even useful sometimes :-).
|
14 | 14 |
*
|
15 | 15 |
*/
|
|
16 |
#include "libi3.h"
|
|
17 |
|
16 | 18 |
#include <stdio.h>
|
17 | 19 |
#include <stdbool.h>
|
18 | 20 |
#include <sys/types.h>
|
|
33 | 35 |
#include <xcb/xcb.h>
|
34 | 36 |
#include <xcb/xcb_aux.h>
|
35 | 37 |
|
36 | |
#include "libi3.h"
|
37 | 38 |
#include <i3/ipc.h>
|
38 | 39 |
|
39 | 40 |
static char *socket_path;
|
0 | 0 |
#pragma once
|
|
1 |
|
|
2 |
#include <config.h>
|
1 | 3 |
|
2 | 4 |
#include <err.h>
|
3 | 5 |
|
7 | 7 |
* when the user has an error in their configuration file.
|
8 | 8 |
*
|
9 | 9 |
*/
|
|
10 |
#include "libi3.h"
|
|
11 |
|
10 | 12 |
#include <stdio.h>
|
11 | 13 |
#include <sys/types.h>
|
12 | 14 |
#include <sys/stat.h>
|
|
29 | 31 |
#include <xcb/randr.h>
|
30 | 32 |
#include <xcb/xcb_cursor.h>
|
31 | 33 |
|
32 | |
#include "libi3.h"
|
33 | 34 |
#include "i3-nagbar.h"
|
34 | 35 |
|
35 | 36 |
/** This is the equivalent of XC_left_ptr. I’m not sure why xcb doesn’t have a
|
5 | 5 |
*
|
6 | 6 |
*/
|
7 | 7 |
#pragma once
|
|
8 |
|
|
9 |
#include <config.h>
|
8 | 10 |
|
9 | 11 |
#include <stdbool.h>
|
10 | 12 |
#include <xcb/xcb.h>
|
7 | 7 |
*
|
8 | 8 |
*/
|
9 | 9 |
#pragma once
|
|
10 |
|
|
11 |
#include <config.h>
|
10 | 12 |
|
11 | 13 |
#include <xcb/xcb.h>
|
12 | 14 |
#include <cairo/cairo-xcb.h>
|
7 | 7 |
*
|
8 | 8 |
*/
|
9 | 9 |
#pragma once
|
|
10 |
|
|
11 |
#include <config.h>
|
10 | 12 |
|
11 | 13 |
#include <stdint.h>
|
12 | 14 |
//#include "outputs.h"
|
6 | 6 |
* child.c: Getting input for the statusline
|
7 | 7 |
*
|
8 | 8 |
*/
|
|
9 |
#include "common.h"
|
|
10 |
|
9 | 11 |
#include <stdlib.h>
|
10 | 12 |
#include <unistd.h>
|
11 | 13 |
#include <sys/types.h>
|
|
23 | 25 |
#include <yajl/yajl_version.h>
|
24 | 26 |
#include <yajl/yajl_gen.h>
|
25 | 27 |
#include <paths.h>
|
26 | |
|
27 | |
#include "common.h"
|
28 | 28 |
|
29 | 29 |
/* Global variables for child_*() */
|
30 | 30 |
i3bar_child child;
|
6 | 6 |
* config.c: Parses the configuration (received from i3).
|
7 | 7 |
*
|
8 | 8 |
*/
|
|
9 |
#include "common.h"
|
|
10 |
|
9 | 11 |
#include <string.h>
|
10 | 12 |
#include <stdlib.h>
|
11 | 13 |
#include <stdio.h>
|
|
15 | 17 |
#include <yajl/yajl_version.h>
|
16 | 18 |
|
17 | 19 |
#include <X11/Xlib.h>
|
18 | |
|
19 | |
#include "common.h"
|
20 | 20 |
|
21 | 21 |
static char *cur_key;
|
22 | 22 |
static bool parsing_bindings;
|
6 | 6 |
* ipc.c: Communicating with i3
|
7 | 7 |
*
|
8 | 8 |
*/
|
|
9 |
#include "common.h"
|
|
10 |
|
9 | 11 |
#include <stdlib.h>
|
10 | 12 |
#include <stdio.h>
|
11 | 13 |
#include <unistd.h>
|
|
19 | 21 |
#ifdef I3_ASAN_ENABLED
|
20 | 22 |
#include <sanitizer/lsan_interface.h>
|
21 | 23 |
#endif
|
22 | |
|
23 | |
#include "common.h"
|
24 | 24 |
|
25 | 25 |
ev_io *i3_connection;
|
26 | 26 |
|
4 | 4 |
* © 2010 Axel Wagner and contributors (see also: LICENSE)
|
5 | 5 |
*
|
6 | 6 |
*/
|
|
7 |
#include "common.h"
|
|
8 |
|
7 | 9 |
#include <stdio.h>
|
8 | 10 |
#include <i3/ipc.h>
|
9 | 11 |
#include <string.h>
|
|
13 | 15 |
#include <ev.h>
|
14 | 16 |
#include <getopt.h>
|
15 | 17 |
#include <glob.h>
|
16 | |
|
17 | |
#include "common.h"
|
18 | 18 |
|
19 | 19 |
/*
|
20 | 20 |
* Having verboselog(), errorlog() and debuglog() is necessary when using libi3.
|
6 | 6 |
* mode.c: Handle mode event and show current binding mode in the bar
|
7 | 7 |
*
|
8 | 8 |
*/
|
|
9 |
#include "common.h"
|
|
10 |
|
9 | 11 |
#include <string.h>
|
10 | 12 |
#include <stdlib.h>
|
11 | 13 |
#include <stdio.h>
|
12 | 14 |
#include <errno.h>
|
13 | 15 |
#include <yajl/yajl_parse.h>
|
14 | 16 |
#include <yajl/yajl_version.h>
|
15 | |
|
16 | |
#include "common.h"
|
17 | 17 |
|
18 | 18 |
/* A datatype to pass through the callbacks to save the state */
|
19 | 19 |
struct mode_json_params {
|
6 | 6 |
* outputs.c: Maintaining the outputs list
|
7 | 7 |
*
|
8 | 8 |
*/
|
|
9 |
#include "common.h"
|
|
10 |
|
9 | 11 |
#include <string.h>
|
10 | 12 |
#include <stdlib.h>
|
11 | 13 |
#include <stdio.h>
|
|
13 | 15 |
#include <i3/ipc.h>
|
14 | 16 |
#include <yajl/yajl_parse.h>
|
15 | 17 |
#include <yajl/yajl_version.h>
|
16 | |
|
17 | |
#include "common.h"
|
18 | 18 |
|
19 | 19 |
/* A datatype to pass through the callbacks to save the state */
|
20 | 20 |
struct outputs_json_params {
|
7 | 7 |
* protocol version and features.
|
8 | 8 |
*
|
9 | 9 |
*/
|
|
10 |
#include "common.h"
|
|
11 |
|
10 | 12 |
#include <stdlib.h>
|
11 | 13 |
#include <unistd.h>
|
12 | 14 |
#include <sys/types.h>
|
|
23 | 25 |
#include <yajl/yajl_common.h>
|
24 | 26 |
#include <yajl/yajl_parse.h>
|
25 | 27 |
#include <yajl/yajl_version.h>
|
26 | |
|
27 | |
#include "common.h"
|
28 | 28 |
|
29 | 29 |
static enum {
|
30 | 30 |
KEY_VERSION,
|
6 | 6 |
* workspaces.c: Maintaining the workspace lists
|
7 | 7 |
*
|
8 | 8 |
*/
|
|
9 |
#include "common.h"
|
|
10 |
|
9 | 11 |
#include <string.h>
|
10 | 12 |
#include <stdlib.h>
|
11 | 13 |
#include <stdio.h>
|
12 | 14 |
#include <errno.h>
|
13 | 15 |
#include <yajl/yajl_parse.h>
|
14 | 16 |
#include <yajl/yajl_version.h>
|
15 | |
|
16 | |
#include "common.h"
|
17 | 17 |
|
18 | 18 |
/* A datatype to pass through the callbacks to save the state */
|
19 | 19 |
struct workspaces_json_params {
|
6 | 6 |
* xcb.c: Communicating with X
|
7 | 7 |
*
|
8 | 8 |
*/
|
|
9 |
#include "common.h"
|
|
10 |
|
9 | 11 |
#include <xcb/xcb.h>
|
10 | 12 |
#include <xcb/xkb.h>
|
11 | 13 |
#include <xcb/xproto.h>
|
|
31 | 33 |
#include <sanitizer/lsan_interface.h>
|
32 | 34 |
#endif
|
33 | 35 |
|
34 | |
#include "common.h"
|
35 | 36 |
#include "libi3.h"
|
36 | 37 |
|
37 | 38 |
/** This is the equivalent of XC_left_ptr. I’m not sure why xcb doesn’t have a
|
9 | 9 |
* compile-time.
|
10 | 10 |
*
|
11 | 11 |
*/
|
12 | |
#ifndef I3_ALL_H
|
13 | |
#define I3_ALL_H
|
|
12 |
#pragma once
|
|
13 |
|
|
14 |
#include <config.h>
|
14 | 15 |
|
15 | 16 |
#include <assert.h>
|
16 | 17 |
#include <stdbool.h>
|
|
80 | 81 |
#include "display_version.h"
|
81 | 82 |
#include "restore_layout.h"
|
82 | 83 |
#include "main.h"
|
83 | |
|
84 | |
#endif
|
7 | 7 |
*
|
8 | 8 |
*/
|
9 | 9 |
#pragma once
|
|
10 |
|
|
11 |
#include <config.h>
|
10 | 12 |
|
11 | 13 |
/**
|
12 | 14 |
* Checks the list of assignments for the given window and runs all matching
|
8 | 8 |
*/
|
9 | 9 |
#pragma once
|
10 | 10 |
|
|
11 |
#include <config.h>
|
|
12 |
|
11 | 13 |
/**
|
12 | 14 |
* The button press X callback. This function determines whether the floating
|
13 | 15 |
* modifier is pressed and where the user clicked (decoration, border, inside
|
8 | 8 |
*/
|
9 | 9 |
#pragma once
|
10 | 10 |
|
|
11 |
#include <config.h>
|
|
12 |
|
11 | 13 |
char *parse_cmd(const char *new);
|
8 | 8 |
*/
|
9 | 9 |
#pragma once
|
10 | 10 |
|
|
11 |
#include <config.h>
|
|
12 |
|
11 | 13 |
#include "commands_parser.h"
|
12 | 14 |
|
13 | 15 |
/** The beginning of the prototype for every cmd_ function. */
|
9 | 9 |
*
|
10 | 10 |
*/
|
11 | 11 |
#pragma once
|
|
12 |
|
|
13 |
#include <config.h>
|
12 | 14 |
|
13 | 15 |
/**
|
14 | 16 |
* Create a new container (and attach it to the given parent, if not NULL).
|
11 | 11 |
*/
|
12 | 12 |
#pragma once
|
13 | 13 |
|
|
14 |
#include "libi3.h"
|
|
15 |
|
14 | 16 |
#include <stdbool.h>
|
15 | 17 |
#include "queue.h"
|
16 | 18 |
#include "i3.h"
|
17 | |
#include "libi3.h"
|
18 | 19 |
|
19 | 20 |
typedef struct Config Config;
|
20 | 21 |
typedef struct Barconfig Barconfig;
|
7 | 7 |
*
|
8 | 8 |
*/
|
9 | 9 |
#pragma once
|
|
10 |
|
|
11 |
#include "libi3.h"
|
10 | 12 |
|
11 | 13 |
#define SN_API_NOT_YET_FROZEN 1
|
12 | 14 |
#include <libsn/sn-launcher.h>
|
|
16 | 18 |
#include <pcre.h>
|
17 | 19 |
#include <sys/time.h>
|
18 | 20 |
|
19 | |
#include "libi3.h"
|
20 | 21 |
#include "queue.h"
|
21 | 22 |
|
22 | 23 |
/*
|
9 | 9 |
*/
|
10 | 10 |
#pragma once
|
11 | 11 |
|
|
12 |
#include <config.h>
|
|
13 |
|
12 | 14 |
int handle_event(void *ignored, xcb_connection_t *c, xcb_generic_event_t *e);
|
7 | 7 |
* i3 --moreversion.
|
8 | 8 |
*/
|
9 | 9 |
#pragma once
|
|
10 |
|
|
11 |
#include <config.h>
|
10 | 12 |
|
11 | 13 |
/**
|
12 | 14 |
* Connects to i3 to find out the currently running version. Useful since it
|
7 | 7 |
*
|
8 | 8 |
*/
|
9 | 9 |
#pragma once
|
|
10 |
|
|
11 |
#include <config.h>
|
10 | 12 |
|
11 | 13 |
/**
|
12 | 14 |
* Updates _NET_CURRENT_DESKTOP with the current desktop number.
|
9 | 9 |
*/
|
10 | 10 |
#pragma once
|
11 | 11 |
|
|
12 |
#include <config.h>
|
|
13 |
|
12 | 14 |
/**
|
13 | 15 |
* Creates outputs according to the given specification.
|
14 | 16 |
* The specification must be in the format wxh+x+y, for example 1024x768+0+0,
|
7 | 7 |
*
|
8 | 8 |
*/
|
9 | 9 |
#pragma once
|
|
10 |
|
|
11 |
#include <config.h>
|
10 | 12 |
|
11 | 13 |
#include <sys/time.h>
|
12 | 14 |
#include <sys/resource.h>
|
7 | 7 |
*
|
8 | 8 |
*/
|
9 | 9 |
#pragma once
|
|
10 |
|
|
11 |
#include <config.h>
|
10 | 12 |
|
11 | 13 |
/**
|
12 | 14 |
* There was a key press. We compare this key code with our bindings table and pass
|
8 | 8 |
*
|
9 | 9 |
*/
|
10 | 10 |
#pragma once
|
|
11 |
|
|
12 |
#include <config.h>
|
11 | 13 |
|
12 | 14 |
typedef enum {
|
13 | 15 |
// We could not determine the content of the JSON file. This typically
|
8 | 8 |
*/
|
9 | 9 |
#pragma once
|
10 | 10 |
|
|
11 |
#include <config.h>
|
|
12 |
|
11 | 13 |
/**
|
12 | 14 |
* Enable or disable the main X11 event handling function.
|
13 | 15 |
* This is used by drag_pointer() which has its own, modal event handler, which
|
11 | 11 |
*
|
12 | 12 |
*/
|
13 | 13 |
#pragma once
|
|
14 |
|
|
15 |
#include <config.h>
|
14 | 16 |
|
15 | 17 |
/*
|
16 | 18 |
* Initializes the Match data structure. This function is necessary because the
|
8 | 8 |
*/
|
9 | 9 |
#pragma once
|
10 | 10 |
|
|
11 |
#include <config.h>
|
|
12 |
|
11 | 13 |
/**
|
12 | 14 |
* Moves the given container in the given direction (TOK_LEFT, TOK_RIGHT,
|
13 | 15 |
* TOK_UP, TOK_DOWN from cmdparse.l)
|
7 | 7 |
*
|
8 | 8 |
*/
|
9 | 9 |
#pragma once
|
|
10 |
|
|
11 |
#include <config.h>
|
10 | 12 |
|
11 | 13 |
/**
|
12 | 14 |
* Returns the output container below the given output container.
|
7 | 7 |
*
|
8 | 8 |
*/
|
9 | 9 |
#pragma once
|
|
10 |
|
|
11 |
#include <config.h>
|
10 | 12 |
|
11 | 13 |
/**
|
12 | 14 |
* Creates a new 'regex' struct containing the given pattern and a PCRE
|
8 | 8 |
*
|
9 | 9 |
*/
|
10 | 10 |
#pragma once
|
|
11 |
|
|
12 |
#include <config.h>
|
11 | 13 |
|
12 | 14 |
/* This is used to keep a state to pass around when rendering a con in render_con(). */
|
13 | 15 |
typedef struct render_params {
|
8 | 8 |
*/
|
9 | 9 |
#pragma once
|
10 | 10 |
|
|
11 |
#include <config.h>
|
|
12 |
|
11 | 13 |
bool resize_find_tiling_participants(Con **current, Con **other, direction_t direction);
|
12 | 14 |
|
13 | 15 |
int resize_graphical_handler(Con *first, Con *second, orientation_t orientation, const xcb_button_press_event_t *event);
|
8 | 8 |
*
|
9 | 9 |
*/
|
10 | 10 |
#pragma once
|
|
11 |
|
|
12 |
#include <config.h>
|
11 | 13 |
|
12 | 14 |
/**
|
13 | 15 |
* Opens a separate connection to X11 for placeholder windows when restoring
|
7 | 7 |
*
|
8 | 8 |
*/
|
9 | 9 |
#pragma once
|
|
10 |
|
|
11 |
#include <config.h>
|
10 | 12 |
|
11 | 13 |
/**
|
12 | 14 |
* Moves the specified window to the __i3_scratch workspace, making it floating
|
7 | 7 |
*
|
8 | 8 |
*/
|
9 | 9 |
#pragma once
|
|
10 |
|
|
11 |
#include <config.h>
|
10 | 12 |
|
11 | 13 |
extern Con *croot;
|
12 | 14 |
/* TODO: i am not sure yet how much access to the focused container should
|
7 | 7 |
*
|
8 | 8 |
*/
|
9 | 9 |
#pragma once
|
|
10 |
|
|
11 |
#include <config.h>
|
10 | 12 |
|
11 | 13 |
/**
|
12 | 14 |
* Frees an i3Window and all its members.
|
8 | 8 |
*
|
9 | 9 |
*/
|
10 | 10 |
#pragma once
|
|
11 |
|
|
12 |
#include <config.h>
|
11 | 13 |
|
12 | 14 |
/** Stores the X11 window ID of the currently focused window */
|
13 | 15 |
extern xcb_window_t focused_id;
|
7 | 7 |
*
|
8 | 8 |
*/
|
9 | 9 |
#pragma once
|
|
10 |
|
|
11 |
#include <config.h>
|
10 | 12 |
|
11 | 13 |
#include <yajl/yajl_gen.h>
|
12 | 14 |
#include <yajl/yajl_parse.h>
|
5 | 5 |
*
|
6 | 6 |
*/
|
7 | 7 |
#include "libi3.h"
|
|
8 |
|
8 | 9 |
#include <math.h>
|
9 | 10 |
#include <stdlib.h>
|
10 | 11 |
#include <xcb/xcb_xrm.h>
|
5 | 5 |
* draw.c: Utility for drawing.
|
6 | 6 |
*
|
7 | 7 |
*/
|
|
8 |
#include "libi3.h"
|
|
9 |
|
8 | 10 |
#include <stdlib.h>
|
9 | 11 |
#include <err.h>
|
10 | 12 |
#include <string.h>
|
11 | 13 |
#include <xcb/xcb.h>
|
12 | 14 |
#include <xcb/xcb_aux.h>
|
13 | 15 |
#include <cairo/cairo-xcb.h>
|
14 | |
|
15 | |
#include "libi3.h"
|
16 | 16 |
|
17 | 17 |
/* The default visual_type to use if none is specified when creating the surface. Must be defined globally. */
|
18 | 18 |
xcb_visualtype_t *visual_type;
|
4 | 4 |
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
|
5 | 5 |
*
|
6 | 6 |
*/
|
|
7 |
#include "libi3.h"
|
|
8 |
|
7 | 9 |
#include <stdlib.h>
|
8 | 10 |
#include <stdbool.h>
|
9 | 11 |
|
10 | 12 |
#include <xcb/xcb.h>
|
11 | 13 |
#include <xcb/xproto.h>
|
12 | |
|
13 | |
#include "libi3.h"
|
14 | 14 |
|
15 | 15 |
/*
|
16 | 16 |
* Generates a configure_notify event and sends it to the given window
|
4 | 4 |
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
|
5 | 5 |
*
|
6 | 6 |
*/
|
|
7 |
#include "libi3.h"
|
|
8 |
|
7 | 9 |
#include <assert.h>
|
8 | 10 |
#include <stdint.h>
|
9 | 11 |
#include <stdlib.h>
|
|
13 | 15 |
|
14 | 16 |
#include <cairo/cairo-xcb.h>
|
15 | 17 |
#include <pango/pangocairo.h>
|
16 | |
|
17 | |
#include "libi3.h"
|
18 | 18 |
|
19 | 19 |
static const i3Font *savedFont = NULL;
|
20 | 20 |
|
4 | 4 |
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
|
5 | 5 |
*
|
6 | 6 |
*/
|
|
7 |
#include "libi3.h"
|
|
8 |
|
7 | 9 |
#include <stdlib.h>
|
8 | 10 |
#include <stdint.h>
|
9 | 11 |
#include <string.h>
|
10 | |
|
11 | |
#include "libi3.h"
|
12 | 12 |
|
13 | 13 |
#ifndef STARTS_WITH
|
14 | 14 |
#define STARTS_WITH(string, needle) (strncasecmp((string), (needle), strlen((needle))) == 0)
|
4 | 4 |
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
|
5 | 5 |
*
|
6 | 6 |
*/
|
|
7 |
#include "libi3.h"
|
|
8 |
|
7 | 9 |
#include <stdlib.h>
|
8 | 10 |
#include <stdint.h>
|
9 | 11 |
#include <string.h>
|
10 | 12 |
|
11 | 13 |
#include "queue.h"
|
12 | |
#include "libi3.h"
|
13 | |
|
14 | 14 |
struct Colorpixel {
|
15 | 15 |
char hex[8];
|
16 | 16 |
uint32_t pixel;
|
5 | 5 |
*
|
6 | 6 |
*/
|
7 | 7 |
#include "libi3.h"
|
|
8 |
|
8 | 9 |
#include <stdlib.h>
|
9 | 10 |
#include <string.h>
|
10 | 11 |
#include <sys/stat.h>
|
|
0 |
/*
|
|
1 |
* vim:ts=4:sw=4:expandtab
|
|
2 |
*
|
|
3 |
* i3 - an improved dynamic tiling window manager
|
|
4 |
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
|
|
5 |
*
|
|
6 |
*/
|
|
7 |
#include "libi3.h"
|
|
8 |
|
0 | 9 |
#include <unistd.h>
|
1 | 10 |
#include <string.h>
|
2 | 11 |
#include <stdio.h>
|
3 | 12 |
#include <limits.h>
|
4 | 13 |
#include <stdlib.h>
|
5 | 14 |
#include <errno.h>
|
6 | |
|
7 | |
#include "libi3.h"
|
8 | 15 |
|
9 | 16 |
/*
|
10 | 17 |
* This function returns the absolute path to the executable it is running in.
|
4 | 4 |
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
|
5 | 5 |
*
|
6 | 6 |
*/
|
|
7 |
#include "libi3.h"
|
|
8 |
|
7 | 9 |
#include <stdint.h>
|
8 | 10 |
#include <stdlib.h>
|
9 | 11 |
#include <xcb/xcb.h>
|
10 | 12 |
#include <xcb/xcb_keysyms.h>
|
11 | |
|
12 | |
#include "libi3.h"
|
13 | 13 |
|
14 | 14 |
/*
|
15 | 15 |
* All-in-one function which returns the modifier mask (XCB_MOD_MASK_*) for the
|
4 | 4 |
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
|
5 | 5 |
*
|
6 | 6 |
*/
|
|
7 |
#include "libi3.h"
|
|
8 |
|
7 | 9 |
#include <assert.h>
|
8 | 10 |
#include <stdint.h>
|
9 | 11 |
#include <stdlib.h>
|
|
15 | 17 |
#include <pwd.h>
|
16 | 18 |
#include <unistd.h>
|
17 | 19 |
#include <err.h>
|
18 | |
|
19 | |
#include "libi3.h"
|
20 | 20 |
|
21 | 21 |
/*
|
22 | 22 |
* Returns the name of a temporary file with the specified prefix.
|
4 | 4 |
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
|
5 | 5 |
*
|
6 | 6 |
*/
|
|
7 |
#include "libi3.h"
|
|
8 |
|
7 | 9 |
#include <sys/types.h>
|
8 | 10 |
#include <sys/socket.h>
|
9 | 11 |
#include <sys/un.h>
|
|
12 | 14 |
#include <stdlib.h>
|
13 | 15 |
#include <unistd.h>
|
14 | 16 |
#include <fcntl.h>
|
15 | |
|
16 | |
#include "libi3.h"
|
17 | 17 |
|
18 | 18 |
/*
|
19 | 19 |
* Connects to the i3 IPC socket and returns the file descriptor for the
|
4 | 4 |
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
|
5 | 5 |
*
|
6 | 6 |
*/
|
|
7 |
#include "libi3.h"
|
|
8 |
|
7 | 9 |
#include <string.h>
|
8 | 10 |
#include <stdlib.h>
|
9 | 11 |
#include <stdio.h>
|
|
12 | 14 |
#include <errno.h>
|
13 | 15 |
|
14 | 16 |
#include <i3/ipc.h>
|
15 | |
|
16 | |
#include "libi3.h"
|
17 | 17 |
|
18 | 18 |
/*
|
19 | 19 |
* Reads a message from the given socket file descriptor and stores its length
|
4 | 4 |
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
|
5 | 5 |
*
|
6 | 6 |
*/
|
|
7 |
#include "libi3.h"
|
|
8 |
|
7 | 9 |
#include <string.h>
|
8 | 10 |
#include <stdlib.h>
|
9 | 11 |
#include <unistd.h>
|
|
12 | 14 |
#include <errno.h>
|
13 | 15 |
|
14 | 16 |
#include <i3/ipc.h>
|
15 | |
|
16 | |
#include "libi3.h"
|
17 | 17 |
|
18 | 18 |
/*
|
19 | 19 |
* Formats a message (payload) of the given size and type and sends it to i3 via
|
|
0 |
/*
|
|
1 |
* vim:ts=4:sw=4:expandtab
|
|
2 |
*
|
|
3 |
* i3 - an improved dynamic tiling window manager
|
|
4 |
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
|
|
5 |
*
|
|
6 |
*/
|
|
7 |
#include "libi3.h"
|
|
8 |
|
0 | 9 |
#include <string.h>
|
1 | 10 |
#include <stdbool.h>
|
2 | 11 |
|
|
0 |
/*
|
|
1 |
* vim:ts=4:sw=4:expandtab
|
|
2 |
*
|
|
3 |
* i3 - an improved dynamic tiling window manager
|
|
4 |
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
|
|
5 |
*
|
|
6 |
*/
|
0 | 7 |
#include "libi3.h"
|
|
8 |
|
1 | 9 |
#include <errno.h>
|
2 | 10 |
#include <stdlib.h>
|
3 | 11 |
#include <string.h>
|
4 | 4 |
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
|
5 | 5 |
*
|
6 | 6 |
*/
|
|
7 |
#include "libi3.h"
|
7 | 8 |
|
8 | |
#include "libi3.h"
|
9 | 9 |
#include <err.h>
|
10 | 10 |
#include <glob.h>
|
11 | 11 |
#include <stdlib.h>
|
4 | 4 |
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
|
5 | 5 |
*
|
6 | 6 |
*/
|
|
7 |
#include "libi3.h"
|
|
8 |
|
7 | 9 |
#include <stdio.h>
|
8 | 10 |
#include <string.h>
|
9 | 11 |
#include <stdbool.h>
|
|
13 | 15 |
|
14 | 16 |
#include <xcb/xcb.h>
|
15 | 17 |
#include <xcb/xcb_aux.h>
|
16 | |
|
17 | |
#include "libi3.h"
|
18 | 18 |
|
19 | 19 |
/*
|
20 | 20 |
* Try to get the contents of the given atom (for example I3_SOCKET_PATH) from
|
4 | 4 |
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
|
5 | 5 |
*
|
6 | 6 |
*/
|
|
7 |
#include "libi3.h"
|
|
8 |
|
7 | 9 |
#include <string.h>
|
8 | 10 |
#include <stdlib.h>
|
9 | 11 |
#include <stdarg.h>
|
|
11 | 13 |
#include <stdio.h>
|
12 | 14 |
#include <err.h>
|
13 | 15 |
#include <errno.h>
|
14 | |
|
15 | |
#include "libi3.h"
|
16 | 16 |
|
17 | 17 |
/*
|
18 | 18 |
* The s* functions (safe) are wrappers around malloc, strdup, …, which exits if one of
|
4 | 4 |
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
|
5 | 5 |
*
|
6 | 6 |
*/
|
|
7 |
#include "libi3.h"
|
|
8 |
|
7 | 9 |
#include <sys/types.h>
|
8 | 10 |
#include <string.h>
|
9 | |
|
10 | |
#include "libi3.h"
|
11 | 11 |
|
12 | 12 |
#if defined(__APPLE__)
|
13 | 13 |
|
4 | 4 |
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
|
5 | 5 |
*
|
6 | 6 |
*/
|
|
7 |
#include "libi3.h"
|
|
8 |
|
7 | 9 |
#include <err.h>
|
8 | 10 |
#include <errno.h>
|
9 | 11 |
#include <iconv.h>
|
10 | 12 |
#include <stdlib.h>
|
11 | 13 |
#include <string.h>
|
12 | |
|
13 | |
#include "libi3.h"
|
14 | 14 |
|
15 | 15 |
static iconv_t utf8_conversion_descriptor = (iconv_t)-1;
|
16 | 16 |
static iconv_t ucs2_conversion_descriptor = (iconv_t)-1;
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "assignments.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "click.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "commands.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
|
8 | 6 |
* commands.c: all command functions (see commands_parser.c)
|
9 | 7 |
*
|
10 | 8 |
*/
|
|
9 |
#include "all.h"
|
|
10 |
|
11 | 11 |
#include <stdint.h>
|
12 | 12 |
#include <float.h>
|
13 | 13 |
#include <stdarg.h>
|
|
16 | 16 |
#include <sanitizer/lsan_interface.h>
|
17 | 17 |
#endif
|
18 | 18 |
|
19 | |
#include "all.h"
|
20 | 19 |
#include "shmlog.h"
|
21 | 20 |
|
22 | 21 |
// Macros to make the YAJL API a bit easier to use.
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "commands_parser.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
|
24 | 22 |
* instead of actually calling any function).
|
25 | 23 |
*
|
26 | 24 |
*/
|
|
25 |
#include "all.h"
|
|
26 |
|
27 | 27 |
#include <stdio.h>
|
28 | 28 |
#include <stdlib.h>
|
29 | 29 |
#include <string.h>
|
30 | 30 |
#include <unistd.h>
|
31 | 31 |
#include <stdbool.h>
|
32 | 32 |
#include <stdint.h>
|
33 | |
|
34 | |
#include "all.h"
|
35 | 33 |
|
36 | 34 |
// Macros to make the YAJL API a bit easier to use.
|
37 | 35 |
#define y(x, ...) (command_output.json_gen != NULL ? yajl_gen_##x(command_output.json_gen, ##__VA_ARGS__) : 0)
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "con.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
|
11 | 9 |
*
|
12 | 10 |
*/
|
13 | 11 |
#include "all.h"
|
|
12 |
|
14 | 13 |
#include "yajl_utils.h"
|
15 | 14 |
|
16 | 15 |
static void con_on_remove_child(Con *con);
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "config.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
|
10 | 8 |
*
|
11 | 9 |
*/
|
12 | 10 |
#include "all.h"
|
|
11 |
|
13 | 12 |
#include <xkbcommon/xkbcommon.h>
|
14 | 13 |
|
15 | 14 |
char *current_configpath = NULL;
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "config_directives.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
|
8 | 6 |
* config_directives.c: all config storing functions (see config_parser.c)
|
9 | 7 |
*
|
10 | 8 |
*/
|
|
9 |
#include "all.h"
|
|
10 |
|
11 | 11 |
#include <float.h>
|
12 | 12 |
#include <stdarg.h>
|
13 | |
|
14 | |
#include "all.h"
|
15 | 13 |
|
16 | 14 |
/*******************************************************************************
|
17 | 15 |
* Criteria functions.
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "config_parser.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
|
24 | 22 |
* nearest <error> token.
|
25 | 23 |
*
|
26 | 24 |
*/
|
|
25 |
#include "all.h"
|
|
26 |
|
27 | 27 |
#include <stdio.h>
|
28 | 28 |
#include <stdlib.h>
|
29 | 29 |
#include <string.h>
|
|
35 | 35 |
#include <sys/stat.h>
|
36 | 36 |
#include <fcntl.h>
|
37 | 37 |
#include <xcb/xcb_xrm.h>
|
38 | |
|
39 | |
#include "all.h"
|
40 | 38 |
|
41 | 39 |
// Macros to make the YAJL API a bit easier to use.
|
42 | 40 |
#define y(x, ...) yajl_gen_##x(command_output.json_gen, ##__VA_ARGS__)
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "debug.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
|
9 | 7 |
* events. This code is from xcb-util.
|
10 | 8 |
*
|
11 | 9 |
*/
|
|
10 |
#include <config.h>
|
|
11 |
|
12 | 12 |
#include <stdio.h>
|
13 | 13 |
#include <xcb/xcb.h>
|
14 | 14 |
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "key_press.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
|
9 | 7 |
* i3 --moreversion.
|
10 | 8 |
*
|
11 | 9 |
*/
|
|
10 |
#include "all.h"
|
|
11 |
|
12 | 12 |
#include <sys/types.h>
|
13 | 13 |
#include <sys/stat.h>
|
14 | 14 |
#include <sys/wait.h>
|
|
16 | 16 |
#include <sys/un.h>
|
17 | 17 |
#include <fcntl.h>
|
18 | 18 |
#include <time.h>
|
19 | |
#include "all.h"
|
20 | 19 |
|
21 | 20 |
static bool human_readable_key, loaded_config_file_name_key;
|
22 | 21 |
static char *human_readable_version, *loaded_config_file_name;
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "ewmh.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "fake_outputs.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "floating.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "handlers.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "ipc.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
|
9 | 7 |
*
|
10 | 8 |
*/
|
11 | 9 |
#include "all.h"
|
|
10 |
|
12 | 11 |
#include "yajl_utils.h"
|
13 | 12 |
|
14 | 13 |
#include <stdint.h>
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "key_press.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "load_layout.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "log.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
|
8 | 6 |
* log.c: Logging functions.
|
9 | 7 |
*
|
10 | 8 |
*/
|
|
9 |
#include <config.h>
|
|
10 |
|
11 | 11 |
#include <stdarg.h>
|
12 | 12 |
#include <stdio.h>
|
13 | 13 |
#include <string.h>
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "main.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
|
8 | 6 |
* main.c: Initialization, main loop
|
9 | 7 |
*
|
10 | 8 |
*/
|
|
9 |
#include "all.h"
|
|
10 |
|
11 | 11 |
#include <ev.h>
|
12 | 12 |
#include <fcntl.h>
|
13 | 13 |
#include <sys/types.h>
|
|
18 | 18 |
#include <sys/mman.h>
|
19 | 19 |
#include <sys/stat.h>
|
20 | 20 |
#include <libgen.h>
|
21 | |
#include "all.h"
|
22 | 21 |
#include "shmlog.h"
|
23 | 22 |
|
24 | 23 |
#include "sd-daemon.h"
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "manage.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
|
9 | 7 |
*
|
10 | 8 |
*/
|
11 | 9 |
#include "all.h"
|
|
10 |
|
12 | 11 |
#include "yajl_utils.h"
|
13 | 12 |
|
14 | 13 |
#include <yajl/yajl_gen.h>
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "match.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "move.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "output.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "randr.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "regex.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "render.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "resize.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "restore_layout.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "scratchpad.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "sighandler.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "startup.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
|
12 | 10 |
*
|
13 | 11 |
*/
|
14 | 12 |
#include "all.h"
|
|
13 |
|
15 | 14 |
#include "sd-daemon.h"
|
16 | 15 |
|
17 | 16 |
#include <sys/types.h>
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "tree.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "util.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
7 | 7 |
* and used dynamically without recompiling every object file.
|
8 | 8 |
*
|
9 | 9 |
*/
|
|
10 |
#include <config.h>
|
|
11 |
|
10 | 12 |
const char *i3_version = I3_VERSION;
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "window.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "workspace.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "x.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "xcb.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "xcursor.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|
|
8 | 6 |
* xcursor.c: xcursor support for themed cursors.
|
9 | 7 |
*
|
10 | 8 |
*/
|
|
9 |
#include <config.h>
|
|
10 |
|
11 | 11 |
#include <assert.h>
|
12 | 12 |
#include <xcb/xcb_cursor.h>
|
13 | 13 |
|
0 | |
#undef I3__FILE__
|
1 | |
#define I3__FILE__ "xinerama.c"
|
2 | 0 |
/*
|
3 | 1 |
* vim:ts=4:sw=4:expandtab
|
4 | 2 |
*
|