diff options
author | gotmor <gotmor@f2baff5b-bf2c-0410-a398-912abdc3d8b2> | 2007-05-11 10:17:25 +0000 |
---|---|---|
committer | gotmor <gotmor@f2baff5b-bf2c-0410-a398-912abdc3d8b2> | 2007-05-11 10:17:25 +0000 |
commit | faf43c6311d3445fd142307eab2ec2765e3d3d7d (patch) | |
tree | c6e62941995d8ae59c1710cfe72e051f2fbb9188 /draw.c | |
parent | 2bf490e772921d34d70c96dd138bc1b899894451 (diff) | |
download | dzen-faf43c6311d3445fd142307eab2ec2765e3d3d7d.tar.gz dzen-faf43c6311d3445fd142307eab2ec2765e3d3d7d.zip |
code clean und and rearrangement
git-svn-id: http://dzen.googlecode.com/svn/trunk@17 f2baff5b-bf2c-0410-a398-912abdc3d8b2
Diffstat (limited to 'draw.c')
-rw-r--r-- | draw.c | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -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); + } +} |