Merge ssh://git@sfinx.od.ua/home/git/Harbour/forms
[forms.git] / F / F_Linux_Console_UI.H
blob710cfd458f833aec4ee7a14392c5546b6d72a968
2 #ifndef _F_LINUX_CONSOLE_UI_H_
3 #define _F_LINUX_CONSOLE_UI_H_
5 #include <F_UI.H>
6 #include <F_Gpm.H>
7 #include <F_Linux_Input.H>
8 #include <F_Linux_Keyboard.H>
9 #include <F_Linux_Console_Display.H>
11 namespace F {
13 /*! The simple console ui implemetation
14  */
16  class F_Linux_Console_UI : public F_UI {
18    F_Input_Device *mouse; // gpm, ÂÕÄØ ÏΠÎÅÌÁÄÅΠ...
19    F_Input_Device *input; // Linux input subsystem (mouse / keyboard / etc.)
20    F_Linux_Console_Display *display;
21    std::vector <F_Event_t> event_queue;
22 //   F_Event_t last_kbd_ev, last_mouse_ev;
23    F_Color cursor_;
24    
25    bool probe();
26    void run(void);
27    void initial();
28    
29   public:
31    F_Linux_Console_UI(unsigned char ui_priority = 0) :
32      F_UI(CONSOLE_UI, ui_priority) {
33 //       memset(&last_kbd_ev, 0, sizeof(F_Event_t));
34 //       memset(&last_mouse_ev, 0, sizeof(F_Event_t));
35        display = 0;
36        mouse = 0;
37        input = 0;
38    }
39    ~F_Linux_Console_UI();
40    void init(void) { }
41    void sigstop();
42    void sigcont();
43    void sigwinch();
44    void sigsegv() { sigsegv_ = true; }
45    void shutdown() {
46      if (cleaned_up_)
47        return;
48      // restore display area from back_store
49      if (display && !sigsegv_)
50        display->restore();
51      delete display;
52      delete mouse;
53      delete input;
54      cleaned_up_ = true;
55   }
56    bool exit_confirm(bool from_sighandler);
58    void refresh();
60    int get_key() {
61 //     int key = last_kbd_ev.kbd.key;
62 //     last_kbd_ev.kbd.key = 0;
63 //     return key;
64     return 0;
65    }
67  };
68 } // namespace F
70 #endif