Use new vnc syntax (with a colon).
[qemu-gui.git] / vncpanel.h
blob44b61eb2b2d0fdfc9758e8c5f6cee87739b10ea6
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 wxCriticalSection& GetCriticalSection();
54 wxCriticalSection lock;
55 private:
56 wxBitmap* VNCGenerateBitmap(int x,int y,int w,int h);
57 /**
58 * Called to paint the panel.
60 * @param event The triggering wxPaintEvent (unused).
62 void OnPaint(wxPaintEvent &event);
64 /**
65 * Called to erase the background.
67 * @param event The triggering wxEraseEvent (unused).
69 void OnEraseBackground(wxEraseEvent &event);
71 /**
72 * Captures all mouse events and sends them to the vncserver
74 void OnMouseEvent(wxMouseEvent& event);
76 /**
77 * Captures all key events and sends them to the vncserver
79 void OnKeyDown(wxKeyEvent& event);
80 void OnKeyUp(wxKeyEvent& event);
81 rfbKeySym TranslateKeyCode(wxKeyEvent& event);
83 bool Lock();
84 void UnLock();
85 wxMutex *vncclientMutex;
87 rfbClient *vncclient;
88 VNCDisplayThread *vncdisplaythread;
89 bool locked;
91 DECLARE_EVENT_TABLE()
94 #endif