Deleted Added
sdiff udiff text old ( 8635:23ba076b2cca ) new ( 9330:4a3269a11230 )
full compact
1/*
2 * Copyright (c) 2010 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 28 unchanged lines hidden (view full) ---

37 * Authors: Ali Saidi
38 * William Wang
39 */
40
41/** @file
42 * Declaration of a VNC server
43 */
44
45#ifndef __BASE_VNC_VNC_SERVER_HH__
46#define __BASE_VNC_VNC_SERVER_HH__
47
48#include <iostream>
49
50#include "base/vnc/convert.hh"
51#include "base/vnc/vncinput.hh"
52#include "base/bitmap.hh"
53#include "base/circlebuf.hh"
54#include "base/pollevent.hh"
55#include "base/socket.hh"
56#include "cpu/intr_control.hh"
57#include "params/VncServer.hh"
58#include "sim/sim_object.hh"
59
60/** @file
61 * Declaration of a VNC server
62 */
63
64class VncServer : public VncInput
65{
66 public:
67
68 /**
69 * \defgroup VncConstants A set of constants and structs from the VNC spec
70 * @{
71 */
72 /** Authentication modes */
73 const static uint32_t AuthInvalid = 0;
74 const static uint32_t AuthNone = 1;
75
76 /** Error conditions */
77 const static uint32_t VncOK = 0;
78
79 /** Server -> Client message IDs */
80 enum ServerMessages {
81 ServerFrameBufferUpdate = 0,
82 ServerSetColorMapEntries = 1,
83 ServerBell = 2,
84 ServerCutText = 3
85 };
86

--- 20 unchanged lines hidden (view full) ---

107 enum ConnectionState {
108 WaitForProtocolVersion,
109 WaitForSecurityResponse,
110 WaitForClientInit,
111 InitializationPhase,
112 NormalPhase
113 };
114
115 struct ServerInitMsg {
116 uint16_t fbWidth;
117 uint16_t fbHeight;
118 PixelFormat px;
119 uint32_t namelen;
120 char name[2]; // just to put M5 in here
121 } M5_ATTR_PACKED;
122
123 struct FrameBufferUpdate {
124 uint8_t type;
125 uint8_t padding;
126 uint16_t num_rects;
127 } M5_ATTR_PACKED;
128
129 struct FrameBufferRect {
130 uint16_t x;

--- 56 unchanged lines hidden (view full) ---

187 ~VncServer();
188
189 // RFB
190 protected:
191
192 /** The rfb prototol state the connection is in */
193 ConnectionState curState;
194
195 /** An update needs to be sent to the client. Without doing this the
196 * client will constantly request data that is pointless */
197 bool sendUpdate;
198
199 /** The one and only pixel format we support */
200 PixelFormat pixelFormat;
201
202 /** If the vnc client supports receiving raw data. It always should */
203 bool supportsRawEnc;
204
205 /** If the vnc client supports the desktop resize command */
206 bool supportsResizeEnc;
207
208 protected:
209 /**
210 * vnc client Interface
211 */
212
213 /** Send an error message to the client
214 * @param error_msg text to send describing the error
215 */
216 void sendError(const char* error_msg);

--- 85 unchanged lines hidden (view full) ---

302 void recvCutText();
303
304 /** Tell the client that the frame buffer resized. This happens when the
305 * simulated system changes video modes (E.g. X11 starts).
306 */
307 void sendFrameBufferResized();
308
309 public:
310 /** The frame buffer uses this call to notify the vnc server that
311 * the frame buffer has been updated and a new image needs to be sent to the
312 * client
313 */
314 void
315 setDirty()
316 {
317 VncInput::setDirty();
318 sendUpdate = true;
319 sendFrameBufferUpdate();
320 }
321
322 /** Set the mode of the data the frame buffer will be sending us
323 * @param mode the mode
324 */
325 void setFrameBufferParams(VideoConvert::Mode mode, uint16_t width,
326 uint16_t height);
327};
328
329#endif