1
/* matchbox - a lightweight window manager
3
Copyright 2002 Matthew Allum
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; either version 2, or (at your option)
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
22
#include <X11/Xutil.h>
23
#include <X11/Xatom.h>
25
#include <X11/Xft/Xft.h>
31
#define APPLY_GRAVITY 1
32
#define REMOVE_GRAVITY -1
34
#define DOCK_HEIGHT 16
35
#define DOCK_MIN_HEIGHT 4
37
#define STACK_REMOVE 1
40
#define BUTTON_NEXT_PRESSED 1
41
#define BUTTON_PREV_PRESSED 2
42
#define BUTTON_CLOSE_PRESSED 3
44
#define MENU_FLAG (1<<1)
45
#define SINGLE_FLAG (1<<2) /* hack to specify when only a single client */
47
#define Wm wm /* tmp to avoid breakage */
50
#define START_CLIENT_LOOP(w,c) (c) = (w)->head_client; do {
51
#define END_CLIENT_LOOP(w,c) } while (((c) = (c)->next) \
52
&& ((c) != (w)->head_client) );
54
#define WBW(c) ((c)->wm->theme->win_border_width)
56
typedef enum { dialog, toolbar, detached,
57
override, docked, menu, mainwin } Client_type;
59
typedef struct _client
64
struct _client *trans;
66
int x, y, width, height;
68
int tmp_data; /* must be a better way */
77
void (* reparent)( struct _client* c );
78
void (* redraw)( struct _client* c, Bool use_cache );
79
void (* button_press) (struct _client *c, XButtonEvent *e);
80
void (* move_resize)( struct _client* c );
81
void (* configure)( struct _client* c );
82
void (* get_coverage)( struct _client* c, int* x, int* y, int* h, int* w );
83
void (* hide)( struct _client* c );
84
void (* show)( struct _client* c );
85
void (* destroy)( struct _client* c );
108
typedef enum { plain, gradient, pixmap } Theme_type;
111
typedef struct _theme
114
XFontStruct* toolbar_font;
118
XftFont *toolbar_xftfont;
125
int win_border_width;
129
XColor bg_col; /* for win borders, lines */
130
XColor text_col; /* for text */
131
XColor fg_col; /* main fg color */
132
XColor fg_start_col, fg_end_col; /* for gradients & bevels */
134
GC text_gc, toolbar_text_gc, bg_gc, fg_gc, effects_gc, mask_gc, invert_gc;
136
Cursor move_curs, resize_curs;
140
typedef struct _wm_config
148
unsigned int modifier;
150
char theme_file[255];
151
char display_name[128];
162
client* head_client; /* For ptr to beginning of list */
163
client* focused_client; /* currently focused client */
164
client* main_client; /* currently viewable main client */
170
int lock; /* to go, replaced by flags */
177
Cursor move_curs, resize_curs, curs;
179
/* To do, set in an array */
180
Atom wm_state, wm_change_state, wm_protos, wm_delete, wm_cmapwins,
181
mb_theme, mb_command;