plan9port/src/cmd/rio/dat.h

176 lines
3.2 KiB
C
Raw Normal View History

2004-03-21 04:27:28 +00:00
/* Copyright (c) 1994-1996 David Hogan, see README for licence details */
#define BORDER _border
#define CORNER _corner
2004-03-21 04:27:28 +00:00
#define INSET _inset
2004-04-19 19:35:17 +00:00
#define MAXHIDDEN 128
2004-03-21 04:27:28 +00:00
#define B3FIXED 5
#define AllButtonMask (Button1Mask|Button2Mask|Button3Mask \
|Button4Mask|Button5Mask)
#define ButtonMask (ButtonPressMask|ButtonReleaseMask)
#define MenuMask (ButtonMask|ButtonMotionMask|ExposureMask)
#define MenuGrabMask (ButtonMask|ButtonMotionMask|StructureNotifyMask)
#ifdef Plan9
#define DEFSHELL "/bin/rc"
#else
#define DEFSHELL "/bin/sh"
#endif
typedef struct Client Client;
typedef struct Menu Menu;
typedef struct ScreenInfo ScreenInfo;
2004-03-30 05:01:53 +00:00
typedef enum BorderOrient BorderOrient;
2004-03-21 04:27:28 +00:00
struct Client {
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;
char *label;
char *instance;
char *class;
char *name;
char *iconname;
Colormap cmap;
int ncmapwins;
Window *cmapwins;
Colormap *wmcmaps;
ScreenInfo *screen;
};
#define hidden(c) ((c)->state == IconicState)
#define withdrawn(c) ((c)->state == WithdrawnState)
#define normal(c) ((c)->state == NormalState)
/* c->proto */
#define Pdelete 1
#define Ptakefocus 2
2004-03-30 05:01:53 +00:00
#define Plosefocus 4
2004-03-21 04:27:28 +00:00
struct Menu {
char **item;
char *(*gen)();
int lasthit;
};
2004-03-30 05:01:53 +00:00
enum BorderOrient {
BorderUnknown = 0, /* we depend on this!*/
BorderN,
2004-03-30 05:01:53 +00:00
BorderNNE,
BorderENE,
BorderE,
2004-03-30 05:01:53 +00:00
BorderESE,
BorderSSE,
BorderS,
2004-03-30 05:01:53 +00:00
BorderSSW,
BorderWSW,
BorderW,
2004-03-30 05:01:53 +00:00
BorderWNW,
BorderNNW,
NBorder,
};
2004-03-21 04:27:28 +00:00
struct ScreenInfo {
int num;
int depth;
2004-03-30 05:01:53 +00:00
Visual *vis;
2004-03-21 04:27:28 +00:00
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];
2004-03-21 04:27:28 +00:00
Pixmap root_pixmap;
char display[256]; /* arbitrary limit */
};
/* main.c */
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;
2004-03-21 04:27:28 +00:00
extern int _inset;
extern int curtime;
extern int debug;
extern int solidsweep;
2004-04-19 19:35:17 +00:00
extern Atom exit_rio;
extern Atom restart_rio;
2004-03-21 04:27:28 +00:00
extern Atom wm_state;
extern Atom wm_change_state;
2004-04-19 19:35:17 +00:00
extern Atom _rio_hold_mode;
2004-03-21 04:27:28 +00:00
extern Atom wm_protocols;
extern Atom wm_delete;
extern Atom wm_take_focus;
2004-03-30 05:01:53 +00:00
extern Atom wm_lose_focus;
2004-03-21 04:27:28 +00:00
extern Atom wm_colormaps;
/* client.c */
extern Client *clients;
extern Client *current;
/* menu.c */
extern Client *hiddenc[];
extern int numhidden;
extern char *b3items[];
extern Menu b3menu;
/* manage.c */
extern int isNew;
2004-03-21 04:27:28 +00:00
/* error.c */
extern int ignore_badwindow;