blob: 59eb22e06cc3ab39203890a3e0d29374af1e2dd0 [file] [log] [blame]
Constantin Kaplinskyaf1891c2005-09-29 06:18:28 +00001/* Copyright (C) 2004-2005 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// PollingManager.h
21//
22
23#ifndef __POLLINGMANAGER_H__
24#define __POLLINGMANAGER_H__
25
26#include <X11/Xlib.h>
27#include <rfb/VNCServer.h>
28
29#include <x0vncserver/Image.h>
30
31using namespace rfb;
32
33class PollingManager {
34
35public:
36
37 PollingManager(Display *dpy, Image *image, ImageFactory *factory);
Constantin Kaplinsky14cd5472005-09-29 17:12:11 +000038 virtual ~PollingManager();
Constantin Kaplinskyaf1891c2005-09-29 06:18:28 +000039
Constantin Kaplinsky14cd5472005-09-29 17:12:11 +000040 void setVNCServer(VNCServer *s);
Constantin Kaplinskyaf1891c2005-09-29 06:18:28 +000041 void pollDebug();
42 void poll();
43
44protected:
45
Constantin Kaplinskydc54fc12005-10-19 13:57:16 +000046 void poll_DetectVideo();
Constantin Kaplinsky14cd5472005-09-29 17:12:11 +000047 void poll_SkipCycles();
48 void poll_Traditional();
49 void poll_Dumb();
50
51 Display *m_dpy;
52 VNCServer *m_server;
53
54 Image *m_image;
55 int m_width;
56 int m_height;
57 int m_widthTiles;
58 int m_heightTiles;
59
60 Image *m_rowImage;
61 Image *m_tileImage;
62
63 char *m_statusMatrix;
64
Constantin Kaplinskydc54fc12005-10-19 13:57:16 +000065 char *m_rateMatrix;
66 char *m_videoFlags;
67 char *m_changedFlags;
68
Constantin Kaplinskyaf1891c2005-09-29 06:18:28 +000069 unsigned int m_pollingStep;
70 static const int m_pollingOrder[];
Constantin Kaplinskyaf1891c2005-09-29 06:18:28 +000071
72};
73
74#endif // __POLLINGMANAGER_H__