Debugging framework
[qemu-gui.git] / vncpanel.h
blob10c6ca63e2ab2f3072181cf2f34f38375a5b563e
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);
75 void HideCursor();
76 void ShowCursor();
77 /**
78 * Captures all key events and sends them to the vncserver
80 void OnKeyDown(wxKeyEvent& event);
81 void OnKeyUp(wxKeyEvent& event);
82 rfbKeySym TranslateKeyCode(wxKeyEvent& event);
84 bool Lock();
85 void UnLock();
86 wxMutex *vncclientMutex;
88 rfbClient *vncclient;
89 VNCDisplayThread *vncdisplaythread;
90 bool locked;
92 DECLARE_EVENT_TABLE()
95 #endif