You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
872 B

19 years ago
  1. /*
  2. * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
  3. * See LICENSE file for license details.
  4. */
  5. #include <X11/Xlib.h>
  6. #include <X11/Xlocale.h>
  7. typedef struct Brush Brush;
  8. typedef struct Color Color;
  9. typedef struct Fnt Fnt;
  10. struct Color {
  11. unsigned long bg;
  12. unsigned long fg;
  13. unsigned long border;
  14. };
  15. struct Fnt {
  16. XFontStruct *xfont;
  17. XFontSet set;
  18. int ascent;
  19. int descent;
  20. };
  21. struct Brush {
  22. GC gc;
  23. Drawable drawable;
  24. XRectangle rect;
  25. Bool border;
  26. Fnt *font;
  27. Color color;
  28. const char *text;
  29. };
  30. extern void draw(Display *dpy, Brush *b);
  31. extern void loadcolor(Display *dpy, int screen, Color *c,
  32. const char *bg, const char *fg, const char *bo);
  33. extern unsigned int textwidth_l(Fnt *font, char *text, unsigned int len);
  34. extern unsigned int textwidth(Fnt *font, char *text);
  35. extern void loadfont(Display *dpy, Fnt *font, const char *fontstr);