2005-11-18 17:54:58 +02:00
|
|
|
/*
|
2006-01-20 16:20:24 +02:00
|
|
|
* (C)opyright MMIV-MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
2005-11-18 17:54:58 +02:00
|
|
|
* See LICENSE file for license details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2006-05-30 18:28:05 +02:00
|
|
|
#include <regex.h>
|
2006-01-21 13:57:20 +02:00
|
|
|
#include <X11/Xlib.h>
|
2005-11-18 17:54:58 +02:00
|
|
|
#include <X11/Xutil.h>
|
|
|
|
|
2006-04-03 15:52:05 +02:00
|
|
|
#include <ixp.h>
|
2006-10-12 16:10:57 +02:00
|
|
|
|
2007-02-04 21:02:05 -05:00
|
|
|
#define nil ((void*)0)
|
|
|
|
|
2007-02-12 01:24:24 -05:00
|
|
|
/* Types */
|
|
|
|
#define uchar _wmiiuchar
|
|
|
|
#define ushort _wmiiushort
|
|
|
|
#define uint _wmiiuint
|
|
|
|
#define ulong _wmiiulong
|
|
|
|
#define vlong _wmiivlong
|
|
|
|
#define uvlong _wmiiuvlong
|
|
|
|
typedef unsigned char uchar;
|
|
|
|
typedef unsigned short ushort;
|
|
|
|
typedef unsigned int uint;
|
|
|
|
typedef unsigned long ulong;
|
|
|
|
typedef unsigned long long uvlong;
|
|
|
|
typedef long long vlong;
|
|
|
|
|
2006-12-13 11:26:38 +01:00
|
|
|
#define BLITZ_FONT "-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*"
|
2007-02-15 16:46:31 -05:00
|
|
|
#define BLITZ_FOCUSCOLORS "#ffffff #335577 #447799"
|
2006-10-12 16:10:57 +02:00
|
|
|
#define BLITZ_NORMCOLORS "#222222 #eeeeee #666666"
|
|
|
|
|
|
|
|
typedef struct Blitz Blitz;
|
|
|
|
typedef enum BlitzAlign BlitzAlign;
|
|
|
|
typedef struct BlitzColor BlitzColor;
|
|
|
|
typedef struct BlitzFont BlitzFont;
|
|
|
|
typedef struct BlitzBrush BlitzBrush;
|
|
|
|
|
|
|
|
struct Blitz {
|
|
|
|
Display *dpy;
|
|
|
|
int screen;
|
|
|
|
Window root;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum BlitzAlign {
|
|
|
|
NORTH = 0x01,
|
|
|
|
EAST = 0x02,
|
|
|
|
SOUTH = 0x04,
|
|
|
|
WEST = 0x08,
|
|
|
|
NEAST = NORTH | EAST,
|
|
|
|
NWEST = NORTH | WEST,
|
|
|
|
SEAST = SOUTH | EAST,
|
|
|
|
SWEST = SOUTH | WEST,
|
|
|
|
CENTER = NEAST | SWEST
|
|
|
|
};
|
|
|
|
|
|
|
|
struct BlitzColor {
|
2007-02-12 01:24:24 -05:00
|
|
|
vlong bg;
|
|
|
|
vlong fg;
|
|
|
|
vlong border;
|
2006-10-12 16:10:57 +02:00
|
|
|
char colstr[24]; /* #RRGGBB #RRGGBB #RRGGBB */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct BlitzFont {
|
|
|
|
XFontStruct *xfont;
|
|
|
|
XFontSet set;
|
|
|
|
int ascent;
|
|
|
|
int descent;
|
2007-02-12 01:24:24 -05:00
|
|
|
uint height;
|
2006-10-12 16:10:57 +02:00
|
|
|
char *fontstr;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct BlitzBrush {
|
|
|
|
Blitz *blitz;
|
|
|
|
Drawable drawable;
|
|
|
|
GC gc;
|
2007-02-09 01:01:54 -05:00
|
|
|
int border;
|
2006-10-12 16:10:57 +02:00
|
|
|
BlitzColor color;
|
|
|
|
BlitzAlign align;
|
|
|
|
BlitzFont *font;
|
|
|
|
XRectangle rect; /* relative rect */
|
|
|
|
};
|
2005-11-18 17:54:58 +02:00
|
|
|
|
2006-07-11 16:15:01 +02:00
|
|
|
/* WM atoms */
|
2007-01-28 13:26:01 +01:00
|
|
|
enum { WMState, WMProtocols, WMDelete, WMLast };
|
2006-09-28 13:02:06 +02:00
|
|
|
|
|
|
|
/* NET atoms */
|
|
|
|
enum { NetSupported, NetWMName, NetLast };
|
|
|
|
|
|
|
|
/* Column modes */
|
|
|
|
enum { Coldefault, Colstack, Colmax };
|
|
|
|
|
|
|
|
/* Cursor */
|
2007-02-20 18:29:16 -05:00
|
|
|
enum { CurNormal, CurNECorner, CurNWCorner, CurSECorner, CurSWCorner,
|
|
|
|
CurMove, CurInput, CurInvisible, CurLast };
|
2006-03-05 13:22:42 +01:00
|
|
|
|
2006-07-13 21:58:26 +00:00
|
|
|
enum { NCOL = 16 };
|
2006-04-06 07:55:33 +02:00
|
|
|
enum { WM_PROTOCOL_DELWIN = 1 };
|
2005-11-18 17:54:58 +02:00
|
|
|
|
2006-06-29 19:02:51 -04:00
|
|
|
/* Data Structures */
|
2006-03-23 10:36:51 +01:00
|
|
|
typedef struct View View;
|
2006-03-05 01:55:45 +01:00
|
|
|
typedef struct Area Area;
|
|
|
|
typedef struct Frame Frame;
|
2005-11-18 17:54:58 +02:00
|
|
|
typedef struct Client Client;
|
2006-06-29 19:02:51 -04:00
|
|
|
typedef struct Key Key;
|
|
|
|
typedef struct Bar Bar;
|
|
|
|
typedef struct Rule Rule;
|
|
|
|
typedef struct Ruleset Ruleset;
|
|
|
|
typedef struct WMScreen WMScreen;
|
2006-06-25 09:16:03 -04:00
|
|
|
|
2006-03-23 10:36:51 +01:00
|
|
|
struct View {
|
2006-06-08 10:54:19 +02:00
|
|
|
View *next;
|
2006-04-06 11:31:54 +02:00
|
|
|
char name[256];
|
2007-02-12 01:24:24 -05:00
|
|
|
ushort id;
|
2006-06-08 10:54:19 +02:00
|
|
|
Area *area;
|
|
|
|
Area *sel;
|
|
|
|
Area *revert;
|
|
|
|
};
|
|
|
|
|
2006-02-01 17:27:53 +02:00
|
|
|
struct Area {
|
2006-06-08 10:54:19 +02:00
|
|
|
Area *next;
|
|
|
|
Frame *frame;
|
2007-02-08 20:31:12 -05:00
|
|
|
Frame *stack;
|
2006-06-08 10:54:19 +02:00
|
|
|
Frame *sel;
|
2006-03-23 10:36:51 +01:00
|
|
|
View *view;
|
2006-06-23 21:22:04 -04:00
|
|
|
Bool floating;
|
2007-02-12 01:24:24 -05:00
|
|
|
ushort id;
|
2006-03-05 00:11:08 +01:00
|
|
|
int mode;
|
2006-01-26 16:24:34 +02:00
|
|
|
XRectangle rect;
|
2005-11-18 17:54:58 +02:00
|
|
|
};
|
|
|
|
|
2006-03-05 01:55:45 +01:00
|
|
|
struct Frame {
|
2006-06-08 10:54:19 +02:00
|
|
|
Frame *cnext;
|
|
|
|
Frame *anext;
|
2007-02-08 20:31:12 -05:00
|
|
|
Frame *snext;
|
2006-06-25 09:16:03 -04:00
|
|
|
View *view;
|
2006-03-05 01:55:45 +01:00
|
|
|
Area *area;
|
2007-02-12 01:24:24 -05:00
|
|
|
ushort id;
|
2006-03-05 01:55:45 +01:00
|
|
|
XRectangle rect;
|
2007-02-14 23:20:47 -05:00
|
|
|
XRectangle crect;
|
2006-06-12 12:11:22 +02:00
|
|
|
XRectangle revert;
|
2006-03-05 01:55:45 +01:00
|
|
|
Client *client;
|
2006-06-12 12:11:22 +02:00
|
|
|
Bool collapsed;
|
2007-02-20 17:31:42 -05:00
|
|
|
XRectangle grabbox;
|
|
|
|
XRectangle titlebar;
|
2006-03-05 01:55:45 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Client {
|
2006-06-08 10:54:19 +02:00
|
|
|
Client *next;
|
|
|
|
Area *revert;
|
|
|
|
Frame *frame;
|
|
|
|
Frame *sel;
|
2006-01-25 19:39:08 +02:00
|
|
|
char name[256];
|
2006-04-06 11:31:54 +02:00
|
|
|
char tags[256];
|
2006-05-30 16:32:28 +02:00
|
|
|
char props[512];
|
2007-02-12 01:24:24 -05:00
|
|
|
uint border;
|
2006-07-11 16:15:01 +02:00
|
|
|
int proto;
|
2006-03-31 07:57:33 +02:00
|
|
|
Bool floating;
|
2006-05-22 20:35:20 +00:00
|
|
|
Bool fixedsize;
|
2007-02-15 02:43:33 -05:00
|
|
|
Bool fullscreen;
|
2007-02-08 21:50:49 -05:00
|
|
|
Bool urgent;
|
2007-02-09 22:06:07 -05:00
|
|
|
Bool mapped;
|
2007-02-11 01:09:00 -05:00
|
|
|
Bool frame_mapped;
|
2007-02-09 22:06:07 -05:00
|
|
|
int unmapped;
|
2006-03-23 05:22:43 -08:00
|
|
|
Window win;
|
|
|
|
Window trans;
|
2006-06-08 10:54:19 +02:00
|
|
|
Window framewin;
|
2007-02-20 18:29:16 -05:00
|
|
|
Cursor cursor;
|
2006-03-23 05:22:43 -08:00
|
|
|
XRectangle rect;
|
|
|
|
XSizeHints size;
|
|
|
|
GC gc;
|
2005-11-18 17:54:58 +02:00
|
|
|
};
|
|
|
|
|
2006-02-09 19:40:12 +01:00
|
|
|
struct Key {
|
2006-06-08 10:54:19 +02:00
|
|
|
Key *next;
|
|
|
|
Key *lnext;
|
|
|
|
Key *tnext;
|
2007-02-12 01:24:24 -05:00
|
|
|
ushort id;
|
2006-03-23 05:22:43 -08:00
|
|
|
char name[128];
|
2007-02-12 01:24:24 -05:00
|
|
|
ulong mod;
|
2006-03-23 05:22:43 -08:00
|
|
|
KeyCode key;
|
2006-02-09 19:40:12 +01:00
|
|
|
};
|
|
|
|
|
2006-06-08 10:54:19 +02:00
|
|
|
struct Bar {
|
|
|
|
Bar *next;
|
2006-06-26 22:21:09 -04:00
|
|
|
Bar *smaller;
|
2006-06-17 07:32:49 -04:00
|
|
|
char buf[280];
|
2006-06-22 11:46:39 +02:00
|
|
|
char text[256];
|
2006-03-23 05:22:43 -08:00
|
|
|
char name[256];
|
2007-02-12 01:24:24 -05:00
|
|
|
ushort id;
|
2006-06-22 11:03:42 +02:00
|
|
|
BlitzBrush brush;
|
2006-06-08 10:54:19 +02:00
|
|
|
};
|
2006-02-09 22:48:01 +01:00
|
|
|
|
2006-06-17 07:32:49 -04:00
|
|
|
struct Rule {
|
|
|
|
Rule *next;
|
|
|
|
regex_t regex;
|
|
|
|
char value[256];
|
|
|
|
};
|
|
|
|
|
2006-06-29 19:02:51 -04:00
|
|
|
struct Ruleset {
|
2006-06-17 07:32:49 -04:00
|
|
|
Rule *rule;
|
|
|
|
char *string;
|
2007-02-12 01:24:24 -05:00
|
|
|
uint size;
|
2006-06-29 19:02:51 -04:00
|
|
|
};
|
2006-06-17 07:32:49 -04:00
|
|
|
|
2006-06-29 19:02:51 -04:00
|
|
|
/* global variables */
|
2006-06-29 18:03:35 -04:00
|
|
|
struct {
|
2007-02-15 16:46:31 -05:00
|
|
|
BlitzColor focuscolor;
|
2006-06-19 10:28:37 +02:00
|
|
|
BlitzColor normcolor;
|
|
|
|
BlitzFont font;
|
2007-02-12 01:24:24 -05:00
|
|
|
uint border;
|
|
|
|
uint snap;
|
2006-03-10 16:21:20 +01:00
|
|
|
char *keys;
|
2007-02-12 01:24:24 -05:00
|
|
|
uint keyssz;
|
2006-06-29 19:02:51 -04:00
|
|
|
Ruleset tagrules;
|
|
|
|
Ruleset colrules;
|
2006-04-12 11:08:31 +02:00
|
|
|
char grabmod[5];
|
2007-02-12 01:24:24 -05:00
|
|
|
ulong mod;
|
2006-04-14 12:03:44 +02:00
|
|
|
int colmode;
|
2006-06-29 18:03:35 -04:00
|
|
|
} def;
|
|
|
|
|
|
|
|
struct WMScreen {
|
|
|
|
Bar *lbar;
|
|
|
|
Bar *rbar;
|
|
|
|
View *sel;
|
2007-02-13 13:19:01 -05:00
|
|
|
Client *focus;
|
2007-02-18 18:31:58 -05:00
|
|
|
Client *hasgrab;
|
2006-06-29 19:02:51 -04:00
|
|
|
Window barwin;
|
2006-06-29 18:03:35 -04:00
|
|
|
|
|
|
|
XRectangle rect;
|
|
|
|
XRectangle brect;
|
|
|
|
BlitzBrush bbrush;
|
2006-06-29 20:02:52 -04:00
|
|
|
} *screens, *screen;
|
2006-02-09 22:48:01 +01:00
|
|
|
|
2006-06-08 10:54:19 +02:00
|
|
|
Client *client;
|
2006-06-29 19:02:51 -04:00
|
|
|
View *view;
|
2006-06-08 10:54:19 +02:00
|
|
|
Key *key;
|
2007-02-23 00:07:30 -05:00
|
|
|
Client c_magic;
|
2006-06-08 10:54:19 +02:00
|
|
|
|
2006-06-25 09:16:03 -04:00
|
|
|
enum { BUFFER_SIZE = 8092 };
|
|
|
|
char buffer[BUFFER_SIZE];
|
|
|
|
|
2006-06-29 19:02:51 -04:00
|
|
|
/* IXP */
|
|
|
|
IXPServer srv;
|
2006-06-17 07:32:49 -04:00
|
|
|
P9Srv p9srv;
|
2006-06-29 19:02:51 -04:00
|
|
|
|
|
|
|
/* X11 */
|
2007-02-12 01:24:24 -05:00
|
|
|
uint num_screens;
|
2006-06-22 11:03:42 +02:00
|
|
|
Blitz blz;
|
2006-05-29 14:15:16 +02:00
|
|
|
GC xorgc;
|
2006-06-22 03:28:39 -04:00
|
|
|
char *user;
|
2006-07-11 16:15:01 +02:00
|
|
|
Atom wm_atom[WMLast];
|
2006-05-10 13:38:01 +02:00
|
|
|
Atom net_atom[NetLast];
|
2006-06-23 00:37:59 -04:00
|
|
|
Atom tags_atom;
|
2006-03-05 13:22:42 +01:00
|
|
|
Cursor cursor[CurLast];
|
2007-02-12 01:24:24 -05:00
|
|
|
uint valid_mask;
|
|
|
|
uint num_lock_mask;
|
2006-06-16 02:52:13 -04:00
|
|
|
Bool sel_screen;
|
2006-06-22 15:25:59 +02:00
|
|
|
Pixmap pmap;
|
2006-05-29 11:04:29 +02:00
|
|
|
void (*handler[LASTEvent]) (XEvent *);
|
2006-05-30 18:28:05 +02:00
|
|
|
|
2006-06-29 19:02:51 -04:00
|
|
|
/* Misc */
|
2007-02-23 23:09:58 -05:00
|
|
|
Bool starting;
|
|
|
|
Bool verbose;
|
2006-06-29 19:02:51 -04:00
|
|
|
|
2006-06-19 23:58:20 -04:00
|
|
|
/* wm.c */
|
2007-02-23 23:09:58 -05:00
|
|
|
char *message_root(char *message);
|
2005-11-18 17:54:58 +02:00
|
|
|
|
2006-02-03 17:15:36 +02:00
|
|
|
/* area.c */
|
2007-02-23 23:09:58 -05:00
|
|
|
Area *create_area(View *v, Area *pos, uint w);
|
|
|
|
void destroy_area(Area *a);
|
|
|
|
Area *area_of_id(View *t, ushort id);
|
|
|
|
void focus_area(Area *a);
|
|
|
|
char *select_area(Area *a, char *arg);
|
|
|
|
void send_to_area(Area *to, Frame *f);
|
|
|
|
void attach_to_area(Area *a, Frame *f, Bool send);
|
|
|
|
void detach_from_area(Frame *f);
|
|
|
|
Client *sel_client_of_area(Area *a);
|
2005-11-18 17:54:58 +02:00
|
|
|
|
2006-02-09 22:48:01 +01:00
|
|
|
/* bar.c */
|
2007-02-23 23:09:58 -05:00
|
|
|
Bar *create_bar(Bar **b_link, char *name);
|
|
|
|
void destroy_bar(Bar **b_link, Bar *b);
|
|
|
|
void draw_bar(WMScreen *s);
|
2007-02-03 14:27:32 -05:00
|
|
|
void draw_border(BlitzBrush *b);
|
2007-02-23 23:09:58 -05:00
|
|
|
void resize_bar();
|
|
|
|
Bar *bar_of_name(Bar *b_link, const char *name);
|
2006-02-09 22:48:01 +01:00
|
|
|
|
2005-11-18 17:54:58 +02:00
|
|
|
/* client.c */
|
2007-02-23 23:09:58 -05:00
|
|
|
Client *create_client(Window w, XWindowAttributes *wa);
|
|
|
|
void destroy_client(Client *c);
|
|
|
|
void configure_client(Client *c);
|
2007-03-02 03:13:32 -05:00
|
|
|
void prop_client(Client *c, Atom a);
|
2007-02-23 23:09:58 -05:00
|
|
|
void kill_client(Client *c);
|
|
|
|
void gravitate_client(Client *c, Bool invert);
|
|
|
|
void map_client(Client *c);
|
|
|
|
void unmap_client(Client *c, int state);
|
|
|
|
void map_frame(Client *c);
|
|
|
|
void unmap_frame(Client *c);
|
|
|
|
void set_cursor(Client *c, Cursor cur);
|
|
|
|
void focus_frame(Frame *f, Bool restack);
|
|
|
|
void reparent_client(Client *c, Window w, int x, int y);
|
|
|
|
void manage_client(Client *c);
|
|
|
|
void focus(Client *c, Bool restack);
|
|
|
|
void focus_client(Client *c);
|
|
|
|
void resize_client(Client *c, XRectangle *r);
|
2007-03-02 03:13:32 -05:00
|
|
|
void apply_sizehints(Client *c, XRectangle *r, Bool floating, Bool frame, BlitzAlign sticky);
|
2007-02-23 23:09:58 -05:00
|
|
|
char *send_client(Frame *f, char *arg, Bool swap);
|
|
|
|
char * message_client(Client *c, char *message);
|
|
|
|
void move_client(Client *c, char *arg);
|
|
|
|
void size_client(Client *c, char *arg);
|
|
|
|
Client *sel_client();
|
|
|
|
Frame *frame_of_win(Window w);
|
|
|
|
Client *client_of_win(Window w);
|
|
|
|
void update_client_grab(Client *c);
|
|
|
|
void apply_rules(Client *c);
|
|
|
|
void apply_tags(Client *c, const char *tags);
|
2006-04-12 10:44:07 +02:00
|
|
|
|
|
|
|
/* column.c */
|
2007-02-23 23:09:58 -05:00
|
|
|
void arrange_column(Area *a, Bool dirty);
|
|
|
|
void resize_column(Client *c, XRectangle *r);
|
|
|
|
int column_mode_of_str(char *arg);
|
|
|
|
char *str_of_column_mode(int mode);
|
|
|
|
Area *new_column(View *v, Area *pos, uint w);
|
2005-11-18 17:54:58 +02:00
|
|
|
|
2006-10-12 16:10:57 +02:00
|
|
|
/* draw.c */
|
2007-02-23 23:09:58 -05:00
|
|
|
int loadcolor(Blitz *blitz, BlitzColor *c);
|
|
|
|
void draw_label(BlitzBrush *b, char *text);
|
|
|
|
void draw_tile(BlitzBrush *b);
|
|
|
|
void draw_rect(BlitzBrush *b);
|
2006-10-12 18:26:30 +02:00
|
|
|
|
2007-02-23 23:09:58 -05:00
|
|
|
void drawbg(Display *dpy, Drawable drawable, GC gc,
|
2007-02-05 04:38:32 -05:00
|
|
|
XRectangle *rect, BlitzColor c, Bool fill, Bool border);
|
2007-02-23 23:09:58 -05:00
|
|
|
void drawcursor(Display *dpy, Drawable drawable, GC gc,
|
2007-02-12 01:24:24 -05:00
|
|
|
int x, int y, uint h, BlitzColor c);
|
2007-02-23 23:09:58 -05:00
|
|
|
uint textwidth(BlitzFont *font, char *text);
|
|
|
|
uint textwidth_l(BlitzFont *font, char *text, uint len);
|
|
|
|
void loadfont(Blitz *blitz, BlitzFont *font);
|
|
|
|
uint labelh(BlitzFont *font);
|
|
|
|
char *parse_colors(char **buf, int *buflen, BlitzColor *col);
|
2006-10-12 16:10:57 +02:00
|
|
|
|
2005-11-18 17:54:58 +02:00
|
|
|
/* event.c */
|
2007-02-23 23:09:58 -05:00
|
|
|
void check_x_event(IXPConn *c);
|
|
|
|
uint flush_masked_events(long even_mask);
|
2005-11-18 17:54:58 +02:00
|
|
|
|
2006-03-08 13:00:10 +01:00
|
|
|
/* frame.c */
|
2007-02-23 23:09:58 -05:00
|
|
|
Frame *create_frame(Client *c, View *v);
|
|
|
|
void remove_frame(Frame *f);
|
|
|
|
void insert_frame(Frame *pos, Frame *f, Bool before);
|
|
|
|
void resize_frame(Frame *f, XRectangle *r);
|
|
|
|
Bool frame_to_top(Frame *f);
|
|
|
|
void set_frame_cursor(Frame *f, int x, int y);
|
|
|
|
void swap_frames(Frame *fa, Frame *fb);
|
|
|
|
int frame_delta_h();
|
2007-03-02 03:13:32 -05:00
|
|
|
void frame2client(XRectangle *r);
|
|
|
|
void client2frame(XRectangle *r);
|
2007-02-23 23:09:58 -05:00
|
|
|
void draw_frame(Frame *f);
|
|
|
|
void draw_frames();
|
|
|
|
void update_frame_widget_colors(Frame *f);
|
2007-02-03 14:27:32 -05:00
|
|
|
void check_frame_constraints(XRectangle *rect);
|
2006-03-08 13:00:10 +01:00
|
|
|
|
2006-06-19 18:26:06 +02:00
|
|
|
/* fs.c */
|
2007-02-23 23:09:58 -05:00
|
|
|
void fs_attach(P9Req *r);
|
|
|
|
void fs_clunk(P9Req *r);
|
|
|
|
void fs_create(P9Req *r);
|
|
|
|
void fs_flush(P9Req *r);
|
|
|
|
void fs_freefid(Fid *f);
|
|
|
|
void fs_open(P9Req *r);
|
|
|
|
void fs_read(P9Req *r);
|
|
|
|
void fs_remove(P9Req *r);
|
|
|
|
void fs_stat(P9Req *r);
|
|
|
|
void fs_walk(P9Req *r);
|
|
|
|
void fs_write(P9Req *r);
|
|
|
|
void write_event(char *format, ...);
|
2006-02-01 23:24:07 +02:00
|
|
|
|
2006-06-12 13:20:30 +02:00
|
|
|
/* geom.c */
|
2007-02-23 23:09:58 -05:00
|
|
|
Bool ispointinrect(int x, int y, XRectangle * r);
|
|
|
|
BlitzAlign quadofcoord(XRectangle *rect, int x, int y);
|
|
|
|
Cursor cursor_of_quad(BlitzAlign align);
|
|
|
|
int strtorect(XRectangle *r, const char *val);
|
|
|
|
BlitzAlign get_sticky(XRectangle *src, XRectangle *dst);
|
|
|
|
int r_east(XRectangle *r);
|
|
|
|
int r_south(XRectangle *r);
|
2006-06-12 13:20:30 +02:00
|
|
|
|
2006-04-12 10:44:07 +02:00
|
|
|
/* key.c */
|
2007-02-23 23:09:58 -05:00
|
|
|
void kpress(Window w, ulong mod, KeyCode keycode);
|
|
|
|
void update_keys();
|
|
|
|
void init_lock_keys();
|
|
|
|
ulong mod_key_of_str(char *val);
|
2006-02-09 19:40:12 +01:00
|
|
|
|
2005-11-18 17:54:58 +02:00
|
|
|
/* mouse.c */
|
2007-02-23 23:09:58 -05:00
|
|
|
void do_mouse_resize(Client *c, Bool grabbox, BlitzAlign align);
|
|
|
|
void grab_mouse(Window w, ulong mod, ulong button);
|
|
|
|
void ungrab_mouse(Window w, ulong mod, uint button);
|
|
|
|
BlitzAlign snap_rect(XRectangle *rects, int num, XRectangle *current,
|
2006-06-04 23:47:09 -04:00
|
|
|
BlitzAlign *mask, int snap);
|
2007-02-23 23:09:58 -05:00
|
|
|
void grab_button(Window w, uint button, ulong mod);
|
2005-11-18 17:54:58 +02:00
|
|
|
|
2006-03-10 11:50:52 +01:00
|
|
|
/* rule.c */
|
2007-02-23 23:09:58 -05:00
|
|
|
void update_rules(Rule **rule, const char *data);
|
|
|
|
void trim(char *str, const char *chars);
|
2006-03-10 11:50:52 +01:00
|
|
|
|
2007-02-11 22:17:20 -05:00
|
|
|
/* util.c */
|
2007-02-23 23:09:58 -05:00
|
|
|
uint tokenize(char *res[], uint reslen, char *str, char delim);
|
|
|
|
char *estrdup(const char *str);
|
|
|
|
void *erealloc(void *ptr, uint size);
|
|
|
|
void *emallocz(uint size);
|
|
|
|
void *emalloc(uint size);
|
|
|
|
void fatal(const char *fmt, ...);
|
|
|
|
int max(int a, int b);
|
|
|
|
char *str_nil(char *s);
|
2007-02-11 22:17:20 -05:00
|
|
|
|
2006-03-23 10:43:57 +01:00
|
|
|
/* view.c */
|
2007-02-23 23:09:58 -05:00
|
|
|
void arrange_view(View *v);
|
|
|
|
void scale_view(View *v, float w);
|
|
|
|
View *get_view(const char *name);
|
|
|
|
View *create_view(const char *name);
|
|
|
|
void focus_view(WMScreen *s, View *v);
|
|
|
|
void update_client_views(Client *c, char **tags);
|
|
|
|
XRectangle *rects_of_view(View *v, uint *num, Frame *ignore);
|
|
|
|
View *view_of_id(ushort id);
|
|
|
|
void select_view(const char *arg);
|
|
|
|
void attach_to_view(View *v, Frame *f);
|
|
|
|
Client *sel_client_of_view(View *v);
|
|
|
|
char *message_view(View *v, char *message);
|
|
|
|
void restack_view(View *v);
|
|
|
|
uchar *view_index(View *v);
|
|
|
|
void destroy_view(View *v);
|
|
|
|
void update_views();
|
|
|
|
uint newcolw_of_view(View *v);
|
2005-11-18 17:54:58 +02:00
|
|
|
|
2005-12-05 03:15:25 +02:00
|
|
|
/* wm.c */
|
2007-02-23 23:09:58 -05:00
|
|
|
int wmii_error_handler(Display *dpy, XErrorEvent *error);
|
|
|
|
int win_proto(Window w);
|