| 1 |
/* |
| 2 |
* Copyright (c) 2002-2004 the xdvik development team |
| 3 |
* |
| 4 |
* Permission is hereby granted, free of charge, to any person obtaining a copy |
| 5 |
* of this software and associated documentation files (the "Software"), to |
| 6 |
* deal in the Software without restriction, including without limitation the |
| 7 |
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 8 |
* sell copies of the Software, and to permit persons to whom the Software is |
| 9 |
* furnished to do so, subject to the following conditions: |
| 10 |
* |
| 11 |
* The above copyright notice and this permission notice shall be included in |
| 12 |
* all copies or substantial portions of the Software. |
| 13 |
* |
| 14 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 15 |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 17 |
* PAUL VOJTA OR ANY OTHER AUTHOR OF THIS SOFTWARE BE LIABLE FOR ANY CLAIM, |
| 18 |
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
| 19 |
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 20 |
* OTHER DEALINGS IN THE SOFTWARE. |
| 21 |
*/ |
| 22 |
|
| 23 |
#ifndef MESSAGE_WINDOW_H_ |
| 24 |
#define MESSAGE_WINDOW_H_ |
| 25 |
|
| 26 |
#define Xdvi_MESSAGE_DIALOG_NAME "dialog" |
| 27 |
#define Xdvi_MESSAGE_SHELL_NAME "message_popup" |
| 28 |
|
| 29 |
|
| 30 |
/* |
| 31 |
* Callback before the message window is closed. It is passed |
| 32 |
* the message window widget ID, and the next XtPointer argument |
| 33 |
* in the message dialog calls. |
| 34 |
*/ |
| 35 |
typedef void (*pre_message_cbT)(Widget w, XtPointer arg); |
| 36 |
/* |
| 37 |
* Additional callbacks passed in as argument. It is passed |
| 38 |
* the next XtPointer argument in the message dialog calls. |
| 39 |
*/ |
| 40 |
typedef void (*message_cbT)(XtPointer arg); |
| 41 |
|
| 42 |
/* preferred size of dialogs, only used for Xaw ... not really hints, but |
| 43 |
hard-coded values ;-) */ |
| 44 |
typedef enum popupMessageSizeHintT_ { SIZE_SMALL, SIZE_MEDIUM, SIZE_LARGE } popupMessageSizeHintT; |
| 45 |
typedef enum popupMessageT_ { MSG_QUESTION, MSG_HELP, MSG_INFO, MSG_WARN, MSG_ERR } popupMessageT; |
| 46 |
|
| 47 |
extern Widget popup_message(Widget parent, |
| 48 |
popupMessageT type, |
| 49 |
const char *helptext, |
| 50 |
const char *format, ...); |
| 51 |
|
| 52 |
#if 0 /* This function is currently unused. */ |
| 53 |
extern Widget popup_message_sized(Widget parent, |
| 54 |
popupMessageT type, |
| 55 |
popupMessageSizeHintT size, |
| 56 |
const char *helptext, |
| 57 |
const char *format, ...); |
| 58 |
#endif |
| 59 |
|
| 60 |
extern Widget positioned_popup_message(Widget parent, |
| 61 |
popupMessageT type, |
| 62 |
int x, int y, |
| 63 |
const char *helptext, const char *format, ...); |
| 64 |
|
| 65 |
extern Widget choice_dialog(Widget parent, |
| 66 |
popupMessageT type, |
| 67 |
const char *helptext, |
| 68 |
#ifndef MOTIF |
| 69 |
const char *ret_action_str, |
| 70 |
#endif |
| 71 |
pre_message_cbT pre_cb, XtPointer arg, |
| 72 |
const char *ok_label, message_cbT ok_cb, XtPointer ok_args, |
| 73 |
const char *cancel_label, message_cbT cancel_cb, XtPointer cancel_args, |
| 74 |
const char *format, ...); |
| 75 |
|
| 76 |
#if MOTIF |
| 77 |
/* 3 buttons currently only implemented for Motif */ |
| 78 |
extern Widget choice3_dialog(Widget parent, |
| 79 |
popupMessageT type, |
| 80 |
const char *helptext, |
| 81 |
pre_message_cbT pre_cb, XtPointer arg, |
| 82 |
const char *yes_label, message_cbT yes_cb, XtPointer yes_args, |
| 83 |
const char *no_label, message_cbT no_cb, XtPointer no_args, |
| 84 |
const char *cancel_label, message_cbT cancel_cb, XtPointer cancel_args, |
| 85 |
const char *format, ...); |
| 86 |
#endif |
| 87 |
|
| 88 |
extern Widget choice_dialog_sized(Widget parent, |
| 89 |
popupMessageT type, |
| 90 |
popupMessageSizeHintT size, |
| 91 |
const char *helptext, |
| 92 |
#ifndef MOTIF |
| 93 |
const char *ret_action_str, |
| 94 |
#endif |
| 95 |
pre_message_cbT pre_cb, XtPointer arg, |
| 96 |
const char *ok_label, message_cbT ok_cb, XtPointer ok_args, |
| 97 |
const char *cancel_label, message_cbT cancel_cb, XtPointer cancel_args, |
| 98 |
const char *format, ...); |
| 99 |
|
| 100 |
extern Widget positioned_choice_dialog(Widget parent, |
| 101 |
popupMessageT type, |
| 102 |
int x_pos, int y_pos, |
| 103 |
const char *helptext, |
| 104 |
#ifndef MOTIF |
| 105 |
const char *ret_action_str, |
| 106 |
#endif |
| 107 |
pre_message_cbT pre_cb, XtPointer arg, |
| 108 |
const char *ok_label, message_cbT ok_cb, XtPointer ok_args, |
| 109 |
const char *cancel_label, message_cbT cancel_cb, XtPointer cancel_args, |
| 110 |
const char *format, ...); |
| 111 |
extern void warn_overstrike(void); |
| 112 |
extern Boolean raise_message_windows(void); |
| 113 |
extern Boolean is_message_window(Widget w); |
| 114 |
extern Boolean kill_message_window(Widget w); |
| 115 |
|
| 116 |
#endif /* MESSAGE_WINDOW_H_ */ |