2009-02-05 21:28:18 +03:00
|
|
|
/** \file wtools.h
|
|
|
|
* \brief Header: widget based utility functions
|
|
|
|
*/
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
#ifndef MC__WTOOLS_H
|
|
|
|
#define MC__WTOOLS_H
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/*** typedefs(not structures) and defined constants **********************************************/
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/* 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,
|
2011-10-23 11:08:24 +04:00
|
|
|
D_ERROR = (1 << 0),
|
|
|
|
D_CENTER = (1 << 1)
|
2010-11-10 14:09:42 +03:00
|
|
|
} /* dialog options */ ;
|
|
|
|
|
|
|
|
/*** structures declarations (and typedefs of structures)*****************************************/
|
|
|
|
|
|
|
|
/*** global variables defined in .c file *********************************************************/
|
|
|
|
|
|
|
|
/*** declarations of public functions ************************************************************/
|
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
/* The input dialogs */
|
2009-01-14 03:01:18 +03:00
|
|
|
char *input_dialog (const char *header, const char *text,
|
2010-06-28 16:22:49 +04:00
|
|
|
const char *history_name, const char *def_text);
|
2009-01-14 03:01:18 +03:00
|
|
|
char *input_dialog_help (const char *header, const char *text, const char *help,
|
2010-06-28 16:22:49 +04:00
|
|
|
const char *history_name, const char *def_text);
|
2009-01-14 03:01:18 +03:00
|
|
|
char *input_expand_dialog (const char *header, const char *text,
|
2010-06-28 16:22:49 +04:00
|
|
|
const char *history_name, const char *def_text);
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2010-11-12 11:03:57 +03:00
|
|
|
int query_dialog (const char *header, const char *text, int flags, int count, ...);
|
1998-02-27 07:54:42 +03:00
|
|
|
void query_set_sel (int new_sel);
|
2002-11-14 10:25:18 +03:00
|
|
|
|
2003-10-26 03:58:14 +03:00
|
|
|
/* Create message box but don't dismiss it yet, not background safe */
|
2003-10-26 01:12:05 +04:00
|
|
|
struct Dlg_head *create_message (int flags, const char *title,
|
2010-06-28 16:22:49 +04:00
|
|
|
const char *text, ...) __attribute__ ((format (__printf__, 3, 4)));
|
2003-10-26 03:58:14 +03:00
|
|
|
|
|
|
|
/* Show message box, background safe */
|
2003-10-26 07:47:20 +03:00
|
|
|
void message (int flags, const char *title, const char *text, ...)
|
2006-02-03 17:42:36 +03:00
|
|
|
__attribute__ ((format (__printf__, 3, 4)));
|
2003-10-26 03:58:14 +03:00
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/*** inline functions ****************************************************************************/
|
2010-11-12 11:03:57 +03:00
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
#endif /* MC__WTOOLS_H */
|