source: titan/plugins/keylock/keylock.c @ 16512

Last change on this file since 16512 was 16512, checked in by nit, 11 years ago

[titan] update all plugins

  • Property svn:executable set to *
File size: 1.4 KB
Line 
1#include "../../titan/struct.h"
2#include "../../titan/debug.h"
3#include "../../titan/header.h"
4
5char pluginname[] = "KeyLock";
6char plugindesc[] = "Extensions";
7char pluginpic[] = "%pluginpath%/keylock/plugin.png";
8
9int pluginaktiv = 0;
10//struct skin* pluginmenu = NULL;
11//int pluginflag = 1; //don't show the plugin in pluginmanager
12
13void keylock_main()
14{
15        struct skin* framebuffer = getscreen("framebuffer");
16        struct skin* keylock = getscreen("keylock");
17        int t1 = 0, t2 = 0, rcret = 0;
18        char* bg = NULL;
19       
20        setnodeattr(keylock, framebuffer);
21        bg = savescreen(keylock);
22        drawscreen(keylock, 0, 0);
23       
24        while(1)
25        {
26                rcret = waitrc(keylock, 0, 0);
27                if(rcret == getrcconfigint("rcred", NULL)) {
28                        if(t2 == 0) {
29                                t1 = t1 + 1;
30                                if(t1 < 3)
31                                        continue;
32                        }
33                }
34                if(rcret == getrcconfigint("rcgreen", NULL)) {
35                        if(t1 == 2)
36                                break;
37                }
38                t1 = 0;
39                t2 = 0;
40        }
41       
42        restorescreen(bg, keylock);
43        blitfb(0);
44}
45                       
46//wird beim laden ausgefuehrt
47void init(void)
48{
49        char* tmpstr = NULL;
50        pluginaktiv = 1;
51       
52        tmpstr = ostrcat(getconfig("pluginpath", NULL), "/keylock/skin.xml", 0, 0);
53        readscreen(tmpstr, 117, 1);
54        free(tmpstr); tmpstr = NULL;
55       
56        debug(10, "KeyLock Plugin loadet !!!");
57}
58
59//wird beim entladen ausgefuehrt
60void deinit(void)
61{
62        delmarkedscreen(117);
63        pluginaktiv = 0;
64        debug(10, "KeyLock Plugin removed !!!");
65}
66
67
68//wird in der Pluginverwaltung bzw Menue ausfeguehrt
69void start(void)
70{
71        keylock_main();
72}
Note: See TracBrowser for help on using the repository browser.