Implemented drop events in iOS
authorSam Lantinga <slouken@libsdl.org>
Sun, 14 Oct 2012 01:05:04 -0700
changeset 65874ef7c70295c9
parent 6586 ab57cc69dcc0
child 6588 f739b8044c26
Implemented drop events in iOS
Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj
src/video/uikit/SDL_uikitappdelegate.m
     1.1 --- a/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj	Sun Oct 14 00:24:07 2012 -0700
     1.2 +++ b/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj	Sun Oct 14 01:05:04 2012 -0700
     1.3 @@ -102,6 +102,8 @@
     1.4  		AA126AD51617C5E7005ABC8F /* SDL_uikitmodes.m in Sources */ = {isa = PBXBuildFile; fileRef = AA126AD31617C5E6005ABC8F /* SDL_uikitmodes.m */; };
     1.5  		AA628ADB159369E3005138DD /* SDL_rotate.c in Sources */ = {isa = PBXBuildFile; fileRef = AA628AD9159369E3005138DD /* SDL_rotate.c */; };
     1.6  		AA628ADC159369E3005138DD /* SDL_rotate.h in Headers */ = {isa = PBXBuildFile; fileRef = AA628ADA159369E3005138DD /* SDL_rotate.h */; };
     1.7 +		AA704DD6162AA90A0076D1C1 /* SDL_dropevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = AA704DD4162AA90A0076D1C1 /* SDL_dropevents_c.h */; };
     1.8 +		AA704DD7162AA90A0076D1C1 /* SDL_dropevents.c in Sources */ = {isa = PBXBuildFile; fileRef = AA704DD5162AA90A0076D1C1 /* SDL_dropevents.c */; };
     1.9  		AA7558981595D55500BBD41B /* begin_code.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558651595D55500BBD41B /* begin_code.h */; };
    1.10  		AA7558991595D55500BBD41B /* close_code.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558661595D55500BBD41B /* close_code.h */; };
    1.11  		AA75589A1595D55500BBD41B /* SDL_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558671595D55500BBD41B /* SDL_assert.h */; };
    1.12 @@ -355,6 +357,8 @@
    1.13  		AA126AD31617C5E6005ABC8F /* SDL_uikitmodes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitmodes.m; sourceTree = "<group>"; };
    1.14  		AA628AD9159369E3005138DD /* SDL_rotate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_rotate.c; sourceTree = "<group>"; };
    1.15  		AA628ADA159369E3005138DD /* SDL_rotate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rotate.h; sourceTree = "<group>"; };
    1.16 +		AA704DD4162AA90A0076D1C1 /* SDL_dropevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_dropevents_c.h; sourceTree = "<group>"; };
    1.17 +		AA704DD5162AA90A0076D1C1 /* SDL_dropevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_dropevents.c; sourceTree = "<group>"; };
    1.18  		AA7558651595D55500BBD41B /* begin_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = begin_code.h; sourceTree = "<group>"; };
    1.19  		AA7558661595D55500BBD41B /* close_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = close_code.h; sourceTree = "<group>"; };
    1.20  		AA7558671595D55500BBD41B /* SDL_assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_assert.h; sourceTree = "<group>"; };
    1.21 @@ -1014,25 +1018,27 @@
    1.22  		FD99B98C0DD52EDC00FB1D6B /* events */ = {
    1.23  			isa = PBXGroup;
    1.24  			children = (
    1.25 -				04BA9D5F11EF474A00B60E01 /* SDL_gesture_c.h */,
    1.26 -				04BA9D6011EF474A00B60E01 /* SDL_gesture.c */,
    1.27 -				04BA9D6111EF474A00B60E01 /* SDL_touch_c.h */,
    1.28 -				04BA9D6211EF474A00B60E01 /* SDL_touch.c */,
    1.29  				FD99B98D0DD52EDC00FB1D6B /* blank_cursor.h */,
    1.30  				FD99B98E0DD52EDC00FB1D6B /* default_cursor.h */,
    1.31  				FD99B98F0DD52EDC00FB1D6B /* scancodes_darwin.h */,
    1.32  				FD99B9900DD52EDC00FB1D6B /* scancodes_linux.h */,
    1.33  				FD99B9920DD52EDC00FB1D6B /* scancodes_xfree86.h */,
    1.34 +				0420496F11E6F03D007E7EC9 /* SDL_clipboardevents.c */,
    1.35  				0420496E11E6F03D007E7EC9 /* SDL_clipboardevents_c.h */,
    1.36 -				0420496F11E6F03D007E7EC9 /* SDL_clipboardevents.c */,
    1.37 +				AA704DD5162AA90A0076D1C1 /* SDL_dropevents.c */,
    1.38 +				AA704DD4162AA90A0076D1C1 /* SDL_dropevents_c.h */,
    1.39  				FD99B9930DD52EDC00FB1D6B /* SDL_events.c */,
    1.40  				FD99B9940DD52EDC00FB1D6B /* SDL_events_c.h */,
    1.41 +				04BA9D6011EF474A00B60E01 /* SDL_gesture.c */,
    1.42 +				04BA9D5F11EF474A00B60E01 /* SDL_gesture_c.h */,
    1.43  				FD99B9950DD52EDC00FB1D6B /* SDL_keyboard.c */,
    1.44  				FD99B9960DD52EDC00FB1D6B /* SDL_keyboard_c.h */,
    1.45  				FD99B9970DD52EDC00FB1D6B /* SDL_mouse.c */,
    1.46  				FD99B9980DD52EDC00FB1D6B /* SDL_mouse_c.h */,
    1.47  				FD99B9990DD52EDC00FB1D6B /* SDL_quit.c */,
    1.48  				FD99B99A0DD52EDC00FB1D6B /* SDL_sysevents.h */,
    1.49 +				04BA9D6211EF474A00B60E01 /* SDL_touch.c */,
    1.50 +				04BA9D6111EF474A00B60E01 /* SDL_touch_c.h */,
    1.51  				FD99B99B0DD52EDC00FB1D6B /* SDL_windowevents.c */,
    1.52  				FD99B99C0DD52EDC00FB1D6B /* SDL_windowevents_c.h */,
    1.53  			);
    1.54 @@ -1241,6 +1247,7 @@
    1.55  				AA7558C91595D55500BBD41B /* SDL_video.h in Headers */,
    1.56  				AA7558CA1595D55500BBD41B /* SDL.h in Headers */,
    1.57  				AA126AD41617C5E7005ABC8F /* SDL_uikitmodes.h in Headers */,
    1.58 +				AA704DD6162AA90A0076D1C1 /* SDL_dropevents_c.h in Headers */,
    1.59  			);
    1.60  			runOnlyForDeploymentPostprocessing = 0;
    1.61  		};
    1.62 @@ -1458,6 +1465,7 @@
    1.63  				93CB792613FC5F5300BD3E05 /* SDL_uikitviewcontroller.m in Sources */,
    1.64  				AA628ADB159369E3005138DD /* SDL_rotate.c in Sources */,
    1.65  				AA126AD51617C5E7005ABC8F /* SDL_uikitmodes.m in Sources */,
    1.66 +				AA704DD7162AA90A0076D1C1 /* SDL_dropevents.c in Sources */,
    1.67  			);
    1.68  			runOnlyForDeploymentPostprocessing = 0;
    1.69  		};
     2.1 --- a/src/video/uikit/SDL_uikitappdelegate.m	Sun Oct 14 00:24:07 2012 -0700
     2.2 +++ b/src/video/uikit/SDL_uikitappdelegate.m	Sun Oct 14 01:05:04 2012 -0700
     2.3 @@ -267,6 +267,17 @@
     2.4      }
     2.5  }
     2.6  
     2.7 +- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
     2.8 +{
     2.9 +    NSURL *fileURL = [url filePathURL];
    2.10 +    if (fileURL != nil) {
    2.11 +        SDL_SendDropFile([[fileURL path] UTF8String]);
    2.12 +    } else {
    2.13 +        SDL_SendDropFile([[url absoluteString] UTF8String]);
    2.14 +    }
    2.15 +    return YES;
    2.16 +}
    2.17 +
    2.18  @end
    2.19  
    2.20  #endif /* SDL_VIDEO_DRIVER_UIKIT */