source: titan/titan/autores.h @ 10958

Last change on this file since 10958 was 10337, checked in by nit, 12 years ago

[titan] fix _()

File size: 1.5 KB
Line 
1#ifndef AUTORES_H
2#define AUTORES_H
3
4void screenautores(char* text, int timeout, int flag)
5{
6        debug(1000, "in");
7        int rcret = -1, tmpscreencalc = 0, 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                status.screencalc = 2;
22                setnodeattr(autores, framebuffer);
23                status.screencalc = 0;
24                status.rcowner = autores;
25                bg = saverect(autores->rposx, autores->rposy, autores->rwidth, autores->rheight);
26                tmpscreencalc = status.screencalc;
27                status.screencalc = 0;
28                drawscreen(autores, 2);
29        }
30        else
31                drawscreen(autores, 0);
32
33        //deaktivate for test, so we can end the screen with each keypress
34        //while(rcret != RCTIMEOUT && rcret != getrcconfigint("rcexit", NULL))
35                        rcret = waitrc(autores, timeout * 1000, 0);
36
37        if(fromthread != 1)
38                delownerrc(autores);
39
40        if(fromthread == 1)
41        {
42                clearscreennolock(autores);
43                restorerect(bg, autores->rposx, autores->rposy, autores->rwidth, autores->rheight);
44                blitfb();
45                status.screencalc = tmpscreencalc;
46                sleep(1);
47                status.rcowner = NULL;
48                m_unlock(&status.rcmutex, 10);
49                m_unlock(&status.drawingmutex, 0);
50        }
51        else
52        {
53                clearscreen(autores);
54                drawscreen(skin, 0);
55        }
56
57        debug(1000, "out");
58}
59
60void autoresthreadfunc(struct stimerthread* self, char* text, int timeout)
61{
62        screenautores(text, timeout, 0);
63}
64
65#endif
Note: See TracBrowser for help on using the repository browser.