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.

33 lines
770 B

14 years ago
14 years ago
14 years ago
14 years ago
  1. /* See LICENSE file for copyright and license details. */
  2. #include <X11/Xlib.h>
  3. /* enums */
  4. enum { ColFG, ColBG, ColLast };
  5. /* typedefs */
  6. typedef struct {
  7. int x, y, w, h;
  8. Drawable drawable;
  9. Display *dpy;
  10. GC gc;
  11. struct {
  12. XFontStruct *xfont;
  13. XFontSet set;
  14. int ascent;
  15. int descent;
  16. int height;
  17. } font;
  18. } DC; /* draw context */
  19. /* forward declarations */
  20. void cleanupdraw(DC *dc);
  21. void drawtext(DC *dc, const char *text, unsigned long col[ColLast]);
  22. void eprint(const char *fmt, ...);
  23. unsigned long getcolor(DC *dc, const char *colstr);
  24. void initfont(DC *dc, const char *fontstr);
  25. void setupdraw(DC *dc, Window w);
  26. int textnw(DC *dc, const char *text, unsigned int len);
  27. int textw(DC *dc, const char *text);
  28. /* variables */
  29. extern const char *progname;