Constantin Kaplinsky | 0a1eca1 | 2006-04-16 07:28:14 +0000 | [diff] [blame^] | 1 | /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. |
| 2 | * |
Constantin Kaplinsky | 47ed8d3 | 2004-10-08 09:43:57 +0000 | [diff] [blame] | 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 | |
Constantin Kaplinsky | 47ed8d3 | 2004-10-08 09:43:57 +0000 | [diff] [blame] | 28 | #include <windows.h> |
| 29 | #include <rfb_win32/WMHooks.h> |
| 30 | |
| 31 | namespace rfb { |
Constantin Kaplinsky | 47ed8d3 | 2004-10-08 09:43:57 +0000 | [diff] [blame] | 32 | 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 Kaplinsky | 47ed8d3 | 2004-10-08 09:43:57 +0000 | [diff] [blame] | 54 | bool use_getCursorInfo; |
| 55 | HCURSOR cursor; |
| 56 | }; |
| 57 | |
| 58 | }; |
Constantin Kaplinsky | 47ed8d3 | 2004-10-08 09:43:57 +0000 | [diff] [blame] | 59 | }; |
| 60 | |
| 61 | #endif // __RFB_WIN32_WM_CURSOR_H__ |