From 5f552048b3da580cb0bb51b22877c101d60fa204 Mon Sep 17 00:00:00 2001 From: joye Date: Thu, 29 May 2014 19:17:12 +0000 Subject: *** empty log message *** --- src/bltGrAxisOp.C | 2 +- src/bltGrBind.C | 53 ++++++++++++++++++++++++++++------------------------- src/bltGrBind.h | 6 ++---- src/bltGrElemOp.C | 2 +- src/bltGrLegd.C | 3 +-- src/bltGrLegdOp.C | 2 +- src/bltGrMarkerOp.C | 2 +- src/bltGrXAxisOp.C | 2 +- src/bltGraph.C | 2 +- 9 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/bltGrAxisOp.C b/src/bltGrAxisOp.C index 6d60e04..7a3c99f 100644 --- a/src/bltGrAxisOp.C +++ b/src/bltGrAxisOp.C @@ -151,7 +151,7 @@ static int BindOp(ClientData clientData, Tcl_Interp* interp, return TCL_OK; } else - return graphPtr->bindTable_->configure(interp, graphPtr->axisTag(Tcl_GetString(objv[3])), objc-4, objv+4); + return graphPtr->bindTable_->configure(graphPtr->axisTag(Tcl_GetString(objv[3])), objc-4, objv+4); } static int CreateOp(ClientData clientData, Tcl_Interp* interp, diff --git a/src/bltGrBind.C b/src/bltGrBind.C index 8d77add..70b6dd0 100644 --- a/src/bltGrBind.C +++ b/src/bltGrBind.C @@ -39,12 +39,11 @@ using namespace std; static Tk_EventProc BindProc; -BindTable::BindTable(Graph* graphPtr, Tcl_Interp* interp, Tk_Window tkwinn, - Blt_BindPickProc* pickProcc) +BindTable::BindTable(Graph* graphPtr, Blt_BindPickProc* pickProcc) { graphPtr_ = graphPtr; flags =0; - bindingTable = Tk_CreateBindingTable(interp); + bindingTable = Tk_CreateBindingTable(graphPtr->interp_); currentItem =NULL; currentContext =NULL; newItem =NULL; @@ -53,12 +52,11 @@ BindTable::BindTable(Graph* graphPtr, Tcl_Interp* interp, Tk_Window tkwinn, focusContext =NULL; // pickEvent =NULL; state =0; - tkwin = tkwinn; pickProc = pickProcc; unsigned int mask = (KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask); - Tk_CreateEventHandler(tkwin, mask, BindProc, this); + Tk_CreateEventHandler(graphPtr->tkwin_, mask, BindProc, this); } BindTable::~BindTable() @@ -67,39 +65,42 @@ BindTable::~BindTable() unsigned int mask = (KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask); - Tk_DeleteEventHandler(tkwin, mask, BindProc, this); + Tk_DeleteEventHandler(graphPtr_->tkwin_, mask, BindProc, this); } -int BindTable::configure(Tcl_Interp* interp, ClientData item, - int objc, Tcl_Obj* const objv[]) +int BindTable::configure(ClientData item, int objc, Tcl_Obj* const objv[]) { if (objc == 0) { - Tk_GetAllBindings(interp, bindingTable, item); + Tk_GetAllBindings(graphPtr_->interp_, bindingTable, item); return TCL_OK; } const char *string = Tcl_GetString(objv[0]); if (objc == 1) { - const char* command = Tk_GetBinding(interp, bindingTable, item, string); + const char* command = + Tk_GetBinding(graphPtr_->interp_, bindingTable, item, string); if (!command) { - Tcl_ResetResult(interp); - Tcl_AppendResult(interp, "invalid binding event \"", string, "\"", NULL); + Tcl_ResetResult(graphPtr_->interp_); + Tcl_AppendResult(graphPtr_->interp_, "invalid binding event \"", + string, "\"", NULL); return TCL_ERROR; } - Tcl_SetStringObj(Tcl_GetObjResult(interp), command, -1); + Tcl_SetStringObj(Tcl_GetObjResult(graphPtr_->interp_), command, -1); return TCL_OK; } const char* seq = string; const char* command = Tcl_GetString(objv[1]); if (command[0] == '\0') - return Tk_DeleteBinding(interp, bindingTable, item, seq); + return Tk_DeleteBinding(graphPtr_->interp_, bindingTable, item, seq); unsigned long mask; if (command[0] == '+') - mask = Tk_CreateBinding(interp, bindingTable, item, seq, command+1, 1); + mask = Tk_CreateBinding(graphPtr_->interp_, bindingTable, + item, seq, command+1, 1); else - mask = Tk_CreateBinding(interp, bindingTable, item, seq, command, 0); + mask = Tk_CreateBinding(graphPtr_->interp_, bindingTable, + item, seq, command, 0); if (!mask) return TCL_ERROR; @@ -108,9 +109,9 @@ int BindTable::configure(Tcl_Interp* interp, ClientData item, |Button5MotionMask|ButtonPressMask|ButtonReleaseMask |EnterWindowMask|LeaveWindowMask|KeyPressMask |KeyReleaseMask|PointerMotionMask|VirtualEventMask)) { - Tk_DeleteBinding(interp, bindingTable, item, seq); - Tcl_ResetResult(interp); - Tcl_AppendResult(interp, "requested illegal events; ", + Tk_DeleteBinding(graphPtr_->interp_, bindingTable, item, seq); + Tcl_ResetResult(graphPtr_->interp_); + Tcl_AppendResult(graphPtr_->interp_, "requested illegal events; ", "only key, button, motion, enter, leave, and virtual ", "events may be used", (char *)NULL); return TCL_ERROR; @@ -142,7 +143,7 @@ void BindTable::deleteBindings(ClientData object) void BindTable::doEvent(XEvent* eventPtr, ClientData item, ClientData context) { - if (!tkwin || !bindingTable) + if (!graphPtr_->tkwin_ || !bindingTable) return; if ((eventPtr->type == KeyPress) || (eventPtr->type == KeyRelease)) { @@ -155,7 +156,8 @@ void BindTable::doEvent(XEvent* eventPtr, ClientData item, ClientData context) int nTags; ClassId classId = (ClassId)(long(context)); const char** tagArray = graphPtr_->getTags(item, classId, &nTags); - Tk_BindEvent(bindingTable, eventPtr, tkwin, nTags, (void**)tagArray); + Tk_BindEvent(bindingTable, eventPtr, graphPtr_->tkwin_, nTags, + (void**)tagArray); if (tagArray) delete [] tagArray; } @@ -255,8 +257,7 @@ static void PickCurrentItem(BindTable* bindPtr, XEvent* eventPtr) if (((newItem != bindPtr->currentItem) || (newContext != bindPtr->currentContext)) && (buttonDown)) { bindPtr->flags |= LEFT_GRABBED_ITEM; XEvent event = bindPtr->pickEvent; - if ((newItem != bindPtr->newItem) || - (newContext != bindPtr->newContext)) { + if ((newItem != bindPtr->newItem) || (newContext != bindPtr->newContext)) { // Generate and events for objects during button // grabs. This isn't standard. But for example, it allows one to @@ -350,14 +351,16 @@ static void BindProc(ClientData clientData, XEvent* eventPtr) bindPtr->state = eventPtr->xbutton.state; PickCurrentItem(bindPtr, eventPtr); bindPtr->state ^= mask; - bindPtr->doEvent(eventPtr, bindPtr->currentItem, bindPtr->currentContext); + bindPtr->doEvent(eventPtr, + bindPtr->currentItem, bindPtr->currentContext); } else { // Button release: first process the event, with the button still // considered to be down. Then repick the current item under the // assumption that the button is no longer down. bindPtr->state = eventPtr->xbutton.state; - bindPtr->doEvent(eventPtr, bindPtr->currentItem, bindPtr->currentContext); + bindPtr->doEvent(eventPtr, + bindPtr->currentItem, bindPtr->currentContext); eventPtr->xbutton.state ^= mask; bindPtr->state = eventPtr->xbutton.state; PickCurrentItem(bindPtr, eventPtr); diff --git a/src/bltGrBind.h b/src/bltGrBind.h index 9a4f79e..a67a479 100644 --- a/src/bltGrBind.h +++ b/src/bltGrBind.h @@ -50,15 +50,13 @@ class BindTable { ClientData focusContext; XEvent pickEvent; int state; - Tk_Window tkwin; Blt_BindPickProc* pickProc; public: - BindTable(Graph*, Tcl_Interp* interp, Tk_Window tkwin, - Blt_BindPickProc* pickProc); + BindTable(Graph*, Blt_BindPickProc* pickProc); virtual ~BindTable(); - int configure(Tcl_Interp*, ClientData, int, Tcl_Obj *const []); + int configure(ClientData, int, Tcl_Obj *const []); void deleteBindings(ClientData object); void doEvent(XEvent*, ClientData, ClientData); }; diff --git a/src/bltGrElemOp.C b/src/bltGrElemOp.C index 30c2a9a..a41a864 100644 --- a/src/bltGrElemOp.C +++ b/src/bltGrElemOp.C @@ -203,7 +203,7 @@ static int BindOp(ClientData clientData, Tcl_Interp* interp, return TCL_OK; } - return graphPtr->bindTable_->configure(interp, graphPtr->elementTag(Tcl_GetString(objv[3])), objc - 4, objv + 4); + return graphPtr->bindTable_->configure(graphPtr->elementTag(Tcl_GetString(objv[3])), objc - 4, objv + 4); } static int ClosestOp(ClientData clientData, Tcl_Interp* interp, diff --git a/src/bltGrLegd.C b/src/bltGrLegd.C index 2cd3162..9b513a9 100644 --- a/src/bltGrLegd.C +++ b/src/bltGrLegd.C @@ -194,8 +194,7 @@ Legend::Legend(Graph* graphPtr) ops->titleStyle.angle =0; ops->titleStyle.justify =TK_JUSTIFY_LEFT; - bindTable_ = new BindTable(graphPtr, graphPtr->interp_, graphPtr->tkwin_, - LegendPickEntry); + bindTable_ = new BindTable(graphPtr, LegendPickEntry); Tcl_InitHashTable(&selectTable_, TCL_ONE_WORD_KEYS); diff --git a/src/bltGrLegdOp.C b/src/bltGrLegdOp.C index b7cefff..1e979e5 100644 --- a/src/bltGrLegdOp.C +++ b/src/bltGrLegdOp.C @@ -195,7 +195,7 @@ static int BindOp(ClientData clientData, Tcl_Interp* interp, return TCL_OK; } - return graphPtr->legend_->bindTable_->configure(interp, graphPtr->elementTag(Tcl_GetString(objv[3])), objc - 4, objv + 4); + return graphPtr->legend_->bindTable_->configure(graphPtr->elementTag(Tcl_GetString(objv[3])), objc - 4, objv + 4); } static int CurselectionOp(ClientData clientData, Tcl_Interp* interp, diff --git a/src/bltGrMarkerOp.C b/src/bltGrMarkerOp.C index 93849bd..76d9a2e 100644 --- a/src/bltGrMarkerOp.C +++ b/src/bltGrMarkerOp.C @@ -224,7 +224,7 @@ static int BindOp(ClientData clientData, Tcl_Interp* interp, return TCL_OK; } - return graphPtr->bindTable_->configure(interp, graphPtr->markerTag(Tcl_GetString(objv[3])), objc - 4, objv + 4); + return graphPtr->bindTable_->configure(graphPtr->markerTag(Tcl_GetString(objv[3])), objc - 4, objv + 4); } static int CreateOp(ClientData clientData, Tcl_Interp* interp, diff --git a/src/bltGrXAxisOp.C b/src/bltGrXAxisOp.C index 235c9b3..16187a1 100644 --- a/src/bltGrXAxisOp.C +++ b/src/bltGrXAxisOp.C @@ -85,7 +85,7 @@ static int BindOp(ClientData clientData, Tcl_Interp* interp, { Graph* graphPtr = (Graph*)clientData; Axis* axisPtr = GetAxisFromCmd(clientData, objv[1]); - return graphPtr->bindTable_->configure(interp, graphPtr->axisTag(axisPtr->name_), objc-3, objv+3); + return graphPtr->bindTable_->configure(graphPtr->axisTag(axisPtr->name_), objc-3, objv+3); } static int InvTransformOp(ClientData clientData, Tcl_Interp* interp, diff --git a/src/bltGraph.C b/src/bltGraph.C index 103346a..588f606 100644 --- a/src/bltGraph.C +++ b/src/bltGraph.C @@ -120,7 +120,7 @@ Graph::Graph(ClientData clientData, Tcl_Interp* interp, axes_.displayList = Blt_Chain_Create(); elements_.displayList = Blt_Chain_Create(); markers_.displayList = Blt_Chain_Create(); - bindTable_ = new BindTable(this, interp_, tkwin_, GraphPickEntry); + bindTable_ = new BindTable(this, GraphPickEntry); if (createAxes() != TCL_OK) { valid_ =0; -- cgit v0.12