This practice proved itself in sbase, ubase and a couple of other
projects.
Also remove the True and False defined in X11 and FcTrue and FcFalse
defined in Fontconfig.
Signed-off-by: Christoph Lohmann <[email protected]>
static unsigned int tripleclicktimeout = 600;
/* alt screens */
static unsigned int tripleclicktimeout = 600;
/* alt screens */
-static bool allowaltscreen = true;
+static int allowaltscreen = 1;
/* frames per second st should at maximum draw to the screen */
static unsigned int xfps = 120;
/* frames per second st should at maximum draw to the screen */
static unsigned int xfps = 120;
#include <locale.h>
#include <pwd.h>
#include <stdarg.h>
#include <locale.h>
#include <pwd.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int col; /* nb col */
Line *line; /* screen */
Line *alt; /* alternate screen */
int col; /* nb col */
Line *line; /* screen */
Line *alt; /* alternate screen */
- bool *dirty; /* dirtyness of lines */
+ int *dirty; /* dirtyness of lines */
XftGlyphFontSpec *specbuf; /* font spec buffer used for rendering */
TCursor c; /* cursor */
int top; /* top scroll limit */
XftGlyphFontSpec *specbuf; /* font spec buffer used for rendering */
TCursor c; /* cursor */
int top; /* top scroll limit */
char trantbl[4]; /* charset table translation */
int charset; /* current charset */
int icharset; /* selected charset for sequence */
char trantbl[4]; /* charset table translation */
int charset; /* current charset */
int icharset; /* selected charset for sequence */
- bool numlock; /* lock numbers in keyboard */
- bool *tabs;
+ int numlock; /* lock numbers in keyboard */
+ int *tabs;
} Term;
/* Purely graphic info */
} Term;
/* Purely graphic info */
Visual *vis;
XSetWindowAttributes attrs;
int scr;
Visual *vis;
XSetWindowAttributes attrs;
int scr;
- bool isfixed; /* is fixed geometry? */
+ int isfixed; /* is fixed geometry? */
int l, t; /* left and top offset */
int gm; /* geometry mask */
int tw, th; /* tty width and height */
int l, t; /* left and top offset */
int gm; /* geometry mask */
int tw, th; /* tty width and height */
char *primary, *clipboard;
Atom xtarget;
char *primary, *clipboard;
Atom xtarget;
struct timespec tclick1;
struct timespec tclick2;
} Selection;
struct timespec tclick1;
struct timespec tclick2;
} Selection;
static void tswapscreen(void);
static void tsetdirt(int, int);
static void tsetdirtattr(int);
static void tswapscreen(void);
static void tsetdirt(int, int);
static void tsetdirtattr(int);
-static void tsetmode(bool, bool, int *, int);
+static void tsetmode(int, int, int *, int);
static void tfulldirt(void);
static void techo(Rune);
static void tcontrolcode(uchar );
static void tdectest(char );
static int32_t tdefcolor(int *, int *, int);
static void tdeftran(char);
static void tfulldirt(void);
static void techo(Rune);
static void tcontrolcode(uchar );
static void tdectest(char );
static int32_t tdefcolor(int *, int *, int);
static void tdeftran(char);
-static inline bool match(uint, uint);
+static inline int match(uint, uint);
static void ttynew(void);
static void ttyread(void);
static void ttyresize(void);
static void ttynew(void);
static void ttyread(void);
static void ttyresize(void);
static void selinit(void);
static void selnormalize(void);
static void selinit(void);
static void selnormalize(void);
-static inline bool selected(int, int);
+static inline int selected(int, int);
static char *getsel(void);
static void selcopy(Time);
static void selscroll(int, int);
static char *getsel(void);
static void selcopy(Time);
static void selscroll(int, int);
sel.ne.x = term.col - 1;
}
sel.ne.x = term.col - 1;
}
selected(int x, int y) {
if(sel.mode == SEL_EMPTY)
selected(int x, int y) {
if(sel.mode == SEL_EMPTY)
if(sel.type == SEL_RECTANGULAR)
return BETWEEN(y, sel.nb.y, sel.ne.y)
if(sel.type == SEL_RECTANGULAR)
return BETWEEN(y, sel.nb.y, sel.ne.y)
void
selsnap(int *x, int *y, int direction) {
int newx, newy, xt, yt;
void
selsnap(int *x, int *y, int direction) {
int newx, newy, xt, yt;
Glyph *gp, *prevgp;
switch(sel.snap) {
Glyph *gp, *prevgp;
switch(sel.snap) {
}
/* all done, send a notification to the listener */
}
/* all done, send a notification to the listener */
- if(!XSendEvent(xsre->display, xsre->requestor, True, 0, (XEvent *) &xev))
+ if(!XSendEvent(xsre->display, xsre->requestor, 1, 0, (XEvent *) &xev))
fprintf(stderr, "Error sending SelectionNotify event\n");
}
fprintf(stderr, "Error sending SelectionNotify event\n");
}
void
tcursor(int mode) {
static TCursor c[2];
void
tcursor(int mode) {
static TCursor c[2];
- bool alt = IS_SET(MODE_ALTSCREEN);
+ int alt = IS_SET(MODE_ALTSCREEN);
if(mode == CURSOR_SAVE) {
c[alt] = term.c;
if(mode == CURSOR_SAVE) {
c[alt] = term.c;
-tsetmode(bool priv, bool set, int *args, int narg) {
+tsetmode(int priv, int set, int *args, int narg) {
for(lim = args + narg; args < lim; ++args) {
if(priv) {
for(lim = args + narg; args < lim; ++args) {
if(priv) {
void
tputc(Rune u) {
char c[UTF_SIZ];
void
tputc(Rune u) {
char c[UTF_SIZ];
int width, len;
Glyph *gp;
int width, len;
Glyph *gp;
int i;
int minrow = MIN(row, term.row);
int mincol = MIN(col, term.col);
int i;
int minrow = MIN(row, term.row);
int mincol = MIN(col, term.col);
TCursor c;
if(col < 1 || row < 1) {
TCursor c;
if(col < 1 || row < 1) {
return x == 0 ? 0 : 0x3737 + 0x2828 * x;
}
return x == 0 ? 0 : 0x3737 + 0x2828 * x;
}
xloadcolor(int i, const char *name, Color *ncolor) {
XRenderColor color = { .alpha = 0xffff };
xloadcolor(int i, const char *name, Color *ncolor) {
XRenderColor color = { .alpha = 0xffff };
void
xloadcols(void) {
int i;
void
xloadcols(void) {
int i;
else
die("Could not allocate color %d\n", i);
}
else
die("Could not allocate color %d\n", i);
}
sizeh->width_inc = xw.cw;
sizeh->base_height = 2 * borderpx;
sizeh->base_width = 2 * borderpx;
sizeh->width_inc = xw.cw;
sizeh->base_height = 2 * borderpx;
sizeh->base_width = 2 * borderpx;
- if(xw.isfixed == True) {
sizeh->flags |= PMaxSize | PMinSize;
sizeh->min_width = sizeh->max_width = xw.w;
sizeh->min_height = sizeh->max_height = xw.h;
sizeh->flags |= PMaxSize | PMinSize;
sizeh->min_width = sizeh->max_width = xw.w;
sizeh->min_height = sizeh->max_height = xw.h;
if(f >= frclen) {
if(!font->set)
font->set = FcFontSort(0, font->pattern,
if(f >= frclen) {
if(!font->set)
font->set = FcFontSort(0, font->pattern,
fcsets[0] = font->set;
/*
fcsets[0] = font->set;
/*
FcCharSetAddChar(fccharset, rune);
FcPatternAddCharSet(fcpattern, FC_CHARSET,
fccharset);
FcCharSetAddChar(fccharset, rune);
FcPatternAddCharSet(fcpattern, FC_CHARSET,
fccharset);
- FcPatternAddBool(fcpattern, FC_SCALABLE,
- FcTrue);
+ FcPatternAddBool(fcpattern, FC_SCALABLE, 1);
FcConfigSubstitute(0, fcpattern,
FcMatchPattern);
FcConfigSubstitute(0, fcpattern,
FcMatchPattern);
int i, x, y, ox, numspecs;
Glyph base, new;
XftGlyphFontSpec* specs;
int i, x, y, ox, numspecs;
Glyph base, new;
XftGlyphFontSpec* specs;
- bool ena_sel = sel.ob.x != -1 && sel.alt == IS_SET(MODE_ALTSCREEN);
+ int ena_sel = sel.ob.x != -1 && sel.alt == IS_SET(MODE_ALTSCREEN);
if(!(xw.state & WIN_VISIBLE))
return;
if(!(xw.state & WIN_VISIBLE))
return;
match(uint mask, uint state) {
return mask == XK_ANY_MOD || mask == (state & ~ignoremod);
}
match(uint mask, uint state) {
return mask == XK_ANY_MOD || mask == (state & ~ignoremod);
}
- allowaltscreen = false;
break;
case 'c':
opt_class = EARGF(usage());
break;
case 'c':
opt_class = EARGF(usage());
&xw.l, &xw.t, &cols, &rows);
break;
case 'i':
&xw.l, &xw.t, &cols, &rows);
break;
case 'i':
break;
case 'o':
opt_io = EARGF(usage());
break;
case 'o':
opt_io = EARGF(usage());