4 * Copyright 1993-1998 Lucent Technologies, Inc.
6 * Permission to use, copy, modify, and distribute this software and
7 * its documentation for any purpose and without fee is hereby
8 * granted, provided that the above copyright notice appear in all
9 * copies and that both that the copyright notice and warranty
10 * disclaimer appear in supporting documentation, and that the names
11 * of Lucent Technologies any of their entities not be used in
12 * advertising or publicity pertaining to distribution of the software
13 * without specific, written prior permission.
15 * Lucent Technologies disclaims all warranties with regard to this
16 * software, including all implied warranties of merchantability and
17 * fitness. In no event shall Lucent Technologies be liable for any
18 * special, indirect or consequential damages or any damages
19 * whatsoever resulting from loss of use, data or profits, whether in
20 * an action of contract, negligence or other tortuous action, arising
21 * out of or in connection with the use or performance of this
30 typedef struct Blt_BindTableStruct *Blt_BindTable;
32 typedef ClientData (Blt_BindPickProc) _ANSI_ARGS_((ClientData clientData,
33 int x, int y, ClientData *contextPtr));
35 typedef void (Blt_BindTagProc) _ANSI_ARGS_((Blt_BindTable bindTable,
36 ClientData object, ClientData context, Blt_List list));
40 * Binding structure information:
43 struct Blt_BindTableStruct {
45 Tk_BindingTable bindingTable;
46 /* Table of all bindings currently defined.
47 * NULL means that no bindings exist, so the
48 * table hasn't been created. Each "object"
49 * used for this table is either a Tk_Uid for
50 * a tag or the address of an item named by
53 ClientData currentItem; /* The item currently containing the mouse
54 * pointer, or NULL if none. */
55 ClientData currentContext; /* One word indicating what kind of object
58 ClientData newItem; /* The item that is about to become the
59 * current one, or NULL. This field is
60 * used to detect deletions of the new
61 * current item pointer that occur during
62 * Leave processing of the previous current
64 ClientData newContext; /* One-word indicating what kind of object
68 ClientData focusContext;
70 XEvent pickEvent; /* The event upon which the current choice
71 * of the current tab is based. Must be saved
72 * so that if the current item is deleted,
73 * we can pick another. */
74 int activePick; /* The pick event has been initialized so
75 * that we can repick it */
77 int state; /* Last known modifier state. Used to
78 * defer picking a new current object
79 * while buttons are down. */
81 ClientData clientData;
83 Blt_BindPickProc *pickProc; /* Routine to report the item the mouse is
85 Blt_BindTagProc *tagProc; /* Routine to report tags picked items. */
88 EXTERN void Blt_DestroyBindingTable _ANSI_ARGS_((Blt_BindTable table));
90 EXTERN Blt_BindTable Blt_CreateBindingTable _ANSI_ARGS_((Tcl_Interp *interp,
91 Tk_Window tkwin, ClientData clientData, Blt_BindPickProc *pickProc,
92 Blt_BindTagProc *tagProc));
94 EXTERN int Blt_ConfigureBindings _ANSI_ARGS_((Tcl_Interp *interp,
95 Blt_BindTable table, ClientData item, int argc, char **argv));
97 #if (TCL_MAJOR_VERSION >= 8)
98 EXTERN int Blt_ConfigureBindingsFromObj _ANSI_ARGS_((Tcl_Interp *interp,
99 Blt_BindTable table, ClientData item, int objc, Tcl_Obj *CONST *objv));
102 EXTERN void Blt_PickCurrentItem _ANSI_ARGS_((Blt_BindTable table));
104 EXTERN void Blt_DeleteBindings _ANSI_ARGS_((Blt_BindTable table,
107 EXTERN void Blt_MoveBindingTable _ANSI_ARGS_((Blt_BindTable table,
110 #define Blt_SetFocusItem(bindPtr, object, context) \
111 ((bindPtr)->focusItem = (ClientData)(object),\
112 (bindPtr)->focusContext = (ClientData)(context))
114 #define Blt_SetCurrentItem(bindPtr, object, context) \
115 ((bindPtr)->currentItem = (ClientData)(object),\
116 (bindPtr)->currentContext = (ClientData)(context))
118 #define Blt_GetCurrentItem(bindPtr) ((bindPtr)->currentItem)
119 #define Blt_GetCurrentContext(bindPtr) ((bindPtr)->currentContext)
120 #define Blt_GetLatestItem(bindPtr) ((bindPtr)->newItem)
122 #define Blt_GetBindingData(bindPtr) ((bindPtr)->clientData)
124 #endif /*_BLT_BIND_H*/