wtools.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. char *input_dialog_help (const char *header, const char *text, const char *help,
  26. const char *history_name, const char *def_text, gboolean strip_password);
  27. char *input_expand_dialog (const char *header, const char *text,
  28. const char *history_name, const char *def_text);
  29. int query_dialog (const char *header, const char *text, int flags, int count, ...);
  30. void query_set_sel (int new_sel);
  31. /* Create message box but don't dismiss it yet, not background safe */
  32. struct Dlg_head *create_message (int flags, const char *title,
  33. const char *text, ...) __attribute__ ((format (__printf__, 3, 4)));
  34. /* Show message box, background safe */
  35. void message (int flags, const char *title, const char *text, ...)
  36. __attribute__ ((format (__printf__, 3, 4)));
  37. /*** inline functions ****************************************************************************/
  38. #endif /* MC__WTOOLS_H */