awesome/config.h

281 lines
6 KiB
C
Raw Normal View History

2007-12-10 13:43:28 +01:00
/*
2007-09-12 14:29:51 +02:00
* config.h - configuration management header
*
* Copyright © 2007 Julien Danjou <julien@danjou.info>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
2007-09-12 14:29:51 +02:00
*/
2007-09-05 20:15:00 +02:00
#ifndef AWESOME_CONFIG_H
#define AWESOME_CONFIG_H
2007-09-05 20:15:00 +02:00
#include <X11/Xlib.h>
2007-10-01 19:22:57 +02:00
#include <X11/Xft/Xft.h>
2007-10-15 12:40:45 +02:00
#include <regex.h>
#include <draw.h>
2007-09-05 20:15:00 +02:00
/** Bar possible position */
enum
{ BarTop, BarBot, BarLeft, BarRight, BarOff };
2007-09-05 20:15:00 +02:00
2007-12-23 15:16:10 +01:00
/** Common colors */
2007-09-05 20:15:00 +02:00
enum
2007-12-23 15:16:10 +01:00
{ ColBorder, ColFG, ColBG, ColLast };
2007-09-05 20:15:00 +02:00
enum
{ CurNormal, CurResize, CurMove, CurLast }; /* cursor */
2007-09-12 18:16:20 +02:00
2007-11-12 19:25:10 +01:00
typedef struct Rule Rule;
struct Rule
2007-09-05 20:15:00 +02:00
{
char *prop;
char *tags;
2007-11-12 18:21:03 +01:00
int screen;
2007-09-05 20:15:00 +02:00
Bool isfloating;
2007-10-15 12:40:45 +02:00
regex_t *propregex;
regex_t *tagregex;
2007-11-12 19:25:10 +01:00
Rule *next;
};
2007-09-05 20:15:00 +02:00
typedef struct AwesomeConf AwesomeConf;
2007-09-05 20:15:00 +02:00
2007-12-14 17:57:05 +01:00
typedef struct Layout Layout;
struct Layout
2007-09-05 20:15:00 +02:00
{
char *image;
void (*arrange) (int);
2007-12-14 17:57:05 +01:00
Layout *next;
};
2007-09-05 20:15:00 +02:00
typedef struct Key Key;
struct Key
2007-09-05 20:15:00 +02:00
{
unsigned long mod;
KeySym keysym;
void (*func) (int, char *);
char *arg;
Key *next;
};
2007-09-05 20:15:00 +02:00
typedef struct Button Button;
struct Button
{
unsigned long mod;
unsigned int button;
void (*func) (int, char *);
char *arg;
Button *next;
};
/** Status bar */
typedef struct Widget Widget;
typedef struct
{
/** Bar width */
int width;
/** Bar height */
int height;
/** Layout txt width */
int txtlayoutwidth;
/** Default position */
int dposition;
/** Bar position */
int position;
2007-09-07 17:29:36 +02:00
/** Window */
Window window;
/** Screen */
int screen;
/** Screen */
Widget *widgets;
} Statusbar;
2007-10-11 21:50:32 +02:00
typedef struct Client Client;
struct Client
{
/** Client name */
char name[256];
/** Window geometry */
int x, y, w, h;
/** Real window geometry for floating */
int rx, ry, rw, rh;
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
int minax, maxax, minay, maxay;
long flags;
int border, oldborder;
2007-12-23 15:16:10 +01:00
/** Has urgency hint */
Bool isurgent;
/** Store previous floating state before maximizing */
Bool wasfloating;
/** True if the window is floating */
Bool isfloating;
/** True if the window is fixed */
Bool isfixed;
/** True if the window is maximized */
Bool ismax;
2007-10-11 21:50:32 +02:00
/** Next client */
Client *next;
/** Previous client */
Client *prev;
/** Window of the client */
Window win;
/** Client display */
Display *display;
/** Client logical screen */
int screen;
/** Client physical screen */
int phys_screen;
};
2007-12-14 21:51:54 +01:00
typedef struct FocusList FocusList;
struct FocusList
{
Client *client;
FocusList *prev;
};
/** Tag type */
typedef struct Tag Tag;
struct Tag
{
/** Tag name */
char *name;
/** True if selected */
Bool selected;
/** True if was selected before selecting others tags */
Bool was_selected;
/** Current tag layout */
Layout *layout;
2007-11-11 11:48:26 +01:00
/** Master width factor */
double mwfact;
2007-11-11 11:53:10 +01:00
/** Number of master windows */
int nmaster;
2007-11-11 11:55:20 +01:00
/** Number of columns in tile layout */
int ncol;
/** Next tag */
Tag *next;
};
/** TagClientLink type */
typedef struct TagClientLink TagClientLink;
struct TagClientLink
{
Tag *tag;
Client *client;
TagClientLink *next;
};
2007-11-27 23:03:55 +01:00
/** Padding type */
typedef struct
{
/** Padding at top */
int top;
/** Padding at bottom */
int bottom;
/** Padding at left */
int left;
/** Padding at right */
int right;
} Padding;
typedef struct
2007-09-05 20:15:00 +02:00
{
/** Number of pixels to snap windows */
int snap;
/** Border size */
int borderpx;
/** Transparency of unfocused clients */
int opacity_unfocused;
/** Focus move pointer */
Bool focus_move_pointer;
/** Allow floats to be lowered on focus change */
Bool allow_lower_floats;
/** Respect resize hints */
Bool resize_hints;
/** Normal colors */
XColor colors_normal[ColLast];
/** Selected colors */
XColor colors_selected[ColLast];
2007-12-23 15:16:10 +01:00
/** Urgency colors */
XColor colors_urgent[ColLast];
2007-09-05 20:15:00 +02:00
/** Tag list */
2007-09-24 15:37:52 +02:00
Tag *tags;
TagClientLink *tclink;
2007-09-05 20:15:00 +02:00
/** Layout list */
Layout *layouts;
/** Status bar */
Statusbar *statusbar;
/** Padding */
Padding padding;
/** Font */
XftFont *font;
} VirtScreen;
struct Widget
{
char *name;
2007-12-16 04:28:29 +01:00
int (*draw)(Widget *, DrawCtx *, int, int);
void (*tell)(Widget *, char *);
Statusbar *statusbar;
int alignment;
void *data;
int location;
int width;
Widget *next;
};
/** Main configuration structure */
struct AwesomeConf
{
/** Display ref */
Display *display;
/** Logical screens */
VirtScreen *screens;
2007-09-05 20:15:00 +02:00
/** Rules list */
Rule *rules;
/** Keys bindings list */
2007-09-05 20:15:00 +02:00
Key *keys;
/** Mouse bindings list */
struct
{
Button *tag;
Button *title;
Button *layout;
Button *root;
Button *client;
} buttons;
2007-09-05 20:15:00 +02:00
/** Numlock mask */
unsigned int numlockmask;
2007-09-13 15:57:35 +02:00
/** Check for XShape extension */
Bool have_shape;
2007-09-13 16:00:03 +02:00
/** Check for XRandR extension */
Bool have_randr;
2007-10-10 13:29:46 +02:00
/** Cursors */
Cursor cursor[CurLast];
2007-10-11 21:50:32 +02:00
/** Clients list */
Client *clients;
2007-10-31 11:37:38 +01:00
/** Path to config file */
char *configpath;
2007-12-14 21:51:54 +01:00
/** Selected clients on this tag */
FocusList *focus;
2007-09-05 20:15:00 +02:00
};
void config_parse(const char *);
2007-09-05 20:15:00 +02:00
#endif
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80