summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-05-11 12:12:49 (GMT)
committernijtmans <nijtmans>2010-05-11 12:12:49 (GMT)
commitede9fc2f74a2e9aa5084e18c93d903e81f0f3303 (patch)
tree1a71cc0e56c633acfe0fb2e4a5af9d1ea1bce8bd
parent44d12a1d5aa9b0103f0c3bea1ed81b59d4d383d1 (diff)
downloadtk-ede9fc2f74a2e9aa5084e18c93d903e81f0f3303.zip
tk-ede9fc2f74a2e9aa5084e18c93d903e81f0f3303.tar.gz
tk-ede9fc2f74a2e9aa5084e18c93d903e81f0f3303.tar.bz2
Consistent use of variable names in RestrictEvent
API documentation and implementation: Use 'prev' in stead of 'old', and 'arg' in stead of 'clientData' everywhere, just as in tkEvent.c.
-rw-r--r--ChangeLog8
-rw-r--r--doc/RestrictEv.316
-rw-r--r--generic/tkGrab.c12
-rw-r--r--unix/tkUnixDraw.c13
-rw-r--r--unix/tkUnixSend.c11
-rw-r--r--unix/tkUnixWm.c15
6 files changed, 39 insertions, 36 deletions
diff --git a/ChangeLog b/ChangeLog
index 7ecc694..3685d96 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-05-11 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * doc/RestrictEv.3 Consistent use of variable names in RestrictEvent
+ * generic/tkGrab.c API documentation and implementation: Use 'prev'
+ * unix/tkUnixDraw.c in stead of 'old', and 'arg' in stead of
+ * unix/tkUnixSend.c 'clientData' everywhere, just as in tkEvent.c.
+ * unix/tkUnixWm.c
+
2010-05-10 Jan Nijtmans <nijtmans@users.sf.net>
* doc/BindTable.3 Bring in line with actual implementation.
diff --git a/doc/RestrictEv.3 b/doc/RestrictEv.3
index 03907a6..ad59124 100644
--- a/doc/RestrictEv.3
+++ b/doc/RestrictEv.3
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: RestrictEv.3,v 1.8 2008/06/30 22:57:02 dkf Exp $
+'\" RCS: @(#) $Id: RestrictEv.3,v 1.9 2010/05/11 12:12:50 nijtmans Exp $
'\"
.so man.macros
.TH Tk_RestrictEvents 3 "" Tk "Tk Library Procedures"
@@ -17,15 +17,15 @@ Tk_RestrictEvents \- filter and selectively delay X events
\fB#include <tk.h>\fR
.sp
Tk_RestrictProc *
-\fBTk_RestrictEvents\fR(\fIproc, clientData, prevClientDataPtr\fR)
+\fBTk_RestrictEvents\fR(\fIproc, arg, prevArgPtr\fR)
.SH ARGUMENTS
-.AS Tk_RestrictProc **prevClientDataPtr
+.AS Tk_RestrictProc **prevArgPtr
.AP Tk_RestrictProc *proc in
Predicate procedure to call to filter incoming X events.
NULL means do not restrict events at all.
-.AP ClientData clientData in
+.AP ClientData arg in
Arbitrary argument to pass to \fIproc\fR.
-.AP ClientData *prevClientDataPtr out
+.AP ClientData *prevArgPtr out
Pointer to place to save argument to previous restrict procedure.
.BE
.SH DESCRIPTION
@@ -42,10 +42,10 @@ is a procedure with arguments and result that match
the type \fBTk_RestrictProc\fR:
.CS
typedef Tk_RestrictAction \fBTk_RestrictProc\fR(
- ClientData \fIclientData\fR,
+ ClientData \fIarg\fR,
XEvent *\fIeventPtr\fR);
.CE
-The \fIclientData\fR argument is a copy of the \fIclientData\fR passed
+The \fIarg\fR argument is a copy of the \fIarg\fR passed
to \fBTk_RestrictEvents\fR; it may be used to provide \fIproc\fR with
information it needs to filter events. The \fIeventPtr\fR points to
an event under consideration. \fIProc\fR returns a restrict action
@@ -57,7 +57,7 @@ left on the event queue for later processing. If the return value is
\fBTK_DISCARD_EVENT\fR, then the event will be removed from the event
queue and discarded without being processed.
.PP
-\fBTk_RestrictEvents\fR uses its return value and \fIprevClientDataPtr\fR
+\fBTk_RestrictEvents\fR uses its return value and \fIprevArgPtr\fR
to return information about the current event restriction procedure
(a NULL return value means there are currently no restrictions).
These values may be used to restore the previous restriction state
diff --git a/generic/tkGrab.c b/generic/tkGrab.c
index 67cf216..8056b2c 100644
--- a/generic/tkGrab.c
+++ b/generic/tkGrab.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkGrab.c,v 1.20 2010/02/13 13:47:49 nijtmans Exp $
+ * RCS: @(#) $Id: tkGrab.c,v 1.21 2010/05/11 12:12:50 nijtmans Exp $
*/
#include "tkInt.h"
@@ -152,7 +152,7 @@ static const unsigned int buttonStates[] = {
static void EatGrabEvents(TkDisplay *dispPtr, unsigned int serial);
static TkWindow * FindCommonAncestor(TkWindow *winPtr1,
TkWindow *winPtr2, int *countPtr1, int *countPtr2);
-static Tk_RestrictAction GrabRestrictProc(ClientData arg, XEvent *eventPtr);
+static Tk_RestrictProc GrabRestrictProc;
static int GrabWinEventProc(Tcl_Event *evPtr, int flags);
static void MovePointer2(TkWindow *sourcePtr, TkWindow *destPtr,
int mode, int leaveEvents, int EnterEvents);
@@ -1242,18 +1242,18 @@ EatGrabEvents(
unsigned int serial) /* Only discard events that have a serial
* number at least this great. */
{
- Tk_RestrictProc *oldProc;
+ Tk_RestrictProc *prevProc;
GrabInfo info;
- ClientData oldArg, dummy;
+ ClientData prevArg;
info.display = dispPtr->display;
info.serial = serial;
TkpSync(info.display);
- oldProc = Tk_RestrictEvents(GrabRestrictProc, &info, &oldArg);
+ prevProc = Tk_RestrictEvents(GrabRestrictProc, &info, &prevArg);
while (Tcl_ServiceEvent(TCL_WINDOW_EVENTS)) {
/* EMPTY */
}
- Tk_RestrictEvents(oldProc, oldArg, &dummy);
+ Tk_RestrictEvents(prevProc, prevArg, &prevArg);
}
/*
diff --git a/unix/tkUnixDraw.c b/unix/tkUnixDraw.c
index 25741cc..71904f3 100644
--- a/unix/tkUnixDraw.c
+++ b/unix/tkUnixDraw.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixDraw.c,v 1.11 2007/12/13 15:28:50 dgp Exp $
+ * RCS: @(#) $Id: tkUnixDraw.c,v 1.12 2010/05/11 12:12:49 nijtmans Exp $
*/
#include "tkInt.h"
@@ -34,7 +34,7 @@ typedef struct ScrollInfo {
* Forward declarations for functions declared later in this file:
*/
-static Tk_RestrictAction ScrollRestrictProc(ClientData arg, XEvent *eventPtr);
+static Tk_RestrictProc ScrollRestrictProc;
/*
*----------------------------------------------------------------------
@@ -65,8 +65,8 @@ TkScrollWindow(
int dx, int dy, /* Distance rectangle should be moved. */
TkRegion damageRgn) /* Region to accumulate damage in. */
{
- Tk_RestrictProc *oldProc;
- ClientData oldArg, dummy;
+ Tk_RestrictProc *prevProc;
+ ClientData prevArg;
ScrollInfo info;
XCopyArea(Tk_Display(tkwin), Tk_WindowId(tkwin), Tk_WindowId(tkwin), gc,
@@ -86,12 +86,11 @@ TkScrollWindow(
*/
TkpSync(info.display);
- oldProc = Tk_RestrictEvents(ScrollRestrictProc, (ClientData) &info,
- &oldArg);
+ prevProc = Tk_RestrictEvents(ScrollRestrictProc, &info, &prevArg);
while (!info.done) {
Tcl_ServiceEvent(TCL_WINDOW_EVENTS);
}
- Tk_RestrictEvents(oldProc, oldArg, &dummy);
+ Tk_RestrictEvents(prevProc, prevArg, &prevArg);
if (XEmptyRegion((Region) damageRgn)) {
return 0;
diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c
index 108d109..515be11 100644
--- a/unix/tkUnixSend.c
+++ b/unix/tkUnixSend.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixSend.c,v 1.26 2009/12/20 23:26:53 dkf Exp $
+ * RCS: @(#) $Id: tkUnixSend.c,v 1.27 2010/05/11 12:12:50 nijtmans Exp $
*/
#include "tkUnixInt.h"
@@ -220,8 +220,7 @@ static NameRegistry * RegOpen(Tcl_Interp *interp,
TkDisplay *dispPtr, int lock);
static void SendEventProc(ClientData clientData, XEvent *eventPtr);
static int SendInit(Tcl_Interp *interp, TkDisplay *dispPtr);
-static Tk_RestrictAction SendRestrictProc(ClientData clientData,
- XEvent *eventPtr);
+static Tk_RestrictProc SendRestrictProc;
static int ServerSecure(TkDisplay *dispPtr);
static void UpdateCommWindow(TkDisplay *dispPtr);
static int ValidateName(TkDisplay *dispPtr, const char *name,
@@ -946,7 +945,7 @@ Tk_SendCmd(
const char *destName;
int result, c, async, i, firstArg;
size_t length;
- Tk_RestrictProc *prevRestrictProc;
+ Tk_RestrictProc *prevProc;
ClientData prevArg;
TkDisplay *dispPtr;
Tcl_Time timeout;
@@ -1138,7 +1137,7 @@ Tk_SendCmd(
* other events in the application.
*/
- prevRestrictProc = Tk_RestrictEvents(SendRestrictProc, NULL, &prevArg);
+ prevProc = Tk_RestrictEvents(SendRestrictProc, NULL, &prevArg);
Tcl_GetTime(&timeout);
timeout.sec += 2;
while (!pending.gotResponse) {
@@ -1169,7 +1168,7 @@ Tk_SendCmd(
}
}
}
- (void) Tk_RestrictEvents(prevRestrictProc, prevArg, &prevArg);
+ Tk_RestrictEvents(prevProc, prevArg, &prevArg);
/*
* Unregister the information about the pending command and return the
diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c
index 109afc5..c6f56aa 100644
--- a/unix/tkUnixWm.c
+++ b/unix/tkUnixWm.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixWm.c,v 1.81 2010/02/16 21:12:57 nijtmans Exp $
+ * RCS: @(#) $Id: tkUnixWm.c,v 1.82 2010/05/11 12:12:49 nijtmans Exp $
*/
#include "tkUnixInt.h"
@@ -358,8 +358,7 @@ static void WaitForConfigureNotify(TkWindow *winPtr,
static int WaitForEvent(Display *display,
WmInfo *wmInfoPtr, int type, XEvent *eventPtr);
static void WaitForMapNotify(TkWindow *winPtr, int mapped);
-static Tk_RestrictAction WaitRestrictProc(ClientData clientData,
- XEvent *eventPtr);
+static Tk_RestrictProc WaitRestrictProc;
static void WrapperEventProc(ClientData clientData,
XEvent *eventPtr);
static void WmWaitMapProc(ClientData clientData,
@@ -5169,8 +5168,8 @@ WaitForEvent(
XEvent *eventPtr) /* Place to store event. */
{
WaitRestrictInfo info;
- Tk_RestrictProc *oldRestrictProc;
- ClientData oldRestrictData;
+ Tk_RestrictProc *prevProc;
+ ClientData prevArg;
Tcl_Time timeout;
/*
@@ -5184,8 +5183,7 @@ WaitForEvent(
info.type = type;
info.eventPtr = eventPtr;
info.foundEvent = 0;
- oldRestrictProc = Tk_RestrictEvents(WaitRestrictProc, &info,
- &oldRestrictData);
+ prevProc = Tk_RestrictEvents(WaitRestrictProc, &info, &prevArg);
Tcl_GetTime(&timeout);
timeout.sec += 2;
@@ -5195,8 +5193,7 @@ WaitForEvent(
break;
}
}
- (void) Tk_RestrictEvents(oldRestrictProc, oldRestrictData,
- &oldRestrictData);
+ Tk_RestrictEvents(prevProc, prevArg, &prevArg);
if (info.foundEvent) {
return TCL_OK;
}