init: Add init.c

This commit is contained in:
Martin Duquesnoy
2008-11-06 07:59:11 +01:00
parent 62f2e40ff4
commit b5ba311576
12 changed files with 230 additions and 131 deletions

View File

@@ -62,6 +62,27 @@ getcolor(char *color)
return xcolor.pixel;
}
long
getwinstate(Window win)
{
int f;
long ret = -1;
ulong n, e;
uchar *p = NULL;
Atom at;
if(XGetWindowProperty(dpy, win, wm_atom[WMState], 0L, 2L, False, wm_atom[WMState],
&at, &f, &n, &e, (uchar **)&p) != Success)
return -1;
if(n != 0)
ret = *p;
free(p);
return ret;
}
double
round(double x)
{