source: trunk/src/testing/app/vnc/rfb.h @ 4

Revision 4, 2.5 KB checked in by ajaworski, 13 years ago (diff)

Added modified SAGE sources

Line 
1//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
2//
3//  This file is part of the VNC system.
4//
5//  The VNC system is free software; you can redistribute it and/or modify
6//  it under the terms of the GNU General Public License as published by
7//  the Free Software Foundation; either version 2 of the License, or
8//  (at your option) any later version.
9//
10//  This program is distributed in the hope that it will be useful,
11//  but WITHOUT ANY WARRANTY; without even the implied warranty of
12//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13//  GNU General Public License for more details.
14//
15//  You should have received a copy of the GNU General Public License
16//  along with this program; if not, write to the Free Software
17//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
18//  USA.
19//
20// If the source code for the VNC system is not available from the place
21// whence you received this file, check http://www.uk.research.att.com/vnc or contact
22// the authors on vnc@uk.research.att.com for information on obtaining it.
23
24
25// rfb.h
26// This includes the rfb spec header, the port numbers,
27// the CARD type definitions and various useful macros.
28//
29
30#ifndef RFB_H__
31#define RFB_H__
32
33// Define the CARD* types as used in X11/Xmd.h
34
35#if defined(WIN32)
36typedef unsigned long CARD32;
37typedef unsigned short CARD16;
38typedef short INT16;
39typedef unsigned char  CARD8;
40#else
41#include <X11/Xmd.h> // **** CORRECTION HACK - Miko 6/6/2003
42#endif
43
44/*
45 * Data structure used by color operations
46 */
47//  typedef struct {
48//      unsigned long pixel;
49//      unsigned short red, green, blue;
50//      char flags;
51//      char pad;
52//  } XColor;
53//  #define DoRed                       (1<<0)
54//  #define DoGreen                     (1<<1)
55//  #define DoBlue                      (1<<2)
56
57// Define the port number offsets
58#define FLASH_PORT_OFFSET 5400
59#define INCOMING_PORT_OFFSET 5500
60#define HTTP_PORT_OFFSET 5800   // we don't use this in Venice
61#define RFB_PORT_OFFSET 5900
62
63#define PORT_TO_DISPLAY(p) ( (p) - RFB_PORT_OFFSET )
64#define DISPLAY_TO_PORT(d) ( (d) + RFB_PORT_OFFSET )
65
66// include the protocol spec
67#include "rfbproto.h"
68
69// define some quick endian conversions
70// change this if necessary
71#if not defined(__APPLE__)
72#define LITTLE_ENDIAN_HOST
73#endif
74
75#ifdef LITTLE_ENDIAN_HOST
76
77#define Swap16IfLE(s) \
78    ((CARD16) ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)))
79#define Swap32IfLE(l) \
80    ((CARD32) ((((l) & 0xff000000) >> 24) | \
81     (((l) & 0x00ff0000) >> 8)  | \
82         (((l) & 0x0000ff00) << 8)  | \
83         (((l) & 0x000000ff) << 24)))
84
85#else
86
87#define Swap16IfLE(s) (s)
88#define Swap32IfLE(l) (l)
89
90#endif
91
92
93#endif
Note: See TracBrowser for help on using the repository browser.