$darkmode
Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
action_notifier.h File Reference

Temporary on-screen notification system for user actions. More...

#include "ui.h"
Include dependency graph for action_notifier.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ActionNotification
 Represents a single active notification. More...
 
struct  ActionNotifier
 Manager for action notifications. More...
 

Macros

#define MAX_ACTION_NOTIFICATIONS   5
 Maximum number of concurrent notifications. More...
 
#define MAX_ACTION_TEXT_LENGTH   128
 Maximum length of a notification message. More...
 
#define NOTIF_DUR_SHORT   1.0F
 Short notification duration (seconds). More...
 
#define NOTIF_DUR_NORMAL   1.5F
 Normal notification duration (seconds). More...
 
#define NOTIF_DUR_LONG   2.0F
 Long notification duration (seconds). More...
 

Functions

void action_notifier_init (ActionNotifier *notifier)
 Initializes the notifier. More...
 
void action_notifier_push (ActionNotifier *notifier, const char *text, float duration)
 Adds a new notification message. More...
 
void action_notifier_update (ActionNotifier *notifier, float delta_time)
 Updates notification timers. More...
 
void action_notifier_draw (ActionNotifier *notifier, UIContext *ui_ctx, int screen_width, int screen_height)
 Renders active notifications to the screen. More...
 

Detailed Description

Temporary on-screen notification system for user actions.

Macro Definition Documentation

◆ MAX_ACTION_NOTIFICATIONS

#define MAX_ACTION_NOTIFICATIONS   5

Maximum number of concurrent notifications.

◆ MAX_ACTION_TEXT_LENGTH

#define MAX_ACTION_TEXT_LENGTH   128

Maximum length of a notification message.

◆ NOTIF_DUR_LONG

#define NOTIF_DUR_LONG   2.0F

Long notification duration (seconds).

◆ NOTIF_DUR_NORMAL

#define NOTIF_DUR_NORMAL   1.5F

Normal notification duration (seconds).

◆ NOTIF_DUR_SHORT

#define NOTIF_DUR_SHORT   1.0F

Short notification duration (seconds).

Function Documentation

◆ action_notifier_draw()

void action_notifier_draw ( ActionNotifier notifier,
UIContext ui_ctx,
int  screen_width,
int  screen_height 
)

Renders active notifications to the screen.

Parameters
notifierPointer to the notifier.
ui_ctxUIContext to use for drawing.
screen_widthCurrent window width.
screen_heightCurrent window height.
Here is the call graph for this function:

◆ action_notifier_init()

void action_notifier_init ( ActionNotifier notifier)

Initializes the notifier.

Parameters
notifierPointer to the notifier struct.

◆ action_notifier_push()

void action_notifier_push ( ActionNotifier notifier,
const char *  text,
float  duration 
)

Adds a new notification message.

Parameters
notifierPointer to the notifier.
textThe message to display.
durationDuration in seconds.
Here is the call graph for this function:

◆ action_notifier_update()

void action_notifier_update ( ActionNotifier notifier,
float  delta_time 
)

Updates notification timers.

Parameters
notifierPointer to the notifier.
delta_timeDelta time since last update (seconds).