summaryrefslogtreecommitdiff
path: root/src/gui.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui.h')
-rw-r--r--src/gui.h28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/gui.h b/src/gui.h
index 4f03394..3744739 100644
--- a/src/gui.h
+++ b/src/gui.h
@@ -33,10 +33,20 @@
/* ---------------------------------------- INTERFACES
*/
+/* Message types
+*/
+typedef enum {eMessageBox, eYesNoBox} GUIBoxType;
+
/* Display a simple message box. A message of longer than 1024 bytes causes
- undefined behaviour. Newlines cause a line break.
+ undefined behaviour. Newlines cause a line break. If a line is over 38
+ characters then it will be truncated.
+
+ If type is eYesNoBox then TRUE/FALSE is returned depending on whether
+ yes/no was selected.
*/
-void GUIMessage(const char *title, const char *format,...);
+int GUIMessage(GUIBoxType type,
+ const char *title,
+ const char *format,...);
/* Enter a string, max 40 characters
@@ -44,6 +54,20 @@ void GUIMessage(const char *title, const char *format,...);
const char *GUIInputString(const char *prompt, const char *orig);
+/* Selects an entry from a list. Returns the index selected, or
+ -1 if cancelled.
+*/
+int GUIListSelect(const char *title, int no, char * const list[]);
+
+
+/* Allows options to be toggled in a list. Returns FALSE for cancelled (in
+ which case option will be as it was. TRUE if accepted, and option will be
+ updated.
+*/
+int GUIListOption(const char *title,
+ int no, char * const list[], int option[]);
+
+
#endif