dwm.c
branchstil
changeset 1534 ff21639cb978
parent 1532 4a1df4ff7ca3
child 1536 932900ff8dbb
child 1537 c7a2261b5414
equal deleted inserted replaced
1533:e2e1cbb46541 1534:ff21639cb978
   268 static Monitor *mons = NULL, *selmon = NULL;
   268 static Monitor *mons = NULL, *selmon = NULL;
   269 static Window root;
   269 static Window root;
   270 
   270 
   271 /* configuration, allows nested code to access above variables */
   271 /* configuration, allows nested code to access above variables */
   272 #include "push.h"
   272 #include "push.h"
       
   273 #include "layouts/fibonacci.h"
   273 #include "config.h"
   274 #include "config.h"
   274 
   275 
   275 struct Monitor {
   276 struct Monitor {
   276 	char ltsymbol[16];
   277 	char ltsymbol[16];
   277 	float mfact;
   278 	float mfact;
   296 	double mfacts[LENGTH(tags) + 1];
   297 	double mfacts[LENGTH(tags) + 1];
   297 	Bool showbars[LENGTH(tags) + 1];
   298 	Bool showbars[LENGTH(tags) + 1];
   298 };
   299 };
   299 
   300 
   300 #include "push.c"
   301 #include "push.c"
       
   302 #include "layouts/fibonacci.c"
   301 
   303 
   302 /* compile-time check if all tags fit into an unsigned int bit array. */
   304 /* compile-time check if all tags fit into an unsigned int bit array. */
   303 struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
   305 struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
   304 
   306 
   305 /* function implementations */
   307 /* function implementations */
   803 	if(!len)
   805 	if(!len)
   804 		return;
   806 		return;
   805 	memcpy(buf, text, len);
   807 	memcpy(buf, text, len);
   806 	if(len < olen)
   808 	if(len < olen)
   807 		for(i = len; i && i > len - 3; buf[--i] = '.');
   809 		for(i = len; i && i > len - 3; buf[--i] = '.');
   808 	pango_layout_set_text(dc.plo, text, len);
   810 	pango_layout_set_markup(dc.plo, text, len);
   809 	pango_xft_render_layout(dc.xftdrawable, (col==dc.norm?dc.xftnorm:dc.xftsel)+(invert?ColBG:ColFG), dc.plo, x * PANGO_SCALE, y * PANGO_SCALE);
   811 	pango_xft_render_layout(dc.xftdrawable, (col==dc.norm?dc.xftnorm:dc.xftsel)+(invert?ColBG:ColFG), dc.plo, x * PANGO_SCALE, y * PANGO_SCALE);
   810 }
   812 }
   811 
   813 
   812 void
   814 void
   813 enternotify(XEvent *e) {
   815 enternotify(XEvent *e) {
  1615 }
  1617 }
  1616 
  1618 
  1617 int
  1619 int
  1618 textnw(const char *text, unsigned int len) {
  1620 textnw(const char *text, unsigned int len) {
  1619 	PangoRectangle r;
  1621 	PangoRectangle r;
  1620 	pango_layout_set_text(dc.plo, text, len);
  1622 	pango_layout_set_markup(dc.plo, text, len);
  1621 	pango_layout_get_extents(dc.plo, &r, 0);
  1623 	pango_layout_get_extents(dc.plo, &r, 0);
  1622 	return r.width / PANGO_SCALE;
  1624 	return r.width / PANGO_SCALE;
  1623 }
  1625 }
  1624 
  1626 
  1625 void
  1627 void