GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
Functions
gp_widget_log.h File Reference

A text log widget. More...

#include <stdlib.h>
#include <utils/gp_cbuffer.h>

Go to the source code of this file.

Functions

void gp_widget_log_append (gp_widget *self, const char *text)
 Appends text to the log.
 
gp_widget * gp_widget_log_new (gp_widget_tattr tattr, unsigned int min_width, unsigned int min_lines, size_t max_logs)
 Allocates a log widget.
 

Detailed Description

A text log widget.

Definition in file gp_widget_log.h.

Function Documentation

◆ gp_widget_log_append()

void gp_widget_log_append ( gp_widget *  self,
const char *  text 
)

Appends text to the log.

Parameters
selfA log widget.
textText to be appended.

◆ gp_widget_log_new()

gp_widget * gp_widget_log_new ( gp_widget_tattr  tattr,
unsigned int  min_width,
unsigned int  min_lines,
size_t  max_logs 
)

Allocates a log widget.

The log widget is a circular buffer of loglines, when size reaches the max_log_lines the oldest message gets removed from the log.

Parameters
tattrText attributes
min_widthMinimal width in letters
min_linesMinimal number of lines
max_logsMaximal number of log lines stored internally.
Returns
Newly allocated log widget.