Mercurial > sdl-ios-xcode
comparison src/video/quartz/SDL_QuartzEvents.m @ 1487:dc6b59e925a2
Cleaning up warnings on MacOS X
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 09 Mar 2006 06:33:21 +0000 |
parents | 376665398b25 |
children | 34b9e479047e |
comparison
equal
deleted
inserted
replaced
1486:9d77fc9d0ace | 1487:dc6b59e925a2 |
---|---|
21 */ | 21 */ |
22 #include "SDL_config.h" | 22 #include "SDL_config.h" |
23 | 23 |
24 #include "SDL_QuartzVideo.h" | 24 #include "SDL_QuartzVideo.h" |
25 | 25 |
26 #include <IOKit/IOMessage.h> // For wake from sleep detection | 26 #include <IOKit/IOMessage.h> /* For wake from sleep detection */ |
27 #include <IOKit/pwr_mgt/IOPMLib.h> // For wake from sleep detection | 27 #include <IOKit/pwr_mgt/IOPMLib.h> /* For wake from sleep detection */ |
28 #include "SDL_QuartzKeys.h" | 28 #include "SDL_QuartzKeys.h" |
29 | 29 |
30 /* | 30 /* |
31 * In Panther, this header defines device dependent masks for | 31 * In Panther, this header defines device dependent masks for |
32 * right side keys. These definitions only exist in Panther, but | 32 * right side keys. These definitions only exist in Panther, but |
679 CFRunLoopAddSource (CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode); | 679 CFRunLoopAddSource (CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode); |
680 CFRelease (rls); | 680 CFRelease (rls); |
681 } | 681 } |
682 | 682 |
683 | 683 |
684 // Try to map Quartz mouse buttons to SDL's lingo... | 684 /* Try to map Quartz mouse buttons to SDL's lingo... */ |
685 static int QZ_OtherMouseButtonToSDL(int button) | 685 static int QZ_OtherMouseButtonToSDL(int button) |
686 { | 686 { |
687 switch (button) | 687 switch (button) |
688 { | 688 { |
689 case 0: | 689 case 0: |
690 return(SDL_BUTTON_LEFT); // 1 | 690 return(SDL_BUTTON_LEFT); /* 1 */ |
691 case 1: | 691 case 1: |
692 return(SDL_BUTTON_RIGHT); // 3 | 692 return(SDL_BUTTON_RIGHT); /* 3 */ |
693 case 2: | 693 case 2: |
694 return(SDL_BUTTON_MIDDLE); // 2 | 694 return(SDL_BUTTON_MIDDLE); /* 2 */ |
695 } | 695 } |
696 | 696 |
697 // >= 3: skip 4 & 5, since those are the SDL mousewheel buttons. | 697 /* >= 3: skip 4 & 5, since those are the SDL mousewheel buttons. */ |
698 return(button + 3); | 698 return(button + 3); |
699 } | 699 } |
700 | 700 |
701 | 701 |
702 void QZ_PumpEvents (_THIS) | 702 void QZ_PumpEvents (_THIS) |
703 { | 703 { |
704 static Uint32 screensaverTicks = 0; | |
705 Uint32 nowTicks; | |
704 int firstMouseEvent; | 706 int firstMouseEvent; |
705 CGMouseDelta dx, dy; | 707 CGMouseDelta dx, dy; |
706 | 708 |
707 NSDate *distantPast; | 709 NSDate *distantPast; |
708 NSEvent *event; | 710 NSEvent *event; |
711 | 713 |
712 if (!SDL_VideoSurface) | 714 if (!SDL_VideoSurface) |
713 return; /* don't do anything if there's no screen surface. */ | 715 return; /* don't do anything if there's no screen surface. */ |
714 | 716 |
715 /* Update activity every five seconds to prevent screensaver. --ryan. */ | 717 /* Update activity every five seconds to prevent screensaver. --ryan. */ |
716 static Uint32 screensaverTicks = 0; | 718 nowTicks = SDL_GetTicks(); |
717 Uint32 nowTicks = SDL_GetTicks(); | |
718 if ((nowTicks - screensaverTicks) > 5000) | 719 if ((nowTicks - screensaverTicks) > 5000) |
719 { | 720 { |
720 UpdateSystemActivity(UsrActivity); | 721 UpdateSystemActivity(UsrActivity); |
721 screensaverTicks = nowTicks; | 722 screensaverTicks = nowTicks; |
722 } | 723 } |