summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-03-11 09:58:14 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-03-11 09:58:14 +0200
commit939c0f48181046d6b938be0f5ef327a4d991e433 (patch)
tree6ef76a1a84a50537a2dcbbba3bb3d47bf6d82e5c
parenta132cb7c04a39dc81f998ec3364fbaae87927016 (diff)
Mobile: Adjustments and fixes for iOS
-rw-r--r--CMakeLists.txt16
-rw-r--r--res/LaunchScreen.storyboard7
-rw-r--r--res/MacOSXBundleInfo.plist.in176
-rw-r--r--src/ui/touch.c4
4 files changed, 105 insertions, 98 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3b61f9dc..d18a1674 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,6 +22,7 @@ project (Lagrange
22 DESCRIPTION "A Beautiful Gemini Client" 22 DESCRIPTION "A Beautiful Gemini Client"
23 LANGUAGES C 23 LANGUAGES C
24) 24)
25set (IOS_BUNDLE_VERSION 1)
25set (COPYRIGHT_YEAR 2021) 26set (COPYRIGHT_YEAR 2021)
26 27
27# Build configuration. 28# Build configuration.
@@ -190,7 +191,10 @@ if (IOS)
190 app/Images.xcassets 191 app/Images.xcassets
191 res/LaunchScreen.storyboard 192 res/LaunchScreen.storyboard
192 ) 193 )
193 set_source_files_properties(app/Images.xcassets PROPERTIES 194 set_source_files_properties(
195 app/Images.xcassets
196 res/LaunchScreen.storyboard
197 PROPERTIES
194 MACOSX_PACKAGE_LOCATION Resources 198 MACOSX_PACKAGE_LOCATION Resources
195 ) 199 )
196elseif (APPLE) 200elseif (APPLE)
@@ -275,14 +279,16 @@ if (APPLE)
275 MACOSX_BUNDLE_INFO_STRING "${PROJECT_VERSION}" 279 MACOSX_BUNDLE_INFO_STRING "${PROJECT_VERSION}"
276 MACOSX_BUNDLE_ICON_FILE "Lagrange.icns" 280 MACOSX_BUNDLE_ICON_FILE "Lagrange.icns"
277 MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION}" 281 MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION}"
278 MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_VERSION}" 282 MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}"
279 MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}" 283 MACOSX_BUNDLE_GUI_IDENTIFIER "fi.skyjake.lagrange"
280 MACOSX_BUNDLE_GUI_IDENTIFIER "fi.skyjake.Lagrange"
281 MACOSX_BUNDLE_COPYRIGHT "© ${COPYRIGHT_YEAR} Jaakko Keränen" 284 MACOSX_BUNDLE_COPYRIGHT "© ${COPYRIGHT_YEAR} Jaakko Keränen"
282 XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "fi.skyjake.Lagrange" 285 XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "fi.skyjake.lagrange"
286 XCODE_ATTRIBUTE_SKIP_INSTALL "NO"
287 XCODE_ATTRIBUTE_INSTALL_PATH "$(LOCAL_APPS_DIR)"
283 ) 288 )
284 if (IOS) 289 if (IOS)
285 set_target_properties (app PROPERTIES 290 set_target_properties (app PROPERTIES
291 MACOSX_BUNDLE_BUNDLE_VERSION "${IOS_BUNDLE_VERSION}"
286 XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2" 292 XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2"
287 XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon" 293 XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon"
288 MACOSX_BUNDLE_ICON_FILE "AppIcon" 294 MACOSX_BUNDLE_ICON_FILE "AppIcon"
diff --git a/res/LaunchScreen.storyboard b/res/LaunchScreen.storyboard
index f9a048ed..fdde7251 100644
--- a/res/LaunchScreen.storyboard
+++ b/res/LaunchScreen.storyboard
@@ -1,7 +1,8 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1<?xml version="1.0" encoding="UTF-8"?>
2<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13142" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> 2<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
3 <device id="retina6_1" orientation="portrait" appearance="light"/>
3 <dependencies> 4 <dependencies>
4 <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12042"/> 5 <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
5 </dependencies> 6 </dependencies>
6 <scenes/> 7 <scenes/>
7</document> 8</document>
diff --git a/res/MacOSXBundleInfo.plist.in b/res/MacOSXBundleInfo.plist.in
index 64f406ec..2c69c5ee 100644
--- a/res/MacOSXBundleInfo.plist.in
+++ b/res/MacOSXBundleInfo.plist.in
@@ -2,93 +2,93 @@
2<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 2<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3<plist version="1.0"> 3<plist version="1.0">
4<dict> 4<dict>
5 <key>CFBundleDevelopmentRegion</key> 5 <key>CFBundleDevelopmentRegion</key>
6 <string>English</string> 6 <string>English</string>
7 <key>CFBundleExecutable</key> 7 <key>CFBundleExecutable</key>
8 <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string> 8 <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
9 <key>CFBundleGetInfoString</key> 9 <key>CFBundleGetInfoString</key>
10 <string>${MACOSX_BUNDLE_INFO_STRING}</string> 10 <string>${MACOSX_BUNDLE_INFO_STRING}</string>
11 <key>CFBundleIconFile</key> 11 <key>CFBundleIconName</key>
12 <string>${MACOSX_BUNDLE_ICON_FILE}</string> 12 <string>${MACOSX_BUNDLE_ICON_FILE}</string>
13 <key>CFBundleIdentifier</key> 13 <key>CFBundleIdentifier</key>
14 <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string> 14 <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
15 <key>CFBundleInfoDictionaryVersion</key> 15 <key>CFBundleInfoDictionaryVersion</key>
16 <string>6.0</string> 16 <string>6.0</string>
17 <key>CFBundleLongVersionString</key> 17 <key>CFBundleName</key>
18 <string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string> 18 <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
19 <key>CFBundleName</key> 19 <key>CFBundlePackageType</key>
20 <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string> 20 <string>APPL</string>
21 <key>CFBundlePackageType</key> 21 <key>CFBundleVersion</key>
22 <string>APPL</string> 22 <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
23 <key>CFBundleShortVersionString</key> 23 <key>CFBundleShortVersionString</key>
24 <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string> 24 <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
25 <key>CFBundleSignature</key> 25 <key>CFBundleSignature</key>
26 <string>????</string> 26 <string>????</string>
27 <key>CFBundleVersion</key> 27 <key>CSResourcesFileMapped</key>
28 <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string> 28 <true/>
29 <key>CSResourcesFileMapped</key> 29 <key>NSHumanReadableCopyright</key>
30 <true/> 30 <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
31 <key>NSHumanReadableCopyright</key> 31 <key>NSHighResolutionCapable</key>
32 <string>${MACOSX_BUNDLE_COPYRIGHT}</string> 32 <true/>
33 <key>NSHighResolutionCapable</key> 33 <key>NSRequiresAquaSystemAppearance</key>
34 <true/> 34 <false/>
35 <key>NSRequiresAquaSystemAppearance</key> 35 <key>NSSupportsAutomaticGraphicsSwitching</key>
36 <false/> 36 <true/>
37 <key>NSSupportsAutomaticGraphicsSwitching</key> 37 <key>UISupportedInterfaceOrientations</key>
38 <true/> 38 <array>
39 <key>UISupportedInterfaceOrientations</key> 39 <string>UIInterfaceOrientationPortrait</string>
40 <array> 40 <string>UIInterfaceOrientationLandscapeLeft</string>
41 <string>UIInterfaceOrientationPortrait</string> 41 <string>UIInterfaceOrientationLandscapeRight</string>
42 <string>UIInterfaceOrientationLandscapeLeft</string> 42 </array>
43 <string>UIInterfaceOrientationLandscapeRight</string> 43 <key>UISupportedInterfaceOrientations~ipad</key>
44 </array> 44 <array>
45 <key>UISupportedInterfaceOrientations~ipad</key> 45 <string>UIInterfaceOrientationPortrait</string>
46 <array> 46 <string>UIInterfaceOrientationPortraitUpsideDown</string>
47 <string>UIInterfaceOrientationPortrait</string> 47 <string>UIInterfaceOrientationLandscapeLeft</string>
48 <string>UIInterfaceOrientationPortraitUpsideDown</string> 48 <string>UIInterfaceOrientationLandscapeRight</string>
49 <string>UIInterfaceOrientationLandscapeLeft</string> 49 </array>
50 <string>UIInterfaceOrientationLandscapeRight</string> 50 <key>UILaunchStoryboardName</key>
51 </array> 51 <string>LaunchScreen</string>
52 <key>UILaunchStoryboardName</key> 52 <key>LSSupportsOpeningDocumentsInPlace</key>
53 <string>LaunchScreen</string> 53 <false/>
54 <key>CFBundleDocumentTypes</key> 54 <key>CFBundleDocumentTypes</key>
55 <array> 55 <array>
56 <dict> 56 <dict>
57 <key>CFBundleTypeExtensions</key> 57 <key>CFBundleTypeExtensions</key>
58 <array> 58 <array>
59 <string>gmi</string> 59 <string>gmi</string>
60 <string>gemini</string> 60 <string>gemini</string>
61 </array> 61 </array>
62 <key>CFBundleTypeIconFile</key> 62 <key>CFBundleTypeIconFile</key>
63 <string>text-gemini.icns</string> 63 <string>text-gemini.icns</string>
64 <key>CFBundleTypeName</key> 64 <key>CFBundleTypeName</key>
65 <string>Gemini Text File</string> 65 <string>Gemini Text File</string>
66 <key>CFBundleTypeRole</key> 66 <key>CFBundleTypeRole</key>
67 <string>Viewer</string> 67 <string>Viewer</string>
68 <key>LSHandlerRank</key> 68 <key>LSHandlerRank</key>
69 <string>Default</string> 69 <string>Default</string>
70 <key>LSTypeIsPackage</key> 70 <key>LSTypeIsPackage</key>
71 <false/> 71 <false/>
72 </dict> 72 </dict>
73 </array> 73 </array>
74 <key>CFBundleURLTypes</key> 74 <key>CFBundleURLTypes</key>
75 <array> 75 <array>
76 <dict> 76 <dict>
77 <key>CFBundleURLName</key> 77 <key>CFBundleURLName</key>
78 <string>Gemini</string> 78 <string>Gemini</string>
79 <key>CFBundleURLSchemes</key> 79 <key>CFBundleURLSchemes</key>
80 <array> 80 <array>
81 <string>gemini</string> 81 <string>gemini</string>
82 </array> 82 </array>
83 </dict> 83 </dict>
84 <dict> 84 <dict>
85 <key>CFBundleURLName</key> 85 <key>CFBundleURLName</key>
86 <string>Gopher</string> 86 <string>Gopher</string>
87 <key>CFBundleURLSchemes</key> 87 <key>CFBundleURLSchemes</key>
88 <array> 88 <array>
89 <string>gopher</string> 89 <string>gopher</string>
90 </array> 90 </array>
91 </dict> 91 </dict>
92 </array> 92 </array>
93</dict> 93</dict>
94</plist> 94</plist>
diff --git a/src/ui/touch.c b/src/ui/touch.c
index ea7b6648..df457b27 100644
--- a/src/ui/touch.c
+++ b/src/ui/touch.c
@@ -492,7 +492,7 @@ iBool processEvent_Touch(const SDL_Event *ev) {
492 const size_t lastIndex = iMin(touch->posCount - 1, lastIndex_Touch_); 492 const size_t lastIndex = iMin(touch->posCount - 1, lastIndex_Touch_);
493 const uint32_t elapsed = fing->timestamp - touch->posTime[lastIndex]; 493 const uint32_t elapsed = fing->timestamp - touch->posTime[lastIndex];
494 const float minVelocity = 400.0f; 494 const float minVelocity = 400.0f;
495 if (elapsed < 85) { 495 if (elapsed < 150) {
496 velocity = divf_F3(sub_F3(pos, touch->pos[lastIndex]), 496 velocity = divf_F3(sub_F3(pos, touch->pos[lastIndex]),
497 (float) elapsed / 1000.0f); 497 (float) elapsed / 1000.0f);
498 if (touch->axis == y_TouchAxis || fabsf(x_F3(velocity)) < minVelocity) { 498 if (touch->axis == y_TouchAxis || fabsf(x_F3(velocity)) < minVelocity) {
@@ -502,7 +502,7 @@ iBool processEvent_Touch(const SDL_Event *ev) {
502 setY_F3(&velocity, 0.0f); 502 setY_F3(&velocity, 0.0f);
503 } 503 }
504 } 504 }
505// printf("elap:%ums vel:%f\n", elapsed, length_F3(velocity)); 505 //printf("elap:%ums vel:%f\n", elapsed, length_F3(velocity));
506 pushPos_Touch_(touch, pos, nowTime); 506 pushPos_Touch_(touch, pos, nowTime);
507 /* If short and didn't move far, do a tap (left click). */ 507 /* If short and didn't move far, do a tap (left click). */
508 if (duration < longPressSpanMs_ && isStationary_Touch_(touch)) { 508 if (duration < longPressSpanMs_ && isStationary_Touch_(touch)) {