DIWNE::DrawInfo
A structure used to relay information between DIWNE objects during their sequential construction/drawing in a single frame. More...
#include "DIWNE/Core/Elements/DiwneObject.h"
Public Functions
Name | |
---|---|
DrawInfo(InteractionState & state) | |
void | consumeHover() |
void | consumeInput() |
DrawInfo | findChange(const DrawInfo & other) const<br>Find the difference between two contexts. |
bool | inputAvailable()<br>Shorthand for checking that input wasn't consumed. |
bool | inputFullyAvailable()<br>Input is available, nothing is being dragged and no action is active. |
void | logicalUpdate(bool isVisualUpdateAsWell =true) |
void | popup() |
void | tooltip() |
void | update(bool visual, bool logical =false, bool blockInput =false)<br>Composite update method. |
void | visualUpdate() |
Public Attributes
Name | |
---|---|
unsigned short | hoverConsumed <br>Whether objects should not be hovered anymore // TODO: This is currently unused, but potentially useful. |
unsigned short | inputConsumed <br>Whether input has been captured by an object previously and should not be reacted to anymore. |
unsigned short | logicalUpdates <br>Indicates a logical interaction, eg. |
unsigned short | popupOpened |
InteractionState & | state |
unsigned short | tooltipOpened |
unsigned short | visualUpdates <br>Number of purely visual interactions that are occurring. This can be a simple mouse hover. |
Detailed Description
class DIWNE::DrawInfo;
class DIWNE::DrawInfo;
A structure used to relay information between DIWNE objects during their sequential construction/drawing in a single frame.
This is mainly used to retain information about whether an object should react to user input or if a diwne object drawn earlier already "captured" the input and other objects should ignore it. An instance of this object is passed along the drawing code for any nested diwne objects and along the way it collects information about what has already happened that frame. A reference to the persistent interaction state is also passed along to simplify access to it.
Public Functions Documentation
function DrawInfo
DrawInfo(
InteractionState & state
)
DrawInfo(
InteractionState & state
)
function consumeHover
inline void consumeHover()
inline void consumeHover()
function consumeInput
inline void consumeInput()
inline void consumeInput()
function findChange
DrawInfo findChange(
const DrawInfo & other
) const
DrawInfo findChange(
const DrawInfo & other
) const
Find the difference between two contexts.
Parameters:
- other The other, older, context to compare with.
Return: New context representing the only change between this context and the other one.
This relates primarily to the few trivial unsigned short variables. This is used to find the immediate change of the context between two points in time. Which is useful to figure out how a certain draw call changed the context.
function inputAvailable
bool inputAvailable()
bool inputAvailable()
Shorthand for checking that input wasn't consumed.
function inputFullyAvailable
bool inputFullyAvailable()
bool inputFullyAvailable()
Input is available, nothing is being dragged and no action is active.
function logicalUpdate
void logicalUpdate(
bool isVisualUpdateAsWell =true
)
void logicalUpdate(
bool isVisualUpdateAsWell =true
)
function popup
inline void popup()
inline void popup()
function tooltip
inline void tooltip()
inline void tooltip()
function update
void update(
bool visual,
bool logical =false,
bool blockInput =false
)
void update(
bool visual,
bool logical =false,
bool blockInput =false
)
Composite update method.
function visualUpdate
void visualUpdate()
void visualUpdate()
Public Attributes Documentation
variable hoverConsumed
unsigned short hoverConsumed {0};
unsigned short hoverConsumed {0};
Whether objects should not be hovered anymore // TODO: This is currently unused, but potentially useful.
variable inputConsumed
unsigned short inputConsumed {0};
unsigned short inputConsumed {0};
Whether input has been captured by an object previously and should not be reacted to anymore.
variable logicalUpdates
unsigned short logicalUpdates {0};
unsigned short logicalUpdates {0};
Indicates a logical interaction, eg.
change of some attribute or a non blocking button press. Requests focus. This can be used to detect whether an object is being clicked on directly, in which case the number of logical updates should be 0. An object above another should submit a logical update in its onPressed() method.
variable popupOpened
unsigned short popupOpened {0};
unsigned short popupOpened {0};
variable state
InteractionState & state;
InteractionState & state;
variable tooltipOpened
unsigned short tooltipOpened {0};
unsigned short tooltipOpened {0};
variable visualUpdates
unsigned short visualUpdates {0};
unsigned short visualUpdates {0};
Number of purely visual interactions that are occurring. This can be a simple mouse hover.
Updated on 2025-05-31 at 12:55:31 +0000