olaf neophyte and de.po updates, valgrind tweaks, delete green lady, inkscape dpi=96
[goodguy/history.git] / cinelerra-5.1 / cinelerra / remotecontrol.h
1 #ifndef _REMOTECONTROL_H_
2 #define _REMOTECONTROL_H_
3
4 #include "bcpopup.h"
5 #include "bcwindow.h"
6 #include "mutex.h"
7 #include "mwindowgui.inc"
8 #include "thread.h"
9
10 class RemoteControl;
11 class RemoteGUI;
12 class RemoteHandler;
13 class RemoteWindow;
14
15 class RemoteGUI : public BC_Popup
16 {
17 public:
18         RemoteControl *remote_control;
19
20         void set_active(RemoteHandler *handler);
21         void set_inactive();
22         void fill_color(int color);
23         void tile_windows(int config);
24         int button_press_event();
25         int keypress_event();
26         int process_key(int key);
27
28         RemoteGUI(BC_WindowBase *wdw, RemoteControl *remote_control);
29         ~RemoteGUI();
30 };
31
32 class RemoteWindow : public BC_Window
33 {
34 public:
35         RemoteControl *remote_control;
36
37          RemoteWindow(RemoteControl *remote_control);
38          ~RemoteWindow();
39 };
40
41 class RemoteHandler
42 {
43 public:
44         RemoteGUI *gui;
45         int color;
46
47         void activate() { gui->set_active(this); }
48         virtual int remote_process_key(RemoteControl *remote_control, int key) { return -1; }
49
50         RemoteHandler(RemoteGUI *gui, int color);
51         virtual ~RemoteHandler();
52 };
53
54 class RemoteControl : Thread {
55 public:
56         MWindowGUI *mwindow_gui;
57         RemoteWindow *remote_window;
58         RemoteGUI *gui;
59         RemoteHandler *handler;
60         Mutex *active_lock;
61
62         void run();
63         void set_color(int color);
64         void fill_color(int color);
65         int remote_key(int key);
66
67         int activate(RemoteHandler *handler=0);
68         int deactivate();
69         bool is_active() { return handler != 0; }
70
71         RemoteControl(MWindowGUI *gui);
72         ~RemoteControl();
73 };
74
75 #endif