wtools.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 << 0),
  17. D_CENTER = (1 << 1)
  18. } /* dialog options */ ;
  19. /*** structures declarations (and typedefs of structures)*****************************************/
  20. /*** global variables defined in .c file *********************************************************/
  21. /*** declarations of public functions ************************************************************/
  22. /* The input dialogs */
  23. char *input_dialog (const char *header, const char *text,
  24. const char *history_name, const char *def_text,
  25. input_complete_t completion_flags);
  26. char *input_dialog_help (const char *header, const char *text, const char *help,
  27. const char *history_name, const char *def_text, gboolean strip_password,
  28. input_complete_t completion_flags);
  29. char *input_expand_dialog (const char *header, const char *text, const char *history_name,
  30. const char *def_text, input_complete_t completion_flags);
  31. int query_dialog (const char *header, const char *text, int flags, int count, ...);
  32. void query_set_sel (int new_sel);
  33. /* Create message box but don't dismiss it yet, not background safe */
  34. struct WDialog *create_message (int flags, const char *title,
  35. const char *text, ...) __attribute__ ((format (__printf__, 3, 4)));
  36. /* Show message box, background safe */
  37. void message (int flags, const char *title, const char *text, ...)
  38. __attribute__ ((format (__printf__, 3, 4)));
  39. /*** inline functions ****************************************************************************/
  40. #endif /* MC__WTOOLS_H */