2 * Copyright 2009, Haiku, Inc.
3 * Distributed under the terms of the MIT License.
6 * Michael Lotz <mmlr@mlotz.ch>
12 #include <NetEndpoint.h>
13 #include <ObjectList.h>
19 class StreamingRingBuffer
;
23 class RemoteView
: public BView
{
25 RemoteView(BRect frame
,
26 const char *remoteHost
,
28 virtual ~RemoteView();
32 virtual void AttachedToWindow();
34 virtual void Draw(BRect updateRect
);
36 virtual void MouseMoved(BPoint where
, uint32 code
,
37 const BMessage
*dragMessage
);
38 virtual void MouseDown(BPoint where
);
39 virtual void MouseUp(BPoint where
);
41 virtual void KeyDown(const char *bytes
, int32 numBytes
);
42 virtual void KeyUp(const char *bytes
, int32 numBytes
);
44 virtual void MessageReceived(BMessage
*message
);
47 void _SendMouseMessage(uint16 code
,
49 void _SendKeyMessage(uint16 code
,
50 const char *bytes
, int32 numBytes
);
52 static int _StateCompareByKey(const uint32
*key
,
53 const engine_state
*state
);
54 engine_state
* _CreateState(uint32 token
);
55 void _DeleteState(uint32 token
);
56 engine_state
* _FindState(uint32 token
);
58 static int32
_DrawEntry(void *data
);
61 BRect
_BuildInvalidateRect(BPoint
*points
,
67 StreamingRingBuffer
* fReceiveBuffer
;
68 StreamingRingBuffer
* fSendBuffer
;
69 BNetEndpoint
* fEndpoint
;
70 NetReceiver
* fReceiver
;
74 thread_id fDrawThread
;
76 BBitmap
* fOffscreenBitmap
;
80 BBitmap
* fCursorBitmap
;
84 BObjectList
<engine_state
> fStates
;
87 #endif // REMOTE_VIEW_H