1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357
|
/* Copyright (c) 1994-1996 David Hogan, see README for licence details */
/* Many changes by Lars Bernhardsson. */
/* Less changes by Florian Forster <octopus@verplant.org> */
#define VERSION "larswm 7.5.3+patches [22-JAN-2006] by Lars Bernhardsson <lab@fnurt.net>"
#define BORDER 2
#define TILE_PAD 2
#define L_OFF_R 32768
#define L_OFF_G 32768
#define L_OFF_B 32768
#define L_ON_R 65535
#define L_ON_G 0
#define L_ON_B 0
#define L_DELTA 16384
#define L_TOP(x) (unsigned short) (((x) + L_DELTA) > 65535 ? 65535 : (x) + L_DELTA)
#define L_BOT(x) (unsigned short) (((x) - L_DELTA) < 0 ? 0 : (x) - L_DELTA)
#define BAR_HEIGHT (2 + font->ascent + font->descent)
#define BAR_TEXT_Y (1 + font->ascent)
#define BAR_X(s) 0
#define BAR_Y(s) (DisplayHeight (dpy, (s)->num) - BAR_HEIGHT)
#define BAR_WIDTH(s) (DisplayWidth (dpy, (s)->num))
#define DEFSHELL "/bin/sh"
#define DEFRC "/etc/X11/larswmrc"
#define MAXSCREENS 4
#define MAXDESKTOPS 16
#define MAXFLOATCLASS 64
#define MAXTOOLCLASS 64
#define MAXSTICKYCLASS 64
#define MAXNOTILECLASS 64
#define MAXDTCLASS 64
#define MAXHIDDEN 64
#define MAXAPPS 64
#define MAXBTNAPPS 3
#define MAXSWITCHCLASSES 64
/* for zooming */
#define DIM_VERT 1
#define DIM_HORIZ 2
#define DIM_OUTSIDE 4
/* to keep track of if a window is zoomed max */
/* height/width/both or select zoomed */
#define ZOOM_UNZOOMED 0
#define ZOOM_NORMAL 1
#define ZOOM_SELECT 2
typedef struct Client Client;
typedef struct ScreenInfo ScreenInfo;
typedef struct Prefs Prefs;
struct Client
{
Window window;
Window parent;
Window trans;
Client *next;
int x;
int y;
int dx;
int dy;
int border;
int zx;
int zy;
int zdx;
int zdy;
int iszoom;
int isleft;
int isaside;
int ax;
int ay;
XSizeHints size;
int min_dx;
int min_dy;
int state;
int hidden;
int init;
int reparenting;
int proto;
int desktop;
int isfloat;
int istool;
int issticky;
int isshaped;
int isnotile;
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
struct ScreenInfo
{
int num;
Window root;
Window barwin;
Colormap def_cmap;
GC gc;
#ifdef THREE_D
GC topwhitegc;
GC botwhitegc;
GC topblackgc;
GC botblackgc;
#endif
unsigned long black;
unsigned long white;
#ifdef THREE_D
unsigned long topwhite;
unsigned long botwhite;
unsigned long topblack;
unsigned long botblack;
#endif
int min_cmaps;
Cursor place;
Cursor sweep;
char display[256];
int desktop;
int tile_height;
int res_height;
int bigmr[MAXDESKTOPS];
int clickthru[MAXDESKTOPS];
int tile_resize[MAXDESKTOPS];
int skip_focus[MAXDESKTOPS];
int left_track_width[MAXDESKTOPS];
int notile_raised[MAXDESKTOPS];
Client *focused[MAXDESKTOPS];
Client *notilefocused[MAXDESKTOPS];
};
struct Prefs
{
int clickthru[MAXSCREENS][MAXDESKTOPS];
int tile_resize[MAXSCREENS][MAXDESKTOPS];
int skip_focus[MAXSCREENS][MAXDESKTOPS];
int left_track_width[MAXSCREENS][MAXDESKTOPS];
int desktops;
char *dtname[MAXSCREENS][MAXDESKTOPS];
char *bgstr;
char *fgstr;
char *fname;
char *application[MAXAPPS];
char *btnapplication[MAXBTNAPPS];
char *switchclass[MAXSWITCHCLASSES];
char *switchclass_app[MAXSWITCHCLASSES];
char *floatclass[MAXFLOATCLASS];
char *toolclass[MAXTOOLCLASS];
char *notileclass[MAXNOTILECLASS];
char *stickyclass[MAXSTICKYCLASS];
char *dtclass[MAXDTCLASS];
int dtnum[MAXDTCLASS];
/* keycodes for shortcuts */
KeySym prev_screen_key;
unsigned long prev_screen_mod;
KeySym next_screen_key;
unsigned long next_screen_mod;
KeySym prev_desktop_key;
unsigned long prev_desktop_mod;
KeySym next_desktop_key;
unsigned long next_desktop_mod;
KeySym prev_desktop_drag_key;
unsigned long prev_desktop_drag_mod;
KeySym next_desktop_drag_key;
unsigned long next_desktop_drag_mod;
KeySym prev_window_key;
unsigned long prev_window_mod;
KeySym next_window_key;
unsigned long next_window_mod;
KeySym raise_notile_key;
unsigned long raise_notile_mod;
KeySym move_northwest_key;
unsigned long move_northwest_mod;
KeySym move_north_key;
unsigned long move_north_mod;
KeySym move_northeast_key;
unsigned long move_northeast_mod;
KeySym move_west_key;
unsigned long move_west_mod;
KeySym move_center_key;
unsigned long move_center_mod;
KeySym move_east_key;
unsigned long move_east_mod;
KeySym move_southwest_key;
unsigned long move_southwest_mod;
KeySym move_south_key;
unsigned long move_south_mod;
KeySym move_southeast_key;
unsigned long move_southeast_mod;
KeySym move_select_key;
unsigned long move_select_mod;
KeySym move_aside_key;
unsigned long move_aside_mod;
KeySym move_aside_other_key;
unsigned long move_aside_other_mod;
KeySym move_sd_key;
unsigned long move_sd_mod;
KeySym toggle_inc_key;
unsigned long toggle_inc_mod;
KeySym move_up_key;
unsigned long move_up_mod;
KeySym move_down_key;
unsigned long move_down_mod;
KeySym move_left_key;
unsigned long move_left_mod;
KeySym move_right_key;
unsigned long move_right_mod;
KeySym grow_vert_key;
unsigned long grow_vert_mod;
KeySym shrink_vert_key;
unsigned long shrink_vert_mod;
KeySym grow_horiz_key;
unsigned long grow_horiz_mod;
KeySym shrink_horiz_key;
unsigned long shrink_horiz_mod;
KeySym grow_both_key;
unsigned long grow_both_mod;
KeySym shrink_both_key;
unsigned long shrink_both_mod;
KeySym zoom_vert_key;
unsigned long zoom_vert_mod;
KeySym zoom_horiz_key;
unsigned long zoom_horiz_mod;
KeySym zoom_full_key;
unsigned long zoom_full_mod;
KeySym zoom_full2_key;
unsigned long zoom_full2_mod;
KeySym hide_key;
unsigned long hide_mod;
KeySym unhide_key;
unsigned long unhide_mod;
KeySym close_key;
unsigned long close_mod;
KeySym goto_desktop_key[MAXDESKTOPS];
unsigned long goto_desktop_mod[MAXDESKTOPS];
KeySym application_key[MAXAPPS];
unsigned long application_mod[MAXAPPS];
KeySym switchclass_key[MAXSWITCHCLASSES];
unsigned long switchclass_mod[MAXSWITCHCLASSES];
};
/* main.c */
extern Display *dpy;
extern ScreenInfo *screens;
extern int num_screens;
extern int initting;
extern XFontStruct *font;
extern char **myargv;
extern Bool shape;
extern char *shell;
extern Atom exit_larswm;
extern Atom restart_larswm;
extern Atom bartext_larswm;
extern Atom wm_state;
extern Atom wm_change_state;
extern Atom wm_protocols;
extern Atom wm_delete;
extern Atom wm_colormaps;
/* client.c */
extern Client *clients;
extern Client *current;
extern Client *prev_current;
/* buttons.c */
extern Client *hiddenc[];
extern int numhidden;
/* error.c */
extern int ignore_badwindow;
/* prefs.c */
extern Prefs prefs;
/* bar.c */
extern int bar_hidden;
|