1 #ifndef _WDL_RFBCLIENT_H_
2 #define _WDL_RFBCLIENT_H_
6 #include "jnetlib/jnetlib.h"
12 WDL_RFB_Client(JNL_IConnection
*con
, const char *password
);
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
30 void RequestUpdate() { m_needref
|=1; }
33 void (*DrawRectangleCallback
)(WDL_RFB_Client
*_this
, LICE_IBitmap
*drawimg
, int dest_x
, int dest_y
, int dest_w
, int dest_h
);
38 enum { ErrorState
=-1, InitialState
=0, AuthWaitState
, AuthWaitState2
, ServerInitState
, RunState
, RunState_GettingRects
};
40 int m_remote_ver
; // xxxyyy
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
;
58 int m_msg_state
; // state specific value / data
60 unsigned int GetBE(int nb
=4, int queueoffs
=0, bool advance
=true);
70 #endif//_WDL_RFBCLIENT_H_