Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame^] | 1 | /* 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 | // SMsgHandler - class to handle incoming messages on the server side. |
| 20 | // |
| 21 | |
| 22 | #ifndef __RFB_SMSGHANDLER_H__ |
| 23 | #define __RFB_SMSGHANDLER_H__ |
| 24 | |
| 25 | #include <rdr/types.h> |
| 26 | #include <rfb/PixelFormat.h> |
| 27 | #include <rfb/ConnParams.h> |
| 28 | #include <rfb/InputHandler.h> |
| 29 | |
| 30 | namespace rdr { class InStream; } |
| 31 | |
| 32 | namespace rfb { |
| 33 | |
| 34 | class SMsgHandler : public InputHandler { |
| 35 | public: |
| 36 | SMsgHandler(); |
| 37 | virtual ~SMsgHandler(); |
| 38 | |
| 39 | // The following methods are called as corresponding messages are read. A |
| 40 | // derived class should override these methods as desired. Note that for |
| 41 | // the setPixelFormat() and setEncodings() methods, a derived class must |
| 42 | // call on to SMsgHandler's methods. |
| 43 | |
| 44 | virtual void clientInit(bool shared); |
| 45 | |
| 46 | virtual void setPixelFormat(const PixelFormat& pf); |
| 47 | virtual void setEncodings(int nEncodings, rdr::U32* encodings); |
| 48 | virtual void framebufferUpdateRequest(const Rect& r, bool incremental); |
| 49 | |
| 50 | // InputHandler interface |
| 51 | // The InputHandler methods will be called for the corresponding messages. |
| 52 | |
| 53 | // supportsLocalCursor() is called whenever the status of |
| 54 | // cp.supportsLocalCursor has changed. At the moment this happens on a |
| 55 | // setEncodings message, but in the future this may be due to a message |
| 56 | // specially for this purpose. |
| 57 | virtual void supportsLocalCursor(); |
| 58 | |
| 59 | virtual bool processFTMsg(int type) = 0; |
| 60 | |
| 61 | ConnParams cp; |
| 62 | }; |
| 63 | } |
| 64 | #endif |