blob: 41f9ee84dda1dcd7a38c95eeec3c9b57fca3b164 [file] [log] [blame]
Constantin Kaplinsky0a1eca12006-04-16 07:28:14 +00001/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
2 *
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +00003 * 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// -=- WMCursor.h
20
21// WMCursor provides a single API through which the cursor state can be obtained
22// The underlying implementation will use either GetCursorInfo, or use the
23// wm_hooks library if GetCursorInfo is not available.
24
25#ifndef __RFB_WIN32_WM_CURSOR_H__
26#define __RFB_WIN32_WM_CURSOR_H__
27
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +000028#include <windows.h>
29#include <rfb_win32/WMHooks.h>
30
31namespace rfb {
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +000032 namespace win32 {
33
34 class WMCursor {
35 public:
36 WMCursor();
37 ~WMCursor();
38
39 struct Info {
40 HCURSOR cursor;
41 Point position;
42 bool visible;
43 Info() : cursor(0), visible(false) {}
44 bool operator!=(const Info& info) {
45 return ((cursor != info.cursor) ||
46 (!position.equals(info.position)) ||
47 (visible != info.visible));
48 }
49 };
50
51 Info getCursorInfo();
52 protected:
53 WMCursorHooks* hooks;
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +000054 bool use_getCursorInfo;
55 HCURSOR cursor;
56 };
57
58 };
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +000059};
60
61#endif // __RFB_WIN32_WM_CURSOR_H__