2008-01-13 15:44:01 +01:00
|
|
|
/*
|
|
|
|
* structs.h - basic structs header
|
|
|
|
*
|
|
|
|
* Copyright © 2007-2008 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef AWESOME_STRUCTS_H
|
|
|
|
#define AWESOME_STRUCTS_H
|
|
|
|
|
|
|
|
#include <regex.h>
|
|
|
|
#include "layout.h"
|
2008-01-24 18:48:11 +01:00
|
|
|
#include "common/draw.h"
|
2008-01-26 17:58:01 +01:00
|
|
|
#include "common/swindow.h"
|
2008-03-13 09:28:21 +01:00
|
|
|
#include "common/xscreen.h"
|
2008-01-13 15:44:01 +01:00
|
|
|
|
|
|
|
/** Rules for floating rule */
|
|
|
|
typedef enum
|
|
|
|
{
|
2008-02-05 17:34:00 +01:00
|
|
|
No = False,
|
|
|
|
Yes = True,
|
2008-03-14 17:33:10 +01:00
|
|
|
Maybe
|
2008-02-05 17:31:37 +01:00
|
|
|
} Fuzzy;
|
2008-01-13 15:44:01 +01:00
|
|
|
|
|
|
|
/** Cursors */
|
|
|
|
enum
|
|
|
|
{ CurNormal, CurResize, CurMove, CurLast };
|
|
|
|
|
2008-03-14 20:35:24 +01:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
SimpleWindow *sw;
|
|
|
|
Position position;
|
2008-03-15 13:59:04 +01:00
|
|
|
Position dposition;
|
2008-03-15 11:13:45 +01:00
|
|
|
Alignment text_align;
|
2008-03-14 20:35:24 +01:00
|
|
|
Position icon;
|
|
|
|
} Titlebar;
|
|
|
|
|
2008-01-13 15:44:01 +01:00
|
|
|
/** Rule type */
|
|
|
|
typedef struct Rule Rule;
|
|
|
|
struct Rule
|
|
|
|
{
|
|
|
|
char *icon;
|
|
|
|
char *xprop;
|
|
|
|
int screen;
|
2008-02-05 17:31:37 +01:00
|
|
|
Fuzzy isfloating;
|
|
|
|
Fuzzy ismaster;
|
2008-03-14 20:35:24 +01:00
|
|
|
Titlebar titlebar;
|
2008-01-25 23:48:24 +01:00
|
|
|
double opacity;
|
2008-01-13 15:44:01 +01:00
|
|
|
regex_t *prop_r;
|
|
|
|
regex_t *tags_r;
|
|
|
|
regex_t *xpropval_r;
|
2008-03-10 10:37:23 +01:00
|
|
|
/** Next and previous rules */
|
|
|
|
Rule *prev, *next;
|
2008-01-13 15:44:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/** Key bindings */
|
|
|
|
typedef struct Key Key;
|
|
|
|
struct Key
|
|
|
|
{
|
|
|
|
unsigned long mod;
|
2008-02-08 14:35:32 +01:00
|
|
|
KeyCode keycode;
|
2008-01-13 15:44:01 +01:00
|
|
|
Uicb *func;
|
|
|
|
char *arg;
|
2008-03-10 10:37:23 +01:00
|
|
|
/** Next and previous keys */
|
|
|
|
Key *prev, *next;
|
2008-01-13 15:44:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/** Mouse buttons bindings */
|
|
|
|
typedef struct Button Button;
|
|
|
|
struct Button
|
|
|
|
{
|
|
|
|
unsigned long mod;
|
|
|
|
unsigned int button;
|
|
|
|
Uicb *func;
|
|
|
|
char *arg;
|
2008-03-10 10:37:23 +01:00
|
|
|
/** Next and previous buttons */
|
|
|
|
Button *prev, *next;
|
2008-01-13 15:44:01 +01:00
|
|
|
};
|
|
|
|
|
2008-03-04 19:06:04 +01:00
|
|
|
/** Widget tell status code */
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
WIDGET_NOERROR = 0,
|
|
|
|
WIDGET_ERROR,
|
2008-03-06 14:30:18 +01:00
|
|
|
WIDGET_ERROR_NOVALUE,
|
2008-03-04 19:06:04 +01:00
|
|
|
WIDGET_ERROR_CUSTOM,
|
|
|
|
WIDGET_ERROR_FORMAT_BOOL,
|
|
|
|
WIDGET_ERROR_FORMAT_FONT,
|
2008-03-06 14:30:18 +01:00
|
|
|
WIDGET_ERROR_FORMAT_COLOR,
|
2008-03-04 19:06:04 +01:00
|
|
|
WIDGET_ERROR_FORMAT_SECTION
|
|
|
|
} widget_tell_status_t;
|
|
|
|
|
2008-01-13 15:44:01 +01:00
|
|
|
/** Widget */
|
|
|
|
typedef struct Widget Widget;
|
|
|
|
typedef struct Statusbar Statusbar;
|
|
|
|
struct Widget
|
|
|
|
{
|
|
|
|
/** Widget name */
|
|
|
|
char *name;
|
|
|
|
/** Draw function */
|
|
|
|
int (*draw)(Widget *, DrawCtx *, int, int);
|
|
|
|
/** Update function */
|
2008-03-04 19:06:04 +01:00
|
|
|
widget_tell_status_t (*tell)(Widget *, char *, char *);
|
2008-01-13 15:44:01 +01:00
|
|
|
/** ButtonPressedEvent handler */
|
|
|
|
void (*button_press)(Widget *, XButtonPressedEvent *);
|
|
|
|
/** Statusbar */
|
|
|
|
Statusbar *statusbar;
|
|
|
|
/** Alignement */
|
|
|
|
Alignment alignment;
|
|
|
|
/** Misc private data */
|
|
|
|
void *data;
|
|
|
|
/** True if user supplied coords */
|
|
|
|
Bool user_supplied_x;
|
|
|
|
Bool user_supplied_y;
|
2008-03-14 09:37:25 +01:00
|
|
|
/** area_t */
|
|
|
|
area_t area;
|
2008-01-13 15:44:01 +01:00
|
|
|
/** Buttons bindings */
|
|
|
|
Button *buttons;
|
|
|
|
/** Cache */
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
Bool needs_update;
|
|
|
|
int flags;
|
|
|
|
} cache;
|
2008-03-10 10:37:23 +01:00
|
|
|
/** Next and previous widgets */
|
|
|
|
Widget *prev, *next;
|
2008-01-13 15:44:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/** Status bar */
|
|
|
|
struct Statusbar
|
|
|
|
{
|
2008-01-23 15:54:30 +01:00
|
|
|
/** Window */
|
|
|
|
SimpleWindow *sw;
|
2008-01-13 15:44:01 +01:00
|
|
|
/** Statusbar name */
|
|
|
|
char *name;
|
|
|
|
/** Bar width */
|
|
|
|
int width;
|
|
|
|
/** Bar height */
|
|
|
|
int height;
|
|
|
|
/** Default position */
|
|
|
|
Position dposition;
|
|
|
|
/** Bar position */
|
|
|
|
Position position;
|
|
|
|
/** Screen */
|
|
|
|
int screen;
|
|
|
|
/** Widget list */
|
|
|
|
Widget *widgets;
|
2008-03-20 09:08:15 +01:00
|
|
|
/** Draw context */
|
|
|
|
DrawCtx *ctx;
|
2008-03-10 10:37:23 +01:00
|
|
|
/** Next and previous statusbars */
|
|
|
|
Statusbar *prev, *next;
|
2008-01-13 15:44:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/** Client type */
|
2008-01-16 07:57:54 +01:00
|
|
|
typedef struct Client Client;
|
2008-01-13 15:44:01 +01:00
|
|
|
struct Client
|
|
|
|
{
|
|
|
|
/** Client name */
|
|
|
|
char name[256];
|
|
|
|
/** Window geometry */
|
2008-03-14 09:37:25 +01:00
|
|
|
area_t geometry;
|
2008-01-13 15:44:01 +01:00
|
|
|
/** Floating window geometry */
|
2008-03-14 09:37:25 +01:00
|
|
|
area_t f_geometry;
|
2008-01-13 15:44:01 +01:00
|
|
|
/** Max window geometry */
|
2008-03-14 09:37:25 +01:00
|
|
|
area_t m_geometry;
|
2008-01-13 15:44:01 +01:00
|
|
|
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
|
|
|
|
int minax, maxax, minay, maxay;
|
|
|
|
int border, oldborder;
|
|
|
|
/** 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;
|
|
|
|
/** True if the client must be skipped from client list */
|
|
|
|
Bool skip;
|
2008-03-16 17:51:46 +01:00
|
|
|
/** True if the client is moving */
|
|
|
|
Bool ismoving;
|
2008-01-13 15:44:01 +01:00
|
|
|
/** True if the client must be skipped from task bar client list */
|
|
|
|
Bool skiptb;
|
2008-03-10 10:37:23 +01:00
|
|
|
/** Next and previous clients */
|
|
|
|
Client *prev, *next;
|
2008-01-13 15:44:01 +01:00
|
|
|
/** Window of the client */
|
|
|
|
Window win;
|
|
|
|
/** Client logical screen */
|
|
|
|
int screen;
|
|
|
|
/** True if the client is a new one */
|
|
|
|
Bool newcomer;
|
2008-03-14 14:27:56 +01:00
|
|
|
/** Titlebar */
|
2008-03-14 20:35:24 +01:00
|
|
|
Titlebar titlebar;
|
2008-01-13 15:44:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct client_node_t client_node_t;
|
|
|
|
struct client_node_t
|
|
|
|
{
|
|
|
|
Client *client;
|
2008-03-10 10:37:23 +01:00
|
|
|
/** Next and previous client_nodes */
|
|
|
|
client_node_t *prev, *next;
|
2008-01-13 15:44:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/** Tag type */
|
|
|
|
typedef struct Tag Tag;
|
|
|
|
struct Tag
|
|
|
|
{
|
|
|
|
/** Tag name */
|
|
|
|
char *name;
|
2008-01-17 18:43:55 +01:00
|
|
|
/** Screen */
|
|
|
|
int screen;
|
2008-01-13 15:44:01 +01:00
|
|
|
/** True if selected */
|
|
|
|
Bool selected;
|
|
|
|
/** True if was selected before selecting others tags */
|
|
|
|
Bool was_selected;
|
|
|
|
/** Current tag layout */
|
|
|
|
Layout *layout;
|
|
|
|
/** Master width factor */
|
|
|
|
double mwfact;
|
|
|
|
/** Number of master windows */
|
|
|
|
int nmaster;
|
|
|
|
/** Number of columns in tile layout */
|
|
|
|
int ncol;
|
2008-03-10 10:37:23 +01:00
|
|
|
/** Next and previous tags */
|
|
|
|
Tag *prev, *next;
|
2008-01-13 15:44:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/** tag_client_node type */
|
|
|
|
typedef struct tag_client_node_t tag_client_node_t;
|
|
|
|
struct tag_client_node_t
|
|
|
|
{
|
|
|
|
Tag *tag;
|
|
|
|
Client *client;
|
2008-03-10 10:37:23 +01:00
|
|
|
/** Next and previous tag_client_nodes */
|
|
|
|
tag_client_node_t *prev, *next;
|
2008-01-13 15:44:01 +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;
|
|
|
|
|
2008-03-17 19:26:28 +01:00
|
|
|
typedef area_t (FloatingPlacement)(Client *);
|
2008-01-13 15:44:01 +01:00
|
|
|
typedef struct
|
|
|
|
{
|
2008-03-14 20:35:24 +01:00
|
|
|
/** Titlebar default parameters */
|
|
|
|
Titlebar titlebar_default;
|
2008-01-13 15:44:01 +01:00
|
|
|
/** Number of pixels to snap windows */
|
|
|
|
int snap;
|
|
|
|
/** Border size */
|
|
|
|
int borderpx;
|
2008-03-08 10:48:15 +01:00
|
|
|
/** Mwfact limits */
|
|
|
|
float mwfact_upper_limit, mwfact_lower_limit;
|
2008-02-13 18:04:20 +01:00
|
|
|
/** Floating window placement algo */
|
|
|
|
FloatingPlacement *floating_placement;
|
2008-01-13 15:44:01 +01:00
|
|
|
/** Respect resize hints */
|
|
|
|
Bool resize_hints;
|
|
|
|
/** Sloppy focus: focus follow mouse */
|
|
|
|
Bool sloppy_focus;
|
2008-01-25 23:27:32 +01:00
|
|
|
/** True if we should raise windows on focus */
|
|
|
|
Bool sloppy_focus_raise;
|
2008-01-13 15:44:01 +01:00
|
|
|
/** Focus new clients */
|
|
|
|
Bool new_get_focus;
|
|
|
|
/** True if new clients should become master */
|
|
|
|
Bool new_become_master;
|
2008-01-17 19:17:53 +01:00
|
|
|
/** True if we need to arrange() */
|
|
|
|
Bool need_arrange;
|
2008-03-13 14:03:03 +01:00
|
|
|
/** Colors */
|
|
|
|
struct
|
|
|
|
{
|
2008-03-14 08:35:06 +01:00
|
|
|
style_t normal;
|
|
|
|
style_t focus;
|
|
|
|
style_t urgent;
|
|
|
|
} styles;
|
2008-02-04 14:54:50 +01:00
|
|
|
/** Transparency of unfocused clients */
|
|
|
|
int opacity_unfocused;
|
2008-01-13 15:44:01 +01:00
|
|
|
/** Tag list */
|
|
|
|
Tag *tags;
|
|
|
|
/** Layout list */
|
|
|
|
Layout *layouts;
|
|
|
|
/** Status bar */
|
|
|
|
Statusbar *statusbar;
|
|
|
|
/** Padding */
|
2008-01-15 16:52:30 +01:00
|
|
|
Padding padding;
|
2008-01-13 15:44:01 +01:00
|
|
|
} VirtScreen;
|
|
|
|
|
|
|
|
/** Main configuration structure */
|
|
|
|
typedef struct AwesomeConf AwesomeConf;
|
|
|
|
struct AwesomeConf
|
|
|
|
{
|
|
|
|
/** Display ref */
|
|
|
|
Display *display;
|
|
|
|
/** Logical screens */
|
|
|
|
VirtScreen *screens;
|
2008-03-13 09:28:21 +01:00
|
|
|
/** Screens info */
|
|
|
|
ScreensInfo *screens_info;
|
2008-01-13 15:44:01 +01:00
|
|
|
/** Rules list */
|
|
|
|
Rule *rules;
|
|
|
|
/** Keys bindings list */
|
|
|
|
Key *keys;
|
|
|
|
/** Mouse bindings list */
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
Button *root;
|
|
|
|
Button *client;
|
2008-03-19 15:34:07 +01:00
|
|
|
Button *titlebar;
|
2008-01-13 15:44:01 +01:00
|
|
|
} buttons;
|
|
|
|
/** Numlock mask */
|
|
|
|
unsigned int numlockmask;
|
|
|
|
/** Check for XShape extension */
|
|
|
|
Bool have_shape;
|
|
|
|
/** Check for XRandR extension */
|
|
|
|
Bool have_randr;
|
|
|
|
/** Cursors */
|
|
|
|
Cursor cursor[CurLast];
|
|
|
|
/** Clients list */
|
|
|
|
Client *clients;
|
2008-02-06 08:49:31 +01:00
|
|
|
/** Scratch client */
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
Client *client;
|
|
|
|
Bool isvisible;
|
|
|
|
} scratch;
|
2008-01-13 15:44:01 +01:00
|
|
|
/** Path to config file */
|
|
|
|
char *configpath;
|
|
|
|
/** Selected clients history */
|
|
|
|
client_node_t *focus;
|
|
|
|
/** Link between tags and clients */
|
|
|
|
tag_client_node_t *tclink;
|
|
|
|
/** Command line passed to awesome */
|
|
|
|
char *argv;
|
2008-03-04 10:14:13 +01:00
|
|
|
/** Last XMotionEvent coords */
|
|
|
|
int pointer_x, pointer_y;
|
2008-01-13 15:44:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|