1 #ifndef QEMU_GUI_VNCPANEL_H
2 #define QEMU_GUI_VNCPANEL_H
4 #include <wx/scrolwin.h>
5 #include <wx/dcbuffer.h>
9 class VNCDisplayThread
;
12 #include <rfb/rfbclient.h>
15 class VNCPanel
: public wxScrolledWindow
{
17 VNCPanel(wxWindow
*parent
,wxString host
,int display
);
21 * trys to establish a connection to the given host/display
23 bool Connect(int display
);
24 bool Connect(wxString host
,int display
);
26 * stops the vncdisplaythread relases memory used by the
27 * vncclient, gets called from the destructor.
30 void HandleProcessTermination(wxCommandEvent
&);
32 * paints the contents of the SDL surface to the wxPanel
37 * return the VNCClient
40 rfbClient
* GetVNCClient();
43 * draws the updates requested by VLC to the wxPanel
46 void VNCUpdateRect(int x
,int y
,int w
,int h
);
49 * handles screen resizes and creates/allocates the frame buffer
54 wxCriticalSection
& GetCriticalSection();
55 wxCriticalSection lock
;
58 * event handlers which get called from the libvncclient callback
61 void OnVNCUpdate(wxCommandEvent
& event
);
62 void OnVNCResize(wxCommandEvent
& event
);
64 void OnTimer(wxTimerEvent
& event
);
66 wxBitmap
* VNCGenerateBitmap(int x
,int y
,int w
,int h
);
68 * Called to paint the panel.
70 * @param event The triggering wxPaintEvent (unused).
72 void OnPaint(wxPaintEvent
&event
);
75 * Called to erase the background.
77 * @param event The triggering wxEraseEvent (unused).
79 void OnEraseBackground(wxEraseEvent
&event
);
82 * Captures all mouse events and sends them to the vncserver
84 void OnMouseEvent(wxMouseEvent
& event
);
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
);
95 wxMutex
*vncclientMutex
;
98 VNCDisplayThread
*vncdisplaythread
;
101 DECLARE_EVENT_TABLE()