From faf43c6311d3445fd142307eab2ec2765e3d3d7d Mon Sep 17 00:00:00 2001 From: gotmor Date: Fri, 11 May 2007 10:17:25 +0000 Subject: code clean und and rearrangement git-svn-id: http://dzen.googlecode.com/svn/trunk@17 f2baff5b-bf2c-0410-a398-912abdc3d8b2 --- draw.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'draw.c') diff --git a/draw.c b/draw.c index f753811..7360b23 100644 --- a/draw.c +++ b/draw.c @@ -139,3 +139,31 @@ unsigned int textw(const char *text) { return textnw(text, strlen(text)) + dzen.font.height; } + +void +drawheader(char * text) { + dzen.x = 0; + dzen.y = 0; + dzen.w = dzen.title_win.width; + dzen.h = dzen.mh; + + if(text) + drawtext(text, 0, -1); + XCopyArea(dzen.dpy, dzen.title_win.drawable, dzen.title_win.win, + dzen.gc, 0, 0, dzen.title_win.width, dzen.mh, 0, 0); +} + +void +drawbody(char * text) { + if(dzen.slave_win.tcnt >= BUF_SIZE) { + pthread_mutex_lock(&dzen.mt); + free_buffer(); + pthread_mutex_unlock(&dzen.mt); + } + if(dzen.slave_win.tcnt < BUF_SIZE) { + pthread_mutex_lock(&dzen.mt); + dzen.slave_win.tbuf[dzen.slave_win.tcnt] = estrdup(text); + dzen.slave_win.tcnt++; + pthread_mutex_unlock(&dzen.mt); + } +} -- cgit v1.2.3-54-g00ecf