naev 0.11.5
dialogue.h
1/*
2 * See Licensing and Copyright notice in naev.h
3 */
4#pragma once
5
6#include "nstring.h"
7
8/*
9 * popups and alerts
10 */
11/* Alert. */
12PRINTF_FORMAT( 1, 2 ) void dialogue_alert( const char *fmt, ... ); /* does not pause execution */
13void dialogue_alertRaw( const char *msg ); /* does not pause execution */
14/* Message. */
15PRINTF_FORMAT( 2, 3 ) void dialogue_msg( const char *caption, const char *fmt, ... );
16void dialogue_msgRaw( const char *caption, const char *msg );
17/* Image. */
18PRINTF_FORMAT( 3, 4 ) void dialogue_msgImg( const char *caption, const char *img, const char *fmt, ... );
19void dialogue_msgImgRaw( const char *caption, const char *msg, const char *img, int width, int height );
20/* YesNo. */
21PRINTF_FORMAT( 2, 3 ) int dialogue_YesNo( const char *caption, const char *fmt, ... ); /* Yes = 1, No = 0 */
22int dialogue_YesNoRaw( const char *caption, const char *msg );
23/* Input. */
24PRINTF_FORMAT( 4, 5 ) char* dialogue_input( const char* title, int min, int max, const char *fmt, ... );
25char* dialogue_inputRaw( const char* title, int min, int max, const char *msg );
26
27/*
28 * Choice dialogues.
29 */
30void dialogue_makeChoice( const char *caption, const char *msg, int opts );
31void dialogue_addChoice( const char *caption, const char *msg, const char *opt );
32char *dialogue_runChoice (void);
33
34/*
35 * Lists.
36 */
37PRINTF_FORMAT( 4, 5 ) int dialogue_list( const char* title, char **items, int nitems, const char *fmt, ... );
38int dialogue_listRaw( const char* title, char **items, int nitems, const char *msg );
39PRINTF_FORMAT( 8, 9 ) int dialogue_listPanel ( const char* title, char **items, int nitems, int extrawidth,
40 int minheight, void (*add_widgets) (unsigned int wid, int x, int y, int w, int h),
41 void (*select_call) (unsigned int wid, const char* wgtname, int x, int y, int w, int h),
42 const char *fmt, ... );
43int dialogue_listPanelRaw( const char* title, char **items, int nitems, int extrawidth,
44 int minheight, void (*add_widgets) (unsigned int wid, int x, int y, int w, int h),
45 void (*select_call) (unsigned int wid, const char* wgtname, int x, int y, int w, int h),
46 const char *msg );
47
48/*
49 * Custom.
50 */
51void dialogue_custom( const char* caption, int width, int height,
52 int (*update) (double dt, void* data),
53 void (*render) (double x, double y, double w, double h, void* data),
54 int (*event) (unsigned int wid, SDL_Event* event, void* data),
55 void *data, int autofree, int dynamic );
56int dialogue_customFullscreen( int enable );
57int dialogue_customResize( int width, int height );
58
59/*
60 * misc
61 */
62int dialogue_isOpen (void);