wtools.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /** \file wtools.h
  2. * \brief Header: widget based utility functions
  3. */
  4. #ifndef MC__WTOOLS_H
  5. #define MC__WTOOLS_H
  6. /*** typedefs(not structures) and defined constants **********************************************/
  7. /* Pass this as def_text to request a password */
  8. #define INPUT_PASSWORD ((char *) -1)
  9. /* Use this as header for message() - it expands to "Error" */
  10. #define MSG_ERROR ((char *) -1)
  11. /*** enums ***************************************************************************************/
  12. /* flags for message() and query_dialog() */
  13. enum
  14. {
  15. D_NORMAL = 0,
  16. D_ERROR = 1
  17. } /* dialog options */ ;
  18. /*** structures declarations (and typedefs of structures)*****************************************/
  19. /*** global variables defined in .c file *********************************************************/
  20. /*** declarations of public functions ************************************************************/
  21. /* The input dialogs */
  22. char *input_dialog (const char *header, const char *text,
  23. const char *history_name, const char *def_text);
  24. char *input_dialog_help (const char *header, const char *text, const char *help,
  25. const char *history_name, const char *def_text);
  26. char *input_expand_dialog (const char *header, const char *text,
  27. const char *history_name, const char *def_text);
  28. int query_dialog (const char *header, const char *text, int flags, int count, ...);
  29. void query_set_sel (int new_sel);
  30. /* Create message box but don't dismiss it yet, not background safe */
  31. struct Dlg_head *create_message (int flags, const char *title,
  32. const char *text, ...) __attribute__ ((format (__printf__, 3, 4)));
  33. /* Show message box, background safe */
  34. void message (int flags, const char *title, const char *text, ...)
  35. __attribute__ ((format (__printf__, 3, 4)));
  36. /*** inline functions ****************************************************************************/
  37. #endif /* MC__WTOOLS_H */