blob: c5335ad2f8d0291eb20d37e67eb206d902bf4be6 [file] [log] [blame]
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +00001/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
2 *
3 * This is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This software is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this software; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16 * USA.
17 */
18//
19// VNCServer - abstract interface implemented by the RFB library. The back-end
20// code calls the relevant methods as appropriate.
21
22#ifndef __RFB_VNCSERVER_H__
23#define __RFB_VNCSERVER_H__
24
25#include <rfb/UpdateTracker.h>
26#include <rfb/SSecurity.h>
Pierre Ossman04e62db2009-03-23 16:57:07 +000027#include <rfb/ScreenSet.h>
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000028
29namespace rfb {
30
31 class VNCServer : public UpdateTracker {
32 public:
Pierre Ossman559a2e82012-01-23 15:54:11 +000033 // blockUpdates()/unblockUpdates() tells the server that the pixel buffer
34 // is currently in flux and may not be accessed. The attributes of the
35 // pixel buffer may still be accessed, but not the frame buffer itself.
36 // Note that access must be unblocked the exact same number of times it
37 // was blocked.
38 virtual void blockUpdates() = 0;
39 virtual void unblockUpdates() = 0;
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000040
Pierre Ossman04e62db2009-03-23 16:57:07 +000041 // setPixelBuffer() tells the server to use the given pixel buffer (and
42 // optionally a modified screen layout). If this differs in size from
43 // the previous pixel buffer, this may result in protocol messages being
44 // sent, or clients being disconnected.
45 virtual void setPixelBuffer(PixelBuffer* pb, const ScreenSet& layout) = 0;
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000046 virtual void setPixelBuffer(PixelBuffer* pb) = 0;
47
Pierre Ossman04e62db2009-03-23 16:57:07 +000048 // setScreenLayout() modifies the current screen layout without changing
49 // the pixelbuffer. Clients will be notified of the new layout.
50 virtual void setScreenLayout(const ScreenSet& layout) = 0;
51
Constantin Kaplinskyd7c0a6d2007-09-03 04:23:48 +000052 // getPixelBuffer() returns a pointer to the PixelBuffer object.
53 virtual PixelBuffer* getPixelBuffer() const = 0;
54
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000055 // serverCutText() tells the server that the cut text has changed. This
56 // will normally be sent to all clients.
57 virtual void serverCutText(const char* str, int len) = 0;
58
59 // bell() tells the server that it should make all clients make a bell sound.
60 virtual void bell() = 0;
61
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000062 // - Close all currently-connected clients, by calling
63 // their close() method with the supplied reason.
64 virtual void closeClients(const char* reason) = 0;
65
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000066 // setCursor() tells the server that the cursor has changed. The
Pierre Ossman6a1a0d02017-02-19 15:48:17 +010067 // cursorData argument contains width*height rgba quadruplets with
68 // non-premultiplied alpha.
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000069 virtual void setCursor(int width, int height, const Point& hotspot,
Pierre Ossman6a1a0d02017-02-19 15:48:17 +010070 const rdr::U8* cursorData) = 0;
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000071
72 // setCursorPos() tells the server the current position of the cursor.
73 virtual void setCursorPos(const Point& p) = 0;
74
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000075 // setName() tells the server what desktop title to supply to clients
76 virtual void setName(const char* name) = 0;
Pierre Ossmanbb305ca2016-12-11 12:41:26 +010077
78 // setLEDState() tells the server what the current lock keys LED
79 // state is
80 virtual void setLEDState(unsigned int state) = 0;
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000081 };
82}
83#endif