renamed blitz_ into ''

This commit is contained in:
Anselm R. Garbe 2006-10-12 16:12:22 +02:00
parent 8e8e40516e
commit 2c02b4e392
12 changed files with 62 additions and 62 deletions

8
bar.c
View File

@ -50,7 +50,7 @@ resize_bar(WMScreen *s) {
View *v;
s->brect = s->rect;
s->brect.height = blitz_labelh(&def.font);
s->brect.height = labelh(&def.font);
s->brect.y = s->rect.height - s->brect.height;
XMoveResizeWindow(blz.dpy, s->barwin, s->brect.x, s->brect.y, s->brect.width, s->brect.height);
XSync(blz.dpy, False);
@ -65,7 +65,7 @@ draw_bar(WMScreen *s) {
float shrink;
Bar *b, *tb, *largest, **pb;
blitz_draw_tile(&s->bbrush);
draw_tile(&s->bbrush);
if(!s->lbar && !s->rbar)
goto MapBar;
largest = b = tb = NULL;
@ -75,7 +75,7 @@ draw_bar(WMScreen *s) {
b->brush.rect.x = b->brush.rect.y = 0;
b->brush.rect.width = def.font.height;
if(b->text && strlen(b->text))
b->brush.rect.width += blitz_textwidth(b->brush.font, b->text);
b->brush.rect.width += textwidth(b->brush.font, b->text);
b->brush.rect.height = s->brect.height;
width += b->brush.rect.width;
}
@ -111,7 +111,7 @@ draw_bar(WMScreen *s) {
b->brush.align = CENTER;
if(tb)
b->brush.rect.x = tb->brush.rect.x + tb->brush.rect.width;
blitz_draw_label(&b->brush, b->text);
draw_label(&b->brush, b->text);
}
MapBar:
XCopyArea(blz.dpy, s->bbrush.drawable, s->barwin, s->bbrush.gc, 0, 0,

10
brush.c
View File

@ -7,19 +7,19 @@
#include <string.h>
void
blitz_draw_tile(BlitzBrush *b) {
blitz_drawbg(b->blitz->dpy, b->drawable, b->gc, b->rect,
draw_tile(BlitzBrush *b) {
drawbg(b->blitz->dpy, b->drawable, b->gc, b->rect,
b->color, b->border);
}
void
blitz_draw_label(BlitzBrush *b, char *text) {
draw_label(BlitzBrush *b, char *text) {
unsigned int x, y, w, h, len;
Bool shortened = False;
static char buf[2048];
XGCValues gcv;
blitz_draw_tile(b);
draw_tile(b);
if(!text)
return;
shortened = 0;
@ -30,7 +30,7 @@ blitz_draw_label(BlitzBrush *b, char *text) {
h = b->font->ascent + b->font->descent;
y = b->rect.y + b->rect.height / 2 - h / 2 + b->font->ascent;
/* shorten text if necessary */
while(len && (w = blitz_textwidth(b->font, buf)) > b->rect.width - h) {
while(len && (w = textwidth(b->font, buf)) > b->rect.width - h) {
buf[--len] = 0;
shortened = True;
}

View File

@ -111,7 +111,7 @@ create_client(Window w, XWindowAttributes *wa) {
| ButtonPressMask | PointerMotionMask | ButtonReleaseMask | KeyPressMask;
c->framewin = XCreateWindow(blz.dpy, blz.root, c->rect.x, c->rect.y,
c->rect.width + 2 * def.border,
c->rect.height + def.border + blitz_labelh(&def.font), 0,
c->rect.height + def.border + labelh(&def.font), 0,
DefaultDepth(blz.dpy, blz.screen), CopyFromParent,
DefaultVisual(blz.dpy, blz.screen),
CWOverrideRedirect | CWBackPixmap | CWEventMask, &fwa);
@ -287,12 +287,12 @@ gravitate_client(Client *c, Bool invert) {
case NorthWestGravity:
case NorthGravity:
case NorthEastGravity:
dy = blitz_labelh(&def.font);
dy = labelh(&def.font);
break;
case EastGravity:
case CenterGravity:
case WestGravity:
dy = -(c->rect.height / 2) + blitz_labelh(&def.font);
dy = -(c->rect.height / 2) + labelh(&def.font);
break;
case SouthEastGravity:
case SouthGravity:
@ -394,7 +394,7 @@ 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 + blitz_labelh(&def.font);
unsigned int dy = def.border + labelh(&def.font);
unsigned int hdiff, wdiff;
if(floating && (s->flags & PMinSize)) {
@ -471,13 +471,13 @@ resize_client(Client *c, XRectangle *r, Bool ignore_xcall) {
f->rect = *r;
if((f->area->mode != Colstack) || (f->area->sel == f))
match_sizehints(c, &c->sel->rect, floating, stickycorner);
max_height = screen->rect.height - blitz_labelh(&def.font);
max_height = screen->rect.height - labelh(&def.font);
if(!ignore_xcall) {
if(floating) {
if((c->rect.width == screen->rect.width) &&
(c->rect.height == screen->rect.height)) {
f->rect.x = -def.border;
f->rect.y = -blitz_labelh(&def.font);
f->rect.y = -labelh(&def.font);
}else{
if(f->rect.height > max_height)
f->rect.height = max_height;
@ -501,10 +501,10 @@ resize_client(Client *c, XRectangle *r, Bool ignore_xcall) {
f->rect.y, f->rect.width, f->rect.height);
}
c->rect.x = def.border;
c->rect.y = blitz_labelh(&def.font);
c->rect.y = labelh(&def.font);
if((f->area->sel == f) || (f->area->mode != Colstack)) {
c->rect.width = f->rect.width - 2 * def.border;
c->rect.height = f->rect.height - def.border - blitz_labelh(&def.font);
c->rect.height = f->rect.height - def.border - labelh(&def.font);
}
if(!ignore_xcall) {
XMoveResizeWindow(blz.dpy, c->win, c->rect.x, c->rect.y,

View File

@ -17,7 +17,7 @@ xloadcolor(Blitz *blitz, char *colstr) {
}
int
blitz_loadcolor(Blitz *blitz, BlitzColor *c) {
loadcolor(Blitz *blitz, BlitzColor *c) {
if(!c->colstr || strlen(c->colstr) != 23)
return -1;
c->fg = xloadcolor(blitz, &c->colstr[0]);

View File

@ -43,12 +43,12 @@ relax_column(Area *a) {
switch(a->mode) {
case Coldefault:
h = a->rect.height / frame_size;
if(h < 2 * blitz_labelh(&def.font))
if(h < 2 * labelh(&def.font))
fallthrough = True;
break;
case Colstack:
h = a->rect.height - (frame_size - 1) * blitz_labelh(&def.font);
if(h < 3 * blitz_labelh(&def.font))
h = a->rect.height - (frame_size - 1) * labelh(&def.font);
if(h < 3 * labelh(&def.font))
fallthrough = True;
default:
yoff = a->rect.y;
@ -101,7 +101,7 @@ void
scale_column(Area *a, float h) {
unsigned int yoff, frame_size = 0;
Frame *f;
unsigned int min_height = 2 * blitz_labelh(&def.font);
unsigned int min_height = 2 * labelh(&def.font);
float scale, dy = 0;
int hdiff;
@ -136,7 +136,7 @@ void
arrange_column(Area *a, Bool dirty) {
Frame *f;
unsigned int num_frames = 0, yoff = a->rect.y, h;
unsigned int min_height = 2 * blitz_labelh(&def.font);
unsigned int min_height = 2 * labelh(&def.font);
if(a->floating || !a->frame)
return;
@ -161,8 +161,8 @@ arrange_column(Area *a, Bool dirty) {
}
break;
case Colstack:
h = a->rect.height - (num_frames - 1) * blitz_labelh(&def.font);
if(h < 3 * blitz_labelh(&def.font))
h = a->rect.height - (num_frames - 1) * labelh(&def.font);
if(h < 3 * labelh(&def.font))
goto Fallthrough;
for(f=a->frame; f; f=f->anext) {
f->rect = a->rect;
@ -170,7 +170,7 @@ arrange_column(Area *a, Bool dirty) {
if(f == a->sel)
f->rect.height = h;
else
f->rect.height = blitz_labelh(&def.font);
f->rect.height = labelh(&def.font);
yoff += f->rect.height;
//resize_client(f->client, &f->rect, True);
}
@ -206,7 +206,7 @@ drop_resize(Frame *f, XRectangle *new) {
Area *west = NULL, *east = NULL, *a = f->area;
View *v = a->view;
Frame *north = NULL, *south = NULL;
unsigned int min_height = 2 * blitz_labelh(&def.font);
unsigned int min_height = 2 * labelh(&def.font);
unsigned int min_width = screen->rect.width/NCOL;
for(west=v->area->next; west && west->next != a; west=west->next);

4
draw.c
View File

@ -4,7 +4,7 @@
#include "wm.h"
void
blitz_drawbg(Display *dpy, Drawable drawable, GC gc, XRectangle rect,
drawbg(Display *dpy, Drawable drawable, GC gc, XRectangle rect,
BlitzColor c, Bool border)
{
XPoint points[5];
@ -28,7 +28,7 @@ blitz_drawbg(Display *dpy, Drawable drawable, GC gc, XRectangle rect,
}
void
blitz_drawcursor(Display *dpy, Drawable drawable, GC gc,
drawcursor(Display *dpy, Drawable drawable, GC gc,
int x, int y, unsigned int h, BlitzColor c)
{
XSegment s[5];

10
event.c
View File

@ -125,16 +125,16 @@ configurerequest(XEvent *e) {
else
frect=&c->sel->revert;
if(c->rect.width >= screen->rect.width && c->rect.height >= screen->rect.height) {
frect->y = wc.y = -blitz_labelh(&def.font);
frect->y = wc.y = -labelh(&def.font);
frect->x = wc.x = -def.border;
}
else {
frect->y = wc.y = c->rect.y - blitz_labelh(&def.font);
frect->y = wc.y = c->rect.y - labelh(&def.font);
frect->x = wc.x = c->rect.x - def.border;
}
frect->width = wc.width = c->rect.width + 2 * def.border;
frect->height = wc.height = c->rect.height + def.border
+ blitz_labelh(&def.font);
+ labelh(&def.font);
wc.border_width = 1;
wc.sibling = None;
wc.stack_mode = ev->detail;
@ -152,9 +152,9 @@ configurerequest(XEvent *e) {
wc.height = ev->height;
if(c && c->frame) {
wc.x = def.border;
wc.y = blitz_labelh(&def.font);
wc.y = labelh(&def.font);
wc.width = c->sel->rect.width - 2 * def.border;
wc.height = c->sel->rect.height - def.border - blitz_labelh(&def.font);
wc.height = c->sel->rect.height - def.border - labelh(&def.font);
}
wc.border_width = 0;
wc.sibling = None;

10
font.c
View File

@ -8,7 +8,7 @@
#include <locale.h>
unsigned int
blitz_textwidth_l(BlitzFont *font, char *text, unsigned int len) {
textwidth_l(BlitzFont *font, char *text, unsigned int len) {
if(font->set) {
XRectangle r;
XmbTextExtents(font->set, text, len, NULL, &r);
@ -18,12 +18,12 @@ blitz_textwidth_l(BlitzFont *font, char *text, unsigned int len) {
}
unsigned int
blitz_textwidth(BlitzFont *font, char *text) {
return blitz_textwidth_l(font, text, strlen(text));
textwidth(BlitzFont *font, char *text) {
return textwidth_l(font, text, strlen(text));
}
void
blitz_loadfont(Blitz *blitz, BlitzFont *font) {
loadfont(Blitz *blitz, BlitzFont *font) {
char *fontname = font->fontstr;
char **missing = NULL, *def = "?";
int n;
@ -77,6 +77,6 @@ blitz_loadfont(Blitz *blitz, BlitzFont *font) {
}
unsigned int
blitz_labelh(BlitzFont *font) {
labelh(BlitzFont *font) {
return font->height + 4;
}

10
frame.c
View File

@ -20,7 +20,7 @@ create_frame(Client *c, View *v) {
else{
f->revert = f->rect = c->rect;
f->revert.width = f->rect.width += 2 * def.border;
f->revert.height = f->rect.height += def.border + blitz_labelh(&def.font);
f->revert.height = f->rect.height += def.border + labelh(&def.font);
}
f->collapsed = False;
f->tile.blitz = &blz;
@ -77,14 +77,14 @@ draw_frame(Frame *f) {
f->tile.rect.x = f->tile.rect.y = 0;
}
f->grabbox.rect = f->tile.rect;
f->grabbox.rect.height = blitz_labelh(&def.font);
f->grabbox.rect.height = labelh(&def.font);
f->grabbox.rect.width = def.font.height;
f->titlebar.rect = f->grabbox.rect;
f->titlebar.rect.x = f->grabbox.rect.x + f->grabbox.rect.width;
f->titlebar.rect.width = f->rect.width - f->titlebar.rect.x;
blitz_draw_tile(&f->tile);
blitz_draw_tile(&f->grabbox);
blitz_draw_label(&f->titlebar, f->client->name);
draw_tile(&f->tile);
draw_tile(&f->grabbox);
draw_label(&f->titlebar, f->client->name);
XCopyArea(blz.dpy, pmap, f->client->framewin, f->client->gc,
0, 0, f->rect.width, f->rect.height, 0, 0);
XSync(blz.dpy, False);

4
fs.c
View File

@ -232,7 +232,7 @@ parse_colors(char **buf, int *buflen, BlitzColor *col) {
return Ebadvalue;
(*buflen) -= 23;
bcopy(*buf, col->colstr, 23);
blitz_loadcolor(&blz, col);
loadcolor(&blz, col);
(*buf) += 23;
if(**buf == '\n' || **buf == ' ') {
@ -284,7 +284,7 @@ message_root(char *message)
message += 5;
free(def.font.fontstr);
def.font.fontstr = ixp_estrdup(message);
blitz_loadfont(&blz, &def.font);
loadfont(&blz, &def.font);
}
else if(!strncmp(message, "border ", 7)) {
message += 7;

14
wm.c
View File

@ -288,20 +288,20 @@ main(int argc, char *argv[]) {
def.border = 2;
def.colmode = Coldefault;
strncpy(def.selcolor.colstr, BLITZ_SELCOLORS, sizeof(def.selcolor.colstr));
blitz_loadcolor(&blz, &def.selcolor);
loadcolor(&blz, &def.selcolor);
strncpy(def.normcolor.colstr, BLITZ_NORMCOLORS, sizeof(def.normcolor.colstr));
blitz_loadcolor(&blz, &def.normcolor);
loadcolor(&blz, &def.normcolor);
strncpy(def.bcolor[0].colstr, BLITZ_B1COLORS, sizeof(def.bcolor[0].colstr));
strncpy(def.bcolor[1].colstr, BLITZ_B2COLORS, sizeof(def.bcolor[1].colstr));
strncpy(def.bcolor[2].colstr, BLITZ_B3COLORS, sizeof(def.bcolor[2].colstr));
blitz_loadcolor(&blz, &def.bcolor[0]);
blitz_loadcolor(&blz, &def.bcolor[1]);
blitz_loadcolor(&blz, &def.bcolor[2]);
loadcolor(&blz, &def.bcolor[0]);
loadcolor(&blz, &def.bcolor[1]);
loadcolor(&blz, &def.bcolor[2]);
strncpy(def.grabmod, "Mod1", sizeof(def.grabmod));
def.mod = Mod1Mask;
init_atoms();
init_cursors();
blitz_loadfont(&blz, &def.font);
loadfont(&blz, &def.font);
init_lock_keys();
num_screens = 1;
screens = ixp_emallocz(num_screens * sizeof(*screens));
@ -321,7 +321,7 @@ main(int argc, char *argv[]) {
wa.event_mask = ExposureMask | ButtonReleaseMask
| SubstructureRedirectMask | SubstructureNotifyMask;
s->brect = s->rect;
s->brect.height = blitz_labelh(&def.font);
s->brect.height = labelh(&def.font);
s->brect.y = s->rect.height - s->brect.height;
s->barwin = XCreateWindow(blz.dpy, RootWindow(blz.dpy, blz.screen),
s->brect.x, s->brect.y,

18
wm.h
View File

@ -262,8 +262,8 @@ extern void resize_bar();
extern Bar *bar_of_name(Bar *b_link, const char *name);
/* brush.c */
extern void blitz_draw_label(BlitzBrush *b, char *text);
extern void blitz_draw_tile(BlitzBrush *b);
extern void draw_label(BlitzBrush *b, char *text);
extern void draw_tile(BlitzBrush *b);
/* client.c */
extern Client *create_client(Window w, XWindowAttributes *wa);
@ -294,7 +294,7 @@ extern void apply_rules(Client *c);
extern void apply_tags(Client *c, const char *tags);
/* color.c */
extern int blitz_loadcolor(Blitz *blitz, BlitzColor *c);
extern int loadcolor(Blitz *blitz, BlitzColor *c);
/* column.c */
extern void arrange_column(Area *a, Bool dirty);
@ -305,9 +305,9 @@ extern char *str_of_column_mode(int mode);
extern Area *new_column(View *v, Area *pos, unsigned int w);
/* draw.c */
extern void blitz_drawbg(Display *dpy, Drawable drawable, GC gc,
extern void drawbg(Display *dpy, Drawable drawable, GC gc,
XRectangle rect, BlitzColor c, Bool border);
extern void blitz_drawcursor(Display *dpy, Drawable drawable, GC gc,
extern void drawcursor(Display *dpy, Drawable drawable, GC gc,
int x, int y, unsigned int h, BlitzColor c);
/* event.c */
@ -323,10 +323,10 @@ extern void draw_frames();
extern void update_frame_widget_colors(Frame *f);
/* font.c */
extern unsigned int blitz_textwidth(BlitzFont *font, char *text);
extern unsigned int blitz_textwidth_l(BlitzFont *font, char *text, unsigned int len);
extern void blitz_loadfont(Blitz *blitz, BlitzFont *font);
extern unsigned int blitz_labelh(BlitzFont *font);
extern unsigned int textwidth(BlitzFont *font, char *text);
extern unsigned int textwidth_l(BlitzFont *font, char *text, unsigned int len);
extern void loadfont(Blitz *blitz, BlitzFont *font);
extern unsigned int labelh(BlitzFont *font);
/* fs.c */
extern void fs_attach(P9Req *r);