Add a CTRL+ALT+DELETE menuitem.
[qemu-gui.git] / vncpanel.h
blob647eee492bbd7d793af7f440bd7b3b4c882cc653
1 #ifndef QEMU_GUI_VNCPANEL_H
2 #define QEMU_GUI_VNCPANEL_H
4 #include <wx/scrolwin.h>
5 #include <wx/dcbuffer.h>
6 #include <wx/timer.h>
7 #include <wx/thread.h>
9 class VNCDisplayThread;
11 extern "C" {
12 #include <rfb/rfbclient.h>
15 class VNCPanel : public wxScrolledWindow {
16 public:
17 VNCPanel(wxWindow *parent,wxString host,int display);
18 ~VNCPanel();
20 /**
21 * trys to establish a connection to the given host/display
23 bool Connect(int display);
24 bool Connect(wxString host,int display);
25 /**
26 * stops the vncdisplaythread relases memory used by the
27 * vncclient, gets called from the destructor.
29 void Disconnect();
30 void HandleProcessTermination(wxCommandEvent&);
31 /**
32 * paints the contents of the SDL surface to the wxPanel
34 void Paint();
36 /**
37 * return the VNCClient
40 rfbClient* GetVNCClient();
42 /**
43 * draws the updates requested by VLC to the wxPanel
46 void VNCUpdateRect(int x,int y,int w,int h);
48 /**
49 * handles screen resizes and creates/allocates the frame buffer
52 rfbBool VNCResize();
54 wxCriticalSection& GetCriticalSection();
55 wxCriticalSection lock;
56 private:
57 /**
58 * event handlers which get called from the libvncclient callback
59 * functions.
61 void OnVNCUpdate(wxCommandEvent& event);
62 void OnVNCResize(wxCommandEvent& event);
64 void OnTimer(wxTimerEvent& event);
65 wxTimer timer;
66 wxBitmap* VNCGenerateBitmap(int x,int y,int w,int h);
67 /**
68 * Called to paint the panel.
70 * @param event The triggering wxPaintEvent (unused).
72 void OnPaint(wxPaintEvent &event);
74 /**
75 * Called to erase the background.
77 * @param event The triggering wxEraseEvent (unused).
79 void OnEraseBackground(wxEraseEvent &event);
81 /**
82 * Captures all mouse events and sends them to the vncserver
84 void OnMouseEvent(wxMouseEvent& event);
86 /**
87 * Captures all key events and sends them to the vncserver
89 void OnKeyDown(wxKeyEvent& event);
90 void OnKeyUp(wxKeyEvent& event);
91 rfbKeySym TranslateKeyCode(wxKeyEvent& event);
93 bool Lock();
94 void UnLock();
95 wxMutex *vncclientMutex;
97 rfbClient *vncclient;
98 VNCDisplayThread *vncdisplaythread;
99 bool locked;
101 DECLARE_EVENT_TABLE()
104 #endif