summaryrefslogtreecommitdiffstats
path: root/contrib/dialog/dialog.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/dialog/dialog.h')
-rw-r--r--contrib/dialog/dialog.h45
1 files changed, 38 insertions, 7 deletions
diff --git a/contrib/dialog/dialog.h b/contrib/dialog/dialog.h
index e8f5e75..e726573 100644
--- a/contrib/dialog/dialog.h
+++ b/contrib/dialog/dialog.h
@@ -1,9 +1,9 @@
/*
- * $Id: dialog.h,v 1.214 2010/04/28 21:11:49 tom Exp $
+ * $Id: dialog.h,v 1.223 2011/03/02 10:04:09 tom Exp $
*
- * dialog.h -- common declarations for all dialog modules
+ * dialog.h -- common declarations for all dialog modules
*
- * Copyright 2000-2008,2010 Thomas E. Dickey
+ * Copyright 2000-2010,2011 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@@ -26,6 +26,7 @@
#ifndef DIALOG_H_included
#define DIALOG_H_included 1
+/* *INDENT-OFF* */
#include <dlg_config.h>
@@ -43,6 +44,8 @@
#include <signal.h> /* fork() etc. */
#include <math.h> /* sqrt() */
+#undef ERR /* header conflict with Solaris xpg4 */
+
#if defined(HAVE_NCURSESW_NCURSES_H)
#include <ncursesw/ncurses.h>
#elif defined(HAVE_NCURSES_NCURSES_H)
@@ -60,6 +63,19 @@
#include <unctrl.h>
#endif
+/* Solaris xpg4 renames these */
+#ifndef KEY_MAX
+#ifdef __KEY_MAX
+#define KEY_MAX __KEY_MAX
+#endif
+#endif
+
+#ifndef KEY_MIN
+#ifdef __KEY_MIN
+#define KEY_MIN __KEY_MIN
+#endif
+#endif
+
/* possible conflicts with <term.h> which may be included in <curses.h> */
#ifdef color_names
#undef color_names
@@ -143,7 +159,7 @@
#define ARROWS_COL 5
#define MAX_LEN 2048
-#define BUF_SIZE (10*1024)
+#define BUF_SIZE (10L*1024)
#undef MIN
#define MIN(x,y) ((x) < (y) ? (x) : (y))
@@ -155,7 +171,7 @@
#define DEFAULT_ASPECT_RATIO 9
/* how many spaces is a tab long (default)? */
#define TAB_LEN 8
-#define WTIMEOUT_VAL 10
+#define WTIMEOUT_VAL 10 /* minimum amount of time needed for curses */
#ifndef A_CHARTEXT
#define A_CHARTEXT 0xff
@@ -336,6 +352,7 @@ extern int dlg_getpary(WINDOW * /*win*/);
#define form_active_text_attr DIALOG_ATR(30)
#define form_text_attr DIALOG_ATR(31)
#define form_item_readonly_attr DIALOG_ATR(32)
+#define gauge_attr DIALOG_ATR(33)
#define DLGK_max (KEY_MAX + 256)
@@ -357,6 +374,9 @@ typedef struct _dlg_callback {
/* data for dlg_add_callback_ref */
struct _dlg_callback **caller;
DIALOG_FREEBACK freeback;
+ /* 1.1-20110107 */
+ bool (*handle_input)(struct _dlg_callback *p);
+ bool input_ready;
} DIALOG_CALLBACK;
typedef struct _dlg_windows {
@@ -389,6 +409,8 @@ typedef struct {
#ifdef HAVE_DLG_TRACE
FILE *trace_output; /* option "--trace file" */
#endif
+ /* 1.1-20110106 */
+ bool no_mouse; /* option "--no-mouse" */
} DIALOG_STATE;
extern DIALOG_STATE dialog_state;
@@ -473,8 +495,8 @@ extern DIALOG_VARS dialog_vars;
#define assert_ptr(ptr,msg) if ((ptr) == 0) dlg_exiterr("cannot allocate memory in " msg)
-#define dlg_malloc(t,n) (t *) malloc((n) * sizeof(t))
-#define dlg_calloc(t,n) (t *) calloc((n), sizeof(t))
+#define dlg_malloc(t,n) (t *) malloc((size_t)(n) * sizeof(t))
+#define dlg_calloc(t,n) (t *) calloc((size_t)(n), sizeof(t))
#define dlg_realloc(t,n,p) (t *) realloc((p), (n) * sizeof(t))
/*
@@ -514,6 +536,7 @@ extern int dialog_mixedform(const char * /*title*/, const char * /*cprompt*/, in
extern int dialog_mixedgauge(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*percent*/, int /*item_no*/, char ** /*items*/);
extern int dialog_msgbox(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*pauseopt*/);
extern int dialog_pause(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*seconds*/);
+extern int dialog_prgbox(const char * /*title*/, const char * /*cprompt*/, const char * /*command*/, int /*height*/, int /*width*/, int /*pauseopt*/);
extern int dialog_progressbox(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/);
extern int dialog_tailbox(const char * /*title*/, const char * /*file*/, int /*height*/, int /*width*/, int /*bg_task*/);
extern int dialog_textbox(const char * /*title*/, const char * /*file*/, int /*height*/, int /*width*/);
@@ -551,6 +574,12 @@ typedef int (DIALOG_INPUTMENU) (DIALOG_LISTITEM * /*items*/, int /*current*/, ch
extern int dlg_checklist(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*list_height*/, int /*item_no*/, DIALOG_LISTITEM * /*items*/, const char * /*states*/, int /*flag*/, int * /*current_item*/);
extern int dlg_form(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*form_height*/, int /*item_no*/, DIALOG_FORMITEM * /*items*/, int * /*current_item*/);
extern int dlg_menu(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*menu_height*/, int /*item_no*/, DIALOG_LISTITEM * /*items*/, int * /*current_item*/, DIALOG_INPUTMENU /*rename_menu*/);
+extern int dlg_progressbox(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*pauseopt*/, FILE * /* fp */);
+
+/* argv.c */
+extern char ** dlg_string_to_argv(char * /* blob */);
+extern int dlg_count_argv(char ** /* argv */);
+extern int dlg_eat_argv(int * /* argcp */, char *** /* argvp */, int /* start */, int /* count */);
/* arrows.c */
extern void dlg_draw_arrows(WINDOW * /*dialog*/, int /*top_arrow*/, int /*bottom_arrow*/, int /*x*/, int /*top*/, int /*bottom*/);
@@ -627,6 +656,7 @@ extern char * dlg_strclone(const char * /*cprompt*/);
extern char * dlg_strempty(void);
extern chtype dlg_asciibox(chtype /*ch*/);
extern chtype dlg_boxchar(chtype /*ch*/);
+extern chtype dlg_get_attrs(WINDOW * /*win*/);
extern const char * dlg_print_line(WINDOW */*win*/, chtype */*attr*/, const char */*prompt*/, int /*lm*/, int /*rm*/, int */*x*/);
extern int dlg_box_x_ordinate(int /*width*/);
extern int dlg_box_y_ordinate(int /*height*/);
@@ -780,5 +810,6 @@ extern void _nc_free_and_exit(int); /* nc_alloc.h normally not installed */
#ifdef __cplusplus
}
#endif
+/* *INDENT-ON* */
#endif /* DIALOG_H_included */
OpenPOWER on IntegriCloud