The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
tooltips.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 - 2016 by David White <[email protected]>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #ifndef TOOLTIPS_HPP_INCLUDED
16 #define TOOLTIPS_HPP_INCLUDED
17 
18 #include <string>
19 #include "sdl/utils.hpp"
20 
21 class CVideo;
22 struct SDL_Rect;
23 
24 namespace tooltips {
25 
26 struct manager
27 {
28  manager(CVideo& video);
29  ~manager();
30 };
31 
32 void clear_tooltips();
33 void clear_tooltips(const SDL_Rect& rect);
34 int add_tooltip(const SDL_Rect& rect, const std::string& message, const std::string& action ="", bool use_markup = true, const surface& foreground = surface(nullptr));
35 bool update_tooltip(int id, const SDL_Rect& rect, const std::string& message,
36  const std::string& action, bool use_markup, const surface& foreground);
37 bool update_tooltip(int id, const SDL_Rect& rect, const std::string& message,
38  const std::string& action, bool use_markup);
39 void remove_tooltip(int id);
40 void process(int mousex, int mousey);
41 
42 // Check if we clicked on a tooltip having an action.
43 // If it is, then execute the action and return true
44 // (only possible action are opening help page for the moment)
45 bool click(int mousex, int mousey);
46 
47 }
48 
49 #endif
Definition: video.hpp:58
void remove_tooltip(int id)
Definition: tooltips.cpp:174
void clear_tooltips()
Definition: tooltips.cpp:125
void process(int mousex, int mousey)
Definition: tooltips.cpp:198
bool click(int mousex, int mousey)
Definition: tooltips.cpp:216
tooltips.
GLsizei GLenum GLuint GLuint GLsizei char * message
Definition: glew.h:2499
manager(CVideo &video)
Definition: tooltips.cpp:111
bool update_tooltip(int id, const SDL_Rect &rect, const std::string &message, const std::string &action, bool use_markup)
Definition: tooltips.cpp:149
int add_tooltip(const SDL_Rect &rect, const std::string &message, const std::string &action, bool use_markup, const surface &foreground)
Definition: tooltips.cpp:180
GLsizei const GLcharARB ** string
Definition: glew.h:4503