1
2
3
4
5 #ifndef MC__WTOOLS_H
6 #define MC__WTOOLS_H
7
8
9
10
11 #define INPUT_PASSWORD ((char *) -1)
12
13
14 #define MSG_ERROR ((char *) -1)
15
16 typedef struct status_msg_t status_msg_t;
17 #define STATUS_MSG(x) ((status_msg_t *)(x))
18
19 typedef struct simple_status_msg_t simple_status_msg_t;
20 #define SIMPLE_STATUS_MSG(x) ((simple_status_msg_t *)(x))
21
22 typedef void (*status_msg_cb) (status_msg_t * sm);
23 typedef int (*status_msg_update_cb) (status_msg_t * sm);
24
25
26
27
28 enum
29 {
30 D_NORMAL = 0,
31 D_ERROR = (1 << 0),
32 D_CENTER = (1 << 1)
33 } ;
34
35
36
37
38
39
40 struct status_msg_t
41 {
42 WDialog *dlg;
43 gint64 start;
44 gint64 delay;
45 gboolean block;
46
47 status_msg_cb init;
48 status_msg_update_cb update;
49 status_msg_cb deinit;
50 };
51
52
53 struct simple_status_msg_t
54 {
55 status_msg_t status_msg;
56
57 WLabel *label;
58 };
59
60
61
62
63
64
65 char *input_dialog (const char *header, const char *text,
66 const char *history_name, const char *def_text,
67 input_complete_t completion_flags);
68 char *input_dialog_help (const char *header, const char *text, const char *help,
69 const char *history_name, const char *def_text, gboolean strip_password,
70 input_complete_t completion_flags);
71 char *input_expand_dialog (const char *header, const char *text, const char *history_name,
72 const char *def_text, input_complete_t completion_flags);
73
74 int query_dialog (const char *header, const char *text, int flags, int count, ...);
75 void query_set_sel (int new_sel);
76
77
78
79 WDialog *create_message (int flags, const char *title, const char *text, ...)
80 G_GNUC_PRINTF (3, 4);
81
82
83 MC_MOCKABLE void message (int flags, const char *title, const char *text, ...) G_GNUC_PRINTF (3, 4);
84
85
86 gboolean mc_error_message (GError ** mcerror, int *code);
87
88 status_msg_t *status_msg_create (const char *title, double delay, status_msg_cb init_cb,
89 status_msg_update_cb update_cb, status_msg_cb deinit_cb);
90 void status_msg_destroy (status_msg_t * sm);
91 void status_msg_init (status_msg_t * sm, const char *title, double delay, status_msg_cb init_cb,
92 status_msg_update_cb update_cb, status_msg_cb deinit_cb);
93 void status_msg_deinit (status_msg_t * sm);
94 int status_msg_common_update (status_msg_t * sm);
95
96 void simple_status_msg_init_cb (status_msg_t * sm);
97
98
99
100 #endif