Remove some dead code (to be re-implemented), rename nc.c to main.c
This commit is contained in:
@ -30,7 +30,6 @@
|
||||
#include <xcb/xcb_icccm.h>
|
||||
|
||||
#include "util.h"
|
||||
#include "commands.h"
|
||||
#include "ipc.h"
|
||||
#include "tree.h"
|
||||
#include "log.h"
|
||||
|
121
include/client.h
121
include/client.h
@ -1,121 +0,0 @@
|
||||
/*
|
||||
* vim:ts=8:expandtab
|
||||
*
|
||||
* i3 - an improved dynamic tiling window manager
|
||||
*
|
||||
* © 2009 Michael Stapelberg and contributors
|
||||
*
|
||||
* See file LICENSE for license information.
|
||||
*
|
||||
*/
|
||||
#include <xcb/xcb.h>
|
||||
|
||||
#include "data.h"
|
||||
|
||||
#ifndef _CLIENT_H
|
||||
#define _CLIENT_H
|
||||
|
||||
/**
|
||||
* Removes the given client from the container, either because it will be
|
||||
* inserted into another one or because it was unmapped
|
||||
*
|
||||
*/
|
||||
void client_remove_from_container(xcb_connection_t *conn, Client *client,
|
||||
Container *container,
|
||||
bool remove_from_focusstack);
|
||||
|
||||
/**
|
||||
* Warps the pointer into the given client (in the middle of it, to be
|
||||
* specific), therefore selecting it
|
||||
*
|
||||
*/
|
||||
void client_warp_pointer_into(xcb_connection_t *conn, Client *client);
|
||||
|
||||
/**
|
||||
* Kills the given window using WM_DELETE_WINDOW or xcb_kill_window
|
||||
*
|
||||
*/
|
||||
void client_kill(xcb_connection_t *conn, Client *window);
|
||||
|
||||
/**
|
||||
* Checks if the given window class and title match the given client Window
|
||||
* title is passed as "normal" string and as UCS-2 converted string for
|
||||
* matching _NET_WM_NAME capable clients as well as those using legacy hints.
|
||||
*
|
||||
*/
|
||||
bool client_matches_class_name(Client *client, char *to_class, char *to_title,
|
||||
char *to_title_ucs, int to_title_ucs_len);
|
||||
|
||||
/**
|
||||
* Sets the position of the given client in the X stack to the highest (tiling
|
||||
* layer is always on the same position, so this doesn’t matter) below the
|
||||
* first floating client, so that floating windows are always on top.
|
||||
*
|
||||
*/
|
||||
void client_set_below_floating(xcb_connection_t *conn, Client *client);
|
||||
|
||||
/**
|
||||
* Returns true if the client is floating. Makes the code more beatiful, as
|
||||
* floating is not simply a boolean, but also saves whether the user selected
|
||||
* the current state or whether it was automatically set.
|
||||
*
|
||||
*/
|
||||
bool client_is_floating(Client *client);
|
||||
|
||||
/**
|
||||
* Change the border type for the given client to normal (n), 1px border (p) or
|
||||
* completely borderless (b).
|
||||
*
|
||||
*/
|
||||
void client_change_border(xcb_connection_t *conn, Client *client, char border_type);
|
||||
|
||||
/**
|
||||
* Change the border type for the given client to normal (n), 1px border (p) or
|
||||
* completely borderless (b) without actually re-rendering the layout. Useful
|
||||
* for calling it when initializing a new client.
|
||||
*
|
||||
*/
|
||||
bool client_init_border(xcb_connection_t *conn, Client *client, char border_type);
|
||||
|
||||
/**
|
||||
* Unmap the client, correctly setting any state which is needed.
|
||||
*
|
||||
*/
|
||||
void client_unmap(xcb_connection_t *conn, Client *client);
|
||||
|
||||
/**
|
||||
* Map the client, correctly restoring any state needed.
|
||||
*
|
||||
*/
|
||||
void client_map(xcb_connection_t *conn, Client *client);
|
||||
|
||||
/**
|
||||
* Set the given mark for this client. Used for jumping to the client
|
||||
* afterwards (like m<mark> and '<mark> in vim).
|
||||
*
|
||||
*/
|
||||
void client_mark(xcb_connection_t *conn, Client *client, const char *mark);
|
||||
|
||||
/**
|
||||
* Returns the minimum height of a specific window. The height is calculated
|
||||
* by using 2 pixels (for the client window itself), possibly padding this to
|
||||
* comply with the client’s base_height and then adding the decoration height.
|
||||
*
|
||||
*/
|
||||
uint32_t client_min_height(Client *client);
|
||||
|
||||
/**
|
||||
* See client_min_height.
|
||||
*
|
||||
*/
|
||||
uint32_t client_min_width(Client *client);
|
||||
|
||||
/**
|
||||
* Pretty-prints the client’s information into the logfile.
|
||||
*
|
||||
*/
|
||||
#define CLIENT_LOG(client) do { \
|
||||
DLOG("Window: frame 0x%08x, child 0x%08x\n", client->frame, client->child); \
|
||||
} while (0)
|
||||
|
||||
#endif
|
@ -1,24 +0,0 @@
|
||||
/*
|
||||
* vim:ts=8:expandtab
|
||||
*
|
||||
* i3 - an improved dynamic tiling window manager
|
||||
*
|
||||
* (c) 2009 Michael Stapelberg and contributors
|
||||
*
|
||||
* See file LICENSE for license information.
|
||||
*
|
||||
*/
|
||||
#ifndef _COMMANDS_H
|
||||
#define _COMMANDS_H
|
||||
|
||||
#include <xcb/xcb.h>
|
||||
|
||||
#if 0
|
||||
bool focus_window_in_container(xcb_connection_t *conn, Container *container,
|
||||
direction_t direction);
|
||||
#endif
|
||||
|
||||
/** Parses a command, see file CMDMODE for more information */
|
||||
void parse_command(const char *command);
|
||||
|
||||
#endif
|
@ -1,26 +0,0 @@
|
||||
/*
|
||||
* vim:ts=8:expandtab
|
||||
*
|
||||
* i3 - an improved dynamic tiling window manager
|
||||
*
|
||||
* © 2009 Michael Stapelberg and contributors
|
||||
*
|
||||
* See file LICENSE for license information.
|
||||
*
|
||||
*/
|
||||
#include "data.h"
|
||||
|
||||
#ifndef _CONTAINER_H
|
||||
#define _CONTAINER_H
|
||||
|
||||
/**
|
||||
* Returns the mode of the given container (or MODE_DEFAULT if a NULL pointer
|
||||
* was passed in order to save a few explicit checks in other places). If
|
||||
* for_frame was set to true, the special case of having exactly one client
|
||||
* in a container is handled so that MODE_DEFAULT is returned. For some parts
|
||||
* of the rendering, this is interesting, other parts need the real mode.
|
||||
*
|
||||
*/
|
||||
int container_mode(Container *con, bool for_frame);
|
||||
|
||||
#endif
|
@ -1,94 +0,0 @@
|
||||
/*
|
||||
* vim:ts=8:expandtab
|
||||
*
|
||||
* i3 - an improved dynamic tiling window manager
|
||||
*
|
||||
* (c) 2009 Michael Stapelberg and contributors
|
||||
*
|
||||
* See file LICENSE for license information.
|
||||
*
|
||||
*/
|
||||
#include <xcb/xcb.h>
|
||||
|
||||
#ifndef _LAYOUT_H
|
||||
#define _LAYOUT_H
|
||||
|
||||
/**
|
||||
* Gets the unoccupied space (= space which is available for windows which
|
||||
* were resized by the user) This is necessary to render both, customly
|
||||
* resized windows and never touched windows correctly, meaning that the
|
||||
* aspect ratio will be maintained when opening new windows.
|
||||
*
|
||||
*/
|
||||
int get_unoccupied_x(Workspace *workspace);
|
||||
|
||||
/** See get_unoccupied_x */
|
||||
int get_unoccupied_y(Workspace *workspace);
|
||||
|
||||
/**
|
||||
* (Re-)draws window decorations for a given Client onto the given
|
||||
* drawable/graphic context. When in stacking mode, the window decorations
|
||||
* are drawn onto an own window.
|
||||
*
|
||||
*/
|
||||
void decorate_window(xcb_connection_t *conn, Client *client,
|
||||
xcb_drawable_t drawable, xcb_gcontext_t gc,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
/**
|
||||
* Redecorates the given client correctly by checking if it’s in a stacking
|
||||
* container and re-rendering the stack window or just calling decorate_window
|
||||
* if it’s not in a stacking container.
|
||||
*
|
||||
*/
|
||||
void redecorate_window(xcb_connection_t *conn, Client *client);
|
||||
|
||||
/**
|
||||
* Pushes the client’s x and y coordinates to X11
|
||||
*
|
||||
*/
|
||||
void reposition_client(xcb_connection_t *conn, Client *client);
|
||||
|
||||
/**
|
||||
* Pushes the client’s width/height to X11 and resizes the child window. This
|
||||
* function also updates the client’s position, so if you work on tiling clients
|
||||
* only, you can use this function instead of separate calls to reposition_client
|
||||
* and resize_client to reduce flickering.
|
||||
*
|
||||
*/
|
||||
void resize_client(xcb_connection_t *conn, Client *client);
|
||||
|
||||
/**
|
||||
* Renders the given container. Is called by render_layout() or individually
|
||||
* (for example when focus changes in a stacking container)
|
||||
*
|
||||
*/
|
||||
void render_container(xcb_connection_t *conn, Container *container);
|
||||
|
||||
/**
|
||||
* Modifies the event mask of all clients on the given workspace to either
|
||||
* ignore or to handle enter notifies. It is handy to ignore notifies because
|
||||
* they will be sent when a window is mapped under the cursor, thus when the
|
||||
* user didn’t enter the window actively at all.
|
||||
*
|
||||
*/
|
||||
void ignore_enter_notify_forall(xcb_connection_t *conn, Workspace *workspace,
|
||||
bool ignore_enter_notify);
|
||||
|
||||
/**
|
||||
* Renders the given workspace on the given screen
|
||||
*
|
||||
*/
|
||||
void render_workspace(xcb_connection_t *conn, Output *output, Workspace *r_ws);
|
||||
|
||||
/**
|
||||
* Renders the whole layout, that is: Go through each screen, each workspace,
|
||||
* each container and render each client. This also renders the bars.
|
||||
*
|
||||
* If you don’t need to render *everything*, you should call render_container
|
||||
* on the container you want to refresh.
|
||||
*
|
||||
*/
|
||||
void render_layout(xcb_connection_t *conn);
|
||||
|
||||
#endif
|
@ -1,36 +0,0 @@
|
||||
/*
|
||||
* vim:ts=8:expandtab
|
||||
*
|
||||
* i3 - an improved dynamic tiling window manager
|
||||
*
|
||||
* (c) 2009 Michael Stapelberg and contributors
|
||||
*
|
||||
* See file LICENSE for license information.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _RESIZE_H
|
||||
#define _RESIZE_H
|
||||
|
||||
#include <xcb/xcb.h>
|
||||
|
||||
typedef enum { O_HORIZONTAL, O_VERTICAL } resize_orientation_t;
|
||||
|
||||
/**
|
||||
* Renders the resize window between the first/second container and resizes
|
||||
* the table column/row.
|
||||
*
|
||||
*/
|
||||
int resize_graphical_handler(xcb_connection_t *conn, Workspace *ws, int first,
|
||||
int second, resize_orientation_t orientation,
|
||||
xcb_button_press_event_t *event);
|
||||
/**
|
||||
* Resizes a column/row by the given amount of pixels. Called by
|
||||
* resize_graphical_handler (the user clicked) or parse_resize_command (the
|
||||
* user issued the command)
|
||||
*
|
||||
*/
|
||||
void resize_container(xcb_connection_t *conn, Workspace *ws, int first, int second,
|
||||
resize_orientation_t orientation, int pixels);
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user