mc/lib/widget/wtools.h
Andrew Borodin 71364f88c3 Split lib/widget/widget.[ch] and lib/widget/wtools.[ch] files
...into small: one widget in one file.
Renamed most if WInput functions.
Minor optimization.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:30 +03:00

53 lines
2.0 KiB
C

/** \file wtools.h
* \brief Header: widget based utility functions
*/
#ifndef MC__WTOOLS_H
#define MC__WTOOLS_H
/*** typedefs(not structures) and defined constants **********************************************/
/* Pass this as def_text to request a password */
#define INPUT_PASSWORD ((char *) -1)
/* Use this as header for message() - it expands to "Error" */
#define MSG_ERROR ((char *) -1)
/*** enums ***************************************************************************************/
/* flags for message() and query_dialog() */
enum
{
D_NORMAL = 0,
D_ERROR = 1
} /* dialog options */ ;
/*** structures declarations (and typedefs of structures)*****************************************/
/*** global variables defined in .c file *********************************************************/
/*** declarations of public functions ************************************************************/
/* The input dialogs */
char *input_dialog (const char *header, const char *text,
const char *history_name, const char *def_text);
char *input_dialog_help (const char *header, const char *text, const char *help,
const char *history_name, const char *def_text);
char *input_expand_dialog (const char *header, const char *text,
const char *history_name, const char *def_text);
int query_dialog (const char *header, const char *text, int flags, int count, ...);
void query_set_sel (int new_sel);
/* Create message box but don't dismiss it yet, not background safe */
struct Dlg_head *create_message (int flags, const char *title,
const char *text, ...) __attribute__ ((format (__printf__, 3, 4)));
/* Show message box, background safe */
void message (int flags, const char *title, const char *text, ...)
__attribute__ ((format (__printf__, 3, 4)));
/*** inline functions ****************************************************************************/
#endif /* MC__WTOOLS_H */