Added some temporary icons to the repository
[qemu-gui.git] / vncpanel.h
blob103900b76bf61cf37a6c04f6c9cf4bab3fedbaf8
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/thread.h>
8 class VNCDisplayThread;
10 extern "C" {
11 #include <rfb/rfbclient.h>
14 class VNCPanel : public wxScrolledWindow {
15 public:
16 VNCPanel(wxWindow *parent,wxString host,int display);
17 ~VNCPanel();
19 /**
20 * trys to establish a connection to the given host/display
22 bool Connect(int display);
23 bool Connect(wxString host,int display);
24 /**
25 * stops the vncdisplaythread relases memory used by the
26 * vncclient, gets called from the destructor.
28 void Disconnect();
29 void HandleProcessTermination(wxCommandEvent&);
30 /**
31 * paints the contents of the SDL surface to the wxPanel
33 void Paint();
35 /**
36 * return the VNCClient
39 rfbClient* GetVNCClient();
41 /**
42 * draws the updates requested by VLC to the wxPanel
45 void VNCUpdateRect(int x,int y,int w,int h);
47 /**
48 * handles screen resizes and creates/allocates the frame buffer
51 rfbBool VNCResize();
53 private:
54 wxBitmap* VNCGenerateBitmap(int x,int y,int w,int h);
55 /**
56 * Called to paint the panel.
58 * @param event The triggering wxPaintEvent (unused).
60 void OnPaint(wxPaintEvent &event);
62 /**
63 * Called to erase the background.
65 * @param event The triggering wxEraseEvent (unused).
67 void OnEraseBackground(wxEraseEvent &event);
69 /**
70 * Captures all mouse events and sends them to the vncserver
72 void OnMouseEvent(wxMouseEvent& event);
73 void HideCursor();
74 void ShowCursor();
75 /**
76 * Captures all key events and sends them to the vncserver
78 void OnKeyDown(wxKeyEvent& event);
79 void OnKeyUp(wxKeyEvent& event);
80 rfbKeySym TranslateKeyCode(wxKeyEvent& event);
82 bool Lock();
83 void UnLock();
85 rfbClient *vncclient;
86 VNCDisplayThread *vncdisplaythread;
87 bool locked;
89 DECLARE_EVENT_TABLE()
92 #endif