1 /* 2 * Copyright (C) 2003 Constantin Kaplinsky. All Rights Reserved. 3 * 4 * This is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * This software is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this software; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 * USA. 18 */ 19 20 /* 21 * caps.h 22 */ 23 24 #ifndef _VNC_CAPSCONTAINER 25 #define _VNC_CAPSCONTAINER 26 27 /* FIXME: Don't limit the number of capabilities. */ 28 #define TIGHTVNC_MAX_CAPS 64 29 30 typedef struct _CapsContainer 31 { 32 int known_count; 33 CARD32 known_list[TIGHTVNC_MAX_CAPS]; 34 rfbCapabilityInfo known_info[TIGHTVNC_MAX_CAPS]; 35 char *descriptions[TIGHTVNC_MAX_CAPS]; 36 char enable_flags[TIGHTVNC_MAX_CAPS]; 37 38 /* These are redundant, but improve the performance. */ 39 int enabled_count; 40 CARD32 enabled_list[TIGHTVNC_MAX_CAPS]; 41 42 } CapsContainer; 43 44 CapsContainer *CapsNewContainer(void); 45 void CapsDeleteContainer(CapsContainer *pcaps); 46 47 void CapsAdd(CapsContainer *pcaps, 48 CARD32 code, char *vendor, char *name, char *desc); 49 void CapsAddInfo(CapsContainer *pcaps, 50 rfbCapabilityInfo *capinfo, char *desc); 51 52 Bool CapsIsKnown(CapsContainer *pcaps, CARD32 code); 53 Bool CapsGetInfo(CapsContainer *pcaps, CARD32 code, 54 rfbCapabilityInfo *capinfo); 55 char *CapsGetDescription(CapsContainer *pcaps, CARD32 code); 56 57 Bool CapsEnable(CapsContainer *pcaps, rfbCapabilityInfo *capinfo); 58 Bool CapsIsEnabled(CapsContainer *pcaps, CARD32 code); 59 int CapsNumEnabled(CapsContainer *pcaps); 60 CARD32 CapsGetByOrder(CapsContainer *pcaps, int idx); 61 62 #endif /* _VNC_CAPSCONTAINER */ 63 64