*** empty log message ***
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40390
This commit is contained in:
parent
f1cd55c173
commit
455d014f8a
2 changed files with 443 additions and 434 deletions
|
@ -50,8 +50,6 @@ static BOOL gFinderLaunch;
|
|||
|
||||
/* Set the working directory to the .app's parent directory */
|
||||
- (void) setupWorkingDirectory:(BOOL)shouldChdir
|
||||
{
|
||||
if (shouldChdir)
|
||||
{
|
||||
char parentdir[MAXPATHLEN];
|
||||
char *c;
|
||||
|
@ -67,6 +65,8 @@ static BOOL gFinderLaunch;
|
|||
|
||||
*c++ = '\0'; /* cut off last part (binary name) */
|
||||
|
||||
if (shouldChdir)
|
||||
{
|
||||
assert ( chdir (parentdir) == 0 ); /* chdir to the binary app's parent */
|
||||
assert ( chdir ("../../../") == 0 ); /* chdir to the .app's parent */
|
||||
}
|
||||
|
|
|
@ -306,6 +306,7 @@ static void QZ_DoDeactivate (_THIS) {
|
|||
|
||||
static void QZ_PumpEvents (_THIS)
|
||||
{
|
||||
|
||||
static NSPoint lastMouse;
|
||||
NSPoint mouse, saveMouse;
|
||||
Point qdMouse;
|
||||
|
@ -313,12 +314,14 @@ static void QZ_PumpEvents (_THIS)
|
|||
|
||||
NSDate *distantPast;
|
||||
NSEvent *event;
|
||||
NSRect winRect;
|
||||
NSRect titleBarRect;
|
||||
NSAutoreleasePool *pool;
|
||||
|
||||
pool = [ [ NSAutoreleasePool alloc ] init ];
|
||||
distantPast = [ NSDate distantPast ];
|
||||
|
||||
winRect = NSMakeRect (0, 0, SDL_VideoSurface->w, SDL_VideoSurface->h);
|
||||
titleBarRect = NSMakeRect ( 0, SDL_VideoSurface->h, SDL_VideoSurface->w,
|
||||
SDL_VideoSurface->h + 22 );
|
||||
|
||||
|
@ -335,7 +338,7 @@ static void QZ_PumpEvents (_THIS)
|
|||
if (mouse.x != lastMouse.x || mouse.y != lastMouse.y) {
|
||||
|
||||
QZ_PrivateCGToSDL (this, &mouse);
|
||||
if (inForeground) {
|
||||
if (inForeground && NSPointInRect (mouse, winRect)) {
|
||||
//printf ("Mouse Loc: (%f, %f)\n", mouse.x, mouse.y);
|
||||
SDL_PrivateMouseMotion (0, 0, mouse.x, mouse.y);
|
||||
}
|
||||
|
@ -361,6 +364,8 @@ static void QZ_PumpEvents (_THIS)
|
|||
|
||||
#define DO_MOUSE_DOWN(button, sendToWindow) do { \
|
||||
if ( inForeground ) { \
|
||||
if ( (SDL_VideoSurface->flags & SDL_FULLSCREEN) || \
|
||||
NSPointInRect([event locationInWindow], winRect) ) \
|
||||
SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0); \
|
||||
} \
|
||||
else { \
|
||||
|
@ -417,6 +422,7 @@ static void QZ_PumpEvents (_THIS)
|
|||
case NSRightMouseDragged:
|
||||
case 27:
|
||||
case NSMouseMoved:
|
||||
|
||||
if (currentGrabMode == SDL_GRAB_ON) {
|
||||
|
||||
/**
|
||||
|
@ -446,9 +452,11 @@ static void QZ_PumpEvents (_THIS)
|
|||
warp_flag = 0;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case NSScrollWheel:
|
||||
{
|
||||
if (NSPointInRect([ event locationInWindow ], winRect)) {
|
||||
float dy;
|
||||
dy = [ event deltaY ];
|
||||
if ( dy > 0.0 ) /* Scroll up */
|
||||
|
@ -456,6 +464,7 @@ static void QZ_PumpEvents (_THIS)
|
|||
else /* Scroll down */
|
||||
SDL_PrivateMouseButton (SDL_PRESSED, 5, 0, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NSKeyUp:
|
||||
QZ_DoKey (SDL_RELEASED, event);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue