[IPLUG/EXAMPLES] IPlugResampler: qualification of min no longer needed
[wdl/wdl-ol.git] / WDL / rfb_client.h
blobd69483cbe421384d2e1a8bbce31513c45b6ac523
1 #ifndef _WDL_RFBCLIENT_H_
2 #define _WDL_RFBCLIENT_H_
4 #include "wdlstring.h"
5 #include "queue.h"
6 #include "jnetlib/jnetlib.h"
7 #include "lice/lice.h"
9 class WDL_RFB_Client
11 public:
12 WDL_RFB_Client(JNL_IConnection *con, const char *password);
13 ~WDL_RFB_Client();
15 int GetScreenWidth() { return m_screen_w; }
16 int GetScreenHeight() { return m_screen_h; }
18 int Run(); // <0 on disconnect,
19 const char *GetError() { return m_errstr; }
21 void Invalidate() { m_needref=2; } // tell server to re-send
22 void SetUpdateRegion(int x, int y, int w, int h) // if w or h are 0 then whole screen is used
24 m_req_x=x;
25 m_req_y=y;
26 m_req_w=w;
27 m_req_h=h;
30 void RequestUpdate() { m_needref|=1; }
32 void *instance_data;
33 void (*DrawRectangleCallback)(WDL_RFB_Client *_this, LICE_IBitmap *drawimg, int dest_x, int dest_y, int dest_w, int dest_h);
36 private:
38 enum { ErrorState=-1, InitialState=0, AuthWaitState, AuthWaitState2, ServerInitState, RunState, RunState_GettingRects};
40 int m_remote_ver; // xxxyyy
42 int m_state;
43 time_t m_lastt;
44 const char *m_errstr;
46 WDL_String m_password;
47 JNL_IConnection *m_con;
49 int m_screen_w, m_screen_h;
51 int m_req_x,m_req_y,m_req_w,m_req_h, m_needref;
53 WDL_TypedBuf<char> m_namebuf;
54 WDL_TypedQueue<unsigned char> m_msg_buf;
56 int m_skipdata;
58 int m_msg_state; // state specific value / data
60 unsigned int GetBE(int nb=4, int queueoffs=0, bool advance=true);
62 LICE_MemBitmap m_bm;
64 char tmperrbuf[128];
70 #endif//_WDL_RFBCLIENT_H_