Files
haiku-beta6/src/apps/remotedesktop/RemoteView.h
T
Michael Lotz 5ed41cffff RemoteDesktop: Switch connection direction and simplify client.
Instead of the server connecting back to a listening client, make it
into a more traditional setup with the server listening on a port and
the client connecting to it.

The client can now either connect directly, unencrypted and without the
ability to trigger listening and specifying a command, or through SSH,
as before with the possibilty to run a target application and causing
the creation of the listener.

With the direction change, there's only the need for one, local, port
forward with SSH, which simplifies things.
2017-11-21 22:18:17 +01:00

88 lines
2.0 KiB
C++

/*
* Copyright 2009, Haiku, Inc.
* Distributed under the terms of the MIT License.
*
* Authors:
* Michael Lotz <[email protected]>
*/
#ifndef REMOTE_VIEW_H
#define REMOTE_VIEW_H
#include <Cursor.h>
#include <NetEndpoint.h>
#include <ObjectList.h>
#include <View.h>
class BBitmap;
class NetReceiver;
class NetSender;
class StreamingRingBuffer;
struct engine_state;
class RemoteView : public BView {
public:
RemoteView(BRect frame,
const char *remoteHost,
uint16 remotePort);
virtual ~RemoteView();
status_t InitCheck();
virtual void AttachedToWindow();
virtual void Draw(BRect updateRect);
virtual void MouseMoved(BPoint where, uint32 code,
const BMessage *dragMessage);
virtual void MouseDown(BPoint where);
virtual void MouseUp(BPoint where);
virtual void KeyDown(const char *bytes, int32 numBytes);
virtual void KeyUp(const char *bytes, int32 numBytes);
virtual void MessageReceived(BMessage *message);
private:
void _SendMouseMessage(uint16 code,
BPoint where);
void _SendKeyMessage(uint16 code,
const char *bytes, int32 numBytes);
static int _StateCompareByKey(const uint32 *key,
const engine_state *state);
void _CreateState(uint32 token);
void _DeleteState(uint32 token);
engine_state * _FindState(uint32 token);
static int32 _DrawEntry(void *data);
void _DrawThread();
BRect _BuildInvalidateRect(BPoint *points,
int32 pointCount);
status_t fInitStatus;
bool fIsConnected;
StreamingRingBuffer * fReceiveBuffer;
StreamingRingBuffer * fSendBuffer;
BNetEndpoint * fEndpoint;
NetReceiver * fReceiver;
NetSender * fSender;
bool fStopThread;
thread_id fDrawThread;
BBitmap * fOffscreenBitmap;
BView * fOffscreen;
BCursor fViewCursor;
BBitmap * fCursorBitmap;
BRect fCursorFrame;
bool fCursorVisible;
BObjectList<engine_state> fStates;
};
#endif // REMOTE_VIEW_H