X-Plane Remote Access Plugin and Client Library
|
#include <MessageWindow.h>
Public Member Functions | |
MessageWindow () | |
~MessageWindow () | |
void | show () |
void | hide () |
void | reset () |
Private Types | |
enum | { MOUSE_MOVE , MOUSE_RESIZE_LEFT , MOUSE_RESIZE_RIGHT } |
Private Member Functions | |
void | drawWindow () |
void | handleKey (char key, XPLMKeyFlags flags, char virtualKey, bool losingFocus) |
bool | handleMouseClick (int x, int y, XPLMMouseStatus mouse) |
float | getNewMessage (std::string &dest) |
void | setNewMessage (const std::string &msg, float d) |
void | resetLocation () |
void | recalculateMaxMessageLength () |
Static Private Member Functions | |
static void | drawWindowCallback (XPLMWindowID windowID, void *refCon) |
static void | handleKeyCallback (XPLMWindowID windowID, char key, XPLMKeyFlags flags, char virtualKey, void *refCon, int losingFocus) |
static int | handleMouseClickCallback (XPLMWindowID windowID, int x, int y, XPLMMouseStatus mouse, void *refCon) |
Private Attributes | |
XPLMDataRef | widthDataRef |
XPLMDataRef | heightDataRef |
int | fontWidth |
int | fontHeight |
XPLMWindowID | windowID |
int | left |
int | top |
int | right |
int | bottom |
size_t | maxMessageLength |
bool | showForced |
std::string | displayedMessage |
float | showTime |
float | hideTime |
enum xplra::MessageWindow:: { ... } | mouseMode |
int | clickedX |
int | clickedY |
int | clickedLeft |
int | clickedTop |
int | clickedRight |
int | clickedBottom |
hu::varadiistvan::scpl::Mutex | mutex |
std::string | message |
float | duration |
Static Private Attributes | |
static const int | minimalWidth = 150 |
static const int | resizeArea = 50 |
static const int | horizontalMarginSize = 25 |
static const int | verticalMarginSize = 5 |
static const int | baseLineSize = 2 |
static constexpr float | scrollTimeout = 1.0 |
static constexpr float | scrollInterval = 0.1 |
Friends | |
class | MessageRequest |
Class to handle the activities related to the message window.
Definition at line 49 of file MessageWindow.h.
|
private |
The mouse mode
Definition at line 182 of file MessageWindow.h.
MessageWindow::MessageWindow | ( | ) |
Construct the message window. It creates the X-Plane window and registers the callback functions. The window is hidden initially.
Definition at line 78 of file MessageWindow.cc.
MessageWindow::~MessageWindow | ( | ) |
Destroy the message window. It destroys the X-Plane window.
Definition at line 110 of file MessageWindow.cc.
|
private |
Called from the window drawing callback.
Definition at line 141 of file MessageWindow.cc.
|
staticprivate |
Window drawing callback.
Definition at line 50 of file MessageWindow.cc.
|
private |
Get the new message, if any.
Definition at line 253 of file MessageWindow.cc.
|
private |
Called from the key handling callback.
Definition at line 183 of file MessageWindow.cc.
|
staticprivate |
Handle the keypresses.
Definition at line 58 of file MessageWindow.cc.
|
private |
Called from the mouse click handling callback.
Definition at line 192 of file MessageWindow.cc.
|
staticprivate |
Handle the mouse clicks.
Definition at line 68 of file MessageWindow.cc.
void MessageWindow::hide | ( | ) |
Hide the message window if it does not have to display an actual message.
Definition at line 126 of file MessageWindow.cc.
|
private |
Recalculate the maximal message length.
Definition at line 303 of file MessageWindow.cc.
void MessageWindow::reset | ( | ) |
Reset the location of the message window.
Definition at line 133 of file MessageWindow.cc.
|
private |
Reset the location of the message window.
Definition at line 284 of file MessageWindow.cc.
|
private |
Set the new message, if any.
Definition at line 272 of file MessageWindow.cc.
void MessageWindow::show | ( | ) |
Force showing the message window.
Definition at line 118 of file MessageWindow.cc.
|
staticprivate |
The size for the baseline above the bottom of the letters.
Definition at line 94 of file MessageWindow.h.
|
private |
The Y-coordinate of the bottom of the window.
Definition at line 151 of file MessageWindow.h.
|
private |
The bottom coordinate of the window when it was clicked.
Definition at line 221 of file MessageWindow.h.
|
private |
The left coordinate of the window when it was clicked.
Definition at line 206 of file MessageWindow.h.
|
private |
The right coordinate of the window when it was clicked.
Definition at line 216 of file MessageWindow.h.
|
private |
The top coordinate of the window when it was clicked.
Definition at line 211 of file MessageWindow.h.
|
private |
The X-coordinate where the window was clicked.
Definition at line 196 of file MessageWindow.h.
|
private |
The Y-coordinate where the window was clicked.
Definition at line 201 of file MessageWindow.h.
|
private |
The currently displayed message.
Definition at line 166 of file MessageWindow.h.
|
private |
The number of seconds for which the message should be shown. If positive, there is a new message.
Definition at line 238 of file MessageWindow.h.
|
private |
The height of one character of the font.
Definition at line 126 of file MessageWindow.h.
|
private |
The width of one character of the font.
Definition at line 121 of file MessageWindow.h.
|
private |
The dataref containing the height of the program's window.
Definition at line 116 of file MessageWindow.h.
|
private |
The time to hide the current message. If not positive, no message is currently shown.
Definition at line 177 of file MessageWindow.h.
|
staticprivate |
The size of the margins at each side of the window.
Definition at line 84 of file MessageWindow.h.
|
private |
The X-coordinate of the left side of the window.
Definition at line 136 of file MessageWindow.h.
|
private |
The maximal message length.
Definition at line 156 of file MessageWindow.h.
|
private |
The message to show.
Definition at line 232 of file MessageWindow.h.
|
staticprivate |
The minimal width of the message area.
Definition at line 74 of file MessageWindow.h.
enum { ... } xplra::MessageWindow::mouseMode |
The mouse mode
|
private |
The mutex protecting some of the data structures that are used from both the simulator loop and the server thread.
Definition at line 227 of file MessageWindow.h.
|
staticprivate |
The size of the resize sensitivity area.
Definition at line 79 of file MessageWindow.h.
|
private |
The X-coordinate of the right side of the window.
Definition at line 146 of file MessageWindow.h.
|
staticconstexprprivate |
The amount of time in seconds between each character step.
Definition at line 105 of file MessageWindow.h.
|
staticconstexprprivate |
The amount of time in seconds after which the message is started to be scrolled, if it should be scrolled.
Definition at line 100 of file MessageWindow.h.
|
private |
Indicate if the message window should be shown
Definition at line 161 of file MessageWindow.h.
|
private |
The time the current message was shown.
Definition at line 171 of file MessageWindow.h.
|
private |
The Y-coordinate of the top of the window.
Definition at line 141 of file MessageWindow.h.
|
staticprivate |
The size of the margins at the top and the bottom of the window.
Definition at line 89 of file MessageWindow.h.
|
private |
The dataref containing the width of the program's window.
Definition at line 111 of file MessageWindow.h.
|
private |
The window ID.
Definition at line 131 of file MessageWindow.h.