Merged default into iOS-improvements iOS-improvements
authorAlex Szpakowski <slime73@gmail.com>
Wed, 10 Sep 2014 18:10:37 -0300
branchiOS-improvements
changeset 951677867123589c
parent 9515 63f5d07c7d70
parent 9129 d183503df2e8
child 9517 dbe19a0cad97
Merged default into iOS-improvements
include/SDL_hints.h
     1.1 --- a/CMakeLists.txt	Wed Aug 20 17:20:22 2014 -0300
     1.2 +++ b/CMakeLists.txt	Wed Sep 10 18:10:37 2014 -0300
     1.3 @@ -29,9 +29,9 @@
     1.4  # set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0.
     1.5  set(SDL_MAJOR_VERSION 2)
     1.6  set(SDL_MINOR_VERSION 0)
     1.7 -set(SDL_MICRO_VERSION 3)
     1.8 -set(SDL_INTERFACE_AGE 1)
     1.9 -set(SDL_BINARY_AGE 3)
    1.10 +set(SDL_MICRO_VERSION 4)
    1.11 +set(SDL_INTERFACE_AGE 0)
    1.12 +set(SDL_BINARY_AGE 4)
    1.13  set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}")
    1.14  
    1.15  # Calculate a libtool-like version number
    1.16 @@ -247,6 +247,7 @@
    1.17  set_option(VIDEO_COCOA         "Use Cocoa video driver" ${APPLE})
    1.18  set_option(DIRECTX             "Use DirectX for Windows audio/video" ${WINDOWS})
    1.19  set_option(RENDER_D3D          "Enable the Direct3D render driver" ${WINDOWS})
    1.20 +set_option(VIDEO_MX6           "Use Freescale i.MX6 video driver" OFF)
    1.21  
    1.22  # TODO: We should (should we?) respect cmake's ${BUILD_SHARED_LIBS} flag here
    1.23  # The options below are for compatibility to configure's default behaviour.
    1.24 @@ -678,6 +679,7 @@
    1.25      CheckOpenGLX11()
    1.26      CheckOpenGLESX11()
    1.27      CheckWayland()
    1.28 +    CheckMX6()
    1.29    endif()
    1.30  
    1.31    if(LINUX)
    1.32 @@ -970,6 +972,7 @@
    1.33      set_source_files_properties(${EXTRA_SOURCES} PROPERTIES LANGUAGE C)
    1.34      set(HAVE_SDL_FILE TRUE)
    1.35      set(SDL_FRAMEWORK_COCOA 1)
    1.36 +    set(SDL_FRAMEWORK_COREVIDEO 1)
    1.37    else()
    1.38      message_error("SDL_FILE must be enabled to build on MacOS X")
    1.39    endif()
    1.40 @@ -1029,6 +1032,10 @@
    1.41    endif()
    1.42  
    1.43    # Actually load the frameworks at the end so we don't duplicate include.
    1.44 +  if(SDL_FRAMEWORK_COREVIDEO)
    1.45 +    find_library(COREVIDEO CoreVideo)
    1.46 +    list(APPEND EXTRA_LIBS ${COREVIDEO})
    1.47 +  endif()
    1.48    if(SDL_FRAMEWORK_COCOA)
    1.49      find_library(COCOA_LIBRARY Cocoa)
    1.50      list(APPEND EXTRA_LIBS ${COCOA_LIBRARY})
     2.1 --- a/Xcode/SDL/Info-Framework.plist	Wed Aug 20 17:20:22 2014 -0300
     2.2 +++ b/Xcode/SDL/Info-Framework.plist	Wed Sep 10 18:10:37 2014 -0300
     2.3 @@ -19,10 +19,10 @@
     2.4  	<key>CFBundlePackageType</key>
     2.5  	<string>FMWK</string>
     2.6  	<key>CFBundleShortVersionString</key>
     2.7 -	<string>2.0.3</string>
     2.8 +	<string>2.0.4</string>
     2.9  	<key>CFBundleSignature</key>
    2.10  	<string>SDLX</string>
    2.11  	<key>CFBundleVersion</key>
    2.12 -	<string>2.0.3</string>
    2.13 +	<string>2.0.4</string>
    2.14  </dict>
    2.15  </plist>
     3.1 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj	Wed Aug 20 17:20:22 2014 -0300
     3.2 +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj	Wed Sep 10 18:10:37 2014 -0300
     3.3 @@ -810,6 +810,9 @@
     3.4  		DB31407217554B71006C0E22 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317C10858E15000B2BC32 /* Carbon.framework */; };
     3.5  		DB31408B17554D37006C0E22 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00CFA89C106B4BA100758660 /* ForceFeedback.framework */; };
     3.6  		DB31408D17554D3C006C0E22 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00CFA89C106B4BA100758660 /* ForceFeedback.framework */; };
     3.7 +		FA73671D19A540EF004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73671C19A540EF004122E4 /* CoreVideo.framework */; };
     3.8 +		FA73671E19A54140004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73671C19A540EF004122E4 /* CoreVideo.framework */; };
     3.9 +		FA73671F19A54144004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73671C19A540EF004122E4 /* CoreVideo.framework */; };
    3.10  /* End PBXBuildFile section */
    3.11  
    3.12  /* Begin PBXContainerItemProxy section */
    3.13 @@ -830,7 +833,6 @@
    3.14  		0073179F0858DECD00B2BC32 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
    3.15  		007317C10858E15000B2BC32 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
    3.16  		00794D3F09D0C461003FC8A1 /* License.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = License.txt; sourceTree = "<group>"; };
    3.17 -		00AE6E1E08B958CC00255E2F /* ReadMeDevLite.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = ReadMeDevLite.txt; sourceTree = "<group>"; };
    3.18  		00CFA89C106B4BA100758660 /* ForceFeedback.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ForceFeedback.framework; path = /System/Library/Frameworks/ForceFeedback.framework; sourceTree = "<absolute>"; };
    3.19  		00D0D08310675DD9004B05EF /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
    3.20  		04043BBA12FEB1BE0076DB1F /* SDL_glfuncs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_glfuncs.h; sourceTree = "<group>"; };
    3.21 @@ -1100,15 +1102,10 @@
    3.22  		D55A1B80179F262300625D7C /* SDL_cocoamousetap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoamousetap.m; sourceTree = "<group>"; };
    3.23  		DB31407717554B71006C0E22 /* libSDL2.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libSDL2.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
    3.24  		DB89958518A1A5C50092407C /* SDL_syshaptic_c.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDL_syshaptic_c.h; sourceTree = "<group>"; };
    3.25 -		F59C70FF00D5CB5801000001 /* ReadMe.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = ReadMe.txt; sourceTree = "<group>"; };
    3.26 -		F59C710000D5CB5801000001 /* Welcome.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Welcome.txt; sourceTree = "<group>"; };
    3.27  		F59C710300D5CB5801000001 /* ReadMe.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = ReadMe.txt; sourceTree = "<group>"; };
    3.28 -		F59C710500D5CB5801000001 /* SDL-devel.info */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "SDL-devel.info"; sourceTree = "<group>"; };
    3.29  		F59C710600D5CB5801000001 /* SDL.info */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SDL.info; sourceTree = "<group>"; };
    3.30 -		F59C710C00D5D15801000001 /* install.sh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; path = install.sh; sourceTree = "<group>"; };
    3.31  		F5A2EF3900C6A39A01000001 /* BUGS.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = BUGS.txt; path = ../../BUGS.txt; sourceTree = SOURCE_ROOT; };
    3.32 -		F5A2EF3A00C6A3C201000001 /* README-macosx.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = "README-macosx.txt"; path = "../../README-macosx.txt"; sourceTree = SOURCE_ROOT; };
    3.33 -		F5F81AD400D706B101000001 /* Readme SDL Developer.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = "Readme SDL Developer.txt"; path = "pkg-support/Readme SDL Developer.txt"; sourceTree = SOURCE_ROOT; };
    3.34 +		FA73671C19A540EF004122E4 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = /System/Library/Frameworks/CoreVideo.framework; sourceTree = "<absolute>"; };
    3.35  /* End PBXFileReference section */
    3.36  
    3.37  /* Begin PBXFrameworksBuildPhase section */
    3.38 @@ -1116,6 +1113,7 @@
    3.39  			isa = PBXFrameworksBuildPhase;
    3.40  			buildActionMask = 2147483647;
    3.41  			files = (
    3.42 +				FA73671D19A540EF004122E4 /* CoreVideo.framework in Frameworks */,
    3.43  				007317A20858DECD00B2BC32 /* AudioToolbox.framework in Frameworks */,
    3.44  				007317A30858DECD00B2BC32 /* AudioUnit.framework in Frameworks */,
    3.45  				007317A40858DECD00B2BC32 /* Cocoa.framework in Frameworks */,
    3.46 @@ -1131,6 +1129,7 @@
    3.47  			isa = PBXFrameworksBuildPhase;
    3.48  			buildActionMask = 2147483647;
    3.49  			files = (
    3.50 +				FA73671E19A54140004122E4 /* CoreVideo.framework in Frameworks */,
    3.51  				007317A90858DECD00B2BC32 /* AudioToolbox.framework in Frameworks */,
    3.52  				007317AA0858DECD00B2BC32 /* AudioUnit.framework in Frameworks */,
    3.53  				007317AB0858DECD00B2BC32 /* Cocoa.framework in Frameworks */,
    3.54 @@ -1145,6 +1144,7 @@
    3.55  			isa = PBXFrameworksBuildPhase;
    3.56  			buildActionMask = 2147483647;
    3.57  			files = (
    3.58 +				FA73671F19A54144004122E4 /* CoreVideo.framework in Frameworks */,
    3.59  				DB31406C17554B71006C0E22 /* AudioToolbox.framework in Frameworks */,
    3.60  				DB31406D17554B71006C0E22 /* AudioUnit.framework in Frameworks */,
    3.61  				DB31406E17554B71006C0E22 /* Cocoa.framework in Frameworks */,
    3.62 @@ -1663,7 +1663,6 @@
    3.63  			isa = PBXGroup;
    3.64  			children = (
    3.65  				F5A2EF3900C6A39A01000001 /* BUGS.txt */,
    3.66 -				F5A2EF3A00C6A3C201000001 /* README-macosx.txt */,
    3.67  				F59C70FC00D5CB5801000001 /* pkg-support */,
    3.68  				0153844A006D81B07F000001 /* Public Headers */,
    3.69  				08FB77ACFE841707C02AAC07 /* Library Source */,
    3.70 @@ -1738,6 +1737,7 @@
    3.71  		BEC562FE0761C0E800A33029 /* Linked Frameworks */ = {
    3.72  			isa = PBXGroup;
    3.73  			children = (
    3.74 +				FA73671C19A540EF004122E4 /* CoreVideo.framework */,
    3.75  				00D0D08310675DD9004B05EF /* CoreFoundation.framework */,
    3.76  				007317C10858E15000B2BC32 /* Carbon.framework */,
    3.77  				0073179B0858DECD00B2BC32 /* AudioToolbox.framework */,
    3.78 @@ -1753,30 +1753,16 @@
    3.79  		F59C70FC00D5CB5801000001 /* pkg-support */ = {
    3.80  			isa = PBXGroup;
    3.81  			children = (
    3.82 -				F59C70FE00D5CB5801000001 /* devel-resources */,
    3.83  				F59C710100D5CB5801000001 /* resources */,
    3.84 -				F5F81AD400D706B101000001 /* Readme SDL Developer.txt */,
    3.85 -				F59C710500D5CB5801000001 /* SDL-devel.info */,
    3.86  				F59C710600D5CB5801000001 /* SDL.info */,
    3.87  			);
    3.88  			path = "pkg-support";
    3.89  			sourceTree = SOURCE_ROOT;
    3.90  		};
    3.91 -		F59C70FE00D5CB5801000001 /* devel-resources */ = {
    3.92 -			isa = PBXGroup;
    3.93 -			children = (
    3.94 -				F59C710C00D5D15801000001 /* install.sh */,
    3.95 -				F59C70FF00D5CB5801000001 /* ReadMe.txt */,
    3.96 -				F59C710000D5CB5801000001 /* Welcome.txt */,
    3.97 -			);
    3.98 -			path = "devel-resources";
    3.99 -			sourceTree = "<group>";
   3.100 -		};
   3.101  		F59C710100D5CB5801000001 /* resources */ = {
   3.102  			isa = PBXGroup;
   3.103  			children = (
   3.104  				00794D3F09D0C461003FC8A1 /* License.txt */,
   3.105 -				00AE6E1E08B958CC00255E2F /* ReadMeDevLite.txt */,
   3.106  				F59C710300D5CB5801000001 /* ReadMe.txt */,
   3.107  			);
   3.108  			path = resources;
   3.109 @@ -2807,7 +2793,7 @@
   3.110  			buildSettings = {
   3.111  				CLANG_LINK_OBJC_RUNTIME = NO;
   3.112  				DYLIB_COMPATIBILITY_VERSION = 1.0.0;
   3.113 -				DYLIB_CURRENT_VERSION = 3.1.0;
   3.114 +				DYLIB_CURRENT_VERSION = 5.0.0;
   3.115  				FRAMEWORK_VERSION = A;
   3.116  				HEADER_SEARCH_PATHS = /usr/X11R6/include;
   3.117  				INFOPLIST_FILE = "Info-Framework.plist";
   3.118 @@ -2862,7 +2848,7 @@
   3.119  			buildSettings = {
   3.120  				CLANG_LINK_OBJC_RUNTIME = NO;
   3.121  				DYLIB_COMPATIBILITY_VERSION = 1.0.0;
   3.122 -				DYLIB_CURRENT_VERSION = 3.1.0;
   3.123 +				DYLIB_CURRENT_VERSION = 5.0.0;
   3.124  				FRAMEWORK_VERSION = A;
   3.125  				HEADER_SEARCH_PATHS = /usr/X11R6/include;
   3.126  				INFOPLIST_FILE = "Info-Framework.plist";
     4.1 --- a/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj	Wed Aug 20 17:20:22 2014 -0300
     4.2 +++ b/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj	Wed Sep 10 18:10:37 2014 -0300
     4.3 @@ -555,6 +555,51 @@
     4.4  		DB89957918A19ABA0092407C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
     4.5  		DB89957A18A19ABA0092407C /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
     4.6  		DB89958418A19B130092407C /* testhotplug.c in Sources */ = {isa = PBXBuildFile; fileRef = DB89958318A19B130092407C /* testhotplug.c */; };
     4.7 +		FA73672319A54A90004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
     4.8 +		FA73672819A54AB6004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
     4.9 +		FA73672919A54AB9004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.10 +		FA73672A19A54AC0004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.11 +		FA73672B19A54AC2004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.12 +		FA73672C19A54AC5004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.13 +		FA73672D19A54AC7004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.14 +		FA73672E19A54ACA004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.15 +		FA73672F19A54ACC004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.16 +		FA73673019A54AD0004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.17 +		FA73673119A54AD3004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.18 +		FA73673219A54AD5004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.19 +		FA73673319A54AD8004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.20 +		FA73673419A54ADB004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.21 +		FA73673519A54ADE004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.22 +		FA73673619A54AE1004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.23 +		FA73673719A54AE3004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.24 +		FA73673819A54AE6004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.25 +		FA73673919A54AE8004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.26 +		FA73673A19A54AEB004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.27 +		FA73673B19A54AED004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.28 +		FA73673C19A54AF0004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.29 +		FA73673D19A54AF3004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.30 +		FA73673E19A54AF6004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.31 +		FA73673F19A54AF8004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.32 +		FA73674019A54AFB004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.33 +		FA73674119A54AFE004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.34 +		FA73674219A54B01004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.35 +		FA73674319A54B04004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.36 +		FA73674419A54B06004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.37 +		FA73674519A54B09004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.38 +		FA73674619A54B0B004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.39 +		FA73674719A54B0F004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.40 +		FA73674819A54B13004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.41 +		FA73674919A54B16004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.42 +		FA73674A19A54B19004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.43 +		FA73674B19A54B1B004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.44 +		FA73674C19A54B1F004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.45 +		FA73674D19A54B22004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.46 +		FA73674E19A54B25004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.47 +		FA73674F19A54B28004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.48 +		FA73675019A54B2B004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.49 +		FA73675119A54B2F004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.50 +		FA73675219A54B32004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.51 +		FA73675319A54B35004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73672219A54A90004122E4 /* CoreVideo.framework */; };
    4.52  /* End PBXBuildFile section */
    4.53  
    4.54  /* Begin PBXContainerItemProxy section */
    4.55 @@ -1141,6 +1186,7 @@
    4.56  		DB89957E18A19ABA0092407C /* testhotplug */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testhotplug; sourceTree = BUILT_PRODUCTS_DIR; };
    4.57  		DB89958318A19B130092407C /* testhotplug.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testhotplug.c; path = ../../test/testhotplug.c; sourceTree = "<group>"; };
    4.58  		DBBC552C182831D700F3CA8D /* TestDropFile-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "TestDropFile-Info.plist"; sourceTree = "<group>"; };
    4.59 +		FA73672219A54A90004122E4 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = /System/Library/Frameworks/CoreVideo.framework; sourceTree = "<absolute>"; };
    4.60  /* End PBXFileReference section */
    4.61  
    4.62  /* Begin PBXFrameworksBuildPhase section */
    4.63 @@ -1148,6 +1194,7 @@
    4.64  			isa = PBXFrameworksBuildPhase;
    4.65  			buildActionMask = 2147483647;
    4.66  			files = (
    4.67 +				FA73672919A54AB9004122E4 /* CoreVideo.framework in Frameworks */,
    4.68  				0017957C10741F7900F5D044 /* Cocoa.framework in Frameworks */,
    4.69  				0017957D10741F7900F5D044 /* CoreAudio.framework in Frameworks */,
    4.70  				0017957E10741F7900F5D044 /* ForceFeedback.framework in Frameworks */,
    4.71 @@ -1164,6 +1211,7 @@
    4.72  			isa = PBXFrameworksBuildPhase;
    4.73  			buildActionMask = 2147483647;
    4.74  			files = (
    4.75 +				FA73672A19A54AC0004122E4 /* CoreVideo.framework in Frameworks */,
    4.76  				0017959D107421BF00F5D044 /* Cocoa.framework in Frameworks */,
    4.77  				0017959E107421BF00F5D044 /* CoreAudio.framework in Frameworks */,
    4.78  				0017959F107421BF00F5D044 /* ForceFeedback.framework in Frameworks */,
    4.79 @@ -1180,6 +1228,7 @@
    4.80  			isa = PBXFrameworksBuildPhase;
    4.81  			buildActionMask = 2147483647;
    4.82  			files = (
    4.83 +				FA73673319A54AD8004122E4 /* CoreVideo.framework in Frameworks */,
    4.84  				0017971110742F3200F5D044 /* Cocoa.framework in Frameworks */,
    4.85  				0017971210742F3200F5D044 /* CoreAudio.framework in Frameworks */,
    4.86  				0017971310742F3200F5D044 /* ForceFeedback.framework in Frameworks */,
    4.87 @@ -1197,6 +1246,7 @@
    4.88  			isa = PBXFrameworksBuildPhase;
    4.89  			buildActionMask = 2147483647;
    4.90  			files = (
    4.91 +				FA73673419A54ADB004122E4 /* CoreVideo.framework in Frameworks */,
    4.92  				00179738107430D600F5D044 /* Cocoa.framework in Frameworks */,
    4.93  				00179739107430D600F5D044 /* CoreAudio.framework in Frameworks */,
    4.94  				0017973A107430D600F5D044 /* ForceFeedback.framework in Frameworks */,
    4.95 @@ -1213,6 +1263,7 @@
    4.96  			isa = PBXFrameworksBuildPhase;
    4.97  			buildActionMask = 2147483647;
    4.98  			files = (
    4.99 +				FA73672B19A54AC2004122E4 /* CoreVideo.framework in Frameworks */,
   4.100  				0017975E107431B300F5D044 /* Cocoa.framework in Frameworks */,
   4.101  				0017975F107431B300F5D044 /* CoreAudio.framework in Frameworks */,
   4.102  				00179760107431B300F5D044 /* ForceFeedback.framework in Frameworks */,
   4.103 @@ -1230,6 +1281,7 @@
   4.104  			isa = PBXFrameworksBuildPhase;
   4.105  			buildActionMask = 2147483647;
   4.106  			files = (
   4.107 +				FA73673719A54AE3004122E4 /* CoreVideo.framework in Frameworks */,
   4.108  				0017977E107432AE00F5D044 /* Cocoa.framework in Frameworks */,
   4.109  				0017977F107432AE00F5D044 /* CoreAudio.framework in Frameworks */,
   4.110  				00179780107432AE00F5D044 /* ForceFeedback.framework in Frameworks */,
   4.111 @@ -1247,6 +1299,7 @@
   4.112  			isa = PBXFrameworksBuildPhase;
   4.113  			buildActionMask = 2147483647;
   4.114  			files = (
   4.115 +				FA73673819A54AE6004122E4 /* CoreVideo.framework in Frameworks */,
   4.116  				0017979E1074334C00F5D044 /* Cocoa.framework in Frameworks */,
   4.117  				0017979F1074334C00F5D044 /* CoreAudio.framework in Frameworks */,
   4.118  				001797A01074334C00F5D044 /* ForceFeedback.framework in Frameworks */,
   4.119 @@ -1264,6 +1317,7 @@
   4.120  			isa = PBXFrameworksBuildPhase;
   4.121  			buildActionMask = 2147483647;
   4.122  			files = (
   4.123 +				FA73673B19A54AED004122E4 /* CoreVideo.framework in Frameworks */,
   4.124  				001797C0107433C600F5D044 /* Cocoa.framework in Frameworks */,
   4.125  				001797C1107433C600F5D044 /* CoreAudio.framework in Frameworks */,
   4.126  				001797C2107433C600F5D044 /* ForceFeedback.framework in Frameworks */,
   4.127 @@ -1280,6 +1334,7 @@
   4.128  			isa = PBXFrameworksBuildPhase;
   4.129  			buildActionMask = 2147483647;
   4.130  			files = (
   4.131 +				FA73673E19A54AF6004122E4 /* CoreVideo.framework in Frameworks */,
   4.132  				001798021074355200F5D044 /* Cocoa.framework in Frameworks */,
   4.133  				001798031074355200F5D044 /* CoreAudio.framework in Frameworks */,
   4.134  				001798041074355200F5D044 /* ForceFeedback.framework in Frameworks */,
   4.135 @@ -1296,6 +1351,7 @@
   4.136  			isa = PBXFrameworksBuildPhase;
   4.137  			buildActionMask = 2147483647;
   4.138  			files = (
   4.139 +				FA73673F19A54AF8004122E4 /* CoreVideo.framework in Frameworks */,
   4.140  				001798841074392D00F5D044 /* Cocoa.framework in Frameworks */,
   4.141  				001798851074392D00F5D044 /* CoreAudio.framework in Frameworks */,
   4.142  				001798861074392D00F5D044 /* ForceFeedback.framework in Frameworks */,
   4.143 @@ -1312,6 +1368,7 @@
   4.144  			isa = PBXFrameworksBuildPhase;
   4.145  			buildActionMask = 2147483647;
   4.146  			files = (
   4.147 +				FA73674219A54B01004122E4 /* CoreVideo.framework in Frameworks */,
   4.148  				001798A5107439DF00F5D044 /* Cocoa.framework in Frameworks */,
   4.149  				001798A6107439DF00F5D044 /* CoreAudio.framework in Frameworks */,
   4.150  				001798A7107439DF00F5D044 /* ForceFeedback.framework in Frameworks */,
   4.151 @@ -1328,6 +1385,7 @@
   4.152  			isa = PBXFrameworksBuildPhase;
   4.153  			buildActionMask = 2147483647;
   4.154  			files = (
   4.155 +				FA73674619A54B0B004122E4 /* CoreVideo.framework in Frameworks */,
   4.156  				001798E210743BEC00F5D044 /* Cocoa.framework in Frameworks */,
   4.157  				001798E310743BEC00F5D044 /* CoreAudio.framework in Frameworks */,
   4.158  				001798E410743BEC00F5D044 /* ForceFeedback.framework in Frameworks */,
   4.159 @@ -1344,6 +1402,7 @@
   4.160  			isa = PBXFrameworksBuildPhase;
   4.161  			buildActionMask = 2147483647;
   4.162  			files = (
   4.163 +				FA73674C19A54B1F004122E4 /* CoreVideo.framework in Frameworks */,
   4.164  				0017990610743F1000F5D044 /* Cocoa.framework in Frameworks */,
   4.165  				0017990710743F1000F5D044 /* CoreAudio.framework in Frameworks */,
   4.166  				0017990810743F1000F5D044 /* ForceFeedback.framework in Frameworks */,
   4.167 @@ -1361,6 +1420,7 @@
   4.168  			isa = PBXFrameworksBuildPhase;
   4.169  			buildActionMask = 2147483647;
   4.170  			files = (
   4.171 +				FA73675219A54B32004122E4 /* CoreVideo.framework in Frameworks */,
   4.172  				0017992810743FB700F5D044 /* Cocoa.framework in Frameworks */,
   4.173  				0017992910743FB700F5D044 /* CoreAudio.framework in Frameworks */,
   4.174  				0017992A10743FB700F5D044 /* ForceFeedback.framework in Frameworks */,
   4.175 @@ -1378,6 +1438,7 @@
   4.176  			isa = PBXFrameworksBuildPhase;
   4.177  			buildActionMask = 2147483647;
   4.178  			files = (
   4.179 +				FA73672F19A54ACC004122E4 /* CoreVideo.framework in Frameworks */,
   4.180  				002F340B09CA1BFF00EBEB88 /* Cocoa.framework in Frameworks */,
   4.181  				002A866B10730548007319AE /* CoreAudio.framework in Frameworks */,
   4.182  				002A866C10730548007319AE /* ForceFeedback.framework in Frameworks */,
   4.183 @@ -1394,6 +1455,7 @@
   4.184  			isa = PBXFrameworksBuildPhase;
   4.185  			buildActionMask = 2147483647;
   4.186  			files = (
   4.187 +				FA73673619A54AE1004122E4 /* CoreVideo.framework in Frameworks */,
   4.188  				002F342A09CA1F0300EBEB88 /* Cocoa.framework in Frameworks */,
   4.189  				002A866210730547007319AE /* CoreAudio.framework in Frameworks */,
   4.190  				002A866310730547007319AE /* ForceFeedback.framework in Frameworks */,
   4.191 @@ -1410,6 +1472,7 @@
   4.192  			isa = PBXFrameworksBuildPhase;
   4.193  			buildActionMask = 2147483647;
   4.194  			files = (
   4.195 +				FA73674019A54AFB004122E4 /* CoreVideo.framework in Frameworks */,
   4.196  				002F344609CA1FB300EBEB88 /* Cocoa.framework in Frameworks */,
   4.197  				002A868010730549007319AE /* CoreAudio.framework in Frameworks */,
   4.198  				002A868110730549007319AE /* ForceFeedback.framework in Frameworks */,
   4.199 @@ -1426,6 +1489,7 @@
   4.200  			isa = PBXFrameworksBuildPhase;
   4.201  			buildActionMask = 2147483647;
   4.202  			files = (
   4.203 +				FA73674119A54AFE004122E4 /* CoreVideo.framework in Frameworks */,
   4.204  				002F346309CA204F00EBEB88 /* Cocoa.framework in Frameworks */,
   4.205  				002A868610730549007319AE /* CoreAudio.framework in Frameworks */,
   4.206  				002A868710730549007319AE /* ForceFeedback.framework in Frameworks */,
   4.207 @@ -1442,6 +1506,7 @@
   4.208  			isa = PBXFrameworksBuildPhase;
   4.209  			buildActionMask = 2147483647;
   4.210  			files = (
   4.211 +				FA73674B19A54B1B004122E4 /* CoreVideo.framework in Frameworks */,
   4.212  				DB166D7116A1CFB200A1396C /* AudioToolbox.framework in Frameworks */,
   4.213  				DB166D7216A1CFB200A1396C /* AudioUnit.framework in Frameworks */,
   4.214  				DB166D7316A1CFB200A1396C /* Carbon.framework in Frameworks */,
   4.215 @@ -1459,6 +1524,7 @@
   4.216  			isa = PBXFrameworksBuildPhase;
   4.217  			buildActionMask = 2147483647;
   4.218  			files = (
   4.219 +				FA73673119A54AD3004122E4 /* CoreVideo.framework in Frameworks */,
   4.220  				BBFC08C0164C6862003E6A99 /* Cocoa.framework in Frameworks */,
   4.221  				BBFC08C1164C6862003E6A99 /* CoreAudio.framework in Frameworks */,
   4.222  				BBFC08C2164C6862003E6A99 /* ForceFeedback.framework in Frameworks */,
   4.223 @@ -1475,6 +1541,7 @@
   4.224  			isa = PBXFrameworksBuildPhase;
   4.225  			buildActionMask = 2147483647;
   4.226  			files = (
   4.227 +				FA73672319A54A90004122E4 /* CoreVideo.framework in Frameworks */,
   4.228  				002F33C109CA188600EBEB88 /* Cocoa.framework in Frameworks */,
   4.229  				002A863010730405007319AE /* libSDL2.a in Frameworks */,
   4.230  				002A864D10730546007319AE /* CoreAudio.framework in Frameworks */,
   4.231 @@ -1491,6 +1558,7 @@
   4.232  			isa = PBXFrameworksBuildPhase;
   4.233  			buildActionMask = 2147483647;
   4.234  			files = (
   4.235 +				FA73672819A54AB6004122E4 /* CoreVideo.framework in Frameworks */,
   4.236  				002F33BF09CA188600EBEB88 /* Cocoa.framework in Frameworks */,
   4.237  				002A865310730547007319AE /* CoreAudio.framework in Frameworks */,
   4.238  				002A865410730547007319AE /* ForceFeedback.framework in Frameworks */,
   4.239 @@ -1507,6 +1575,7 @@
   4.240  			isa = PBXFrameworksBuildPhase;
   4.241  			buildActionMask = 2147483647;
   4.242  			files = (
   4.243 +				FA73672E19A54ACA004122E4 /* CoreVideo.framework in Frameworks */,
   4.244  				002F33BC09CA188600EBEB88 /* Cocoa.framework in Frameworks */,
   4.245  				002A866E10730548007319AE /* CoreAudio.framework in Frameworks */,
   4.246  				002A866F10730548007319AE /* ForceFeedback.framework in Frameworks */,
   4.247 @@ -1523,6 +1592,7 @@
   4.248  			isa = PBXFrameworksBuildPhase;
   4.249  			buildActionMask = 2147483647;
   4.250  			files = (
   4.251 +				FA73674F19A54B28004122E4 /* CoreVideo.framework in Frameworks */,
   4.252  				002F33B809CA188600EBEB88 /* Cocoa.framework in Frameworks */,
   4.253  				002A868F1073054A007319AE /* CoreAudio.framework in Frameworks */,
   4.254  				002A86901073054A007319AE /* ForceFeedback.framework in Frameworks */,
   4.255 @@ -1539,6 +1609,7 @@
   4.256  			isa = PBXFrameworksBuildPhase;
   4.257  			buildActionMask = 2147483647;
   4.258  			files = (
   4.259 +				FA73673919A54AE8004122E4 /* CoreVideo.framework in Frameworks */,
   4.260  				002F33B709CA188600EBEB88 /* Cocoa.framework in Frameworks */,
   4.261  				002A867410730548007319AE /* CoreAudio.framework in Frameworks */,
   4.262  				002A867510730548007319AE /* ForceFeedback.framework in Frameworks */,
   4.263 @@ -1555,6 +1626,7 @@
   4.264  			isa = PBXFrameworksBuildPhase;
   4.265  			buildActionMask = 2147483647;
   4.266  			files = (
   4.267 +				FA73673A19A54AEB004122E4 /* CoreVideo.framework in Frameworks */,
   4.268  				002F33B509CA188600EBEB88 /* Cocoa.framework in Frameworks */,
   4.269  				002A867710730548007319AE /* CoreAudio.framework in Frameworks */,
   4.270  				002A867810730548007319AE /* ForceFeedback.framework in Frameworks */,
   4.271 @@ -1571,6 +1643,7 @@
   4.272  			isa = PBXFrameworksBuildPhase;
   4.273  			buildActionMask = 2147483647;
   4.274  			files = (
   4.275 +				FA73673C19A54AF0004122E4 /* CoreVideo.framework in Frameworks */,
   4.276  				002F33B609CA188600EBEB88 /* Cocoa.framework in Frameworks */,
   4.277  				002A867A10730549007319AE /* CoreAudio.framework in Frameworks */,
   4.278  				002A867B10730549007319AE /* ForceFeedback.framework in Frameworks */,
   4.279 @@ -1587,6 +1660,7 @@
   4.280  			isa = PBXFrameworksBuildPhase;
   4.281  			buildActionMask = 2147483647;
   4.282  			files = (
   4.283 +				FA73674919A54B16004122E4 /* CoreVideo.framework in Frameworks */,
   4.284  				002F33B209CA188600EBEB88 /* Cocoa.framework in Frameworks */,
   4.285  				002A868910730549007319AE /* CoreAudio.framework in Frameworks */,
   4.286  				002A868A10730549007319AE /* ForceFeedback.framework in Frameworks */,
   4.287 @@ -1603,6 +1677,7 @@
   4.288  			isa = PBXFrameworksBuildPhase;
   4.289  			buildActionMask = 2147483647;
   4.290  			files = (
   4.291 +				FA73675019A54B2B004122E4 /* CoreVideo.framework in Frameworks */,
   4.292  				002F33B009CA188600EBEB88 /* Cocoa.framework in Frameworks */,
   4.293  				002A86981073054A007319AE /* CoreAudio.framework in Frameworks */,
   4.294  				002A86991073054A007319AE /* ForceFeedback.framework in Frameworks */,
   4.295 @@ -1619,6 +1694,7 @@
   4.296  			isa = PBXFrameworksBuildPhase;
   4.297  			buildActionMask = 2147483647;
   4.298  			files = (
   4.299 +				FA73675119A54B2F004122E4 /* CoreVideo.framework in Frameworks */,
   4.300  				002F33AF09CA188600EBEB88 /* Cocoa.framework in Frameworks */,
   4.301  				002A86951073054A007319AE /* CoreAudio.framework in Frameworks */,
   4.302  				002A86961073054A007319AE /* ForceFeedback.framework in Frameworks */,
   4.303 @@ -1635,6 +1711,7 @@
   4.304  			isa = PBXFrameworksBuildPhase;
   4.305  			buildActionMask = 2147483647;
   4.306  			files = (
   4.307 +				FA73675319A54B35004122E4 /* CoreVideo.framework in Frameworks */,
   4.308  				002F33AA09CA188600EBEB88 /* Cocoa.framework in Frameworks */,
   4.309  				002A864110730546007319AE /* CoreAudio.framework in Frameworks */,
   4.310  				002A864210730546007319AE /* ForceFeedback.framework in Frameworks */,
   4.311 @@ -1651,6 +1728,7 @@
   4.312  			isa = PBXFrameworksBuildPhase;
   4.313  			buildActionMask = 2147483647;
   4.314  			files = (
   4.315 +				FA73672C19A54AC5004122E4 /* CoreVideo.framework in Frameworks */,
   4.316  				DB0F48DD17CA51E5008798C5 /* Cocoa.framework in Frameworks */,
   4.317  				DB0F48DE17CA51E5008798C5 /* CoreAudio.framework in Frameworks */,
   4.318  				DB0F48DF17CA51E5008798C5 /* ForceFeedback.framework in Frameworks */,
   4.319 @@ -1667,6 +1745,7 @@
   4.320  			isa = PBXFrameworksBuildPhase;
   4.321  			buildActionMask = 2147483647;
   4.322  			files = (
   4.323 +				FA73673019A54AD0004122E4 /* CoreVideo.framework in Frameworks */,
   4.324  				DB0F48F317CA5212008798C5 /* Cocoa.framework in Frameworks */,
   4.325  				DB0F48F417CA5212008798C5 /* CoreAudio.framework in Frameworks */,
   4.326  				DB0F48F517CA5212008798C5 /* ForceFeedback.framework in Frameworks */,
   4.327 @@ -1690,6 +1769,7 @@
   4.328  			isa = PBXFrameworksBuildPhase;
   4.329  			buildActionMask = 2147483647;
   4.330  			files = (
   4.331 +				FA73673219A54AD5004122E4 /* CoreVideo.framework in Frameworks */,
   4.332  				DB166DB116A1D2F600A1396C /* Cocoa.framework in Frameworks */,
   4.333  				DB166DB216A1D2F600A1396C /* CoreAudio.framework in Frameworks */,
   4.334  				DB166DB316A1D2F600A1396C /* ForceFeedback.framework in Frameworks */,
   4.335 @@ -1706,6 +1786,7 @@
   4.336  			isa = PBXFrameworksBuildPhase;
   4.337  			buildActionMask = 2147483647;
   4.338  			files = (
   4.339 +				FA73673D19A54AF3004122E4 /* CoreVideo.framework in Frameworks */,
   4.340  				DB166DC816A1D36A00A1396C /* Cocoa.framework in Frameworks */,
   4.341  				DB166DC916A1D36A00A1396C /* CoreAudio.framework in Frameworks */,
   4.342  				DB166DCA16A1D36A00A1396C /* ForceFeedback.framework in Frameworks */,
   4.343 @@ -1722,6 +1803,7 @@
   4.344  			isa = PBXFrameworksBuildPhase;
   4.345  			buildActionMask = 2147483647;
   4.346  			files = (
   4.347 +				FA73674319A54B04004122E4 /* CoreVideo.framework in Frameworks */,
   4.348  				DB166DE016A1D50C00A1396C /* Cocoa.framework in Frameworks */,
   4.349  				DB166DE116A1D50C00A1396C /* CoreAudio.framework in Frameworks */,
   4.350  				DB166DE216A1D50C00A1396C /* ForceFeedback.framework in Frameworks */,
   4.351 @@ -1739,6 +1821,7 @@
   4.352  			isa = PBXFrameworksBuildPhase;
   4.353  			buildActionMask = 2147483647;
   4.354  			files = (
   4.355 +				FA73674419A54B06004122E4 /* CoreVideo.framework in Frameworks */,
   4.356  				DB166DF716A1D57C00A1396C /* Cocoa.framework in Frameworks */,
   4.357  				DB166DF816A1D57C00A1396C /* CoreAudio.framework in Frameworks */,
   4.358  				DB166DF916A1D57C00A1396C /* ForceFeedback.framework in Frameworks */,
   4.359 @@ -1756,6 +1839,7 @@
   4.360  			isa = PBXFrameworksBuildPhase;
   4.361  			buildActionMask = 2147483647;
   4.362  			files = (
   4.363 +				FA73674519A54B09004122E4 /* CoreVideo.framework in Frameworks */,
   4.364  				DB166E0E16A1D5AD00A1396C /* Cocoa.framework in Frameworks */,
   4.365  				DB166E0F16A1D5AD00A1396C /* CoreAudio.framework in Frameworks */,
   4.366  				DB166E1016A1D5AD00A1396C /* ForceFeedback.framework in Frameworks */,
   4.367 @@ -1773,6 +1857,7 @@
   4.368  			isa = PBXFrameworksBuildPhase;
   4.369  			buildActionMask = 2147483647;
   4.370  			files = (
   4.371 +				FA73674719A54B0F004122E4 /* CoreVideo.framework in Frameworks */,
   4.372  				DB166E2B16A1D64D00A1396C /* Cocoa.framework in Frameworks */,
   4.373  				DB166E2C16A1D64D00A1396C /* CoreAudio.framework in Frameworks */,
   4.374  				DB166E2D16A1D64D00A1396C /* ForceFeedback.framework in Frameworks */,
   4.375 @@ -1789,6 +1874,7 @@
   4.376  			isa = PBXFrameworksBuildPhase;
   4.377  			buildActionMask = 2147483647;
   4.378  			files = (
   4.379 +				FA73674819A54B13004122E4 /* CoreVideo.framework in Frameworks */,
   4.380  				DB166E4116A1D69000A1396C /* Cocoa.framework in Frameworks */,
   4.381  				DB166E4216A1D69000A1396C /* CoreAudio.framework in Frameworks */,
   4.382  				DB166E4316A1D69000A1396C /* ForceFeedback.framework in Frameworks */,
   4.383 @@ -1806,6 +1892,7 @@
   4.384  			isa = PBXFrameworksBuildPhase;
   4.385  			buildActionMask = 2147483647;
   4.386  			files = (
   4.387 +				FA73674A19A54B19004122E4 /* CoreVideo.framework in Frameworks */,
   4.388  				DB166E5B16A1D6F300A1396C /* Cocoa.framework in Frameworks */,
   4.389  				DB166E5C16A1D6F300A1396C /* CoreAudio.framework in Frameworks */,
   4.390  				DB166E5D16A1D6F300A1396C /* ForceFeedback.framework in Frameworks */,
   4.391 @@ -1822,6 +1909,7 @@
   4.392  			isa = PBXFrameworksBuildPhase;
   4.393  			buildActionMask = 2147483647;
   4.394  			files = (
   4.395 +				FA73674D19A54B22004122E4 /* CoreVideo.framework in Frameworks */,
   4.396  				DB166E7116A1D78400A1396C /* Cocoa.framework in Frameworks */,
   4.397  				DB166E7216A1D78400A1396C /* CoreAudio.framework in Frameworks */,
   4.398  				DB166E7316A1D78400A1396C /* ForceFeedback.framework in Frameworks */,
   4.399 @@ -1838,6 +1926,7 @@
   4.400  			isa = PBXFrameworksBuildPhase;
   4.401  			buildActionMask = 2147483647;
   4.402  			files = (
   4.403 +				FA73674E19A54B25004122E4 /* CoreVideo.framework in Frameworks */,
   4.404  				DB166E8416A1D78C00A1396C /* Cocoa.framework in Frameworks */,
   4.405  				DB166E8516A1D78C00A1396C /* CoreAudio.framework in Frameworks */,
   4.406  				DB166E8616A1D78C00A1396C /* ForceFeedback.framework in Frameworks */,
   4.407 @@ -1854,6 +1943,7 @@
   4.408  			isa = PBXFrameworksBuildPhase;
   4.409  			buildActionMask = 2147483647;
   4.410  			files = (
   4.411 +				FA73672D19A54AC7004122E4 /* CoreVideo.framework in Frameworks */,
   4.412  				DB445EEA18184B7000B306B0 /* Cocoa.framework in Frameworks */,
   4.413  				DB445EEB18184B7000B306B0 /* CoreAudio.framework in Frameworks */,
   4.414  				DB445EEC18184B7000B306B0 /* ForceFeedback.framework in Frameworks */,
   4.415 @@ -1871,6 +1961,7 @@
   4.416  			isa = PBXFrameworksBuildPhase;
   4.417  			buildActionMask = 2147483647;
   4.418  			files = (
   4.419 +				FA73673519A54ADE004122E4 /* CoreVideo.framework in Frameworks */,
   4.420  				DB89957118A19ABA0092407C /* Cocoa.framework in Frameworks */,
   4.421  				DB89957218A19ABA0092407C /* CoreAudio.framework in Frameworks */,
   4.422  				DB89957318A19ABA0092407C /* ForceFeedback.framework in Frameworks */,
   4.423 @@ -1889,6 +1980,7 @@
   4.424  		002F33A209CA183B00EBEB88 /* Linked Frameworks */ = {
   4.425  			isa = PBXGroup;
   4.426  			children = (
   4.427 +				FA73672219A54A90004122E4 /* CoreVideo.framework */,
   4.428  				002A869F10730593007319AE /* AudioToolbox.framework */,
   4.429  				002A871410730623007319AE /* AudioUnit.framework */,
   4.430  				002A873910730675007319AE /* Carbon.framework */,
     5.1 --- a/cmake/sdlchecks.cmake	Wed Aug 20 17:20:22 2014 -0300
     5.2 +++ b/cmake/sdlchecks.cmake	Wed Sep 10 18:10:37 2014 -0300
     5.3 @@ -601,6 +601,25 @@
     5.4  endmacro(CheckDirectFB)
     5.5  
     5.6  # Requires:
     5.7 +# - n/a
     5.8 +macro(CheckMX6)
     5.9 +  if(VIDEO_MX6)
    5.10 +    check_c_source_compiles("
    5.11 +        #define EGL_API_FB
    5.12 +        #include <EGL/eglvivante.h>
    5.13 +        int main(int argc, char** argv) {}" HAVE_VIDEO_OPENGL_EGL_VIVANTE)
    5.14 +    if(HAVE_VIDEO_OPENGL_EGL_VIVANTE)
    5.15 +      set(HAVE_VIDEO_MX6 TRUE)
    5.16 +      set(HAVE_SDL_VIDEO TRUE)
    5.17 +
    5.18 +      file(GLOB MX6_SOURCES ${SDL2_SOURCE_DIR}/src/video/mx6/*.c)
    5.19 +      set(SOURCE_FILES ${SOURCE_FILES} ${MX6_SOURCES})
    5.20 +      set(SDL_VIDEO_DRIVER_MX6 1)
    5.21 +    endif(HAVE_VIDEO_OPENGL_EGL_VIVANTE)
    5.22 +  endif(VIDEO_MX6)
    5.23 +endmacro(CheckMX6)
    5.24 +
    5.25 +# Requires:
    5.26  # - nada
    5.27  macro(CheckOpenGLX11)
    5.28    if(VIDEO_OPENGL)
    5.29 @@ -624,6 +643,7 @@
    5.30  macro(CheckOpenGLESX11)
    5.31    if(VIDEO_OPENGLES)
    5.32      check_c_source_compiles("
    5.33 +        #define EGL_API_FB
    5.34          #include <EGL/egl.h>
    5.35          int main (int argc, char** argv) {}" HAVE_VIDEO_OPENGL_EGL)
    5.36      if(HAVE_VIDEO_OPENGL_EGL)
     6.1 --- a/configure	Wed Aug 20 17:20:22 2014 -0300
     6.2 +++ b/configure	Wed Sep 10 18:10:37 2014 -0300
     6.3 @@ -832,6 +832,7 @@
     6.4  enable_video_x11_scrnsaver
     6.5  enable_video_x11_xshape
     6.6  enable_video_x11_vm
     6.7 +enable_video_mx6
     6.8  enable_video_cocoa
     6.9  enable_video_directfb
    6.10  enable_directfb_shared
    6.11 @@ -1561,6 +1562,7 @@
    6.12    --enable-video-x11-xshape
    6.13                            enable X11 XShape support [[default=yes]]
    6.14    --enable-video-x11-vm   use X11 VM extension for fullscreen [[default=yes]]
    6.15 +  --enable-video-mx6      use Freescale i.MX6 video driver [[default=no]]
    6.16    --enable-video-cocoa    use Cocoa video driver [[default=yes]]
    6.17    --enable-video-directfb use DirectFB video driver [[default=no]]
    6.18    --enable-directfb-shared
    6.19 @@ -2673,9 +2675,9 @@
    6.20  #
    6.21  SDL_MAJOR_VERSION=2
    6.22  SDL_MINOR_VERSION=0
    6.23 -SDL_MICRO_VERSION=3
    6.24 -SDL_INTERFACE_AGE=1
    6.25 -SDL_BINARY_AGE=3
    6.26 +SDL_MICRO_VERSION=4
    6.27 +SDL_INTERFACE_AGE=0
    6.28 +SDL_BINARY_AGE=4
    6.29  SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
    6.30  
    6.31  
    6.32 @@ -20591,6 +20593,53 @@
    6.33      fi
    6.34  }
    6.35  
    6.36 +CheckMX6Video()
    6.37 +{
    6.38 +    # Check whether --enable-video-mx6 was given.
    6.39 +if test "${enable_video_mx6+set}" = set; then :
    6.40 +  enableval=$enable_video_mx6;
    6.41 +else
    6.42 +  enable_video_mx6=no
    6.43 +fi
    6.44 +
    6.45 +    if test x$enable_video = xyes -a x$enable_video_mx6 = xyes; then
    6.46 +        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Vivante GPU SDK" >&5
    6.47 +$as_echo_n "checking for Vivante GPU SDK... " >&6; }
    6.48 +        have_viv_sdk=no
    6.49 +        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    6.50 +/* end confdefs.h.  */
    6.51 +
    6.52 +          #define EGL_API_FB
    6.53 +          #include <EGL/eglvivante.h>
    6.54 +
    6.55 +int
    6.56 +main ()
    6.57 +{
    6.58 +
    6.59 +
    6.60 +  ;
    6.61 +  return 0;
    6.62 +}
    6.63 +_ACEOF
    6.64 +if ac_fn_c_try_compile "$LINENO"; then :
    6.65 +
    6.66 +        have_viv_sdk=yes
    6.67 +
    6.68 +fi
    6.69 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    6.70 +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_viv_sdk" >&5
    6.71 +$as_echo "$have_viv_sdk" >&6; }
    6.72 +        if test x$have_viv_sdk = xyes; then
    6.73 +
    6.74 +$as_echo "#define SDL_VIDEO_DRIVER_MX6 1" >>confdefs.h
    6.75 +
    6.76 +            SOURCES="$SOURCES $srcdir/src/video/mx6/*.c"
    6.77 +            SUMMARY_video="${SUMMARY_video} mx6"
    6.78 +            have_video=yes
    6.79 +        fi
    6.80 +    fi
    6.81 +}
    6.82 +
    6.83  CheckHaikuVideo()
    6.84  {
    6.85      if test x$enable_video = xyes; then
    6.86 @@ -21044,6 +21093,7 @@
    6.87          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    6.88  /* end confdefs.h.  */
    6.89  
    6.90 +         #define EGL_API_FB
    6.91           #include <EGL/egl.h>
    6.92           #include <EGL/eglext.h>
    6.93  
    6.94 @@ -22818,6 +22868,7 @@
    6.95          CheckClockGettime
    6.96          CheckLinuxVersion
    6.97          CheckRPATH
    6.98 +        CheckMX6Video
    6.99          # Set up files for the audio library
   6.100          if test x$enable_audio = xyes; then
   6.101            case $ARCH in
   6.102 @@ -23338,6 +23389,7 @@
   6.103          # The Mac OS X platform requires special setup.
   6.104          EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings"
   6.105          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lobjc"
   6.106 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreVideo"
   6.107          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
   6.108          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
   6.109          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
     7.1 --- a/configure.in	Wed Aug 20 17:20:22 2014 -0300
     7.2 +++ b/configure.in	Wed Sep 10 18:10:37 2014 -0300
     7.3 @@ -20,9 +20,9 @@
     7.4  #
     7.5  SDL_MAJOR_VERSION=2
     7.6  SDL_MINOR_VERSION=0
     7.7 -SDL_MICRO_VERSION=3
     7.8 -SDL_INTERFACE_AGE=1
     7.9 -SDL_BINARY_AGE=3
    7.10 +SDL_MICRO_VERSION=4
    7.11 +SDL_INTERFACE_AGE=0
    7.12 +SDL_BINARY_AGE=4
    7.13  SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
    7.14  
    7.15  AC_SUBST(SDL_MAJOR_VERSION)
    7.16 @@ -1729,6 +1729,32 @@
    7.17      fi
    7.18  }
    7.19  
    7.20 +dnl Set up the MX6 video driver if enabled
    7.21 +CheckMX6Video()
    7.22 +{
    7.23 +    AC_ARG_ENABLE(video-mx6,
    7.24 +AC_HELP_STRING([--enable-video-mx6], [use Freescale i.MX6 video driver [[default=no]]]),
    7.25 +                  , enable_video_mx6=no)
    7.26 +    if test x$enable_video = xyes -a x$enable_video_mx6 = xyes; then
    7.27 +        AC_MSG_CHECKING(for Vivante GPU SDK)
    7.28 +        have_viv_sdk=no
    7.29 +        AC_TRY_COMPILE([
    7.30 +          #define EGL_API_FB
    7.31 +          #include <EGL/eglvivante.h>
    7.32 +        ],[
    7.33 +        ],[
    7.34 +        have_viv_sdk=yes
    7.35 +        ])
    7.36 +        AC_MSG_RESULT($have_viv_sdk)
    7.37 +        if test x$have_viv_sdk = xyes; then
    7.38 +            AC_DEFINE(SDL_VIDEO_DRIVER_MX6, 1, [ ])
    7.39 +            SOURCES="$SOURCES $srcdir/src/video/mx6/*.c"
    7.40 +            SUMMARY_video="${SUMMARY_video} mx6"
    7.41 +            have_video=yes
    7.42 +        fi
    7.43 +    fi
    7.44 +}
    7.45 +
    7.46  dnl Set up the Haiku video driver if enabled
    7.47  CheckHaikuVideo()
    7.48  {
    7.49 @@ -1955,6 +1981,7 @@
    7.50          AC_MSG_CHECKING(for EGL support)
    7.51          video_opengl_egl=no
    7.52          AC_TRY_COMPILE([
    7.53 +         #define EGL_API_FB
    7.54           #include <EGL/egl.h>
    7.55           #include <EGL/eglext.h>
    7.56          ],[
    7.57 @@ -2809,6 +2836,7 @@
    7.58          CheckClockGettime
    7.59          CheckLinuxVersion
    7.60          CheckRPATH
    7.61 +        CheckMX6Video
    7.62          # Set up files for the audio library
    7.63          if test x$enable_audio = xyes; then
    7.64            case $ARCH in
    7.65 @@ -3215,6 +3243,7 @@
    7.66          # The Mac OS X platform requires special setup.
    7.67          EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings"
    7.68          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lobjc"
    7.69 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreVideo"
    7.70          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
    7.71          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
    7.72          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
     8.1 --- a/docs/README-linux.md	Wed Aug 20 17:20:22 2014 -0300
     8.2 +++ b/docs/README-linux.md	Wed Sep 10 18:10:37 2014 -0300
     8.3 @@ -19,7 +19,7 @@
     8.4  libtool libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev \
     8.5  libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev \
     8.6  libxss-dev libgl1-mesa-dev libesd0-dev libdbus-1-dev libudev-dev \
     8.7 -libgles1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev
     8.8 +libgles1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libibus-1.0-dev
     8.9  
    8.10  Ubuntu 14.04 can also add "libwayland-dev libmirclient-dev libxkbcommon-dev"
    8.11  to that command line for Wayland and Mir support.
     9.1 --- a/docs/doxyfile	Wed Aug 20 17:20:22 2014 -0300
     9.2 +++ b/docs/doxyfile	Wed Sep 10 18:10:37 2014 -0300
     9.3 @@ -31,7 +31,7 @@
     9.4  # This could be handy for archiving the generated documentation or 
     9.5  # if some version control system is used.
     9.6  
     9.7 -PROJECT_NUMBER         = 2.0.0
     9.8 +PROJECT_NUMBER         = 2.0
     9.9  
    9.10  # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
    9.11  # base path where the generated documentation will be put. 
    10.1 --- a/include/SDL_config.h.cmake	Wed Aug 20 17:20:22 2014 -0300
    10.2 +++ b/include/SDL_config.h.cmake	Wed Sep 10 18:10:37 2014 -0300
    10.3 @@ -264,6 +264,7 @@
    10.4  #cmakedefine SDL_VIDEO_DRIVER_WINDOWS @SDL_VIDEO_DRIVER_WINDOWS@
    10.5  #cmakedefine SDL_VIDEO_DRIVER_WAYLAND @SDL_VIDEO_DRIVER_WAYLAND@
    10.6  #cmakedefine SDL_VIDEO_DRIVER_RPI @SDL_VIDEO_DRIVER_RPI@
    10.7 +#cmakedefine SDL_VIDEO_DRIVER_MX6 @SDL_VIDEO_DRIVER_MX6@
    10.8  
    10.9  #if 0
   10.10  /* !!! FIXME: in configure script version, missing here: */
    11.1 --- a/include/SDL_config.h.in	Wed Aug 20 17:20:22 2014 -0300
    11.2 +++ b/include/SDL_config.h.in	Wed Sep 10 18:10:37 2014 -0300
    11.3 @@ -308,6 +308,7 @@
    11.4  #undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY
    11.5  #undef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM
    11.6  #undef SDL_VIDEO_DRIVER_NACL
    11.7 +#undef SDL_VIDEO_DRIVER_MX6
    11.8  
    11.9  #undef SDL_VIDEO_RENDER_D3D
   11.10  #undef SDL_VIDEO_RENDER_D3D11
    12.1 --- a/include/SDL_hints.h	Wed Aug 20 17:20:22 2014 -0300
    12.2 +++ b/include/SDL_hints.h	Wed Sep 10 18:10:37 2014 -0300
    12.3 @@ -479,14 +479,13 @@
    12.4  #define SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION"
    12.5  
    12.6  /**
    12.7 - * \brief A variable to control whether certain IMs should handle text editing internally instead of sending TEXTEDITING events.
    12.8 - *
    12.9 + * \brief A variable to control whether certain IMEs should handle text editing internally instead of sending SDL_TEXTEDITING events.
   12.10   *
   12.11   * The variable can be set to the following values:
   12.12 - *   "0"       - TEXTEDITING events are sent, and it is the application's
   12.13 + *   "0"       - SDL_TEXTEDITING events are sent, and it is the application's
   12.14   *               responsibility to render the text from these events and 
   12.15   *               differentiate it somehow from committed text. (default)
   12.16 - *   "1"       - If supported by the IM then TEXTEDITING events are not sent, 
   12.17 + *   "1"       - If supported by the IME then SDL_TEXTEDITING events are not sent, 
   12.18   *               and text that is being composed will be rendered in its own UI.
   12.19   */
   12.20  #define SDL_HINT_IME_INTERNAL_EDITING "SDL_IME_INTERNAL_EDITING"
    13.1 --- a/include/SDL_thread.h	Wed Aug 20 17:20:22 2014 -0300
    13.2 +++ b/include/SDL_thread.h	Wed Sep 10 18:10:37 2014 -0300
    13.3 @@ -233,9 +233,9 @@
    13.4   *          if (!thread_local_storage) {
    13.5   *              thread_local_storage = SDL_TLSCreate();
    13.6   *          }
    13.7 - *          SDL_AtomicUnLock(&tls_lock);
    13.8 + *          SDL_AtomicUnlock(&tls_lock);
    13.9   *      }
   13.10 - *      SDL_TLSSet(thread_local_storage, value);
   13.11 + *      SDL_TLSSet(thread_local_storage, value, 0);
   13.12   *  }
   13.13   *  
   13.14   *  void *GetMyThreadData(void)
    14.1 --- a/include/SDL_version.h	Wed Aug 20 17:20:22 2014 -0300
    14.2 +++ b/include/SDL_version.h	Wed Sep 10 18:10:37 2014 -0300
    14.3 @@ -59,7 +59,7 @@
    14.4  */
    14.5  #define SDL_MAJOR_VERSION   2
    14.6  #define SDL_MINOR_VERSION   0
    14.7 -#define SDL_PATCHLEVEL      3
    14.8 +#define SDL_PATCHLEVEL      4
    14.9  
   14.10  /**
   14.11   *  \brief Macro to determine SDL version program was compiled against.
    15.1 --- a/premake/README-macosx.txt	Wed Aug 20 17:20:22 2014 -0300
    15.2 +++ b/premake/README-macosx.txt	Wed Sep 10 18:10:37 2014 -0300
    15.3 @@ -17,6 +17,7 @@
    15.4  
    15.5  The Mac OS X projects currently have reliance on the following dependencies:
    15.6  
    15.7 +  -CoreVideo.framework
    15.8    -AudioToolbox.framework
    15.9    -AudioUnit.framework
   15.10    -Cocoa.framework
    16.1 --- a/premake/projects/SDL2.lua	Wed Aug 20 17:20:22 2014 -0300
    16.2 +++ b/premake/projects/SDL2.lua	Wed Sep 10 18:10:37 2014 -0300
    16.3 @@ -213,6 +213,7 @@
    16.4  		}
    16.5  		SDL_links
    16.6  		{
    16.7 +			"CoreVideo.framework",
    16.8  			"AudioToolbox.framework",
    16.9  			"AudioUnit.framework",
   16.10  			"Cocoa.framework",
    17.1 --- a/src/core/linux/SDL_ibus.c	Wed Aug 20 17:20:22 2014 -0300
    17.2 +++ b/src/core/linux/SDL_ibus.c	Wed Sep 10 18:10:37 2014 -0300
    17.3 @@ -54,14 +54,14 @@
    17.4      SDL_Keymod sdl_mods = SDL_GetModState();
    17.5      
    17.6      /* Not sure about MOD3, MOD4 and HYPER mappings */
    17.7 -    if(sdl_mods & KMOD_LSHIFT) ibus_mods |= IBUS_SHIFT_MASK;
    17.8 -    if(sdl_mods & KMOD_CAPS)   ibus_mods |= IBUS_LOCK_MASK;
    17.9 -    if(sdl_mods & KMOD_LCTRL)  ibus_mods |= IBUS_CONTROL_MASK;
   17.10 -    if(sdl_mods & KMOD_LALT)   ibus_mods |= IBUS_MOD1_MASK;
   17.11 -    if(sdl_mods & KMOD_NUM)    ibus_mods |= IBUS_MOD2_MASK;
   17.12 -    if(sdl_mods & KMOD_MODE)   ibus_mods |= IBUS_MOD5_MASK;
   17.13 -    if(sdl_mods & KMOD_LGUI)   ibus_mods |= IBUS_SUPER_MASK;
   17.14 -    if(sdl_mods & KMOD_RGUI)   ibus_mods |= IBUS_META_MASK;
   17.15 +    if (sdl_mods & KMOD_LSHIFT) ibus_mods |= IBUS_SHIFT_MASK;
   17.16 +    if (sdl_mods & KMOD_CAPS)   ibus_mods |= IBUS_LOCK_MASK;
   17.17 +    if (sdl_mods & KMOD_LCTRL)  ibus_mods |= IBUS_CONTROL_MASK;
   17.18 +    if (sdl_mods & KMOD_LALT)   ibus_mods |= IBUS_MOD1_MASK;
   17.19 +    if (sdl_mods & KMOD_NUM)    ibus_mods |= IBUS_MOD2_MASK;
   17.20 +    if (sdl_mods & KMOD_MODE)   ibus_mods |= IBUS_MOD5_MASK;
   17.21 +    if (sdl_mods & KMOD_LGUI)   ibus_mods |= IBUS_SUPER_MASK;
   17.22 +    if (sdl_mods & KMOD_RGUI)   ibus_mods |= IBUS_META_MASK;
   17.23  
   17.24      return ibus_mods;
   17.25  }
   17.26 @@ -71,34 +71,34 @@
   17.27  {
   17.28      /* The text we need is nested weirdly, use dbus-monitor to see the structure better */
   17.29      const char *text = NULL;
   17.30 +    const char *struct_id = NULL;
   17.31      DBusMessageIter sub1, sub2;
   17.32  
   17.33 -    if(dbus->message_iter_get_arg_type(iter) != DBUS_TYPE_VARIANT){
   17.34 +    if (dbus->message_iter_get_arg_type(iter) != DBUS_TYPE_VARIANT) {
   17.35          return NULL;
   17.36      }
   17.37      
   17.38      dbus->message_iter_recurse(iter, &sub1);
   17.39      
   17.40 -    if(dbus->message_iter_get_arg_type(&sub1) != DBUS_TYPE_STRUCT){
   17.41 +    if (dbus->message_iter_get_arg_type(&sub1) != DBUS_TYPE_STRUCT) {
   17.42          return NULL;
   17.43      }
   17.44      
   17.45      dbus->message_iter_recurse(&sub1, &sub2);
   17.46      
   17.47 -    if(dbus->message_iter_get_arg_type(&sub2) != DBUS_TYPE_STRING){
   17.48 +    if (dbus->message_iter_get_arg_type(&sub2) != DBUS_TYPE_STRING) {
   17.49          return NULL;
   17.50      }
   17.51      
   17.52 -    const char *struct_id = NULL;
   17.53      dbus->message_iter_get_basic(&sub2, &struct_id);
   17.54 -    if(!struct_id || SDL_strncmp(struct_id, "IBusText", sizeof("IBusText")) != 0){
   17.55 +    if (!struct_id || SDL_strncmp(struct_id, "IBusText", sizeof("IBusText")) != 0) {
   17.56          return NULL;
   17.57      }
   17.58      
   17.59      dbus->message_iter_next(&sub2);
   17.60      dbus->message_iter_next(&sub2);
   17.61      
   17.62 -    if(dbus->message_iter_get_arg_type(&sub2) != DBUS_TYPE_STRING){
   17.63 +    if (dbus->message_iter_get_arg_type(&sub2) != DBUS_TYPE_STRING) {
   17.64          return NULL;
   17.65      }
   17.66      
   17.67 @@ -113,8 +113,8 @@
   17.68      size_t utf8_len = 0;
   17.69      const char *p;
   17.70      
   17.71 -    for(p = str; *p; ++p){
   17.72 -        if(!((*p & 0x80) && !(*p & 0x40))){
   17.73 +    for (p = str; *p; ++p) {
   17.74 +        if (!((*p & 0x80) && !(*p & 0x40))) {
   17.75              ++utf8_len;
   17.76          }
   17.77      }
   17.78 @@ -127,16 +127,18 @@
   17.79  {
   17.80      SDL_DBusContext *dbus = (SDL_DBusContext *)user_data;
   17.81          
   17.82 -    if(dbus->message_is_signal(msg, IBUS_INPUT_INTERFACE, "CommitText")){
   17.83 +    if (dbus->message_is_signal(msg, IBUS_INPUT_INTERFACE, "CommitText")) {
   17.84          DBusMessageIter iter;
   17.85 +        const char *text;
   17.86 +
   17.87          dbus->message_iter_init(msg, &iter);
   17.88          
   17.89 -        const char *text = IBus_GetVariantText(conn, &iter, dbus);
   17.90 -        if(text && *text){
   17.91 +        text = IBus_GetVariantText(conn, &iter, dbus);
   17.92 +        if (text && *text) {
   17.93              char buf[SDL_TEXTEDITINGEVENT_TEXT_SIZE];
   17.94              size_t text_bytes = SDL_strlen(text), i = 0;
   17.95              
   17.96 -            while(i < text_bytes){
   17.97 +            while (i < text_bytes) {
   17.98                  size_t sz = SDL_utf8strlcpy(buf, text+i, sizeof(buf));
   17.99                  SDL_SendKeyboardText(buf);
  17.100                  
  17.101 @@ -147,17 +149,19 @@
  17.102          return DBUS_HANDLER_RESULT_HANDLED;
  17.103      }
  17.104      
  17.105 -    if(dbus->message_is_signal(msg, IBUS_INPUT_INTERFACE, "UpdatePreeditText")){
  17.106 +    if (dbus->message_is_signal(msg, IBUS_INPUT_INTERFACE, "UpdatePreeditText")) {
  17.107          DBusMessageIter iter;
  17.108 +        const char *text;
  17.109 +
  17.110          dbus->message_iter_init(msg, &iter);
  17.111 -        const char *text = IBus_GetVariantText(conn, &iter, dbus);
  17.112 +        text = IBus_GetVariantText(conn, &iter, dbus);
  17.113          
  17.114 -        if(text && *text){
  17.115 +        if (text && *text) {
  17.116              char buf[SDL_TEXTEDITINGEVENT_TEXT_SIZE];
  17.117              size_t text_bytes = SDL_strlen(text), i = 0;
  17.118              size_t cursor = 0;
  17.119              
  17.120 -            while(i < text_bytes){
  17.121 +            while (i < text_bytes) {
  17.122                  size_t sz = SDL_utf8strlcpy(buf, text+i, sizeof(buf));
  17.123                  size_t chars = IBus_utf8_strlen(buf);
  17.124                  
  17.125 @@ -173,9 +177,9 @@
  17.126          return DBUS_HANDLER_RESULT_HANDLED;
  17.127      }
  17.128      
  17.129 -    if(dbus->message_is_signal(msg, IBUS_INPUT_INTERFACE, "HidePreeditText")){
  17.130 -    	SDL_SendEditingText("", 0, 0);
  17.131 -    	return DBUS_HANDLER_RESULT_HANDLED;
  17.132 +    if (dbus->message_is_signal(msg, IBUS_INPUT_INTERFACE, "HidePreeditText")) {
  17.133 +        SDL_SendEditingText("", 0, 0);
  17.134 +        return DBUS_HANDLER_RESULT_HANDLED;
  17.135      }
  17.136      
  17.137      return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
  17.138 @@ -184,19 +188,20 @@
  17.139  static char *
  17.140  IBus_ReadAddressFromFile(const char *file_path)
  17.141  {
  17.142 -    FILE *addr_file = fopen(file_path, "r");
  17.143 -    if(!addr_file){
  17.144 +    char addr_buf[1024];
  17.145 +    SDL_bool success = SDL_FALSE;
  17.146 +    FILE *addr_file;
  17.147 +
  17.148 +    addr_file = fopen(file_path, "r");
  17.149 +    if (!addr_file) {
  17.150          return NULL;
  17.151      }
  17.152  
  17.153 -    char addr_buf[1024];
  17.154 -    SDL_bool success = SDL_FALSE;
  17.155 -
  17.156 -    while(fgets(addr_buf, sizeof(addr_buf), addr_file)){
  17.157 -        if(SDL_strncmp(addr_buf, "IBUS_ADDRESS=", sizeof("IBUS_ADDRESS=")-1) == 0){
  17.158 +    while (fgets(addr_buf, sizeof(addr_buf), addr_file)) {
  17.159 +        if (SDL_strncmp(addr_buf, "IBUS_ADDRESS=", sizeof("IBUS_ADDRESS=")-1) == 0) {
  17.160              size_t sz = SDL_strlen(addr_buf);
  17.161 -            if(addr_buf[sz-1] == '\n') addr_buf[sz-1] = 0;
  17.162 -            if(addr_buf[sz-2] == '\r') addr_buf[sz-2] = 0;
  17.163 +            if (addr_buf[sz-1] == '\n') addr_buf[sz-1] = 0;
  17.164 +            if (addr_buf[sz-2] == '\r') addr_buf[sz-2] = 0;
  17.165              success = SDL_TRUE;
  17.166              break;
  17.167          }
  17.168 @@ -204,7 +209,7 @@
  17.169  
  17.170      fclose(addr_file);
  17.171  
  17.172 -    if(success){
  17.173 +    if (success) {
  17.174          return SDL_strdup(addr_buf + (sizeof("IBUS_ADDRESS=") - 1));
  17.175      } else {
  17.176          return NULL;
  17.177 @@ -214,38 +219,47 @@
  17.178  static char *
  17.179  IBus_GetDBusAddressFilename(void)
  17.180  {
  17.181 -    if(ibus_addr_file){
  17.182 +    SDL_DBusContext *dbus;
  17.183 +    const char *disp_env;
  17.184 +    char config_dir[PATH_MAX];
  17.185 +    char *display = NULL;
  17.186 +    const char *addr;
  17.187 +    const char *conf_env;
  17.188 +    char *key;
  17.189 +    char file_path[PATH_MAX];
  17.190 +    const char *host;
  17.191 +    char *disp_num, *screen_num;
  17.192 +
  17.193 +    if (ibus_addr_file) {
  17.194          return SDL_strdup(ibus_addr_file);
  17.195      }
  17.196      
  17.197 -    SDL_DBusContext *dbus = SDL_DBus_GetContext();
  17.198 -    
  17.199 -    if(!dbus){
  17.200 +    dbus = SDL_DBus_GetContext();
  17.201 +    if (!dbus) {
  17.202          return NULL;
  17.203      }
  17.204      
  17.205      /* Use this environment variable if it exists. */
  17.206 -    const char *addr = SDL_getenv("IBUS_ADDRESS");
  17.207 -    if(addr && *addr){
  17.208 +    addr = SDL_getenv("IBUS_ADDRESS");
  17.209 +    if (addr && *addr) {
  17.210          return SDL_strdup(addr);
  17.211      }
  17.212      
  17.213      /* Otherwise, we have to get the hostname, display, machine id, config dir
  17.214         and look up the address from a filepath using all those bits, eek. */
  17.215 -    const char *disp_env = SDL_getenv("DISPLAY");
  17.216 -    char *display = NULL;
  17.217 -    
  17.218 -    if(!disp_env || !*disp_env){
  17.219 +    disp_env = SDL_getenv("DISPLAY");
  17.220 +
  17.221 +    if (!disp_env || !*disp_env) {
  17.222          display = SDL_strdup(":0.0");
  17.223      } else {
  17.224          display = SDL_strdup(disp_env);
  17.225      }
  17.226      
  17.227 -    const char *host = display;
  17.228 -    char *disp_num   = SDL_strrchr(display, ':'), 
  17.229 -         *screen_num = SDL_strrchr(display, '.');
  17.230 +    host = display;
  17.231 +    disp_num   = SDL_strrchr(display, ':');
  17.232 +    screen_num = SDL_strrchr(display, '.');
  17.233      
  17.234 -    if(!disp_num){
  17.235 +    if (!disp_num) {
  17.236          SDL_free(display);
  17.237          return NULL;
  17.238      }
  17.239 @@ -253,32 +267,30 @@
  17.240      *disp_num = 0;
  17.241      disp_num++;
  17.242      
  17.243 -    if(screen_num){
  17.244 +    if (screen_num) {
  17.245          *screen_num = 0;
  17.246      }
  17.247      
  17.248 -    if(!*host){
  17.249 +    if (!*host) {
  17.250          host = "unix";
  17.251      }
  17.252          
  17.253 -    char config_dir[PATH_MAX];
  17.254      SDL_memset(config_dir, 0, sizeof(config_dir));
  17.255      
  17.256 -    const char *conf_env = SDL_getenv("XDG_CONFIG_HOME");
  17.257 -    if(conf_env && *conf_env){
  17.258 +    conf_env = SDL_getenv("XDG_CONFIG_HOME");
  17.259 +    if (conf_env && *conf_env) {
  17.260          SDL_strlcpy(config_dir, conf_env, sizeof(config_dir));
  17.261      } else {
  17.262          const char *home_env = SDL_getenv("HOME");
  17.263 -        if(!home_env || !*home_env){
  17.264 +        if (!home_env || !*home_env) {
  17.265              SDL_free(display);
  17.266              return NULL;
  17.267          }
  17.268          SDL_snprintf(config_dir, sizeof(config_dir), "%s/.config", home_env);
  17.269      }
  17.270      
  17.271 -    char *key = dbus->get_local_machine_id();
  17.272 -    
  17.273 -    char file_path[PATH_MAX];
  17.274 +    key = dbus->get_local_machine_id();
  17.275 +
  17.276      SDL_memset(file_path, 0, sizeof(file_path));
  17.277      SDL_snprintf(file_path, sizeof(file_path), "%s/ibus/bus/%s-%s-%s", 
  17.278                                                 config_dir, key, host, disp_num);
  17.279 @@ -296,15 +308,15 @@
  17.280  {
  17.281      SDL_DBusContext *dbus = SDL_DBus_GetContext();
  17.282      
  17.283 -    if(IBus_CheckConnection(dbus)){
  17.284 +    if (IBus_CheckConnection(dbus)) {
  17.285  
  17.286          DBusMessage *msg = dbus->message_new_method_call(IBUS_SERVICE,
  17.287                                                           input_ctx_path,
  17.288                                                           IBUS_INPUT_INTERFACE,
  17.289                                                           "SetCapabilities");
  17.290 -        if(msg){
  17.291 +        if (msg) {
  17.292              Uint32 caps = IBUS_CAP_FOCUS;
  17.293 -            if(!(internal_editing && *internal_editing == '1')){
  17.294 +            if (!(internal_editing && *internal_editing == '1')) {
  17.295                  caps |= IBUS_CAP_PREEDIT_TEXT;
  17.296              }
  17.297              
  17.298 @@ -313,8 +325,8 @@
  17.299                                        DBUS_TYPE_INVALID);
  17.300          }
  17.301          
  17.302 -        if(msg){
  17.303 -            if(dbus->connection_send(ibus_conn, msg, NULL)){
  17.304 +        if (msg) {
  17.305 +            if (dbus->connection_send(ibus_conn, msg, NULL)) {
  17.306                  dbus->connection_flush(ibus_conn);
  17.307              }
  17.308              dbus->message_unref(msg);
  17.309 @@ -328,42 +340,40 @@
  17.310  {
  17.311      const char *path = NULL;
  17.312      SDL_bool result = SDL_FALSE;
  17.313 -    
  17.314 +    DBusMessage *msg;
  17.315 +
  17.316      ibus_conn = dbus->connection_open_private(addr, NULL);
  17.317  
  17.318 -    if(!ibus_conn){
  17.319 +    if (!ibus_conn) {
  17.320          return SDL_FALSE;
  17.321      }
  17.322  
  17.323      dbus->connection_flush(ibus_conn);
  17.324      
  17.325 -    if(!dbus->bus_register(ibus_conn, NULL)){
  17.326 +    if (!dbus->bus_register(ibus_conn, NULL)) {
  17.327          ibus_conn = NULL;
  17.328          return SDL_FALSE;
  17.329      }
  17.330      
  17.331      dbus->connection_flush(ibus_conn);
  17.332  
  17.333 -    DBusMessage *msg = dbus->message_new_method_call(IBUS_SERVICE,
  17.334 -                                                     IBUS_PATH,
  17.335 -                                                     IBUS_INTERFACE,
  17.336 -                                                     "CreateInputContext");
  17.337 -    if(msg){
  17.338 +    msg = dbus->message_new_method_call(IBUS_SERVICE, IBUS_PATH, IBUS_INTERFACE, "CreateInputContext");
  17.339 +    if (msg) {
  17.340          const char *client_name = "SDL2_Application";
  17.341          dbus->message_append_args(msg,
  17.342                                    DBUS_TYPE_STRING, &client_name,
  17.343                                    DBUS_TYPE_INVALID);
  17.344      }
  17.345      
  17.346 -    if(msg){
  17.347 +    if (msg) {
  17.348          DBusMessage *reply;
  17.349          
  17.350          reply = dbus->connection_send_with_reply_and_block(ibus_conn, msg, 1000, NULL);
  17.351 -        if(reply){
  17.352 -            if(dbus->message_get_args(reply, NULL,
  17.353 +        if (reply) {
  17.354 +            if (dbus->message_get_args(reply, NULL,
  17.355                                         DBUS_TYPE_OBJECT_PATH, &path,
  17.356 -                                       DBUS_TYPE_INVALID)){
  17.357 -                if(input_ctx_path){
  17.358 +                                       DBUS_TYPE_INVALID)) {
  17.359 +                if (input_ctx_path) {
  17.360                      SDL_free(input_ctx_path);
  17.361                  }
  17.362                  input_ctx_path = SDL_strdup(path);
  17.363 @@ -374,7 +384,7 @@
  17.364          dbus->message_unref(msg);
  17.365      }
  17.366  
  17.367 -    if(result){
  17.368 +    if (result) {
  17.369          SDL_AddHintCallback(SDL_HINT_IME_INTERNAL_EDITING, &IBus_SetCapabilities, NULL);
  17.370          
  17.371          dbus->bus_add_match(ibus_conn, "type='signal',interface='org.freedesktop.IBus.InputContext'", NULL);
  17.372 @@ -391,27 +401,27 @@
  17.373  static SDL_bool
  17.374  IBus_CheckConnection(SDL_DBusContext *dbus)
  17.375  {
  17.376 -    if(!dbus) return SDL_FALSE;
  17.377 +    if (!dbus) return SDL_FALSE;
  17.378      
  17.379 -    if(ibus_conn && dbus->connection_get_is_connected(ibus_conn)){
  17.380 +    if (ibus_conn && dbus->connection_get_is_connected(ibus_conn)) {
  17.381          return SDL_TRUE;
  17.382      }
  17.383      
  17.384 -    if(inotify_fd > 0 && inotify_wd > 0){
  17.385 +    if (inotify_fd > 0 && inotify_wd > 0) {
  17.386          char buf[1024];
  17.387          ssize_t readsize = read(inotify_fd, buf, sizeof(buf));
  17.388 -        if(readsize > 0){
  17.389 +        if (readsize > 0) {
  17.390          
  17.391              char *p;
  17.392              SDL_bool file_updated = SDL_FALSE;
  17.393              
  17.394 -            for(p = buf; p < buf + readsize; /**/){
  17.395 +            for (p = buf; p < buf + readsize; /**/) {
  17.396                  struct inotify_event *event = (struct inotify_event*) p;
  17.397 -                if(event->len > 0){
  17.398 +                if (event->len > 0) {
  17.399                      char *addr_file_no_path = SDL_strrchr(ibus_addr_file, '/');
  17.400 -                    if(!addr_file_no_path) return SDL_FALSE;
  17.401 +                    if (!addr_file_no_path) return SDL_FALSE;
  17.402                   
  17.403 -                    if(SDL_strcmp(addr_file_no_path + 1, event->name) == 0){
  17.404 +                    if (SDL_strcmp(addr_file_no_path + 1, event->name) == 0) {
  17.405                          file_updated = SDL_TRUE;
  17.406                          break;
  17.407                      }
  17.408 @@ -420,9 +430,9 @@
  17.409                  p += sizeof(struct inotify_event) + event->len;
  17.410              }
  17.411              
  17.412 -            if(file_updated){
  17.413 +            if (file_updated) {
  17.414                  char *addr = IBus_ReadAddressFromFile(ibus_addr_file);
  17.415 -                if(addr){
  17.416 +                if (addr) {
  17.417                      SDL_bool result = IBus_SetupConnection(dbus, addr);
  17.418                      SDL_free(addr);
  17.419                      return result;
  17.420 @@ -440,23 +450,26 @@
  17.421      SDL_bool result = SDL_FALSE;
  17.422      SDL_DBusContext *dbus = SDL_DBus_GetContext();
  17.423      
  17.424 -    if(dbus){
  17.425 +    if (dbus) {
  17.426          char *addr_file = IBus_GetDBusAddressFilename();
  17.427 -        if(!addr_file){
  17.428 +        char *addr;
  17.429 +        char *addr_file_dir;
  17.430 +
  17.431 +        if (!addr_file) {
  17.432              return SDL_FALSE;
  17.433          }
  17.434          
  17.435          ibus_addr_file = SDL_strdup(addr_file);
  17.436          
  17.437 -        char *addr = IBus_ReadAddressFromFile(addr_file);
  17.438 +        addr = IBus_ReadAddressFromFile(addr_file);
  17.439          
  17.440 -        if(inotify_fd < 0){
  17.441 +        if (inotify_fd < 0) {
  17.442              inotify_fd = inotify_init();
  17.443              fcntl(inotify_fd, F_SETFL, O_NONBLOCK);
  17.444          }
  17.445          
  17.446 -        char *addr_file_dir = SDL_strrchr(addr_file, '/');
  17.447 -        if(addr_file_dir){
  17.448 +        addr_file_dir = SDL_strrchr(addr_file, '/');
  17.449 +        if (addr_file_dir) {
  17.450              *addr_file_dir = 0;
  17.451          }
  17.452          
  17.453 @@ -473,24 +486,26 @@
  17.454  void
  17.455  SDL_IBus_Quit(void)
  17.456  {   
  17.457 -    if(input_ctx_path){
  17.458 +    SDL_DBusContext *dbus;
  17.459 +
  17.460 +    if (input_ctx_path) {
  17.461          SDL_free(input_ctx_path);
  17.462          input_ctx_path = NULL;
  17.463      }
  17.464      
  17.465 -    if(ibus_addr_file){
  17.466 +    if (ibus_addr_file) {
  17.467          SDL_free(ibus_addr_file);
  17.468          ibus_addr_file = NULL;
  17.469      }
  17.470      
  17.471 -    SDL_DBusContext *dbus = SDL_DBus_GetContext();
  17.472 +    dbus = SDL_DBus_GetContext();
  17.473      
  17.474 -    if(dbus && ibus_conn){
  17.475 +    if (dbus && ibus_conn) {
  17.476          dbus->connection_close(ibus_conn);
  17.477          dbus->connection_unref(ibus_conn);
  17.478      }
  17.479      
  17.480 -    if(inotify_fd > 0 && inotify_wd > 0){
  17.481 +    if (inotify_fd > 0 && inotify_wd > 0) {
  17.482          inotify_rm_watch(inotify_fd, inotify_wd);
  17.483          inotify_wd = -1;
  17.484      }
  17.485 @@ -505,13 +520,13 @@
  17.486  {   
  17.487      SDL_DBusContext *dbus = SDL_DBus_GetContext();
  17.488      
  17.489 -    if(IBus_CheckConnection(dbus)){
  17.490 +    if (IBus_CheckConnection(dbus)) {
  17.491          DBusMessage *msg = dbus->message_new_method_call(IBUS_SERVICE,
  17.492                                                           input_ctx_path,
  17.493                                                           IBUS_INPUT_INTERFACE,
  17.494                                                           method);
  17.495 -        if(msg){
  17.496 -            if(dbus->connection_send(ibus_conn, msg, NULL)){
  17.497 +        if (msg) {
  17.498 +            if (dbus->connection_send(ibus_conn, msg, NULL)) {
  17.499                  dbus->connection_flush(ibus_conn);
  17.500              }
  17.501              dbus->message_unref(msg);
  17.502 @@ -538,12 +553,12 @@
  17.503      SDL_bool result = SDL_FALSE;   
  17.504      SDL_DBusContext *dbus = SDL_DBus_GetContext();
  17.505      
  17.506 -    if(IBus_CheckConnection(dbus)){
  17.507 +    if (IBus_CheckConnection(dbus)) {
  17.508          DBusMessage *msg = dbus->message_new_method_call(IBUS_SERVICE,
  17.509                                                           input_ctx_path,
  17.510                                                           IBUS_INPUT_INTERFACE,
  17.511                                                           "ProcessKeyEvent");
  17.512 -        if(msg){
  17.513 +        if (msg) {
  17.514              Uint32 mods = IBus_ModState();
  17.515              dbus->message_append_args(msg,
  17.516                                        DBUS_TYPE_UINT32, &keysym,
  17.517 @@ -552,14 +567,14 @@
  17.518                                        DBUS_TYPE_INVALID);
  17.519          }
  17.520          
  17.521 -        if(msg){
  17.522 +        if (msg) {
  17.523              DBusMessage *reply;
  17.524              
  17.525              reply = dbus->connection_send_with_reply_and_block(ibus_conn, msg, 300, NULL);
  17.526 -            if(reply){
  17.527 -                if(!dbus->message_get_args(reply, NULL,
  17.528 +            if (reply) {
  17.529 +                if (!dbus->message_get_args(reply, NULL,
  17.530                                             DBUS_TYPE_BOOLEAN, &result,
  17.531 -                                           DBUS_TYPE_INVALID)){
  17.532 +                                           DBUS_TYPE_INVALID)) {
  17.533                      result = SDL_FALSE;                         
  17.534                  }
  17.535                  dbus->message_unref(reply);
  17.536 @@ -577,49 +592,51 @@
  17.537  void
  17.538  SDL_IBus_UpdateTextRect(SDL_Rect *rect)
  17.539  {
  17.540 -    if(rect){
  17.541 +    SDL_Window *focused_win;
  17.542 +    SDL_SysWMinfo info;
  17.543 +    int x = 0, y = 0;
  17.544 +    SDL_DBusContext *dbus;
  17.545 +
  17.546 +    if (rect) {
  17.547          SDL_memcpy(&ibus_cursor_rect, rect, sizeof(ibus_cursor_rect));
  17.548      }
  17.549 -    
  17.550 -    SDL_Window *focused_win = SDL_GetKeyboardFocus();
  17.551  
  17.552 -    if(!focused_win) return;
  17.553 -    
  17.554 -    SDL_SysWMinfo info;
  17.555 +    focused_win = SDL_GetKeyboardFocus();
  17.556 +    if (!focused_win) {
  17.557 +        return;
  17.558 +    }
  17.559 +
  17.560      SDL_VERSION(&info.version);
  17.561 -    
  17.562 -    if(!SDL_GetWindowWMInfo(focused_win, &info)) return;
  17.563 -    
  17.564 -    int x = 0, y = 0;
  17.565 -    
  17.566 +    if (!SDL_GetWindowWMInfo(focused_win, &info)) {
  17.567 +        return;
  17.568 +    }
  17.569 +
  17.570      SDL_GetWindowPosition(focused_win, &x, &y);
  17.571     
  17.572  #if SDL_VIDEO_DRIVER_X11    
  17.573 -    if(info.subsystem == SDL_SYSWM_X11){
  17.574 -        SDL_DisplayData *displaydata =
  17.575 -            (SDL_DisplayData *) SDL_GetDisplayForWindow(focused_win)->driverdata;
  17.576 +    if (info.subsystem == SDL_SYSWM_X11) {
  17.577 +        SDL_DisplayData *displaydata = (SDL_DisplayData *) SDL_GetDisplayForWindow(focused_win)->driverdata;
  17.578              
  17.579          Display *x_disp = info.info.x11.display;
  17.580          Window x_win = info.info.x11.window;
  17.581          int x_screen = displaydata->screen;
  17.582          Window unused;
  17.583              
  17.584 -        X11_XTranslateCoordinates(x_disp, x_win, RootWindow(x_disp, x_screen),
  17.585 -            0, 0, &x, &y, &unused);
  17.586 +        X11_XTranslateCoordinates(x_disp, x_win, RootWindow(x_disp, x_screen), 0, 0, &x, &y, &unused);
  17.587      }
  17.588  #endif
  17.589  
  17.590      x += ibus_cursor_rect.x;
  17.591      y += ibus_cursor_rect.y;
  17.592          
  17.593 -    SDL_DBusContext *dbus = SDL_DBus_GetContext();
  17.594 +    dbus = SDL_DBus_GetContext();
  17.595      
  17.596 -    if(IBus_CheckConnection(dbus)){
  17.597 +    if (IBus_CheckConnection(dbus)) {
  17.598          DBusMessage *msg = dbus->message_new_method_call(IBUS_SERVICE,
  17.599                                                           input_ctx_path,
  17.600                                                           IBUS_INPUT_INTERFACE,
  17.601                                                           "SetCursorLocation");
  17.602 -        if(msg){
  17.603 +        if (msg) {
  17.604              dbus->message_append_args(msg,
  17.605                                        DBUS_TYPE_INT32, &x,
  17.606                                        DBUS_TYPE_INT32, &y,
  17.607 @@ -628,8 +645,8 @@
  17.608                                        DBUS_TYPE_INVALID);
  17.609          }
  17.610          
  17.611 -        if(msg){
  17.612 -            if(dbus->connection_send(ibus_conn, msg, NULL)){
  17.613 +        if (msg) {
  17.614 +            if (dbus->connection_send(ibus_conn, msg, NULL)) {
  17.615                  dbus->connection_flush(ibus_conn);
  17.616              }
  17.617              dbus->message_unref(msg);
  17.618 @@ -642,10 +659,10 @@
  17.619  {
  17.620      SDL_DBusContext *dbus = SDL_DBus_GetContext();
  17.621      
  17.622 -    if(IBus_CheckConnection(dbus)){
  17.623 +    if (IBus_CheckConnection(dbus)) {
  17.624          dbus->connection_read_write(ibus_conn, 0);
  17.625      
  17.626 -        while(dbus->connection_dispatch(ibus_conn) == DBUS_DISPATCH_DATA_REMAINS){
  17.627 +        while (dbus->connection_dispatch(ibus_conn) == DBUS_DISPATCH_DATA_REMAINS) {
  17.628              /* Do nothing, actual work happens in IBus_MessageFilter */
  17.629          }
  17.630      }
    18.1 --- a/src/joystick/darwin/SDL_sysjoystick.c	Wed Aug 20 17:20:22 2014 -0300
    18.2 +++ b/src/joystick/darwin/SDL_sysjoystick.c	Wed Sep 10 18:10:37 2014 -0300
    18.3 @@ -364,15 +364,33 @@
    18.4      return SDL_TRUE;
    18.5  }
    18.6  
    18.7 +static SDL_bool
    18.8 +JoystickAlreadyKnown(IOHIDDeviceRef ioHIDDeviceObject)
    18.9 +{
   18.10 +    recDevice *i;
   18.11 +    for (i = gpDeviceList; i != NULL; i = i->pNext) {
   18.12 +        if (i->deviceRef == ioHIDDeviceObject) {
   18.13 +            return SDL_TRUE;
   18.14 +        }
   18.15 +    }
   18.16 +    return SDL_FALSE;
   18.17 +}
   18.18 +
   18.19  
   18.20  static void
   18.21  JoystickDeviceWasAddedCallback(void *ctx, IOReturn res, void *sender, IOHIDDeviceRef ioHIDDeviceObject)
   18.22  {
   18.23 +    recDevice *device;
   18.24 +
   18.25      if (res != kIOReturnSuccess) {
   18.26          return;
   18.27      }
   18.28  
   18.29 -    recDevice *device = (recDevice *) SDL_calloc(1, sizeof(recDevice));
   18.30 +    if (JoystickAlreadyKnown(ioHIDDeviceObject)) {
   18.31 +        return;  /* IOKit sent us a duplicate. */
   18.32 +    }
   18.33 +
   18.34 +    device = (recDevice *) SDL_calloc(1, sizeof(recDevice));
   18.35  
   18.36      if (!device) {
   18.37          SDL_OutOfMemory();
    19.1 --- a/src/main/windows/version.rc	Wed Aug 20 17:20:22 2014 -0300
    19.2 +++ b/src/main/windows/version.rc	Wed Sep 10 18:10:37 2014 -0300
    19.3 @@ -9,8 +9,8 @@
    19.4  //
    19.5  
    19.6  VS_VERSION_INFO VERSIONINFO
    19.7 - FILEVERSION 2,0,3,0
    19.8 - PRODUCTVERSION 2,0,3,0
    19.9 + FILEVERSION 2,0,4,0
   19.10 + PRODUCTVERSION 2,0,4,0
   19.11   FILEFLAGSMASK 0x3fL
   19.12   FILEFLAGS 0x0L
   19.13   FILEOS 0x40004L
   19.14 @@ -23,12 +23,12 @@
   19.15          BEGIN
   19.16              VALUE "CompanyName", "\0"
   19.17              VALUE "FileDescription", "SDL\0"
   19.18 -            VALUE "FileVersion", "2, 0, 3, 0\0"
   19.19 +            VALUE "FileVersion", "2, 0, 4, 0\0"
   19.20              VALUE "InternalName", "SDL\0"
   19.21              VALUE "LegalCopyright", "Copyright  2014 Sam Lantinga\0"
   19.22              VALUE "OriginalFilename", "SDL2.dll\0"
   19.23              VALUE "ProductName", "Simple DirectMedia Layer\0"
   19.24 -            VALUE "ProductVersion", "2, 0, 3, 0\0"
   19.25 +            VALUE "ProductVersion", "2, 0, 4, 0\0"
   19.26          END
   19.27      END
   19.28      BLOCK "VarFileInfo"
    20.1 --- a/src/render/opengl/SDL_render_gl.c	Wed Aug 20 17:20:22 2014 -0300
    20.2 +++ b/src/render/opengl/SDL_render_gl.c	Wed Sep 10 18:10:37 2014 -0300
    20.3 @@ -1429,6 +1429,7 @@
    20.4                         format, type, temp_pixels);
    20.5  
    20.6      if (GL_CheckError("glReadPixels()", renderer) < 0) {
    20.7 +        SDL_free(temp_pixels);
    20.8          return -1;
    20.9      }
   20.10  
    21.1 --- a/src/video/SDL_bmp.c	Wed Aug 20 17:20:22 2014 -0300
    21.2 +++ b/src/video/SDL_bmp.c	Wed Sep 10 18:10:37 2014 -0300
    21.3 @@ -85,15 +85,17 @@
    21.4      int bmpPitch;
    21.5      int i, pad;
    21.6      SDL_Surface *surface;
    21.7 -    Uint32 Rmask;
    21.8 -    Uint32 Gmask;
    21.9 -    Uint32 Bmask;
   21.10 -    Uint32 Amask;
   21.11 +    Uint32 Rmask = 0;
   21.12 +    Uint32 Gmask = 0;
   21.13 +    Uint32 Bmask = 0;
   21.14 +    Uint32 Amask = 0;
   21.15      SDL_Palette *palette;
   21.16      Uint8 *bits;
   21.17      Uint8 *top, *end;
   21.18      SDL_bool topDown;
   21.19      int ExpandBMP;
   21.20 +    SDL_bool haveRGBMasks = SDL_FALSE;
   21.21 +    SDL_bool haveAlphaMask = SDL_FALSE;
   21.22      SDL_bool correctAlpha = SDL_FALSE;
   21.23  
   21.24      /* The Win32 BMP file header (14 bytes) */
   21.25 @@ -144,15 +146,14 @@
   21.26  
   21.27      /* Read the Win32 BITMAPINFOHEADER */
   21.28      biSize = SDL_ReadLE32(src);
   21.29 -    if (biSize == 12) {
   21.30 +    if (biSize == 12) {   /* really old BITMAPCOREHEADER */
   21.31          biWidth = (Uint32) SDL_ReadLE16(src);
   21.32          biHeight = (Uint32) SDL_ReadLE16(src);
   21.33          /* biPlanes = */ SDL_ReadLE16(src);
   21.34          biBitCount = SDL_ReadLE16(src);
   21.35          biCompression = BI_RGB;
   21.36 -    } else {
   21.37 -        const unsigned int headerSize = 40;
   21.38 -
   21.39 +    } else if (biSize >= 40) {  /* some version of BITMAPINFOHEADER */
   21.40 +        Uint32 headerSize;
   21.41          biWidth = SDL_ReadLE32(src);
   21.42          biHeight = SDL_ReadLE32(src);
   21.43          /* biPlanes = */ SDL_ReadLE16(src);
   21.44 @@ -164,6 +165,54 @@
   21.45          biClrUsed = SDL_ReadLE32(src);
   21.46          /* biClrImportant = */ SDL_ReadLE32(src);
   21.47  
   21.48 +        /* 64 == BITMAPCOREHEADER2, an incompatible OS/2 2.x extension. Skip this stuff for now. */
   21.49 +        if (biSize == 64) {
   21.50 +            /* ignore these extra fields. */
   21.51 +            if (biCompression == BI_BITFIELDS) {
   21.52 +                /* this value is actually huffman compression in this variant. */
   21.53 +                SDL_SetError("Compressed BMP files not supported");
   21.54 +                was_error = SDL_TRUE;
   21.55 +                goto done;
   21.56 +            }
   21.57 +        } else {
   21.58 +            /* This is complicated. If compression is BI_BITFIELDS, then
   21.59 +               we have 3 DWORDS that specify the RGB masks. This is either
   21.60 +               stored here in an BITMAPV2INFOHEADER (which only differs in
   21.61 +               that it adds these RGB masks) and biSize >= 52, or we've got
   21.62 +               these masks stored in the exact same place, but strictly
   21.63 +               speaking, this is the bmiColors field in BITMAPINFO immediately
   21.64 +               following the legacy v1 info header, just past biSize. */
   21.65 +            if (biCompression == BI_BITFIELDS) {
   21.66 +                haveRGBMasks = SDL_TRUE;
   21.67 +                Rmask = SDL_ReadLE32(src);
   21.68 +                Gmask = SDL_ReadLE32(src);
   21.69 +                Bmask = SDL_ReadLE32(src);
   21.70 +
   21.71 +                /* ...v3 adds an alpha mask. */
   21.72 +                if (biSize >= 56) {  /* BITMAPV3INFOHEADER; adds alpha mask */
   21.73 +                    haveAlphaMask = SDL_TRUE;
   21.74 +                    Amask = SDL_ReadLE32(src);
   21.75 +                }
   21.76 +            } else {
   21.77 +                /* the mask fields are ignored for v2+ headers if not BI_BITFIELD. */
   21.78 +                if (biSize >= 52) {  /* BITMAPV2INFOHEADER; adds RGB masks */
   21.79 +                    /*Rmask = */ SDL_ReadLE32(src);
   21.80 +                    /*Gmask = */ SDL_ReadLE32(src);
   21.81 +                    /*Bmask = */ SDL_ReadLE32(src);
   21.82 +                }
   21.83 +                if (biSize >= 56) {  /* BITMAPV3INFOHEADER; adds alpha mask */
   21.84 +                    /*Amask = */ SDL_ReadLE32(src);
   21.85 +                }
   21.86 +            }
   21.87 +
   21.88 +            /* Insert other fields here; Wikipedia and MSDN say we're up to
   21.89 +               v5 of this header, but we ignore those for now (they add gamma,
   21.90 +               color spaces, etc). Ignoring the weird OS/2 2.x format, we
   21.91 +               currently parse up to v3 correctly (hopefully!). */
   21.92 +        }
   21.93 +
   21.94 +        /* skip any header bytes we didn't handle... */
   21.95 +        headerSize = (Uint32) (SDL_RWtell(src) - (fp_offset + 14));
   21.96          if (biSize > headerSize) {
   21.97              SDL_RWseek(src, (biSize - headerSize), RW_SEEK_CUR);
   21.98          }
   21.99 @@ -194,80 +243,46 @@
  21.100      }
  21.101  
  21.102      /* We don't support any BMP compression right now */
  21.103 -    Rmask = Gmask = Bmask = Amask = 0;
  21.104      switch (biCompression) {
  21.105      case BI_RGB:
  21.106          /* If there are no masks, use the defaults */
  21.107 -        if (bfOffBits == (14 + biSize)) {
  21.108 -            /* Default values for the BMP format */
  21.109 -            switch (biBitCount) {
  21.110 -            case 15:
  21.111 -            case 16:
  21.112 -                Rmask = 0x7C00;
  21.113 -                Gmask = 0x03E0;
  21.114 -                Bmask = 0x001F;
  21.115 -                break;
  21.116 -            case 24:
  21.117 -#if SDL_BYTEORDER == SDL_BIG_ENDIAN
  21.118 -                Rmask = 0x000000FF;
  21.119 -                Gmask = 0x0000FF00;
  21.120 -                Bmask = 0x00FF0000;
  21.121 -#else
  21.122 -                Rmask = 0x00FF0000;
  21.123 -                Gmask = 0x0000FF00;
  21.124 -                Bmask = 0x000000FF;
  21.125 -#endif
  21.126 -                break;
  21.127 -            case 32:
  21.128 -                /* We don't know if this has alpha channel or not */
  21.129 -                correctAlpha = SDL_TRUE;
  21.130 -                Amask = 0xFF000000;
  21.131 -                Rmask = 0x00FF0000;
  21.132 -                Gmask = 0x0000FF00;
  21.133 -                Bmask = 0x000000FF;
  21.134 -                break;
  21.135 -            default:
  21.136 -                break;
  21.137 -            }
  21.138 -            break;
  21.139 -        }
  21.140 -        /* Fall through -- read the RGB masks */
  21.141 -
  21.142 -    case BI_BITFIELDS:
  21.143 +        SDL_assert(!haveRGBMasks);
  21.144 +        SDL_assert(!haveAlphaMask);
  21.145 +        /* Default values for the BMP format */
  21.146          switch (biBitCount) {
  21.147          case 15:
  21.148          case 16:
  21.149 -            Rmask = SDL_ReadLE32(src);
  21.150 -            Gmask = SDL_ReadLE32(src);
  21.151 -            Bmask = SDL_ReadLE32(src);
  21.152 +            Rmask = 0x7C00;
  21.153 +            Gmask = 0x03E0;
  21.154 +            Bmask = 0x001F;
  21.155 +            break;
  21.156 +        case 24:
  21.157 +#if SDL_BYTEORDER == SDL_BIG_ENDIAN
  21.158 +            Rmask = 0x000000FF;
  21.159 +            Gmask = 0x0000FF00;
  21.160 +            Bmask = 0x00FF0000;
  21.161 +#else
  21.162 +            Rmask = 0x00FF0000;
  21.163 +            Gmask = 0x0000FF00;
  21.164 +            Bmask = 0x000000FF;
  21.165 +#endif
  21.166              break;
  21.167          case 32:
  21.168 -            Rmask = SDL_ReadLE32(src);
  21.169 -            Gmask = SDL_ReadLE32(src);
  21.170 -            Bmask = SDL_ReadLE32(src);
  21.171 -            Amask = SDL_ReadLE32(src);
  21.172 -
  21.173 -            /* ImageMagick seems to put out bogus masks here. Pick a default. */
  21.174 -            if ((Rmask == 0xFFFFFF) && (Gmask == 0xFFFFFF) &&
  21.175 -                (Bmask == 0xFFFFFF) && (Amask == 0xFFFFFF) ) {
  21.176 -                Amask = 0xFF000000;
  21.177 -                Rmask = 0x00FF0000;
  21.178 -                Gmask = 0x0000FF00;
  21.179 -                Bmask = 0x000000FF;
  21.180 -            } else if ((Rmask == 0xFFFFFF00) && (Gmask == 0xFFFFFF00) &&
  21.181 -                       (Bmask == 0xFFFFFF00) && (Amask == 0xFFFFFF00) ) {
  21.182 -                /* argh, The Gimp seems to put out different bogus masks! */
  21.183 -                Amask = 0x000000FF;
  21.184 -                Rmask = 0xFF000000;
  21.185 -                Gmask = 0x00FF0000;
  21.186 -                Bmask = 0x0000FF00;
  21.187 -            }
  21.188 -
  21.189 +            /* We don't know if this has alpha channel or not */
  21.190 +            correctAlpha = SDL_TRUE;
  21.191 +            Amask = 0xFF000000;
  21.192 +            Rmask = 0x00FF0000;
  21.193 +            Gmask = 0x0000FF00;
  21.194 +            Bmask = 0x000000FF;
  21.195              break;
  21.196          default:
  21.197              break;
  21.198          }
  21.199          break;
  21.200 +
  21.201 +    case BI_BITFIELDS:
  21.202 +        break;  /* we handled this in the info header. */
  21.203 +
  21.204      default:
  21.205          SDL_SetError("Compressed BMP files not supported");
  21.206          was_error = SDL_TRUE;
    22.1 --- a/src/video/SDL_shape.c	Wed Aug 20 17:20:22 2014 -0300
    22.2 +++ b/src/video/SDL_shape.c	Wed Sep 10 18:10:37 2014 -0300
    22.3 @@ -128,6 +128,7 @@
    22.4      SDL_Color key;
    22.5      SDL_ShapeTree* result = (SDL_ShapeTree*)SDL_malloc(sizeof(SDL_ShapeTree));
    22.6      SDL_Rect next = {0,0,0,0};
    22.7 +
    22.8      for(y=dimensions.y;y<dimensions.y + dimensions.h;y++) {
    22.9          for(x=dimensions.x;x<dimensions.x + dimensions.w;x++) {
   22.10              pixel_value = 0;
   22.11 @@ -165,27 +166,37 @@
   22.12              if(last_opaque == -1)
   22.13                  last_opaque = pixel_opaque;
   22.14              if(last_opaque != pixel_opaque) {
   22.15 +                const int halfwidth = dimensions.w / 2;
   22.16 +                const int halfheight = dimensions.h / 2;
   22.17 +
   22.18                  result->kind = QuadShape;
   22.19 -                /* These will stay the same. */
   22.20 -                next.w = dimensions.w / 2;
   22.21 -                next.h = dimensions.h / 2;
   22.22 -                /* These will change from recursion to recursion. */
   22.23 +
   22.24                  next.x = dimensions.x;
   22.25                  next.y = dimensions.y;
   22.26 +                next.w = halfwidth;
   22.27 +                next.h = halfheight;
   22.28                  result->data.children.upleft = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,next);
   22.29 -                next.x += next.w;
   22.30 -                /* Unneeded: next.y = dimensions.y; */
   22.31 +
   22.32 +                next.x = dimensions.x + halfwidth;
   22.33 +                next.w = dimensions.w - halfwidth;
   22.34                  result->data.children.upright = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,next);
   22.35 +
   22.36                  next.x = dimensions.x;
   22.37 -                next.y += next.h;
   22.38 +                next.w = halfwidth;
   22.39 +                next.y = dimensions.y + halfheight;
   22.40 +                next.h = dimensions.h - halfheight;
   22.41                  result->data.children.downleft = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,next);
   22.42 -                next.x += next.w;
   22.43 -                /* Unneeded: next.y = dimensions.y + dimensions.h /2; */
   22.44 +
   22.45 +                next.x = dimensions.x + halfwidth;
   22.46 +                next.w = dimensions.w - halfwidth;
   22.47                  result->data.children.downright = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,next);
   22.48 +
   22.49                  return result;
   22.50              }
   22.51          }
   22.52      }
   22.53 +
   22.54 +
   22.55      /* If we never recursed, all the pixels in this quadrant have the same "value". */
   22.56      result->kind = (last_opaque == SDL_TRUE ? OpaqueShape : TransparentShape);
   22.57      result->data.shape = dimensions;
    23.1 --- a/src/video/SDL_sysvideo.h	Wed Aug 20 17:20:22 2014 -0300
    23.2 +++ b/src/video/SDL_sysvideo.h	Wed Sep 10 18:10:37 2014 -0300
    23.3 @@ -391,6 +391,9 @@
    23.4  #if SDL_VIDEO_DRIVER_NACL
    23.5  extern VideoBootStrap NACL_bootstrap;
    23.6  #endif
    23.7 +#if SDL_VIDEO_DRIVER_MX6
    23.8 +extern VideoBootStrap MX6_bootstrap;
    23.9 +#endif
   23.10  
   23.11  extern SDL_VideoDevice *SDL_GetVideoDevice(void);
   23.12  extern int SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode);
    24.1 --- a/src/video/SDL_video.c	Wed Aug 20 17:20:22 2014 -0300
    24.2 +++ b/src/video/SDL_video.c	Wed Sep 10 18:10:37 2014 -0300
    24.3 @@ -95,6 +95,9 @@
    24.4  #if SDL_VIDEO_DRIVER_NACL
    24.5      &NACL_bootstrap,
    24.6  #endif
    24.7 +#if SDL_VIDEO_DRIVER_MX6
    24.8 +    &MX6_bootstrap,
    24.9 +#endif
   24.10  #if SDL_VIDEO_DRIVER_DUMMY
   24.11      &DUMMY_bootstrap,
   24.12  #endif
    25.1 --- a/src/video/cocoa/SDL_cocoamodes.m	Wed Aug 20 17:20:22 2014 -0300
    25.2 +++ b/src/video/cocoa/SDL_cocoamodes.m	Wed Sep 10 18:10:37 2014 -0300
    25.3 @@ -27,6 +27,10 @@
    25.4  /* We need this for IODisplayCreateInfoDictionary and kIODisplayOnlyPreferredName */
    25.5  #include <IOKit/graphics/IOGraphicsLib.h>
    25.6  
    25.7 +/* We need this for CVDisplayLinkGetNominalOutputVideoRefreshPeriod */
    25.8 +#include <CoreVideo/CVBase.h>
    25.9 +#include <CoreVideo/CVDisplayLink.h>
   25.10 +
   25.11  /* we need this for ShowMenuBar() and HideMenuBar(). */
   25.12  #include <Carbon/Carbon.h>
   25.13  
   25.14 @@ -114,7 +118,7 @@
   25.15  }
   25.16  
   25.17  static SDL_bool
   25.18 -GetDisplayMode(_THIS, const void *moderef, SDL_DisplayMode *mode)
   25.19 +GetDisplayMode(_THIS, const void *moderef, CVDisplayLinkRef link, SDL_DisplayMode *mode)
   25.20  {
   25.21      SDL_DisplayModeData *data;
   25.22      long width = 0;
   25.23 @@ -133,7 +137,7 @@
   25.24          CFStringRef fmt = CGDisplayModeCopyPixelEncoding(vidmode);
   25.25          width = (long) CGDisplayModeGetWidth(vidmode);
   25.26          height = (long) CGDisplayModeGetHeight(vidmode);
   25.27 -        refreshRate = (long) CGDisplayModeGetRefreshRate(vidmode);
   25.28 +        refreshRate = (long) (CGDisplayModeGetRefreshRate(vidmode) + 0.5);
   25.29  
   25.30          if (CFStringCompare(fmt, CFSTR(IO32BitDirectPixels),
   25.31                              kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
   25.32 @@ -141,6 +145,9 @@
   25.33          } else if (CFStringCompare(fmt, CFSTR(IO16BitDirectPixels),
   25.34                              kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
   25.35              bpp = 16;
   25.36 +        } else if (CFStringCompare(fmt, CFSTR(kIO30BitDirectPixels),
   25.37 +                            kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
   25.38 +            bpp = 30;
   25.39          } else {
   25.40              bpp = 0;  /* ignore 8-bit and such for now. */
   25.41          }
   25.42 @@ -151,6 +158,7 @@
   25.43      #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
   25.44      if (!IS_SNOW_LEOPARD_OR_LATER()) {
   25.45          CFNumberRef number;
   25.46 +        double refresh;
   25.47          CFDictionaryRef vidmode = (CFDictionaryRef) moderef;
   25.48          number = CFDictionaryGetValue(vidmode, kCGDisplayWidth);
   25.49          CFNumberGetValue(number, kCFNumberLongType, &width);
   25.50 @@ -159,15 +167,27 @@
   25.51          number = CFDictionaryGetValue(vidmode, kCGDisplayBitsPerPixel);
   25.52          CFNumberGetValue(number, kCFNumberLongType, &bpp);
   25.53          number = CFDictionaryGetValue(vidmode, kCGDisplayRefreshRate);
   25.54 -        CFNumberGetValue(number, kCFNumberLongType, &refreshRate);
   25.55 +        CFNumberGetValue(number, kCFNumberDoubleType, &refresh);
   25.56 +        refreshRate = (long) (refresh + 0.5);
   25.57      }
   25.58      #endif
   25.59  
   25.60 +    /* CGDisplayModeGetRefreshRate returns 0 for many non-CRT displays. */
   25.61 +    if (refreshRate == 0 && link != NULL) {
   25.62 +        CVTime time = CVDisplayLinkGetNominalOutputVideoRefreshPeriod(link);
   25.63 +        if ((time.flags & kCVTimeIsIndefinite) == 0 && time.timeValue != 0) {
   25.64 +            refreshRate = (long) ((time.timeScale / (double) time.timeValue) + 0.5);
   25.65 +        }
   25.66 +    }
   25.67 +
   25.68      mode->format = SDL_PIXELFORMAT_UNKNOWN;
   25.69      switch (bpp) {
   25.70      case 16:
   25.71          mode->format = SDL_PIXELFORMAT_ARGB1555;
   25.72          break;
   25.73 +    case 30:
   25.74 +        mode->format = SDL_PIXELFORMAT_ARGB2101010;
   25.75 +        break;
   25.76      case 32:
   25.77          mode->format = SDL_PIXELFORMAT_ARGB8888;
   25.78          break;
   25.79 @@ -241,6 +261,7 @@
   25.80              SDL_DisplayData *displaydata;
   25.81              SDL_DisplayMode mode;
   25.82              const void *moderef = NULL;
   25.83 +            CVDisplayLinkRef link = NULL;
   25.84  
   25.85              if (pass == 0) {
   25.86                  if (!CGDisplayIsMain(displays[i])) {
   25.87 @@ -277,16 +298,21 @@
   25.88              }
   25.89              displaydata->display = displays[i];
   25.90  
   25.91 +            CVDisplayLinkCreateWithCGDisplay(displays[i], &link);
   25.92 +
   25.93              SDL_zero(display);
   25.94              /* this returns a stddup'ed string */
   25.95              display.name = (char *)Cocoa_GetDisplayName(displays[i]);
   25.96 -            if (!GetDisplayMode (_this, moderef, &mode)) {
   25.97 +            if (!GetDisplayMode(_this, moderef, link, &mode)) {
   25.98 +                CVDisplayLinkRelease(link);
   25.99                  Cocoa_ReleaseDisplayMode(_this, moderef);
  25.100                  SDL_free(display.name);
  25.101                  SDL_free(displaydata);
  25.102                  continue;
  25.103              }
  25.104  
  25.105 +            CVDisplayLinkRelease(link);
  25.106 +
  25.107              display.desktop_mode = mode;
  25.108              display.current_mode = mode;
  25.109              display.driverdata = displaydata;
  25.110 @@ -328,13 +354,16 @@
  25.111      #endif
  25.112  
  25.113      if (modes) {
  25.114 +        CVDisplayLinkRef link = NULL;
  25.115          const CFIndex count = CFArrayGetCount(modes);
  25.116          CFIndex i;
  25.117  
  25.118 +        CVDisplayLinkCreateWithCGDisplay(data->display, &link);
  25.119 +
  25.120          for (i = 0; i < count; i++) {
  25.121              const void *moderef = CFArrayGetValueAtIndex(modes, i);
  25.122              SDL_DisplayMode mode;
  25.123 -            if (GetDisplayMode(_this, moderef, &mode)) {
  25.124 +            if (GetDisplayMode(_this, moderef, link, &mode)) {
  25.125                  if (IS_SNOW_LEOPARD_OR_LATER()) {
  25.126                      CGDisplayModeRetain((CGDisplayModeRef) moderef);
  25.127                  }
  25.128 @@ -342,6 +371,7 @@
  25.129              }
  25.130          }
  25.131  
  25.132 +        CVDisplayLinkRelease(link);
  25.133          Cocoa_ReleaseDisplayModeList(_this, modes);
  25.134      }
  25.135  }
    26.1 --- a/src/video/directfb/SDL_DirectFB_window.c	Wed Aug 20 17:20:22 2014 -0300
    26.2 +++ b/src/video/directfb/SDL_DirectFB_window.c	Wed Sep 10 18:10:37 2014 -0300
    26.3 @@ -90,7 +90,7 @@
    26.4      desc.height = windata->size.h;
    26.5      desc.pixelformat = dispdata->pixelformat;
    26.6      desc.surface_caps = DSCAPS_PREMULTIPLIED;
    26.7 -#if DIRECTFB_MAJOR_VERSION == 1 && DIRECTFB_MINOR_VERSION >= 4
    26.8 +#if DIRECTFB_MAJOR_VERSION == 1 && DIRECTFB_MINOR_VERSION >= 6
    26.9      if (window->flags & SDL_WINDOW_OPENGL) {
   26.10          desc.surface_caps |= DSCAPS_GL;
   26.11      }
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/src/video/mx6/SDL_mx6events.c	Wed Sep 10 18:10:37 2014 -0300
    27.3 @@ -0,0 +1,45 @@
    27.4 +/*
    27.5 +  Simple DirectMedia Layer
    27.6 +  Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
    27.7 +
    27.8 +  This software is provided 'as-is', without any express or implied
    27.9 +  warranty.  In no event will the authors be held liable for any damages
   27.10 +  arising from the use of this software.
   27.11 +
   27.12 +  Permission is granted to anyone to use this software for any purpose,
   27.13 +  including commercial applications, and to alter it and redistribute it
   27.14 +  freely, subject to the following restrictions:
   27.15 +
   27.16 +  1. The origin of this software must not be misrepresented; you must not
   27.17 +     claim that you wrote the original software. If you use this software
   27.18 +     in a product, an acknowledgment in the product documentation would be
   27.19 +     appreciated but is not required.
   27.20 +  2. Altered source versions must be plainly marked as such, and must not be
   27.21 +     misrepresented as being the original software.
   27.22 +  3. This notice may not be removed or altered from any source distribution.
   27.23 +*/
   27.24 +
   27.25 +#include "../../SDL_internal.h"
   27.26 +
   27.27 +#if SDL_VIDEO_DRIVER_MX6
   27.28 +
   27.29 +#include "../../events/SDL_sysevents.h"
   27.30 +#include "../../events/SDL_events_c.h"
   27.31 +#include "../../events/SDL_keyboard_c.h"
   27.32 +#include "SDL_mx6video.h"
   27.33 +#include "SDL_mx6events_c.h"
   27.34 +
   27.35 +#ifdef SDL_INPUT_LINUXEV
   27.36 +#include "../../core/linux/SDL_evdev.h"
   27.37 +#endif
   27.38 +
   27.39 +void MX6_PumpEvents(_THIS)
   27.40 +{
   27.41 +#ifdef SDL_INPUT_LINUXEV
   27.42 +    SDL_EVDEV_Poll();
   27.43 +#endif
   27.44 +    
   27.45 +}
   27.46 +
   27.47 +#endif /* SDL_VIDEO_DRIVER_MX6 */
   27.48 +
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/src/video/mx6/SDL_mx6events_c.h	Wed Sep 10 18:10:37 2014 -0300
    28.3 @@ -0,0 +1,31 @@
    28.4 +/*
    28.5 +  Simple DirectMedia Layer
    28.6 +  Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
    28.7 +
    28.8 +  This software is provided 'as-is', without any express or implied
    28.9 +  warranty.  In no event will the authors be held liable for any damages
   28.10 +  arising from the use of this software.
   28.11 +
   28.12 +  Permission is granted to anyone to use this software for any purpose,
   28.13 +  including commercial applications, and to alter it and redistribute it
   28.14 +  freely, subject to the following restrictions:
   28.15 +
   28.16 +  1. The origin of this software must not be misrepresented; you must not
   28.17 +     claim that you wrote the original software. If you use this software
   28.18 +     in a product, an acknowledgment in the product documentation would be
   28.19 +     appreciated but is not required.
   28.20 +  2. Altered source versions must be plainly marked as such, and must not be
   28.21 +     misrepresented as being the original software.
   28.22 +  3. This notice may not be removed or altered from any source distribution.
   28.23 +*/
   28.24 +
   28.25 +#ifndef _SDL_mx6events_c_h
   28.26 +#define _SDL_mx6events_c_h
   28.27 +
   28.28 +#include "SDL_mx6video.h"
   28.29 +
   28.30 +void MX6_PumpEvents(_THIS);
   28.31 +void MX6_EventInit(_THIS);
   28.32 +void MX6_EventQuit(_THIS);
   28.33 +
   28.34 +#endif /* _SDL_mx6events_c_h */
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/src/video/mx6/SDL_mx6opengles.c	Wed Sep 10 18:10:37 2014 -0300
    29.3 @@ -0,0 +1,209 @@
    29.4 +/*
    29.5 +  Simple DirectMedia Layer
    29.6 +  Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
    29.7 +
    29.8 +  This software is provided 'as-is', without any express or implied
    29.9 +  warranty.  In no event will the authors be held liable for any damages
   29.10 +  arising from the use of this software.
   29.11 +
   29.12 +  Permission is granted to anyone to use this software for any purpose,
   29.13 +  including commercial applications, and to alter it and redistribute it
   29.14 +  freely, subject to the following restrictions:
   29.15 +
   29.16 +  1. The origin of this software must not be misrepresented; you must not
   29.17 +     claim that you wrote the original software. If you use this software
   29.18 +     in a product, an acknowledgment in the product documentation would be
   29.19 +     appreciated but is not required.
   29.20 +  2. Altered source versions must be plainly marked as such, and must not be
   29.21 +     misrepresented as being the original software.
   29.22 +  3. This notice may not be removed or altered from any source distribution.
   29.23 +*/
   29.24 +#include "../../SDL_internal.h"
   29.25 +
   29.26 +#if SDL_VIDEO_DRIVER_MX6 && SDL_VIDEO_OPENGL_EGL
   29.27 +
   29.28 +#include "SDL_mx6opengles.h"
   29.29 +#include "SDL_loadso.h"
   29.30 +#include "SDL_mx6video.h"
   29.31 +
   29.32 +#define DEFAULT_OGL "libGL.so.1"
   29.33 +#define DEFAULT_EGL "libEGL.so.1"
   29.34 +#define DEFAULT_OGL_ES2 "libGLESv2.so.2"
   29.35 +#define DEFAULT_OGL_ES "libGLESv1_CM.so.1"
   29.36 +
   29.37 +#define LOAD_FUNC(NAME) \
   29.38 +*((void**)&_this->egl_data->NAME) = SDL_LoadFunction(_this->egl_data->dll_handle, #NAME); \
   29.39 +if (!_this->egl_data->NAME) \
   29.40 +{ \
   29.41 +    return SDL_SetError("Could not retrieve EGL function " #NAME); \
   29.42 +}
   29.43 +
   29.44 +#define LOAD_VIV_FUNC(NAME) \
   29.45 +*((void**)&egl_viv_data->NAME) = SDL_LoadFunction(_this->egl_data->dll_handle, #NAME); \
   29.46 +if (!egl_viv_data->NAME) \
   29.47 +{ \
   29.48 +    return SDL_SetError("Could not retrieve EGL function " #NAME); \
   29.49 +}
   29.50 +
   29.51 +/* EGL implementation of SDL OpenGL support */
   29.52 +
   29.53 +int
   29.54 +MX6_GLES_LoadLibrary(_THIS, const char *egl_path) {
   29.55 +    /* The definitions of egl_dll_handle and dll_handle were interchanged for some reason.
   29.56 +       Just left them as is for compatibility */
   29.57 +    void *dll_handle = NULL, *egl_dll_handle = NULL;
   29.58 +    char *path = NULL;
   29.59 +    SDL_DisplayData *displaydata;
   29.60 +
   29.61 +    if (_this->egl_data) {
   29.62 +        return SDL_SetError("OpenGL ES context already created");
   29.63 +    }
   29.64 +
   29.65 +    _this->egl_data = (struct SDL_EGL_VideoData *) SDL_calloc(1, sizeof(SDL_EGL_VideoData));
   29.66 +    if (!_this->egl_data) {
   29.67 +        return SDL_OutOfMemory();
   29.68 +    }
   29.69 +
   29.70 +    egl_viv_data = (struct MX6_EGL_VivanteData *) SDL_calloc(1, sizeof(MX6_EGL_VivanteData));
   29.71 +    if (!egl_viv_data) {
   29.72 +        return SDL_OutOfMemory();
   29.73 +    }
   29.74 +
   29.75 +    path = SDL_getenv("SDL_VIDEO_GL_DRIVER");
   29.76 +    if (path != NULL) {
   29.77 +        egl_dll_handle = SDL_LoadObject(path);
   29.78 +    }
   29.79 +
   29.80 +    if (egl_dll_handle == NULL) {
   29.81 +        if(_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) {
   29.82 +            if (_this->gl_config.major_version > 1) {
   29.83 +                path = DEFAULT_OGL_ES2;
   29.84 +                egl_dll_handle = SDL_LoadObject(path);
   29.85 +            }
   29.86 +            else {
   29.87 +                path = DEFAULT_OGL_ES;
   29.88 +                egl_dll_handle = SDL_LoadObject(path);
   29.89 +            }
   29.90 +        }      
   29.91 +        else {
   29.92 +            path = DEFAULT_OGL;
   29.93 +            egl_dll_handle = SDL_LoadObject(path);
   29.94 +        }     
   29.95 +    }
   29.96 +    _this->egl_data->egl_dll_handle = egl_dll_handle;
   29.97 +
   29.98 +    if (egl_dll_handle == NULL) {
   29.99 +        return SDL_SetError("Could not initialize OpenGL / GLES library");
  29.100 +    }
  29.101 +
  29.102 +    if (egl_path != NULL) {
  29.103 +        dll_handle = SDL_LoadObject(egl_path);
  29.104 +    }   
  29.105 +    
  29.106 +    if (SDL_LoadFunction(dll_handle, "eglChooseConfig") == NULL) {
  29.107 +        if (dll_handle != NULL) {
  29.108 +            SDL_UnloadObject(dll_handle);
  29.109 +        }
  29.110 +        path = SDL_getenv("SDL_VIDEO_EGL_DRIVER");
  29.111 +        if (path == NULL) {
  29.112 +            path = DEFAULT_EGL;
  29.113 +        }
  29.114 +        dll_handle = SDL_LoadObject(path);
  29.115 +        if (dll_handle == NULL) {
  29.116 +            return SDL_SetError("Could not load EGL library");
  29.117 +        }
  29.118 +    }
  29.119 +
  29.120 +    _this->egl_data->dll_handle = dll_handle;
  29.121 +
  29.122 +    /* Load new function pointers */
  29.123 +    LOAD_FUNC(eglGetDisplay);
  29.124 +    LOAD_FUNC(eglInitialize);
  29.125 +    LOAD_FUNC(eglTerminate);
  29.126 +    LOAD_FUNC(eglGetProcAddress);
  29.127 +    LOAD_FUNC(eglChooseConfig);
  29.128 +    LOAD_FUNC(eglGetConfigAttrib);
  29.129 +    LOAD_FUNC(eglCreateContext);
  29.130 +    LOAD_FUNC(eglDestroyContext);
  29.131 +    LOAD_FUNC(eglCreateWindowSurface);
  29.132 +    LOAD_FUNC(eglDestroySurface);
  29.133 +    LOAD_FUNC(eglMakeCurrent);
  29.134 +    LOAD_FUNC(eglSwapBuffers);
  29.135 +    LOAD_FUNC(eglSwapInterval);
  29.136 +    LOAD_FUNC(eglWaitNative);
  29.137 +    LOAD_FUNC(eglWaitGL);
  29.138 +    LOAD_FUNC(eglBindAPI);
  29.139 +    /* Functions from Vivante GPU SDK */
  29.140 +    LOAD_VIV_FUNC(fbGetDisplay);
  29.141 +    LOAD_VIV_FUNC(fbGetDisplayByIndex);
  29.142 +    LOAD_VIV_FUNC(fbGetDisplayGeometry);
  29.143 +    LOAD_VIV_FUNC(fbGetDisplayInfo);
  29.144 +    LOAD_VIV_FUNC(fbDestroyDisplay);
  29.145 +    LOAD_VIV_FUNC(fbCreateWindow);
  29.146 +    LOAD_VIV_FUNC(fbGetWindowGeometry);
  29.147 +    LOAD_VIV_FUNC(fbGetWindowInfo);
  29.148 +    LOAD_VIV_FUNC(fbDestroyWindow);
  29.149 +    LOAD_VIV_FUNC(fbCreatePixmap);
  29.150 +    LOAD_VIV_FUNC(fbCreatePixmapWithBpp);
  29.151 +    LOAD_VIV_FUNC(fbGetPixmapGeometry);
  29.152 +    LOAD_VIV_FUNC(fbGetPixmapInfo);
  29.153 +    LOAD_VIV_FUNC(fbDestroyPixmap);
  29.154 +   
  29.155 +    displaydata = SDL_GetDisplayDriverData(0);
  29.156 +
  29.157 +    _this->egl_data->egl_display = _this->egl_data->eglGetDisplay(displaydata->native_display);
  29.158 +    if (!_this->egl_data->egl_display) {
  29.159 +        return SDL_SetError("Could not get EGL display");
  29.160 +    }
  29.161 +    
  29.162 +    if (_this->egl_data->eglInitialize(_this->egl_data->egl_display, NULL, NULL) != EGL_TRUE) {
  29.163 +        return SDL_SetError("Could not initialize EGL");
  29.164 +    }
  29.165 +
  29.166 +    displaydata->egl_display = _this->egl_data->egl_display;
  29.167 +
  29.168 +    _this->gl_config.driver_loaded = 1;
  29.169 +
  29.170 +    if (path) {
  29.171 +        SDL_strlcpy(_this->gl_config.driver_path, path, sizeof(_this->gl_config.driver_path) - 1);
  29.172 +    } else {
  29.173 +        *_this->gl_config.driver_path = '\0';
  29.174 +    }
  29.175 +    
  29.176 +    return 0;
  29.177 +}
  29.178 +
  29.179 +void
  29.180 +MX6_GLES_UnloadLibrary(_THIS)
  29.181 +{
  29.182 +    if (_this->egl_data) {
  29.183 +        if (_this->egl_data->egl_display) {
  29.184 +            _this->egl_data->eglTerminate(_this->egl_data->egl_display);
  29.185 +            _this->egl_data->egl_display = NULL;
  29.186 +        }
  29.187 +
  29.188 +        if (_this->egl_data->dll_handle) {
  29.189 +            SDL_UnloadObject(_this->egl_data->dll_handle);
  29.190 +            _this->egl_data->dll_handle = NULL;
  29.191 +        }
  29.192 +        if (_this->egl_data->egl_dll_handle) {
  29.193 +            SDL_UnloadObject(_this->egl_data->egl_dll_handle);
  29.194 +            _this->egl_data->egl_dll_handle = NULL;
  29.195 +        }
  29.196 +        
  29.197 +        SDL_free(_this->egl_data);
  29.198 +        _this->egl_data = NULL;
  29.199 +
  29.200 +        SDL_free(egl_viv_data);
  29.201 +        egl_viv_data = NULL;
  29.202 +    }
  29.203 +}
  29.204 +
  29.205 +SDL_EGL_CreateContext_impl(MX6)
  29.206 +SDL_EGL_SwapWindow_impl(MX6)
  29.207 +SDL_EGL_MakeCurrent_impl(MX6)
  29.208 +
  29.209 +#endif /* SDL_VIDEO_DRIVER_MX6 && SDL_VIDEO_OPENGL_EGL */
  29.210 +
  29.211 +/* vi: set ts=4 sw=4 expandtab: */
  29.212 +
    30.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.2 +++ b/src/video/mx6/SDL_mx6opengles.h	Wed Sep 10 18:10:37 2014 -0300
    30.3 @@ -0,0 +1,68 @@
    30.4 +/*
    30.5 +  Simple DirectMedia Layer
    30.6 +  Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
    30.7 +
    30.8 +  This software is provided 'as-is', without any express or implied
    30.9 +  warranty.  In no event will the authors be held liable for any damages
   30.10 +  arising from the use of this software.
   30.11 +
   30.12 +  Permission is granted to anyone to use this software for any purpose,
   30.13 +  including commercial applications, and to alter it and redistribute it
   30.14 +  freely, subject to the following restrictions:
   30.15 +
   30.16 +  1. The origin of this software must not be misrepresented; you must not
   30.17 +     claim that you wrote the original software. If you use this software
   30.18 +     in a product, an acknowledgment in the product documentation would be
   30.19 +     appreciated but is not required.
   30.20 +  2. Altered source versions must be plainly marked as such, and must not be
   30.21 +     misrepresented as being the original software.
   30.22 +  3. This notice may not be removed or altered from any source distribution.
   30.23 +*/
   30.24 +#include "../../SDL_internal.h"
   30.25 +
   30.26 +#ifndef _SDL_mx6opengles_h
   30.27 +#define _SDL_mx6opengles_h
   30.28 +
   30.29 +#if SDL_VIDEO_DRIVER_MX6 && SDL_VIDEO_OPENGL_EGL
   30.30 +
   30.31 +#include "../SDL_sysvideo.h"
   30.32 +#include "../SDL_egl_c.h"
   30.33 +
   30.34 +typedef struct MX6_EGL_VivanteData
   30.35 +{
   30.36 +    EGLNativeDisplayType(EGLAPIENTRY *fbGetDisplay) (void *context);
   30.37 +    EGLNativeDisplayType(EGLAPIENTRY *fbGetDisplayByIndex) (int DisplayIndex);
   30.38 +    void(EGLAPIENTRY *fbGetDisplayGeometry) (EGLNativeDisplayType Display, int *Width, int *Height);
   30.39 +    void(EGLAPIENTRY *fbGetDisplayInfo) (EGLNativeDisplayType Display, int *Width, int *Height, unsigned long *Physical, int *Stride, int *BitsPerPixel);
   30.40 +    void(EGLAPIENTRY *fbDestroyDisplay) (EGLNativeDisplayType Display);
   30.41 +    EGLNativeWindowType(EGLAPIENTRY *fbCreateWindow) (EGLNativeDisplayType Display, int X, int Y, int Width, int Height);
   30.42 +    void(EGLAPIENTRY *fbGetWindowGeometry) (EGLNativeWindowType Window, int *X, int *Y, int *Width, int *Height);
   30.43 +    void(EGLAPIENTRY *fbGetWindowInfo) (EGLNativeWindowType Window, int *X, int *Y, int *Width, int *Height, int *BitsPerPixel, unsigned int *Offset);
   30.44 +    void(EGLAPIENTRY *fbDestroyWindow) (EGLNativeWindowType Window);
   30.45 +    EGLNativePixmapType(EGLAPIENTRY *fbCreatePixmap) (EGLNativeDisplayType Display, int Width, int Height);
   30.46 +    EGLNativePixmapType(EGLAPIENTRY *fbCreatePixmapWithBpp) (EGLNativeDisplayType Display, int Width, int Height, int BitsPerPixel);
   30.47 +    void(EGLAPIENTRY *fbGetPixmapGeometry) (EGLNativePixmapType Pixmap, int *Width, int *Height);
   30.48 +    void(EGLAPIENTRY *fbGetPixmapInfo) (EGLNativePixmapType Pixmap, int *Width, int *Height, int *BitsPerPixel, int *Stride, void **Bits);
   30.49 +    void(EGLAPIENTRY *fbDestroyPixmap) (EGLNativePixmapType Pixmap);
   30.50 +} MX6_EGL_VivanteData;
   30.51 +
   30.52 +struct MX6_EGL_VivanteData *egl_viv_data;
   30.53 +
   30.54 +/* OpenGLES functions */
   30.55 +#define MX6_GLES_GetAttribute SDL_EGL_GetAttribute
   30.56 +#define MX6_GLES_GetProcAddress SDL_EGL_GetProcAddress
   30.57 +#define MX6_GLES_SetSwapInterval SDL_EGL_SetSwapInterval
   30.58 +#define MX6_GLES_GetSwapInterval SDL_EGL_GetSwapInterval
   30.59 +#define MX6_GLES_DeleteContext SDL_EGL_DeleteContext
   30.60 +
   30.61 +extern int MX6_GLES_LoadLibrary(_THIS, const char *path);
   30.62 +extern void MX6_GLES_UnloadLibrary(_THIS);
   30.63 +extern SDL_GLContext MX6_GLES_CreateContext(_THIS, SDL_Window * window);
   30.64 +extern void MX6_GLES_SwapWindow(_THIS, SDL_Window * window);
   30.65 +extern int MX6_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
   30.66 +
   30.67 +#endif /* SDL_VIDEO_DRIVER_MX6 && SDL_VIDEO_OPENGL_EGL */
   30.68 +
   30.69 +#endif /* _SDL_mx6opengles_h */
   30.70 +
   30.71 +/* vi: set ts=4 sw=4 expandtab: */
    31.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.2 +++ b/src/video/mx6/SDL_mx6video.c	Wed Sep 10 18:10:37 2014 -0300
    31.3 @@ -0,0 +1,325 @@
    31.4 +/*
    31.5 +  Simple DirectMedia Layer
    31.6 +  Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
    31.7 +
    31.8 +  This software is provided 'as-is', without any express or implied
    31.9 +  warranty.  In no event will the authors be held liable for any damages
   31.10 +  arising from the use of this software.
   31.11 +
   31.12 +  Permission is granted to anyone to use this software for any purpose,
   31.13 +  including commercial applications, and to alter it and redistribute it
   31.14 +  freely, subject to the following restrictions:
   31.15 +
   31.16 +  1. The origin of this software must not be misrepresented; you must not
   31.17 +     claim that you wrote the original software. If you use this software
   31.18 +     in a product, an acknowledgment in the product documentation would be
   31.19 +     appreciated but is not required.
   31.20 +  2. Altered source versions must be plainly marked as such, and must not be
   31.21 +     misrepresented as being the original software.
   31.22 +  3. This notice may not be removed or altered from any source distribution.
   31.23 +*/
   31.24 +
   31.25 +#include "../../SDL_internal.h"
   31.26 +
   31.27 +#if SDL_VIDEO_DRIVER_MX6
   31.28 +
   31.29 +/* SDL internals */
   31.30 +#include "../SDL_sysvideo.h"
   31.31 +#include "SDL_version.h"
   31.32 +#include "SDL_syswm.h"
   31.33 +#include "SDL_loadso.h"
   31.34 +#include "SDL_events.h"
   31.35 +
   31.36 +#ifdef SDL_INPUT_LINUXEV
   31.37 +#include "../../core/linux/SDL_evdev.h"
   31.38 +#endif
   31.39 +
   31.40 +#include "SDL_mx6video.h"
   31.41 +#include "SDL_mx6events_c.h"
   31.42 +#include "SDL_mx6opengles.h"
   31.43 +
   31.44 +static int
   31.45 +MX6_Available(void)
   31.46 +{
   31.47 +    return 1;
   31.48 +}
   31.49 +
   31.50 +static void
   31.51 +MX6_Destroy(SDL_VideoDevice * device)
   31.52 +{
   31.53 +    if (device->driverdata != NULL) {
   31.54 +        device->driverdata = NULL;
   31.55 +    }
   31.56 +}
   31.57 +
   31.58 +static SDL_VideoDevice *
   31.59 +MX6_Create()
   31.60 +{
   31.61 +    SDL_VideoDevice *device;
   31.62 +    SDL_VideoData *phdata;
   31.63 +
   31.64 +    /* Initialize SDL_VideoDevice structure */
   31.65 +    device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
   31.66 +    if (device == NULL) {
   31.67 +        SDL_OutOfMemory();
   31.68 +        return NULL;
   31.69 +    }
   31.70 +
   31.71 +    /* Initialize internal data */
   31.72 +    phdata = (SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
   31.73 +    if (phdata == NULL) {
   31.74 +        SDL_OutOfMemory();
   31.75 +        SDL_free(device);
   31.76 +        return NULL;
   31.77 +    }
   31.78 +
   31.79 +    device->driverdata = phdata;
   31.80 +
   31.81 +    /* Setup amount of available displays and current display */
   31.82 +    device->num_displays = 0;
   31.83 +
   31.84 +    /* Set device free function */
   31.85 +    device->free = MX6_Destroy;
   31.86 +
   31.87 +    /* Setup all functions which we can handle */
   31.88 +    device->VideoInit = MX6_VideoInit;
   31.89 +    device->VideoQuit = MX6_VideoQuit;
   31.90 +    device->GetDisplayModes = MX6_GetDisplayModes;
   31.91 +    device->SetDisplayMode = MX6_SetDisplayMode;
   31.92 +    device->CreateWindow = MX6_CreateWindow;
   31.93 +    device->CreateWindowFrom = MX6_CreateWindowFrom;
   31.94 +    device->SetWindowTitle = MX6_SetWindowTitle;
   31.95 +    device->SetWindowIcon = MX6_SetWindowIcon;
   31.96 +    device->SetWindowPosition = MX6_SetWindowPosition;
   31.97 +    device->SetWindowSize = MX6_SetWindowSize;
   31.98 +    device->ShowWindow = MX6_ShowWindow;
   31.99 +    device->HideWindow = MX6_HideWindow;
  31.100 +    device->RaiseWindow = MX6_RaiseWindow;
  31.101 +    device->MaximizeWindow = MX6_MaximizeWindow;
  31.102 +    device->MinimizeWindow = MX6_MinimizeWindow;
  31.103 +    device->RestoreWindow = MX6_RestoreWindow;
  31.104 +    device->SetWindowGrab = MX6_SetWindowGrab;
  31.105 +    device->DestroyWindow = MX6_DestroyWindow;
  31.106 +    device->GetWindowWMInfo = MX6_GetWindowWMInfo;
  31.107 +
  31.108 +    device->GL_LoadLibrary = MX6_GLES_LoadLibrary;
  31.109 +    device->GL_GetProcAddress = MX6_GLES_GetProcAddress;
  31.110 +    device->GL_UnloadLibrary = MX6_GLES_UnloadLibrary;
  31.111 +    device->GL_CreateContext = MX6_GLES_CreateContext;
  31.112 +    device->GL_MakeCurrent = MX6_GLES_MakeCurrent;
  31.113 +    device->GL_SetSwapInterval = MX6_GLES_SetSwapInterval;
  31.114 +    device->GL_GetSwapInterval = MX6_GLES_GetSwapInterval;
  31.115 +    device->GL_SwapWindow = MX6_GLES_SwapWindow;
  31.116 +    device->GL_DeleteContext = MX6_GLES_DeleteContext;
  31.117 +
  31.118 +    device->PumpEvents = MX6_PumpEvents;
  31.119 +
  31.120 +    return device;
  31.121 +}
  31.122 +
  31.123 +VideoBootStrap MX6_bootstrap = {
  31.124 +    "MX6",
  31.125 +    "Freescale i.MX6 Video Driver",
  31.126 +    MX6_Available,
  31.127 +    MX6_Create
  31.128 +};
  31.129 +
  31.130 +static void
  31.131 +MX6_UpdateDisplay(_THIS)
  31.132 +{
  31.133 +    SDL_VideoDisplay *display = &_this->displays[0];
  31.134 +    SDL_DisplayData *data = (SDL_DisplayData*)display->driverdata;
  31.135 +    EGLNativeDisplayType native_display = egl_viv_data->fbGetDisplayByIndex(0);
  31.136 +    SDL_DisplayMode current_mode;
  31.137 +    int pitch, bpp;
  31.138 +    unsigned long pixels;
  31.139 +
  31.140 +    /* Store the native EGL display */
  31.141 +    data->native_display = native_display;
  31.142 +
  31.143 +    SDL_zero(current_mode);
  31.144 +    egl_viv_data->fbGetDisplayInfo(native_display, &current_mode.w, &current_mode.h, &pixels, &pitch, &bpp);
  31.145 +    /* FIXME: How do we query refresh rate? */
  31.146 +    current_mode.refresh_rate = 60;
  31.147 +
  31.148 +    switch (bpp)
  31.149 +    {
  31.150 +    default: /* Is another format used? */
  31.151 +    case 16:
  31.152 +        current_mode.format = SDL_PIXELFORMAT_RGB565;
  31.153 +        break;
  31.154 +    }
  31.155 +
  31.156 +    display->desktop_mode = current_mode;
  31.157 +    display->current_mode = current_mode;
  31.158 +}
  31.159 +
  31.160 +/*****************************************************************************/
  31.161 +/* SDL Video and Display initialization/handling functions                   */
  31.162 +/*****************************************************************************/
  31.163 +int
  31.164 +MX6_VideoInit(_THIS)
  31.165 +{
  31.166 +    SDL_VideoDisplay display;
  31.167 +    SDL_DisplayMode current_mode;
  31.168 +    SDL_DisplayData *data;
  31.169 +    
  31.170 +    data = (SDL_DisplayData *) SDL_calloc(1, sizeof(SDL_DisplayData));
  31.171 +    if (data == NULL) {
  31.172 +        return SDL_OutOfMemory();
  31.173 +    }
  31.174 +
  31.175 +    SDL_zero(display);
  31.176 +    SDL_zero(current_mode);
  31.177 +    display.desktop_mode = current_mode;
  31.178 +    display.current_mode = current_mode;
  31.179 +    display.driverdata = data;
  31.180 +    SDL_AddVideoDisplay(&display);
  31.181 +
  31.182 +    if (SDL_GL_LoadLibrary(NULL) < 0) {
  31.183 +        return -1;
  31.184 +    }
  31.185 +    MX6_UpdateDisplay(_this);
  31.186 +
  31.187 +#ifdef SDL_INPUT_LINUXEV    
  31.188 +    SDL_EVDEV_Init();
  31.189 +#endif    
  31.190 +
  31.191 +    return 1;
  31.192 +}
  31.193 +
  31.194 +void
  31.195 +MX6_VideoQuit(_THIS)
  31.196 +{
  31.197 +#ifdef SDL_INPUT_LINUXEV    
  31.198 +    SDL_EVDEV_Quit();
  31.199 +#endif    
  31.200 +}
  31.201 +
  31.202 +void
  31.203 +MX6_GetDisplayModes(_THIS, SDL_VideoDisplay * display)
  31.204 +{
  31.205 +    /* Only one display mode available, the current one */
  31.206 +    SDL_AddDisplayMode(display, &display->current_mode);
  31.207 +}
  31.208 +
  31.209 +int
  31.210 +MX6_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode)
  31.211 +{
  31.212 +    return 0;
  31.213 +}
  31.214 +
  31.215 +int
  31.216 +MX6_CreateWindow(_THIS, SDL_Window * window)
  31.217 +{
  31.218 +    SDL_DisplayData *displaydata;
  31.219 +    SDL_WindowData *wdata;
  31.220 +    
  31.221 +    displaydata = SDL_GetDisplayDriverData(0);
  31.222 +    
  31.223 +    /* Allocate window internal data */
  31.224 +    wdata = (SDL_WindowData *) SDL_calloc(1, sizeof(SDL_WindowData));
  31.225 +    if (wdata == NULL) {
  31.226 +        return SDL_OutOfMemory();
  31.227 +    }
  31.228 +
  31.229 +    /* Setup driver data for this window */
  31.230 +    window->driverdata = wdata;
  31.231 +    window->flags |= SDL_WINDOW_OPENGL;
  31.232 +    
  31.233 +    if (!_this->egl_data) {
  31.234 +        return -1;
  31.235 +    }
  31.236 +
  31.237 +    wdata->native_window = egl_viv_data->fbCreateWindow(displaydata->native_display, window->x, window->y, window->w, window->h);    
  31.238 +    if (!wdata->native_window) {
  31.239 +        return SDL_SetError("MX6: Can't create native window");
  31.240 +    }
  31.241 +
  31.242 +    wdata->egl_surface = SDL_EGL_CreateSurface(_this, wdata->native_window);
  31.243 +    if (wdata->egl_surface == EGL_NO_SURFACE) {
  31.244 +        return SDL_SetError("MX6: Can't create EGL surface");
  31.245 +    }
  31.246 +
  31.247 +    /* Window has been successfully created */
  31.248 +    return 0;
  31.249 +}
  31.250 +
  31.251 +void
  31.252 +MX6_DestroyWindow(_THIS, SDL_Window * window)
  31.253 +{
  31.254 +    SDL_WindowData *wdata;
  31.255 +    
  31.256 +    wdata = window->driverdata;
  31.257 +    if (wdata) {
  31.258 +        SDL_EGL_DestroySurface(_this, wdata->egl_surface);
  31.259 +    }
  31.260 +
  31.261 +    if (egl_viv_data) {
  31.262 +        egl_viv_data->fbDestroyWindow(wdata->native_window);
  31.263 +    }
  31.264 +}
  31.265 +
  31.266 +int
  31.267 +MX6_CreateWindowFrom(_THIS, SDL_Window * window, const void *data)
  31.268 +{
  31.269 +    return -1;
  31.270 +}
  31.271 +
  31.272 +void
  31.273 +MX6_SetWindowTitle(_THIS, SDL_Window * window)
  31.274 +{
  31.275 +}
  31.276 +void
  31.277 +MX6_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon)
  31.278 +{
  31.279 +}
  31.280 +void
  31.281 +MX6_SetWindowPosition(_THIS, SDL_Window * window)
  31.282 +{
  31.283 +}
  31.284 +void
  31.285 +MX6_SetWindowSize(_THIS, SDL_Window * window)
  31.286 +{
  31.287 +}
  31.288 +void
  31.289 +MX6_ShowWindow(_THIS, SDL_Window * window)
  31.290 +{
  31.291 +}
  31.292 +void
  31.293 +MX6_HideWindow(_THIS, SDL_Window * window)
  31.294 +{
  31.295 +}
  31.296 +void
  31.297 +MX6_RaiseWindow(_THIS, SDL_Window * window)
  31.298 +{
  31.299 +}
  31.300 +void
  31.301 +MX6_MaximizeWindow(_THIS, SDL_Window * window)
  31.302 +{
  31.303 +}
  31.304 +void
  31.305 +MX6_MinimizeWindow(_THIS, SDL_Window * window)
  31.306 +{
  31.307 +}
  31.308 +void
  31.309 +MX6_RestoreWindow(_THIS, SDL_Window * window)
  31.310 +{
  31.311 +}
  31.312 +void
  31.313 +MX6_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed)
  31.314 +{
  31.315 +}
  31.316 +
  31.317 +/*****************************************************************************/
  31.318 +/* SDL Window Manager function                                               */
  31.319 +/*****************************************************************************/
  31.320 +SDL_bool
  31.321 +MX6_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info)
  31.322 +{
  31.323 +    return SDL_TRUE;
  31.324 +}
  31.325 +
  31.326 +#endif /* SDL_VIDEO_DRIVER_MX6 */
  31.327 +
  31.328 +/* vi: set ts=4 sw=4 expandtab: */
    32.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.2 +++ b/src/video/mx6/SDL_mx6video.h	Wed Sep 10 18:10:37 2014 -0300
    32.3 @@ -0,0 +1,76 @@
    32.4 +/*
    32.5 +  Simple DirectMedia Layer
    32.6 +  Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
    32.7 +
    32.8 +  This software is provided 'as-is', without any express or implied
    32.9 +  warranty.  In no event will the authors be held liable for any damages
   32.10 +  arising from the use of this software.
   32.11 +
   32.12 +  Permission is granted to anyone to use this software for any purpose,
   32.13 +  including commercial applications, and to alter it and redistribute it
   32.14 +  freely, subject to the following restrictions:
   32.15 +
   32.16 +  1. The origin of this software must not be misrepresented; you must not
   32.17 +     claim that you wrote the original software. If you use this software
   32.18 +     in a product, an acknowledgment in the product documentation would be
   32.19 +     appreciated but is not required.
   32.20 +  2. Altered source versions must be plainly marked as such, and must not be
   32.21 +     misrepresented as being the original software.
   32.22 +  3. This notice may not be removed or altered from any source distribution.
   32.23 +*/
   32.24 +
   32.25 +#ifndef __SDL_MX6VIDEO_H__
   32.26 +#define __SDL_MX6VIDEO_H__
   32.27 +
   32.28 +#include "../../SDL_internal.h"
   32.29 +#include "../SDL_sysvideo.h"
   32.30 +
   32.31 +#include "SDL_egl.h"
   32.32 +
   32.33 +typedef struct SDL_VideoData
   32.34 +{
   32.35 +} SDL_VideoData;
   32.36 +
   32.37 +typedef struct SDL_DisplayData
   32.38 +{
   32.39 +    EGLNativeDisplayType native_display;
   32.40 +    EGLDisplay egl_display;
   32.41 +} SDL_DisplayData;
   32.42 +
   32.43 +typedef struct SDL_WindowData
   32.44 +{
   32.45 +    EGLNativeWindowType native_window;
   32.46 +    EGLSurface egl_surface;
   32.47 +} SDL_WindowData;
   32.48 +
   32.49 +/****************************************************************************/
   32.50 +/* SDL_VideoDevice functions declaration                                    */
   32.51 +/****************************************************************************/
   32.52 +
   32.53 +/* Display and window functions */
   32.54 +int MX6_VideoInit(_THIS);
   32.55 +void MX6_VideoQuit(_THIS);
   32.56 +void MX6_GetDisplayModes(_THIS, SDL_VideoDisplay * display);
   32.57 +int MX6_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode);
   32.58 +int MX6_CreateWindow(_THIS, SDL_Window * window);
   32.59 +int MX6_CreateWindowFrom(_THIS, SDL_Window * window, const void *data);
   32.60 +void MX6_SetWindowTitle(_THIS, SDL_Window * window);
   32.61 +void MX6_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon);
   32.62 +void MX6_SetWindowPosition(_THIS, SDL_Window * window);
   32.63 +void MX6_SetWindowSize(_THIS, SDL_Window * window);
   32.64 +void MX6_ShowWindow(_THIS, SDL_Window * window);
   32.65 +void MX6_HideWindow(_THIS, SDL_Window * window);
   32.66 +void MX6_RaiseWindow(_THIS, SDL_Window * window);
   32.67 +void MX6_MaximizeWindow(_THIS, SDL_Window * window);
   32.68 +void MX6_MinimizeWindow(_THIS, SDL_Window * window);
   32.69 +void MX6_RestoreWindow(_THIS, SDL_Window * window);
   32.70 +void MX6_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed);
   32.71 +void MX6_DestroyWindow(_THIS, SDL_Window * window);
   32.72 +
   32.73 +/* Window manager function */
   32.74 +SDL_bool MX6_GetWindowWMInfo(_THIS, SDL_Window * window,
   32.75 +                             struct SDL_SysWMinfo *info);
   32.76 +
   32.77 +#endif /* __SDL_MX6VIDEO_H__ */
   32.78 +
   32.79 +/* vi: set ts=4 sw=4 expandtab: */
    33.1 --- a/src/video/x11/SDL_x11window.c	Wed Aug 20 17:20:22 2014 -0300
    33.2 +++ b/src/video/x11/SDL_x11window.c	Wed Sep 10 18:10:37 2014 -0300
    33.3 @@ -643,6 +643,7 @@
    33.4                      &items_read, &items_left, &propdata);
    33.5          if (status == Success && propdata) {
    33.6              title = SDL_iconv_string("UTF-8", "", SDL_static_cast(char*, propdata), items_read+1);
    33.7 +            X11_XFree(propdata);
    33.8          } else {
    33.9              title = SDL_strdup("");
   33.10          }
    34.1 --- a/test/testdrawchessboard.c	Wed Aug 20 17:20:22 2014 -0300
    34.2 +++ b/test/testdrawchessboard.c	Wed Sep 10 18:10:37 2014 -0300
    34.3 @@ -14,25 +14,22 @@
    34.4  
    34.5  /* Sample program:  Draw a Chess Board  by using SDL_CreateSoftwareRenderer API */
    34.6  
    34.7 -#include <stdlib.h>
    34.8 -#include <stdio.h>
    34.9 -
   34.10  #include "SDL.h"
   34.11  
   34.12  void
   34.13  DrawChessBoard(SDL_Renderer * renderer)
   34.14  {
   34.15 -	int row = 0,coloum = 0,x = 0;
   34.16 +	int row = 0,column = 0,x = 0;
   34.17  	SDL_Rect rect, darea;
   34.18  
   34.19  	/* Get the Size of drawing surface */
   34.20  	SDL_RenderGetViewport(renderer, &darea);
   34.21  
   34.22 -	for(row; row < 8; row++)
   34.23 +	for( ; row < 8; row++)
   34.24  	{
   34.25 -		coloum = row%2;
   34.26 -		x = x + coloum;
   34.27 -		for(coloum; coloum < 4+(row%2); coloum++)
   34.28 +		column = row%2;
   34.29 +		x = x + column;
   34.30 +		for( ; column < 4+(row%2); column++)
   34.31  		{
   34.32  			SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0xFF);
   34.33  
    35.1 --- a/test/testgamecontroller.c	Wed Aug 20 17:20:22 2014 -0300
    35.2 +++ b/test/testgamecontroller.c	Wed Sep 10 18:10:37 2014 -0300
    35.3 @@ -28,51 +28,6 @@
    35.4  #define SCREEN_HEIGHT   317
    35.5  #endif
    35.6  
    35.7 -static const char *
    35.8 -ControllerAxisName(const SDL_GameControllerAxis axis)
    35.9 -{
   35.10 -    switch (axis)
   35.11 -    {
   35.12 -        #define AXIS_CASE(ax) case SDL_CONTROLLER_AXIS_##ax: return #ax
   35.13 -        AXIS_CASE(INVALID);
   35.14 -        AXIS_CASE(LEFTX);
   35.15 -        AXIS_CASE(LEFTY);
   35.16 -        AXIS_CASE(RIGHTX);
   35.17 -        AXIS_CASE(RIGHTY);
   35.18 -        AXIS_CASE(TRIGGERLEFT);
   35.19 -        AXIS_CASE(TRIGGERRIGHT);
   35.20 -        #undef AXIS_CASE
   35.21 -        default: return "???";
   35.22 -    }
   35.23 -}
   35.24 -
   35.25 -static const char *
   35.26 -ControllerButtonName(const SDL_GameControllerButton button)
   35.27 -{
   35.28 -    switch (button)
   35.29 -    {
   35.30 -        #define BUTTON_CASE(btn) case SDL_CONTROLLER_BUTTON_##btn: return #btn
   35.31 -        BUTTON_CASE(INVALID);
   35.32 -        BUTTON_CASE(A);
   35.33 -        BUTTON_CASE(B);
   35.34 -        BUTTON_CASE(X);
   35.35 -        BUTTON_CASE(Y);
   35.36 -        BUTTON_CASE(BACK);
   35.37 -        BUTTON_CASE(GUIDE);
   35.38 -        BUTTON_CASE(START);
   35.39 -        BUTTON_CASE(LEFTSTICK);
   35.40 -        BUTTON_CASE(RIGHTSTICK);
   35.41 -        BUTTON_CASE(LEFTSHOULDER);
   35.42 -        BUTTON_CASE(RIGHTSHOULDER);
   35.43 -        BUTTON_CASE(DPAD_UP);
   35.44 -        BUTTON_CASE(DPAD_DOWN);
   35.45 -        BUTTON_CASE(DPAD_LEFT);
   35.46 -        BUTTON_CASE(DPAD_RIGHT);
   35.47 -        #undef BUTTON_CASE
   35.48 -        default: return "???";
   35.49 -    }
   35.50 -}
   35.51 -
   35.52  static SDL_Texture *
   35.53  LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent)
   35.54  {
    36.1 --- a/test/teststreaming.c	Wed Aug 20 17:20:22 2014 -0300
    36.2 +++ b/test/teststreaming.c	Wed Sep 10 18:10:37 2014 -0300
    36.3 @@ -27,27 +27,27 @@
    36.4  #define MOOSEFRAMES_COUNT 10
    36.5  
    36.6  SDL_Color MooseColors[84] = {
    36.7 -    {49, 49, 49}, {66, 24, 0}, {66, 33, 0}, {66, 66, 66},
    36.8 -    {66, 115, 49}, {74, 33, 0}, {74, 41, 16}, {82, 33, 8},
    36.9 -    {82, 41, 8}, {82, 49, 16}, {82, 82, 82}, {90, 41, 8},
   36.10 -    {90, 41, 16}, {90, 57, 24}, {99, 49, 16}, {99, 66, 24},
   36.11 -    {99, 66, 33}, {99, 74, 33}, {107, 57, 24}, {107, 82, 41},
   36.12 -    {115, 57, 33}, {115, 66, 33}, {115, 66, 41}, {115, 74, 0},
   36.13 -    {115, 90, 49}, {115, 115, 115}, {123, 82, 0}, {123, 99, 57},
   36.14 -    {132, 66, 41}, {132, 74, 41}, {132, 90, 8}, {132, 99, 33},
   36.15 -    {132, 99, 66}, {132, 107, 66}, {140, 74, 49}, {140, 99, 16},
   36.16 -    {140, 107, 74}, {140, 115, 74}, {148, 107, 24}, {148, 115, 82},
   36.17 -    {148, 123, 74}, {148, 123, 90}, {156, 115, 33}, {156, 115, 90},
   36.18 -    {156, 123, 82}, {156, 132, 82}, {156, 132, 99}, {156, 156, 156},
   36.19 -    {165, 123, 49}, {165, 123, 90}, {165, 132, 82}, {165, 132, 90},
   36.20 -    {165, 132, 99}, {165, 140, 90}, {173, 132, 57}, {173, 132, 99},
   36.21 -    {173, 140, 107}, {173, 140, 115}, {173, 148, 99}, {173, 173, 173},
   36.22 -    {181, 140, 74}, {181, 148, 115}, {181, 148, 123}, {181, 156, 107},
   36.23 -    {189, 148, 123}, {189, 156, 82}, {189, 156, 123}, {189, 156, 132},
   36.24 -    {189, 189, 189}, {198, 156, 123}, {198, 165, 132}, {206, 165, 99},
   36.25 -    {206, 165, 132}, {206, 173, 140}, {206, 206, 206}, {214, 173, 115},
   36.26 -    {214, 173, 140}, {222, 181, 148}, {222, 189, 132}, {222, 189, 156},
   36.27 -    {222, 222, 222}, {231, 198, 165}, {231, 231, 231}, {239, 206, 173}
   36.28 +    {49, 49, 49, 255}, {66, 24, 0, 255}, {66, 33, 0, 255}, {66, 66, 66, 255},
   36.29 +    {66, 115, 49, 255}, {74, 33, 0, 255}, {74, 41, 16, 255}, {82, 33, 8, 255},
   36.30 +    {82, 41, 8, 255}, {82, 49, 16, 255}, {82, 82, 82, 255}, {90, 41, 8, 255},
   36.31 +    {90, 41, 16, 255}, {90, 57, 24, 255}, {99, 49, 16, 255}, {99, 66, 24, 255},
   36.32 +    {99, 66, 33, 255}, {99, 74, 33, 255}, {107, 57, 24, 255}, {107, 82, 41, 255},
   36.33 +    {115, 57, 33, 255}, {115, 66, 33, 255}, {115, 66, 41, 255}, {115, 74, 0, 255},
   36.34 +    {115, 90, 49, 255}, {115, 115, 115, 255}, {123, 82, 0, 255}, {123, 99, 57, 255},
   36.35 +    {132, 66, 41, 255}, {132, 74, 41, 255}, {132, 90, 8, 255}, {132, 99, 33, 255},
   36.36 +    {132, 99, 66, 255}, {132, 107, 66, 255}, {140, 74, 49, 255}, {140, 99, 16, 255},
   36.37 +    {140, 107, 74, 255}, {140, 115, 74, 255}, {148, 107, 24, 255}, {148, 115, 82, 255},
   36.38 +    {148, 123, 74, 255}, {148, 123, 90, 255}, {156, 115, 33, 255}, {156, 115, 90, 255},
   36.39 +    {156, 123, 82, 255}, {156, 132, 82, 255}, {156, 132, 99, 255}, {156, 156, 156, 255},
   36.40 +    {165, 123, 49, 255}, {165, 123, 90, 255}, {165, 132, 82, 255}, {165, 132, 90, 255},
   36.41 +    {165, 132, 99, 255}, {165, 140, 90, 255}, {173, 132, 57, 255}, {173, 132, 99, 255},
   36.42 +    {173, 140, 107, 255}, {173, 140, 115, 255}, {173, 148, 99, 255}, {173, 173, 173, 255},
   36.43 +    {181, 140, 74, 255}, {181, 148, 115, 255}, {181, 148, 123, 255}, {181, 156, 107, 255},
   36.44 +    {189, 148, 123, 255}, {189, 156, 82, 255}, {189, 156, 123, 255}, {189, 156, 132, 255},
   36.45 +    {189, 189, 189, 255}, {198, 156, 123, 255}, {198, 165, 132, 255}, {206, 165, 99, 255},
   36.46 +    {206, 165, 132, 255}, {206, 173, 140, 255}, {206, 206, 206, 255}, {214, 173, 115, 255},
   36.47 +    {214, 173, 140, 255}, {222, 181, 148, 255}, {222, 189, 132, 255}, {222, 189, 156, 255},
   36.48 +    {222, 222, 222, 255}, {231, 198, 165, 255}, {231, 231, 231, 255}, {239, 206, 173, 255}
   36.49  };
   36.50  
   36.51  Uint8 MooseFrames[MOOSEFRAMES_COUNT][MOOSEFRAME_SIZE];