summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXMouseEvent.c
diff options
context:
space:
mode:
authorwolfsuit <wolfsuit>2004-02-16 00:19:41 (GMT)
committerwolfsuit <wolfsuit>2004-02-16 00:19:41 (GMT)
commit2c428c96dea00fa1e67ba58a1e386689138adbe5 (patch)
tree367e94ab4e64d32b901564923e10633b826fd06c /macosx/tkMacOSXMouseEvent.c
parentbbdea9a7793eefb0266b3b57c110c3a614e79b1c (diff)
downloadtk-2c428c96dea00fa1e67ba58a1e386689138adbe5.zip
tk-2c428c96dea00fa1e67ba58a1e386689138adbe5.tar.gz
tk-2c428c96dea00fa1e67ba58a1e386689138adbe5.tar.bz2
Fix a bug in tk_getOpenFile - files with no types are rejected when they would
pass in Mac OS Classic. Add the tkMacOSXCarbonEvents.c - just a skeleton right now. A bunch of formatting nits fixed.
Diffstat (limited to 'macosx/tkMacOSXMouseEvent.c')
-rw-r--r--macosx/tkMacOSXMouseEvent.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c
index 6a18426..150519c 100644
--- a/macosx/tkMacOSXMouseEvent.c
+++ b/macosx/tkMacOSXMouseEvent.c
@@ -156,12 +156,13 @@ TkMacOSXProcessMouseEvent(TkMacOSXEvent *eventPtr, MacEventStatus * statusPtr)
medPtr->state |= Mod2Mask; /* option key */
}
if (eventPtr->eKind == kEventMouseDown
- || eventPtr->eKind== kEventMouseDragged ) {
+ || eventPtr->eKind == kEventMouseDragged ) {
EventMouseButton mouseButton;
- if ((status=GetEventParameter(eventPtr->eventRef,
- kEventParamMouseButton,
- typeMouseButton, NULL,
- sizeof(mouseButton), NULL,&mouseButton)) != noErr ) {
+ status = GetEventParameter(eventPtr->eventRef,
+ kEventParamMouseButton,
+ typeMouseButton, NULL,
+ sizeof(mouseButton), NULL,&mouseButton);
+ if (status != noErr ) {
fprintf (stderr, "Failed to retrieve mouse button, %d\n", status);
statusPtr->err = 1;
return 0;
@@ -169,7 +170,7 @@ TkMacOSXProcessMouseEvent(TkMacOSXEvent *eventPtr, MacEventStatus * statusPtr)
medPtr->state |= 1 << ((mouseButton-1)+8);
}
- medPtr->windowPart= FindWindow(where, &medPtr->whichWin);
+ medPtr->windowPart = FindWindow(where, &medPtr->whichWin);
window = TkMacOSXGetXWindow(medPtr->whichWin);
if (medPtr->whichWin != NULL && window == None) {
return 0;
@@ -193,10 +194,11 @@ TkMacOSXProcessMouseEvent(TkMacOSXEvent *eventPtr, MacEventStatus * statusPtr)
window, medPtr->state);
}
if (eventPtr->eKind == kEventMouseWheelMoved) {
- if ((status=GetEventParameter(eventPtr->eventRef,
- kEventParamMouseWheelDelta,
- typeLongInteger, NULL,
- sizeof(medPtr->delta), NULL,&medPtr->delta)) != noErr ) {
+ status = GetEventParameter(eventPtr->eventRef,
+ kEventParamMouseWheelDelta,
+ typeLongInteger, NULL,
+ sizeof(medPtr->delta), NULL,&medPtr->delta);
+ if (status != noErr ) {
fprintf (stderr,
"Failed to retrieve mouse wheel delta, %d\n", status);
statusPtr->err = 1;
@@ -233,23 +235,26 @@ TkMacOSXProcessMouseEvent(TkMacOSXEvent *eventPtr, MacEventStatus * statusPtr)
}
}
- if (medPtr->whichWin && eventPtr->eKind==kEventMouseDown) {
+ if (medPtr->whichWin && eventPtr->eKind == kEventMouseDown) {
ProcessSerialNumber frontPsn, ourPsn;
Boolean flag;
- if ((err=GetFrontProcess(&frontPsn))!=noErr) {
+ err = GetFrontProcess(&frontPsn);
+ if (err != noErr) {
fprintf(stderr, "GetFrontProcess failed, %d\n", err);
statusPtr->err = 1;
return 1;
}
GetCurrentProcess(&ourPsn);
- if ((err=SameProcess(&frontPsn, &ourPsn, &flag))!=noErr) {
+ err = SameProcess(&frontPsn, &ourPsn, &flag);
+ if (err != noErr) {
fprintf(stderr, "SameProcess failed, %d\n", err);
statusPtr->err = 1;
return 1;
} else {
if (!flag) {
- if ((err=SetFrontProcess(&ourPsn)) != noErr) {
+ err = SetFrontProcess(&ourPsn);
+ if (err != noErr) {
fprintf(stderr,"SetFrontProcess failed,%d\n", err);
statusPtr->err = 1;
return 1;
@@ -484,7 +489,7 @@ HandleInCollapse(WindowRef win)
static int
GeneratePollingEvents(MouseEventData * medPtr)
{
- Tk_Window tkwin, rootwin, grabWin, topPtr;
+ Tk_Window tkwin, rootwin, grabWin;
Window window;
int local_x, local_y;
TkDisplay *dispPtr;