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.

34 lines
873 B

14 years ago
14 years ago
14 years ago
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 { ColBorder, 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 drawsquare(DC *dc, Bool filled, unsigned long col[ColLast], Bool invert);
  22. void drawtext(DC *dc, const char *text, unsigned long col[ColLast], Bool invert);
  23. void eprint(const char *fmt, ...);
  24. unsigned long getcolor(DC *dc, const char *colstr);
  25. void initfont(DC *dc, const char *fontstr);
  26. void setupdraw(DC *dc, Window w);
  27. int textnw(DC *dc, const char *text, unsigned int len);
  28. int textw(DC *dc, const char *text);
  29. /* variables */
  30. extern const char *progname;