blob: a96822a7ddfc858196a140fc189aefe0cb44662d [file] [log] [blame]
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +00001/* Copyright (C) 2002-2003 RealVNC Ltd. 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// -=- 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
28#define WIN32_LEAN_AND_MEAN
29#include <windows.h>
30#include <rfb_win32/WMHooks.h>
31
32namespace rfb {
33
34 namespace win32 {
35
36 class WMCursor {
37 public:
38 WMCursor();
39 ~WMCursor();
40
41 struct Info {
42 HCURSOR cursor;
43 Point position;
44 bool visible;
45 Info() : cursor(0), visible(false) {}
46 bool operator!=(const Info& info) {
47 return ((cursor != info.cursor) ||
48 (!position.equals(info.position)) ||
49 (visible != info.visible));
50 }
51 };
52
53 Info getCursorInfo();
54 protected:
55 WMCursorHooks* hooks;
56 HMODULE library;
57 bool use_getCursorInfo;
58 HCURSOR cursor;
59 };
60
61 };
62
63};
64
65#endif // __RFB_WIN32_WM_CURSOR_H__