[4] | 1 | /***************************************************************************************** |
---|
| 2 | * VNCViewer for SAGE |
---|
| 3 | * Copyright (C) 2004 Electronic Visualization Laboratory, |
---|
| 4 | * University of Illinois at Chicago |
---|
| 5 | * |
---|
| 6 | * All rights reserved. |
---|
| 7 | * |
---|
| 8 | * Redistribution and use in source and binary forms, with or without |
---|
| 9 | * modification, are permitted provided that the following conditions are met: |
---|
| 10 | * |
---|
| 11 | * * Redistributions of source code must retain the above copyright |
---|
| 12 | * notice, this list of conditions and the following disclaimer. |
---|
| 13 | * * Redistributions in binary form must reproduce the above |
---|
| 14 | * copyright notice, this list of conditions and the following disclaimer |
---|
| 15 | * in the documentation and/or other materials provided with the distribution. |
---|
| 16 | * * Neither the name of the University of Illinois at Chicago nor |
---|
| 17 | * the names of its contributors may be used to endorse or promote |
---|
| 18 | * products derived from this software without specific prior written permission. |
---|
| 19 | * |
---|
| 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
---|
| 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
---|
| 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
---|
| 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
---|
| 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
---|
| 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
---|
| 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
---|
| 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
---|
| 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
---|
| 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
---|
| 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
| 31 | * |
---|
| 32 | * Direct questions, comments etc about VNCViewer for SAGE to www.evl.uic.edu/cavern/forum |
---|
| 33 | *****************************************************************************************/ |
---|
| 34 | |
---|
| 35 | |
---|
| 36 | #ifndef _AURA_H_sgVNCViewer |
---|
| 37 | #define _AURA_H_sgVNCViewer |
---|
| 38 | |
---|
| 39 | #include "vncviewer.h" |
---|
| 40 | |
---|
| 41 | |
---|
| 42 | #define CMD_UPDATE 0xDE50001 |
---|
| 43 | |
---|
| 44 | #if defined(WIN32) |
---|
| 45 | void InitWinsock(); |
---|
| 46 | #endif |
---|
| 47 | |
---|
| 48 | // [M]ouse buttons |
---|
| 49 | #define MK_NOTHING 0x0000 |
---|
| 50 | #define MK_LEFT 0x0001 |
---|
| 51 | #define MK_RIGHT 0x0002 |
---|
| 52 | #define MK_MIDDLE 0x0003 |
---|
| 53 | |
---|
| 54 | |
---|
| 55 | class sgVNCViewer |
---|
| 56 | { |
---|
| 57 | protected: |
---|
| 58 | int ox, oy; // origin of the tile |
---|
| 59 | int sw, sh; // size of the tile |
---|
| 60 | |
---|
| 61 | char *hostname; |
---|
| 62 | char *password; |
---|
| 63 | int displaynumber; |
---|
| 64 | int focus; |
---|
| 65 | int bstate; |
---|
| 66 | |
---|
| 67 | VNCViewer *VNC; |
---|
| 68 | uchar *screen_back; |
---|
| 69 | uchar *screen_front; |
---|
| 70 | int rectData; |
---|
| 71 | |
---|
| 72 | public: |
---|
| 73 | sgVNCViewer(char *host, int display, int _ox, int _oy, int _sw, int _sh, char *passwd); |
---|
| 74 | ~sgVNCViewer(); |
---|
| 75 | |
---|
| 76 | virtual bool Step(); |
---|
| 77 | uchar *Data(); |
---|
| 78 | |
---|
| 79 | void CopyDataToScreen(char *buf, int x, int y, int width, int height); |
---|
| 80 | void RectDataToScreen(int x, int y, int w, int h, int ox, int oy); |
---|
| 81 | void FillToScreen(CARD32 pix, int x, int y, int width, int height); |
---|
| 82 | void SendKey(unsigned long key, int down); |
---|
| 83 | void SendMouse(int x, int y, int button); |
---|
| 84 | |
---|
| 85 | }; |
---|
| 86 | |
---|
| 87 | #endif |
---|