dmenu for lunch applications in dwm
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.

58 lines
1.3 KiB

18 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 "config.h"
  6. #include <X11/Xlib.h>
  7. #include <X11/Xlocale.h>
  8. typedef struct Brush Brush;
  9. typedef struct DC DC;
  10. typedef struct Fnt Fnt;
  11. struct Fnt {
  12. XFontStruct *xfont;
  13. XFontSet set;
  14. int ascent;
  15. int descent;
  16. int height;
  17. };
  18. struct DC { /* draw context */
  19. int x, y, w, h;
  20. unsigned long bg;
  21. unsigned long fg;
  22. unsigned long border;
  23. Drawable drawable;
  24. Fnt font;
  25. GC gc;
  26. };
  27. struct Brush {
  28. GC gc;
  29. Drawable drawable;
  30. int x, y, w, h;
  31. Fnt font;
  32. unsigned long bg;
  33. unsigned long fg;
  34. unsigned long border;
  35. };
  36. /* draw.c */
  37. extern void draw(Display *dpy, Brush *b, Bool border, const char *text);
  38. extern void loadcolors(Display *dpy, int screen, Brush *b,
  39. const char *bg, const char *fg, const char *bo);
  40. extern void loadfont(Display *dpy, Fnt *font, const char *fontstr);
  41. extern unsigned int textnw(Fnt *font, char *text, unsigned int len);
  42. extern unsigned int textw(Fnt *font, char *text);
  43. extern unsigned int texth(Fnt *font);
  44. /* util.c */
  45. extern void *emalloc(unsigned int size);
  46. extern void *emallocz(unsigned int size);
  47. extern void eprint(const char *errstr, ...);
  48. extern char *estrdup(const char *str);
  49. extern void swap(void **p1, void **p2);