wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

commit 7c3c475918feae424537d9ed0d814f2208962640
parent afa5c137c1f6df0b9cc8e9ee85c714c585ca5b87
Author: Kris Maglione <jg@suckless.org>
Date:   Mon, 12 Feb 2007 01:24:24 -0500

Added u(char|short|int|long|vlong) and vlong types


Diffstat:
area.c | 20++++++++++----------
bar.c | 4++--
client.c | 12++++++------
column.c | 18+++++++++---------
draw.c | 16++++++++--------
event.c | 4++--
frame.c | 2+-
fs.c | 54+++++++++++++++++++++++++++---------------------------
key.c | 18+++++++++---------
main.c | 10+++++-----
mouse.c | 6+++---
printevent.c | 16++++++++--------
view.c | 40++++++++++++++++++++--------------------
wmii.h | 86++++++++++++++++++++++++++++++++++++++++++++++---------------------------------
14 files changed, 160 insertions(+), 146 deletions(-)

diff --git a/area.c b/area.c @@ -17,10 +17,10 @@ sel_client_of_area(Area *a) { } Area * -create_area(View *v, Area *pos, unsigned int w) { - static unsigned short id = 1; - unsigned int area_num, col_num, i; - unsigned int min_width; +create_area(View *v, Area *pos, uint w) { + static ushort id = 1; + uint area_num, col_num, i; + uint min_width; Area *a, **p; min_width = screen->rect.width/NCOL; @@ -77,7 +77,7 @@ destroy_area(Area *a) { Client *c; Area *ta; View *v; - unsigned int i; + uint i; v = a->view; @@ -118,7 +118,7 @@ send_to_area(Area *to, Area *from, Frame *f) { void attach_to_area(Area *a, Frame *f, Bool send) { - unsigned int h, n_frame; + uint h, n_frame; Frame *ft; Client *c; View *v; @@ -163,7 +163,7 @@ detach_from_area(Area *a, Frame *f) { Client *c; View *v; Area *ta; - unsigned int i; + uint i; v = a->view; c = f->client; @@ -209,7 +209,7 @@ detach_from_area(Area *a, Frame *f) { static void place_client(Area *a, Client *c) { - static unsigned int mx, my; + static uint mx, my; static Bool *field; BlitzAlign align; XPoint p1 = {0, 0}; @@ -217,7 +217,7 @@ place_client(Area *a, Client *c) { XRectangle *rects; Frame *f, *fr; Bool fit; - unsigned int i, j, x, y, dx, dy, cx, cy, maxx, maxy, diff, num; + uint i, j, x, y, dx, dy, cx, cy, maxx, maxy, diff, num; int snap; snap = screen->rect.height / 66; @@ -355,7 +355,7 @@ focus_area(Area *a) { char * select_area(Area *a, char *arg) { Area *new; - unsigned int i; + uint i; Frame *p, *f; View *v; static char Ebadvalue[] = "bad value"; diff --git a/bar.c b/bar.c @@ -10,7 +10,7 @@ Bar *free_bars = nil; Bar * create_bar(Bar **b_link, char *name) { - static unsigned int id = 1; + static uint id = 1; Bar **i, *b = bar_of_name(*b_link, name);; if(b) @@ -62,7 +62,7 @@ resize_bar(WMScreen *s) { void draw_bar(WMScreen *s) { - unsigned int width, tw, nb, size; + uint width, tw, nb, size; float shrink; Bar *b, *tb, *largest, **pb; diff --git a/client.c b/client.c @@ -204,7 +204,7 @@ set_client_state(Client * c, int state) /* type */ wm_atom[WMState], /* format */ 32, /* mode */ PropModeReplace, - /* data */ (unsigned char *) data, + /* data */ (uchar *) data, /* npositions */2 ); } @@ -473,9 +473,9 @@ destroy_client(Client *c) { void match_sizehints(Client *c, XRectangle *r, Bool floating, BlitzAlign sticky) { XSizeHints *s = &c->size; - unsigned int dx = 2 * def.border; - unsigned int dy = def.border + labelh(&def.font); - unsigned int hdiff, wdiff; + uint dx = 2 * def.border; + uint dy = def.border + labelh(&def.font); + uint hdiff, wdiff; if(floating && (s->flags & PMinSize)) { if(r->width < s->min_width + dx) { @@ -766,7 +766,7 @@ compare_tags(const void *a, const void *b) { void apply_tags(Client *c, const char *tags) { - unsigned int i, j, k, n; + uint i, j, k, n; int len; Bool add; char buf[512], last; @@ -848,7 +848,7 @@ apply_tags(Client *c, const char *tags) { toks[n] = nil; update_client_views(c, toks); XChangeProperty(blz.dpy, c->win, tags_atom, XA_STRING, 8, - PropModeReplace, (unsigned char *)c->tags, strlen(c->tags)); + PropModeReplace, (uchar *)c->tags, strlen(c->tags)); } static void diff --git a/column.c b/column.c @@ -29,7 +29,7 @@ column_mode_of_str(char *arg) { static void relax_column(Area *a) { - unsigned int frame_size, yoff, h; + uint frame_size, yoff, h; Frame *f; int hdiff; Bool fallthrough = False; @@ -75,7 +75,7 @@ relax_column(Area *a) { int hx; for(hx = 1; hx < hdiff; hx++) for(f=a->frame; f && (hx < hdiff); f=f->anext) { - unsigned int tmp = f->rect.height; + uint tmp = f->rect.height; f->rect.height += hx; hdiff -= (f->rect.height - tmp); } @@ -93,9 +93,9 @@ relax_column(Area *a) { void scale_column(Area *a, float h) { - unsigned int yoff, frame_size = 0; + uint yoff, frame_size = 0; Frame *f; - unsigned int min_height = 2 * labelh(&def.font); + uint min_height = 2 * labelh(&def.font); float scale, dy = 0; int hdiff; @@ -129,8 +129,8 @@ scale_column(Area *a, float h) { void arrange_column(Area *a, Bool dirty) { Frame *f; - unsigned int num_frames = 0, yoff = a->rect.y, h; - unsigned int min_height = 2 * labelh(&def.font); + uint num_frames = 0, yoff = a->rect.y, h; + uint min_height = 2 * labelh(&def.font); if(a->floating || !a->frame) return; @@ -199,8 +199,8 @@ resize_column(Client *c, XRectangle *new) { Frame *north, *south, *f; View *v; BlitzAlign sticky; - unsigned int min_height; - unsigned int min_width; + uint min_height; + uint min_width; f = c->sel; a = f->area; @@ -301,7 +301,7 @@ AfterVertical: } Area * -new_column(View *v, Area *pos, unsigned int w) { +new_column(View *v, Area *pos, uint w) { Area *a = create_area(v, pos, w); if(!a) return nil; diff --git a/draw.c b/draw.c @@ -6,8 +6,8 @@ #include <stdlib.h> #include <string.h> -unsigned int -textwidth_l(BlitzFont *font, char *text, unsigned int len) { +uint +textwidth_l(BlitzFont *font, char *text, uint len) { if(font->set) { XRectangle r; XmbTextExtents(font->set, text, len, &r, nil); @@ -16,7 +16,7 @@ textwidth_l(BlitzFont *font, char *text, unsigned int len) { return XTextWidth(font->xfont, text, len); } -unsigned int +uint textwidth(BlitzFont *font, char *text) { return textwidth_l(font, text, strlen(text)); } @@ -67,7 +67,7 @@ loadfont(Blitz *blitz, BlitzFont *font) { font->height = font->ascent + font->descent; } -unsigned int +uint labelh(BlitzFont *font) { return font->height + 2; } @@ -86,7 +86,7 @@ draw_border(BlitzBrush *b) { void draw_label(BlitzBrush *b, char *text) { - unsigned int x, y, w, h, len; + uint x, y, w, h, len; Bool shortened = False; static char buf[2048]; XRectangle r = {0}; @@ -162,7 +162,7 @@ drawbg(Display *dpy, Drawable drawable, GC gc, XRectangle *rect, void drawcursor(Display *dpy, Drawable drawable, GC gc, - int x, int y, unsigned int h, BlitzColor c) + int x, int y, uint h, BlitzColor c) { XSegment s[5]; @@ -186,7 +186,7 @@ drawcursor(Display *dpy, Drawable drawable, GC gc, XDrawSegments(dpy, drawable, gc, s, 5); } -static unsigned long +static ulong xloadcolor(Blitz *blitz, char *colstr) { XColor color; char col[8]; @@ -210,7 +210,7 @@ loadcolor(Blitz *blitz, BlitzColor *c) { char * parse_colors(char **buf, int *buflen, BlitzColor *col) { - unsigned int i; + uint i; if(*buflen < 23 || 3 != sscanf(*buf, "#%06x #%06x #%06x", &i,&i,&i)) return "bad value"; (*buflen) -= 23; diff --git a/event.c b/event.c @@ -8,10 +8,10 @@ #include <X11/keysym.h> #include "printevent.h" -unsigned int +uint flush_masked_events(long even_mask) { XEvent ev; - unsigned int n = 0; + uint n = 0; while(XCheckMaskEvent(blz.dpy, even_mask, &ev)) n++; return n; } diff --git a/frame.c b/frame.c @@ -7,7 +7,7 @@ Frame * create_frame(Client *c, View *v) { - static unsigned short id = 1; + static ushort id = 1; Frame *f = ixp_emallocz(sizeof(Frame)); f->id = id++; diff --git a/fs.c b/fs.c @@ -15,9 +15,9 @@ typedef struct Dirtab Dirtab; struct Dirtab { char *name; - unsigned char qtype; - unsigned int type; - unsigned int perm; + uchar qtype; + uint type; + uint perm; }; typedef struct FidLink FidLink; @@ -39,10 +39,10 @@ struct FileId { Ruleset *rule; BlitzColor *col; } content; - unsigned int id; - unsigned int index; + uint id; + uint index; Dirtab tab; - unsigned short nref; + ushort nref; }; /* Constants */ @@ -66,7 +66,7 @@ static char Ebadcmd[] = "bad command"; /* Macros */ -#define QID(t, i) (((long long)((t)&0xFF)<<32)|((i)&0xFFFFFFFF)) +#define QID(t, i) (((vlong)((t)&0xFF)<<32)|((i)&0xFFFFFFFF)) /* Global Vars */ /***************/ @@ -141,7 +141,7 @@ static FileId * get_file() { FileId *temp; if(!free_fileid) { - unsigned int i = 15; + uint i = 15; temp = ixp_emallocz(sizeof(FileId) * i); for(; i; i--) { temp->next = free_fileid; @@ -174,7 +174,7 @@ clone_files(FileId *f) { /* This should be moved to libixp */ static void -write_buf(P9Req *r, void *buf, unsigned int len) { +write_buf(P9Req *r, void *buf, uint len) { if(r->ifcall.offset >= len) return; @@ -188,8 +188,8 @@ write_buf(P9Req *r, void *buf, unsigned int len) { /* This should be moved to libixp */ void -write_to_buf(P9Req *r, void *buf, unsigned int *len, unsigned int max) { - unsigned int offset, count; +write_to_buf(P9Req *r, void *buf, uint *len, uint max) { + uint offset, count; offset = (r->fid->omode&P9OAPPEND) ? *len : r->ifcall.offset; if(offset > *len || r->ifcall.count == 0) { @@ -216,7 +216,7 @@ write_to_buf(P9Req *r, void *buf, unsigned int *len, unsigned int max) { /* This should be moved to libixp */ void data_to_cstring(P9Req *r) { - unsigned int i; + uint i; i = r->ifcall.count; if(!i || r->ifcall.data[i - 1] != '\n') r->ifcall.data = ixp_erealloc(r->ifcall.data, ++i); @@ -227,7 +227,7 @@ data_to_cstring(P9Req *r) { char * message_root(char *message) { - unsigned int n; + uint n; if(!strchr(message, ' ')) { snprintf(buffer, BUFFER_SIZE, "%s ", message); @@ -261,14 +261,14 @@ message_root(char *message) } else if(!strncmp(message, "border ", 7)) { message += 7; - n = (unsigned int)strtol(message, &message, 10); + n = (uint)strtol(message, &message, 10); if(*message) return Ebadvalue; def.border = n; } else if(!strncmp(message, "grabmod ", 8)) { message += 8; - unsigned long mod; + ulong mod; mod = mod_key_of_str(message); if(!(mod & (Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask))) return Ebadvalue; @@ -284,7 +284,7 @@ message_root(char *message) char * read_root_ctl() { - unsigned int i = 0; + uint i = 0; if(screen->sel) i += snprintf(&buffer[i], (BUFFER_SIZE - i), "view %s\n", screen->sel->name); i += snprintf(&buffer[i], (BUFFER_SIZE - i), "focuscolors %s\n", def.focuscolor.colstr); @@ -313,7 +313,7 @@ respond_event(P9Req *r) { void write_event(char *format, ...) { - unsigned int len, slen; + uint len, slen; va_list ap; FidLink *f; FileId *fi; @@ -338,7 +338,7 @@ write_event(char *format, ...) { } static void -dostat(Stat *s, unsigned int len, FileId *f) { +dostat(Stat *s, uint len, FileId *f) { s->type = 0; s->dev = 0; s->qid.path = QID(f->tab.type, f->id); @@ -366,7 +366,7 @@ lookup_file(FileId *parent, char *name) Client *c; View *v; Bar *b; - unsigned int id; + uint id; if(!(parent->tab.perm & P9DMDIR)) return nil; @@ -391,7 +391,7 @@ lookup_file(FileId *parent, char *name) }if(name) goto LastItem; } if(name) { - id = (unsigned int)strtol(name, &name, 16); + id = (uint)strtol(name, &name, 16); if(*name) goto NextItem; } for(c=client; c; c=c->next) { @@ -403,7 +403,7 @@ lookup_file(FileId *parent, char *name) file->id = c->win; file->tab = *dir; file->tab.name = ixp_emallocz(16); - snprintf(file->tab.name, 16, "0x%x", (unsigned int)c->win); + snprintf(file->tab.name, 16, "0x%x", (uint)c->win); if(name) goto LastItem; } } @@ -550,7 +550,7 @@ fs_walk(P9Req *r) { respond(r, nil); } -unsigned int +uint fs_size(FileId *f) { switch(f->tab.type) { default: @@ -571,7 +571,7 @@ void fs_stat(P9Req *r) { Stat s; int size; - unsigned char *buf; + uchar *buf; dostat(&s, fs_size(r->fid->aux), r->fid->aux); r->ofcall.nstat = size = ixp_sizeof_stat(&s); @@ -604,7 +604,7 @@ fs_read(P9Req *r) { if(offset >= r->ifcall.offset) { if(size < n) break; - ixp_pack_stat((unsigned char **)&buf, &size, &s); + ixp_pack_stat((uchar **)&buf, &size, &s); } offset += n; } @@ -654,7 +654,7 @@ fs_read(P9Req *r) { return; } r->ofcall.data = ixp_emallocz(16); - n = snprintf(r->ofcall.data, 16, "0x%x", (unsigned int)f->index); + n = snprintf(r->ofcall.data, 16, "0x%x", (uint)f->index); assert(n >= 0); r->ofcall.count = n; respond(r, nil); @@ -680,7 +680,7 @@ void fs_write(P9Req *r) { FileId *f; char *errstr = nil; - unsigned int i; + uint i; if(r->ifcall.count == 0) { respond(r, nil); @@ -730,7 +730,7 @@ fs_write(P9Req *r) { return; case FsFRctl: data_to_cstring(r); - { unsigned int n; + { uint n; char *toks[32]; n = ixp_tokenize(toks, 32, r->ifcall.data, '\n'); for(i = 0; i < n; i++) { diff --git a/key.c b/key.c @@ -30,9 +30,9 @@ init_lock_keys() { valid_mask = 255 & ~(num_lock_mask | LockMask); } -unsigned long +ulong mod_key_of_str(char *val) { - unsigned long mod = 0; + ulong mod = 0; if (strstr(val, "Shift")) mod |= ShiftMask; @@ -86,8 +86,8 @@ get_key(const char *name) { char buf[128]; char *seq[8]; char *kstr; - unsigned int i, toks; - static unsigned short id = 1; + uint i, toks; + static ushort id = 1; Key *k = 0, *r = 0; if((k = name2key(name))) { @@ -122,7 +122,7 @@ get_key(const char *name) { } static void -next_keystroke(unsigned long *mod, KeyCode *code) { +next_keystroke(ulong *mod, KeyCode *code) { XEvent e; KeySym sym; *mod = 0; @@ -136,7 +136,7 @@ next_keystroke(unsigned long *mod, KeyCode *code) { } static void -emulate_key_press(unsigned long mod, KeyCode key) { +emulate_key_press(ulong mod, KeyCode key) { XEvent e; Window client_win; int revert; @@ -155,7 +155,7 @@ emulate_key_press(unsigned long mod, KeyCode key) { } static Key * -match_keys(Key *k, unsigned long mod, KeyCode keycode, Bool seq) { +match_keys(Key *k, ulong mod, KeyCode keycode, Bool seq) { Key *ret = nil, *next; for(next = k->tnext; k; (k=next) && (next=k->tnext)) { @@ -171,7 +171,7 @@ match_keys(Key *k, unsigned long mod, KeyCode keycode, Bool seq) { static void kpress_seq(Window w, Key *done) { - unsigned long mod; + ulong mod; KeyCode key; Key *found; @@ -191,7 +191,7 @@ kpress_seq(Window w, Key *done) { } void -kpress(Window w, unsigned long mod, KeyCode keycode) { +kpress(Window w, ulong mod, KeyCode keycode) { Key *k, *found; for(k=key; k; k->tnext=k->lnext, k=k->lnext); diff --git a/main.c b/main.c @@ -40,7 +40,7 @@ sigchld_handler(int sig) { static void scan_wins() { int i; - unsigned int num; + uint num; Window *wins; XWindowAttributes wa; Window d1, d2; @@ -60,10 +60,10 @@ scan_wins() { } static int -win_property(Window w, Atom a, Atom t, long l, unsigned char **prop) { +win_property(Window w, Atom a, Atom t, long l, uchar **prop) { Atom real; int format; - unsigned long res, extra; + ulong res, extra; int status; status = XGetWindowProperty(blz.dpy, w, a, 0L, l, False, t, &real, &format, @@ -85,7 +85,7 @@ win_proto(Window w) { int i; res = win_property(w, wm_atom[WMProtocols], XA_ATOM, 20L, - ((unsigned char **) &protocols)); + ((uchar **) &protocols)); if(res <= 0) { return protos; } @@ -107,7 +107,7 @@ init_atoms() { net_atom[NetWMName] = XInternAtom(blz.dpy, "_NET_WM_NAME", False); tags_atom = XInternAtom(blz.dpy, "_WIN_TAGS", False); XChangeProperty(blz.dpy, blz.root, net_atom[NetSupported], XA_ATOM, 32, - PropModeReplace, (unsigned char *) net_atom, NetLast); + PropModeReplace, (uchar *) net_atom, NetLast); } static void diff --git a/mouse.c b/mouse.c @@ -268,7 +268,7 @@ do_managed_move(Client *c) { Window dummy; XEvent ev; Frame *f; - unsigned int di; + uint di; int x, y, i; focus(c, False); @@ -324,7 +324,7 @@ do_mouse_resize(Client *c, Bool grabbox, BlitzAlign align) { XEvent ev; XRectangle *rects, ofrect, frect, origin; int snap, dx, dy, pt_x, pt_y, hr_x, hr_y, i; - unsigned int num, di; + uint num, di; Bool floating; float rx, ry; Frame *f; @@ -460,7 +460,7 @@ do_mouse_resize(Client *c, Bool grabbox, BlitzAlign align) { } void -grab_button(Window w, unsigned int button, unsigned long mod) { +grab_button(Window w, uint button, ulong mod) { XGrabButton(blz.dpy, button, mod, w, False, ButtonMask, GrabModeSync, GrabModeSync, None, None); if((mod != AnyModifier) && num_lock_mask) { diff --git a/printevent.c b/printevent.c @@ -109,11 +109,11 @@ VisibilityState(int state) static char* ServerTime(Time time) { - unsigned long msec; - unsigned long sec; - unsigned long min; - unsigned long hr; - unsigned long day; + ulong msec; + ulong sec; + ulong min; + ulong hr; + ulong day; static char buffer[32]; msec = time % 1000; @@ -138,13 +138,13 @@ if(0) typedef struct MaskType MaskType; struct MaskType { - unsigned int value; + uint value; char *string; }; /* Returns the string equivalent of a mask of buttons and/or modifier keys */ static char* -ButtonAndOrModifierState(unsigned int state) +ButtonAndOrModifierState(uint state) { static char buffer[256]; static MaskType masks[] = { @@ -183,7 +183,7 @@ ButtonAndOrModifierState(unsigned int state) /* Returns the string equivalent of a mask of configure window values */ static char* -ConfigureValueMask(unsigned int valuemask) +ConfigureValueMask(uint valuemask) { static char buffer[256]; static MaskType masks[] = { diff --git a/view.c b/view.c @@ -57,7 +57,7 @@ get_view(const char *name) { View * create_view(const char *name) { - static unsigned short id = 1; + static ushort id = 1; View **i, *v = ixp_emallocz(sizeof(View)); v->id = id++; @@ -161,9 +161,9 @@ restack_view(View *v) { Area *a; Frame *f; Client *c; - unsigned int n, i; + uint n, i; static Window *wins = nil; - static unsigned int winssz = 0; + static uint winssz = 0; i = 0; n = 1; @@ -191,8 +191,8 @@ restack_view(View *v) { void scale_view(View *v, float w) { - unsigned int xoff, num_col; - unsigned int min_width; + uint xoff, num_col; + uint min_width; Area *a; float scale, dx = 0; int wdiff = 0; @@ -232,7 +232,7 @@ scale_view(View *v, float w) { void arrange_view(View *v) { - unsigned int xoff = 0; + uint xoff = 0; Area *a; if(!v->area->next) @@ -248,7 +248,7 @@ arrange_view(View *v) { } XRectangle * -rects_of_view(View *v, unsigned int *num) { +rects_of_view(View *v, uint *num) { XRectangle *result; Frame *f; @@ -263,9 +263,9 @@ rects_of_view(View *v, unsigned int *num) { } /* XXX: This will need cleanup */ -unsigned char * +uchar * view_index(View *v) { - unsigned int a_i, buf_i, n; + uint a_i, buf_i, n; int len; Frame *f; Area *a; @@ -285,25 +285,25 @@ view_index(View *v) { XRectangle *r = &f->rect; if(a->floating) n = snprintf(&buffer[buf_i], len, "~ 0x%x %d %d %d %d %s\n", - (unsigned int)f->client->win, + (uint)f->client->win, r->x, r->y, r->width, r->height, f->client->props); else n = snprintf(&buffer[buf_i], len, "%d 0x%x %d %d %s\n", - a_i, (unsigned int)f->client->win, r->y, + a_i, (uint)f->client->win, r->y, r->height, f->client->props); if(len - n < 0) - return (unsigned char *)buffer; + return (uchar *)buffer; buf_i += n; len -= n; } } - return (unsigned char *)buffer; + return (uchar *)buffer; } Client * -client_of_message(View *v, char *message, unsigned int *next) { - unsigned long id = 0; +client_of_message(View *v, char *message, uint *next) { + ulong id = 0; Client *c; if(!strncmp(message, "sel ", 4)) { @@ -320,8 +320,8 @@ client_of_message(View *v, char *message, unsigned int *next) { } Area * -area_of_message(View *v, char *message, unsigned int *next) { - unsigned int i; +area_of_message(View *v, char *message, uint *next) { + uint i; Area *a; if(!strncmp(message, "sel ", 4)) { @@ -338,7 +338,7 @@ area_of_message(View *v, char *message, unsigned int *next) { char * message_view(View *v, char *message) { - unsigned int n, i; + uint n, i; Client *c; Frame *f; Area *a; @@ -391,11 +391,11 @@ update_views() { focus_view(screen, screen->sel); } -unsigned int +uint newcolw_of_view(View *v) { Rule *r; Area *a; - unsigned int i, n; + uint i, n; regmatch_t tmpregm; for(r=def.colrules.rule; r; r=r->next) { diff --git a/wmii.h b/wmii.h @@ -12,6 +12,20 @@ #define nil ((void*)0) +/* Types */ +#define uchar _wmiiuchar +#define ushort _wmiiushort +#define uint _wmiiuint +#define ulong _wmiiulong +#define vlong _wmiivlong +#define uvlong _wmiiuvlong +typedef unsigned char uchar; +typedef unsigned short ushort; +typedef unsigned int uint; +typedef unsigned long ulong; +typedef unsigned long long uvlong; +typedef long long vlong; + #define BLITZ_FONT "-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*" #define BLITZ_FOCUSCOLORS "#ffffff #335577 #447799" #define BLITZ_SELCOLORS "#444444 #bbbbbb #556088" @@ -42,9 +56,9 @@ enum BlitzAlign { }; struct BlitzColor { - unsigned long bg; - unsigned long fg; - unsigned long border; + vlong bg; + vlong fg; + vlong border; char colstr[24]; /* #RRGGBB #RRGGBB #RRGGBB */ }; @@ -53,7 +67,7 @@ struct BlitzFont { XFontSet set; int ascent; int descent; - unsigned int height; + uint height; char *fontstr; }; @@ -97,7 +111,7 @@ typedef struct WMScreen WMScreen; struct View { View *next; char name[256]; - unsigned short id; + ushort id; Area *area; Area *sel; Area *revert; @@ -110,7 +124,7 @@ struct Area { Frame *sel; View *view; Bool floating; - unsigned short id; + ushort id; int mode; XRectangle rect; }; @@ -121,7 +135,7 @@ struct Frame { Frame *snext; View *view; Area *area; - unsigned short id; + ushort id; XRectangle rect; XRectangle revert; Client *client; @@ -139,7 +153,7 @@ struct Client { char name[256]; char tags[256]; char props[512]; - unsigned int border; + uint border; int proto; Bool floating; Bool fixedsize; @@ -159,9 +173,9 @@ struct Key { Key *next; Key *lnext; Key *tnext; - unsigned short id; + ushort id; char name[128]; - unsigned long mod; + ulong mod; KeyCode key; }; @@ -171,7 +185,7 @@ struct Bar { char buf[280]; char text[256]; char name[256]; - unsigned short id; + ushort id; BlitzBrush brush; }; @@ -184,7 +198,7 @@ struct Rule { struct Ruleset { Rule *rule; char *string; - unsigned int size; + uint size; }; /* global variables */ @@ -193,14 +207,14 @@ struct { BlitzColor selcolor; BlitzColor normcolor; BlitzFont font; - unsigned int border; - unsigned int snap; + uint border; + uint snap; char *keys; - unsigned int keyssz; + uint keyssz; Ruleset tagrules; Ruleset colrules; char grabmod[5]; - unsigned long mod; + ulong mod; int colmode; } def; @@ -227,7 +241,7 @@ IXPServer srv; P9Srv p9srv; /* X11 */ -unsigned int num_screens; +uint num_screens; Blitz blz; GC xorgc; char *user; @@ -235,8 +249,8 @@ Atom wm_atom[WMLast]; Atom net_atom[NetLast]; Atom tags_atom; Cursor cursor[CurLast]; -unsigned int valid_mask; -unsigned int num_lock_mask; +uint valid_mask; +uint num_lock_mask; Bool sel_screen; Pixmap pmap; void (*handler[LASTEvent]) (XEvent *); @@ -249,9 +263,9 @@ extern Bool verbose; extern char *message_root(char *message); /* area.c */ -extern Area *create_area(View *v, Area *pos, unsigned int w); +extern Area *create_area(View *v, Area *pos, uint w); extern void destroy_area(Area *a); -extern Area *area_of_id(View *t, unsigned short id); +extern Area *area_of_id(View *t, ushort id); extern void focus_area(Area *a); extern char *select_area(Area *a, char *arg); extern void send_to_area(Area *to, Area *from, Frame *f); @@ -301,7 +315,7 @@ extern void scale_column(Area *a, float h); extern void resize_column(Client *c, XRectangle *r); extern int column_mode_of_str(char *arg); extern char *str_of_column_mode(int mode); -extern Area *new_column(View *v, Area *pos, unsigned int w); +extern Area *new_column(View *v, Area *pos, uint w); /* draw.c */ extern int loadcolor(Blitz *blitz, BlitzColor *c); @@ -312,16 +326,16 @@ extern void draw_rect(BlitzBrush *b); extern void drawbg(Display *dpy, Drawable drawable, GC gc, XRectangle *rect, BlitzColor c, Bool fill, Bool border); extern void drawcursor(Display *dpy, Drawable drawable, GC gc, - int x, int y, unsigned int h, BlitzColor c); -extern unsigned int textwidth(BlitzFont *font, char *text); -extern unsigned int textwidth_l(BlitzFont *font, char *text, unsigned int len); + int x, int y, uint h, BlitzColor c); +extern uint textwidth(BlitzFont *font, char *text); +extern uint textwidth_l(BlitzFont *font, char *text, uint len); extern void loadfont(Blitz *blitz, BlitzFont *font); -extern unsigned int labelh(BlitzFont *font); +extern uint labelh(BlitzFont *font); extern char *parse_colors(char **buf, int *buflen, BlitzColor *col); /* event.c */ extern void check_x_event(IXPConn *c); -extern unsigned int flush_masked_events(long even_mask); +extern uint flush_masked_events(long even_mask); /* frame.c */ extern Frame *create_frame(Client *c, View *v); @@ -358,18 +372,18 @@ extern int r_east(XRectangle *r); extern int r_south(XRectangle *r); /* key.c */ -extern void kpress(Window w, unsigned long mod, KeyCode keycode); +extern void kpress(Window w, ulong mod, KeyCode keycode); extern void update_keys(); extern void init_lock_keys(); -extern unsigned long mod_key_of_str(char *val); +extern ulong mod_key_of_str(char *val); /* mouse.c */ extern void do_mouse_resize(Client *c, Bool grabbox, BlitzAlign align); -extern void grab_mouse(Window w, unsigned long mod, unsigned int button); -extern void ungrab_mouse(Window w, unsigned long mod, unsigned int button); +extern void grab_mouse(Window w, ulong mod, ulong button); +extern void ungrab_mouse(Window w, ulong mod, uint button); extern BlitzAlign snap_rect(XRectangle *rects, int num, XRectangle *current, BlitzAlign *mask, int snap); -extern void grab_button(Window w, unsigned int button, unsigned long mod); +extern void grab_button(Window w, uint button, ulong mod); /* rule.c */ extern void update_rules(Rule **rule, const char *data); @@ -386,17 +400,17 @@ extern View *get_view(const char *name); extern View *create_view(const char *name); extern void focus_view(WMScreen *s, View *v); extern void update_client_views(Client *c, char **tags); -extern XRectangle *rects_of_view(View *v, unsigned int *num); -extern View *view_of_id(unsigned short id); +extern XRectangle *rects_of_view(View *v, uint *num); +extern View *view_of_id(ushort id); extern void select_view(const char *arg); extern void attach_to_view(View *v, Frame *f); extern Client *sel_client_of_view(View *v); extern char *message_view(View *v, char *message); extern void restack_view(View *v); -extern unsigned char *view_index(View *v); +extern uchar *view_index(View *v); extern void destroy_view(View *v); extern void update_views(); -extern unsigned int newcolw_of_view(View *v); +extern uint newcolw_of_view(View *v); /* wm.c */ extern int wmii_error_handler(Display *dpy, XErrorEvent *error);