remove old files
This commit is contained in:
55
proto.h
55
proto.h
@@ -1,55 +0,0 @@
|
|||||||
void catch_exit(int sig);
|
|
||||||
int execsh(char *cmd);
|
|
||||||
void exec_cmd(char *cmd);
|
|
||||||
int oops(Display *d, XErrorEvent *ee);
|
|
||||||
void query_windows();
|
|
||||||
unsigned int color_name_to_pixel(const char *name);
|
|
||||||
int window_get_prop(Window w, Atom prop, Atom *type, int *items, void *buffer, int bytes);
|
|
||||||
int window_get_atom_prop(Window w, Atom atom, Atom *list, int count);
|
|
||||||
void window_set_atom_prop(Window w, Atom prop, Atom *atoms, int count);
|
|
||||||
int window_get_cardinal_prop(Window w, Atom atom, unsigned long *list, int count);
|
|
||||||
void window_set_cardinal_prop(Window w, Atom prop, unsigned long *values, int count);
|
|
||||||
int window_get_window_prop(Window w, Atom atom, Window *list, int count);
|
|
||||||
void window_set_window_prop(Window w, Atom prop, Window *values, int count);
|
|
||||||
void ewmh_client_list();
|
|
||||||
client* window_build_client(Window win);
|
|
||||||
void client_free(client *c);
|
|
||||||
void stack_free(stack *s);
|
|
||||||
int client_has_state(client *c, Atom state);
|
|
||||||
int client_toggle_state(client *c, Atom state);
|
|
||||||
int window_send_clientmessage(Window target, Window subject, Atom atom, unsigned long protocol, unsigned long mask);
|
|
||||||
int client_send_wm_protocol(client *c, Atom protocol);
|
|
||||||
void client_close(client *c);
|
|
||||||
void client_place_spot(client *c, int spot, int mon, int force);
|
|
||||||
void client_spot_cycle(client *c);
|
|
||||||
Window spot_focus_top_window(int spot, int mon, Window except);
|
|
||||||
void client_stack_family(client *c, stack *raise);
|
|
||||||
void client_raise_family(client *c);
|
|
||||||
void client_set_focus(client *c);
|
|
||||||
void client_activate(client *c);
|
|
||||||
void window_listen(Window win);
|
|
||||||
void client_update_border(client *c);
|
|
||||||
void action_move(void *data, int num, client *cli);
|
|
||||||
void action_focus(void *data, int num, client *cli);
|
|
||||||
void action_close(void *data, int num, client *cli);
|
|
||||||
void action_cycle(void *data, int num, client *cli);
|
|
||||||
void action_other(void *data, int num, client *cli);
|
|
||||||
void action_command(void *data, int num, client *cli);
|
|
||||||
void action_find_or_start(void *data, int num, client *cli);
|
|
||||||
void action_move_monitor(void *data, int num, client *cli);
|
|
||||||
void action_focus_monitor(void *data, int num, client *cli);
|
|
||||||
void action_fullscreen(void *data, int num, client *cli);
|
|
||||||
void action_above(void *data, int num, client *cli);
|
|
||||||
void action_snapshot(void *data, int num, client *cli);
|
|
||||||
void action_rollback(void *data, int num, client *cli);
|
|
||||||
void create_notify(XEvent *e);
|
|
||||||
void configure_request(XEvent *ev);
|
|
||||||
void configure_notify(XEvent *e);
|
|
||||||
void map_request(XEvent *e);
|
|
||||||
void map_notify(XEvent *e);
|
|
||||||
void unmap_notify(XEvent *e);
|
|
||||||
void key_press(XEvent *ev);
|
|
||||||
void button_press(XEvent *ev);
|
|
||||||
void client_message(XEvent *ev);
|
|
||||||
void any_event(XEvent *e);
|
|
||||||
int main(int argc, char *argv[]);
|
|
||||||
211
xoat.h
211
xoat.h
@@ -1,211 +0,0 @@
|
|||||||
/*
|
|
||||||
|
|
||||||
MIT/X11 License
|
|
||||||
Copyright (c) 2012 Sean Pringle <sean.pringle@gmail.com>
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of this software and associated documentation files (the
|
|
||||||
"Software"), to deal in the Software without restriction, including
|
|
||||||
without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be
|
|
||||||
included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
||||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
||||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
||||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
||||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
||||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <X11/X.h>
|
|
||||||
#include <X11/Xlib.h>
|
|
||||||
#include <X11/Xutil.h>
|
|
||||||
#include <X11/Xatom.h>
|
|
||||||
#include <X11/Xproto.h>
|
|
||||||
#include <X11/keysym.h>
|
|
||||||
#include <X11/XKBlib.h>
|
|
||||||
#include <X11/extensions/Xinerama.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <err.h>
|
|
||||||
#include <signal.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/wait.h>
|
|
||||||
|
|
||||||
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
|
||||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
|
||||||
|
|
||||||
#define NEAR(a,o,b) ((b) > (a)-(o) && (b) < (a)+(o))
|
|
||||||
#define OVERLAP(a,b,c,d) (((a)==(c) && (b)==(d)) || MIN((a)+(b), (c)+(d)) - MAX((a), (c)) > 0)
|
|
||||||
#define INTERSECT(x,y,w,h,x1,y1,w1,h1) (OVERLAP((x),(w),(x1),(w1)) && OVERLAP((y),(h),(y1),(h1)))
|
|
||||||
|
|
||||||
Display *display;
|
|
||||||
Window root;
|
|
||||||
Time latest;
|
|
||||||
char *self;
|
|
||||||
Window ewmh;
|
|
||||||
|
|
||||||
enum {
|
|
||||||
MONITOR_CURRENT=-1
|
|
||||||
};
|
|
||||||
|
|
||||||
enum {
|
|
||||||
SPOT1=1, // large left pane
|
|
||||||
SPOT2, // medium top right pane
|
|
||||||
SPOT3, // small bottom right pane
|
|
||||||
SPOT_CURRENT,
|
|
||||||
SPOT_SMART,
|
|
||||||
SPOT1_LEFT,
|
|
||||||
SPOT1_RIGHT
|
|
||||||
};
|
|
||||||
|
|
||||||
enum {
|
|
||||||
FOCUS_IGNORE=1,
|
|
||||||
FOCUS_STEAL,
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
short x, y, w, h;
|
|
||||||
} box;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
short x, y, w, h;
|
|
||||||
box spots[SPOT3+1];
|
|
||||||
} monitor;
|
|
||||||
|
|
||||||
#define MAX_STRUT 150
|
|
||||||
#define MAX_MONITORS 3
|
|
||||||
monitor monitors[MAX_MONITORS];
|
|
||||||
int nmonitors = 1;
|
|
||||||
|
|
||||||
#define MAX_NET_WM_STATES 5
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
Window window;
|
|
||||||
XWindowAttributes attr;
|
|
||||||
Window transient, leader;
|
|
||||||
Atom type, states[MAX_NET_WM_STATES+1];
|
|
||||||
short monitor, spot, visible, manage, input, urgent;
|
|
||||||
char *class;
|
|
||||||
} client;
|
|
||||||
|
|
||||||
#define STACK 64
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
short depth;
|
|
||||||
client *clients[STACK];
|
|
||||||
Window windows[STACK];
|
|
||||||
} stack;
|
|
||||||
|
|
||||||
short current_spot = 0, current_mon = 0;
|
|
||||||
Window current = None;
|
|
||||||
stack windows, snapshot;
|
|
||||||
|
|
||||||
#define for_windows(i,c)\
|
|
||||||
for (query_windows(), (i) = 0; (i) < windows.depth; (i)++)\
|
|
||||||
if (((c) = windows.clients[(i)]))
|
|
||||||
|
|
||||||
#define for_windows_rev(i,c)\
|
|
||||||
for (query_windows(), (i) = windows.depth-1; (i) > -1; (i)--)\
|
|
||||||
if (((c) = windows.clients[(i)]))
|
|
||||||
|
|
||||||
#define for_spots(i)\
|
|
||||||
for ((i) = SPOT1; (i) <= SPOT3; (i)++)
|
|
||||||
|
|
||||||
#define for_spots_rev(i)\
|
|
||||||
for ((i) = SPOT3; (i) >= SPOT1; (i)--)
|
|
||||||
|
|
||||||
static int (*xerror)(Display *, XErrorEvent *);
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
long left, right, top, bottom,
|
|
||||||
left_start_y, left_end_y, right_start_y, right_end_y,
|
|
||||||
top_start_x, top_end_x, bottom_start_x, bottom_end_x;
|
|
||||||
} wm_strut;
|
|
||||||
|
|
||||||
wm_strut struts;
|
|
||||||
|
|
||||||
#define ATOM_ENUM(x) x
|
|
||||||
#define ATOM_CHAR(x) #x
|
|
||||||
|
|
||||||
#define GENERAL_ATOMS(X) \
|
|
||||||
X(XOAT_SPOT),\
|
|
||||||
X(XOAT_EXIT),\
|
|
||||||
X(XOAT_RESTART),\
|
|
||||||
X(_MOTIF_WM_HINTS),\
|
|
||||||
X(_NET_SUPPORTED),\
|
|
||||||
X(_NET_ACTIVE_WINDOW),\
|
|
||||||
X(_NET_CLOSE_WINDOW),\
|
|
||||||
X(_NET_CLIENT_LIST_STACKING),\
|
|
||||||
X(_NET_CLIENT_LIST),\
|
|
||||||
X(_NET_SUPPORTING_WM_CHECK),\
|
|
||||||
X(_NET_WM_NAME),\
|
|
||||||
X(_NET_WM_PID),\
|
|
||||||
X(_NET_WM_STRUT),\
|
|
||||||
X(_NET_WM_STRUT_PARTIAL),\
|
|
||||||
X(_NET_WM_WINDOW_TYPE),\
|
|
||||||
X(_NET_WM_WINDOW_TYPE_DESKTOP),\
|
|
||||||
X(_NET_WM_WINDOW_TYPE_DOCK),\
|
|
||||||
X(_NET_WM_WINDOW_TYPE_SPLASH),\
|
|
||||||
X(_NET_WM_WINDOW_TYPE_NOTIFICATION),\
|
|
||||||
X(_NET_WM_WINDOW_TYPE_DIALOG),\
|
|
||||||
X(_NET_WM_STATE),\
|
|
||||||
X(_NET_WM_STATE_FULLSCREEN),\
|
|
||||||
X(_NET_WM_STATE_ABOVE),\
|
|
||||||
X(_NET_WM_STATE_DEMANDS_ATTENTION),\
|
|
||||||
X(WM_DELETE_WINDOW),\
|
|
||||||
X(WM_CLIENT_LEADER),\
|
|
||||||
X(WM_TAKE_FOCUS),\
|
|
||||||
X(WM_PROTOCOLS)
|
|
||||||
|
|
||||||
enum { GENERAL_ATOMS(ATOM_ENUM), ATOMS };
|
|
||||||
const char *atom_names[] = { GENERAL_ATOMS(ATOM_CHAR) };
|
|
||||||
Atom atoms[ATOMS];
|
|
||||||
|
|
||||||
unsigned int NumlockMask = 0;
|
|
||||||
|
|
||||||
enum {
|
|
||||||
ACTION_NONE,
|
|
||||||
ACTION_MOVE,
|
|
||||||
ACTION_FOCUS,
|
|
||||||
ACTION_CYCLE,
|
|
||||||
ACTION_CLOSE,
|
|
||||||
ACTION_OTHER,
|
|
||||||
ACTION_COMMAND,
|
|
||||||
ACTION_FIND_OR_START,
|
|
||||||
ACTION_MOVE_MONITOR,
|
|
||||||
ACTION_FOCUS_MONITOR,
|
|
||||||
ACTION_FULLSCREEN_TOGGLE,
|
|
||||||
ACTION_ABOVE_TOGGLE,
|
|
||||||
ACTION_SNAPSHOT,
|
|
||||||
ACTION_ROLLBACK,
|
|
||||||
ACTIONS
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef void (*handler)(XEvent*);
|
|
||||||
typedef void (*action)(void*, int, client*);
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
unsigned int mod;
|
|
||||||
KeySym key;
|
|
||||||
short act;
|
|
||||||
void *data;
|
|
||||||
int num;
|
|
||||||
} binding;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user