summaryrefslogtreecommitdiff
path: root/dialog.h
diff options
context:
space:
mode:
Diffstat (limited to 'dialog.h')
-rw-r--r--dialog.h63
1 files changed, 53 insertions, 10 deletions
diff --git a/dialog.h b/dialog.h
index 1a6b0f72c96e9..2746cd03328d5 100644
--- a/dialog.h
+++ b/dialog.h
@@ -1,9 +1,9 @@
/*
- * $Id: dialog.h,v 1.267 2013/09/22 19:06:36 tom Exp $
+ * $Id: dialog.h,v 1.283 2018/06/19 22:52:11 tom Exp $
*
* dialog.h -- common declarations for all dialog modules
*
- * Copyright 2000-2012,2013 Thomas E. Dickey
+ * Copyright 2000-2017,2018 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
@@ -127,8 +127,8 @@
#define USE_COLORS TRUE
#ifdef HAVE_COLOR
-#define SCOLS (COLS - (dialog_state.use_shadow ? 2 : 0))
-#define SLINES (LINES - (dialog_state.use_shadow ? 1 : 0))
+#define SCOLS (COLS - (dialog_state.use_shadow ? SHADOW_COLS : 0))
+#define SLINES (LINES - (dialog_state.use_shadow ? SHADOW_ROWS : 0))
#else
#define SCOLS COLS
#define SLINES LINES
@@ -154,15 +154,16 @@
#define CHR_NEXT DLG_CTRL('N')
#define CHR_PREVIOUS DLG_CTRL('P')
#define CHR_TRACE DLG_CTRL('T')
+#define CHR_SPACE ' '
#define ESC 27
#define TAB DLG_CTRL('I')
-#define MARGIN 1
-#define GUTTER 2
-#define SHADOW_ROWS 1
-#define SHADOW_COLS 2
-#define ARROWS_COL 5
+#define MARGIN 1 /* width of the line drawn around each box */
+#define GUTTER 2 /* minimum columns between name/description in menu */
+#define SHADOW_ROWS 1 /* rows to reserve for window's shadow */
+#define SHADOW_COLS 2 /* columns to reserve for window's shadow */
+#define ARROWS_COL 5 /* distance from left margin to up/down arrows */
#define MAX_LEN 2048
#define BUF_SIZE (10L*1024)
@@ -389,6 +390,19 @@ extern WINDOW * dlg_wgetparent(WINDOW * /*win*/);
#define DLGK_max (KEY_MAX + 256)
/*
+ * Use attributes.
+ */
+#ifdef PDCURSES
+#define dlg_attrset(w,a) (void) wattrset((w), (a))
+#define dlg_attron(w,a) (void) wattron((w), (a))
+#define dlg_attroff(w,a) (void) wattroff((w), (a))
+#else
+#define dlg_attrset(w,a) (void) wattrset((w), (int)(a))
+#define dlg_attron(w,a) (void) wattron((w), (int)(a))
+#define dlg_attroff(w,a) (void) wattroff((w), (int)(a))
+#endif
+
+/*
* Callbacks are used to implement the "background" tailbox.
*/
struct _dlg_callback;
@@ -447,6 +461,12 @@ typedef struct {
int visit_cols; /* option "--visit-items" */
/* 1.2-20130922 */
bool finish_string; /* caching optimization for gauge */
+ /* 1.2-20150125 */
+ bool plain_buttons; /* true to suppress button-label highlight */
+ /* 1.3-20180610 */
+ bool text_only; /* option "--print-text-only", etc. */
+ int text_height;
+ int text_width;
} DIALOG_STATE;
extern DIALOG_STATE dialog_state;
@@ -526,6 +546,12 @@ typedef struct {
bool last_key; /* option "--last-key" */
/* 1.2-20130902 */
bool help_tags; /* option "--help-tags" */
+ /* 1.3-20160126 */
+ char *week_start; /* option "--week-start" */
+ /* 1.3-20160206 */
+ bool iso_week; /* option "--iso-week" */
+ /* 1.3-20170131 */
+ bool reorder; /* option "--reorder" */
} DIALOG_VARS;
#define USE_ITEM_HELP(s) (dialog_vars.item_help && (s) != 0)
@@ -553,6 +579,10 @@ extern DIALOG_VARS dialog_vars;
#define chtype long
#endif
+#ifndef isblank
+#define isblank(c) ((c) == ' ' || (c) == TAB)
+#endif
+
#define UCH(ch) ((unsigned char)(ch))
#define assert_ptr(ptr,msg) if ((ptr) == 0) dlg_exiterr("cannot allocate memory in " msg)
@@ -711,6 +741,9 @@ extern void dlg_show_string(WINDOW * /*win*/, const char * /*string*/, int /*off
extern int dlg_dummy_menutext(DIALOG_LISTITEM * /*items*/, int /*current*/, char * /*newtext*/);
extern int dlg_renamed_menutext(DIALOG_LISTITEM * /*items*/, int /*current*/, char * /*newtext*/);
+/* prgbox.c */
+extern FILE * dlg_popen(const char * /*command */, const char * /*type */);
+
/* rc.c */
#ifdef HAVE_RC_FILE
extern int dlg_parse_rc(void);
@@ -720,6 +753,9 @@ extern void dlg_create_rc(const char * /*filename*/);
/* treeview.c */
extern int dlg_treeview(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*list_height*/, int /*item_no*/, DIALOG_LISTITEM * /*items*/, const char * /*states*/, int * /*depths*/, int /*flag*/, int * /*current_item*/);
+/* ttysize.c */
+extern int dlg_ttysize(int /* fd */, int * /* height */, int * /* width */);
+
/* ui_getc.c */
extern int dlg_getc(WINDOW * /*win*/, int * /*fkey*/);
extern int dlg_getc_callbacks(int /*ch*/, int /*fkey*/, int * /*result*/);
@@ -809,11 +845,17 @@ extern int dlg_strcmp(const char * /*a*/, const char * /*b*/);
#ifdef HAVE_DLG_TRACE
#define DLG_TRACE(params) dlg_trace_msg params
extern void dlg_trace_msg(const char *fmt, ...) GCC_PRINTFLIKE(1,2);
+#define DLG_TRACE2S(name,value) dlg_trace_2s (name,value)
+#define DLG_TRACE2N(name,value) dlg_trace_2n (name,value)
+extern void dlg_trace_2s(const char * /*name*/, const char * /*value*/);
+extern void dlg_trace_2n(const char * /*name*/, int /*value*/);
extern void dlg_trace_win(WINDOW * /*win*/);
extern void dlg_trace_chr(int /*ch*/, int /*fkey*/);
extern void dlg_trace(const char * /*fname*/);
#else
#define DLG_TRACE(params) /* nothing */
+#define DLG_TRACE2S(name,value) /* nothing */
+#define DLG_TRACE2N(name,value) /* nothing */
#define dlg_trace_win(win) /* nothing */
#define dlg_trace_chr(ch,fkey) /* nothing */
#define dlg_trace(fname) /* nothing */
@@ -821,6 +863,7 @@ extern void dlg_trace(const char * /*fname*/);
#ifdef KEY_RESIZE
extern void dlg_move_window(WINDOW * /*win*/, int /*height*/, int /*width*/, int /*y*/, int /*x*/);
+extern void dlg_will_resize(WINDOW * /*win*/);
#endif
/*
@@ -840,7 +883,7 @@ typedef struct mseRegion {
#if defined(NCURSES_MOUSE_VERSION)
-#define mouse_open() mousemask(BUTTON1_CLICKED, (mmask_t *) 0)
+#define mouse_open() mousemask(BUTTON1_PRESSED, (mmask_t *) 0)
#define mouse_close() mousemask(0, (mmask_t *) 0)
extern mseRegion * dlg_mouse_mkregion (int /*y*/, int /*x*/, int /*height*/, int /*width*/, int /*code*/);