i3
|
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdbool.h>
#include "data.h"
#include "table.h"
#include "util.h"
#include "i3.h"
#include "layout.h"
#include "config.h"
#include "workspace.h"
#include "log.h"
Go to the source code of this file.
Functions | |
void | init_table () |
Initialize table. | |
static void | new_container (Workspace *workspace, Container **container, int col, int row, bool skip_layout_switch) |
void | expand_table_rows (Workspace *workspace) |
Add one row to the table. | |
void | expand_table_rows_at_head (Workspace *workspace) |
Adds one row at the head of the table. | |
void | expand_table_cols (Workspace *workspace) |
Add one column to the table. | |
void | expand_table_cols_at_head (Workspace *workspace) |
Inserts one column at the table’s head. | |
static void | shrink_table_cols (Workspace *workspace) |
static void | shrink_table_rows (Workspace *workspace) |
bool | cell_exists (Workspace *ws, int col, int row) |
Performs simple bounds checking for the given column/row. | |
static void | free_container (xcb_connection_t *conn, Workspace *workspace, int col, int row) |
static void | move_columns_from (xcb_connection_t *conn, Workspace *workspace, int cols) |
static void | move_rows_from (xcb_connection_t *conn, Workspace *workspace, int rows) |
void | dump_table (xcb_connection_t *conn, Workspace *workspace) |
Prints the table’s contents in human-readable form for debugging. | |
void | cleanup_table (xcb_connection_t *conn, Workspace *workspace) |
Shrinks the table by "compacting" it, that is, removing completely empty rows/columns. | |
void | fix_colrowspan (xcb_connection_t *conn, Workspace *workspace) |
Fixes col/rowspan (makes sure there are no overlapping windows) | |
Variables | |
int | current_workspace = 0 |
int | num_workspaces = 1 |
struct workspaces_head * | workspaces |
Workspace * | c_ws |
int | current_col = 0 |
int | current_row = 0 |
bool cell_exists | ( | Workspace * | ws, |
int | col, | ||
int | row | ||
) |
Performs simple bounds checking for the given column/row.
Definition at line 245 of file table.c.
References Workspace::rows.
Referenced by fix_colrowspan(), floating_mod_on_tiled_client(), focus_thing(), handle_button_press(), parse_resize_command(), and snap_current_container().
void cleanup_table | ( | xcb_connection_t * | conn, |
Workspace * | workspace | ||
) |
Shrinks the table by "compacting" it, that is, removing completely empty rows/columns.
Definition at line 319 of file table.c.
References Workspace::cols, CUR_CELL, current_col, Workspace::current_col, current_row, Workspace::current_row, Container::currently_focused, DLOG, free_container(), move_columns_from(), move_rows_from(), Workspace::rows, set_focus(), shrink_table_cols(), shrink_table_rows(), and Workspace::table.
Referenced by handle_unmap_notify_event(), move_current_container(), move_current_window(), move_current_window_to_workspace(), and parse_command().
void dump_table | ( | xcb_connection_t * | conn, |
Workspace * | workspace | ||
) |
Prints the table’s contents in human-readable form for debugging.
Definition at line 299 of file table.c.
References Client::child, CIRCLEQ_FOREACH, Container::currently_focused, DLOG, FOR_TABLE, Client::name, and Workspace::table.
void expand_table_cols | ( | Workspace * | workspace | ) |
Add one column to the table.
Definition at line 127 of file table.c.
References Workspace::cols, config, Config::container_mode, global_conn, new_container(), Workspace::rows, scalloc(), switch_layout_mode(), Workspace::table, and Workspace::width_factor.
Referenced by main(), move_current_container(), move_current_window(), and workspace_get().
void expand_table_cols_at_head | ( | Workspace * | workspace | ) |
Inserts one column at the table’s head.
Definition at line 147 of file table.c.
References Container::col, Workspace::cols, DLOG, new_container(), Workspace::rows, scalloc(), Workspace::table, and Workspace::width_factor.
Referenced by move_current_container(), and move_current_window().
void expand_table_rows | ( | Workspace * | workspace | ) |
Add one row to the table.
Definition at line 73 of file table.c.
References Workspace::cols, config, Config::container_mode, global_conn, Workspace::height_factor, new_container(), Workspace::rows, switch_layout_mode(), and Workspace::table.
Referenced by main(), move_current_container(), move_current_window(), and workspace_get().
void expand_table_rows_at_head | ( | Workspace * | workspace | ) |
Adds one row at the head of the table.
Definition at line 95 of file table.c.
References Workspace::cols, DLOG, Workspace::height_factor, new_container(), Container::row, Workspace::rows, and Workspace::table.
Referenced by move_current_container(), and move_current_window().
void fix_colrowspan | ( | xcb_connection_t * | conn, |
Workspace * | workspace | ||
) |
Fixes col/rowspan (makes sure there are no overlapping windows)
Definition at line 384 of file table.c.
References cell_exists(), Container::colspan, Container::currently_focused, DLOG, FOR_TABLE, Container::rowspan, and Workspace::table.
Referenced by handle_unmap_notify_event(), move_current_container(), move_current_window(), and parse_command().
static void free_container | ( | xcb_connection_t * | conn, |
Workspace * | workspace, | ||
int | col, | ||
int | row | ||
) | [static] |
Definition at line 250 of file table.c.
References leave_stack_mode(), Container::mode, and Workspace::table.
Referenced by cleanup_table(), move_columns_from(), and move_rows_from().
void init_table | ( | ) |
Initialize table.
Definition at line 44 of file table.c.
References scalloc(), TAILQ_INIT, TAILQ_INSERT_TAIL, workspace_set_name(), and workspaces.
Referenced by main().
static void move_columns_from | ( | xcb_connection_t * | conn, |
Workspace * | workspace, | ||
int | cols | ||
) | [static] |
Definition at line 259 of file table.c.
References Container::col, Workspace::cols, DLOG, free_container(), new_container(), Container::row, Workspace::rows, and Workspace::table.
Referenced by cleanup_table().
static void move_rows_from | ( | xcb_connection_t * | conn, |
Workspace * | workspace, | ||
int | rows | ||
) | [static] |
Definition at line 279 of file table.c.
References Container::col, Workspace::cols, DLOG, free_container(), new_container(), Container::row, Workspace::rows, and Workspace::table.
Referenced by cleanup_table().
static void new_container | ( | Workspace * | workspace, |
Container ** | container, | ||
int | col, | ||
int | row, | ||
bool | skip_layout_switch | ||
) | [static] |
Definition at line 54 of file table.c.
References CIRCLEQ_INIT, config, Config::container_mode, Config::container_stack_limit, Config::container_stack_limit_value, global_conn, scalloc(), and switch_layout_mode().
Referenced by expand_table_cols(), expand_table_cols_at_head(), expand_table_rows(), expand_table_rows_at_head(), move_columns_from(), and move_rows_from().
static void shrink_table_cols | ( | Workspace * | workspace | ) | [static] |
Definition at line 183 of file table.c.
References Workspace::cols, DLOG, Workspace::table, and Workspace::width_factor.
Referenced by cleanup_table().
static void shrink_table_rows | ( | Workspace * | workspace | ) | [static] |
Definition at line 216 of file table.c.
References Workspace::cols, DLOG, Workspace::height_factor, Workspace::rows, and Workspace::table.
Referenced by cleanup_table().
Definition at line 36 of file table.c.
Referenced by button_press_bar(), check_crossing_screen_boundary(), decorate_window(), ewmh_update_current_desktop(), focus_thing(), handle_configure_request(), handle_enter_notify(), handle_hints(), handle_unmap_notify_event(), IPC_HANDLER(), jump_to_container(), main(), move_current_container(), move_current_window(), move_floating_window_to_workspace(), next_previous_workspace(), parse_command(), reparent_window(), set_focus(), travel_focus_stack(), workspace_assign_to(), workspace_show(), and workspace_unmap_clients().
int current_col = 0 |
Definition at line 37 of file table.c.
Referenced by check_crossing_screen_boundary(), cleanup_table(), focus_thing(), move_current_container(), move_current_window(), render_container(), set_focus(), and workspace_show().
int current_row = 0 |
Definition at line 38 of file table.c.
Referenced by check_crossing_screen_boundary(), cleanup_table(), focus_thing(), move_current_container(), move_current_window(), render_container(), set_focus(), and workspace_show().
int current_workspace = 0 |
int num_workspaces = 1 |
Definition at line 33 of file table.c.
Referenced by ewmh_update_workarea().
struct workspaces_head* workspaces |
Definition at line 34 of file table.c.
Referenced by button_press_bar(), client_leave_fullscreen(), client_mark(), ewmh_update_workarea(), get_first_workspace_for_output(), get_matching_client(), handle_unmap_notify_event(), init_table(), initialize_output(), IPC_HANDLER(), jump_to_mark(), load_configuration(), main(), next_previous_workspace(), output_change_mode(), randr_query_outputs(), render_internal_bar(), restore_geometry(), workspace_get(), and yyparse().