$darkmode
Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
action_notifier.h
Go to the documentation of this file.
1 
6 #ifndef ACTION_NOTIFIER_H
7 #define ACTION_NOTIFIER_H
8 
9 #include "ui.h"
10 
12 #define MAX_ACTION_NOTIFICATIONS 5
13 
15 #define MAX_ACTION_TEXT_LENGTH 128
16 
18 #define NOTIF_DUR_SHORT 1.0F
19 
21 #define NOTIF_DUR_NORMAL 1.5F
22 
24 #define NOTIF_DUR_LONG 2.0F
25 
30 typedef struct {
32  float lifetime;
33  float max_lifetime;
34  int active;
36 
41 typedef struct {
44 
49 void action_notifier_init(ActionNotifier* notifier);
50 
57 void action_notifier_push(ActionNotifier* notifier, const char* text,
58  float duration);
59 
65 void action_notifier_update(ActionNotifier* notifier, float delta_time);
66 
74 void action_notifier_draw(ActionNotifier* notifier, UIContext* ui_ctx,
75  int screen_width, int screen_height);
76 
77 #endif /* ACTION_NOTIFIER_H */
void action_notifier_init(ActionNotifier *notifier)
Initializes the notifier.
Definition: action_notifier.c:8
void action_notifier_draw(ActionNotifier *notifier, UIContext *ui_ctx, int screen_width, int screen_height)
Renders active notifications to the screen.
Definition: action_notifier.c:69
#define MAX_ACTION_NOTIFICATIONS
Maximum number of concurrent notifications.
Definition: action_notifier.h:12
void action_notifier_update(ActionNotifier *notifier, float delta_time)
Updates notification timers.
Definition: action_notifier.c:52
#define MAX_ACTION_TEXT_LENGTH
Maximum length of a notification message.
Definition: action_notifier.h:15
void action_notifier_push(ActionNotifier *notifier, const char *text, float duration)
Adds a new notification message.
Definition: action_notifier.c:18
Represents a single active notification.
Definition: action_notifier.h:30
float max_lifetime
Definition: action_notifier.h:33
float lifetime
Definition: action_notifier.h:32
int active
Definition: action_notifier.h:34
Manager for action notifications.
Definition: action_notifier.h:41
Persistent state for the UI system.
Definition: ui.h:49
Minimal immediate-mode User Interface (UI) library.