1 /* xkeycaps, Copyright (c) 1991, 1992, 1993, 1996, 1997 2 * Jamie Zawinski <jwz@jwz.org> 3 * 4 * Permission to use, copy, modify, distribute, and sell this software and its 5 * documentation for any purpose is hereby granted without fee, provided that 6 * the above copyright notice appear in all copies and that both that 7 * copyright notice and this permission notice appear in supporting 8 * documentation. No representations are made about the suitability of this 9 * software for any purpose. It is provided "as is" without express or 10 * implied warranty. 11 */ 12 13 #ifndef _XKEYCAPS_H_ 14 #define _XKEYCAPS_H_ 15 16 #ifdef __STDC__ 17 # include <stdlib.h> 18 # include <memory.h> 19 #endif 20 21 #ifndef __STDC__ 22 # undef const 23 # define const /**/ 24 #endif 25 26 # undef P 27 #ifdef __STDC__ 28 # define P(x)x 29 #else 30 # define P(x)() 31 #endif 32 33 34 /* from xkeycaps.c 35 */ 36 extern char *progname; 37 extern char *version; 38 extern char *short_version; 39 extern Window XSendEvent_BadWindow; 40 extern void xkeycaps_DispatchEvent_hook P((KeyboardWidget, XEvent *event)); 41 extern void replace_keyboard P((KeyboardWidget keyboard, const char *name)); 42 43 /* from guess.c 44 */ 45 extern int choose_kbd_dubious_p; 46 extern char choose_kbd_message[]; 47 extern const struct keyboard_instance *choose_kbd P((Display *dpy, 48 const char *kbd_name)); 49 void print_kbd_choices P((void)); 50 51 52 /* from commands.c 53 */ 54 extern struct key_menus *make_key_menus P((KeyboardWidget *)); 55 extern Widget make_command_widgets P((Widget parent, Widget *kbd)); 56 extern int string_equal P((const char *, const char *)); 57 extern void sensitize_menu P((KeyboardWidget, Widget menu, Bool sensitive)); 58 extern void pop_up_kbd_dbox P((Widget, XtPointer, XtPointer)); 59 extern KeyWidget prompt_for_key P((KeyboardWidget, char *msg)); 60 61 /* from actions.c 62 */ 63 extern int mappingNotify_event_expected; 64 extern void highlight_key_action P((Widget, XEvent *, String *, Cardinal *)); 65 extern void unhighlight_key_action P((Widget, XEvent *, String *, Cardinal *)); 66 extern void toggle_key_action P((Widget, XEvent *, String *, Cardinal *)); 67 extern void simulate_KeyPress_action P((Widget, XEvent*, String*, Cardinal*)); 68 extern void simulate_KeyRelease_action P((Widget, XEvent*, String*,Cardinal*)); 69 extern void describe_key_action P((Widget, XEvent *, String *, Cardinal *)); 70 extern void track_key_action P((Widget, XEvent *, String *, Cardinal *)); 71 extern void untrack_key_action P((Widget, XEvent *, String *, Cardinal *)); 72 extern void key_menu_pre_popup_hook P((Widget menu, XtPointer client_data, 73 XtPointer call_data)); 74 extern void keyboard_track_motion_hook P((Widget, XtPointer, String, XEvent *, 75 String *, Cardinal *)); 76 77 extern void key_to_event P((KeyWidget key, XEvent *event, int down_p)); 78 extern void keyboard_handle_mapping_notify P((Widget widget, 79 XtPointer client_data, 80 XEvent *event, 81 Boolean *cont)); 82 extern void keyboard_handle_keymap_notify P((Widget widget, 83 XtPointer client_data, 84 XEvent *event, 85 Boolean *cont)); 86 extern KeyWidget window_to_key P((Display *dpy, Window window)); 87 extern KeyWidget keycode_to_key P((KeyboardWidget keyboard, KeyCode code)); 88 extern void init_modifier_mapping P((KeyboardWidget widget)); 89 90 /* from info.c 91 */ 92 extern struct info_labels *make_info_widget P((Widget parent, 93 Widget parent_left)); 94 extern Widget make_label_1 P((Widget parent, char *name, char *string, 95 Widget left, Widget top, WidgetClass class, 96 XtCallbackProc callback, XtPointer data)); 97 extern Widget make_label P((Widget parent, char *name, char *string, 98 Widget left, Widget top)); 99 extern void message P((KeyboardWidget, char *)); 100 extern void message2 P((KeyboardWidget, char *)); 101 extern void describe_key P((KeyWidget)); 102 103 /* from KbdWidget.c 104 */ 105 extern void create_icon_pixmaps P((Display *)); 106 extern Pixmap get_keyboard_icon P((Display *dpy, 107 const struct keyboard_instance *kbd, 108 int *wP, int *hP)); 109 110 /* from sunOS.c or hpux.c 111 */ 112 #if defined(sun) || defined(hpux) 113 extern char *xkeycaps_guess_local_keyboard_type P((void)); 114 #endif 115 116 117 118 /* When we have to guess, and haven't a clue. 119 The Imakefile can define this to be 0, to make there be no default. 120 */ 121 #ifndef DEFAULT_KBD_NAME 122 # define DEFAULT_KBD_NAME "L101" 123 #endif 124 125 #endif /* _XKEYCAPS_H_ */ 126