i3
Defines | Functions | Variables
src/main.c File Reference
#include <ev.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/time.h>
#include <sys/resource.h>
#include "all.h"
#include "sd-daemon.h"
#include "atoms.xmacro"
Include dependency graph for main.c:

Go to the source code of this file.

Defines

#define xmacro(atom)   xcb_intern_atom_cookie_t atom ## _cookie = xcb_intern_atom(conn, 0, strlen(#atom), #atom);
#define xmacro(name)

Functions

static void xcb_got_event (EV_P_ struct ev_io *w, int revents)
static void xcb_prepare_cb (EV_P_ ev_prepare *w, int revents)
static void xcb_check_cb (EV_P_ ev_check *w, int revents)
static void xkb_got_event (EV_P_ struct ev_io *w, int revents)
static void i3_exit ()
int main (int argc, char *argv[])

Variables

struct rlimit original_rlimit_core
 The original value of RLIMIT_CORE when i3 was started.
static int xkb_event_base
int xkb_current_group
Confocused
char ** start_argv
xcb_connection_t * conn
int conn_screen
SnDisplay * sndisplay
xcb_timestamp_t last_timestamp = XCB_CURRENT_TIME
 The last timestamp we got from X11 (timestamps are included in some events and are used for some things, like determining a unique ID in startup notification).
xcb_screen_t * root_screen
xcb_window_t root
uint8_t root_depth
struct ev_loop * main_loop
xcb_key_symbols_t * keysyms
Display * xlibdpy
Display * xkbdpy
struct bindings_head * bindings
struct autostarts_head autostarts = TAILQ_HEAD_INITIALIZER(autostarts)
struct autostarts_always_head autostarts_always = TAILQ_HEAD_INITIALIZER(autostarts_always)
struct assignments_head assignments = TAILQ_HEAD_INITIALIZER(assignments)
struct ws_assignments_head ws_assignments = TAILQ_HEAD_INITIALIZER(ws_assignments)
bool xcursor_supported = true
bool xkb_supported = true
bool only_check_config = false

Define Documentation

#define xmacro (   atom)    xcb_intern_atom_cookie_t atom ## _cookie = xcb_intern_atom(conn, 0, strlen(#atom), #atom);
#define xmacro (   name)
Value:
do { \
            xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(conn, name ## _cookie, NULL); \
            if (!reply) { \
                ELOG("Could not get atom " #name "\n"); \
                exit(-1); \
            } \
            A_ ## name = reply->atom; \
            free(reply); \
        } while (0);

Function Documentation

static void i3_exit ( ) [static]

Definition at line 201 of file main.c.

References main_loop.

Referenced by main().

int main ( int  argc,
char *  argv[] 
)
static void xcb_check_cb ( EV_P_ ev_check *  w,
int  revents 
) [static]

Definition at line 104 of file main.c.

References conn, DLOG, ELOG, event_is_ignored(), and handle_event().

Referenced by main().

Here is the call graph for this function:

static void xcb_got_event ( EV_P_ struct ev_io *  w,
int  revents 
) [static]

Definition at line 87 of file main.c.

Referenced by main().

static void xcb_prepare_cb ( EV_P_ ev_prepare *  w,
int  revents 
) [static]

Definition at line 95 of file main.c.

References conn.

Referenced by main().

static void xkb_got_event ( EV_P_ struct ev_io *  w,
int  revents 
) [static]

Definition at line 135 of file main.c.

References aio_get_mod_mask_for(), conn, DLOG, ELOG, grab_all_keys(), keysyms, translate_keysyms(), ungrab_all_keys(), XCB_NUM_LOCK, xcb_numlock_mask, xkb_current_group, xkb_event_base, and xkbdpy.

Referenced by main().

Here is the call graph for this function:


Variable Documentation

struct assignments_head assignments = TAILQ_HEAD_INITIALIZER(assignments)

Definition at line 67 of file main.c.

Referenced by assignment_for(), load_configuration(), and run_assignments().

struct autostarts_head autostarts = TAILQ_HEAD_INITIALIZER(autostarts)

Definition at line 61 of file main.c.

Referenced by main(), and parse_file().

Definition at line 64 of file main.c.

Referenced by main(), and parse_file().

struct bindings_head* bindings
xcb_connection_t* conn

Definition at line 36 of file main.c.

Referenced by main(), property_handlers_init(), and start_application().

xcb_key_symbols_t* keysyms
xcb_timestamp_t last_timestamp = XCB_CURRENT_TIME

The last timestamp we got from X11 (timestamps are included in some events and are used for some things, like determining a unique ID in startup notification).

Definition at line 44 of file main.c.

Referenced by handle_button_press(), handle_enter_notify(), handle_event(), handle_key_press(), handle_motion_notify(), and start_application().

struct ev_loop* main_loop

Definition at line 50 of file main.c.

Referenced by i3_exit(), main(), start_application(), and start_configerror_nagbar().

bool only_check_config = false

Definition at line 80 of file main.c.

Referenced by main(), and start_configerror_nagbar().

struct rlimit original_rlimit_core

The original value of RLIMIT_CORE when i3 was started.

We need to restore this before starting any other process, since we set RLIMIT_CORE to RLIM_INFINITY for i3 debugging versions.

Definition at line 24 of file main.c.

Referenced by main(), and start_application().

xcb_window_t root
uint8_t root_depth

Definition at line 48 of file main.c.

Referenced by handle_signal(), main(), and x_push_node().

xcb_screen_t* root_screen

Definition at line 46 of file main.c.

Referenced by disable_randr(), and main().

SnDisplay* sndisplay

Definition at line 39 of file main.c.

Referenced by handle_client_message(), main(), property_handlers_init(), and start_application().

char** start_argv

Definition at line 32 of file main.c.

Referenced by exec_i3_utility(), i3_restart(), and main().

struct ws_assignments_head ws_assignments = TAILQ_HEAD_INITIALIZER(ws_assignments)

Definition at line 71 of file main.c.

Referenced by init_ws_for_output(), and workspace_get().

bool xcursor_supported = true

Definition at line 74 of file main.c.

Referenced by create_window(), load_cursor(), main(), start_application(), and startup_monitor_event().

Definition at line 28 of file main.c.

Referenced by handle_key_press(), and xkb_got_event().

int xkb_event_base [static]

Definition at line 26 of file main.c.

Referenced by main(), and xkb_got_event().

bool xkb_supported = true

Definition at line 75 of file main.c.

Referenced by main().

Display * xkbdpy

Definition at line 55 of file main.c.

Referenced by main(), and xkb_got_event().

Display* xlibdpy

Definition at line 55 of file main.c.

Referenced by load_cursor(), main(), and xcursor_set_root_cursor().