wmii/liblitz/blitz.h

75 lines
1.9 KiB
C
Raw Normal View History

2005-11-18 18:54:58 +03:00
/*
2006-01-20 17:20:24 +03:00
* (C)opyright MMIV-MMVI Anselm R. Garbe <garbeam at gmail dot com>
2005-11-18 18:54:58 +03:00
* See LICENSE file for license details.
*/
#include <X11/Xlib.h>
#include <X11/Xlocale.h>
2005-11-18 18:54:58 +03:00
#define BLITZ_FONT "fixed"
#define BLITZ_FOCUSCOLORS "#ffffff #285577 #4c7899"
#define BLITZ_SELCOLORS "#bbbbbb #103355 #18466a"
#define BLITZ_NORMCOLORS "#222222 #eeeeee #666666"
2005-11-18 18:54:58 +03:00
2006-05-17 13:59:59 +04:00
/*
#ifdef X_HAVE_UTF8_STRING
#define Xi18nTextPropertyToTextList Xutf8TextPropertyToTextList
#define Xi18nDrawString Xutf8DrawString
#define Xi18nTextExtents Xutf8TextExtents
#else
2006-05-17 13:59:59 +04:00
*/
#define Xi18nTextPropertyToTextList XmbTextPropertyToTextList
#define Xi18nDrawString XmbDrawString
#define Xi18nTextExtents XmbTextExtents
2006-05-17 13:59:59 +04:00
/*
#endif
2006-05-17 13:59:59 +04:00
*/
2005-11-18 18:54:58 +03:00
typedef enum {
CENTER, WEST, NWEST, NORTH, NEAST, EAST,
SEAST, SOUTH, SWEST
} BlitzAlign;
2005-11-18 18:54:58 +03:00
typedef struct {
2005-12-05 01:45:59 +03:00
unsigned long bg;
unsigned long fg;
unsigned long border;
} BlitzColor;
typedef struct {
XFontStruct *xfont;
XFontSet set;
int ascent;
int descent;
} BlitzFont;
typedef struct {
BlitzAlign align;
Drawable drawable;
GC gc;
BlitzColor color;
BlitzFont font;
XRectangle rect; /* relative rect */
XRectangle *notch; /* relative notch rect */
2005-12-05 01:45:59 +03:00
char *data;
} BlitzDraw;
/* font.c */
unsigned int blitz_textwidth(Display *dpy, BlitzFont *font, char *text);
void blitz_loadfont(Display *dpy, BlitzFont *font, char *fontstr);
/* color.c */
int blitz_loadcolor(Display *dpy, BlitzColor *c, int mon, char *colstr);
2005-11-18 18:54:58 +03:00
/* draw.c */
void blitz_drawlabel(Display *dpy, BlitzDraw *d);
void blitz_drawborder(Display *dpy, BlitzDraw *d);
2005-11-18 18:54:58 +03:00
/* geometry.c */
BlitzAlign blitz_align_of_rect(XRectangle *rect, int x, int y);
int blitz_strtoalign(BlitzAlign *result, char *val);
int blitz_strtorect(XRectangle *root, XRectangle *r, char *val);
Bool blitz_ispointinrect(int x, int y, XRectangle *r);
int blitz_distance(XRectangle *origin, XRectangle *target);
void blitz_getbasegeometry(unsigned int size, unsigned int *cols, unsigned int *rows);