wesnoth/src/tooltips.hpp
Martin Hrubý (hrubymar10) 674fda85b7 Migrate links to https if available - Fwd c18537edc0
(cherry-picked from commit bc4d22dc72)
2018-10-07 03:23:36 +00:00

45 lines
1.4 KiB
C++

/*
Copyright (C) 2003 - 2018 by David White <dave@whitevine.net>
Part of the Battle for Wesnoth Project https://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 as published by
the Free Software Foundation; either version 2 of the License, 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.
*/
#pragma once
#include <string>
#include "sdl/surface.hpp"
struct SDL_Rect;
namespace tooltips {
struct manager
{
manager();
~manager();
};
void clear_tooltips();
void clear_tooltips(const SDL_Rect& rect);
int add_tooltip(const SDL_Rect& rect, const std::string& message, const std::string& action ="", bool use_markup = true, const surface& foreground = surface(nullptr));
bool update_tooltip(int id, const SDL_Rect& rect, const std::string& message,
const std::string& action, bool use_markup, const surface& foreground);
bool update_tooltip(int id, const SDL_Rect& rect, const std::string& message,
const std::string& action, bool use_markup);
void remove_tooltip(int id);
void process(int mousex, int mousey);
// Check if we clicked on a tooltip having an action.
// If it is, then execute the action and return true
// (only possible action are opening help page for the moment)
bool click(int mousex, int mousey);
}