2#include "MRViewerFwd.h"
74 MRVIEWER_API
void draw(
const Box2i& limitFramebuffer );
81 float defaultNotificationLifeTimeSeconds = 5.0f;
89 struct NotificationWithTimer
95 std::vector<NotificationWithTimer> notifications_;
96 std::vector<NotificationWithTimer> notificationsHistory_;
97 bool requestRedraw_ =
false;
98 bool historyMode_ =
false;
100 float showHistoryBtnMaxTime_{ -1.0f };
101 float currentHistoryBtnTimer_{ -1.0f };
102#ifndef __EMSCRIPTEN__
103 Time requestedTime_{ Time::max() };
104 AsyncRequest asyncRequest_;
108 void drawHistoryButton_(
const Box2i& limitFramebuffer );
110 void drawHistory_(
const Box2i& limitFramebuffer );
112 void drawFloating_(
const Box2i& limitFramebuffer );
115 bool scrollDownNeeded_ =
false;
116 float prevHistoryScrollMax_ = 0.0f;
117 struct DrawNotificationSettings
121 bool historyMode{
false };
122 Vector2f* currentPos{
nullptr };
126 bool drawNotification_(
const DrawNotificationSettings& settings );
127 void addNotification_( std::vector<NotificationWithTimer>& store,
const RibbonNotification& notification );
128 void filterInvalid_(
int numInvalid = -1 );
129 void requestClosestRedraw_();
#define MR_MAKE_FLAG_OPERATORS(T)
Generates operators for a enum (at namespace scope).
Definition MRFlagOperators.h:6
class to hold and operate with notifications
Definition MRRibbonNotification.h:67
auto width(const Box< V > &box)
returns size along x axis
Definition MRBox.h:354
MRVIEWER_API void setHitoryButtonMaxLifeTime(float histBtnMaxLifeTime)
std::string buttonName
Name of button that will be drawn if callback is enabled.
Definition MRRibbonNotification.h:48
MRVIEWER_API void pushNotification(const RibbonNotification ¬ification)
adds new notification for drawing
NotificationTagMask tags
it ANDs with RibbonNotifier allowed tags to see if notification should be displayed
Definition MRRibbonNotification.h:59
std::function< void()> OnButtonClick
Definition MRRibbonNotification.h:44
NotificationType
Definition MRNotificationType.h:10
OnButtonClick onButtonClick
Definition MRRibbonNotification.h:45
std::string text
Text of notification.
Definition MRRibbonNotification.h:52
unsigned NotificationTagMask
Definition MRRibbonNotification.h:31
NotificationType type
Type of notification.
Definition MRRibbonNotification.h:54
MRVIEWER_API void draw(const Box2i &limitFramebuffer)
float lifeTimeSec
Definition MRRibbonNotification.h:57
bool operator==(const RibbonNotification &other) const
RibbonNotification notification
Definition MRRibbonNotification.h:91
RibbonNotificationCorner
corner where notifications will appear
Definition MRRibbonNotification.h:35
std::string header
Header of notification.
Definition MRRibbonNotification.h:50
Tag
Definition MRRibbonNotification.h:19
@ other
Angle, normally float. Measure in radians.
@ ImplicitChanges
Definition MRRibbonNotification.h:23
@ Report
Definition MRRibbonNotification.h:21
@ Recommendation
Definition MRRibbonNotification.h:22
@ All
Definition MRRibbonNotification.h:26
@ Important
Definition MRRibbonNotification.h:24
@ Default
Definition MRRibbonNotification.h:25
@ None
Definition MRRibbonNotification.h:20
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRRibbonNotification.h:41