Constantin Kaplinsky | ce0907d | 2006-09-08 12:55:37 +0000 | [diff] [blame^] | 1 | /* Copyright (C) 2006 Constantin Kaplinsky. 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 | // |
| 20 | // CapsList class declaration. |
| 21 | // FIXME: Extend the comment. |
| 22 | // |
| 23 | |
| 24 | #ifndef __RFB_CAPSLIST_H__ |
| 25 | #define __RFB_CAPSLIST_H__ |
| 26 | |
| 27 | #include <rfb/CapsContainer.h> |
| 28 | |
| 29 | namespace rdr { class OutStream; } |
| 30 | |
| 31 | namespace rfb { |
| 32 | |
| 33 | // NOTE: Here we use the CapsContainer class for an off-design purpose. |
| 34 | // However, that class is so good that I believe it's better to |
| 35 | // use its well-tested reliable code instead of writing new class |
| 36 | // from the scratch. |
| 37 | |
| 38 | class CapsList : private CapsContainer { |
| 39 | public: |
| 40 | CapsList(int maxCaps = 64); |
| 41 | virtual ~CapsList(); |
| 42 | |
| 43 | int getSize() const { return numEnabled(); } |
| 44 | |
| 45 | void addStandard(rdr::U32 code, const char *name); |
| 46 | void addTightExt(rdr::U32 code, const char *name); |
| 47 | void add3rdParty(rdr::U32 code, const char *name, const char *vendor); |
| 48 | |
| 49 | void write(rdr::OutStream* os) const; |
| 50 | |
| 51 | protected: |
| 52 | static const char *const VENDOR_STD; |
| 53 | static const char *const VENDOR_TIGHT; |
| 54 | }; |
| 55 | |
| 56 | } |
| 57 | |
| 58 | #endif // __RFB_CAPSLIST_H__ |