5 Struct N_GUI_MARKDOWNVIEW_DATA
gullradriel edited this page 2026-10-09 00:55:18 +02:00

N_GUI_MARKDOWNVIEW_DATA

Module: GUI: allegro5 widget system with pseudo-windows

markdownview specific data. More...

#include "n_gui.h"

Public Attributes

Name
void * user_data
user data for on_link
int theme_derived
1 while the style is still the one derived from the widget's theme, so a palette change is followed; cleared the moment the caller asks for the style in order to change it
char * text
the source, owned, NUL-terminated; never NULL after creation
N_GUI_MD_STYLE style
colours and metrics, the caller's to change through n_gui_markdownview_style()
float scroll_y
how far down the content the view is, in pixels
void(*)(int widget_id, const char *url, void *user_data) on_link
called when a link is clicked, or NULL
float measured_w
the width it was measured at, so a resize re-measures and nothing else has to remember to
N_GUI_MD_FONTS fonts
the faces, borrowed: the caller owns them and they must outlive the widget, the same rule every ALLEGRO_BITMAP in this file follows
int dirty
set when the text, the faces or the style changed under a measure
float content_h
the height the whole document last measured at

Detailed Description

struct N_GUI_MARKDOWNVIEW_DATA;

markdownview specific data.

A read-only pane of rendered Markdown that scrolls vertically. There is no horizontal scroll and deliberately no way to ask for one: n_gui_md wraps everything it lays out, table cells included, so nothing ever overflows sideways.

Public Attributes Documentation

variable user_data

void * user_data;

user data for on_link

variable theme_derived

int theme_derived;

1 while the style is still the one derived from the widget's theme, so a palette change is followed; cleared the moment the caller asks for the style in order to change it

variable text

char * text;

the source, owned, NUL-terminated; never NULL after creation

variable style

N_GUI_MD_STYLE style;

colours and metrics, the caller's to change through n_gui_markdownview_style()

variable scroll_y

float scroll_y;

how far down the content the view is, in pixels

void(*)(int widget_id, const char *url, void *user_data) on_link;

called when a link is clicked, or NULL

variable measured_w

float measured_w;

the width it was measured at, so a resize re-measures and nothing else has to remember to

variable fonts

N_GUI_MD_FONTS fonts;

the faces, borrowed: the caller owns them and they must outlive the widget, the same rule every ALLEGRO_BITMAP in this file follows

variable dirty

int dirty;

set when the text, the faces or the style changed under a measure

variable content_h

float content_h;

the height the whole document last measured at