src/table.c File Reference

#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"
Include dependency graph for table.c:

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
Workspacec_ws
int current_col = 0
int current_row = 0

Function Documentation

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 
)
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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

static void new_container ( Workspace workspace,
Container **  container,
int  col,
int  row,
bool  skip_layout_switch 
) [static]
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().


Variable Documentation

int current_col = 0
int current_row = 0

Definition at line 32 of file table.c.

int num_workspaces = 1

Definition at line 33 of file table.c.

Referenced by ewmh_update_workarea().

struct workspaces_head* workspaces

Generated on 2 Jul 2010 for i3 by  doxygen 1.6.1