GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
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...
 

Functions

gp_dialoggp_dialog_new (size_t payload)
 Allocates and initializes new dialog.
 
void gp_dialog_free (gp_dialog *self)
 Frees a dialog.
 
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.
 

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.

Parameters
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.

Parameters
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.
Returns
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.

Parameters
payloadPayload size.
Returns
A newly allocated dialog.