xoreos
0.0.5
|
A tooltip. More...
#include <tooltip.h>
Classes | |
struct | Line |
Public Types | |
enum | Type { kTypeHelp, kTypeFeedback, kTypeSpeech } |
Public Member Functions | |
Tooltip (Type type) | |
Tooltip (Type type, Widget &parent) | |
Tooltip (Type type, Graphics::Aurora::Model &parent) | |
~Tooltip () | |
void | clearLines () |
void | clearPortrait () |
void | addLine (const Common::UString &text, float r, float g, float b, float a) |
void | setPortrait (const Common::UString &image) |
void | setAlign (float align) |
void | updatePosition () |
void | setPosition (float x, float y, float z) |
void | show (uint32 delay, uint32 timeOut=0) |
Show the tooltip. More... | |
void | hide () |
Hide the tooltip again. More... | |
Public Member Functions inherited from Events::Notifyable | |
Notifyable () | |
virtual | ~Notifyable () |
Static Public Member Functions | |
static uint32 | getDefaultDelay () |
Returns the configured default delay, in ms, before a tooltip appears. More... | |
Protected Member Functions | |
void | notifyCameraMoved () |
Private Member Functions | |
void | getSize (float &width, float &height) |
void | checkEmpty () |
void | redoLines (bool force=false) |
void | redoBubble () |
void | redoLayout () |
bool | createTexts (float width, size_t maxLines=0) |
void | deleteTexts () |
uint32 | doShow (uint32 oldInterval) |
uint32 | doHide (uint32 oldInterval) |
void | doShow () |
void | doHide () |
void | getFeedbackMode (bool &showBubble, bool &showText, bool &showPortrait) const |
bool | getParentPosition (float &x, float &y, float &z) const |
Static Private Member Functions | |
static Common::UString | getFontName () |
static Common::UString | getBubbleModel (uint32 lines, float width) |
Private Attributes | |
Type | _type |
Widget * | _parentWidget |
Graphics::Aurora::Model * | _parentModel |
bool | _empty |
bool | _visible |
float | _align |
bool | _showText |
bool | _showBubble |
bool | _showPortrait |
Common::ScopedPtr< Graphics::Aurora::Model > | _bubble |
Common::ScopedPtr< Portrait > | _portrait |
std::vector< Line > | _lines |
Common::PtrVector< Graphics::Aurora::Text > | _texts |
bool | _offscreen |
float | _x |
float | _y |
float | _z |
float | _lineHeight |
float | _lineSpacing |
float | _width |
float | _height |
Common::UString | _font |
Events::TimerHandle | _timerShow |
Events::TimerHandle | _timerHide |
bool | _needCamera |
bool | _detectEdge |
Common::Mutex | _mutex |
Engines::NWN::Tooltip::Tooltip | ( | Type | type | ) |
Definition at line 49 of file tooltip.cpp.
References _showBubble, _showPortrait, _showText, and getFeedbackMode().
Definition at line 59 of file tooltip.cpp.
References _showBubble, _showPortrait, _showText, and getFeedbackMode().
Engines::NWN::Tooltip::Tooltip | ( | Type | type, |
Graphics::Aurora::Model & | parent | ||
) |
Definition at line 69 of file tooltip.cpp.
References _showBubble, _showPortrait, _showText, and getFeedbackMode().
Engines::NWN::Tooltip::~Tooltip | ( | ) |
Definition at line 79 of file tooltip.cpp.
References deleteTexts(), and hide().
void Engines::NWN::Tooltip::addLine | ( | const Common::UString & | text, |
float | r, | ||
float | g, | ||
float | b, | ||
float | a | ||
) |
Definition at line 101 of file tooltip.cpp.
References _lines, Common::UString::empty(), hide(), redoLines(), and Common::UString::split().
|
private |
Definition at line 305 of file tooltip.cpp.
References _empty, _lines, and _portrait.
Referenced by redoLayout().
void Engines::NWN::Tooltip::clearLines | ( | ) |
Definition at line 85 of file tooltip.cpp.
References _lines, hide(), and redoLines().
void Engines::NWN::Tooltip::clearPortrait | ( | ) |
Definition at line 93 of file tooltip.cpp.
References _portrait, hide(), and redoLayout().
|
private |
Definition at line 313 of file tooltip.cpp.
References _font, _lines, _showBubble, _showPortrait, _texts, deleteTexts(), FontMan, Graphics::Aurora::FontHandle::getFont(), and Graphics::Font::split().
Referenced by redoLines().
|
private |
Definition at line 309 of file tooltip.cpp.
References _texts, and Common::PtrVector< T, Deallocator >::clear().
Referenced by createTexts(), and ~Tooltip().
Definition at line 462 of file tooltip.cpp.
References _mutex, _timerShow, _visible, doHide(), and TimerMan.
|
private |
Definition at line 442 of file tooltip.cpp.
References _bubble, _portrait, _texts, and GfxMan.
Referenced by doHide(), hide(), show(), and updatePosition().
Definition at line 456 of file tooltip.cpp.
References _mutex, and doShow().
|
private |
Definition at line 424 of file tooltip.cpp.
References _bubble, _empty, _offscreen, _portrait, _showBubble, _showPortrait, _showText, _texts, _visible, and GfxMan.
Referenced by doShow(), show(), and updatePosition().
|
staticprivate |
Definition at line 503 of file tooltip.cpp.
References Common::UString::format().
Referenced by redoBubble().
|
static |
Returns the configured default delay, in ms, before a tooltip appears.
Definition at line 539 of file tooltip.cpp.
References ConfigMan.
Referenced by Engines::NWN::NWNWidget::enter(), and Engines::NWN::Object::showFeedbackTooltip().
|
private |
Definition at line 476 of file tooltip.cpp.
References _type, ConfigMan, kTypeHelp, and kTypeSpeech.
Referenced by redoLines(), and Tooltip().
|
staticprivate |
Definition at line 499 of file tooltip.cpp.
References ConfigMan.
Referenced by redoLayout(), and redoLines().
|
private |
Definition at line 147 of file tooltip.cpp.
References _parentModel, _parentWidget, Engines::Widget::getPosition(), Graphics::Aurora::Model::getTooltipAnchor(), and GfxMan.
Referenced by updatePosition().
|
private |
Definition at line 289 of file tooltip.cpp.
References _lineHeight, _lineSpacing, _portrait, _texts, and MAX().
Referenced by redoLayout().
void Engines::NWN::Tooltip::hide | ( | ) |
Hide the tooltip again.
Definition at line 275 of file tooltip.cpp.
References _mutex, _timerHide, _timerShow, _visible, doHide(), and TimerMan.
Referenced by addLine(), clearLines(), clearPortrait(), setAlign(), setPortrait(), setPosition(), and ~Tooltip().
|
protectedvirtual |
Reimplemented from Events::Notifyable.
Definition at line 143 of file tooltip.cpp.
References updatePosition().
|
private |
Definition at line 373 of file tooltip.cpp.
References _bubble, _height, _lineHeight, _lineSpacing, _showBubble, _width, Common::UString::c_str(), getBubbleModel(), Engines::loadModelGUI(), Common::ScopedPtrBase< T, Deallocator >::reset(), and warning().
Referenced by redoLayout().
|
private |
Definition at line 398 of file tooltip.cpp.
References _empty, _font, _height, _lineHeight, _lineSpacing, _width, checkEmpty(), Common::UString::empty(), FontMan, Graphics::Aurora::FontHandle::getFont(), getFontName(), Graphics::Font::getHeight(), Graphics::Font::getLineSpacing(), getSize(), redoBubble(), and updatePosition().
Referenced by clearPortrait(), redoLines(), setAlign(), and setPortrait().
|
private |
Definition at line 334 of file tooltip.cpp.
References _font, _height, _lineHeight, _lineSpacing, _showBubble, _showPortrait, _showText, _width, createTexts(), FontMan, getFeedbackMode(), Graphics::Aurora::FontHandle::getFont(), getFontName(), Graphics::Font::getHeight(), Graphics::Font::getLineSpacing(), and redoLayout().
Referenced by addLine(), clearLines(), and show().
void Engines::NWN::Tooltip::setAlign | ( | float | align | ) |
Definition at line 136 of file tooltip.cpp.
References _align, hide(), and redoLayout().
void Engines::NWN::Tooltip::setPortrait | ( | const Common::UString & | image | ) |
Definition at line 125 of file tooltip.cpp.
References _portrait, hide(), Engines::NWN::Portrait::kSizeTiny, and redoLayout().
void Engines::NWN::Tooltip::setPosition | ( | float | x, |
float | y, | ||
float | z | ||
) |
Definition at line 248 of file tooltip.cpp.
References _x, _y, _z, hide(), and updatePosition().
Show the tooltip.
delay | Time in ms to wait before the tooltip appears. If delay is 0, the tooltip will appear immediately. |
timeOut | Time in ms, after the tooltip appeared, before it will be automatically hidden again. If timeOut is 0, the tooltip will not be automatically hidden at all. To hide it, hide() has to be called. |
Definition at line 258 of file tooltip.cpp.
References _empty, _timerHide, _timerShow, _visible, doHide(), doShow(), redoLines(), and TimerMan.
void Engines::NWN::Tooltip::updatePosition | ( | ) |
Definition at line 170 of file tooltip.cpp.
References _align, _bubble, _detectEdge, _empty, _height, _lineHeight, _lineSpacing, _mutex, _offscreen, _portrait, _showBubble, _showPortrait, _texts, _width, _x, _y, _z, doHide(), doShow(), getParentPosition(), MAX(), and WindowMan.
Referenced by notifyCameraMoved(), redoLayout(), and setPosition().
|
private |
Definition at line 109 of file tooltip.h.
Referenced by setAlign(), and updatePosition().
|
private |
Definition at line 115 of file tooltip.h.
Referenced by doHide(), doShow(), redoBubble(), and updatePosition().
|
private |
Definition at line 140 of file tooltip.h.
Referenced by updatePosition().
|
private |
Definition at line 106 of file tooltip.h.
Referenced by checkEmpty(), doShow(), redoLayout(), show(), and updatePosition().
|
private |
Definition at line 134 of file tooltip.h.
Referenced by createTexts(), redoLayout(), and redoLines().
|
private |
Definition at line 132 of file tooltip.h.
Referenced by redoBubble(), redoLayout(), redoLines(), and updatePosition().
|
private |
Definition at line 128 of file tooltip.h.
Referenced by getSize(), redoBubble(), redoLayout(), redoLines(), and updatePosition().
|
private |
Definition at line 119 of file tooltip.h.
Referenced by addLine(), checkEmpty(), clearLines(), and createTexts().
|
private |
Definition at line 129 of file tooltip.h.
Referenced by getSize(), redoBubble(), redoLayout(), redoLines(), and updatePosition().
|
private |
|
private |
Definition at line 122 of file tooltip.h.
Referenced by doShow(), and updatePosition().
|
private |
Definition at line 104 of file tooltip.h.
Referenced by getParentPosition().
|
private |
Definition at line 103 of file tooltip.h.
Referenced by getParentPosition().
|
private |
Definition at line 117 of file tooltip.h.
Referenced by checkEmpty(), clearPortrait(), doHide(), doShow(), getSize(), setPortrait(), and updatePosition().
|
private |
Definition at line 112 of file tooltip.h.
Referenced by createTexts(), doShow(), redoBubble(), redoLines(), Tooltip(), and updatePosition().
|
private |
Definition at line 113 of file tooltip.h.
Referenced by createTexts(), doShow(), redoLines(), Tooltip(), and updatePosition().
|
private |
Definition at line 111 of file tooltip.h.
Referenced by doShow(), redoLines(), and Tooltip().
|
private |
Definition at line 120 of file tooltip.h.
Referenced by createTexts(), deleteTexts(), doHide(), doShow(), getSize(), and updatePosition().
|
private |
|
private |
|
private |
Definition at line 101 of file tooltip.h.
Referenced by getFeedbackMode().
|
private |
|
private |
Definition at line 131 of file tooltip.h.
Referenced by redoBubble(), redoLayout(), redoLines(), and updatePosition().
|
private |
Definition at line 124 of file tooltip.h.
Referenced by setPosition(), and updatePosition().
|
private |
Definition at line 125 of file tooltip.h.
Referenced by setPosition(), and updatePosition().
|
private |
Definition at line 126 of file tooltip.h.
Referenced by setPosition(), and updatePosition().