| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
#ifndef _BLT_BIND_H |
| 26 |
#define _BLT_BIND_H |
| 27 |
|
| 28 |
#include <bltList.h> |
| 29 |
|
| 30 |
typedef struct Blt_BindTableStruct *Blt_BindTable; |
| 31 |
|
| 32 |
typedef ClientData (Blt_BindPickProc) _ANSI_ARGS_((ClientData clientData, |
| 33 |
int x, int y, ClientData *contextPtr)); |
| 34 |
|
| 35 |
typedef void (Blt_BindTagProc) _ANSI_ARGS_((Blt_BindTable bindTable, |
| 36 |
ClientData object, ClientData context, Blt_List list)); |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
struct Blt_BindTableStruct { |
| 44 |
unsigned int flags; |
| 45 |
Tk_BindingTable bindingTable; |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
ClientData currentItem; |
| 54 |
|
| 55 |
ClientData currentContext; |
| 56 |
|
| 57 |
|
| 58 |
ClientData newItem; |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
ClientData newContext; |
| 65 |
|
| 66 |
|
| 67 |
ClientData focusItem; |
| 68 |
ClientData focusContext; |
| 69 |
|
| 70 |
XEvent pickEvent; |
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
int activePick; |
| 75 |
|
| 76 |
|
| 77 |
int state; |
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
ClientData clientData; |
| 82 |
Tk_Window tkwin; |
| 83 |
Blt_BindPickProc *pickProc; |
| 84 |
|
| 85 |
Blt_BindTagProc *tagProc; |
| 86 |
Tcl_Interp *interp; |
| 87 |
}; |
| 88 |
|
| 89 |
EXTERN void Blt_DestroyBindingTable _ANSI_ARGS_((Blt_BindTable table)); |
| 90 |
|
| 91 |
EXTERN Blt_BindTable Blt_CreateBindingTable _ANSI_ARGS_((Tcl_Interp *interp, |
| 92 |
Tk_Window tkwin, ClientData clientData, Blt_BindPickProc *pickProc, |
| 93 |
Blt_BindTagProc *tagProc)); |
| 94 |
|
| 95 |
EXTERN int Blt_ConfigureBindings _ANSI_ARGS_((Tcl_Interp *interp, |
| 96 |
Blt_BindTable table, ClientData item, int argc, char **argv)); |
| 97 |
|
| 98 |
#if (TCL_MAJOR_VERSION >= 8) |
| 99 |
EXTERN int Blt_ConfigureBindingsFromObj _ANSI_ARGS_((Tcl_Interp *interp, |
| 100 |
Blt_BindTable table, ClientData item, int objc, Tcl_Obj *CONST *objv)); |
| 101 |
#endif |
| 102 |
|
| 103 |
EXTERN void Blt_PickCurrentItem _ANSI_ARGS_((Blt_BindTable table)); |
| 104 |
|
| 105 |
EXTERN void Blt_DeleteBindings _ANSI_ARGS_((Blt_BindTable table, |
| 106 |
ClientData object)); |
| 107 |
|
| 108 |
EXTERN void Blt_MoveBindingTable _ANSI_ARGS_((Blt_BindTable table, |
| 109 |
Tk_Window tkwin)); |
| 110 |
|
| 111 |
#define Blt_SetFocusItem(bindPtr, object, context) \ |
| 112 |
((bindPtr)->focusItem = (ClientData)(object),\ |
| 113 |
(bindPtr)->focusContext = (ClientData)(context)) |
| 114 |
|
| 115 |
#define Blt_SetCurrentItem(bindPtr, object, context) \ |
| 116 |
((bindPtr)->currentItem = (ClientData)(object),\ |
| 117 |
(bindPtr)->currentContext = (ClientData)(context)) |
| 118 |
|
| 119 |
#define Blt_GetCurrentItem(bindPtr) ((bindPtr)->currentItem) |
| 120 |
#define Blt_GetCurrentContext(bindPtr) ((bindPtr)->currentContext) |
| 121 |
#define Blt_GetLatestItem(bindPtr) ((bindPtr)->newItem) |
| 122 |
|
| 123 |
#define Blt_GetBindingData(bindPtr) ((bindPtr)->clientData) |
| 124 |
|
| 125 |
#endif |