dwm.c
changeset 1029 2388a478f146
parent 1027 0735e86bbd49
child 1030 e50c3eb0f55a
equal deleted inserted replaced
1028:b4c4c98205cc 1029:2388a478f146
    23  *
    23  *
    24  * Keys and tagging rules are organized as arrays and defined in config.h.
    24  * Keys and tagging rules are organized as arrays and defined in config.h.
    25  *
    25  *
    26  * To understand everything else, start reading main().
    26  * To understand everything else, start reading main().
    27  */
    27  */
       
    28 #include "dwm.h"
       
    29 
    28 #include <errno.h>
    30 #include <errno.h>
    29 #include <locale.h>
    31 #include <locale.h>
    30 #include <stdarg.h>
    32 #include <stdarg.h>
    31 #include <stdio.h>
    33 #include <stdio.h>
    32 #include <stdlib.h>
    34 #include <stdlib.h>
    37 #include <sys/wait.h>
    39 #include <sys/wait.h>
    38 #include <regex.h>
    40 #include <regex.h>
    39 #include <X11/cursorfont.h>
    41 #include <X11/cursorfont.h>
    40 #include <X11/keysym.h>
    42 #include <X11/keysym.h>
    41 #include <X11/Xatom.h>
    43 #include <X11/Xatom.h>
    42 #include <X11/Xlib.h>
       
    43 #include <X11/Xproto.h>
    44 #include <X11/Xproto.h>
    44 #include <X11/Xutil.h>
    45 #include <X11/Xutil.h>
    45 
    46 
    46 /* macros */
    47 /* macros */
    47 #define BUTTONMASK		(ButtonPressMask | ButtonReleaseMask)
    48 #define BUTTONMASK		(ButtonPressMask | ButtonReleaseMask)
    52 enum { BarTop, BarBot, BarOff };			/* bar position */
    53 enum { BarTop, BarBot, BarOff };			/* bar position */
    53 enum { CurNormal, CurResize, CurMove, CurLast };	/* cursor */
    54 enum { CurNormal, CurResize, CurMove, CurLast };	/* cursor */
    54 enum { ColBorder, ColFG, ColBG, ColLast };		/* color */
    55 enum { ColBorder, ColFG, ColBG, ColLast };		/* color */
    55 enum { NetSupported, NetWMName, NetLast };		/* EWMH atoms */
    56 enum { NetSupported, NetWMName, NetLast };		/* EWMH atoms */
    56 enum { WMProtocols, WMDelete, WMName, WMState, WMLast };/* default atoms */
    57 enum { WMProtocols, WMDelete, WMName, WMState, WMLast };/* default atoms */
    57 
       
    58 /* typedefs */
       
    59 typedef struct Client Client;
       
    60 
       
    61 struct Client {
       
    62 	char name[256];
       
    63 	int x, y, w, h;
       
    64 	int rx, ry, rw, rh; /* revert geometry */
       
    65 	int basew, baseh, incw, inch, maxw, maxh, minw, minh;
       
    66 	int minax, maxax, minay, maxay;
       
    67 	long flags;
       
    68 	unsigned int border, oldborder;
       
    69 	Bool isbanned, isfixed, ismax, isfloating, wasfloating;
       
    70 	Bool *tags;
       
    71 	Client *next;
       
    72 	Client *prev;
       
    73 	Client *snext;
       
    74 	Window win;
       
    75 };
       
    76 
    58 
    77 typedef struct {
    59 typedef struct {
    78 	int x, y, w, h;
    60 	int x, y, w, h;
    79 	unsigned long norm[ColLast];
    61 	unsigned long norm[ColLast];
    80 	unsigned long sel[ColLast];
    62 	unsigned long sel[ColLast];