2D bitmap graphics library with emphasis on speed and correctness
No Matches
Data Structures | Functions
gp_dialog.h File Reference

Implements dialog windows. More...

#include <input/gp_types.h>
#include <widgets/gp_widget.h>
#include <widgets/gp_widget_types.h>

Go to the source code of this file.

Data Structures

struct  gp_dialog
 A dialog. More...


gp_dialoggp_dialog_new (size_t payload)
 Allocates and initializes new dialog.
void gp_dialog_free (gp_dialog *self)
 Frees a dialog.
gp_widgetgp_dialog_layout_load (const char *dialog_name, const gp_widget_json_callbacks *const callbacks, const char *fallback_json, gp_htable **uids)
 Loads a dialog layout given a dialog name.

Detailed Description

Implements dialog windows.

Definition in file gp_dialog.h.

Function Documentation

◆ gp_dialog_free()

void gp_dialog_free ( gp_dialog self)

Frees a dialog.

If not NULL the the dialog layout is freed with the gp_widget_free() recursivelly.

selfA dialog.

◆ gp_dialog_layout_load()

gp_widget * gp_dialog_layout_load ( const char *  dialog_name,
const gp_widget_json_callbacks *const  callbacks,
const char *  fallback_json,
gp_htable **  uids 

Loads a dialog layout given a dialog name.

Looks for the layout in $HOME/.config/ and /etc/ if not found attempts to parse layout from fallback JSON string.

dialog_nameDialog name.
callbacksStructure with NULL terminated array of dialog callbacks.
fallback_jsonFallback dialog JSON layout.
uidsAn pointer to store the has table UIDs to. Must be initialized to NULL.
A widget layout or NULL in a case of a failure.

◆ gp_dialog_new()

gp_dialog * gp_dialog_new ( size_t  payload)

Allocates and initializes new dialog.

payloadPayload size.
A newly allocated dialog.