1 | #ifndef AUTORES_H |
---|
2 | #define AUTORES_H |
---|
3 | |
---|
4 | void screenautores(char* text, int timeout, int flag) |
---|
5 | { |
---|
6 | debug(1000, "in"); |
---|
7 | int rcret = -1, fromthread = 0; |
---|
8 | struct skin* autores = getscreen("autores"); |
---|
9 | struct skin* framebuffer = getscreen("framebuffer"); |
---|
10 | char* bg = NULL; |
---|
11 | |
---|
12 | if(pthread_self() != status.mainthread) |
---|
13 | fromthread = 1; |
---|
14 | |
---|
15 | changetext(autores, text); |
---|
16 | |
---|
17 | if(fromthread == 1) |
---|
18 | { |
---|
19 | m_lock(&status.drawingmutex, 0); |
---|
20 | m_lock(&status.rcmutex, 10); |
---|
21 | setnodeattr(autores, framebuffer, 2); |
---|
22 | status.rcowner = autores; |
---|
23 | bg = savescreen(autores); |
---|
24 | drawscreen(autores, 0, 2); |
---|
25 | } |
---|
26 | else |
---|
27 | drawscreen(autores, 0, 0); |
---|
28 | |
---|
29 | //deaktivate for test, so we can end the screen with each keypress |
---|
30 | //while(rcret != RCTIMEOUT && rcret != getrcconfigint("rcexit", NULL)) |
---|
31 | rcret = waitrc(autores, timeout * 1000, 0); |
---|
32 | |
---|
33 | if(fromthread != 1) |
---|
34 | delownerrc(autores); |
---|
35 | |
---|
36 | if(fromthread == 1) |
---|
37 | { |
---|
38 | clearscreennolock(autores); |
---|
39 | restorescreen(bg, autores); |
---|
40 | blitfb(0); |
---|
41 | sleep(1); |
---|
42 | status.rcowner = NULL; |
---|
43 | m_unlock(&status.rcmutex, 10); |
---|
44 | m_unlock(&status.drawingmutex, 0); |
---|
45 | } |
---|
46 | else |
---|
47 | { |
---|
48 | clearscreen(autores); |
---|
49 | drawscreen(skin, 0, 0); |
---|
50 | } |
---|
51 | |
---|
52 | debug(1000, "out"); |
---|
53 | } |
---|
54 | |
---|
55 | void autoresthreadfunc(struct stimerthread* self, char* text, int timeout) |
---|
56 | { |
---|
57 | screenautores(text, timeout, 0); |
---|
58 | } |
---|
59 | |
---|
60 | #endif |
---|