2019-12-02 18:23:00 +00:00
|
|
|
/* Copyright (c) 1994-1996 David Hogan, see README for licence details */
|
|
|
|
|
|
|
|
#ifndef BORDER
|
2021-02-26 18:01:22 +00:00
|
|
|
#define BORDER _border
|
2019-12-02 18:23:00 +00:00
|
|
|
#endif
|
2021-02-26 18:01:22 +00:00
|
|
|
#define CORNER _corner
|
|
|
|
#define INSET _inset
|
|
|
|
#define MAXHIDDEN 128
|
2021-11-16 22:16:28 +00:00
|
|
|
#if defined(SHOWMAX) && defined(SHOWSTICK)
|
2021-03-08 20:51:53 +00:00
|
|
|
#define B3FIXED 7
|
2021-11-16 22:16:28 +00:00
|
|
|
#elif defined(SHOWMAX) || defined(SHOWSTICK)
|
2021-02-26 18:01:22 +00:00
|
|
|
#define B3FIXED 6
|
2021-02-11 04:26:23 +00:00
|
|
|
#else
|
2021-02-26 18:01:22 +00:00
|
|
|
#define B3FIXED 5
|
2021-02-11 04:26:23 +00:00
|
|
|
#endif
|
2021-02-26 18:01:22 +00:00
|
|
|
#define NUMVIRTUALS 12
|
2019-12-02 18:23:00 +00:00
|
|
|
|
2021-11-16 22:16:28 +00:00
|
|
|
#define AllButtonMask \
|
2021-02-26 18:01:22 +00:00
|
|
|
(Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask)
|
|
|
|
#define ButtonMask (ButtonPressMask | ButtonReleaseMask)
|
|
|
|
#define MenuMask (ButtonMask | ButtonMotionMask | ExposureMask)
|
|
|
|
#define MenuGrabMask (ButtonMask | ButtonMotionMask | StructureNotifyMask)
|
2019-12-02 18:23:00 +00:00
|
|
|
|
2021-02-26 18:01:22 +00:00
|
|
|
#ifdef Plan9
|
|
|
|
#define DEFSHELL "/bin/rc"
|
2019-12-02 18:23:00 +00:00
|
|
|
#else
|
2021-02-26 18:01:22 +00:00
|
|
|
#define DEFSHELL "/bin/sh"
|
2019-12-02 18:23:00 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef struct Client Client;
|
|
|
|
typedef struct Menu Menu;
|
|
|
|
typedef struct ScreenInfo ScreenInfo;
|
|
|
|
|
|
|
|
struct Client {
|
2021-02-26 18:01:22 +00:00
|
|
|
Window window;
|
|
|
|
Window parent;
|
|
|
|
Window trans;
|
|
|
|
Client* next;
|
|
|
|
Client* revert;
|
|
|
|
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
int dx;
|
|
|
|
int dy;
|
|
|
|
int border;
|
|
|
|
|
|
|
|
XSizeHints size;
|
|
|
|
int min_dx;
|
|
|
|
int min_dy;
|
|
|
|
|
|
|
|
int state;
|
|
|
|
int init;
|
|
|
|
int reparenting;
|
|
|
|
int is9term;
|
|
|
|
int hold;
|
|
|
|
int proto;
|
|
|
|
int virt;
|
|
|
|
|
|
|
|
char* label;
|
|
|
|
char* instance;
|
|
|
|
char* class;
|
|
|
|
char* name;
|
|
|
|
char* iconname;
|
|
|
|
|
|
|
|
Colormap cmap;
|
|
|
|
int ncmapwins;
|
|
|
|
Window* cmapwins;
|
|
|
|
Colormap* wmcmaps;
|
|
|
|
ScreenInfo* screen;
|
2019-12-02 18:23:00 +00:00
|
|
|
};
|
|
|
|
|
2021-02-26 18:01:22 +00:00
|
|
|
#define hidden(c) ((c)->state == IconicState)
|
|
|
|
#define withdrawn(c) ((c)->state == WithdrawnState)
|
|
|
|
#define normal(c) ((c)->state == NormalState)
|
2019-12-02 18:23:00 +00:00
|
|
|
|
|
|
|
/* c->proto */
|
2021-02-26 18:01:22 +00:00
|
|
|
#define Pdelete 1
|
|
|
|
#define Ptakefocus 2
|
|
|
|
#define Plosefocus 4
|
2019-12-02 18:23:00 +00:00
|
|
|
|
|
|
|
struct Menu {
|
2021-02-26 18:01:22 +00:00
|
|
|
char** item;
|
|
|
|
char* (*gen)();
|
|
|
|
int lasthit;
|
2019-12-02 18:23:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum BorderOrient {
|
2021-02-26 18:01:22 +00:00
|
|
|
BorderUnknown = 0, /* we depend on this!*/
|
|
|
|
BorderN,
|
|
|
|
BorderNNE,
|
|
|
|
BorderENE,
|
|
|
|
BorderE,
|
|
|
|
BorderESE,
|
|
|
|
BorderSSE,
|
|
|
|
BorderS,
|
|
|
|
BorderSSW,
|
|
|
|
BorderWSW,
|
|
|
|
BorderW,
|
|
|
|
BorderWNW,
|
|
|
|
BorderNNW,
|
|
|
|
NBorder
|
2019-12-02 18:23:00 +00:00
|
|
|
};
|
|
|
|
typedef enum BorderOrient BorderOrient;
|
|
|
|
|
|
|
|
struct ScreenInfo {
|
2021-02-26 18:01:22 +00:00
|
|
|
int num;
|
|
|
|
int depth;
|
|
|
|
Visual* vis;
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
Window root;
|
|
|
|
Window menuwin;
|
|
|
|
Window sweepwin;
|
|
|
|
Colormap def_cmap;
|
|
|
|
GC gc;
|
|
|
|
GC gccopy;
|
|
|
|
GC gcred;
|
|
|
|
GC gcsweep;
|
|
|
|
GC gcmenubg;
|
|
|
|
GC gcmenubgs;
|
|
|
|
GC gcmenufg;
|
|
|
|
GC gcmenufgs;
|
|
|
|
unsigned long black;
|
|
|
|
unsigned long white;
|
|
|
|
unsigned long activeholdborder;
|
|
|
|
unsigned long inactiveholdborder;
|
|
|
|
unsigned long activeborder;
|
|
|
|
unsigned long inactiveborder;
|
|
|
|
unsigned long red;
|
|
|
|
Pixmap bkup[2];
|
|
|
|
int min_cmaps;
|
|
|
|
Cursor target;
|
|
|
|
Cursor sweep0;
|
|
|
|
Cursor boxcurs;
|
|
|
|
Cursor arrow;
|
|
|
|
Cursor bordcurs[NBorder];
|
|
|
|
Pixmap root_pixmap;
|
|
|
|
char display[256]; /* arbitrary limit */
|
2019-12-02 18:23:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* main.c */
|
2021-02-26 18:01:22 +00:00
|
|
|
extern Display* dpy;
|
|
|
|
extern ScreenInfo* screens;
|
|
|
|
extern int num_screens;
|
|
|
|
extern int initting;
|
|
|
|
extern XFontStruct* font;
|
|
|
|
extern int nostalgia;
|
|
|
|
extern char** myargv;
|
|
|
|
extern Bool shape;
|
|
|
|
extern char* termprog;
|
|
|
|
extern char* shell;
|
|
|
|
extern char* version[];
|
|
|
|
extern int _border;
|
|
|
|
extern int _corner;
|
|
|
|
extern int _inset;
|
|
|
|
extern int curtime;
|
|
|
|
extern int debug;
|
|
|
|
extern int solidsweep;
|
|
|
|
extern int numvirtuals;
|
|
|
|
extern int scrolling;
|
|
|
|
extern int ffm; /* focus follows mouse */
|
|
|
|
|
|
|
|
extern Atom exit_rio;
|
|
|
|
extern Atom restart_rio;
|
|
|
|
extern Atom wm_state;
|
|
|
|
extern Atom wm_change_state;
|
|
|
|
extern Atom _rio_hold_mode;
|
|
|
|
extern Atom wm_protocols;
|
|
|
|
extern Atom wm_delete;
|
|
|
|
extern Atom wm_take_focus;
|
|
|
|
extern Atom wm_lose_focus;
|
|
|
|
extern Atom wm_colormaps;
|
|
|
|
extern Atom wm_state_fullscreen;
|
|
|
|
extern Atom wm_state;
|
2019-12-02 18:23:00 +00:00
|
|
|
/* client.c */
|
2021-02-26 18:01:22 +00:00
|
|
|
extern Client* clients;
|
|
|
|
extern Client* current;
|
|
|
|
extern Client* currents[];
|
2019-12-02 18:23:00 +00:00
|
|
|
|
|
|
|
/* menu.c */
|
2021-02-26 18:01:22 +00:00
|
|
|
extern Client* hiddenc[];
|
|
|
|
extern int numhidden;
|
|
|
|
extern char* b2items[];
|
|
|
|
extern Menu b2menu;
|
|
|
|
extern char* b3items[];
|
|
|
|
extern Menu b3menu;
|
|
|
|
extern int virt;
|
2019-12-02 18:23:00 +00:00
|
|
|
|
|
|
|
/* manage.c */
|
2021-02-26 18:01:22 +00:00
|
|
|
extern int isNew;
|
2021-05-27 04:42:13 +00:00
|
|
|
extern int zoom;
|
2019-12-02 18:23:00 +00:00
|
|
|
|
|
|
|
/* error.c */
|
2021-02-26 18:01:22 +00:00
|
|
|
extern int ignore_badwindow;
|
2019-12-02 18:23:00 +00:00
|
|
|
|
|
|
|
/* key.c and event.c share this */
|
|
|
|
|
2021-02-26 18:01:22 +00:00
|
|
|
extern int kbLaunch;
|