forked from wesnoth/wesnoth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cursor.hpp
64 lines (48 loc) · 1.33 KB
/
cursor.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/* $Id$ */
/*
Copyright (C) 2003 - 2009 by David White <[email protected]>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2
or at your option any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.
See the COPYING file for more details.
*/
/** @file cursor.hpp */
#ifndef CURSOR_HPP_INCLUDED
#define CURSOR_HPP_INCLUDED
#include "SDL.h"
#include "sdl_utils.hpp"
namespace cursor
{
struct manager
{
manager();
~manager();
};
enum CURSOR_TYPE { NORMAL, WAIT, MOVE, ATTACK, HYPERLINK, MOVE_DRAG, ATTACK_DRAG, NO_CURSOR, NUM_CURSORS };
/**
* This function uses temporary the b&w cursors while the display is busy.
* If used, the colour-cursors will be reused when the display is ready again.
*/
void temporary_use_bw();
/**
* Use the default parameter to reset cursors.
* e.g. after a change in color cursor preferences
*/
void set(CURSOR_TYPE type = NUM_CURSORS);
void set_dragging(bool drag);
CURSOR_TYPE get();
void draw(surface screen);
void undraw(surface screen);
void set_focus(bool focus);
struct setter
{
setter(CURSOR_TYPE type);
~setter();
private:
CURSOR_TYPE old_;
};
} // end namespace cursor
#endif