diff options
340 files changed, 4 insertions, 28240 deletions
diff --git a/.gitignore b/.gitignore index 9505a95b3..97875e85a 100644 --- a/.gitignore +++ b/.gitignore @@ -39,8 +39,6 @@ src/runtime/c/sg/.dirstamp src/runtime/c/stamp-h1 src/runtime/java/.libs/ src/runtime/python/build/ -src/ui/android/libs/ -src/ui/android/obj/ .cabal-sandbox cabal.sandbox.config .stack-work diff --git a/index.html b/index.html index 78d263be5..bc621311c 100644 --- a/index.html +++ b/index.html @@ -80,7 +80,7 @@ function sitesearch() { <ul> <li><a href="http://hackage.haskell.org/package/gf-3.9/docs/PGF.html">PGF library API (Old Runtime)</a> <li><a href="doc/runtime-api.html">PGF library API (New Runtime)</a> - <li><a href="src/ui/android/README">GF on Android (new)</a> + <li><a href="https://github.com/GrammaticalFramework/gf-offline-translator/tree/master/android">GF on Android (new)</a> <li><A HREF="/android/">GF on Android (old) </A> </ul> </div> diff --git a/src/server/lighttpd.conf b/src/server/lighttpd.conf index a495d705b..88a016513 100644 --- a/src/server/lighttpd.conf +++ b/src/server/lighttpd.conf @@ -1,4 +1,4 @@ -# Run with (with -D for no-daemon) +# Run with (with -D for no-daemon) # /usr/sbin/lighttpd -f lighttpd.conf -D # @@ -10,8 +10,9 @@ server.modules = ( "mod_cgi" ) -var.basedir = var.CWD +var.basedir = var.CWD +# John: no longer valid after removing `src/ui` 2018-11-15 server.document-root = basedir + "/../ui/gwt/www" server.errorlog = basedir + "/error.log" @@ -96,4 +97,3 @@ static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" ) ## bind to port (default: 80) server.port = 41296 - diff --git a/src/ui/android/.classpath b/src/ui/android/.classpath deleted file mode 100644 index 7bc01d9a9..000000000 --- a/src/ui/android/.classpath +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="src"/> - <classpathentry kind="src" path="gen"/> - <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> - <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> - <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/> - <classpathentry kind="output" path="bin/classes"/> -</classpath> diff --git a/src/ui/android/.project b/src/ui/android/.project deleted file mode 100644 index abf063e43..000000000 --- a/src/ui/android/.project +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>GFTranslator</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>com.android.ide.eclipse.adt.ApkBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>com.android.ide.eclipse.adt.AndroidNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/src/ui/android/AndroidManifest.xml b/src/ui/android/AndroidManifest.xml deleted file mode 100644 index 84b837a08..000000000 --- a/src/ui/android/AndroidManifest.xml +++ /dev/null @@ -1,63 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="org.grammaticalframework.ui.android" - android:versionCode="15" - android:versionName="1.2.2" - android:installLocation="auto" > - - <uses-sdk - android:minSdkVersion="11" - android:targetSdkVersion="18" /> - - <uses-permission android:name="android.permission.RECORD_AUDIO" /> - - <application - android:allowBackup="true" - android:icon="@drawable/ic_app" - android:label="@string/app_name" - android:theme="@style/AppTheme" android:name="GFTranslator"> - <activity - android:name=".MainActivity" - android:label="@string/app_name" > - <intent-filter> - <action android:name="android.intent.action.MAIN" /> - - <category android:name="android.intent.category.LAUNCHER" /> - </intent-filter> - </activity> - <activity android:name="AlternativesActivity"> - <intent-filter> - <action android:name="android.intent.action.VIEW"/> - <category android:name="android.intent.category.DEFAULT"/> - <category android:name="android.intent.category.BROWSABLE"/> - <data android:scheme="gf-translator"/> - </intent-filter> - </activity> - <activity android:name="HelpActivity"></activity> - <activity android:name="SemanticGraphActivity" - android:launchMode="singleTop"> - <intent-filter> - <action android:name="android.intent.action.SEARCH" /> - </intent-filter> - <meta-data android:name="android.app.searchable" - android:resource="@xml/searchable"/> - <meta-data android:name="android.app.default_searchable" - android:value=".SearchableActivity"/> - </activity> - - <activity android:name="se.chalmers.phrasebook.gui.activities.NavigationActivity"></activity> - - <service android:name="TranslatorInputMethodService" - android:permission="android.permission.BIND_INPUT_METHOD"> - <intent-filter> - <action android:name="android.view.InputMethod" /> - </intent-filter> - <meta-data android:name="android.view.im" android:resource="@xml/method" /> - </service> - <provider android:name=".LexiconSuggestionProvider" - android:authorities="org.grammaticalframework.ui.android.LexiconSuggestionProvider"> - <path-permission android:pathPrefix="/search_suggest_query" - android:readPermission="android.permission.GLOBAL_SEARCH"/> - </provider> - </application> -</manifest> diff --git a/src/ui/android/LICENSE b/src/ui/android/LICENSE deleted file mode 100644 index cf90ceb14..000000000 --- a/src/ui/android/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ - BSD LICENSE - -Copyright (c) 1998, Grammatical Framework -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the <organization> nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/src/ui/android/README b/src/ui/android/README deleted file mode 100644 index 7adb7fe50..000000000 --- a/src/ui/android/README +++ /dev/null @@ -1,68 +0,0 @@ -= Overview = - -This directory contains a sample Android app tht uses -the Android speech recognition and TTS APIs along with -JNI bindings to the C PGF runtime to implement a simple -speech translation app. - - -= Requirements = - -1. Android SDK: http://developer.android.com/sdk/ - installed in $ANDROID_SDK_LOCATION - -2. Android NDK: http://developer.android.com/tools/sdk/ndk/ - installed in $ANDROID_NDK_LOCATION - -= Building = - -Set up Android project: - -# Creates local.properties, not to be checked in -$ $ANDROID_SDK_LOCATION/tools/android update project -p . - -Build libs/libjpgf.jar: - -$ (cd ../../runtime/java && javac org/grammaticalframework/*/*.java && jar -cf ../../ui/android/libs/jpgf.jar org/grammaticalframework/*/*.class) - -Build JNI code: - -$ cd jni -$ $ANDROID_NDK_LOCATION/ndk-build - -Build the semantic database code: - -$ runghc glosses.hs - -Build APK: - -$ ant debug - - -Install on your device: - -$ ant debug install - -or: - -$ adb install -r bin/MainActivity-debug.apk - - -= Changing the grammar = - -1. Replace assets/ResourceDemo.pgf - -2. Edit Translator.java to point to the new file and include its metadata - - -= Developing in Eclipse = - -1. Install Android ADT - -2. Eclipse > File > Import > Existing Projects into Workspace > Next - -3. Select root directory... - -4. Select GF/src/ui/android - -5. Finish
\ No newline at end of file diff --git a/src/ui/android/ant.properties b/src/ui/android/ant.properties deleted file mode 100644 index 59ddc9800..000000000 --- a/src/ui/android/ant.properties +++ /dev/null @@ -1,2 +0,0 @@ -key.store=/home/krasimir/dg/src/keys/dg_keystore -key.alias=dg diff --git a/src/ui/android/assets/help_content.html b/src/ui/android/assets/help_content.html deleted file mode 100644 index 279a2a963..000000000 --- a/src/ui/android/assets/help_content.html +++ /dev/null @@ -1,157 +0,0 @@ -<html> -<body> -</p> -<b>GF Offline Translator</b>: -text and speech translation for 16 languages with -quality control. Version 19 April 2017 (beta). -</p> -<p> -<b>Speech input</b>: Tap microphone icon and talk while it is red. -<br> -<b>Text input</b>: Select "keyboard" from menu, tap keyboard icon. -<br> -<b>Correction</b>: Tap input text and edit. -<br> -<b>Alternatives</b>: Tap output text. -<br> -<b>Grammar info</b>: Tap any of the alternatives. -<br> -<b>Confidence</b>: colour of output text -<ul> -<li><span style="background-color:palegreen">Green</span>: semantic, probably correct (but has alternatives)</li> -<li><span style="background-color:yellow">Yellow</span>: syntactic, often incorrect (has alternatives)</li> -<li><span style="background-color:pink">Light red</span>: chunk-based, probably incorrect (has alternatives)</li> -<li><span style="background-color:red">Dark red</span>: word-based, often very bad</li> -</ul> -<br> -<b>Topics</b> (new, select from menu): Words grouped by semantic categories, with WordNet glosses. -<br> -<b>Phrasebook</b> (new, select from menu): Conceptual authoring with the green translations. -</p> - -<hr> - -<h2>More details</h2> -<p> -GF Offline Translator is based on grammar and semantics. It is compact in size -and gives control on quality. Its technology is inspired by compilers, which are -programs that translate computer languages. -Most other translators for human language are based on -statistics and have less control of quality and are much bigger, so that -they require either an internet connection or a huge storage on your phone. -</p> -The app indicates translation confidence with colours: -<ul> - <li><b>Green</b>: - semantic translation, should be correct. - But not necessarily the only correct one. - You can tap the output to see alternatives. - </li> - <li><b>Yellow</b>: - syntactic translation, should be grammatically correct. - But can be very strange in its interpretation and choice of words. - </li> - <li><b>Light red</b>: - chunk translation, probably incorrect. - Builds the translation from small pieces. - </li> - <li><b>Dark red</b>: - word-by-word translation, almost certainly incorrect. - Builds the translation word by word. - </li> -</ul> -The green translations come from a tourist phrasebook, which allows -you to translate things like "hello" and "how far is the airport from -the hotel". -</p> - -<p> -You can translate both speech and text, as selected in the menu in the -upper right corner. Both kinds of input can be edited with the -keyboard by first tapping at the input field. This is often needed -because of <b>speech recognition errors</b>. Changing words -from <b>upper to lower case</b> may also be needed. -At the moment, <b>Japanese</b> and <b>Thai</b> input must be separated -to words, whereas Chinese works without spaces. -</p> -<p> -Translation works between any of the 16 supported languages, which means 240 -language pairs in the current version. But different languages are on different levels of development. -The following table gives a rough idea of what to expect: -</p> - -<p> -<center> -<table rules=all border=yes> -<tr> <th></th> <th>coverage</th> <th>quality</th> <th>speed</th> <th>speech</th> </tr> -<tr> <th>Bulgarian</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td><td bgcolor=palegreen></td> <td bgcolor=yellow>in only</td></tr> -<tr> <th>Catalan</th> <td bgcolor=pink></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=yellow></td></tr> -<tr> <th>Chinese</th> <td bgcolor=pink></td> <td bgcolor=pink></td> <td bgcolor=palegreen></td> <td bgcolor=yellow></td> </tr> -<tr> <th>Dutch</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td> <td bgcolor=yellow></td> <td bgcolor=palegreen></td> </tr> -<tr> <th>English</th> <td bgcolor=palegreen></td> <td bgcolor=palegreen></td> <td bgcolor=palegreen></td> <td bgcolor=palegreen></td> </tr> -<tr> <th>Estonian</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=red></td></tr> -<tr> <th>Finnish</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=yellow></td></tr> -<tr> <th>French</th> <td bgcolor=pink></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr> -<tr> <th>German</th> <td bgcolor=pink></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr> -<tr> <th>Hindi</th> <td bgcolor=pink></td> <td bgcolor=red></td> <td bgcolor=yellow></td> <td bgcolor=yellow></td> </tr> -<tr> <th>Italian</th> <td bgcolor=pink></td> <td bgcolor=pink></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr> -<tr> <th>Japanese*</th><td bgcolor=pink></td> <td bgcolor=pink></td><td bgcolor=yellow></td> <td bgcolor=palegreen></td></tr> -<tr> <th>Russian</th> <td bgcolor=pink></td> <td bgcolor=red></td> <td bgcolor=yellow></td> <td bgcolor=yellow></td> </tr> -<tr> <th>Spanish</th> <td bgcolor=pink></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr> -<tr> <th>Swedish</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td> <td bgcolor=palegreen></td> <td bgcolor=yellow></td></tr> -<tr> <th>Thai*</th> <td bgcolor=pink></td> <td bgcolor=pink></td><td bgcolor=yellow></td> <td bgcolor=palegreen></td></tr> -</table> -</center> -* For translation from Japanese and Thai you need to separate each word with a space -</p> -<p> -The speech input and output use Google's voice services. Their status -can hence change without notice. You can make it more stable by -installing third-party speech tools, such as SVOX, which provides -output for most of the listed languages. -</p> - -<p> -When you tap on a translation you get a screen with <b>alternative translations</b>. -Tapping on each of the alternatives -gives you <b>grammatical information</b>: -an inflection table, if it is a single word, -and a syntax tree otherwise. -</p> - -<p> -The app also provides an <b>input method</b> which you can use as -an alternative keyboard which allows you to do translation from -other applications, for instance while you are entering SMS or e-mail. -To activate it go to Settings > Language & input. -</p> - -<p> -The translation works <b>completely off-line</b>, without -internet connection, when doing text-based translation. -Even speech works off-line in some languages, -but being on-line may give you better -speech input and output and more languages. -</p> -<p> -You can also install third-party off-line speech engines, such as -<a href="https://play.google.com/store/apps/developer?id=SVOX+Mobile+Voices&hl=en">SVOX</a>. -Consult the voice/language settings on your phone to find the optimal -speech engines, and restart the app after changing the settings. -</p> - -<p> -The GF Offline Translator is powered by -<a href="http://www.grammaticalframework.org/">GF</a>, Grammatical Framework. -It is open-source software, -built by support from the GF community and from <a href="http://www.digitalgrammars.com/">Digital Grammars</a>. -</p> - -<p> -<i>Digital Grammars is a company that can tailor this app to you needs and provide good -translation for the kind of vocabulary you need. Just tell us what you want to see - in the green area!</i> -</p> - -</body> -</html> diff --git a/src/ui/android/assets/phrases.xml b/src/ui/android/assets/phrases.xml deleted file mode 100644 index 847339135..000000000 --- a/src/ui/android/assets/phrases.xml +++ /dev/null @@ -1,1035 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<phrasebook> - <sentence desc="Greetings" id="PGreeting"> - <option> - <function desc="Male Speaker" name="PGreetingMale"> - <call ref="Greeting"/> - </function> - <function desc="Female Speaker" name="PGreetingFemale"> - <call ref="Greeting"/> - </function> - </option> - </sentence> - - <sentence desc="Fixed Phrases" id="PPhrase"> - <option> - <function desc="Male Speaker" name="PGreetingMale"> - <call ref="Phrase"/> - </function> - <function desc="Female Speaker" name="PGreetingFemale"> - <call ref="Phrase"/> - </function> - </option> - </sentence> - - <sentence desc="What is somebody's name?" id="QWhatName"> - <function name="PQuestion"> - <function name="QWhatName"> - <call desc="Who are we talking about?" ref="Person"/> - </function> - </function> - </sentence> - - <sentence desc="Somebody's name is..." id="AHasName"> - <call ref="phraseit"> - <function name="PropAction"> - <function name="AHasName"> - <call ref="Person"/> - <function name="NameNN"/> - </function> - </function> - </call> - </sentence> - - <sentence desc="How old is someone?" id="QWhatAge"> - <function name="PQuestion"> - <function name="QWhatAge"> - <call ref="Person"/> - </function> - </function> - </sentence> - - <sentence desc="Someone's age is..." id="AHasAge"> - <call ref="phraseit"> - <function name="PropAction"> - <function name="AHasAge"> - <call ref="Person"/> - <function name="NNumeral"> - <numeral desc="How many years?"/> - </function> - </function> - </function> - </call> - </sentence> - - <sentence desc="Someone loves someone" id="ALove"> - <call ref="phraseit"> - <function name="PropAction"> - <function name="ALove"> - <call desc="Who loves someone?" ref="Person"/> - <call desc="Who is loved?" ref="Person"/> - </function> - </function> - </call> - </sentence> - - <sentence advanced="true" desc="Someone is married" id="AMarried"> - <call ref="phraseit"> - <function name="PropAction"> - <function name="AMarried"> - <call ref="Person"/> - </function> - </function> - </call> - </sentence> - - <sentence desc="Someone has children" id="AHasChildren"> - <call ref="phraseit"> - <function name="PropAction"> - <function name="AHasChildren"> - <call ref="Person"/> - <function name="NNumeral"> - <numeral desc="How many children?"/> - </function> - </function> - </function> - </call> - </sentence> - - <sentence desc="Someone has something" id="SHave"> - <function name="SHave"> - <call ref="Person"/> - <call desc="What do you have?" ref="Object"/> - </function> - </sentence> - - <sentence desc="Someone has currency" id="AHaveCurr"> - <call ref="phraseit"> - <function name="PropAction"> - <function name="AHaveCurr"> - <call ref="Person"/> - <call ref="Currency"/> - </function> - </function> - </call> - </sentence> - - <sentence desc="Someone lives somewhere" id="ALive"> - <call ref="phraseit"> - <function name="PropAction"> - <function name="ALive"> - <call ref="Person"/> - <call desc="Living where?" ref="country"/> - </function> - </function> - </call> - </sentence> - - <sentence desc="Someone wants to go somewhere" id="AWantGo"> - <call ref="phraseit"> - <function name="PropAction"> - <function name="AWantGo"> - <call ref="Person"/> - <call ref="Place"/> - </function> - </function> - </call> - </sentence> - - <sentence desc="Someone is a citizen" id="ACitizen"> - <call ref="phraseit"> - <function name="PropAction"> - <function name="ACitizen"> - <call ref="Person"/> - <call desc="Living where?" ref="country"/> - </function> - </function> - </call> - </sentence> - - <sentence desc="Someone is somewhere" id="ABePlace"> - <call ref="phraseit"> - <function name="PropAction"> - <function name="ABePlace"> - <call ref="Person"/> - <call ref="Place"/> - </function> - </function> - </call> - </sentence> - - <sentence desc="Something is something" id="Is"> - <call ref="phraseit"> - <function name="Is"> - <call ref="Item"/> - <call ref="Quality"/> - </function> - </call> - </sentence> - - <sentence desc="How far is something?" id="HowFar"> - <function name="PQuestion"> - <function name="HowFar"> - <call desc="What place are we asking about?" ref="Place"/> - </function> - </function> - </sentence> - - <sentence desc="How far is something from somewhere?" id="HowFarFrom"> - <function name="PQuestion"> - <function name="HowFarFrom"> - <call desc="Where are we going from?" ref="Place"/> - <call desc="Where are we going to?" ref="Place"/> - </function> - </function> - </sentence> - - <sentence desc="Some place is open" id="PropOpen"> - <call ref="phraseit"> - <option> - <function desc="now" name="PropOpen"> - <call ref="Place"/> - </function> - <function desc="on a specific date" name="PropOpenDate"> - <call ref="Place"/> - <call ref="Date"/> - </function> - <function desc="on a specific day of the week" name="PropOpenDay"> - <call ref="Place"/> - <call ref="Day"/> - </function> - </option> - </call> - </sentence> - - <sentence desc="Some place is closed" id="PropClosed"> - <call ref="phraseit"> - <option> - <function desc="now" name="PropClosed"> - <call ref="Place"/> - </function> - <function desc="on a specific date" name="PropClosedDate"> - <call ref="Place"/> - <call ref="Date"/> - </function> - <function desc="on a specific day of the week" name="PropClosedDay"> - <call ref="Place"/> - <call ref="Day"/> - </function> - </option> - </call> - </sentence> - - <sentence desc="Someone wants some food" id="AWant"> - <call ref="phraseit"> - <function name="PropAction"> - <function name="AWant"> - <call desc="Who wants food?" ref="Person"/> - <call ref="Object"/> - </function> - </function> - </call> - </sentence> - - <sentence desc="Someone likes some food" id="ALike"> - <call ref="phraseit"> - <function name="PropAction"> - <function name="ALike"> - <call desc="Who likes it?" ref="Person"/> - <call ref="Item"/> - </function> - </function> - </call> - </sentence> - - <sentence desc="Someone has a table" id="AHasTable"> - <call ref="phraseit"> - <function name="PropAction"> - <function name="AHasTable"> - <call ref="Person"/> - <function name="NNumeral"> - <numeral desc="How many persons?"/> - </function> - </function> - </function> - </call> - </sentence> - - <sentence desc="Someone has a room" id="AHasRoom"> - <call ref="phraseit"> - <function name="PropAction"> - <function name="AHasRoom"> - <call ref="Person"/> - <function name="NNumeral"> - <numeral desc="How many persons?"/> - </function> - </function> - </function> - </call> - </sentence> - - <sentence desc="Someone is hungry" id="AHungry"> - <call ref="phraseit"> - <function name="PropAction"> - <function name="AHungry"> - <call ref="Person"/> - </function> - </function> - </call> - </sentence> - - <sentence desc="Someone is thirsty" id="AThirsty"> - <call ref="phraseit"> - <function name="PropAction"> - <function name="AThirsty"> - <call ref="Person" /> - </function> - </function> - </call> - </sentence> - - <sentence desc="Someone is tired" id="ATired"> - <call ref="phraseit"> - <function name="PropAction"> - <function name="ATired"> - <call ref="Person" /> - </function> - </function> - </call> - </sentence> - - <sentence desc="Someone is scared" id="AScared"> - <call ref="phraseit"> - <function name="PropAction"> - <function name="AScared"> - <call ref="Person"/> - </function> - </function> - </call> - </sentence> - - <sentence desc="Someone is ill" id="AIll"> - <call ref="phraseit"> - <function name="PropAction"> - <function name="AIll"> - <call ref="Person"/> - </function> - </function> - </call> - </sentence> - - <sentence desc="Someone is ready" id="AReady"> - <call ref="phraseit"> - <function name="PropAction"> - <function name="AReady"> - <call ref="Person"/> - </function> - </function> - </call> - </sentence> - - <sentence desc="Someone does something" id="ADoVerbPhrase"> - <call ref="phraseit"> - <function name="PropAction"> - <option desc="Modality"> - <call desc="No modality" ref="do"/> - <call desc="can" ref="modal_do"> - <function desc="can" name="MCan"/> - </call> - <call desc="know" ref="modal_do"> - <function desc="know" name="MKnow"/> - </call> - <call desc="must" ref="modal_do"> - <function desc="must" name="MMust"/> - </call> - <call desc="want" ref="modal_do"> - <function desc="want" name="MWant"/> - </call> - </option> - </function> - </call> - </sentence> - - <sentence desc="Someone speaks a language" id="ASpeak"> - <call ref="phraseit"> - <function name="PropAction"> - <function name="ASpeak"> - <call desc="Who speaks it?" ref="Person"/> - <call ref="language"/> - </function> - </function> - </call> - </sentence> - - <sentence desc="Someone understands" id="AUnderstand"> - <call ref="phraseit"> - <function name="PropAction"> - <function name="AUnderstand"> - <call ref="Person"/> - </function> - </function> - </call> - </sentence> - - <sentence desc="Someone knows" id="AKnow"> - <call ref="phraseit"> - <function name="PropAction"> - <function name="AKnow"> - <call ref="Person"/> - </function> - </function> - </call> - </sentence> - - <sentence desc="Someone knows someone" id="AKnowPerson"> - <call ref="phraseit"> - <function name="PropAction"> - <function name="AKnowPerson"> - <call desc="Who knows it?" ref="Person"/> - <call desc="Who is known?" ref="Person"/> - </function> - </function> - </call> - </sentence> - - <sentence desc="How much does something cost?" id="HowMuchCost"> - <function name="PQuestion"> - <function name="HowMuchCost"> - <call ref="Item"/> - </function> - </function> - </sentence> - - <sentence desc="Something costs ..." id="ItCost"> - <call ref="phraseit"> - <function name="ItCost"> - <call ref="Item"/> - <call ref="Price"/> - </function> - </call> - </sentence> - - <sentence desc="Commands" id="PImperative"> - <option> - <function desc="positive, familiar" name="PImperativeFamPos"> - <call ref="VerbPhrase"/> - </function> - <function desc="positive, polite" name="PImperativePolPos"> - <call ref="VerbPhrase"/> - </function> - <function desc="positive, plural" name="PImperativePlurPos"> - <call ref="VerbPhrase"/> - </function> - <function desc="negated, familiar" name="PImperativeFamNeg"> - <call ref="VerbPhrase"/> - </function> - <function desc="negated, polite" name="PImperativePolNeg"> - <call ref="VerbPhrase"/> - </function> - <function desc="negative, plural" name="PImperativePlurNeg"> - <call ref="VerbPhrase"/> - </function> - </option> - </sentence> - - <sentence desc="Price" id="PPrice"> - <function name="PPrice"> - <call ref="Price"/> - </function> - </sentence> - - <sentence desc="Number" id="Number"> - <function name="PNumber"> - <function name="NNumeral"> - <numeral desc="Which number?"/> - </function> - </function> - </sentence> - - <!-- ___________________________________________________________________________________________ --> - <!--Option lists --> - <option desc="Who are we talking about?" id="Person"> - <function desc="me (male)" name="IMale" /> - <function desc="me (female)" name="IFemale" /> - <function desc="you (a male friend)" name="YouFamMale" /> - <function desc="you (a female friend)" name="YouFamFemale" /> - <function desc="you (a male stranger)" name="YouPolMale" /> - <function desc="you (a female stranger)" name="YouPolFemale" /> - <function desc="he" name="He"/> - <function desc="she" name="She"/> - <function desc="we (male)" name="WeMale"/> - <function desc="we (female)" name="WeFemale"/> - <function desc="you (male friends)" name="YouPlurFamMale"/> - <function desc="you (female friends)" name="YouPlurFamFemale"/> - <function desc="you (male strangers)" name="YouPlurPolMale"/> - <function desc="you (female strangers)" name="YouPlurPolFemale"/> - <function desc="they (male)" name="TheyMale"/> - <function desc="they (female)" name="TheyFemale"/> - <function desc="Wife of ..." name="Wife"> - <call ref="Person"/> - </function> - <function desc="Husband of ..." name="Husband"> - <call ref="Person"/> - </function> - <function desc="Daughter of ..." name="Daughter"> - <call ref="Person"/> - </function> - <function desc="Son of ..." name="Son"> - <call ref="Person"/> - </function> - <function desc="Children of ..." name="Children"> - <call ref="Person"/> - </function> - </option> - - <option desc="How to phrase it?" id="phraseit"> - <function desc="As a statement" name="PSentence"> - <function name="SProp"> - <boolean desc="Reported Speech"> - <argument/> - <function name="PropAction"> - <option> - <function desc="As a statement" name="AKnowSentence"> - <call ref="Person"/> - <function name="SProp"> - <argument/> - </function> - </function> - <function desc="As a question" name="AKnowQuestion"> - <call ref="Person"/> - <function name="QProp"> - <argument/> - </function> - </function> - <function desc="As a negation" name="AKnowSentence"> - <call ref="Person"/> - <function name="SPropNot"> - <argument/> - </function> - </function> - </option> - </function> - </boolean> - </function> - </function> - <function desc="As a question" name="PQuestion"> - <function name="QProp"> - <boolean desc="Reported Speech"> - <argument/> - <function name="PropAction"> - <option> - <function desc="As a statement" name="AKnowSentence"> - <call ref="Person"/> - <function name="SProp"> - <argument/> - </function> - </function> - <function desc="As a question" name="AKnowQuestion"> - <call ref="Person"/> - <function name="QProp"> - <argument/> - </function> - </function> - <function desc="As a negation" name="AKnowSentence"> - <call ref="Person"/> - <function name="SPropNot"> - <argument/> - </function> - </function> - </option> - </function> - </boolean> - </function> - </function> - <function desc="As a negation" name="PSentence"> - <function name="SPropNot"> - <boolean desc="Reported Speech"> - <argument/> - <function name="PropAction"> - <option> - <function desc="As a statement" name="AKnowSentence"> - <call ref="Person"/> - <function name="SProp"> - <argument/> - </function> - </function> - <function desc="As a question" name="AKnowQuestion"> - <call ref="Person"/> - <function name="QProp"> - <argument/> - </function> - </function> - <function desc="As a negation" name="AKnowSentence"> - <call ref="Person"/> - <function name="SPropNot"> - <argument/> - </function> - </function> - </option> - </function> - </boolean> - </function> - </function> - </option> - - <option id="language" desc="What language?"> - <function desc="Bulgarian" name="(LangNat Bulgarian)"/> - <function desc="Catalan" name="(LangNat Catalan)"/> - <function desc="Danish" name="(LangNat Danish)"/> - <function desc="Dutch" name="(LangNat Dutch)"/> - <function desc="English" name="(LangNat English)"/> - <function desc="Finnish" name="(LangNat Finnish)"/> - <function desc="Flemish" name="Flemish"/> - <function desc="French" name="(LangNat French)"/> - <function desc="German" name="(LangNat German)"/> - <function desc="Italian" name="(LangNat Italian)"/> - <function desc="Norwegian" name="(LangNat Norwegian)"/> - <function desc="Polish" name="(LangNat Polish)"/> - <function desc="Romanian" name="(LangNat Romanian)"/> - <function desc="Russian" name="(LangNat Russian)"/> - <function desc="Spanish" name="(LangNat Spanish)"/> - <function desc="Swedish" name="(LangNat Swedish)"/> - </option> - - <option id="Citizenship" desc="What nationality"> - <function desc="Belgian" name="Belgian"/> - <function desc="Bulgarian" name="CitiNat Bulgarian"/> - <function desc="Catalan" name="CitiNat Catalan"/> - <function desc="Dutch" name="CitiNat Dutch"/> - <function desc="Danish" name="CitiNat Danish"/> - <function desc="English" name="CitiNat English"/> - <function desc="Finnish" name="CitiNat Finnish"/> - <function desc="French" name="CitiNat French"/> - <function desc="German" name="CitiNat German"/> - <function desc="Italian" name="CitiNat Italian"/> - <function desc="Norwegian" name="CitiNat Norwegian"/> - <function desc="Polish" name="CitiNat Polish"/> - <function desc="Romanian" name="CitiNat Romanian"/> - <function desc="Russian" name="CitiNat Russian"/> - <function desc="Spanish" name="CitiNat Spanish"/> - <function desc="Swedish" name="CitiNat Swedish"/> - </option> - - <option desc="What place are we asking about?" id="PlaceKind"> - <function desc="airport" name="Airport"/> - <function desc="amusement park" name="AmusementPark"/> - <function desc="bank" name="Bank"/> - <function desc="bar" name="Bar"/> - <function desc="cafeteria" name="Cafeteria"/> - <function desc="center" name="Center"/> - <function desc="church" name="Church"/> - <function desc="cinema" name="Cinema"/> - <function desc="car park" name="Parking"/> - <function desc="disco" name="Disco"/> - <function desc="hospital" name="Hospital"/> - <function desc="hotel" name="Hotel"/> - <function desc="museum" name="Museum"/> - <function desc="park" name="Park"/> - <function desc="pharmacy" name="Pharmacy"/> - <function desc="post office" name="PostOffice"/> - <function desc="pub" name="Pub"/> - <function desc="restaurant" name="Restaurant"/> - <function desc="restaurant (National)" name="CitRestaurant"> - <call ref="Citizenship"/> - </function> - <function desc="school" name="School"/> - <function desc="shop" name="Shop"/> - <function desc="station" name="Station"/> - <function desc="supermarket" name="Supermarket"/> - <function desc="theatre" name="Theatre"/> - <function desc="toilet" name="Toilet"/> - <function desc="university" name="University"/> - <function desc="zoo" name="Zoo"/> - </option> - - <option id="Place"> - <function desc="a/an" name="APlace"> - <call ref="PlaceKind"/> - </function> - <function desc="the" name="ThePlace"> - <call ref="PlaceKind"/> - </function> - <function desc="the best" name="SuperlPlace"> - <function name="TheBest"/> - <call ref="PlaceKind"/> - </function> - <function desc="the worst" name="SuperlPlace"> - <function name="TheWorst"/> - <call ref="PlaceKind"/> - </function> - <function desc="the nearest" name="SuperlPlace"> - <function name="TheClosest"/> - <call ref="PlaceKind"/> - </function> - <function desc="the cheapest" name="SuperlPlace"> - <function name="TheCheapest"/> - <call ref="PlaceKind"/> - </function> - <function desc="the most expensive" name="SuperlPlace"> - <function name="TheMostExpensive"/> - <call ref="PlaceKind"/> - </function> - <function desc="the most popular" name="SuperlPlace"> - <function name="TheMostPopular"/> - <call ref="PlaceKind"/> - </function> - </option> - - <option id="country" desc="What nationality"> - <function desc="Belgium" name="Belgium"/> - <function desc="Bulgaria" name="(CountryNat Bulgarian)"/> - <function desc="Catalonia" name="(CountryNat Catalan)"/> - <function desc="The Netherlands" name="(CountryNat Dutch)"/> - <function desc="Denmark" name="(CountryNat Danish)"/> - <function desc="England" name="(CountryNat English)"/> - <function desc="Finland" name="(CountryNat Finnish)"/> - <function desc="France" name="(CountryNat French)"/> - <function desc="Germany" name="(CountryNat German)"/> - <function desc="Italy" name="(CountryNat Italian)"/> - <function desc="Norway" name="(CountryNat Norwegian)"/> - <function desc="Poland" name="(CountryNat Polish)"/> - <function desc="Romania" name="(CountryNat Romanian)"/> - <function desc="Russia" name="(CountryNat Russian)"/> - <function desc="Spain" name="(CountryNat Spanish)"/> - <function desc="Sweden" name="(CountryNat Swedish)"/> - </option> - - <option desc="What is being wanted?" id="Object"> - <function desc="a/an" name="OneObj"> - <call ref="IndefItem"/> - </function> - <function desc="the" name="OneObj"> - <function name="ObjItem"> - <call ref="DefItem"/> - </function> - </function> - <function desc="this" name="OneObj"> - <function name="ObjItem"> - <call ref="ThisItem"/> - </function> - </function> - <function desc="that" name="OneObj"> - <function name="ObjItem"> - <call ref="ThatItem"/> - </function> - </function> - <function desc="(plural)" name="OneObj"> - <function name="ObjPlural"> - <call ref="Kind"/> - </function> - </function> - </option> - - <option desc="Determiner" id="Item"> - <call desc="the" ref="DefItem"/> - <call desc="this" ref="ThisItem"/> - <call desc="that" ref="ThatItem"/> - </option> - - <option id="IndefItem" desc="What are we talking about?"> - <function desc="apple" name="(ObjIndef Apple)"/> - <function desc="beer" name="(ObjMass (MassDrink Beer))"/> - <function desc="bread" name="(ObjMass Bread)"/> - <function desc="cheese" name="(ObjMass Cheese)"/> - <function desc="chicken" name="(ObjMass Chicken)"/> - <function desc="coffee" name="(ObjMass (MassDrink Coffee))"/> - <function desc="fish" name="(ObjMass Fish)"/> - <function desc="meat" name="(ObjMass Meat)"/> - <function desc="milk" name="(ObjMass Milk)"/> - <function desc="pizza" name="(ObjIndef Pizza)"/> - <function desc="salt" name="(ObjMass Salt)"/> - <function desc="tea" name="(ObjMass (MassDrink Tea))"/> - <function desc="water" name="(ObjMass (MassDrink Water))"/> - <function desc="wine" name="(ObjMass (MassDrink Wine))"/> - <function desc="(with quality)" name="ObjMass"> - <function name="SuchMassKind"> - <call ref="Quality"/> - <call ref="MassKind"/> - </function> - </function> - </option> - - <option id="DefItem" desc="What are we talking about?"> - <function desc="apple" name="(The Apple)"/> - <function desc="beer" name="(TheMass (MassDrink Beer))"/> - <function desc="bread" name="(TheMass Bread)"/> - <function desc="cheese" name="(TheMass Cheese)"/> - <function desc="chicken" name="(TheMass Chicken)"/> - <function desc="coffee" name="(TheMass (MassDrink Coffee))"/> - <function desc="fish" name="(TheMass Fish)"/> - <function desc="meat" name="(TheMass Meat)"/> - <function desc="milk" name="(TheMass Milk)"/> - <function desc="pizza" name="(The Pizza)"/> - <function desc="salt" name="(TheMass Salt)"/> - <function desc="tea" name="(TheMass (MassDrink Tea))"/> - <function desc="water" name="(TheMass (MassDrink Water))"/> - <function desc="wine" name="(TheMass (MassDrink Wine))"/> - <function desc="(with quality)" name="TheMass"> - <function name="SuchMassKind"> - <call ref="Quality"/> - <call ref="MassKind"/> - </function> - </function> - </option> - - <option id="ThisItem" desc="What are we talking about?"> - <function desc="apple" name="(This Apple)"/> - <function desc="beer" name="(ThisMass (MassDrink Beer))"/> - <function desc="bread" name="(ThisMass Bread)"/> - <function desc="cheese" name="(ThisMass Cheese)"/> - <function desc="chicken" name="(ThisMass Chicken)"/> - <function desc="coffee" name="(ThisMass (MassDrink Coffee))"/> - <function desc="fish" name="(ThisMass Fish)"/> - <function desc="meat" name="(ThisMass Meat)"/> - <function desc="milk" name="(ThisMass Milk)"/> - <function desc="pizza" name="(This Pizza)"/> - <function desc="salt" name="(ThisMass Salt)"/> - <function desc="tea" name="(ThisMass (MassDrink Tea))"/> - <function desc="water" name="(ThisMass (MassDrink Water))"/> - <function desc="wine" name="(ThisMass (MassDrink Wine))"/> - <function desc="(with quality)" name="ThisMass"> - <function name="SuchMassKind"> - <call ref="Quality"/> - <call ref="MassKind"/> - </function> - </function> - </option> - - <option id="ThatItem" desc="What are we talking about?"> - <function desc="apple" name="(That Apple)"/> - <function desc="beer" name="(ThatMass (MassDrink Beer))"/> - <function desc="bread" name="(ThatMass Bread)"/> - <function desc="cheese" name="(ThatMass Cheese)"/> - <function desc="chicken" name="(ThatMass Chicken)"/> - <function desc="coffee" name="(ThatMass (MassDrink Coffee))"/> - <function desc="fish" name="(ThatMass Fish)"/> - <function desc="meat" name="(ThatMass Meat)"/> - <function desc="milk" name="(ThatMass Milk)"/> - <function desc="pizza" name="(That Pizza)"/> - <function desc="salt" name="(ThatMass Salt)"/> - <function desc="tea" name="(ThatMass (MassDrink Tea))"/> - <function desc="water" name="(ThatMass (MassDrink Water))"/> - <function desc="wine" name="(ThatMass (MassDrink Wine))"/> - <function desc="(with quality)" name="ThatMass"> - <function name="SuchMassKind"> - <call ref="Quality"/> - <call ref="MassKind"/> - </function> - </function> - </option> - - <option id="MassKind" desc="What are we talking about?"> - <function desc="beer" name="(MassDrink Beer)"/> - <function desc="bread" name="Bread"/> - <function desc="cheese" name="Cheese"/> - <function desc="chicken" name="Chicken"/> - <function desc="coffee" name="(MassDrink Coffee)"/> - <function desc="fish" name="Fish"/> - <function desc="meat" name="Meat"/> - <function desc="milk" name="Milk"/> - <function desc="salt" name="Salt"/> - <function desc="tea" name="(MassDrink Tea)"/> - <function desc="water" name="(MassDrink Water)"/> - <function desc="wine" name="(MassDrink Wine)"/> - <function desc="(with quality)" name="SuchMassKind"> - <call ref="Quality"/> - <call ref="MassKind"/> - </function> - </option> - - <option id="Kind" desc="What are we talking about?"> - <function desc="apple" name="Apple"/> - <function desc="pizza" name="Pizza"/> - <function desc="(with quality)" name="SuchKind"> - <call ref="Quality"/> - <call ref="Kind"/> - </function> - </option> - - <option id="Quality" desc="What quality does it have?"> - <function desc="bad" name="(PropQuality Bad)"/> - <function desc="boring" name="(PropQuality Boring)"/> - <function desc="cheap" name="(PropQuality Cheap)"/> - <function desc="cold" name="(PropQuality Cold)"/> - <function desc="delicious" name="(PropQuality Delicious)"/> - <function desc="expensive" name="(PropQuality Expensive)"/> - <function desc="fresh" name="(PropQuality Fresh)"/> - <function desc="good" name="(PropQuality Good)"/> - <function desc="suspect" name="(PropQuality Suspect)"/> - <function desc="warm" name="(PropQuality Warm)"/> - - <function desc="too bad" name="(Too Bad)"/> - <function desc="too boring" name="(Too Boring)"/> - <function desc="too cheap" name="(Too Cheap)"/> - <function desc="too cold" name="(Too Cold)"/> - <function desc="too delicious" name="(Too Delicious)"/> - <function desc="too expensive" name="(Too Expensive)"/> - <function desc="too fresh" name="(Too Fresh)"/> - <function desc="too good" name="(Too Good)"/> - <function desc="too suspect" name="(Too Suspect)"/> - <function desc="too warm" name="(Too Warm)"/> - - <function desc="very bad" name="(Very Bad)"/> - <function desc="very boring" name="(Very Boring)"/> - <function desc="very cheap" name="(Very Cheap)"/> - <function desc="very cold" name="(Very Cold)"/> - <function desc="very delicious" name="(Very Delicious)"/> - <function desc="very expensive" name="(Very Expensive)"/> - <function desc="very fresh" name="(Very Fresh)"/> - <function desc="very good" name="(Very Good)"/> - <function desc="very suspect" name="(Very Suspect)"/> - <function desc="very warm" name="(Very Warm)"/> - - <function desc="(with nationality)" name="PropQuality"> - <function name="PropCit"> - <call ref="Citizenship"/> - </function> - </function> - </option> - - <function name="AmountCurrency" id="Price"> - <function name="NNumeral"> - <numeral desc="How much does it cost?"/> - </function> - <call ref="Currency"/> - </function> - - <option id="Currency"> - <function desc="Euro" name="Euro"/> - <function desc="Dollar" name="Dollar"/> - <function desc="Danish Crown" name="DanishCrown"/> - <function desc="Norwegian Crown" name="NorwegianCrown"/> - <function desc="Swedish Crown" name="SwedishCrown"/> - <function desc="Pound" name="Pound"/> - <function desc="Rouble" name="Rouble"/> - <function desc="Rupee" name="Rupee"/> - <function desc="Lei" name="Lei"/> - <function desc="Leva" name="Leva"/> - <function desc="Yuan" name="Yuan"/> - <function desc="Zloty" name="Zloty"/> - </option> - - <option desc="When?" id="Date"> - <function desc="today" name="Today"/> - <function desc="tomorrow" name="Tomorrow"/> - <function desc="on Monday" name="(OnDay Monday)"/> - <function desc="on Tuesday" name="(OnDay Tuesday)"/> - <function desc="on Wednesday" name="(OnDay Wednesday)"/> - <function desc="on Thursday" name="(OnDay Thursday)"/> - <function desc="on Friday" name="(OnDay Friday)"/> - <function desc="on Saturday" name="(OnDay Saturday)"/> - <function desc="on Sunday" name="(OnDay Sunday)"/> - </option> - - <option desc="On which days?" id="Day"> - <function desc="Monday" name="Monday"/> - <function desc="Tuesday" name="Tuesday"/> - <function desc="Wednesday" name="Wednesday"/> - <function desc="Thursday" name="Thursday"/> - <function desc="Friday" name="Friday"/> - <function desc="Saturday" name="Saturday"/> - <function desc="Sunday" name="Sunday"/> - </option> - - <option dec="Greeting" id="Greeting"> - <function desc="Hello" name="GHello"/> - <function desc="Good Day" name="GGoodDay"/> - <function desc="Good Evening" name="GGoodEvening"/> - <function desc="Good Morning" name="GGoodMorning"/> - <function desc="Good Night" name="GGoodNight"/> - <function desc="Good Luck" name="GGoodLuck"/> - <function desc="See You Soon" name="GSeeYouSoon"/> - <function desc="See You on a Day" name="PSeeYouDate"> - <call ref="Date"/> - </function> - <function desc="See You Somewhere" name="PSeeYouPlace"> - <call ref="Place"/> - </function> - <function desc="See You Somewhere on a Day" name="PSeeYouPlaceDate"> - <call ref="Place"/> - <call ref="Date"/> - </function> - <function desc="Goodbye" name="GGoodbye"/> - <function desc="Bye" name="GBye"/> - <function desc="Cheers" name="GCheers"/> - <function desc="Congratulations" name="GCongratulations"/> - <function desc="Damn" name="GDamn"/> - <function desc="Excuse me" name="GExcuse"/> - <function desc="Excuse me (polite)" name="GExcusePol"/> - <function desc="Happy Birthday" name="GHappyBirthday"/> - <function desc="Help" name="GHelp"/> - <function desc="How Are You" name="GHowAreYou"/> - <function desc="Nice to Meet You" name="GNiceToMeetYou"/> - <function desc="Sorry" name="GSorry"/> - <function desc="Sorry (polite)" name="GSorryPol"/> - <function desc="Thanks" name="GThanks"/> - </option> - - <option dec="Phrase" id="Phrase"> - <function desc="Yes" name="PYes"/> - <function desc="Yes (as an answer to no)" name="PYesToNo"/> - <function desc="No" name="PNo"/> - <function desc="What is the time?" name="GWhatTime"/> - <function desc="The Bill" name="GTheCheck"/> - <function desc="Look Out" name="GLookOut"/> - <function desc="Something please" name="GObjectPlease"> - <call ref="Object"/> - </function> - <function desc="Please" name="GPleaseGive"/> - <function desc="Please (polite)" name="GPleaseGivePol"/> - </option> - - <option id="do"> - <function desc="In general" name="ADoVerbPhrase"> - <call ref="Person"/> - <call ref="VerbPhrase"/> - </function> - <function desc="In some place" name="ADoVerbPhrasePlace"> - <call ref="Person"/> - <call ref="VerbPhrase"/> - <call ref="Place"/> - </function> - </option> - - <option id="modal_do"> - <function desc="In general" name="AModVerbPhrase"> - <argument/> - <call ref="Person"/> - <call ref="VerbPhrase"/> - </function> - <function desc="In some place" name="AModVerbPhrasePlace"> - <argument/> - <call ref="Person"/> - <call ref="VerbPhrase"/> - <call ref="Place"/> - </function> - </option> - - <option desc="Verb" id="VerbPhrase"> - <function desc="Buy" name="V2Buy"> - <call desc="What should be bought?" ref="Object"/> - </function> - <function desc="Drink" name="VDrink"/> - <function desc="Drink Something" name="V2Drink"> - <call desc="What should be drunk?" ref="Object"/> - </function> - <function desc="Eat" name="VEat"/> - <function desc="Eat Something" name="V2Eat"> - <call desc="What should be eaten?" ref="Object"/> - </function> - <function desc="Wait for Someone" name="V2Wait"> - <call desc="Whom should we wait for?" ref="Person"/> - </function> - <function desc="Play" name="VPlay"/> - <function desc="Read" name="VRead"/> - <function desc="Run" name="VRun"/> - <function desc="Sit" name="VSit"/> - <function desc="Sleep" name="VSleep"/> - <function desc="Stop" name="VStop"/> - <function desc="Swim" name="VSwim"/> - <function desc="Wait" name="VWait"/> - <function desc="Walk" name="VWalk"/> - <function desc="Write" name="VWrite"/> - </option> -</phrasebook> diff --git a/src/ui/android/build.xml b/src/ui/android/build.xml deleted file mode 100644 index d60bf62f2..000000000 --- a/src/ui/android/build.xml +++ /dev/null @@ -1,92 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project name="MainActivity" default="help"> - - <!-- The local.properties file is created and updated by the 'android' tool. - It contains the path to the SDK. It should *NOT* be checked into - Version Control Systems. --> - <property file="local.properties" /> - - <!-- The ant.properties file can be created by you. It is only edited by the - 'android' tool to add properties to it. - This is the place to change some Ant specific build properties. - Here are some properties you may want to change/update: - - source.dir - The name of the source directory. Default is 'src'. - out.dir - The name of the output directory. Default is 'bin'. - - For other overridable properties, look at the beginning of the rules - files in the SDK, at tools/ant/build.xml - - Properties related to the SDK location or the project target should - be updated using the 'android' tool with the 'update' action. - - This file is an integral part of the build system for your - application and should be checked into Version Control Systems. - - --> - <property file="ant.properties" /> - - <!-- if sdk.dir was not set from one of the property file, then - get it from the ANDROID_HOME env var. - This must be done before we load project.properties since - the proguard config can use sdk.dir --> - <property environment="env" /> - <condition property="sdk.dir" value="${env.ANDROID_HOME}"> - <isset property="env.ANDROID_HOME" /> - </condition> - - <!-- The project.properties file is created and updated by the 'android' - tool, as well as ADT. - - This contains project specific properties such as project target, and library - dependencies. Lower level build properties are stored in ant.properties - (or in .classpath for Eclipse projects). - - This file is an integral part of the build system for your - application and should be checked into Version Control Systems. --> - <loadproperties srcFile="project.properties" /> - - <!-- quick check on sdk.dir --> - <fail - message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable." - unless="sdk.dir" - /> - - <!-- - Import per project custom build rules if present at the root of the project. - This is the place to put custom intermediary targets such as: - -pre-build - -pre-compile - -post-compile (This is typically used for code obfuscation. - Compiled code location: ${out.classes.absolute.dir} - If this is not done in place, override ${out.dex.input.absolute.dir}) - -post-package - -post-build - -pre-clean - --> - <import file="custom_rules.xml" optional="true" /> - - <!-- Import the actual build file. - - To customize existing targets, there are two options: - - Customize only one target: - - copy/paste the target into this file, *before* the - <import> task. - - customize it to your needs. - - Customize the whole content of build.xml - - copy/paste the content of the rules files (minus the top node) - into this file, replacing the <import> task. - - customize to your needs. - - *********************** - ****** IMPORTANT ****** - *********************** - In all cases you must update the value of version-tag below to read 'custom' instead of an integer, - in order to avoid having your file be overridden by tools such as "android update project" - --> - <!-- version-tag: 1 --> - <import file="/Users/aarne/Library/Android/apache-ant-1.9.4/fetch.xml" /> - -</project> diff --git a/src/ui/android/gf-translator-alignment.dot b/src/ui/android/gf-translator-alignment.dot deleted file mode 100644 index 8eaaa72a5..000000000 --- a/src/ui/android/gf-translator-alignment.dot +++ /dev/null @@ -1,60 +0,0 @@ -digraph { - rankdir=LR ; - node [shape = record] ; - bgcolor = "#FFFFFF00" ; - - struct0[label = "<n0>твоят | <n1>телефон | <n2>може | <n3>да | <n4>превежда"] ; - struct0:n0:e -> struct1:n0:w ; - struct0:n1:e -> struct1:n1:w ; - struct0:n2:e -> struct1:n2:w ; - struct0:n4:e -> struct1:n3:w ; - struct1[label = "<n0>el teu | <n1>telèfon | <n2>sap | <n3>traduir"] ; - struct1:n0:e -> struct2:n0:w ; - struct1:n1:e -> struct2:n2:w ; - struct1:n2:e -> struct2:n3:w ; - struct1:n3:e -> struct2:n4:w ; - struct2[label = "<n0>你 | <n1>的 | <n2>电 话 | <n3>会 | <n4>翻 译"] ; - struct2:n0:e -> struct3:n0:w ; - struct2:n2:e -> struct3:n1:w ; - struct2:n3:e -> struct3:n2:w ; - struct2:n4:e -> struct3:n3:w ; - struct3[label = "<n0>je | <n1>telefoon | <n2>kan | <n3>vertalen"] ; - struct3:n0:e -> struct4:n0:w ; - struct3:n1:e -> struct4:n1:w ; - struct3:n2:e -> struct4:n2:w ; - struct3:n3:e -> struct4:n3:w ; - struct4[label = "<n0>your | <n1>phone | <n2>can | <n3>translate"] ; - struct4:n1:e -> struct5:n1:w ; - struct4:n2:e -> struct5:n2:w ; - struct4:n3:e -> struct5:n3:w ; - struct5[label = "<n1>puhelimesi | <n2>osaa | <n3>kääntää"] ; - struct5:n1:e -> struct6:n1:w ; - struct5:n2:e -> struct6:n2:w ; - struct5:n3:e -> struct6:n3:w ; - struct6[label = "<n0>ton | <n1>téléphone | <n2>sait | <n3>traduire"] ; - struct6:n0:e -> struct7:n0:w ; - struct6:n1:e -> struct7:n1:w ; - struct6:n2:e -> struct7:n2:w ; - struct6:n3:e -> struct7:n3:w ; - struct7[label = "<n0>dein | <n1>Telefon | <n2>kann | <n3>übersetzen"] ; - struct7:n0:e -> struct8:n0:w ; - struct7:n1:e -> struct8:n1:w ; - struct7:n2:e -> struct8:n3:w ; - struct7:n3:e -> struct8:n2:w ; - struct8[label = "<n0>तुम्हारा | <n1>फोन | <n2>अनुवाद कर | <n3>सकता | <n4>है"] ; - struct8:n0:e -> struct9:n1:w ; - struct8:n1:e -> struct9:n2:w ; - struct8:n2:e -> struct9:n4:w ; - struct8:n3:e -> struct9:n3:w ; - struct9[label = "<n0>il | <n1>tuo | <n2>telefono | <n3>sa | <n4>tradurre"] ; - struct9:n1:e -> struct10:n0:w ; - struct9:n2:e -> struct10:n1:w ; - struct9:n3:e -> struct10:n2:w ; - struct9:n4:e -> struct10:n3:w ; - struct10[label = "<n0>tu | <n1>teléfono | <n2>sabe | <n3>traducir"] ; - struct10:n0:e -> struct11:n0:w ; - struct10:n1:e -> struct11:n1:w ; - struct10:n2:e -> struct11:n2:w ; - struct10:n3:e -> struct11:n3:w ; - struct11[label = "<n0>din | <n1>telefon | <n2>kan | <n3>översätta"] ; -} diff --git a/src/ui/android/gf-translator.svg b/src/ui/android/gf-translator.svg deleted file mode 100644 index 21eee477d..000000000 --- a/src/ui/android/gf-translator.svg +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" -"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<?xml-stylesheet type="text/css" href="http://fonts.googleapis.com/css?family=Inconsolata"?> - -<svg width="1024" height="500" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> - <filter id="A"><feGaussianBlur stdDeviation="2"/></filter> - <defs> - <linearGradient id="grad1" x1="0%" y1="0%" x2="0%" y2="100%"> - <stop offset="0%" style="stop-color:#a8d8ff;stop-opacity:1" /> - <stop offset="100%" style="stop-color:#f6f6f6;stop-opacity:1" /> - </linearGradient> - </defs> - <rect width="1024" height="500" style="fill:url(#grad1)"/> - <path filter="url(#A)" - d="M120,270 v-51 h59 m-59,0 v-53 h114 a110.5,105 0 1,1 -24,-66" - fill="none" stroke="black" stroke-width="4" opacity="0.25" - stroke-linejoin="round" stroke-linecap="round"/> - <path d="M120,270 v-51 h59 m-59,0 v-53 h114 a110.5,105 0 1,1 -24,-66" - fill="none" stroke="red" stroke-width="4" - stroke-linejoin="round" stroke-linecap="round"/> - <text x="310" y="120" font-size="70" font-family="Inconsolata">Offline Translation</text> - <text x="600" y="170" font-size="35" font-family="Inconsolata">with</text> - <text x="270" y="240" font-size="70" font-family="Inconsolata" fill="black" opacity="0.25" filter="url(#A)">Grammatical Framework</text> - <text x="270" y="240" font-size="70" font-family="Inconsolata" fill="#06c">Grammatical Framework</text> - <image x="0" y="270" width="1024" height="200" - xlink:href="gf-translator-alignment.png" /> -</svg> diff --git a/src/ui/android/glosses.hs b/src/ui/android/glosses.hs deleted file mode 100644 index 966ec90aa..000000000 --- a/src/ui/android/glosses.hs +++ /dev/null @@ -1,46 +0,0 @@ -import SG -import PGF2 -import Data.Char -import Data.List - -main = do - db <- openSG "assets/semantics.db" - inTransaction db $ do - ls <- fmap lines $ readFile "../../../lib/src/translator/Dictionary.gf" - let glosses = [x | Just (fn,gloss) <- map gloss ls, x <- glossTriples fn gloss] - topics <- fmap (map toTriple . lines) $ readFile "topics.txt" - sequence_ [insertTriple db s p o | (s,p,o) <- glosses++topics] - closeSG db - -toTriple l = - case readTriple l of - Just t -> t - Nothing -> error ("topics.txt: "++l) - -gloss l = - case words l of - ("fun":fn:_) -> case dropWhile (/='\t') l of - '\t':l -> Just (fn,l) - _ -> Nothing - _ -> Nothing - -glossTriples fn s = - (if null gs then [] else [(fn_e,gloss,mkStr (merge gs))])++ - (if null es then [] else [(fn_e,example,mkStr (merge (map (init . tail) es)))]) - where - fn_e = mkApp fn [] - gloss = mkApp "gloss" [] - example = mkApp "example" [] - (es,gs) = partition isExample (splitGloss s) - -splitGloss s = - let (xs,s') = break (==';') s - in trim xs : case s' of - ';':s -> splitGloss s - _ -> [] - where - trim = reverse . dropWhile isSpace . reverse . dropWhile isSpace - -merge = intercalate "; " - -isExample s = not (null s) && head s == '"' && last s == '"' diff --git a/src/ui/android/hlc.svg b/src/ui/android/hlc.svg deleted file mode 100644 index e61e41c19..000000000 --- a/src/ui/android/hlc.svg +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" -"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<?xml-stylesheet type="text/css" href="http://fonts.googleapis.com/css?family=Inconsolata"?> - -<svg width="250" height="250" version="1.1" xmlns="http://www.w3.org/2000/svg"> - <desc>Digital Grammar Logo</desc> - - <path d="M205,200 a110,110 0 1,1 0,-150 M125,15 v110 h80 M165,95 v60 M205,95 v60" fill="none" stroke="red" stroke-width="14" stroke-linejoin="round" stroke-linecap="round"/> -</svg> diff --git a/src/ui/android/jni/Android.mk b/src/ui/android/jni/Android.mk deleted file mode 100644 index f1f697bed..000000000 --- a/src/ui/android/jni/Android.mk +++ /dev/null @@ -1,28 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -jni_c_files := jpgf.c jsg.c jni_utils.c -sg_c_files := sg.c sqlite3Btree.c -pgf_c_files := data.c expr.c graphviz.c linearizer.c literals.c parser.c parseval.c pgf.c printer.c reader.c \ -reasoner.c evaluator.c jit.c typechecker.c lookup.c aligner.c writer.c -gu_c_files := assert.c choice.c exn.c fun.c in.c map.c out.c utf8.c \ -bits.c defs.c enum.c file.c hash.c mem.c prime.c seq.c string.c ucs.c variant.c - -LOCAL_MODULE := jpgf -LOCAL_SRC_FILES := $(addprefix ../../../runtime/java/, $(jni_c_files)) \ - $(addprefix ../../../runtime/c/sg/, $(sg_c_files)) \ - $(addprefix ../../../runtime/c/pgf/, $(pgf_c_files)) \ - $(addprefix ../../../runtime/c/gu/, $(gu_c_files)) -LOCAL_C_INCLUDES := ../../../runtime/c - -include $(BUILD_SHARED_LIBRARY) - -$(realpath ../obj/local/armeabi/objs/jpgf/__/__/__/runtime/c/pgf/jit.o): lightning -$(realpath ../obj/local/armeabi/objs-debug/jpgf/__/__/__/runtime/c/pgf/jit.o): lightning - -lightning: - ln -s -f arm/asm.h ../../../runtime/c/pgf/lightning/asm.h - ln -s -f arm/core.h ../../../runtime/c/pgf/lightning/core.h - ln -s -f arm/fp.h ../../../runtime/c/pgf/lightning/fp.h - ln -s -f arm/funcs.h ../../../runtime/c/pgf/lightning/funcs.h diff --git a/src/ui/android/jni/Application.mk b/src/ui/android/jni/Application.mk deleted file mode 100644 index 6a9876332..000000000 --- a/src/ui/android/jni/Application.mk +++ /dev/null @@ -1,3 +0,0 @@ -APP_PLATFORM := android-8 -APP_CFLAGS := -std=gnu99 -APP_OPTIM := release diff --git a/src/ui/android/proguard-project.txt b/src/ui/android/proguard-project.txt deleted file mode 100644 index f2fe1559a..000000000 --- a/src/ui/android/proguard-project.txt +++ /dev/null @@ -1,20 +0,0 @@ -# To enable ProGuard in your project, edit project.properties -# to define the proguard.config property as described in that file. -# -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in ${sdk.dir}/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the ProGuard -# include property in project.properties. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/src/ui/android/project.properties b/src/ui/android/project.properties deleted file mode 100644 index 6e18427a4..000000000 --- a/src/ui/android/project.properties +++ /dev/null @@ -1,14 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system edit -# "ant.properties", and override values to adapt the script to your -# project structure. -# -# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): -#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt - -# Project target. -target=android-21 diff --git a/src/ui/android/res/drawable-hdpi/btn_close.png b/src/ui/android/res/drawable-hdpi/btn_close.png Binary files differdeleted file mode 100644 index 47f11e5bf..000000000 --- a/src/ui/android/res/drawable-hdpi/btn_close.png +++ /dev/null diff --git a/src/ui/android/res/drawable-hdpi/close_arrow.png b/src/ui/android/res/drawable-hdpi/close_arrow.png Binary files differdeleted file mode 100644 index bf280a05a..000000000 --- a/src/ui/android/res/drawable-hdpi/close_arrow.png +++ /dev/null diff --git a/src/ui/android/res/drawable-hdpi/ic_action_switch.png b/src/ui/android/res/drawable-hdpi/ic_action_switch.png Binary files differdeleted file mode 100644 index 5449a32b8..000000000 --- a/src/ui/android/res/drawable-hdpi/ic_action_switch.png +++ /dev/null diff --git a/src/ui/android/res/drawable-hdpi/ic_app.png b/src/ui/android/res/drawable-hdpi/ic_app.png Binary files differdeleted file mode 100644 index 8d9bdd820..000000000 --- a/src/ui/android/res/drawable-hdpi/ic_app.png +++ /dev/null diff --git a/src/ui/android/res/drawable-hdpi/ic_drawer.png b/src/ui/android/res/drawable-hdpi/ic_drawer.png Binary files differdeleted file mode 100644 index c59f601ca..000000000 --- a/src/ui/android/res/drawable-hdpi/ic_drawer.png +++ /dev/null diff --git a/src/ui/android/res/drawable-hdpi/ic_keyboard.png b/src/ui/android/res/drawable-hdpi/ic_keyboard.png Binary files differdeleted file mode 100644 index ce257a269..000000000 --- a/src/ui/android/res/drawable-hdpi/ic_keyboard.png +++ /dev/null diff --git a/src/ui/android/res/drawable-hdpi/ic_mic.png b/src/ui/android/res/drawable-hdpi/ic_mic.png Binary files differdeleted file mode 100644 index f79ff489b..000000000 --- a/src/ui/android/res/drawable-hdpi/ic_mic.png +++ /dev/null diff --git a/src/ui/android/res/drawable-hdpi/ic_search_black_24dp.png b/src/ui/android/res/drawable-hdpi/ic_search_black_24dp.png Binary files differdeleted file mode 100644 index c593e7ad8..000000000 --- a/src/ui/android/res/drawable-hdpi/ic_search_black_24dp.png +++ /dev/null diff --git a/src/ui/android/res/drawable-hdpi/open_arrow.png b/src/ui/android/res/drawable-hdpi/open_arrow.png Binary files differdeleted file mode 100644 index ec7453797..000000000 --- a/src/ui/android/res/drawable-hdpi/open_arrow.png +++ /dev/null diff --git a/src/ui/android/res/drawable-hdpi/sym_keyboard_delete.png b/src/ui/android/res/drawable-hdpi/sym_keyboard_delete.png Binary files differdeleted file mode 100644 index 5139c7179..000000000 --- a/src/ui/android/res/drawable-hdpi/sym_keyboard_delete.png +++ /dev/null diff --git a/src/ui/android/res/drawable-hdpi/sym_keyboard_return.png b/src/ui/android/res/drawable-hdpi/sym_keyboard_return.png Binary files differdeleted file mode 100644 index 5a5670c32..000000000 --- a/src/ui/android/res/drawable-hdpi/sym_keyboard_return.png +++ /dev/null diff --git a/src/ui/android/res/drawable-hdpi/sym_keyboard_search.png b/src/ui/android/res/drawable-hdpi/sym_keyboard_search.png Binary files differdeleted file mode 100644 index e72cde3bb..000000000 --- a/src/ui/android/res/drawable-hdpi/sym_keyboard_search.png +++ /dev/null diff --git a/src/ui/android/res/drawable-hdpi/sym_keyboard_shift.png b/src/ui/android/res/drawable-hdpi/sym_keyboard_shift.png Binary files differdeleted file mode 100644 index 275769618..000000000 --- a/src/ui/android/res/drawable-hdpi/sym_keyboard_shift.png +++ /dev/null diff --git a/src/ui/android/res/drawable-hdpi/sym_keyboard_space.png b/src/ui/android/res/drawable-hdpi/sym_keyboard_space.png Binary files differdeleted file mode 100644 index cef2daa5d..000000000 --- a/src/ui/android/res/drawable-hdpi/sym_keyboard_space.png +++ /dev/null diff --git a/src/ui/android/res/drawable-mdpi/ic_action_switch.png b/src/ui/android/res/drawable-mdpi/ic_action_switch.png Binary files differdeleted file mode 100644 index ecf7d0347..000000000 --- a/src/ui/android/res/drawable-mdpi/ic_action_switch.png +++ /dev/null diff --git a/src/ui/android/res/drawable-mdpi/ic_app.png b/src/ui/android/res/drawable-mdpi/ic_app.png Binary files differdeleted file mode 100644 index 923d0fe91..000000000 --- a/src/ui/android/res/drawable-mdpi/ic_app.png +++ /dev/null diff --git a/src/ui/android/res/drawable-mdpi/ic_drawer.png b/src/ui/android/res/drawable-mdpi/ic_drawer.png Binary files differdeleted file mode 100644 index 1ed2c56ee..000000000 --- a/src/ui/android/res/drawable-mdpi/ic_drawer.png +++ /dev/null diff --git a/src/ui/android/res/drawable-mdpi/ic_mic.png b/src/ui/android/res/drawable-mdpi/ic_mic.png Binary files differdeleted file mode 100644 index 8f7f55cf9..000000000 --- a/src/ui/android/res/drawable-mdpi/ic_mic.png +++ /dev/null diff --git a/src/ui/android/res/drawable-mdpi/ic_search_black_24dp.png b/src/ui/android/res/drawable-mdpi/ic_search_black_24dp.png Binary files differdeleted file mode 100644 index 6b1634323..000000000 --- a/src/ui/android/res/drawable-mdpi/ic_search_black_24dp.png +++ /dev/null diff --git a/src/ui/android/res/drawable-mdpi/sym_keyboard_delete.png b/src/ui/android/res/drawable-mdpi/sym_keyboard_delete.png Binary files differdeleted file mode 100644 index 6cee59682..000000000 --- a/src/ui/android/res/drawable-mdpi/sym_keyboard_delete.png +++ /dev/null diff --git a/src/ui/android/res/drawable-mdpi/sym_keyboard_done.png b/src/ui/android/res/drawable-mdpi/sym_keyboard_done.png Binary files differdeleted file mode 100644 index c0d6d1394..000000000 --- a/src/ui/android/res/drawable-mdpi/sym_keyboard_done.png +++ /dev/null diff --git a/src/ui/android/res/drawable-mdpi/sym_keyboard_return.png b/src/ui/android/res/drawable-mdpi/sym_keyboard_return.png Binary files differdeleted file mode 100644 index cbe2b152f..000000000 --- a/src/ui/android/res/drawable-mdpi/sym_keyboard_return.png +++ /dev/null diff --git a/src/ui/android/res/drawable-mdpi/sym_keyboard_search.png b/src/ui/android/res/drawable-mdpi/sym_keyboard_search.png Binary files differdeleted file mode 100644 index 127755d6b..000000000 --- a/src/ui/android/res/drawable-mdpi/sym_keyboard_search.png +++ /dev/null diff --git a/src/ui/android/res/drawable-mdpi/sym_keyboard_shift.png b/src/ui/android/res/drawable-mdpi/sym_keyboard_shift.png Binary files differdeleted file mode 100644 index d05962846..000000000 --- a/src/ui/android/res/drawable-mdpi/sym_keyboard_shift.png +++ /dev/null diff --git a/src/ui/android/res/drawable-mdpi/sym_keyboard_space.png b/src/ui/android/res/drawable-mdpi/sym_keyboard_space.png Binary files differdeleted file mode 100644 index 09b94d9e6..000000000 --- a/src/ui/android/res/drawable-mdpi/sym_keyboard_space.png +++ /dev/null diff --git a/src/ui/android/res/drawable-xhdpi/ic_action_switch.png b/src/ui/android/res/drawable-xhdpi/ic_action_switch.png Binary files differdeleted file mode 100644 index b5da00fb2..000000000 --- a/src/ui/android/res/drawable-xhdpi/ic_action_switch.png +++ /dev/null diff --git a/src/ui/android/res/drawable-xhdpi/ic_app.png b/src/ui/android/res/drawable-xhdpi/ic_app.png Binary files differdeleted file mode 100644 index f7eb06682..000000000 --- a/src/ui/android/res/drawable-xhdpi/ic_app.png +++ /dev/null diff --git a/src/ui/android/res/drawable-xhdpi/ic_dictionary.png b/src/ui/android/res/drawable-xhdpi/ic_dictionary.png Binary files differdeleted file mode 100644 index 985644ebd..000000000 --- a/src/ui/android/res/drawable-xhdpi/ic_dictionary.png +++ /dev/null diff --git a/src/ui/android/res/drawable-xhdpi/ic_drawer.png b/src/ui/android/res/drawable-xhdpi/ic_drawer.png Binary files differdeleted file mode 100644 index a5fa74def..000000000 --- a/src/ui/android/res/drawable-xhdpi/ic_drawer.png +++ /dev/null diff --git a/src/ui/android/res/drawable-xhdpi/ic_mic.png b/src/ui/android/res/drawable-xhdpi/ic_mic.png Binary files differdeleted file mode 100644 index 13d21274a..000000000 --- a/src/ui/android/res/drawable-xhdpi/ic_mic.png +++ /dev/null diff --git a/src/ui/android/res/drawable-xhdpi/ic_search_black_24dp.png b/src/ui/android/res/drawable-xhdpi/ic_search_black_24dp.png Binary files differdeleted file mode 100644 index 638190268..000000000 --- a/src/ui/android/res/drawable-xhdpi/ic_search_black_24dp.png +++ /dev/null diff --git a/src/ui/android/res/drawable-xxhdpi/ic_app.png b/src/ui/android/res/drawable-xxhdpi/ic_app.png Binary files differdeleted file mode 100644 index 6154d852a..000000000 --- a/src/ui/android/res/drawable-xxhdpi/ic_app.png +++ /dev/null diff --git a/src/ui/android/res/drawable-xxhdpi/ic_drawer.png b/src/ui/android/res/drawable-xxhdpi/ic_drawer.png Binary files differdeleted file mode 100644 index 9c4685d6e..000000000 --- a/src/ui/android/res/drawable-xxhdpi/ic_drawer.png +++ /dev/null diff --git a/src/ui/android/res/drawable-xxhdpi/ic_search_black_24dp.png b/src/ui/android/res/drawable-xxhdpi/ic_search_black_24dp.png Binary files differdeleted file mode 100644 index 3ae490ef9..000000000 --- a/src/ui/android/res/drawable-xxhdpi/ic_search_black_24dp.png +++ /dev/null diff --git a/src/ui/android/res/drawable-xxxhdpi/ic_search_black_24dp.png b/src/ui/android/res/drawable-xxxhdpi/ic_search_black_24dp.png Binary files differdeleted file mode 100644 index 21be57299..000000000 --- a/src/ui/android/res/drawable-xxxhdpi/ic_search_black_24dp.png +++ /dev/null diff --git a/src/ui/android/res/drawable/first_person_utterance_bg.xml b/src/ui/android/res/drawable/first_person_utterance_bg.xml deleted file mode 100644 index acdf9ab92..000000000 --- a/src/ui/android/res/drawable/first_person_utterance_bg.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<shape xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="rectangle"> - <corners android:radius="4dp" /> - <solid android:color="#CDCDED" /> -</shape>
\ No newline at end of file diff --git a/src/ui/android/res/drawable/grid_phrasebook_button.xml b/src/ui/android/res/drawable/grid_phrasebook_button.xml deleted file mode 100644 index 21a6ac127..000000000 --- a/src/ui/android/res/drawable/grid_phrasebook_button.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<shape xmlns:android="http://schemas.android.com/apk/res/android" > - <stroke android:width="1dp" - android:color="@color/primary_color" /> - <padding android:left="5dp" android:top="5dp" android:right="5dp" android:bottom="5dp" /> - <corners android:radius="8dp" /> -</shape>
\ No newline at end of file diff --git a/src/ui/android/res/drawable/ic_volume_up_black_18dp.png b/src/ui/android/res/drawable/ic_volume_up_black_18dp.png Binary files differdeleted file mode 100644 index 992d2c452..000000000 --- a/src/ui/android/res/drawable/ic_volume_up_black_18dp.png +++ /dev/null diff --git a/src/ui/android/res/drawable/second_person_best_utterance_bg.xml b/src/ui/android/res/drawable/second_person_best_utterance_bg.xml deleted file mode 100644 index 0c60864b9..000000000 --- a/src/ui/android/res/drawable/second_person_best_utterance_bg.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<shape xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="rectangle"> - <corners android:radius="4dp" /> - <solid android:color="@color/primary_color" /> -</shape>
\ No newline at end of file diff --git a/src/ui/android/res/drawable/second_person_chunk_utterance_bg.xml b/src/ui/android/res/drawable/second_person_chunk_utterance_bg.xml deleted file mode 100644 index d10d67122..000000000 --- a/src/ui/android/res/drawable/second_person_chunk_utterance_bg.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<shape xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="rectangle"> - <corners android:radius="4dp" /> - <solid android:color="#FFB2A5" /> -</shape>
\ No newline at end of file diff --git a/src/ui/android/res/drawable/second_person_utterance_bg.xml b/src/ui/android/res/drawable/second_person_utterance_bg.xml deleted file mode 100644 index e07cc10b3..000000000 --- a/src/ui/android/res/drawable/second_person_utterance_bg.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<shape xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="rectangle"> - <corners android:radius="4dp" /> - <solid android:color="#FFFF99" /> -</shape>
\ No newline at end of file diff --git a/src/ui/android/res/drawable/second_person_worst_utterance_bg.xml b/src/ui/android/res/drawable/second_person_worst_utterance_bg.xml deleted file mode 100644 index f4effe3bc..000000000 --- a/src/ui/android/res/drawable/second_person_worst_utterance_bg.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<shape xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="rectangle"> - <corners android:radius="4dp" /> - <solid android:color="#FF303e" /> -</shape>
\ No newline at end of file diff --git a/src/ui/android/res/layout/activity_help.xml b/src/ui/android/res/layout/activity_help.xml deleted file mode 100644 index 3cb88a569..000000000 --- a/src/ui/android/res/layout/activity_help.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" - android:layout_height="fill_parent" > - - <WebView - android:id="@+id/help_content" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - /> -</RelativeLayout> diff --git a/src/ui/android/res/layout/activity_lexical_entry.xml b/src/ui/android/res/layout/activity_lexical_entry.xml deleted file mode 100644 index fa49f252b..000000000 --- a/src/ui/android/res/layout/activity_lexical_entry.xml +++ /dev/null @@ -1,80 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<FrameLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_height="match_parent" - android:layout_width="match_parent"> - - <android.support.v4.widget.DrawerLayout - android:id="@+id/drawer_layout" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <!-- The main content view --> - <RelativeLayout - android:layout_height="match_parent" - android:layout_width="match_parent"> - - <RelativeLayout - android:id="@+id/lexical_header" - android:layout_height="wrap_content" - android:layout_width="match_parent" - android:layout_alignParentTop="true" - android:layout_alignParentLeft="true" - android:layout_alignParentRight="true" - android:padding="8dp" - android:background="#C0C0C0"> - - <org.grammaticalframework.ui.android.LanguageSelector - android:id="@+id/show_language" - android:layout_height="wrap_content" - android:layout_width="match_parent" - android:layout_alignParentLeft="true" - android:layout_alignParentTop="true" - android:padding="0dp"/> - - </RelativeLayout> - - <TextView - android:id="@+id/lexical_desc" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_below="@+id/lexical_header" - android:paddingLeft="1dp" - android:paddingTop="4dp" - android:paddingBottom="2dp" - android:textSize="25sp"/> - - <ListView - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_below="@id/lexical_desc" - android:orientation="vertical" - android:paddingLeft="1dp" - android:id="@android:id/list" > - </ListView> - </RelativeLayout> - - <!-- The navigation drawer --> - <ListView android:id="@+id/topics_list" - android:layout_width="250dp" - android:layout_height="match_parent" - android:layout_gravity="start" - android:choiceMode="singleChoice" - android:divider="@android:color/transparent" - android:dividerHeight="0dp" - android:background="#FFFFE0"/> - </android.support.v4.widget.DrawerLayout> - - <LinearLayout - android:id="@+id/progressBarView" - android:gravity="center" - android:visibility="gone" - android:background="#00000000" - android:layout_height="match_parent" - android:layout_width="match_parent"> - - <ProgressBar - android:layout_width="wrap_content" - android:layout_height="wrap_content"/> - </LinearLayout> -</FrameLayout> diff --git a/src/ui/android/res/layout/activity_main.xml b/src/ui/android/res/layout/activity_main.xml deleted file mode 100644 index b77fe5857..000000000 --- a/src/ui/android/res/layout/activity_main.xml +++ /dev/null @@ -1,91 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<FrameLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_height="match_parent" - android:layout_width="match_parent"> - - <RelativeLayout - android:layout_height="match_parent" - android:layout_width="match_parent"> - - <RelativeLayout - android:id="@+id/top_bg" - android:layout_height="wrap_content" - android:layout_width="match_parent" - android:layout_alignParentTop="true" - android:layout_alignParentLeft="true" - android:layout_alignParentRight="true" - android:padding="8dp" - android:background="#C0C0C0"> - - <ImageView - android:id="@+id/start_stop" - android:layout_height="wrap_content" - android:layout_width="wrap_content" - android:layout_alignTop="@+id/source_language" - android:layout_alignBottom="@+id/target_language" - android:layout_alignParentRight="true" - android:padding="8dp" - android:src="@drawable/ic_mic" - android:contentDescription="@string/microphone"/> - - <ImageView - android:id="@+id/switch_languages" - android:layout_height="wrap_content" - android:layout_width="wrap_content" - android:layout_alignTop="@+id/source_language" - android:layout_alignBottom="@+id/target_language" - android:layout_toLeftOf="@id/start_stop" - android:padding="8dp" - android:src="@drawable/ic_action_switch" - android:contentDescription="@string/switch_languages"/> - - <org.grammaticalframework.ui.android.LanguageSelector - android:id="@+id/source_language" - android:layout_height="wrap_content" - android:layout_width="match_parent" - android:layout_alignParentLeft="true" - android:layout_alignParentTop="true" - android:layout_toLeftOf="@id/switch_languages" - android:padding="0dp"/> - - <org.grammaticalframework.ui.android.LanguageSelector - android:id="@+id/target_language" - android:layout_height="wrap_content" - android:layout_width="match_parent" - android:layout_below="@id/source_language" - android:layout_toLeftOf="@id/switch_languages" - android:padding="0dp"/> - </RelativeLayout> - - <org.grammaticalframework.ui.android.ConversationView - android:id="@+id/conversation" - android:layout_height="match_parent" - android:layout_width="match_parent" - android:layout_alignParentLeft="true" - android:layout_alignParentBottom="true" - android:layout_alignParentRight="true" - android:layout_below="@id/top_bg"> - - <LinearLayout - android:id="@+id/conversation_content" - android:layout_height="wrap_content" - android:layout_width="match_parent" - android:orientation="vertical" - android:padding="16dp"/> - </org.grammaticalframework.ui.android.ConversationView> - </RelativeLayout> - - <LinearLayout - android:id="@+id/progressBarView" - android:gravity="center" - android:visibility="gone" - android:background="#00000000" - android:layout_height="match_parent" - android:layout_width="match_parent"> - - <ProgressBar - android:layout_width="wrap_content" - android:layout_height="wrap_content"/> - </LinearLayout> -</FrameLayout>
\ No newline at end of file diff --git a/src/ui/android/res/layout/activity_navigation.xml b/src/ui/android/res/layout/activity_navigation.xml deleted file mode 100644 index 44311b90d..000000000 --- a/src/ui/android/res/layout/activity_navigation.xml +++ /dev/null @@ -1,16 +0,0 @@ -<!-- A DrawerLayout is intended to be used as the top-level content view using match_parent for both width and height to consume the full space available. --> -<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - android:id="@+id/drawer_layout" - android:layout_width="match_parent" - android:layout_height="match_parent" - tools:context=".gui.activities.NavigationActivity"> - - <!-- As the main content view, the view below consumes the entire - space available using match_parent in both dimensions. --> - <FrameLayout - android:id="@+id/container" - android:layout_width="match_parent" - android:layout_height="match_parent" /> - -</android.support.v4.widget.DrawerLayout> diff --git a/src/ui/android/res/layout/activity_semantic_graph.xml b/src/ui/android/res/layout/activity_semantic_graph.xml deleted file mode 100644 index 004e22a7c..000000000 --- a/src/ui/android/res/layout/activity_semantic_graph.xml +++ /dev/null @@ -1,61 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<FrameLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_height="match_parent" - android:layout_width="match_parent"> - - <RelativeLayout - android:layout_height="match_parent" - android:layout_width="match_parent"> - - <RelativeLayout - android:id="@+id/graph_header" - android:layout_height="wrap_content" - android:layout_width="match_parent" - android:layout_alignParentTop="true" - android:layout_alignParentLeft="true" - android:layout_alignParentRight="true" - android:padding="8dp" - android:background="#C0C0C0"> - - <ImageView - android:id="@+id/add_word" - android:layout_height="wrap_content" - android:layout_width="wrap_content" - android:layout_alignParentRight="true" - android:padding="8dp" - android:src="@drawable/ic_search_black_24dp"/> - - <org.grammaticalframework.ui.android.LanguageSelector - android:id="@+id/show_language" - android:layout_height="wrap_content" - android:layout_width="match_parent" - android:layout_alignParentLeft="true" - android:layout_alignParentTop="true" - android:layout_toLeftOf="@id/add_word" - android:padding="0dp"/> - </RelativeLayout> - - <org.grammaticalframework.ui.android.SemanticGraphView - android:id="@+id/semantic_graph" - android:layout_height="match_parent" - android:layout_width="match_parent" - android:layout_alignParentLeft="true" - android:layout_alignParentBottom="true" - android:layout_alignParentRight="true" - android:layout_below="@id/graph_header"/> - </RelativeLayout> - - <LinearLayout - android:id="@+id/progressBarView" - android:gravity="center" - android:visibility="gone" - android:background="#00000000" - android:layout_height="match_parent" - android:layout_width="match_parent"> - - <ProgressBar - android:layout_width="wrap_content" - android:layout_height="wrap_content"/> - </LinearLayout> -</FrameLayout> diff --git a/src/ui/android/res/layout/alternative_item.xml b/src/ui/android/res/layout/alternative_item.xml deleted file mode 100644 index f35d1b938..000000000 --- a/src/ui/android/res/layout/alternative_item.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" - android:layout_height="fill_parent" > - <ImageView - android:id="@+id/arrow" - android:layout_width="30dp" - android:layout_height="30dp" - android:contentDescription="@string/open_image" - android:src="@drawable/open_arrow" - android:paddingLeft="10dp" - android:paddingRight="5dp" /> - - <TextView - android:id="@+id/alternative_desc" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_toRightOf="@id/arrow" - android:paddingLeft="10dp" - android:textSize="25sp"/> - - <org.grammaticalframework.ui.android.ParseTreeView - android:id="@+id/desc_details" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_below="@id/alternative_desc" - android:textSize="25sp" - /> - - <TextView - android:id="@+id/abstract_tree" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_below="@id/desc_details" - android:textSize="15sp"/> -</RelativeLayout>
\ No newline at end of file diff --git a/src/ui/android/res/layout/checkbox_input_list_item.xml b/src/ui/android/res/layout/checkbox_input_list_item.xml deleted file mode 100644 index 255d0ae8d..000000000 --- a/src/ui/android/res/layout/checkbox_input_list_item.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="vertical" - android:layout_width="match_parent" - android:layout_height="wrap_content"> - - <CheckBox - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:textSize="15sp" - android:id="@+id/choice_checkbox" /> - -</LinearLayout> diff --git a/src/ui/android/res/layout/first_person_utterance.xml b/src/ui/android/res/layout/first_person_utterance.xml deleted file mode 100644 index 97171149c..000000000 --- a/src/ui/android/res/layout/first_person_utterance.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<EditText xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_height="wrap_content" - android:layout_width="wrap_content" - android:layout_marginBottom="16dp" - android:layout_gravity="left" - android:padding="8dp" - android:textSize="20sp" - android:inputType="textNoSuggestions" - android:background="@drawable/first_person_utterance_bg" - /> diff --git a/src/ui/android/res/layout/fragment_phrase_list.xml b/src/ui/android/res/layout/fragment_phrase_list.xml deleted file mode 100644 index 1868da31c..000000000 --- a/src/ui/android/res/layout/fragment_phrase_list.xml +++ /dev/null @@ -1,16 +0,0 @@ -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:descendantFocusability="blocksDescendants" - tools:context="se.chalmers.phrasebook.gui.fragments.PhraseListFragment"> - - <ListView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:id="@+id/phrase_listView" - android:layout_alignParentRight="true" - android:layout_alignParentTop="true" - /> - -</FrameLayout> diff --git a/src/ui/android/res/layout/fragment_translator.xml b/src/ui/android/res/layout/fragment_translator.xml deleted file mode 100644 index 6b6584f98..000000000 --- a/src/ui/android/res/layout/fragment_translator.xml +++ /dev/null @@ -1,60 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<LinearLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="vertical" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="vertical" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:background="@drawable/grid_phrasebook_button" - android:layout_marginTop="10dp" - android:layout_marginLeft="10dp" - android:layout_marginRight="10dp" - android:id="@+id/fragment_translation"> - - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="New Text" - android:textSize="24dp" - android:id="@+id/origin_phrase" - android:layout_marginLeft="10dp" - android:layout_marginRight="10dp" - android:layout_marginTop="16dp" - android:layout_marginBottom="16dp" - android:maxLines="4" - android:scrollHorizontally="false" - /> - - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="New Text" - android:textSize="24dp" - android:id="@+id/target_phrase" - android:layout_marginLeft="10dp" - android:layout_marginRight="10dp" - android:maxLines="4" - android:scrollHorizontally="false" - /> - - <ImageView - android:id="@+id/button3" - android:layout_width="30dp" - android:layout_height="30dp" - android:layout_gravity="right" - android:src="@drawable/ic_volume_up_black_18dp"/> - </LinearLayout> - - <ListView xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="vertical" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:id="@+id/input_holder" - android:divider="@android:color/transparent" - android:padding="8dp"/> -</LinearLayout> diff --git a/src/ui/android/res/layout/input.xml b/src/ui/android/res/layout/input.xml deleted file mode 100644 index fdef07a53..000000000 --- a/src/ui/android/res/layout/input.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<org.grammaticalframework.ui.android.TranslatorKeyboardView - xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/keyboard" - android:layout_alignParentBottom="true" - android:layout_width="match_parent" - android:layout_height="wrap_content" - /> diff --git a/src/ui/android/res/layout/keyboard_languages_options.xml b/src/ui/android/res/layout/keyboard_languages_options.xml deleted file mode 100644 index 17512df19..000000000 --- a/src/ui/android/res/layout/keyboard_languages_options.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<TableLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal" - android:padding="5dp" - android:layout_margin="1dp" - > - <ImageButton android:id="@+id/closeButton" - android:background="@android:color/transparent" - android:src="@drawable/btn_close" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center" - android:layout_marginStart="8dp" - android:padding="5dp" - android:clickable="true" - /> -</TableLayout>
\ No newline at end of file diff --git a/src/ui/android/res/layout/languages_item.xml b/src/ui/android/res/layout/languages_item.xml deleted file mode 100644 index d5f47ab27..000000000 --- a/src/ui/android/res/layout/languages_item.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<TextView - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_height="wrap_content" - android:layout_width="match_parent" - android:padding="8dp" - android:textSize="20sp" - /> diff --git a/src/ui/android/res/layout/lexical_item.xml b/src/ui/android/res/layout/lexical_item.xml deleted file mode 100644 index 1d3835e54..000000000 --- a/src/ui/android/res/layout/lexical_item.xml +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" - android:layout_height="fill_parent" > - <ImageView - android:id="@+id/arrow" - android:layout_width="30dp" - android:layout_height="30dp" - android:contentDescription="@string/open_image" - android:src="@drawable/open_arrow" - android:paddingLeft="10dp" - android:paddingRight="5dp" /> - - <TextView - android:id="@+id/lexical_desc" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_toRightOf="@id/arrow" - android:paddingLeft="10dp" - android:textSize="25sp"/> - - <WebView - android:id="@+id/desc_details" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_below="@id/lexical_desc"/> -</RelativeLayout> diff --git a/src/ui/android/res/layout/number_input_list_item.xml b/src/ui/android/res/layout/number_input_list_item.xml deleted file mode 100644 index a3cfa07e5..000000000 --- a/src/ui/android/res/layout/number_input_list_item.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="vertical" android:layout_width="match_parent" - android:layout_height="match_parent" - > - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="New Text" - android:textSize="15sp" - android:id="@+id/textView_number" /> - - <SeekBar - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:max="100" - android:id="@+id/seekBar" /> - - <EditText - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:inputType="numberPassword" - android:ems="10" - android:id="@+id/editNumber" /> - - -</LinearLayout>
\ No newline at end of file diff --git a/src/ui/android/res/layout/phrase_list_item.xml b/src/ui/android/res/layout/phrase_list_item.xml deleted file mode 100644 index f812ad871..000000000 --- a/src/ui/android/res/layout/phrase_list_item.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:textSize="18dp" - android:textColor="@color/text_colour_light" - android:fontFamily="sans-serif-light" - android:text="New Text" - android:id="@+id/textView3" - android:padding="8dp" - xmlns:android="http://schemas.android.com/apk/res/android" /> - diff --git a/src/ui/android/res/layout/second_person_utterance.xml b/src/ui/android/res/layout/second_person_utterance.xml deleted file mode 100644 index 416d85328..000000000 --- a/src/ui/android/res/layout/second_person_utterance.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<TextView - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_height="wrap_content" - android:layout_width="wrap_content" - android:layout_marginBottom="16dp" - android:layout_marginLeft="32dp" - android:layout_gravity="right" - android:padding="8dp" - android:textSize="20sp" - android:background="@drawable/second_person_utterance_bg" - /> diff --git a/src/ui/android/res/layout/spinner_input_list_item.xml b/src/ui/android/res/layout/spinner_input_list_item.xml deleted file mode 100644 index be07004f4..000000000 --- a/src/ui/android/res/layout/spinner_input_list_item.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="vertical" - android:layout_width="match_parent" - android:layout_height="wrap_content"> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="New Text" - android:textSize="15sp" - android:id="@+id/text_view_spinner" /> - - <Spinner - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:id="@+id/choice_spinner" /> - -</LinearLayout> diff --git a/src/ui/android/res/menu/main.xml b/src/ui/android/res/menu/main.xml deleted file mode 100644 index f36095749..000000000 --- a/src/ui/android/res/menu/main.xml +++ /dev/null @@ -1,10 +0,0 @@ -<menu xmlns:android="http://schemas.android.com/apk/res/android" > - <item android:id="@+id/input_mode" - android:title="@string/keyboard_input"/> - <item android:id="@+id/phrasebook" - android:title="@string/phrasebook"/> - <item android:id="@+id/topics" - android:title="@string/topics"/> - <item android:id="@+id/help" - android:title="@string/help"/> -</menu> diff --git a/src/ui/android/res/values-sw600dp/dimens.xml b/src/ui/android/res/values-sw600dp/dimens.xml deleted file mode 100644 index 44f01db75..000000000 --- a/src/ui/android/res/values-sw600dp/dimens.xml +++ /dev/null @@ -1,8 +0,0 @@ -<resources> - - <!-- - Customize dimensions originally defined in res/values/dimens.xml (such as - screen margins) for sw600dp devices (e.g. 7" tablets) here. - --> - -</resources> diff --git a/src/ui/android/res/values-sw720dp-land/dimens.xml b/src/ui/android/res/values-sw720dp-land/dimens.xml deleted file mode 100644 index 61e3fa8fb..000000000 --- a/src/ui/android/res/values-sw720dp-land/dimens.xml +++ /dev/null @@ -1,9 +0,0 @@ -<resources> - - <!-- - Customize dimensions originally defined in res/values/dimens.xml (such as - screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here. - --> - <dimen name="activity_horizontal_margin">128dp</dimen> - -</resources> diff --git a/src/ui/android/res/values-v11/styles.xml b/src/ui/android/res/values-v11/styles.xml deleted file mode 100644 index 3c02242ad..000000000 --- a/src/ui/android/res/values-v11/styles.xml +++ /dev/null @@ -1,11 +0,0 @@ -<resources> - - <!-- - Base application theme for API 11+. This theme completely replaces - AppBaseTheme from res/values/styles.xml on API 11+ devices. - --> - <style name="AppBaseTheme" parent="android:Theme.Holo.Light"> - <!-- API 11 theme customizations can go here. --> - </style> - -</resources> diff --git a/src/ui/android/res/values-v14/styles.xml b/src/ui/android/res/values-v14/styles.xml deleted file mode 100644 index a91fd0372..000000000 --- a/src/ui/android/res/values-v14/styles.xml +++ /dev/null @@ -1,12 +0,0 @@ -<resources> - - <!-- - Base application theme for API 14+. This theme completely replaces - AppBaseTheme from BOTH res/values/styles.xml and - res/values-v11/styles.xml on API 14+ devices. - --> - <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar"> - <!-- API 14 theme customizations can go here. --> - </style> - -</resources> diff --git a/src/ui/android/res/values/attrs.xml b/src/ui/android/res/values/attrs.xml deleted file mode 100644 index debd08fa0..000000000 --- a/src/ui/android/res/values/attrs.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <declare-styleable name="Theme"> - <attr name="parseTreeViewStyle" format="reference"/> - </declare-styleable> -</resources> diff --git a/src/ui/android/res/values/colors.xml b/src/ui/android/res/values/colors.xml deleted file mode 100644 index e7dbbada4..000000000 --- a/src/ui/android/res/values/colors.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <color name="candidate_normal">#FF000000</color> - <color name="candidate_recommended">#FFE35900</color> - <color name="candidate_other">#ff808080</color> - <color name="candidate_background">#ffffffff</color> - <item name="primary_color" type="color">#75CD75</item> - <item name="text_colour_light" type="color">#616161</item> -</resources> diff --git a/src/ui/android/res/values/dimens.xml b/src/ui/android/res/values/dimens.xml deleted file mode 100644 index 04289dc79..000000000 --- a/src/ui/android/res/values/dimens.xml +++ /dev/null @@ -1,10 +0,0 @@ -<resources> - - <!-- Default screen margins, per the Android Design guidelines. --> - <dimen name="activity_horizontal_margin">16dp</dimen> - <dimen name="activity_vertical_margin">16dp</dimen> - <dimen name="key_height">50dip</dimen> - <dimen name="candidate_font_height">25sp</dimen> - <dimen name="candidate_vertical_padding">6sp</dimen> - -</resources> diff --git a/src/ui/android/res/values/strings.xml b/src/ui/android/res/values/strings.xml deleted file mode 100644 index 8281a1353..000000000 --- a/src/ui/android/res/values/strings.xml +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <string name="app_name">GF Offline Translator</string> - - <string name="microphone">Microphone</string> - <string name="switch_languages">Switch languages</string> - <string name="open_image">Opening</string> - <string name="mic_input">Speech Input</string> - <string name="keyboard_input">Keyboard Input</string> - <string name="semantic_graph">Semantic Graph</string> - <string name="help">Help</string> - <string name="global_preferences_key">org.grammaticalframework.ui.android.GLOBAL_PREFERENCES</string> - - <string name="authority_key">authority_key</string> - <string name="source_key">source_key</string> - <string name="target_key">target_key</string> - <string name="alternatives_key">alternatives_key</string> - - <!-- Labels on soft keys --> - <string name="label_done_key">Done</string> - <string name="label_go_key">Go</string> - <string name="label_next_key">Next</string> - <string name="label_previous_key">Previous</string> - <string name="label_send_key">Send</string> - - <!-- Labels for subtype --> - <string name="normalKeyboardMode">normalKeyboardMode</string> - <string name="internalKeyboardMode">internalKeyboardMode</string> - - <string name="search_hint">Search word:</string> - <string name="search_description">Search for words in the lexicon</string> - - <string name="topics">Topics</string> - <string name="topics_open">Open topics</string> - <string name="topics_close">Close topics</string> - - <string name="phrasebook">Phrasebook</string> -</resources> diff --git a/src/ui/android/res/values/styles.xml b/src/ui/android/res/values/styles.xml deleted file mode 100644 index c839d30a9..000000000 --- a/src/ui/android/res/values/styles.xml +++ /dev/null @@ -1,24 +0,0 @@ -<resources> - - <!-- - Base application theme, dependent on API level. This theme is replaced - by AppBaseTheme from res/values-vXX/styles.xml on newer devices. - --> - <style name="AppBaseTheme" parent="android:Theme.Light"> - <!-- - Theme customizations available in newer API levels can go in - res/values-vXX/styles.xml, while customizations related to - backward-compatibility can go here. - --> - </style> - - <!-- Application theme. --> - <style name="AppTheme" parent="AppBaseTheme"> - <!-- All customizations that are NOT specific to a particular API-level can go here. --> - <item name="parseTreeViewStyle">@style/ParseTreeViewStyle</item> - </style> - - <style name="ParseTreeViewStyle"> - <item name="android:scrollbars">horizontal</item> - </style> -</resources> diff --git a/src/ui/android/res/xml/cyrillic.xml b/src/ui/android/res/xml/cyrillic.xml deleted file mode 100644 index b699d9c19..000000000 --- a/src/ui/android/res/xml/cyrillic.xml +++ /dev/null @@ -1,76 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<Keyboard xmlns:android="http://schemas.android.com/apk/res/android" - android:keyWidth="9%p" - android:horizontalGap="0px" - android:verticalGap="0px" - android:keyHeight="@dimen/key_height" - > - - <Row> - <Key android:codes="1103" android:keyLabel="я" android:horizontalGap="0.5%p" android:keyEdgeFlags="left"/> - <Key android:codes="1074" android:keyLabel="в"/> - <Key android:codes="1077" android:keyLabel="е" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ёєэ"/> - <Key android:codes="1088" android:keyLabel="р"/> - <Key android:codes="1090" android:keyLabel="т" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ћ"/> - <Key android:codes="1098" android:keyLabel="ъ"/> - <Key android:codes="1091" android:keyLabel="у" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ў"/> - <Key android:codes="1080" android:keyLabel="и" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ії"/> - <Key android:codes="1086" android:keyLabel="о"/> - <Key android:codes="1087" android:keyLabel="п"/> - <Key android:codes="1095" android:keyLabel="ч" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ҷҹ" android:keyEdgeFlags="right"/> - </Row> - - <Row> - <Key android:codes="1072" android:keyLabel="а" android:horizontalGap="0.5%p" android:keyEdgeFlags="left"/> - <Key android:codes="1089" android:keyLabel="с"/> - <Key android:codes="1076" android:keyLabel="д" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ђ"/> - <Key android:codes="1092" android:keyLabel="ф"/> - <Key android:codes="1075" android:keyLabel="г" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ґѓ"/> - <Key android:codes="1093" android:keyLabel="х"/> - <Key android:codes="1081" android:keyLabel="й" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ј"/> - <Key android:codes="1082" android:keyLabel="к" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ќ"/> - <Key android:codes="1083" android:keyLabel="л" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="љ"/> - <Key android:codes="1096" android:keyLabel="ш"/> - <Key android:codes="1097" android:keyLabel="щ" android:keyEdgeFlags="right"/> - </Row> - - <Row> - <Key android:codes="-1" android:keyIcon="@drawable/sym_keyboard_shift" - android:keyWidth="14%p" android:isModifier="true" - android:isSticky="true" android:keyEdgeFlags="left"/> - <Key android:codes="1079" android:keyLabel="з"/> - <Key android:codes="1100" android:keyLabel="ь" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ыѣ"/> - <Key android:codes="1094" android:keyLabel="ц"/> - <Key android:codes="1078" android:keyLabel="ж" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="җџ"/> - <Key android:codes="1073" android:keyLabel="б"/> - <Key android:codes="1085" android:keyLabel="н" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="њ"/> - <Key android:codes="1084" android:keyLabel="м"/> - <Key android:codes="1102" android:keyLabel="ю"/> - <Key android:codes="-5" android:keyIcon="@drawable/sym_keyboard_delete" - android:keyWidth="15%p" android:keyEdgeFlags="right" - android:isRepeatable="true"/> - </Row> - - <Row android:rowEdgeFlags="bottom" android:keyboardMode="@string/normalKeyboardMode"> - <Key android:codes="-100" android:keyLabel="Sr" android:keyWidth="13%p" android:keyEdgeFlags="left"/> - <Key android:codes="-200" android:keyLabel="Tr" android:keyWidth="13%p"/> - <Key android:codes="-2" android:keyLabel="123" android:keyWidth="13%p"/> - <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space" - android:keyWidth="29%p" android:isRepeatable="true"/> - <Key android:codes="46" android:keyLabel="." android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="," - android:keyWidth="14%p"/> - <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_return" - android:keyWidth="19%p" android:keyEdgeFlags="right"/> - </Row> - - <Row android:rowEdgeFlags="bottom" android:keyboardMode="@string/internalKeyboardMode"> - <Key android:codes="-2" android:keyLabel="123" android:keyWidth="15%p" android:horizontalGap="10%p" android:keyEdgeFlags="left"/> - <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space" - android:keyWidth="30%p" android:isRepeatable="true"/> - <Key android:codes="46" android:keyLabel="." android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="," - android:keyWidth="15%p"/> - <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_return" - android:keyWidth="20%p" android:keyEdgeFlags="right"/> - </Row> -</Keyboard> diff --git a/src/ui/android/res/xml/devanagari_page1.xml b/src/ui/android/res/xml/devanagari_page1.xml deleted file mode 100644 index 14e87a4f3..000000000 --- a/src/ui/android/res/xml/devanagari_page1.xml +++ /dev/null @@ -1,67 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<Keyboard xmlns:android="http://schemas.android.com/apk/res/android" - android:keyWidth="10%p" - android:horizontalGap="0px" - android:verticalGap="0px" - android:keyHeight="@dimen/key_height" - > - - <Row> - <Key android:codes="2325" android:keyLabel="क" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="क़०" android:keyEdgeFlags="left"/> - <Key android:codes="2326" android:keyLabel="ख" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ख़१"/> - <Key android:codes="2327" android:keyLabel="ग" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ग़२"/> - <Key android:codes="2328" android:keyLabel="घ" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="३"/> - <Key android:codes="2329" android:keyLabel="ङ" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="४"/> - <Key android:codes="2330" android:keyLabel="च" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="५"/> - <Key android:codes="2331" android:keyLabel="छ" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="६"/> - <Key android:codes="2332" android:keyLabel="ज" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ज़७"/> - <Key android:codes="2333" android:keyLabel="झ" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="८"/> - <Key android:codes="2334" android:keyLabel="ञ" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="९" android:keyEdgeFlags="right"/> - </Row> - - <Row> - <Key android:codes="2335" android:keyLabel="ट" android:keyEdgeFlags="left"/> - <Key android:codes="2336" android:keyLabel="ठ"/> - <Key android:codes="2337" android:keyLabel="ड" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ड़"/> - <Key android:codes="2338" android:keyLabel="ढ" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ढ़"/> - <Key android:codes="2339" android:keyLabel="ण"/> - <Key android:codes="2340" android:keyLabel="त"/> - <Key android:codes="2341" android:keyLabel="थ"/> - <Key android:codes="2342" android:keyLabel="द"/> - <Key android:codes="2343" android:keyLabel="ध"/> - <Key android:codes="2344" android:keyLabel="न" android:keyEdgeFlags="right"/> - </Row> - - <Row> - <Key android:codes="-10" android:keyLabel="1/2" android:horizontalGap="3%p" android:keyEdgeFlags="left"/> - <Key android:codes="2309" android:keyLabel="अ" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="आा"/> - <Key android:codes="2311" android:keyLabel="इ" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ीईि"/> - <Key android:codes="2313" android:keyLabel="उ" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ूऊु"/> - <Key android:codes="2319" android:keyLabel="ए" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ॅऐैेऍ"/> - <Key android:codes="2323" android:keyLabel="ओ" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ॉौऔोऑ"/> - <Key android:codes="2315" android:keyLabel="ऋ" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ॄॠृ"/> - <Key android:codes="2305" android:keyLabel="ँ" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ंः"/> - <Key android:codes="-5" android:keyIcon="@drawable/sym_keyboard_delete" - android:keyWidth="15%p" android:keyEdgeFlags="right" - android:isRepeatable="true"/> - </Row> - - <Row android:rowEdgeFlags="bottom" android:keyboardMode="@string/normalKeyboardMode"> - <Key android:codes="-100" android:keyLabel="Sr" android:keyWidth="13%p" android:horizontalGap="6%p" android:keyEdgeFlags="left"/> - <Key android:codes="-200" android:keyLabel="Tr" android:keyWidth="13%p"/> - <Key android:codes="-2" android:keyLabel="123" android:keyWidth="13%p"/> - <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space" - android:keyWidth="29%p" android:isRepeatable="true"/> - <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_return" - android:keyWidth="19%p" android:keyEdgeFlags="right"/> - </Row> - - <Row android:rowEdgeFlags="bottom" android:keyboardMode="@string/internalKeyboardMode"> - <Key android:codes="-2" android:keyLabel="123" android:keyWidth="18%p" android:horizontalGap="15%p" android:keyEdgeFlags="left"/> - <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space" - android:keyWidth="30%p" android:isRepeatable="true"/> - <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_return" - android:keyWidth="20%p" android:keyEdgeFlags="right"/> - </Row> -</Keyboard>
\ No newline at end of file diff --git a/src/ui/android/res/xml/devanagari_page2.xml b/src/ui/android/res/xml/devanagari_page2.xml deleted file mode 100644 index 982adb277..000000000 --- a/src/ui/android/res/xml/devanagari_page2.xml +++ /dev/null @@ -1,67 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<Keyboard xmlns:android="http://schemas.android.com/apk/res/android" - android:keyWidth="10%p" - android:horizontalGap="0px" - android:verticalGap="0px" - android:keyHeight="@dimen/key_height" - > - - <Row> - <Key android:codes="2346" android:keyLabel="प" android:keyEdgeFlags="left"/> - <Key android:codes="2347" android:keyLabel="फ" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="फ़"/> - <Key android:codes="2348" android:keyLabel="ब"/> - <Key android:codes="2349" android:keyLabel="भ"/> - <Key android:codes="2350" android:keyLabel="म"/> - <Key android:codes="2351" android:keyLabel="य" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="य़"/> - <Key android:codes="2352" android:keyLabel="र" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ऱ"/> - <Key android:codes="2354" android:keyLabel="ल"/> - <Key android:codes="2355" android:keyLabel="ळ" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ऴ"/> - <Key android:codes="2357" android:keyLabel="व" android:keyEdgeFlags="right"/> - </Row> - - <Row> - <Key android:codes="2358" android:keyLabel="श" android:keyEdgeFlags="left"/> - <Key android:codes="2359" android:keyLabel="ष"/> - <Key android:codes="2360" android:keyLabel="स"/> - <Key android:codes="2361" android:keyLabel="ह"/> - <Key android:codes="2325,2381,2359" android:keyLabel="क्ष"/> - <Key android:codes="2340,2381,2352" android:keyLabel="त्र"/> - <Key android:codes="2332,2381,2334" android:keyLabel="ज्ञ"/> - <Key android:codes="2358,2381,2352" android:keyLabel="श्र"/> - <Key android:codes="2364" android:keyLabel="़"/> - <Key android:codes="2381" android:keyLabel="्"/>"आ" - </Row> - - <Row> - <Key android:codes="-10" android:keyLabel="2/2" android:horizontalGap="3%p" android:keyEdgeFlags="left"/> - <Key android:codes="2310" android:keyLabel="आ" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="अा"/> - <Key android:codes="2312" android:keyLabel="ई" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ीइि"/> - <Key android:codes="2314" android:keyLabel="ऊ" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ूउु"/> - <Key android:codes="2320" android:keyLabel="ऐ" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ॅैएेऍ"/> - <Key android:codes="2324" android:keyLabel="औ" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ॉौओोऑ"/> - <Key android:codes="2400" android:keyLabel="ॠ" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ॄऋृ"/> - <Key android:codes="2306" android:keyLabel="ं" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ँः"/> - <Key android:codes="-5" android:keyIcon="@drawable/sym_keyboard_delete" - android:keyWidth="15%p" android:keyEdgeFlags="right" - android:isRepeatable="true"/> - </Row> - - <Row android:rowEdgeFlags="bottom" android:keyboardMode="@string/normalKeyboardMode"> - <Key android:codes="-100" android:keyLabel="Sr" android:keyWidth="13%p" android:horizontalGap="6%p" android:keyEdgeFlags="left"/> - <Key android:codes="-200" android:keyLabel="Tr" android:keyWidth="13%p"/> - <Key android:codes="-2" android:keyLabel="123" android:keyWidth="13%p"/> - <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space" - android:keyWidth="29%p" android:isRepeatable="true"/> - <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_return" - android:keyWidth="19%p" android:keyEdgeFlags="right"/> - </Row> - - <Row android:rowEdgeFlags="bottom" android:keyboardMode="@string/internalKeyboardMode"> - <Key android:codes="-2" android:keyLabel="123" android:keyWidth="18%p" android:horizontalGap="15%p" android:keyEdgeFlags="left"/> - <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space" - android:keyWidth="30%p" android:isRepeatable="true"/> - <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_return" - android:keyWidth="20%p" android:keyEdgeFlags="right"/> - </Row> -</Keyboard>
\ No newline at end of file diff --git a/src/ui/android/res/xml/method.xml b/src/ui/android/res/xml/method.xml deleted file mode 100644 index af83761ca..000000000 --- a/src/ui/android/res/xml/method.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- The attributes in this XML file provide configuration information --> -<!-- for the Search Manager. --> - -<input-method xmlns:android="http://schemas.android.com/apk/res/android"> -</input-method> diff --git a/src/ui/android/res/xml/nordic.xml b/src/ui/android/res/xml/nordic.xml deleted file mode 100644 index 80b1d6e51..000000000 --- a/src/ui/android/res/xml/nordic.xml +++ /dev/null @@ -1,77 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<Keyboard xmlns:android="http://schemas.android.com/apk/res/android" - android:keyWidth="9%p" - android:horizontalGap="0px" - android:verticalGap="0px" - android:keyHeight="@dimen/key_height" - > - - <Row> - <Key android:codes="113" android:keyLabel="q" android:horizontalGap="0.5%p" android:keyEdgeFlags="left"/> - <Key android:codes="119" android:keyLabel="w"/> - <Key android:codes="101" android:keyLabel="e" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="èéêěëę"/> - <Key android:codes="114" android:keyLabel="r"/> - <Key android:codes="116" android:keyLabel="t"/> - <Key android:codes="121" android:keyLabel="y" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ỳýÿ"/> - <Key android:codes="117" android:keyLabel="u" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ùúûǔūü"/> - <Key android:codes="105" android:keyLabel="i" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ìíîǐï"/> - <Key android:codes="111" android:keyLabel="o" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="òóôõöǫœø"/> - <Key android:codes="112" android:keyLabel="p"/> - <Key android:codes="229" android:keyLabel="å" android:keyEdgeFlags="right"/> - </Row> - - <Row> - <Key android:codes="97" android:keyLabel="a" android:horizontalGap="0.5%p" - android:keyEdgeFlags="left" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="àáâǎãäåæ"/> - <Key android:codes="115" android:keyLabel="s" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ŝšß"/> - <Key android:codes="100" android:keyLabel="d" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="đ"/> - <Key android:codes="102" android:keyLabel="f"/> - <Key android:codes="103" android:keyLabel="g" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ǵ"/> - <Key android:codes="104" android:keyLabel="h"/> - <Key android:codes="106" android:keyLabel="j" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ǰ"/> - <Key android:codes="107" android:keyLabel="k" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ḱ"/> - <Key android:codes="108" android:keyLabel="l"/> - <Key android:codes="246" android:keyLabel="ö"/> - <Key android:codes="228" android:keyLabel="ä" android:keyEdgeFlags="right"/> - </Row> - - <Row> - <Key android:codes="-1" android:keyIcon="@drawable/sym_keyboard_shift" - android:keyWidth="15%p" android:isModifier="true" - android:isSticky="true" android:keyEdgeFlags="left"/> - <Key android:codes="122" android:keyLabel="z" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ẑž" android:keyWidth="10%p"/> - <Key android:codes="120" android:keyLabel="x" android:keyWidth="10%p"/> - <Key android:codes="99" android:keyLabel="c" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ćč" android:keyWidth="10%p"/> - <Key android:codes="118" android:keyLabel="v" android:keyWidth="10%p"/> - <Key android:codes="98" android:keyLabel="b" android:keyWidth="10%p"/> - <Key android:codes="110" android:keyLabel="n" android:keyWidth="10%p" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ńñ"/> - <Key android:codes="109" android:keyLabel="m" android:keyWidth="10%p"/> - <Key android:codes="-5" android:keyIcon="@drawable/sym_keyboard_delete" - android:keyWidth="15%p" android:keyEdgeFlags="right" - android:isRepeatable="true"/> - </Row> - - <Row android:rowEdgeFlags="bottom" android:keyboardMode="@string/normalKeyboardMode"> - <Key android:codes="-100" android:keyLabel="Sr" android:keyWidth="13%p" android:keyEdgeFlags="left"/> - <Key android:codes="-200" android:keyLabel="Tr" android:keyWidth="13%p"/> - <Key android:codes="-2" android:keyLabel="123" android:keyWidth="13%p"/> - <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space" - android:keyWidth="29%p" android:isRepeatable="true"/> - <Key android:codes="46" android:keyLabel="." android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="," - android:keyWidth="14%p"/> - <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_return" - android:keyWidth="19%p" android:keyEdgeFlags="right"/> - </Row> - - <Row android:rowEdgeFlags="bottom" android:keyboardMode="@string/internalKeyboardMode"> - <Key android:codes="-2" android:keyLabel="123" android:keyWidth="15%p" android:horizontalGap="10%p" android:keyEdgeFlags="left"/> - <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space" - android:keyWidth="30%p" android:isRepeatable="true"/> - <Key android:codes="46" android:keyLabel="." android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="," - android:keyWidth="15%p"/> - <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_return" - android:keyWidth="20%p" android:keyEdgeFlags="right"/> - </Row> -</Keyboard> - diff --git a/src/ui/android/res/xml/popup_keyboard.xml b/src/ui/android/res/xml/popup_keyboard.xml deleted file mode 100644 index 521d3d278..000000000 --- a/src/ui/android/res/xml/popup_keyboard.xml +++ /dev/null @@ -1,5 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Keyboard xmlns:android="http://schemas.android.com/apk/res/android" - android:keyWidth="10%p" - android:keyHeight="10%p"> -</Keyboard>
\ No newline at end of file diff --git a/src/ui/android/res/xml/qwerty.xml b/src/ui/android/res/xml/qwerty.xml deleted file mode 100644 index a0021d4b4..000000000 --- a/src/ui/android/res/xml/qwerty.xml +++ /dev/null @@ -1,74 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<Keyboard xmlns:android="http://schemas.android.com/apk/res/android" - android:keyWidth="10%p" - android:horizontalGap="0px" - android:verticalGap="0px" - android:keyHeight="@dimen/key_height" - > - - <Row> - <Key android:codes="113" android:keyLabel="q" android:keyEdgeFlags="left"/> - <Key android:codes="119" android:keyLabel="w"/> - <Key android:codes="101" android:keyLabel="e" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="èéêěëę"/> - <Key android:codes="114" android:keyLabel="r"/> - <Key android:codes="116" android:keyLabel="t"/> - <Key android:codes="121" android:keyLabel="y" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ỳýÿ"/> - <Key android:codes="117" android:keyLabel="u" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ùúûǔūü"/> - <Key android:codes="105" android:keyLabel="i" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ìíîǐï"/> - <Key android:codes="111" android:keyLabel="o" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="òóôõöǫœø"/> - <Key android:codes="112" android:keyLabel="p" android:keyEdgeFlags="right"/> - </Row> - - <Row> - <Key android:codes="97" android:keyLabel="a" android:horizontalGap="5%p" - android:keyEdgeFlags="left" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="àáâǎãäåæ"/> - <Key android:codes="115" android:keyLabel="s" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ŝšß"/> - <Key android:codes="100" android:keyLabel="d" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="đ"/> - <Key android:codes="102" android:keyLabel="f"/> - <Key android:codes="103" android:keyLabel="g" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ǵ"/> - <Key android:codes="104" android:keyLabel="h"/> - <Key android:codes="106" android:keyLabel="j" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ǰ"/> - <Key android:codes="107" android:keyLabel="k" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ḱ"/> - <Key android:codes="108" android:keyLabel="l" android:keyEdgeFlags="right"/> - </Row> - - <Row> - <Key android:codes="-1" android:keyIcon="@drawable/sym_keyboard_shift" - android:keyWidth="15%p" android:isModifier="true" - android:isSticky="true" android:keyEdgeFlags="left"/> - <Key android:codes="122" android:keyLabel="z" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ẑž"/> - <Key android:codes="120" android:keyLabel="x"/> - <Key android:codes="99" android:keyLabel="c" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ćč"/> - <Key android:codes="118" android:keyLabel="v"/> - <Key android:codes="98" android:keyLabel="b"/> - <Key android:codes="110" android:keyLabel="n" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="ńñ"/> - <Key android:codes="109" android:keyLabel="m"/> - <Key android:codes="-5" android:keyIcon="@drawable/sym_keyboard_delete" - android:keyWidth="15%p" android:keyEdgeFlags="right" - android:isRepeatable="true"/> - </Row> - - <Row android:rowEdgeFlags="bottom" android:keyboardMode="@string/normalKeyboardMode"> - <Key android:codes="-100" android:keyLabel="Sr" android:keyWidth="13%p" android:keyEdgeFlags="left"/> - <Key android:codes="-200" android:keyLabel="Tr" android:keyWidth="13%p"/> - <Key android:codes="-2" android:keyLabel="123" android:keyWidth="13%p"/> - <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space" - android:keyWidth="29%p" android:isRepeatable="true"/> - <Key android:codes="46" android:keyLabel="." android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="," - android:keyWidth="14%p"/> - <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_return" - android:keyWidth="19%p" android:keyEdgeFlags="right"/> - </Row> - - <Row android:rowEdgeFlags="bottom" android:keyboardMode="@string/internalKeyboardMode"> - <Key android:codes="-2" android:keyLabel="123" android:keyWidth="15%p" android:horizontalGap="10%p" android:keyEdgeFlags="left"/> - <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space" - android:keyWidth="30%p" android:isRepeatable="true"/> - <Key android:codes="46" android:keyLabel="." android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters="," - android:keyWidth="15%p"/> - <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_return" - android:keyWidth="20%p" android:keyEdgeFlags="right"/> - </Row> -</Keyboard> - diff --git a/src/ui/android/res/xml/searchable.xml b/src/ui/android/res/xml/searchable.xml deleted file mode 100644 index 7e7b6a846..000000000 --- a/src/ui/android/res/xml/searchable.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<searchable xmlns:android="http://schemas.android.com/apk/res/android" - android:label="@string/app_name" - android:hint="@string/search_hint" - android:searchSuggestAuthority="org.grammaticalframework.ui.android.LexiconSuggestionProvider" - android:includeInGlobalSearch="true" - android:searchSettingsDescription="@string/search_description"> -</searchable> diff --git a/src/ui/android/res/xml/symbols_page1.xml b/src/ui/android/res/xml/symbols_page1.xml deleted file mode 100644 index 509bb79ae..000000000 --- a/src/ui/android/res/xml/symbols_page1.xml +++ /dev/null @@ -1,73 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<Keyboard xmlns:android="http://schemas.android.com/apk/res/android" - android:keyWidth="10%p" - android:horizontalGap="0px" - android:verticalGap="0px" - android:keyHeight="@dimen/key_height" - > - - <Row> - <Key android:codes="49" android:keyLabel="1" android:keyEdgeFlags="left"/> - <Key android:codes="50" android:keyLabel="2"/> - <Key android:codes="51" android:keyLabel="3"/> - <Key android:codes="52" android:keyLabel="4"/> - <Key android:codes="53" android:keyLabel="5"/> - <Key android:codes="54" android:keyLabel="6"/> - <Key android:codes="55" android:keyLabel="7"/> - <Key android:codes="56" android:keyLabel="8"/> - <Key android:codes="57" android:keyLabel="9"/> - <Key android:codes="48" android:keyLabel="0" android:keyEdgeFlags="right"/> - </Row> - - <Row> - <Key android:codes="64" android:keyLabel="\@" android:keyEdgeFlags="left"/> - <Key android:codes="35" android:keyLabel="\#"/> - <Key android:codes="36" android:keyLabel="$"/> - <Key android:codes="37" android:keyLabel="%"/> - <Key android:codes="38" android:keyLabel="&"/> - <Key android:codes="42" android:keyLabel="*"/> - <Key android:codes="45" android:keyLabel="-"/> - <Key android:codes="61" android:keyLabel="="/> - <Key android:codes="40" android:keyLabel="("/> - <Key android:codes="41" android:keyLabel=")" android:keyEdgeFlags="right"/> - </Row> - - <Row> - <Key android:codes="-1" android:keyIcon="@drawable/sym_keyboard_shift" - android:keyWidth="15%p" android:isModifier="true" - android:isSticky="true" android:keyEdgeFlags="left"/> - <Key android:codes="33" android:keyLabel="!" /> - <Key android:codes="34" android:keyLabel="""/> - <Key android:codes="39" android:keyLabel="\'"/> - <Key android:codes="58" android:keyLabel=":"/> - <Key android:codes="59" android:keyLabel=";"/> - <Key android:codes="47" android:keyLabel="/" /> - <Key android:codes="63" android:keyLabel="\?"/> - <Key android:codes="-5" android:keyIcon="@drawable/sym_keyboard_delete" - android:keyWidth="15%p" android:keyEdgeFlags="right" - android:isRepeatable="true"/> - </Row> - - <Row android:rowEdgeFlags="bottom" android:keyboardMode="@string/normalKeyboardMode"> - <Key android:codes="-200" android:keyLabel="Tr" android:horizontalGap="5%p" - android:keyWidth="13%p" android:keyEdgeFlags="left" /> - <Key android:codes="-2" android:keyLabel="ABC" android:keyWidth="15%p" /> - <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space" android:keyWidth="30%p" - android:isRepeatable="true"/> - <Key android:codes="46" android:keyLabel="." android:keyWidth="15%p" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters=","/> - <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_return" - android:keyWidth="20%p" android:keyEdgeFlags="right" - /> - </Row> - - <Row android:rowEdgeFlags="bottom" android:keyboardMode="@string/internalKeyboardMode"> - <Key android:codes="-2" android:keyLabel="ABC" android:keyWidth="15%p" android:horizontalGap="10%p"/> - <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space" android:keyWidth="30%p" - android:isRepeatable="true"/> - <Key android:codes="46" android:keyLabel="." android:keyWidth="15%p" android:popupKeyboard="@xml/popup_keyboard" android:popupCharacters=","/> - <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_return" - android:keyWidth="20%p" android:keyEdgeFlags="right" - /> - </Row> -</Keyboard>
\ No newline at end of file diff --git a/src/ui/android/res/xml/symbols_page2.xml b/src/ui/android/res/xml/symbols_page2.xml deleted file mode 100644 index b55e6f521..000000000 --- a/src/ui/android/res/xml/symbols_page2.xml +++ /dev/null @@ -1,71 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<Keyboard xmlns:android="http://schemas.android.com/apk/res/android" - android:keyWidth="10%p" - android:horizontalGap="0px" - android:verticalGap="0px" - android:keyHeight="@dimen/key_height" - > - - <Row> - <Key android:codes="126" android:keyLabel="~" android:keyEdgeFlags="left"/> - <Key android:codes="177" android:keyLabel="±"/> - <Key android:codes="215" android:keyLabel="×"/> - <Key android:codes="247" android:keyLabel="÷"/> - <Key android:codes="8226" android:keyLabel="•"/> - <Key android:codes="176" android:keyLabel="°"/> - <Key android:codes="96" android:keyLabel="`"/> - <Key android:codes="180" android:keyLabel="´"/> - <Key android:codes="123" android:keyLabel="{"/> - <Key android:codes="125" android:keyLabel="}" android:keyEdgeFlags="right"/> - </Row> - - <Row> - <Key android:codes="169" android:keyLabel="©" android:keyEdgeFlags="left"/> - <Key android:codes="163" android:keyLabel="£"/> - <Key android:codes="8364" android:keyLabel="€"/> - <Key android:codes="94" android:keyLabel="^"/> - <Key android:codes="174" android:keyLabel="®"/> - <Key android:codes="165" android:keyLabel="¥"/> - <Key android:codes="95" android:keyLabel="_"/> - <Key android:codes="43" android:keyLabel="+"/> - <Key android:codes="91" android:keyLabel="["/> - <Key android:codes="93" android:keyLabel="]" android:keyEdgeFlags="right"/> - </Row> - - <Row> - <Key android:codes="-1" android:keyIcon="@drawable/sym_keyboard_shift" - android:keyWidth="15%p" android:isModifier="true" - android:isSticky="true" android:keyEdgeFlags="left"/> - <Key android:codes="161" android:keyLabel="¡" /> - <Key android:codes="60" android:keyLabel="<"/> - <Key android:codes="62" android:keyLabel=">"/> - <Key android:codes="162" android:keyLabel="¢"/> - <Key android:codes="124" android:keyLabel="|"/> - <Key android:codes="92" android:keyLabel="\\" /> - <Key android:codes="191" android:keyLabel="¿"/> - <Key android:codes="-5" android:keyIcon="@drawable/sym_keyboard_delete" - android:keyWidth="15%p" android:keyEdgeFlags="right" - android:isRepeatable="true"/> - </Row> - - <Row android:rowEdgeFlags="bottom" android:keyboardMode="@string/normalKeyboardMode"> - <Key android:codes="-200" android:keyLabel="Tr" android:horizontalGap="5%p" - android:keyWidth="13%p" android:keyEdgeFlags="left" /> - <Key android:codes="-2" android:keyLabel="ABC" android:keyWidth="15%p" /> - <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space" android:keyWidth="30%p" - android:isRepeatable="true"/> - <Key android:codes="8230" android:keyLabel="…" android:keyWidth="15%p" /> - <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_return" - android:keyWidth="20%p" android:keyEdgeFlags="right" /> - </Row> - - <Row android:rowEdgeFlags="bottom" android:keyboardMode="@string/internalKeyboardMode"> - <Key android:codes="-2" android:keyLabel="ABC" android:keyWidth="15%p" android:horizontalGap="10%p"/> - <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space" android:keyWidth="30%p" - android:isRepeatable="true"/> - <Key android:codes="8230" android:keyLabel="…" android:keyWidth="15%p" /> - <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_return" - android:keyWidth="20%p" android:keyEdgeFlags="right" /> - </Row> -</Keyboard> diff --git a/src/ui/android/res/xml/thai_page1.xml b/src/ui/android/res/xml/thai_page1.xml deleted file mode 100644 index bcc2aee39..000000000 --- a/src/ui/android/res/xml/thai_page1.xml +++ /dev/null @@ -1,86 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<Keyboard xmlns:android="http://schemas.android.com/apk/res/android" - android:keyWidth="9%p" - android:horizontalGap="0px" - android:verticalGap="0px" - android:keyHeight="@dimen/key_height" - > - - <Row android:keyWidth="8%p"> - <Key android:codes="3653" android:keyLabel="ๅ" android:horizontalGap="2%p"/> - <Key android:codes="3613" android:keyLabel="ฝ"/> - <Key android:codes="3622" android:keyLabel="ฦ"/> - <Key android:codes="3616" android:keyLabel="ภ"/> - <Key android:codes="3606" android:keyLabel="ถ"/> - <Key android:codes="3640" android:keyLabel="ุ"/> - <Key android:codes="3638" android:keyLabel="ึ"/> - <Key android:codes="3588" android:keyLabel="ค"/> - <Key android:codes="3605" android:keyLabel="ต"/> - <Key android:codes="3592" android:keyLabel="จ"/> - <Key android:codes="3586" android:keyLabel="ข"/> - <Key android:codes="3594" android:keyLabel="ช"/> - </Row> - - <Row> - <Key android:codes="3654" android:keyLabel="ๆ" android:horizontalGap="1%p"/> - <Key android:codes="3652" android:keyLabel="ไ"/> - <Key android:codes="3614" android:keyLabel="พ"/> - <Key android:codes="3632" android:keyLabel="ะ"/> - <Key android:codes="3633" android:keyLabel="ั"/> - <Key android:codes="3637" android:keyLabel="ี"/> - <Key android:codes="3619" android:keyLabel="ร"/> - <Key android:codes="3609" android:keyLabel="น"/> - <Key android:codes="3618" android:keyLabel="ย"/> - <Key android:codes="3610" android:keyLabel="บ"/> - <Key android:codes="3621" android:keyLabel="ล"/> - </Row> - - <Row> - <Key android:codes="3615" android:keyLabel="ฟ" android:horizontalGap="1%p"/> - <Key android:codes="3627" android:keyLabel="ห"/> - <Key android:codes="3585" android:keyLabel="ก"/> - <Key android:codes="3604" android:keyLabel="ด"/> - <Key android:codes="3648" android:keyLabel="เ"/> - <Key android:codes="3657" android:keyLabel="้"/> - <Key android:codes="3656" android:keyLabel="่"/> - <Key android:codes="3634" android:keyLabel="า"/> - <Key android:codes="3626" android:keyLabel="ส"/> - <Key android:codes="3623" android:keyLabel="ว"/> - <Key android:codes="3591" android:keyLabel="ง"/> - </Row> - - <Row android:keyWidth="8%p"> - <Key android:codes="-10" android:keyLabel="1/2" android:horizontalGap="2%p" android:keyEdgeFlags="left"/> - <Key android:codes="3612" android:keyLabel="ผ"/> - <Key android:codes="3611" android:keyLabel="ป"/> - <Key android:codes="3649" android:keyLabel="แ"/> - <Key android:codes="3629" android:keyLabel="อ"/> - <Key android:codes="3636" android:keyLabel="ิ"/> - <Key android:codes="3639" android:keyLabel="ื"/> - <Key android:codes="3607" android:keyLabel="ท"/> - <Key android:codes="3617" android:keyLabel="ม"/> - <Key android:codes="3651" android:keyLabel="ใ"/> - <Key android:codes="-5" android:keyIcon="@drawable/sym_keyboard_delete" - android:keyWidth="15%p" android:keyEdgeFlags="right" - android:isRepeatable="true"/> - </Row> - - <Row android:rowEdgeFlags="bottom" android:keyboardMode="@string/normalKeyboardMode"> - <Key android:codes="-100" android:keyLabel="Sr" android:keyWidth="13%p" android:horizontalGap="6%p" android:keyEdgeFlags="left"/> - <Key android:codes="-200" android:keyLabel="Tr" android:keyWidth="13%p"/> - <Key android:codes="-2" android:keyLabel="123" android:keyWidth="13%p"/> - <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space" - android:keyWidth="29%p" android:isRepeatable="true"/> - <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_return" - android:keyWidth="19%p" android:keyEdgeFlags="right"/> - </Row> - - <Row android:rowEdgeFlags="bottom" android:keyboardMode="@string/internalKeyboardMode"> - <Key android:codes="-2" android:keyLabel="123" android:keyWidth="18%p" android:horizontalGap="15%p" android:keyEdgeFlags="left"/> - <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space" - android:keyWidth="30%p" android:isRepeatable="true"/> - <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_return" - android:keyWidth="20%p" android:keyEdgeFlags="right"/> - </Row> -</Keyboard> diff --git a/src/ui/android/res/xml/thai_page2.xml b/src/ui/android/res/xml/thai_page2.xml deleted file mode 100644 index 00e76f525..000000000 --- a/src/ui/android/res/xml/thai_page2.xml +++ /dev/null @@ -1,83 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<Keyboard xmlns:android="http://schemas.android.com/apk/res/android" - android:keyWidth="9%p" - android:horizontalGap="0px" - android:verticalGap="0px" - android:keyHeight="@dimen/key_height" - > - - <Row> - <Key android:codes="43" android:keyLabel="+"/> - <Key android:codes="3665" android:keyLabel="๑"/> - <Key android:codes="3666" android:keyLabel="๒"/> - <Key android:codes="3667" android:keyLabel="๓"/> - <Key android:codes="3668" android:keyLabel="๔"/> - <Key android:codes="3647" android:keyLabel="฿"/> - <Key android:codes="3669" android:keyLabel="๕"/> - <Key android:codes="3670" android:keyLabel="๖"/> - <Key android:codes="3671" android:keyLabel="๗"/> - <Key android:codes="3672" android:keyLabel="๘"/> - <Key android:codes="3673" android:keyLabel="๙"/> - </Row> - - <Row android:keyWidth="8%p"> - <Key android:codes="3664" android:keyLabel="๐" android:horizontalGap="2%p"/> - <Key android:codes="34" android:keyLabel='"'/> - <Key android:codes="3598" android:keyLabel="ฎ"/> - <Key android:codes="3601" android:keyLabel="ฑ"/> - <Key android:codes="3608" android:keyLabel="ธ"/> - <Key android:codes="3661" android:keyLabel="ํ"/> - <Key android:codes="3658" android:keyLabel="๊"/> - <Key android:codes="3603" android:keyLabel="ณ"/> - <Key android:codes="3631" android:keyLabel="ฯ"/> - <Key android:codes="3597" android:keyLabel="ญ"/> - <Key android:codes="3600" android:keyLabel="ฐ"/> - <Key android:codes="3587" android:keyLabel="ฃ"/> - </Row> - - <Row> - <Key android:codes="3620" android:keyLabel="ฤ" android:horizontalGap="1%p"/> - <Key android:codes="3590" android:keyLabel="ฆ"/> - <Key android:codes="3599" android:keyLabel="ฏ"/> - <Key android:codes="3650" android:keyLabel="โ"/> - <Key android:codes="3596" android:keyLabel="ฌ"/> - <Key android:codes="3655" android:keyLabel="็"/> - <Key android:codes="3659" android:keyLabel="๋"/> - <Key android:codes="3625" android:keyLabel="ษ"/> - <Key android:codes="3624" android:keyLabel="ศ"/> - <Key android:codes="3595" android:keyLabel="ซ"/> - <Key android:codes="3589" android:keyLabel="ฅ"/> - </Row> - - <Row> - <Key android:codes="-10" android:keyLabel="2/2" android:horizontalGap="8%p" android:keyEdgeFlags="left"/> - <Key android:codes="3593" android:keyLabel="ฉ"/> - <Key android:codes="3630" android:keyLabel="ฮ"/> - <Key android:codes="3642" android:keyLabel="ฺ"/> - <Key android:codes="3660" android:keyLabel="์"/> - <Key android:codes="3602" android:keyLabel="ฒ"/> - <Key android:codes="3628" android:keyLabel="ฬ"/> - <Key android:codes="-5" android:keyIcon="@drawable/sym_keyboard_delete" - android:keyWidth="15%p" android:keyEdgeFlags="right" - android:isRepeatable="true"/> - </Row> - - <Row android:rowEdgeFlags="bottom" android:keyboardMode="@string/normalKeyboardMode"> - <Key android:codes="-100" android:keyLabel="Sr" android:keyWidth="13%p" android:horizontalGap="6%p" android:keyEdgeFlags="left"/> - <Key android:codes="-200" android:keyLabel="Tr" android:keyWidth="13%p"/> - <Key android:codes="-2" android:keyLabel="123" android:keyWidth="13%p"/> - <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space" - android:keyWidth="29%p" android:isRepeatable="true"/> - <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_return" - android:keyWidth="19%p" android:keyEdgeFlags="right"/> - </Row> - - <Row android:rowEdgeFlags="bottom" android:keyboardMode="@string/internalKeyboardMode"> - <Key android:codes="-2" android:keyLabel="123" android:keyWidth="18%p" android:horizontalGap="15%p" android:keyEdgeFlags="left"/> - <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space" - android:keyWidth="30%p" android:isRepeatable="true"/> - <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_return" - android:keyWidth="20%p" android:keyEdgeFlags="right"/> - </Row> -</Keyboard> diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/ASR.java b/src/ui/android/src/org/grammaticalframework/ui/android/ASR.java deleted file mode 100644 index 8d683e1f5..000000000 --- a/src/ui/android/src/org/grammaticalframework/ui/android/ASR.java +++ /dev/null @@ -1,240 +0,0 @@ - -package org.grammaticalframework.ui.android; - -import android.content.Context; -import android.content.Intent; -import android.os.Bundle; -import android.speech.RecognitionListener; -import android.speech.RecognizerIntent; -import android.speech.SpeechRecognizer; -import android.text.TextUtils; -import android.util.Log; - -import java.util.ArrayList; - -/** - * Convenience wrapper around the {@link SpeechRecognizer} API. - */ -public class ASR { - - private static final boolean DBG = false; - private static final String TAG = "ASR"; - - private final Context mContext; - - private SpeechRecognizer mSpeechRecognizer; - - private String mLanguage = null; - - private State mState = State.IDLE; - - private Listener mListener; - - public static enum State { - IDLE, INITIALIZING, WAITING_FOR_SPEECH, RECORDING, WAITING_FOR_RESULTS; - } - - public ASR(Context context) { - mContext = context; - if (SpeechRecognizer.isRecognitionAvailable(context)) { - mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(context); - mSpeechRecognizer.setRecognitionListener(new MyRecognitionListener()); - } - } - - public void setListener(Listener listener) { - mListener = listener; - } - - public void setLanguage(String language) { - mLanguage = language; - } - - public void startRecognition() { - Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); - if (!TextUtils.isEmpty(mLanguage)) { - intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, mLanguage); - } - intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, - RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); - intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 2); - intent.putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, true); - // Weird, this shouldn't be required, but on ICS it seems to be - intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, - mContext.getPackageName()); - - mSpeechRecognizer.startListening(intent); - setState(State.INITIALIZING); - } - - public void stopRecognition() { - mSpeechRecognizer.stopListening(); - setState(State.IDLE); - } - - public boolean isRunning() { - return mState != State.IDLE; - } - - private void setState(State newState) { - if (DBG) Log.d(TAG, "Entering state: " + newState); - mState = newState; - if (mListener != null) { - mListener.onStateChanged(mState); - } - } - - public State getState() { - return mState; - } - - public void destroy() { - if (mSpeechRecognizer != null) { - mSpeechRecognizer.destroy(); - mSpeechRecognizer = null; - } - } - - private void handlePartialInput(String text) { - if (mListener != null) { - mListener.onPartialInput(text); - } - } - - private void handleSpeechInput(String text) { - if (mListener != null) { - mListener.onSpeechInput(text); - } - } - - private class MyRecognitionListener implements RecognitionListener { - @Override - public void onReadyForSpeech(Bundle params) { - if (DBG) Log.d(TAG, "onReadyForSpeech"); - setState(State.WAITING_FOR_SPEECH); - } - - @Override - public void onBeginningOfSpeech() { - if (DBG) Log.d(TAG, "onBeginningOfSpeech"); - setState(State.RECORDING); - } - - @Override - public void onBufferReceived(byte[] buffer) { - // Ignore - } - - @Override - public void onRmsChanged(float rmsdB) { - if (DBG) Log.d(TAG, "onRmsChanged(" + rmsdB + ")"); - } - - @Override - public void onEndOfSpeech() { - if (DBG) Log.d(TAG, "onEndOfSpeech"); - setState(State.WAITING_FOR_RESULTS); - } - - @Override - public void onError(int error) { - if (DBG) Log.d(TAG, "Error: " + errorMessage(error) + " (" + error + ")"); - setState(State.IDLE); - } - - private String errorMessage(int speechRecognizerError) { - switch(speechRecognizerError) { - case SpeechRecognizer.ERROR_NETWORK_TIMEOUT: - return "network timeout"; - case SpeechRecognizer.ERROR_NETWORK: - return "network"; - case SpeechRecognizer.ERROR_AUDIO: - return "audio"; - case SpeechRecognizer.ERROR_SERVER: - return "server"; - case SpeechRecognizer.ERROR_CLIENT: - return "client"; - case SpeechRecognizer.ERROR_SPEECH_TIMEOUT: - return "timeout waiting for speech"; - case SpeechRecognizer.ERROR_NO_MATCH: - return "no match found"; - case SpeechRecognizer.ERROR_RECOGNIZER_BUSY: - return "recognizer busy"; - case SpeechRecognizer.ERROR_INSUFFICIENT_PERMISSIONS: - return "insufficient permissions (missing RECORD_AUDIO?)"; - default: - return "unknown"; - } - } - - @Override - public void onEvent(int eventType, Bundle params) { - if (DBG) Log.d(TAG, "onEvent(" + eventType + ")"); - } - - @Override - public void onPartialResults(Bundle bundle) { - if (DBG) { - StringBuilder sb = new StringBuilder(); - sb.append("onPartialResults:"); - appendResults(sb, bundle); - Log.d(TAG, sb.toString()); - } - - String result = getResult(bundle); - if (!TextUtils.isEmpty(result)) { - handlePartialInput(result); - } - } - - @Override - public void onResults(Bundle bundle) { - if (DBG) { - StringBuilder sb = new StringBuilder(); - sb.append("onResults:"); - appendResults(sb, bundle); - Log.d(TAG, sb.toString()); - } - - setState(State.IDLE); - - String result = getResult(bundle); - if (!TextUtils.isEmpty(result)) { - handleSpeechInput(result); - } - } - - private String getResult(Bundle bundle) { - ArrayList<String> results = - bundle.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); - if (results != null && !results.isEmpty()) { - return results.get(0); - } else { - return null; - } - } - - private void appendResults(StringBuilder sb, Bundle bundle) { - ArrayList<String> results = - bundle.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); - float[] scores = bundle.getFloatArray(SpeechRecognizer.CONFIDENCE_SCORES); - - if (results != null) { - int size = results.size(); - for (int i = 0; i < size; i++) { - sb.append("\n> ").append(results.get(i)); - if (scores != null && i < scores.length) { - sb.append(" [").append(scores[i]).append("]"); - } - } - } - } - } - - public interface Listener { - void onPartialInput(String input); - void onSpeechInput(String input); - void onStateChanged(State newState); - } - -} diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/AlternativesActivity.java b/src/ui/android/src/org/grammaticalframework/ui/android/AlternativesActivity.java deleted file mode 100644 index 4f39a04e1..000000000 --- a/src/ui/android/src/org/grammaticalframework/ui/android/AlternativesActivity.java +++ /dev/null @@ -1,674 +0,0 @@ -package org.grammaticalframework.ui.android; - -import java.util.*; - -import android.app.Activity; -import android.app.ListActivity; -import android.content.Context; -import android.content.res.Configuration; -import android.os.AsyncTask; -import android.os.Bundle; -import android.view.*; -import android.view.View; -import android.view.View.OnClickListener; -import android.view.ViewGroup; -import android.view.ViewGroup.LayoutParams; -import android.view.MenuItem; -import android.view.LayoutInflater; -import android.webkit.WebView; -import android.widget.BaseAdapter; -import android.widget.ListAdapter; -import android.widget.ArrayAdapter; -import android.widget.ImageView; -import android.widget.RelativeLayout; -import android.widget.TextView; -import android.widget.CheckBox; -import android.widget.CompoundButton; -import android.widget.ListView; -import android.widget.AdapterView; -import android.util.Log; -import android.support.v4.widget.DrawerLayout; -import android.support.v4.app.ActionBarDrawerToggle; - -import org.grammaticalframework.pgf.*; -import org.grammaticalframework.ui.android.LanguageSelector.OnLanguageSelectedListener; - -public class AlternativesActivity extends ListActivity { - - private Translator mTranslator; - private LanguageSelector mShowLanguageView; - private View mProgressBarView = null; - private AlternativesAdapter mAdapter = null; - private DrawerLayout mDrawerLayout; - private ListView mDrawerList; - private ActionBarDrawerToggle mDrawerToggle; - - /** Called when the activity is first created. */ - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_lexical_entry); - - mTranslator = ((GFTranslator) getApplicationContext()).getTranslator(); - - mShowLanguageView = (LanguageSelector) findViewById(R.id.show_language); - mShowLanguageView.setLanguages(mTranslator.getAvailableLanguages()); - mShowLanguageView.setOnLanguageSelectedListener(new OnLanguageSelectedListener() { - @Override - public void onLanguageSelected(final Language language) { - new AsyncTask<Void,Void,Void>() { - @Override - protected void onPreExecute() { - showProgressBar(); - } - - @Override - protected Void doInBackground(Void... params) { - mTranslator.setTargetLanguage(language); - mTranslator.isTargetLanguageLoaded(); - return null; - } - - @Override - protected void onPostExecute(Void result) { - mAdapter.notifyDataSetChanged(); - collapse(); - hideProgressBar(); - } - }.execute(); - } - }); - - mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); - mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, - R.drawable.ic_drawer, - R.string.topics_open, - R.string.topics_close); - mDrawerLayout.setDrawerListener(mDrawerToggle); - - getActionBar().setDisplayHomeAsUpEnabled(true); - getActionBar().setHomeButtonEnabled(true); - - TextView descrView = (TextView) findViewById(R.id.lexical_desc); - - if (getIntent().getData() != null) { - String authority = getIntent().getData().getAuthority(); - String source = getIntent().getData().getQueryParameter("source"); - - List analyses = new ArrayList(); - for (String an : getIntent().getData().getQueryParameters("alternative")) { - analyses.add(Expr.readExpr(an)); - } - descrView.setText(source); - - mAdapter = new AlternativesAdapter(this, authority, analyses); - } else { - mDrawerLayout.openDrawer(Gravity.LEFT); - - mAdapter = new AlternativesAdapter(this, Translator.WORDS); - } - - expandedView = null; - setListAdapter(mAdapter); - - mDrawerList = (ListView) findViewById(R.id.topics_list); - mDrawerList.setAdapter(mAdapter.getTopicsAdapter()); - - mProgressBarView = findViewById(R.id.progressBarView); - } - - @Override - protected void onResume() { - super.onResume(); - - mShowLanguageView.setSelectedLanguage(mTranslator.getTargetLanguage()); - } - - private void showProgressBar() { - mProgressBarView.setVisibility(View.VISIBLE); - } - - private void hideProgressBar() { - mProgressBarView.setVisibility(View.GONE); - } - - private View expandedView; - - private void collapse() { - if (expandedView == null) - return; - - ImageView arrow = (ImageView) expandedView.findViewById(R.id.arrow); - arrow.setImageResource(R.drawable.open_arrow); - - View view = (View) expandedView.findViewById(R.id.desc_details); - ((RelativeLayout) expandedView).removeView(view); - - TextView textView = (TextView) expandedView.findViewById(R.id.abstract_tree); - if (textView != null) - ((RelativeLayout) expandedView).removeView(textView); - - expandedView = null; - } - - private void expandWord(View view, Expr lemma) { - String html = mTranslator.getInflectionTable(lemma); - if (html == null) - return; - - ImageView arrow = (ImageView) view.findViewById(R.id.arrow); - arrow.setImageResource(R.drawable.close_arrow); - - WebView inflectionView = (WebView) view.findViewById(R.id.desc_details); - if (inflectionView == null) { - inflectionView = new WebView(this); - inflectionView.setId(R.id.desc_details); - RelativeLayout.LayoutParams params = - new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); - params.addRule(RelativeLayout.BELOW, R.id.lexical_desc); - ((RelativeLayout) view).addView(inflectionView, params); - } - - inflectionView.loadData(html, "text/html; charset=UTF-8", null); - - expandedView = view; - } - - private void expandSentence(View view, Expr expr) { - ImageView arrow = (ImageView) view.findViewById(R.id.arrow); - arrow.setImageResource(R.drawable.close_arrow); - - ParseTreeView parseView = (ParseTreeView) view.findViewById(R.id.desc_details); - if (parseView == null) { - parseView = new ParseTreeView(this); - parseView.setId(R.id.desc_details); - RelativeLayout.LayoutParams params = - new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); - params.addRule(RelativeLayout.BELOW, R.id.alternative_desc); - ((RelativeLayout) view).addView(parseView, params); - } - - Object[] brackets = mTranslator.bracketedLinearize(expr); - if (brackets[0] instanceof Bracket) { - Bracket b = (Bracket) brackets[0]; - if (b.children[0].equals("*") || - b.children[0].equals("+")) { - Object[] children = new Object[b.children.length-1]; - for (int i = 1; i < b.children.length; i++) - children[i-1] = b.children[i]; - b = new Bracket(b.cat, b.fun, b.fid, b.lindex, children); - brackets[0] = b; - } - } - parseView.setBrackets(brackets); - - TextView textView = (TextView) view.findViewById(R.id.abstract_tree); - if (textView == null) { - textView = new TextView(this); - textView.setId(R.id.abstract_tree); - textView.setTextSize(15); - RelativeLayout.LayoutParams params = - new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); - params.addRule(RelativeLayout.BELOW, R.id.desc_details); - ((RelativeLayout) view).addView(textView, params); - } - textView.setText(expr.toString()); - - expandedView = view; - } - - private class Topic { - public String name; - public Expr expr; - public boolean isChecked; - public boolean isAvailable; - - public Topic(String name, Expr expr) { - this.name = name; - this.expr = expr; - this.isChecked = false; - this.isAvailable = true; - } - } - - private class AlternativesAdapter extends BaseAdapter implements ListAdapter { - /** - * Contains the list of objects that represent the alternatives - */ - private List<Expr> mAlternatives; - - private Context mContext; - - // A copy of the original mAlternatives array, initialized from and then used instead as soon as - // a topic filtering is applied. mAlternatives will then only contain the filtered values. - private ArrayList<Expr> mOriginalAlternatives; - - private LayoutInflater mInflater; - - private String mAuthority; - - /** - * A list of lists of topics. Each element in this list contains - * the list of topics for the correponding item in - * mAlternatives/mOriginalAlternatives - */ - private List<List<Topic>> mTopics; - - private Map<String,Topic> mTopicMap; - private Topic[] mAllTopics; - private Topic[] mOriginalAllTopics; - - private Topic mOtherTopic; - private Topic mSourceTopic; - - private TopicsAdapter mTopicsAdapter; - - public AlternativesAdapter(Context context, String authority, List<Expr> alternatives) { - mContext = context; - mAuthority = authority; - mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - mAlternatives = alternatives; - - boolean addOther = false; - mTopics = new ArrayList<List<Topic>>(); - mTopicMap = new TreeMap<String,Topic>(); - for (Expr e : mAlternatives) { - List<Topic> topics = new ArrayList<Topic>(); - for (Expr topicExpr : mTranslator.getTopicsOf(e)) { - String name = mTranslator.linearizeSource(topicExpr); - String key = name.toLowerCase(); - Topic topic = mTopicMap.get(key); - if (topic == null) { - topic = new Topic(name, topicExpr); - mTopicMap.put(key,topic); - } - topics.add(topic); - } - mTopics.add(topics); - - if (topics.size() == 0) - addOther = true; - } - - int i = 0; - mAllTopics = new Topic[mTopicMap.size() + (addOther ? 1 : 0)]; - for (Map.Entry<String,Topic> entry : mTopicMap.entrySet()) { - mAllTopics[i++] = entry.getValue(); - } - if (addOther) { - Expr topicExpr = Expr.readExpr("other_A"); - String name = mTranslator.linearizeSource(topicExpr); - mOtherTopic = new Topic(name, topicExpr); - mAllTopics[i++] = mOtherTopic; - } - - mOriginalAllTopics = mAllTopics; - - mTopicsAdapter = new TopicsAdapter(); - } - - public AlternativesAdapter(Context context, String authority) { - mContext = context; - mAuthority = authority; - mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - mAlternatives = null; - - mTopics = null; - - int i = 0; - mTopicMap = new TreeMap<String,Topic>(); - for (Expr topicExpr : mTranslator.getTopicsOf(null)) { - String name = mTranslator.linearizeSource(topicExpr); - String key = name.toLowerCase(); - Topic topic = mTopicMap.get(key); - if (topic == null) { - topic = new Topic(name, topicExpr); - mTopicMap.put(key,topic); - } - } - mAllTopics = new Topic[mTopicMap.size()]; - for (Map.Entry<String,Topic> entry : mTopicMap.entrySet()) { - mAllTopics[i++] = entry.getValue(); - } - - mOriginalAllTopics = mAllTopics; - - mTopicsAdapter = new TopicsAdapter(); - } - - /** - * Returns the context associated with this array adapter. The context is used - * to create views from the resource passed to the constructor. - * - * @return The Context associated with this adapter. - */ - public Context getContext() { - return mContext; - } - - public String getAuthority() { - return mAuthority; - } - - /** - * {@inheritDoc} - */ - public int getCount() { - if (mAlternatives == null) - return 0; - else - return mAlternatives.size(); - } - - /** - * {@inheritDoc} - */ - public Expr getItem(int position) { - return mAlternatives.get(position); - } - - /** - * Returns the position of the specified item in the array. - * - * @param item The item to retrieve the position of. - * - * @return The position of the specified item. - */ - public int getPosition(Expr item) { - if (mAlternatives == null) - return -1; - else - return mAlternatives.indexOf(item); - } - - /** - * {@inheritDoc} - */ - public long getItemId(int position) { - return position; - } - - public View getView(int position, View convertView, ViewGroup parent) { - final Expr expr = getItem(position); - - if (mAuthority.equals(Translator.WORDS)) { - if (convertView == null) { - convertView = mInflater.inflate(R.layout.lexical_item, null); - } - - TextView descView = (TextView) - convertView.findViewById(R.id.lexical_desc); - - String phrase = mTranslator.generateLexiconEntry(expr); - descView.setText(phrase); - - convertView.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View view) { - if (expandedView == view) - collapse(); - else if (expandedView == null) - expandWord(view, expr); - else { - collapse(); - expandWord(view, expr); - } - } - }); - } else if (mAuthority.equals(Translator.SENTENCES)) { - if (convertView == null) { - convertView = mInflater.inflate(R.layout.alternative_item, null); - - View treeView = (View) convertView.findViewById(R.id.desc_details); - ((RelativeLayout) convertView).removeView(treeView); - - TextView textView = (TextView) convertView.findViewById(R.id.abstract_tree); - ((RelativeLayout) convertView).removeView(textView); - } - - TextView descView = (TextView) - convertView.findViewById(R.id.alternative_desc); - - String phrase = mTranslator.linearize(expr); - - // parse by words, marked by %, darkest red color - if (phrase.charAt(0) == '%') { - descView.setBackgroundDrawable(getResources().getDrawable(R.drawable.second_person_worst_utterance_bg)); - phrase = phrase.substring(2); - } - - // parse by chunks, marked by *, red color - else if (phrase.charAt(0) == '*') { - descView.setBackgroundDrawable(getResources().getDrawable(R.drawable.second_person_chunk_utterance_bg)); - phrase = phrase.substring(2); - } - - // parse error or unknown translations (in []) present, darkest red color - else if (phrase.contains("parse error:") || phrase.contains("[")) { - descView.setBackgroundDrawable(getResources().getDrawable(R.drawable.second_person_worst_utterance_bg)); - } - - // parse by domain grammar, marked by +, green color - else if (phrase.charAt(0) == '+') { - descView.setBackgroundDrawable(getResources().getDrawable(R.drawable.second_person_best_utterance_bg)); - phrase = phrase.substring(2); - } - - else { - descView.setBackgroundDrawable(getResources().getDrawable(R.drawable.second_person_utterance_bg)); - } - - descView.setText(phrase); - - convertView.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View view) { - if (expandedView == view) - collapse(); - else if (expandedView == null) - expandSentence(view, expr); - else { - collapse(); - expandSentence(view, expr); - } - } - }); - } - - return convertView; - } - - public boolean areAllItemsEnabled() { - return true; - } - - public boolean isEnabled(int position) { - return true; - } - - public TopicsAdapter getTopicsAdapter() { - return mTopicsAdapter; - } - - void filterOnTopics(List<Topic> selected_topics) { - if (mSourceTopic != null && !selected_topics.contains(mSourceTopic)) { - mAlternatives = null; - mOriginalAlternatives = null; - mTopics = null; - mAllTopics = mOriginalAllTopics; - } - - if (mAlternatives == null) { - if (selected_topics.size() == 0) { - notifyDataSetChanged(); - return; - } - - mSourceTopic = selected_topics.get(0); - mAlternatives = mTranslator.getTopicWords(mSourceTopic.expr); - - mTopics = new ArrayList<List<Topic>>(); - for (Expr e : mAlternatives) { - List<Topic> topics = new ArrayList<Topic>(); - for (Expr topicExpr : mTranslator.getTopicsOf(e)) { - String name = mTranslator.linearizeSource(topicExpr); - String key = name.toLowerCase(); - topics.add(mTopicMap.get(key)); - } - mTopics.add(topics); - } - } - - if (mOriginalAlternatives == null) { - mOriginalAlternatives = new ArrayList<Expr>(mAlternatives); - } - - mAlternatives = new ArrayList<Expr>(); - List<List<Expr>> topics = new ArrayList<List<Expr>>(); - - for (Topic topic : mOriginalAllTopics) { - topic.isAvailable = false; - } - - int count = 0; - for (int i = 0; i < mOriginalAlternatives.size(); i++) { - boolean match = true; - for (Topic topic : selected_topics) { - if (topic == mOtherTopic) { - if (mTopics.get(i).size() > 0) { - match = false; - break; - } - } else if (!mTopics.get(i).contains(topic)) { - match = false; - break; - } - } - if (match) { - mAlternatives.add(mOriginalAlternatives.get(i)); - if (mTopics.get(i).size() == 0) { - if (!mOtherTopic.isAvailable) - count++; - mOtherTopic.isAvailable = true; - } else { - for (Topic topic : mTopics.get(i)) { - if (!topic.isAvailable) - count++; - topic.isAvailable = true; - } - } - } - } - - int i = 0; - mAllTopics = new Topic[count]; - for (Topic topic : mOriginalAllTopics) { - if (topic.isAvailable) - mAllTopics[i++] = topic; - } - - notifyDataSetChanged(); - } - } - - private class TopicsAdapter extends BaseAdapter implements ListAdapter { - public TopicsAdapter() { - } - - public Context getContext() { - return mAdapter.getContext(); - } - - public int getCount() { - return mAdapter.mAllTopics.length; - } - - public Topic getItem(int position) { - return mAdapter.mAllTopics[position]; - } - - public int getPosition(Topic topic) { - for (int i = 0; i < mAdapter.mAllTopics.length; i++) { - if (mAdapter.mAllTopics[i] == topic) - return i; - } - return -1; - } - - public long getItemId(int position) { - return position; - } - - // Shame on you Google this class should not have been here - // but unfortuantely CheckBox.setChecked doesn't work and here - // we need a workarround. Since the class is there now it is also - // used to implement OnClickListener. - private class TopicCheckBox extends CheckBox implements OnClickListener { - private Topic mTopic; - - public TopicCheckBox(Context context, Topic topic) { - super(context); - mTopic = topic; - setOnClickListener(this); - } - - @Override - public boolean isChecked() { - if (mTopic == null) - return false; - else - return mTopic.isChecked; - } - - @Override - public void onClick(View view) { - mTopic.isChecked = !mTopic.isChecked; - filterOnTopics(); - notifyDataSetChanged(); - } - } - - private void filterOnTopics() { - List<Topic> selected_topics = new ArrayList<Topic>(); - for (int i = 0; i < getCount(); i++) { - Topic topic = getItem(i); - if (topic.isChecked) - selected_topics.add(topic); - } - mAdapter.filterOnTopics(selected_topics); - } - - public View getView(int position, View convertView, ViewGroup parent) { - Topic entry = getItem(position); - - CheckBox checkBox = new TopicCheckBox(getContext(), entry); - checkBox.setText(entry.name); - checkBox.setTextSize(25); - checkBox.setTextColor(android.graphics.Color.parseColor("#808080")); - return checkBox; - } - } - - @Override - protected void onPostCreate(Bundle savedInstanceState) { - super.onPostCreate(savedInstanceState); - // Sync the toggle state after onRestoreInstanceState has occurred. - mDrawerToggle.syncState(); - } - - @Override - public void onConfigurationChanged(Configuration newConfig) { - super.onConfigurationChanged(newConfig); - mDrawerToggle.onConfigurationChanged(newConfig); - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - // Pass the event to ActionBarDrawerToggle, if it returns - // true, then it has handled the app icon touch event - if (mDrawerToggle.onOptionsItemSelected(item)) { - return true; - } - return super.onOptionsItemSelected(item); - } -} diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/CompletionsView.java b/src/ui/android/src/org/grammaticalframework/ui/android/CompletionsView.java deleted file mode 100644 index c59dbfe86..000000000 --- a/src/ui/android/src/org/grammaticalframework/ui/android/CompletionsView.java +++ /dev/null @@ -1,291 +0,0 @@ -package org.grammaticalframework.ui.android; - -import android.annotation.SuppressLint; -import android.content.Context; -import android.content.res.Resources; -import android.graphics.Canvas; -import android.graphics.Paint; -import android.graphics.Rect; -import android.graphics.drawable.Drawable; -import android.view.GestureDetector; -import android.view.MotionEvent; -import android.view.View; -import android.view.inputmethod.CompletionInfo; - -import java.util.ArrayList; -import java.util.List; - -public class CompletionsView extends View { - - private static final int OUT_OF_BOUNDS = -1; - - private TranslatorInputMethodService mService; - private CompletionInfo[] mSuggestions; - private int mSelectedIndex; - private int mTouchX = OUT_OF_BOUNDS; - private Drawable mSelectionHighlight; - private boolean mTypedWordValid; - - private Rect mBgPadding; - - private static final int MAX_SUGGESTIONS = 32; - private static final int SCROLL_PIXELS = 20; - - private int[] mWordWidth = new int[MAX_SUGGESTIONS]; - private int[] mWordX = new int[MAX_SUGGESTIONS]; - - private static final int X_GAP = 10; - - private int mColorNormal; - private int mColorRecommended; - private int mColorOther; - private int mVerticalPadding; - private Paint mPaint; - private boolean mScrolled; - private int mTargetScrollX; - - private int mTotalWidth; - - private GestureDetector mGestureDetector; - - /** - * Construct a CandidateView for showing suggested words for completion. - * @param context - * @param attrs - */ - public CompletionsView(Context context) { - super(context); - mSelectionHighlight = context.getResources().getDrawable( - android.R.drawable.list_selector_background); - mSelectionHighlight.setState(new int[] { - android.R.attr.state_enabled, - android.R.attr.state_focused, - android.R.attr.state_window_focused, - android.R.attr.state_pressed - }); - - Resources r = context.getResources(); - - setBackgroundColor(r.getColor(R.color.candidate_background)); - - mColorNormal = r.getColor(R.color.candidate_normal); - mColorRecommended = r.getColor(R.color.candidate_recommended); - mColorOther = r.getColor(R.color.candidate_other); - mVerticalPadding = r.getDimensionPixelSize(R.dimen.candidate_vertical_padding); - - mPaint = new Paint(); - mPaint.setColor(mColorNormal); - mPaint.setAntiAlias(true); - mPaint.setTextSize(r.getDimensionPixelSize(R.dimen.candidate_font_height)); - mPaint.setStrokeWidth(0); - - mGestureDetector = new GestureDetector(new GestureDetector.SimpleOnGestureListener() { - @Override - public boolean onScroll(MotionEvent e1, MotionEvent e2, - float distanceX, float distanceY) { - mScrolled = true; - int sx = getScrollX(); - sx += distanceX; - if (sx < 0) { - sx = 0; - } - if (sx + getWidth() > mTotalWidth) { - sx -= distanceX; - } - mTargetScrollX = sx; - scrollTo(sx, getScrollY()); - invalidate(); - return true; - } - }); - setHorizontalFadingEdgeEnabled(true); - setWillNotDraw(false); - setHorizontalScrollBarEnabled(false); - setVerticalScrollBarEnabled(false); - } - - /** - * A connection back to the service to communicate with the text field - * @param listener - */ - public void setService(TranslatorInputMethodService listener) { - mService = listener; - } - - @Override - public int computeHorizontalScrollRange() { - return mTotalWidth; - } - - @Override - protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - int measuredWidth = resolveSize(50, widthMeasureSpec); - - // Get the desired height of the icon menu view (last row of items does - // not have a divider below) - Rect padding = new Rect(); - mSelectionHighlight.getPadding(padding); - final int desiredHeight = ((int)mPaint.getTextSize()) + mVerticalPadding - + padding.top + padding.bottom; - - // Maximum possible width and desired height - setMeasuredDimension(measuredWidth, - resolveSize(desiredHeight, heightMeasureSpec)); - } - - /** - * If the canvas is null, then only touch calculations are performed to pick the target - * candidate. - */ - @Override - protected void onDraw(Canvas canvas) { - if (canvas != null) { - super.onDraw(canvas); - } - mTotalWidth = 0; - if (mSuggestions == null) return; - - if (mBgPadding == null) { - mBgPadding = new Rect(0, 0, 0, 0); - if (getBackground() != null) { - getBackground().getPadding(mBgPadding); - } - } - int x = 0; - final int count = mSuggestions.length; - final int height = getHeight(); - final Rect bgPadding = mBgPadding; - final Paint paint = mPaint; - final int touchX = mTouchX; - final int scrollX = getScrollX(); - final boolean scrolled = mScrolled; - final boolean typedWordValid = mTypedWordValid; - final int y = (int) (((height - mPaint.getTextSize()) / 2) - mPaint.ascent()); - - for (int i = 0; i < count; i++) { - String suggestion = mSuggestions[i].getText().toString(); - float textWidth = paint.measureText(suggestion); - final int wordWidth = (int) textWidth + X_GAP * 2; - - mWordX[i] = x; - mWordWidth[i] = wordWidth; - paint.setColor(mColorNormal); - if (touchX + scrollX >= x && touchX + scrollX < x + wordWidth && !scrolled) { - if (canvas != null) { - canvas.translate(x, 0); - mSelectionHighlight.setBounds(0, bgPadding.top, wordWidth, height); - mSelectionHighlight.draw(canvas); - canvas.translate(-x, 0); - } - mSelectedIndex = i; - } - - if (canvas != null) { - if ((i == 1 && !typedWordValid) || (i == 0 && typedWordValid)) { - paint.setFakeBoldText(true); - paint.setColor(mColorRecommended); - } else if (i != 0) { - paint.setColor(mColorOther); - } - canvas.drawText(suggestion, x + X_GAP, y, paint); - paint.setColor(mColorOther); - canvas.drawLine(x + wordWidth + 0.5f, bgPadding.top, - x + wordWidth + 0.5f, height + 1, paint); - paint.setFakeBoldText(false); - } - x += wordWidth; - } - mTotalWidth = x; - if (mTargetScrollX != getScrollX()) { - scrollToTarget(); - } - } - - private void scrollToTarget() { - int sx = getScrollX(); - if (mTargetScrollX > sx) { - sx += SCROLL_PIXELS; - if (sx >= mTargetScrollX) { - sx = mTargetScrollX; - requestLayout(); - } - } else { - sx -= SCROLL_PIXELS; - if (sx <= mTargetScrollX) { - sx = mTargetScrollX; - requestLayout(); - } - } - scrollTo(sx, getScrollY()); - invalidate(); - } - - @SuppressLint("WrongCall") - public void setSuggestions(CompletionInfo[] suggestions, boolean completions, - boolean typedWordValid) { - clear(); - if (suggestions != null) { - mSuggestions = suggestions; - } - mTypedWordValid = typedWordValid; - scrollTo(0, 0); - mTargetScrollX = 0; - // Compute the total width - onDraw(null); - invalidate(); - requestLayout(); - } - - public void clear() { - mSuggestions = new CompletionInfo[0]; - mTouchX = OUT_OF_BOUNDS; - mSelectedIndex = -1; - invalidate(); - } - - @Override - public boolean onTouchEvent(MotionEvent me) { - - if (mGestureDetector.onTouchEvent(me)) { - return true; - } - - int action = me.getAction(); - int x = (int) me.getX(); - int y = (int) me.getY(); - mTouchX = x; - - switch (action) { - case MotionEvent.ACTION_DOWN: - mScrolled = false; - invalidate(); - break; - case MotionEvent.ACTION_MOVE: - if (y <= 0) { - // Fling up!? - if (mSelectedIndex >= 0) { - mService.pickSuggestionManually(mSelectedIndex); - mSelectedIndex = -1; - } - } - invalidate(); - break; - case MotionEvent.ACTION_UP: - if (!mScrolled) { - if (mSelectedIndex >= 0) { - mService.pickSuggestionManually(mSelectedIndex); - } - } - mSelectedIndex = -1; - removeHighlight(); - requestLayout(); - break; - } - return true; - } - - private void removeHighlight() { - mTouchX = OUT_OF_BOUNDS; - invalidate(); - } -} diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/ConversationView.java b/src/ui/android/src/org/grammaticalframework/ui/android/ConversationView.java deleted file mode 100644 index b7d118e7c..000000000 --- a/src/ui/android/src/org/grammaticalframework/ui/android/ConversationView.java +++ /dev/null @@ -1,242 +0,0 @@ -package org.grammaticalframework.ui.android; - -import java.io.Serializable; -import java.util.*; - -import android.content.Context; -import android.os.Bundle; -import android.util.AttributeSet; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.view.inputmethod.EditorInfo; -import android.view.inputmethod.InputMethodManager; -import android.view.KeyEvent; -import android.widget.EditText; -import android.widget.ScrollView; -import android.widget.TextView; -import android.widget.TextView.OnEditorActionListener; - -import org.grammaticalframework.pgf.Expr; - -public class ConversationView extends ScrollView { - - private LayoutInflater mInflater; - - private ViewGroup mContent; - - private OnClickListener mAlternativesListener; - private ASR.Listener mSpeechListener; - - public ConversationView(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - } - - public ConversationView(Context context, AttributeSet attrs) { - super(context, attrs); - } - - public ConversationView(Context context) { - super(context); - } - - @Override - protected void onFinishInflate() { - super.onFinishInflate(); - mContent = (ViewGroup) findViewById(R.id.conversation_content); - mInflater = LayoutInflater.from(getContext()); - } - - private class EditorListener implements OnEditorActionListener, OnClickListener { - @Override - public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { - if ((actionId & EditorInfo.IME_MASK_ACTION) != 0) { - CharSequence text = v.getText(); - InputMethodManager inputMethodManager = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); - if (inputMethodManager != null) { - inputMethodManager.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, 0); - } - v.setFocusable(false); - mLastUtterance = v; - if (mSpeechListener != null) - mSpeechListener.onSpeechInput(text.toString().trim()); - return true; - } - return false; - } - - @Override - public void onClick(View v) { - v.setFocusableInTouchMode(true); - v.requestFocus(); - InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); - imm.showSoftInput(v, InputMethodManager.SHOW_IMPLICIT); - } - }; - - private EditorListener mEditorListener = new EditorListener(); - private TextView mLastUtterance = null; - - public void addFirstPersonUtterance(CharSequence text, boolean focused) { - EditText edittext = (EditText) - mInflater.inflate(R.layout.first_person_utterance, mContent, false); - edittext.setText(text); - edittext.setOnEditorActionListener(mEditorListener); - edittext.setOnClickListener(mEditorListener); - edittext.setHorizontallyScrolling(false); - edittext.setMaxLines(Integer.MAX_VALUE); - Bundle extras = edittext.getInputExtras(true); - extras.putBoolean("show_language_toggle", false); - mContent.addView(edittext); - - if (focused) { - edittext.requestFocus(); - InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); - imm.showSoftInput(edittext, InputMethodManager.SHOW_IMPLICIT); - } else { - edittext.setFocusable(false); - } - - post(new Runnable() { - public void run() { - fullScroll(FOCUS_DOWN); - } - }); - - mLastUtterance = edittext; - } - - @SuppressWarnings("deprecation") - public CharSequence addSecondPersonUtterance(String authority, CharSequence source, CharSequence target, List<Expr> alternatives) { - TextView view; - if (mLastUtterance != null && mLastUtterance.getTag() != null) - view = (TextView) mLastUtterance.getTag(); - else { - view = (TextView) - mInflater.inflate(R.layout.second_person_utterance, mContent, false); - if (mAlternativesListener != null) - view.setOnClickListener(mAlternativesListener); - mContent.addView(view); - post(new Runnable() { - public void run() { - fullScroll(FOCUS_DOWN); - } - }); - - mLastUtterance.setTag(view); - } - - view.setTag(R.string.authority_key, authority); - view.setTag(R.string.source_key, source); - view.setTag(R.string.target_key, target); - view.setTag(R.string.alternatives_key, alternatives); - - // parse by words, marked by %, darkest red color - if (target.charAt(0) == '%') { - view.setBackgroundDrawable(getResources().getDrawable(R.drawable.second_person_worst_utterance_bg)); - target = target.subSequence(1, target.length()).toString().trim(); - } - - // parse by chunks, marked by *, red color - else if (target.charAt(0) == '*') { - view.setBackgroundDrawable(getResources().getDrawable(R.drawable.second_person_chunk_utterance_bg)); - target = target.subSequence(1, target.length()).toString().trim(); - } - - // parse error: darkest red color - else if (target.toString().contains("parse error:")) { - view.setBackgroundDrawable(getResources().getDrawable(R.drawable.second_person_worst_utterance_bg)); - } - - // unknown linearizations in output: darkest red color. But replace [ ] by spaces and remove _ for better speech synthesis - else if (target.toString().contains("[")) { - view.setBackgroundDrawable(getResources().getDrawable(R.drawable.second_person_worst_utterance_bg)); - } - - // parse by domain grammar, marked by +, green color - else if (target.charAt(0) == '+') { - view.setBackgroundDrawable(getResources().getDrawable(R.drawable.second_person_best_utterance_bg)); - target = target.subSequence(1, target.length()).toString().trim(); - } - - else { - view.setBackgroundDrawable(getResources().getDrawable(R.drawable.second_person_utterance_bg)); - } - - view.setText(target); - return target; - } - - public void updateLastUtterance(CharSequence text) { - if (mLastUtterance != null) - mLastUtterance.setText(text); - } - - public void setOnAlternativesListener(final OnAlternativesListener listener) { - if (listener == null) - mAlternativesListener = null; - else - mAlternativesListener = new OnClickListener() { - @Override - public void onClick(View v) { - String authority = v.getTag(R.string.authority_key).toString(); - String source = v.getTag(R.string.source_key).toString(); - List<Expr> alternatives = (List<Expr>) v.getTag(R.string.alternatives_key); - listener.onAlternativesSelected(authority, source, alternatives); - } - }; - } - - public void setSpeechInputListener(ASR.Listener listener) { - mSpeechListener = listener; - } - - public interface OnAlternativesListener { - public void onAlternativesSelected(CharSequence authority, CharSequence word, List<Expr> althernatives); - } - - public void saveConversation(Bundle state) { - ArrayList<String> authorities = new ArrayList<String>(); - ArrayList<String> firstPersonUtterances = new ArrayList<String>(); - ArrayList<String> secondPersonUtterances = new ArrayList<String>(); - ArrayList<Object> translationAlternatives = new ArrayList<Object>(); - - int childCount = mContent.getChildCount(); - for (int i = 0; i < childCount; i++) { - View child = mContent.getChildAt(i); - if (child.getClass() == TextView.class) { - authorities.add(child.getTag(R.string.authority_key).toString()); - firstPersonUtterances.add(child.getTag(R.string.source_key).toString()); - secondPersonUtterances.add(child.getTag(R.string.target_key).toString()); - translationAlternatives.add(child.getTag(R.string.alternatives_key)); - } - } - - state.putStringArrayList("authorities", authorities); - state.putStringArrayList("first_person_uterances", firstPersonUtterances); - state.putStringArrayList("second_person_uterances", secondPersonUtterances); - state.putSerializable("translation_alternatives",(Serializable) translationAlternatives); - } - - public void restoreConversation(Bundle state) { - ArrayList<String> authorities = state.getStringArrayList("authorities"); - ArrayList<String> firstPersonUtterances = state.getStringArrayList("first_person_uterances"); - ArrayList<String> secondPersonUtterances = state.getStringArrayList("second_person_uterances"); - ArrayList<List<Expr>> translationAlternatives= (ArrayList<List<Expr>>) state.getSerializable("translation_alternatives"); - - int i = 0; - while (i < authorities.size() && - i < firstPersonUtterances.size() && - i < Math.min(secondPersonUtterances.size(), translationAlternatives.size())) { - String text = firstPersonUtterances.get(i); - addFirstPersonUtterance(text, false); - - String authority = authorities.get(i); - String translation = secondPersonUtterances.get(i); - List<Expr> alternatives = translationAlternatives.get(i); - addSecondPersonUtterance(authority, text, translation, alternatives); - - i++; - } - } -} diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/GFTranslator.java b/src/ui/android/src/org/grammaticalframework/ui/android/GFTranslator.java deleted file mode 100644 index 8900b2415..000000000 --- a/src/ui/android/src/org/grammaticalframework/ui/android/GFTranslator.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.grammaticalframework.ui.android; - -import android.app.Application; - -public class GFTranslator extends Application { - private Translator mTranslator; - private static GFTranslator instance; - - @Override - public void onCreate() { - mTranslator = new Translator(this); - instance = this; - } - - public Translator getTranslator() { - return mTranslator; - } - - public static GFTranslator get() { - return instance; - } -} diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/HelpActivity.java b/src/ui/android/src/org/grammaticalframework/ui/android/HelpActivity.java deleted file mode 100644 index c6a822484..000000000 --- a/src/ui/android/src/org/grammaticalframework/ui/android/HelpActivity.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.grammaticalframework.ui.android; - -import android.app.Activity; -import android.os.Bundle; -import android.webkit.WebView; - -public class HelpActivity extends Activity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_help); - WebView wv = (WebView) findViewById(R.id.help_content); - wv.loadUrl("file:///android_asset/help_content.html"); - } -}
\ No newline at end of file diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/Language.java b/src/ui/android/src/org/grammaticalframework/ui/android/Language.java deleted file mode 100644 index 000206045..000000000 --- a/src/ui/android/src/org/grammaticalframework/ui/android/Language.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.grammaticalframework.ui.android; - -import java.io.Serializable; - -public class Language implements Serializable { - private static final long serialVersionUID = 1L; - - private final String mLangCode; - private final String mLangName; - private final String mConcrete; - private final int mKeyboardPage1Resource; - private final int mKeyboardPage2Resource; - - public Language(String langCode, String langName, String concrete, - int keyboardResource) { - mLangCode = langCode; - mLangName = langName; - mConcrete = concrete; - mKeyboardPage1Resource = keyboardResource; - mKeyboardPage2Resource = keyboardResource; - } - - public Language(String langCode, String langName, String concrete, - int keyboardPage1Resource, int keyboardPage2Resource) { - mLangCode = langCode; - mLangName = langName; - mConcrete = concrete; - mKeyboardPage1Resource = keyboardPage1Resource; - mKeyboardPage2Resource = keyboardPage2Resource; - } - - public String getLangCode() { - return mLangCode; - } - - public String getLangName() { - return mLangName; - } - - public int getKeyboardPage1Resource() { - return mKeyboardPage1Resource; - } - - public int getKeyboardPage2Resource() { - return mKeyboardPage2Resource; - } - - String getConcrete() { - return mConcrete; - } - - @Override - public String toString() { - return getLangName(); - } - - @Override - public boolean equals(Object o) { - Language other = (Language) o; - return mLangCode.equals(other.mLangCode); - } -}
\ No newline at end of file diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/LanguageSelector.java b/src/ui/android/src/org/grammaticalframework/ui/android/LanguageSelector.java deleted file mode 100644 index de628b2b5..000000000 --- a/src/ui/android/src/org/grammaticalframework/ui/android/LanguageSelector.java +++ /dev/null @@ -1,55 +0,0 @@ -package org.grammaticalframework.ui.android; - -import android.content.Context; -import android.util.AttributeSet; -import android.view.View; -import android.widget.AdapterView; -import android.widget.Spinner; - -import java.util.List; - -public class LanguageSelector extends Spinner { - - public LanguageSelector(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - } - - public LanguageSelector(Context context, AttributeSet attrs) { - super(context, attrs); - } - - public LanguageSelector(Context context) { - super(context); - } - - public void setLanguages(List<Language> languages) { - setAdapter(new LanguagesAdapter(getContext(), languages)); - } - - public void setSelectedLanguage(Language selected) { - setSelection(((LanguagesAdapter) getAdapter()).getPosition(selected)); - } - - public Language getSelectedLanguage() { - return (Language) getSelectedItem(); - } - - public void setOnLanguageSelectedListener(final OnLanguageSelectedListener listener) { - setOnItemSelectedListener(new OnItemSelectedListener() { - @Override - public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { - if (listener != null) { - listener.onLanguageSelected((Language) parent.getItemAtPosition(position)); - } - } - @Override - public void onNothingSelected(AdapterView<?> parent) { - } - }); - } - - public interface OnLanguageSelectedListener { - void onLanguageSelected(Language language); - } - -} diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/LanguagesAdapter.java b/src/ui/android/src/org/grammaticalframework/ui/android/LanguagesAdapter.java deleted file mode 100644 index e39ed7bd9..000000000 --- a/src/ui/android/src/org/grammaticalframework/ui/android/LanguagesAdapter.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.grammaticalframework.ui.android; - -import android.content.Context; -import android.widget.ArrayAdapter; -import android.widget.SpinnerAdapter; - - -import java.util.List; - -public class LanguagesAdapter extends ArrayAdapter<Language> implements SpinnerAdapter { - - public LanguagesAdapter(Context context, List<Language> objects) { - super(context, R.layout.languages_item, objects); - } - -} diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/LexiconSuggestionProvider.java b/src/ui/android/src/org/grammaticalframework/ui/android/LexiconSuggestionProvider.java deleted file mode 100644 index 7b9813b7d..000000000 --- a/src/ui/android/src/org/grammaticalframework/ui/android/LexiconSuggestionProvider.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.grammaticalframework.ui.android; - -import android.content.ContentProvider; -import android.content.ContentValues; -import android.provider.BaseColumns; -import android.database.Cursor; -import android.database.MatrixCursor; -import android.app.SearchManager; -import android.net.Uri; -import android.util.Log; -import android.view.inputmethod.CompletionInfo; - -public class LexiconSuggestionProvider extends ContentProvider { - private Translator mTranslator; - - public boolean onCreate() { - return true; - } - - public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { - mTranslator = ((GFTranslator) getContext().getApplicationContext()).getTranslator(); - String[] columns = new String[] { - BaseColumns._ID, - SearchManager.SUGGEST_COLUMN_TEXT_1, - SearchManager.SUGGEST_COLUMN_QUERY - }; - - String query = uri.getLastPathSegment(); - MatrixCursor cursor = new MatrixCursor(columns, 100); - for (CompletionInfo info : mTranslator.lookupWordPrefix(query)) { - cursor.addRow(new String[] {Long.toString(info.getId()),info.getText().toString(),info.getText().toString()}); - } - - return cursor; - } - - public Uri insert (Uri uri, ContentValues values) { - throw new UnsupportedOperationException(); - } - - public int update (Uri uri, ContentValues values, String selection, String[] selectionArgs) { - throw new UnsupportedOperationException(); - } - - public int delete (Uri uri, String selection, String[] selectionArgs) { - throw new UnsupportedOperationException(); - } - - public String getType (Uri uri) { - return null; - } -} diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/LocaleUtils.java b/src/ui/android/src/org/grammaticalframework/ui/android/LocaleUtils.java deleted file mode 100644 index 9fb048908..000000000 --- a/src/ui/android/src/org/grammaticalframework/ui/android/LocaleUtils.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.grammaticalframework.ui.android; - -import android.text.TextUtils; - -import java.util.Locale; - -/** - * Collections of utils to handle locales. - */ -public class LocaleUtils { - - /** - * Parses a locale string formatted by {@link Locale#toString()}. - * - * @return the parsed {@code Locale} or {@code defaultLocale} if the input was null or empty. - */ - public static Locale parseJavaLocale(String localeString, Locale defaultLocale) { - if (TextUtils.isEmpty(localeString)) { - return defaultLocale; - } - final char separator = '_'; - int pos1 = localeString.indexOf(separator); - if (pos1 == -1) { - return new Locale(localeString); - } - String language = localeString.substring(0, pos1); - - int start2 = pos1 + 1; - int pos2 = localeString.indexOf(separator, start2); - if (pos2 == -1) { - return new Locale(language, localeString.substring(start2)); - } - String country = localeString.substring(start2, pos2); - - int start3 = pos2 + 1; - int pos3 = localeString.indexOf(separator, start3); - String variant = (pos3 == -1) - ? localeString.substring(start3) - : localeString.substring(start3, pos3); - return new Locale(language, country, variant); - } -} diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/MainActivity.java b/src/ui/android/src/org/grammaticalframework/ui/android/MainActivity.java deleted file mode 100644 index 369e542e9..000000000 --- a/src/ui/android/src/org/grammaticalframework/ui/android/MainActivity.java +++ /dev/null @@ -1,377 +0,0 @@ -package org.grammaticalframework.ui.android; - -import java.io.*; -import java.util.*; - -import android.app.Activity; -import android.content.Intent; -import android.content.SharedPreferences; -import android.os.AsyncTask; -import android.os.Bundle; -import android.speech.SpeechRecognizer; -import android.net.Uri; -import android.util.Log; -import android.util.Pair; -import android.view.Menu; -import android.view.MenuInflater; -import android.view.MenuItem; -import android.view.MotionEvent; -import android.view.View; -import android.view.View.OnClickListener; -import android.view.View.OnTouchListener; -import android.widget.ImageView; - -import org.grammaticalframework.ui.android.ASR.State; -import org.grammaticalframework.ui.android.LanguageSelector.OnLanguageSelectedListener; -import org.grammaticalframework.ui.android.ConversationView.OnAlternativesListener; -import org.grammaticalframework.pgf.*; - -public class MainActivity extends Activity { - - private static final boolean DBG = true; - private static final String TAG = "MainActivity"; - - private ImageView mStartStopButton; - - private ConversationView mConversationView; - - private LanguageSelector mSourceLanguageView; - - private LanguageSelector mTargetLanguageView; - - private ImageView mSwitchLanguagesButton; - - private ASR mAsr; - - private TTS mTts; - - private Translator mTranslator; - - private boolean input_mode; - - private SpeechInputListener mSpeechListener; - - private View mProgressBarView = null; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - mStartStopButton = (ImageView) findViewById(R.id.start_stop); - mConversationView = (ConversationView) findViewById(R.id.conversation); - mSourceLanguageView = (LanguageSelector) findViewById(R.id.source_language); - mTargetLanguageView = (LanguageSelector) findViewById(R.id.target_language); - mSwitchLanguagesButton = (ImageView) findViewById(R.id.switch_languages); - mProgressBarView = findViewById(R.id.progressBarView); - - mStartStopButton.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - if (mAsr.isRunning()) { - stopRecognition(); - } else { - startRecognition(); - } - } - }); - - SharedPreferences pref = getPreferences(MODE_PRIVATE); - input_mode = pref.getBoolean("input_mode", true); - if (!SpeechRecognizer.isRecognitionAvailable(this)) { - input_mode = false; - } - mStartStopButton.setImageResource(input_mode ? R.drawable.ic_mic : R.drawable.ic_keyboard); - - mSpeechListener = new SpeechInputListener(); - - mConversationView.setOnAlternativesListener(new OnAlternativesListener() { - @Override - public void onAlternativesSelected(CharSequence authority, CharSequence input, List<Expr> alternatives) { - Uri.Builder builder = new Uri.Builder(); - builder.scheme("gf-translator"); - builder.authority(authority.toString()); - builder.appendQueryParameter("source", input.toString()); - for (Expr e : alternatives) { - builder.appendQueryParameter("alternative", e.toString()); - } - - Intent myIntent = new Intent(Intent.ACTION_VIEW, builder.build()); - MainActivity.this.startActivity(myIntent); - } - }); - mConversationView.setSpeechInputListener(mSpeechListener); - - mAsr = new ASR(this); - mAsr.setListener(mSpeechListener); - - mTts = new TTS(this); - - mTranslator = ((GFTranslator) getApplicationContext()).getTranslator(); - - mSourceLanguageView.setLanguages(mTranslator.getAvailableLanguages()); - mSourceLanguageView.setOnLanguageSelectedListener(new OnLanguageSelectedListener() { - @Override - public void onLanguageSelected(Language language) { - onSourceLanguageSelected(language); - } - }); - mTargetLanguageView.setLanguages(mTranslator.getAvailableLanguages()); - mTargetLanguageView.setOnLanguageSelectedListener(new OnLanguageSelectedListener() { - @Override - public void onLanguageSelected(Language language) { - onTargetLanguageSelected(language); - } - }); - - mSwitchLanguagesButton.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - onSwitchLanguages(); - } - }); - - if (savedInstanceState != null) { - mConversationView.restoreConversation(savedInstanceState); - } - } - - @Override - protected void onResume() { - super.onResume(); - - mSourceLanguageView.setSelectedLanguage(mTranslator.getSourceLanguage()); - mTargetLanguageView.setSelectedLanguage(mTranslator.getTargetLanguage()); - } - - private void showProgressBar() { - mProgressBarView.setVisibility(View.VISIBLE); - } - - private void hideProgressBar() { - mProgressBarView.setVisibility(View.GONE); - } - - @Override - protected void onSaveInstanceState(Bundle outState) { - super.onSaveInstanceState(outState); - mConversationView.saveConversation(outState); - } - - @Override - public boolean onCreateOptionsMenu(Menu menu) { - MenuInflater inflater = getMenuInflater(); - inflater.inflate(R.menu.main, menu); - - menu.getItem(0).setTitle(input_mode ? R.string.keyboard_input : R.string.mic_input); - - if (!SpeechRecognizer.isRecognitionAvailable(this)) { - menu.getItem(0).setEnabled(false); - } - return true; - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - // Handle item selection - switch (item.getItemId()) { - case R.id.input_mode: - if (input_mode) { - item.setTitle(R.string.mic_input); - mStartStopButton.setImageResource(R.drawable.ic_keyboard); - input_mode = false; - } else { - item.setTitle(R.string.keyboard_input); - mStartStopButton.setImageResource(R.drawable.ic_mic); - input_mode = true; - } - - SharedPreferences.Editor editor = getPreferences(MODE_PRIVATE).edit(); - editor.putBoolean("input_mode", input_mode); - editor.commit(); - - return true; - case R.id.phrasebook: { - Intent myIntent = new Intent(MainActivity.this, se.chalmers.phrasebook.gui.activities.NavigationActivity.class); - MainActivity.this.startActivity(myIntent); - return true; - } - case R.id.topics: { - Intent myIntent = new Intent(MainActivity.this, AlternativesActivity.class); - MainActivity.this.startActivity(myIntent); - return true; - } - case R.id.help: { - Intent myIntent = new Intent(MainActivity.this, HelpActivity.class); - MainActivity.this.startActivity(myIntent); - return true; - } - default: - return super.onOptionsItemSelected(item); - } - } - - @Override - protected void onDestroy() { - if (mAsr != null) { - mAsr.destroy(); - mAsr = null; - } - if (mTts != null) { - mTts.destroy(); - mTts = null; - } - super.onDestroy(); - } - - void onSourceLanguageSelected(Language language) { - mTranslator.setSourceLanguage(language); - if (TranslatorInputMethodService.getInstance() != null) { - TranslatorInputMethodService.getInstance().handleChangeSourceLanguage(language); - } - } - - void onTargetLanguageSelected(Language language) { - mTranslator.setTargetLanguage(language); - if (TranslatorInputMethodService.getInstance() != null) { - TranslatorInputMethodService.getInstance().handleChangeTargetLanguage(language); - } - } - - public String getSourceLanguageCode() { - return mTranslator.getSourceLanguage().getLangCode(); - } - - public String getTargetLanguageCode() { - return mTranslator.getTargetLanguage().getLangCode(); - } - - void onSwitchLanguages() { - mTranslator.switchLanguages(); - mSourceLanguageView.setSelectedLanguage(mTranslator.getSourceLanguage()); - mTargetLanguageView.setSelectedLanguage(mTranslator.getTargetLanguage()); - - if (TranslatorInputMethodService.getInstance() != null) { - TranslatorInputMethodService.getInstance().handleSwitchLanguages(); - } - } - - private void startRecognition() { - if (input_mode) { - mConversationView.addFirstPersonUtterance("...", false); - mAsr.setLanguage(getSourceLanguageCode()); - mAsr.startRecognition(); - } else { - mConversationView.addFirstPersonUtterance("", true); - } - } - - private void stopRecognition() { - mAsr.stopRecognition(); - } - - private void handlePartialSpeechInput(String input) { - mConversationView.updateLastUtterance(input); - } - - private void handleSpeechInput(final String input) { - final List<MorphoAnalysis> list = mTranslator.lookupMorpho(input); - - mConversationView.updateLastUtterance(input); - new AsyncTask<Void,Void,Pair<String,List<ExprProb>>>() { - @Override - protected void onPreExecute() { - showProgressBar(); - } - - @Override - protected Pair<String,List<ExprProb>> doInBackground(Void... params) { - return mTranslator.translate(input); - } - - @Override - protected void onPostExecute(Pair<String,List<ExprProb>> res) { - String text = res.first; - List<ExprProb> transl = res.second; - - List<Expr> alts = null; - String authority = null; - - // filter out duplicates - int i = 0; - if (list.size() > 0) { - alts = new ArrayList(list.size()); - authority = Translator.WORDS; - - while (i < list.size()) { - MorphoAnalysis an = list.get(i); - boolean found = false; - for (int j = 0; j < i; j++) { - if (list.get(j).getLemma().equals(an.getLemma())) { - found = true; - break; - } - } - - if (!found) { - alts.add(Expr.readExpr(an.getLemma())); - } - - i++; - } - } else { - alts = new ArrayList(transl.size()); - authority = Translator.SENTENCES; - - Set<String> strings = new HashSet<String>(); - while (i < transl.size()) { - String s = mTranslator.linearize(transl.get(i).getExpr()); - if (s.length() > 0 && - (s.charAt(0) == '%' || s.charAt(0) == '*' || s.charAt(0) == '+')) { - s = s.substring(2); - } - - if (!strings.contains(s)) { - strings.add(s); - alts.add(transl.get(i).getExpr()); - } - - i++; - } - } - - if (DBG) Log.d(TAG, "Speaking: " + res.first); - CharSequence text2 = - mConversationView.addSecondPersonUtterance(authority, input, text, alts); - text2 = text2.toString().replace('[',' ').replace(']',' ').replaceAll("_","").trim(); - mTts.speak(getTargetLanguageCode(), text2.toString()); - - hideProgressBar(); - } - }.execute(); - } - - private class SpeechInputListener implements ASR.Listener { - - @Override - public void onPartialInput(String input) { - handlePartialSpeechInput(input); - } - - @Override - public void onSpeechInput(String input) { - handleSpeechInput(input); - } - - @Override - public void onStateChanged(State newState) { - if (newState == ASR.State.IDLE) { - //clear the overlay - mStartStopButton.getDrawable().clearColorFilter(); - } else { - mStartStopButton.getDrawable().setColorFilter(0xffff0000,android.graphics.PorterDuff.Mode.SRC_ATOP); - } - mStartStopButton.invalidate(); - } - } -} diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/ParseTreeView.java b/src/ui/android/src/org/grammaticalframework/ui/android/ParseTreeView.java deleted file mode 100644 index b2ff74183..000000000 --- a/src/ui/android/src/org/grammaticalframework/ui/android/ParseTreeView.java +++ /dev/null @@ -1,270 +0,0 @@ -package org.grammaticalframework.ui.android; - -import android.content.Context; -import android.graphics.Canvas; -import android.graphics.Paint; -import android.graphics.PointF; -import android.graphics.Rect; -import android.util.AttributeSet; -import android.util.SparseArray; -import android.view.MotionEvent; -import android.view.View; - -import org.grammaticalframework.pgf.Bracket; - - -public class ParseTreeView extends View { - private static final float SISTER_SKIP = 25; - private static final float PARENT_SKIP = 0.5f; - private static final float ABOVE_LINE_SKIP = 0.1f; - private static final float BELOW_LINE_SKIP = 0.1f; - - private Paint paint; - private Object[] brackets; - - private float lastMotionX; - private float scrollRange; - - public ParseTreeView(Context context) { - this(context, null); - } - - public ParseTreeView(Context context, AttributeSet attrs) { - super(context, attrs, R.attr.parseTreeViewStyle); - - paint = new Paint(); - paint.setTextSize(60); - brackets = null; - scrollRange = 0; - } - - public Object[] getBrackets() { - return brackets; - } - - public void setBrackets(Object[] brackets) { - this.brackets = brackets; - awakenScrollBars(); - } - - static class MeasureResult { - float width = 0.0f; - float height = 0.0f; - float nodeTab = 0.0f; - float nodeCenter = 0.0f; - float childTab = 0.0f; - float localWidth = 0.0f; - float localHeight = 0.0f; - } - - private MeasureResult mr = new MeasureResult(); - private SparseArray<PointF> coords = new SparseArray<PointF>(); - private PointF zeroPoint = new PointF(); - - private void measureTree(Object o) { - if (o instanceof Bracket) { - Bracket bracket = (Bracket) o; - - Rect bounds = new Rect(); - paint.getTextBounds(bracket.cat,0,bracket.cat.length(),bounds); - float localWidth = bounds.width(); - float localHeight = bounds.height(); - float layerHeight = localHeight * (1.0f + BELOW_LINE_SKIP + ABOVE_LINE_SKIP + PARENT_SKIP); - - PointF local = coords.get(bracket.fid); - if (local == null) { - coords.put(bracket.fid, zeroPoint); - } else { - localWidth = 0; - } - - float subWidth = 0.0f; - float subHeight = 0.0f; - float nodeCenter = 0.0f; - for (int i = 0; i < bracket.children.length; i++) { - measureTree(bracket.children[i]); - - if (i == 0) { - nodeCenter += (subWidth + mr.nodeCenter) / 2.0; - } - if (i == bracket.children.length - 1) { - nodeCenter += (subWidth + mr.nodeCenter) / 2.0; - } - - subWidth += mr.width; - if (i < bracket.children.length - 1) { - subWidth += SISTER_SKIP; - } - - if (subHeight < mr.height) - subHeight = mr.height; - } - float localLeft = localWidth / 2.0f; - float subLeft = nodeCenter; - float totalLeft = Math.max(localLeft, subLeft); - float localRight = localWidth / 2.0f; - float subRight = subWidth - nodeCenter; - float totalRight = Math.max(localRight, subRight); - mr.width = totalLeft + totalRight; - mr.height = layerHeight + subHeight; - mr.childTab = totalLeft - subLeft; - mr.nodeTab = totalLeft - localLeft; - mr.nodeCenter = nodeCenter + mr.childTab; - mr.localWidth = localWidth; - mr.localHeight = localHeight; - } else { - String word = o.toString(); - - Rect bounds = new Rect(); - paint.getTextBounds(word,0,word.length(),bounds); - mr.width = bounds.width(); - mr.height = bounds.height(); - mr.nodeTab = 0.0f; - mr.nodeCenter = bounds.width() / 2.0f; - mr.childTab = 0.0f; - mr.localWidth = bounds.width(); - mr.localHeight = bounds.height(); - } - } - - @Override - protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - if (brackets == null) { - setMeasuredDimension(0, 0); - return; - } - - coords.clear(); - - float width = 0.0f; - float height = 0.0f; - for (int i = 0; i < brackets.length; i++) { - measureTree(brackets[i]); - - width += mr.width; - if (i < brackets.length - 1) { - width += SISTER_SKIP; - } - - if (height < mr.height) - height = mr.height; - } - - height += paint.getFontMetrics().descent; - - int w = getPaddingLeft() + (int) width + getPaddingRight(); - int h = getPaddingTop() + (int) height + getPaddingBottom(); - - scrollRange = w; - - int widthReq = MeasureSpec.getSize(widthMeasureSpec); - if (MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.EXACTLY || - (MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.AT_MOST && w > widthReq)) { - w = widthReq; - } - int heightReq = MeasureSpec.getSize(heightMeasureSpec); - if (MeasureSpec.getMode(heightMeasureSpec) == MeasureSpec.EXACTLY || - (MeasureSpec.getMode(heightMeasureSpec) == MeasureSpec.AT_MOST && h > heightReq)) { - h = heightReq; - } - - setMeasuredDimension(w, h); - } - - private void drawTree(Canvas canvas, - float x, float y, float bottom, PointF parentPoint, - Object o) { - if (o instanceof Bracket) { - Bracket bracket = (Bracket) o; - - PointF lineStart = coords.get(bracket.fid); - if (lineStart == null) { - lineStart = new PointF(x + mr.nodeCenter, y + mr.localHeight * (1.0f + BELOW_LINE_SKIP)); - coords.put(bracket.fid, lineStart); - - if (parentPoint != null) { - float lineEndX = x + mr.nodeCenter; - float lineEndY = y; - canvas.drawLine(parentPoint.x, parentPoint.y, lineEndX, lineEndY, paint); - } - - canvas.drawText(bracket.cat, x+mr.nodeTab, y+mr.localHeight, paint); - } - - float layerMultiplier = (1.0f + BELOW_LINE_SKIP + ABOVE_LINE_SKIP + PARENT_SKIP); - float layerHeight = mr.localHeight * layerMultiplier; - float childStartX = x + mr.childTab; - float childStartY = y + layerHeight; - for (int i = 0; i < bracket.children.length; i++) { - Object child = bracket.children[i]; - SparseArray<PointF> copy = coords.clone(); - measureTree(child); - coords = copy; - float w = mr.width; - drawTree(canvas, childStartX, childStartY, bottom, lineStart, child); - childStartX += w + SISTER_SKIP; - } - } else { - float lineEndX = x + mr.nodeCenter; - float lineEndY = bottom - mr.height; - canvas.drawLine(parentPoint.x, parentPoint.y, lineEndX, lineEndY, paint); - canvas.drawText(o.toString(), x, bottom, paint); - } - } - - @Override - protected void onDraw (Canvas canvas) { - super.onDraw(canvas); - - if (brackets == null) { - return; - } - - coords.clear(); - - float startX = getPaddingLeft(); - for (int i = 0; i < brackets.length; i++) { - Object child = brackets[i]; - - SparseArray<PointF> copy = coords.clone(); - measureTree(child); - coords = copy; - float w = mr.width; - drawTree(canvas, startX, getPaddingTop(), getPaddingTop()+mr.height, null, child); - startX += w + SISTER_SKIP; - } - } - - @Override - public boolean onTouchEvent(MotionEvent ev) { - switch (ev.getAction()) { - case MotionEvent.ACTION_DOWN: - // Remember where the motion event started - lastMotionX = ev.getX(); - break; - case MotionEvent.ACTION_MOVE: - // Scroll to follow the motion event - float x = ev.getX(); - final int deltaX = (int) (lastMotionX - x); - lastMotionX = x; - int offset = computeHorizontalScrollOffset() + deltaX; - int range = computeHorizontalScrollRange() - computeHorizontalScrollExtent(); - if (range > 0) { - if (offset < 0) - offset = 0; - if (offset > range) - offset = range; - scrollTo(offset, 0); - } - break; - case MotionEvent.ACTION_UP: - break; - } - return true; - } - - @Override - protected int computeHorizontalScrollRange() { - return (int) scrollRange; - } -} diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/RotationGestureDetector.java b/src/ui/android/src/org/grammaticalframework/ui/android/RotationGestureDetector.java deleted file mode 100644 index d077db1bc..000000000 --- a/src/ui/android/src/org/grammaticalframework/ui/android/RotationGestureDetector.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.grammaticalframework.ui.android; - -import android.view.MotionEvent; - -public class RotationGestureDetector { - - private static final int INVALID_POINTER_ID = -1; - private float fX, fY, sX, sY, focalX, focalY; - private int ptrID1, ptrID2; - private float mAngle; - private boolean firstTouch; - - private OnRotationGestureListener mListener; - - public RotationGestureDetector(OnRotationGestureListener listener) { - mListener = listener; - ptrID1 = INVALID_POINTER_ID; - ptrID2 = INVALID_POINTER_ID; - } - - public float getAngle() { - return mAngle; - } - - public boolean onTouchEvent(MotionEvent event){ - switch (event.getActionMasked()) { - case MotionEvent.ACTION_DOWN: - sX = event.getX(); - sY = event.getY(); - ptrID1 = event.getPointerId(0); - mAngle = 0; - firstTouch = true; - break; - case MotionEvent.ACTION_POINTER_DOWN: - fX = event.getX(); - fY = event.getY(); - focalX = getMidpoint(fX, sX); - focalY = getMidpoint(fY, sY); - ptrID2 = event.getPointerId(event.getActionIndex()); - mAngle = 0; - firstTouch = true; - break; - case MotionEvent.ACTION_MOVE: - if(ptrID1 != INVALID_POINTER_ID && ptrID2 != INVALID_POINTER_ID) { - float nfX, nfY, nsX, nsY; - nsX = event.getX(event.findPointerIndex(ptrID1)); - nsY = event.getY(event.findPointerIndex(ptrID1)); - nfX = event.getX(event.findPointerIndex(ptrID2)); - nfY = event.getY(event.findPointerIndex(ptrID2)); - if (firstTouch) { - mAngle = 0; - firstTouch = false; - } else { - mAngle = angleBetweenLines(fX, fY, sX, sY, nfX, nfY, nsX, nsY); - } - - if (mListener != null) { - mListener.OnRotation(this); - } - fX = nfX; - fY = nfY; - sX = nsX; - sY = nsY; - } - break; - case MotionEvent.ACTION_UP: - ptrID1 = INVALID_POINTER_ID; - break; - case MotionEvent.ACTION_POINTER_UP: - ptrID2 = INVALID_POINTER_ID; - break; - } - return true; - } - - private float getMidpoint(float a, float b) { - return (a + b) / 2; - } - - private float findAngleDelta(float angle1, float angle2) - { - angle2 = angle2 % 360.0f; - angle1 = angle1 % 360.0f; - - float dist = angle1 - angle2; - if (dist < -180.0f) - { - dist += 360.0f; - } - else if (dist > 180.0f) - { - dist -= 360.0f; - } - - return dist; - } - - private float angleBetweenLines(float fx1, float fy1, float fx2, float fy2, float sx1, float sy1, float sx2, float sy2) - { - float angle1 = (float) Math.atan2((fy1 - fy2), (fx1 - fx2)); - float angle2 = (float) Math.atan2((sy1 - sy2), (sx1 - sx2)); - - return findAngleDelta((float)Math.toDegrees(angle1),(float)Math.toDegrees(angle2)); - } - - public static interface OnRotationGestureListener { - public boolean OnRotation(RotationGestureDetector detector); - } -} diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/SemanticGraph.java b/src/ui/android/src/org/grammaticalframework/ui/android/SemanticGraph.java deleted file mode 100644 index 0033404c9..000000000 --- a/src/ui/android/src/org/grammaticalframework/ui/android/SemanticGraph.java +++ /dev/null @@ -1,235 +0,0 @@ -package org.grammaticalframework.ui.android; - -import java.util.*; - -public class SemanticGraph { - private Map<String,Node> nodes; - private List<Edge> edges; - - private float layoutMinX; - private float layoutMaxX; - private float layoutMinY; - private float layoutMaxY; - - public SemanticGraph() { - nodes = new HashMap<String,Node>(); - edges = new ArrayList<Edge>(); - - layoutMinX = 0; - layoutMaxX = 0; - layoutMinY = 0; - layoutMaxY = 0; - } - - public Node addNode(String lemma, List senses) { - Node n = nodes.get(lemma); - if (n == null) { - n = new Node(lemma, senses); - } - nodes.put(lemma,n); - return n; - } - - public Node getNode(String lemma) { - return nodes.get(lemma); - } - - public Collection<Node> getNodes() { - return Collections.unmodifiableCollection(nodes.values()); - } - - public Edge addEdge(Node node1, Node node2) { - Edge edge = new Edge(node1, node2); - edges.add(edge); - return edge; - } - - private static final int LAYOUT_ITERATIONS = 500; - private static final float LAYOUT_K = 2; - private static final float LAYOUT_C = 0.01f; - private static final float LAYOUT_MAX_VERTEX_MOVEMENT = 0.5f; - private static final float LAYOUT_MAX_REPULSIVE_FORCE_DISTANCE = 6; - - public void layout() { - layoutPrepare(); - for (int i = 0; i < LAYOUT_ITERATIONS; i++) { - layoutIteration(); - } - layoutCalcBounds(); - } - - public float getLayoutMinX() { - return layoutMinX; - } - - public float getLayoutMaxX() { - return layoutMaxX; - } - - public float getLayoutMinY() { - return layoutMinY; - } - - public float getLayoutMaxY() { - return layoutMaxY; - } - - private void layoutPrepare() { - for (Node node : nodes.values()) { - node.layoutForceX = 0; - node.layoutForceY = 0; - } - } - - private void layoutIteration() { - List<Node> prev = new ArrayList<Node>(); - for(Node node1 : this.nodes.values()) { - for (Node node2 : prev) { - layoutRepulsive(node1, node2); - } - prev.add(node1); - } - - // Forces on nodes due to edge attractions - for (Edge edge : edges) { - layoutAttractive(edge); - } - - // Move by the given force - for (Node node : nodes.values()) { - float xmove = LAYOUT_C * node.layoutForceX; - float ymove = LAYOUT_C * node.layoutForceY; - - float max = LAYOUT_MAX_VERTEX_MOVEMENT; - if (xmove > max) xmove = max; - if (xmove < -max) xmove = -max; - if (ymove > max) ymove = max; - if (ymove < -max) ymove = -max; - - node.layoutPosX += xmove; - node.layoutPosY += ymove; - node.layoutForceX = 0; - node.layoutForceY = 0; - } - } - - private void layoutRepulsive(Node node1, Node node2) { - float dx = node2.layoutPosX - node1.layoutPosX; - float dy = node2.layoutPosY - node1.layoutPosY; - float d2 = dx * dx + dy * dy; - if (d2 < 0.01) { - dx = (float) (0.1 * Math.random() + 0.1); - dy = (float) (0.1 * Math.random() + 0.1); - d2 = dx * dx + dy * dy; - } - float d = (float) Math.sqrt(d2); - if (d < LAYOUT_MAX_REPULSIVE_FORCE_DISTANCE) { - float repulsiveForce = LAYOUT_K * LAYOUT_K / d; - node2.layoutForceX += repulsiveForce * dx / d; - node2.layoutForceY += repulsiveForce * dy / d; - node1.layoutForceX -= repulsiveForce * dx / d; - node1.layoutForceY -= repulsiveForce * dy / d; - } - } - - private void layoutAttractive(Edge edge) { - Node node1 = edge.source; - Node node2 = edge.target; - - float dx = node2.layoutPosX - node1.layoutPosX; - float dy = node2.layoutPosY - node1.layoutPosY; - float d2 = dx * dx + dy * dy; - if (d2 < 0.01) { - dx = (float) (0.1 * Math.random() + 0.1); - dy = (float) (0.1 * Math.random() + 0.1); - d2 = dx * dx + dy * dy; - } - float d = (float) Math.sqrt(d2); - if (d > LAYOUT_MAX_REPULSIVE_FORCE_DISTANCE) { - d = LAYOUT_MAX_REPULSIVE_FORCE_DISTANCE; - d2 = d * d; - } - float attractiveForce = (d2 - LAYOUT_K * LAYOUT_K) / LAYOUT_K; - attractiveForce *= Math.log(edge.attraction) * 0.5 + 1; - - node2.layoutForceX -= attractiveForce * dx / d; - node2.layoutForceY -= attractiveForce * dy / d; - node1.layoutForceX += attractiveForce * dx / d; - node1.layoutForceY += attractiveForce * dy / d; - } - - private void layoutCalcBounds() { - float minx = Float.POSITIVE_INFINITY, - maxx = Float.NEGATIVE_INFINITY, - miny = Float.POSITIVE_INFINITY, - maxy = Float.NEGATIVE_INFINITY; - - for (Node node : nodes.values()) { - float x = node.layoutPosX; - float y = node.layoutPosY; - - if (x > maxx) maxx = x; - if (x < minx) minx = x; - if (y > maxy) maxy = y; - if (y < miny) miny = y; - } - - layoutMinX = minx; - layoutMaxX = maxx; - layoutMinY = miny; - layoutMaxY = maxy; - } - - public static class Node { - private String lemma; - private List senses; - - private float layoutPosX; - private float layoutPosY; - private float layoutForceX; - private float layoutForceY; - - - private Node(String lemma, List senses) { - this.lemma = lemma; - this.senses = senses; - - layoutPosX = 0; - layoutPosY = 0; - layoutForceX = 0; - layoutForceY = 0; - } - - public String getLemma() { - return lemma; - } - - public int getSenseCount() { - return senses.size(); - } - - public Object getSenseId(int i) { - return senses.get(i); - } - - public float getLayoutX() { - return layoutPosX; - } - - public float getLayoutY() { - return layoutPosY; - } - } - - public static class Edge { - private Node source; - private Node target; - private float attraction; - - private Edge(Node source, Node target) { - this.source = source; - this.target = target; - this.attraction = 1; - } - } -} diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/SemanticGraphActivity.java b/src/ui/android/src/org/grammaticalframework/ui/android/SemanticGraphActivity.java deleted file mode 100644 index 38878cc50..000000000 --- a/src/ui/android/src/org/grammaticalframework/ui/android/SemanticGraphActivity.java +++ /dev/null @@ -1,102 +0,0 @@ -package org.grammaticalframework.ui.android; - -import java.util.*; - -import android.app.Activity; -import android.app.SearchManager; -import android.os.Bundle; -import android.os.AsyncTask; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.ImageView; -import android.widget.Toast; -import android.content.Intent; - -import org.grammaticalframework.pgf.MorphoAnalysis; -import org.grammaticalframework.ui.android.LanguageSelector.OnLanguageSelectedListener; - -public class SemanticGraphActivity extends Activity { - private Translator mTranslator; - - private LanguageSelector mLanguageView; - private View mProgressBarView = null; - private ImageView mAddWordButton; - private SemanticGraphView mGraphView; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_semantic_graph); - - mTranslator = ((GFTranslator) getApplicationContext()).getTranslator(); - - mLanguageView = (LanguageSelector) findViewById(R.id.show_language); - mLanguageView.setLanguages(mTranslator.getAvailableLanguages()); - mLanguageView.setOnLanguageSelectedListener(new OnLanguageSelectedListener() { - @Override - public void onLanguageSelected(final Language language) { - new AsyncTask<Void,Void,Void>() { - @Override - protected void onPreExecute() { - showProgressBar(); - } - - @Override - protected Void doInBackground(Void... params) { - mTranslator.setSourceLanguage(language); - mTranslator.isTargetLanguageLoaded(); - return null; - } - - @Override - protected void onPostExecute(Void result) { - hideProgressBar(); - } - }.execute(); - } - }); - - mAddWordButton = (ImageView) findViewById(R.id.add_word); - - mGraphView = (SemanticGraphView) findViewById(R.id.semantic_graph); - - mAddWordButton.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - onSearchRequested(); - } - }); - - mProgressBarView = findViewById(R.id.progressBarView); - } - - @Override - protected void onResume() { - super.onResume(); - - mLanguageView.setSelectedLanguage(mTranslator.getSourceLanguage()); - } - - private void showProgressBar() { - mProgressBarView.setVisibility(View.VISIBLE); - } - - private void hideProgressBar() { - mProgressBarView.setVisibility(View.GONE); - } - - @Override - protected void onNewIntent (Intent intent) { - if (Intent.ACTION_SEARCH.equals(intent.getAction())) { - String query = intent.getStringExtra(SearchManager.QUERY); - List<MorphoAnalysis> list = mTranslator.lookupMorpho(query); - if (list == null || list.size() == 0) { - Toast toast = Toast.makeText(this, "\""+query+"\" doesn't match", Toast.LENGTH_SHORT); - toast.show(); - } else { - mGraphView.getGraph().addNode(query, list); - mGraphView.refresh(); - } - } - } -} diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/SemanticGraphManager.java b/src/ui/android/src/org/grammaticalframework/ui/android/SemanticGraphManager.java deleted file mode 100644 index f3b26a3cf..000000000 --- a/src/ui/android/src/org/grammaticalframework/ui/android/SemanticGraphManager.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.grammaticalframework.ui.android; - -import java.io.*; -import android.content.Context; -import android.util.Log; - -import org.grammaticalframework.sg.*; -import org.grammaticalframework.pgf.*; - -public class SemanticGraphManager implements Closeable { - private final Context mContext; - private SG mDB; - - public static final String DATABASE_FILE_NAME = "semantics.db"; - - public SemanticGraphManager(Context context) { - mContext = context; - mDB = null; - } - - private void createDatabaseFromAssets() throws SGError, IOException { - if (mDB != null) - return; - - String path = mContext.getDatabasePath(DATABASE_FILE_NAME).getPath(); - - boolean exists = false; - - File file = new File(path); - if (((GFTranslator) mContext.getApplicationContext()).getTranslator().isUpgraded("db_version")) { - file.delete(); - } else { - if (file.exists()) { - exists = true; - } - } - - File dir = new File(mContext.getApplicationInfo().dataDir + "/databases"); - if (!dir.exists()) { - dir.mkdir(); - } - - if (!extractDatabase(file)) - return; - - mDB = SG.openSG(path); - if (exists) - return; - } - - private boolean extractDatabase(File outFile) { - InputStream in = null; - OutputStream out = null; - try { - in = mContext.getAssets().open(DATABASE_FILE_NAME); - out = new FileOutputStream(outFile); - copyFile(in, out); - return true; - } catch(IOException e) { - Log.e("tag", "Failed to copy asset file: " + DATABASE_FILE_NAME, e); - } - finally { - if (in != null) { - try { - in.close(); - } catch (IOException e) { - // NOOP - } - } - if (out != null) { - try { - out.close(); - } catch (IOException e) { - // NOOP - } - } - } - - return false; - } - - private void copyFile(InputStream in, OutputStream out) throws IOException { - byte[] buffer = new byte[1024]; - int read; - while((read = in.read(buffer)) != -1){ - out.write(buffer, 0, read); - } - } - - public void close() { - if (mDB != null) { - mDB.close(); - mDB = null; - } - } - - public TripleResult queryTriple(Expr subj, Expr pred, Expr obj) throws IOException { - createDatabaseFromAssets(); - return mDB.queryTriple(subj, pred, obj); - } -} diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/SemanticGraphView.java b/src/ui/android/src/org/grammaticalframework/ui/android/SemanticGraphView.java deleted file mode 100644 index 81785d5ce..000000000 --- a/src/ui/android/src/org/grammaticalframework/ui/android/SemanticGraphView.java +++ /dev/null @@ -1,144 +0,0 @@ -package org.grammaticalframework.ui.android; - -import android.view.View; -import android.view.GestureDetector; -import android.view.ScaleGestureDetector; -import android.view.MotionEvent; -import android.graphics.Paint; -import android.graphics.Canvas; -import android.graphics.Color; -import android.graphics.Rect; -import android.content.Context; -import android.util.AttributeSet; -import android.util.Log; - -public class SemanticGraphView extends View implements GestureDetector.OnGestureListener, ScaleGestureDetector.OnScaleGestureListener, RotationGestureDetector.OnRotationGestureListener { - - private SemanticGraph mGraph = new SemanticGraph(); - - private float mStartX = 0; - private float mStartY = 0; - private float mFocusX = 0; - private float mFocusY = 0; - private float mScale = 1; - private float mAngle = 0; - - private Paint mPaint; - - private GestureDetector mGD; - private ScaleGestureDetector mSGD; - private RotationGestureDetector mRGD; - - private static final float TEXT_PAD = 10; - private static final float SENSE_POINT_RADIUS = 5; - - public SemanticGraphView(Context context, AttributeSet attrs) { - super(context, attrs); - - mPaint = new Paint(); - mPaint.setTextSize(60); - - mGD = new GestureDetector(this); - mSGD = new ScaleGestureDetector(context,this); - mRGD = new RotationGestureDetector(this); - } - - public SemanticGraph getGraph() { - return mGraph; - } - - public void refresh() { - mGraph.layout(); - invalidate(); - } - - @Override - protected void onDraw (Canvas canvas) { - super.onDraw(canvas); - - canvas.scale(mScale,mScale,mFocusX,mFocusY); - canvas.translate(mStartX, mStartY); - canvas.rotate(mAngle); - - Rect bounds = new Rect(); - - float dx = mGraph.getLayoutMinX(); - float sx = getWidth()/(mGraph.getLayoutMaxX()-mGraph.getLayoutMinX()); - float dy = mGraph.getLayoutMinY(); - float sy = getHeight()/(mGraph.getLayoutMaxY()-mGraph.getLayoutMinY()); - for (SemanticGraph.Node node : mGraph.getNodes()) { - mPaint.getTextBounds(node.getLemma().toCharArray(), 0, node.getLemma().length(), bounds); - - float left = (node.getLayoutX()-dx)*sx - TEXT_PAD; - float base = (node.getLayoutY()-dy)*sy; - float top = base - bounds.height() - TEXT_PAD; - float right = left + bounds.right + TEXT_PAD; - float bottom = base + bounds.bottom + TEXT_PAD; - float sqrt2 = (float) Math.sqrt(2); - - canvas.drawText(node.getLemma(), left + TEXT_PAD, base, mPaint); - - float pi = (float) Math.PI; - for (int i = 0; i < node.getSenseCount(); i++) { - float phi = i * 2*pi / node.getSenseCount(); - float cx = ((left+right) + (right-left)*sqrt2*((float) Math.sin(phi)))/2; - float cy = ((top+bottom) + (bottom-top)*sqrt2*((float) Math.cos(phi)))/2; - - canvas.drawCircle(cx,cy,SENSE_POINT_RADIUS,mPaint); - } - } - } - - public boolean onTouchEvent(MotionEvent ev) { - mGD.onTouchEvent(ev); - mSGD.onTouchEvent(ev); - mRGD.onTouchEvent(ev); - return true; - } - - public boolean onDown(MotionEvent e) { - return true; - } - - public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { - return true; - } - - public void onLongPress(MotionEvent e) { - } - - public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { - mStartX -= distanceX; - mStartY -= distanceY; - invalidate(); - return true; - } - - public void onShowPress(MotionEvent e) { - } - - public boolean onSingleTapUp(MotionEvent e) { - return true; - } - - public boolean onScaleBegin(ScaleGestureDetector detector) { - return true; - } - - public boolean onScale(ScaleGestureDetector detector) { - mScale *= detector.getScaleFactor(); - mFocusX = detector.getFocusX(); - mFocusY = detector.getFocusY(); - invalidate(); - return true; - } - - public void onScaleEnd(ScaleGestureDetector detector) { - } - - public boolean OnRotation(RotationGestureDetector detector) { - mAngle -= detector.getAngle(); - invalidate(); - return true; - } -} diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/TTS.java b/src/ui/android/src/org/grammaticalframework/ui/android/TTS.java deleted file mode 100644 index 3e020f0af..000000000 --- a/src/ui/android/src/org/grammaticalframework/ui/android/TTS.java +++ /dev/null @@ -1,75 +0,0 @@ -package org.grammaticalframework.ui.android; - -import android.content.Context; -import android.media.AudioManager; -import android.speech.tts.TextToSpeech; -import android.util.Log; - -import java.util.HashMap; -import java.util.Locale; - -public class TTS { - - private static final String TAG = "TTS"; - - private TextToSpeech mTts; - private AudioManager mAudioManager; - - public TTS(Context context) { - mTts = new TextToSpeech(context, new InitListener()); - mAudioManager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE); - } - - // TODO: handle speak() calls before service connects - public void speak(String language, String text) { - - - if (mAudioManager.getRingerMode() == AudioManager.RINGER_MODE_NORMAL) { - - /* hack for missing TTS -- don't use for official release! - if (language.equals("bg-BG")) { - language = "ru-RU"; - } - if (language.equals("ca-ES")) { - language = "es-ES"; // hardly politically correct... - } - */ - - /* Google Chinese speech input has a nonstandard code. In output, yue works for Chi in Google, but SVOX uses the standard zh-CN */ - if (language.equals("cmn-Hans-CN")) { - language = "zh-CN"; - } - - Locale locale = LocaleUtils.parseJavaLocale(language.replace('-', '_'), - Locale.getDefault()); - - int result = mTts.setLanguage(locale); - if (result == TextToSpeech.LANG_MISSING_DATA || - result == TextToSpeech.LANG_NOT_SUPPORTED) { - Log.e(TAG, "Language is not available"); - } else { - HashMap<String,String> params = new HashMap<String,String>(); - mTts.speak(text, TextToSpeech.QUEUE_FLUSH, params); - } - } - } - - public void destroy() { - if (mTts != null) { - mTts.stop(); - mTts.shutdown(); - } - } - - private class InitListener implements TextToSpeech.OnInitListener { - @Override - public void onInit(int status) { - if (status == TextToSpeech.SUCCESS) { - Log.d(TAG, "Initialized TTS"); - } else { - Log.e(TAG, "Failed to initialize TTS"); - } - } - - } -} diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/Translator.java b/src/ui/android/src/org/grammaticalframework/ui/android/Translator.java deleted file mode 100644 index 4bfe9690a..000000000 --- a/src/ui/android/src/org/grammaticalframework/ui/android/Translator.java +++ /dev/null @@ -1,777 +0,0 @@ -package org.grammaticalframework.ui.android; - -import android.content.Context; -import android.content.SharedPreferences; -import android.content.pm.PackageManager.NameNotFoundException; -import android.util.Log; -import android.util.Pair; -import android.net.Uri; -import android.view.inputmethod.CompletionInfo; -import android.database.sqlite.SQLiteDatabase; -import android.database.Cursor; - -import org.grammaticalframework.sg.*; -import org.grammaticalframework.pgf.*; -import java.io.*; -import java.util.*; - -public class Translator { - - private static final String TAG = "Translator"; - - // new - - // TODO: allow changing - private String mGrammar = "App.pgf" ; - - // TODO: build dynamically? - private Language[] mLanguages = { - new Language("bg-BG", "Bulgarian", "AppBul", R.xml.cyrillic), - new Language("ca-ES", "Catalan", "AppCat", R.xml.qwerty), - new Language("cmn-Hans-CN", "Chinese", "AppChi", R.xml.qwerty), - // new Language("zh-CN", "Chinese", "AppChi", R.xml.qwerty), - // new Language("yue", "Chinese (Cantonese)", "AppChi", R.xml.qwerty), - // new Language("cmn-Hans-CN", "Chinese (Mandarin)", "AppChi", R.xml.qwerty), - new Language("nl-NL", "Dutch", "AppDut", R.xml.qwerty), - new Language("en-US", "English", "AppEng", R.xml.qwerty), - new Language("et-EE", "Estonian","AppEst", R.xml.nordic), - new Language("fi-FI", "Finnish", "AppFin", R.xml.nordic), - new Language("fr-FR", "French", "AppFre", R.xml.qwerty), //// - new Language("de-DE", "German", "AppGer", R.xml.qwerty), - new Language("hi-IN", "Hindi", "AppHin", R.xml.devanagari_page1, R.xml.devanagari_page2), - new Language("it-IT", "Italian", "AppIta", R.xml.qwerty), - new Language("ja-JP", "Japanese","AppJpn", R.xml.qwerty), - new Language("ru-RU", "Russian", "AppRus", R.xml.cyrillic), - new Language("es-ES", "Spanish", "AppSpa", R.xml.qwerty), - new Language("sv-SE", "Swedish", "AppSwe", R.xml.nordic), - new Language("th-TH", "Thai", "AppTha", R.xml.thai_page1, R.xml.thai_page2), - new Language("ur-PK", "Urdu", "AppUrd", R.xml.qwerty), // TODO language code and keyboard to check - }; - - private Context mContext; - - private GrammarLoader mGrammarLoader; - private ConcrLoader mSourceLoader; - private ConcrLoader mTargetLoader; - private ConcrLoader mOtherLoader; - private SemanticGraphManager mSGManager; - - private static final String SOURCE_LANG_KEY = "source_lang"; - private static final String TARGET_LANG_KEY = "target_lang"; - - public static final String WORDS = "words"; - public static final String SENTENCES = "sentences"; - - private static final int NUM_ALT_TRANSLATIONS = 10; - - private SharedPreferences mSharedPref; - - private Language getPrefLang(String key, int def) { - int index = mSharedPref.getInt(key, def); - if (index < 0 || index >= mLanguages.length) - index = def; - return mLanguages[index]; - } - - private void setPrefLang(String key, Language def) { - for (int index = 0; index < mLanguages.length; index++) { - if (def == mLanguages[index]) { - SharedPreferences.Editor editor = mSharedPref.edit(); - editor.putInt(key, index); - editor.commit(); - break; - } - } - } - - public Translator(Context context) { - mContext = context; - - mSharedPref = context.getSharedPreferences( - context.getString(R.string.global_preferences_key), Context.MODE_PRIVATE); - - mGrammarLoader = new GrammarLoader(); - mGrammarLoader.start(); - - Language prefSourceLang = getPrefLang(SOURCE_LANG_KEY, 0); - Language prefTargetLang = getPrefLang(TARGET_LANG_KEY, 1); - - mSourceLoader = new ConcrLoader(prefSourceLang); - mSourceLoader.start(); - - if (prefSourceLang == prefTargetLang) { - mTargetLoader = mSourceLoader; - } else { - mTargetLoader = new ConcrLoader(prefTargetLang); - mTargetLoader.start(); - } - - mOtherLoader = null; - - mSGManager = new SemanticGraphManager(context); - } - - public List<Language> getAvailableLanguages() { - return Arrays.asList(mLanguages); - } - - public Language getSourceLanguage() { - return mSourceLoader.getLanguage(); - } - - public void setSourceLanguage(Language language) { - setPrefLang(SOURCE_LANG_KEY, language); - - if (mSourceLoader.getLanguage() == language) - return; - if (mTargetLoader.getLanguage() == language) { - cacheOrUnloadLanguage(mSourceLoader); - mSourceLoader = mTargetLoader; - return; - } - if (mOtherLoader != null && - mOtherLoader.getLanguage() == language) { - ConcrLoader tmp = mSourceLoader; - mSourceLoader = mOtherLoader; - mOtherLoader = tmp; - return; - } - - try { - mSourceLoader.join(); - } catch (InterruptedException e) { - Log.e(TAG, "Loading interrupted", e); - } - - if (mSourceLoader.getLanguage() != mTargetLoader.getLanguage()) { - cacheOrUnloadLanguage(mSourceLoader); - } - - mSourceLoader = new ConcrLoader(language); - mSourceLoader.start(); - } - - public boolean isSourceLanguageLoaded() { - try { - mSourceLoader.join(); - return true; - } catch (InterruptedException e) { - Log.e(TAG, "Loading interrupted", e); - } - return false; - } - - private Concr getSourceConcr() { - try { - mSourceLoader.join(); - } catch (InterruptedException e) { - Log.e(TAG, "Loading interrupted", e); - } - return mSourceLoader.getConcr(); - } - - public Language getTargetLanguage() { - return mTargetLoader.getLanguage(); - } - - public void setTargetLanguage(Language language) { - setPrefLang(TARGET_LANG_KEY, language); - - if (mTargetLoader.getLanguage() == language) - return; - if (mSourceLoader.getLanguage() == language) { - cacheOrUnloadLanguage(mTargetLoader); - mTargetLoader = mSourceLoader; - return; - } - if (mOtherLoader != null && - mOtherLoader.getLanguage() == language) { - ConcrLoader tmp = mTargetLoader; - mTargetLoader = mOtherLoader; - mOtherLoader = tmp; - return; - } - - try { - mTargetLoader.join(); - } catch (InterruptedException e) { - Log.e(TAG, "Loading interrupted", e); - } - - if (mSourceLoader.getLanguage() != mTargetLoader.getLanguage()) { - cacheOrUnloadLanguage(mTargetLoader); - } - - mTargetLoader = new ConcrLoader(language); - mTargetLoader.start(); - } - - public boolean isTargetLanguageLoaded() { - try { - mTargetLoader.join(); - return true; - } catch (InterruptedException e) { - Log.e(TAG, "Loading interrupted", e); - } - return false; - } - - private Concr getTargetConcr() { - try { - mTargetLoader.join(); - } catch (InterruptedException e) { - Log.e(TAG, "Loading interrupted", e); - } - return mTargetLoader.getConcr(); - } - - private void cacheOrUnloadLanguage(ConcrLoader loader) { - if (mOtherLoader != null) { - mOtherLoader.getConcr().unload(); - Log.d(TAG, mOtherLoader.getLanguage().getConcrete() + ".pgf_c unloaded"); - } - mOtherLoader = loader; - } - - public void switchLanguages() { - ConcrLoader tmp = mSourceLoader; - mSourceLoader = mTargetLoader; - mTargetLoader = tmp; - } - - private static String explode(String in) { - String out = ""; - for (int i = 0; i < in.length(); i++) { - if (i > 0) - out += ' '; - out += in.charAt(i); - } - return out; - } - - private static String implode(String s) { - return s.replaceAll("(?<!^[%*+])\\s",""); - } - - private String translateWord(String input) { - - String output = input.toUpperCase() ; // if all else fails, return the word itself in upper case ///in brackets - Concr sourceLang = getSourceConcr() ; - Concr targetLang = getTargetConcr() ; - - String lowerinput = input.toLowerCase() ; // also consider lower-cased versions of the word - - try { - Iterator<ExprProb> iter = sourceLang.parse("Chunk", input).iterator(); // try parse as chunk - Expr expr = iter.next().getExpr(); - output = targetLang.linearize(expr); - return output ; - } catch (ParseError e) { // if this fails - List<MorphoAnalysis> morphos = lookupMorpho(input) ; // lookup morphological analyses - - morphos.addAll(lookupMorpho(lowerinput)) ; // including the analyses of the lower-cased word - - for (MorphoAnalysis ana : morphos) { - if (targetLang.hasLinearization(ana.getLemma())) { // check that the word has linearization in target - output = targetLang.linearize(Expr.readExpr(ana.getLemma())) ; - break ; // if yes, don't search any more - } - } - return output ; - } - } - - private String translateByLookup(String input) { - String[] words = input.split(" ") ; - - String output = "%" ; - for (String w : words) { - output = output + " " + translateWord(w) ; - } - - return output ; - } - - // lowercase the first word if (1) it is not in the lexicon and (2) its lowercase version is in the lexicon - // otherwise it will be left uppercase and treated as a name - private String lowercaseIfBetter(String input) { - String[] words = input.split(" ") ; - - String firstword = words[0] ; - - String lowerfirstword = firstword.toLowerCase() ; - - if (lookupMorpho(firstword).isEmpty() && !(lookupMorpho(lowerfirstword).isEmpty())) { - words[0] = lowerfirstword ; - String output = "" ; - for (String w : words) { - output = output + " " + w ; - } - return output ; - } else { - return input ; - } - - } - - /** - * Takes a lot of time. Must not be called on the main thread. - */ - public Pair<String, List<ExprProb>> translate(String input) { - if (getSourceLanguage().getLangCode().equals("cmn-Hans-CN")) { - // for Chinese we need to put space after every character - input = explode(input); - } else { - input = lowercaseIfBetter(input); - } ; - - String output = null; - List<ExprProb> exprs = new ArrayList<ExprProb>(); - - try { - Concr sourceLang = getSourceConcr(); - Concr targetLang = getTargetConcr(); - - Map<String,LiteralCallback> callbacks = new HashMap<String,LiteralCallback>(); - callbacks.put("PN", new NercLiteralCallback(mGrammarLoader.getGrammar(), sourceLang, input)); - callbacks.put("Symb", new UnknownLiteralCallback(sourceLang, input)); - - int count = NUM_ALT_TRANSLATIONS; - for (ExprProb ep : sourceLang.parseWithHeuristics(getGrammar().getStartCat(), input, -1, callbacks)) { - if (count-- <= 0) - break; - exprs.add(ep); - if (output == null) - output = targetLang.linearize(ep.getExpr()); - } - } catch (ParseError e) { - output = translateByLookup(input); - } - - if (output == null) - output = "% "; // make sure that we return something - - if (getTargetLanguage().getLangCode().equals("cmn-Hans-CN") || - getTargetLanguage().getLangCode().equals("ja-JP") || - getTargetLanguage().getLangCode().equals("th-TH")) - output = implode(output) ; - - return new Pair<String,List<ExprProb>>(output, exprs); - } - - public String linearize(Expr expr) { - Concr targetLang = getTargetConcr(); - String s = targetLang.linearize(expr); - if (s == null) - s = "% "; // make sure that we return something - - if (getTargetLanguage().getLangCode().equals("cmn-Hans-CN") || - getTargetLanguage().getLangCode().equals("ja-JP") || - getTargetLanguage().getLangCode().equals("th-TH")) - return implode(s); - else - return s; - } - - public String linearizeSource(Expr expr) { - Concr targetLang = getSourceConcr(); - String s = targetLang.linearize(expr); - if (s == null) - s = "% "; // make sure that we return something - - if (getSourceLanguage().getLangCode().equals("cmn-Hans-CN") || - getSourceLanguage().getLangCode().equals("ja-JP") || - getSourceLanguage().getLangCode().equals("th-TH")) - return implode(s); - else - return s; - } - - public Object[] bracketedLinearize(Expr expr) { - Concr targetLang = getTargetConcr(); - return targetLang.bracketedLinearize(expr); - } - - public String generateLexiconEntry(Expr lemma) { - Concr sourceLang = getSourceConcr(); - Concr targetLang = getTargetConcr(); - String fun = lemma.toString(); - String cat = getGrammar().getFunctionType(fun).getCategory(); - - Expr e2 = Expr.readExpr("MkTag (Inflection"+cat+" "+fun+")"); - - if (targetLang.hasLinearization("Inflection"+cat)) { - if (targetLang.hasLinearization(fun)) - return sourceLang.linearize(lemma) + " - " + targetLang.linearize(e2) + ". " + targetLang.linearize(lemma); - else - return sourceLang.linearize(lemma) + " " + targetLang.linearize(e2)+"."; - } else { - if (targetLang.hasLinearization(fun)) - return sourceLang.linearize(lemma) + " - " + targetLang.linearize(lemma); - else - return sourceLang.linearize(lemma); - } - } - - private static final Expr gloss_pred = Expr.readExpr("gloss"); - private static final Expr topic_pred = Expr.readExpr("topic"); - private static final Expr example_pred = Expr.readExpr("example"); - - public Expr getDefinition(Expr lemma, boolean withExample) { - Expr gloss = null; - Expr example = null; - Map<String,Uri.Builder> topics = new TreeMap<String,Uri.Builder>(); - - try { - TripleResult res = mSGManager.queryTriple(lemma, null, null); - while (res.hasNext()) { - if (res.getPredicate().equals(gloss_pred)) - gloss = res.getObject(); - else if (res.getPredicate().equals(topic_pred)) - updateWordsMap(res.getObject(), topics); - else if (res.getPredicate().equals(example_pred)) - example = res.getObject(); - } - res.close(); - } catch (IOException e) { - // nothing - } catch (SGError e) { - // nothing - } - - Expr topic = null; - if (topics.size() > 0) { - StringBuilder builder = new StringBuilder(); - builder.append('('); - buildWordsHtml(topics, builder); - builder.append(')'); - topic = new Expr(builder.toString()); - } - if (gloss == null) - return topic; - else { - if (topic == null) - topic = new Expr(""); - if (withExample && example != null) - return new Expr("MkDefinitionEx", topic, gloss, example); - else - return new Expr("MkDefinition", topic, gloss); - } - } - - private void updateWordsMap(Expr expr, Map<String,Uri.Builder> map) { - String word = getTargetConcr().linearize(expr); - - Uri.Builder builder = map.get(word); - if (builder == null) { - builder = new Uri.Builder(); - builder.scheme("gf-translator"); - builder.authority(WORDS); - builder.appendQueryParameter("source", word); - map.put(word,builder); - } - builder.appendQueryParameter("alternative", expr.toString()); - } - - private void buildWordsHtml(Map<String,Uri.Builder> map, StringBuilder sbuilder) { - boolean first = true; - for (Map.Entry<String,Uri.Builder> entry : map.entrySet()) { - if (first) - first = false; - else - sbuilder.append(", "); - - sbuilder.append("<a href=\""+entry.getValue().build()+"\">"+entry.getKey()+"</a>"); - } - } - - public List<Expr> getTopicWords(Expr lemma) { - TripleResult res = null; - List<Expr> words = new ArrayList<Expr>(); - try { - res = mSGManager.queryTriple(null, topic_pred, lemma); - while (res.hasNext()) { - words.add(res.getSubject()); - } - } catch (IOException e) { - // nothing - } catch (SGError e) { - // nothing - } finally { - if (res != null) - res.close(); - } - return words; - } - - private Expr getTopicWordsHtml(Expr lemma) { - StringBuilder sbuilder = new StringBuilder(); - TripleResult res = null; - try { - res = mSGManager.queryTriple(null, topic_pred, lemma); - Map<String,Uri.Builder> map = new TreeMap<String,Uri.Builder>(); - while (res.hasNext()) { - updateWordsMap(res.getSubject(), map); - } - - StringBuilder builder = new StringBuilder(); - buildWordsHtml(map, builder); - return new Expr(builder.toString()); - } catch (IOException e) { - // nothing - } catch (SGError e) { - // nothing - } finally { - if (res != null) - res.close(); - } - return null; - } - - public String getInflectionTable(Expr lemma) { - boolean withExample = - (getSourceLanguage().getLangCode().equals("en-US") || - getTargetLanguage().getLangCode().equals("en-US")); - Expr def = - getDefinition(lemma, withExample); - - String fun = lemma.toString(); - Concr targetLang = getTargetConcr(); - String cat = getGrammar().getFunctionType(fun).getCategory(); - - if (targetLang.hasLinearization(fun) && - targetLang.hasLinearization("Inflection"+cat)) { - if (def == null) - def = Expr.readExpr("NoDefinition"); - - Expr e = new Expr("MkDocument", - def, - new Expr("Inflection"+cat,lemma), - getTopicWordsHtml(lemma)); - String html = - "<html><head><meta charset=\"UTF-8\"/><style>a {color: #808080;}</style></head><body>" + - targetLang.linearize(e) + - "</body>"; - return html; - } else if (def != null) { - String html = - "<html><head><meta charset=\"UTF-8\"/><style>a {color: #808080;}</style></head><body>" + - targetLang.linearize(def) + - "</body>"; - return html; - } else { - return null; - } - } - - public List<Expr> getTopicsOf(Expr lemma) { - TripleResult res = null; - List<Expr> topics = new ArrayList<Expr>(); - try { - res = mSGManager.queryTriple(lemma, topic_pred, null); - while (res.hasNext()) { - topics.add(res.getObject()); - } - } catch (IOException e) { - // nothing - } catch (SGError e) { - // nothing - } finally { - if (res != null) - res.close(); - } - return topics; - } - - private static String escapeHtml(CharSequence text) { - StringBuilder out = new StringBuilder(); - - for (int i = 0; i < text.length(); i++) { - char c = text.charAt(i); - - if (c == '<') { - out.append("<"); - } else if (c == '>') { - out.append(">"); - } else if (c == '&') { - out.append("&"); - } else if (c == '"') { - out.append("""); - } else if (c > 0x7E || c < ' ') { - out.append("&#").append((int) c).append(";"); - } else if (c == ' ') { - while (i + 1 < text.length() && text.charAt(i + 1) == ' ') { - out.append(" "); - i++; - } - - out.append(' '); - } else { - out.append(c); - } - } - - return out.toString(); - } - - public List<MorphoAnalysis> lookupMorpho(String sentence) { - List<MorphoAnalysis> ans = getSourceConcr().lookupMorpho(sentence); - Collections.sort(ans, new Comparator<MorphoAnalysis>() { - public int compare(MorphoAnalysis a1, MorphoAnalysis a2) { - if (a1.getProb() > a2.getProb()) - return 1; - else if (a1.getProb() < a2.getProb()) - return -1; - else - return 0; - } - }); - return ans; - } - - public CompletionInfo[] lookupWordPrefix(String prefix) { - PriorityQueue<FullFormEntry> queue = - new PriorityQueue<FullFormEntry>(500, new Comparator<FullFormEntry>() { - @Override - public int compare(FullFormEntry lhs, FullFormEntry rhs) { - return Double.compare(lhs.getProb(), rhs.getProb()); - } - }); - for (FullFormEntry entry : getSourceConcr().lookupWordPrefix(prefix)) { - queue.add(entry); - if (queue.size() >= 1000) - break; - } - - CompletionInfo[] completions = new CompletionInfo[Math.min(queue.size(), 5)+1]; - completions[0] = new CompletionInfo(0, 0, prefix); - for (int i = 1; i < completions.length; i++) { - completions[i] = new CompletionInfo(i,i,queue.poll().getForm()); - } - - if (completions.length > 1) { - Arrays.sort(completions, 1, completions.length-1, new Comparator<CompletionInfo>() { - @Override - public int compare(CompletionInfo arg0, CompletionInfo arg1) { - return ((String) arg0.getText()).compareTo((String) arg1.getText()); - } - }); - } - - return completions; - } - - private PGF getGrammar() { - try { - mGrammarLoader.join(); - } catch (InterruptedException e) { - Log.e(TAG, "Loading interrupted", e); - } - return mGrammarLoader.getGrammar(); - } - - private class GrammarLoader extends Thread { - private PGF mPGF; - - public GrammarLoader() { - mPGF = null; - } - - public PGF getGrammar() { - return mPGF; - } - - public void run() { - InputStream in = null; - - try { - in = mContext.getAssets().open(mGrammar); - Log.d(TAG, "Trying to open " + mGrammar); - long t1 = System.currentTimeMillis(); - mPGF = PGF.readPGF(in); - long t2 = System.currentTimeMillis(); - Log.d(TAG, mGrammar + " loaded ("+(t2-t1)+" ms)"); - } catch (FileNotFoundException e) { - Log.e(TAG, "File not found", e); - } catch (IOException e) { - Log.e(TAG, "Error loading grammar", e); - } finally { - if (in != null) { - try { - in.close(); - } catch (IOException e) { - Log.e(TAG, "Error closing the stream", e); - } - } - } - } - } - - private class ConcrLoader extends Thread { - private Language mLanguage; - private Concr mConcr; - - public ConcrLoader(Language lang) { - this.mLanguage = lang; - this.mConcr = null; - } - - public Language getLanguage() { - return mLanguage; - } - - public Concr getConcr() { - return mConcr; - } - - public void run() { - try { - mGrammarLoader.join(); - } catch (InterruptedException e) { - Log.d(TAG, "interrupted", e); - } - - InputStream in = null; - - try { - String name = mLanguage.getConcrete()+".pgf_c"; - in = mContext.getAssets().open(name); - Log.d(TAG, "Trying to load " + name); - long t1 = System.currentTimeMillis(); - mConcr = mGrammarLoader.getGrammar().getLanguages().get(mLanguage.getConcrete()); - mConcr.load(in); - long t2 = System.currentTimeMillis(); - Log.d(TAG, name + " loaded ("+(t2-t1)+" ms)"); - } catch (FileNotFoundException e) { - Log.e(TAG, "File not found", e); - } catch (IOException e) { - Log.e(TAG, "Error loading concrete", e); - } finally { - if (in != null) { - try { - in.close(); - } catch (IOException e) { - Log.e(TAG, "Error closing the stream", e); - } - } - } - } - } - - public boolean isUpgraded(String key) { - int old_code = mSharedPref.getInt(key, 0); - - int new_code = 0; - try { - new_code = mContext.getPackageManager().getPackageInfo(mContext.getPackageName(), 0).versionCode; - } catch (NameNotFoundException e) { - // Huh? Really? - } - - SharedPreferences.Editor editor = mSharedPref.edit(); - editor.putInt(key, new_code); - editor.commit(); - - return (old_code != new_code); - } -} diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/TranslatorInputMethodService.java b/src/ui/android/src/org/grammaticalframework/ui/android/TranslatorInputMethodService.java deleted file mode 100644 index d621e2f69..000000000 --- a/src/ui/android/src/org/grammaticalframework/ui/android/TranslatorInputMethodService.java +++ /dev/null @@ -1,666 +0,0 @@ -package org.grammaticalframework.ui.android; - -import android.inputmethodservice.InputMethodService; -import android.text.InputType; -import android.text.method.MetaKeyKeyListener; -import android.view.KeyCharacterMap; -import android.view.KeyEvent; -import android.view.View; -import android.view.inputmethod.CompletionInfo; -import android.view.inputmethod.EditorInfo; -import android.view.inputmethod.InputConnection; - - -public class TranslatorInputMethodService extends InputMethodService - implements android.inputmethodservice.KeyboardView.OnKeyboardActionListener { - - private TranslatorKeyboardView mInputView; - private CompletionsView mCandidateView; - private CompletionInfo[] mCompletions; - - private StringBuilder mComposingText = new StringBuilder(); - private StringBuilder mComposingWord = new StringBuilder(); - private boolean mPredictionOn; - private boolean mCompletionOn; - private boolean mCapsLock; - private long mLastShiftTime; - private long mMetaState; - - private TranslatorKeyboard mSymbolsPage1Keyboard; - private TranslatorKeyboard mSymbolsPage2Keyboard; - private TranslatorKeyboard mLanguagePage1Keyboard; - private TranslatorKeyboard mLanguagePage2Keyboard; - - private TranslatorKeyboard mCurKeyboard; - - private int mActionId; - - private Translator mTranslator; - - @Override - public void onCreate() { - super.onCreate(); - - mTranslator = ((GFTranslator) getApplicationContext()).getTranslator(); - - mSymbolsPage1Keyboard = null; - mSymbolsPage2Keyboard = null; - mLanguagePage1Keyboard = null; - mLanguagePage2Keyboard = null; - } - - @Override - public View onCreateInputView() { - mInputView = (TranslatorKeyboardView) - getLayoutInflater().inflate(R.layout.input, null); - mInputView.setOnKeyboardActionListener(this); - mInputView.setKeyboard(mCurKeyboard); - return mInputView; - } - - @Override - public View onCreateCandidatesView() { - mCandidateView = new CompletionsView(this); - mCandidateView.setService(this); - return mCandidateView; - } - - private int mModeId; - private EditorInfo mAttribute; - private static TranslatorInputMethodService mInstance; - - static TranslatorInputMethodService getInstance() { - return mInstance; - } - - @Override - public void onStartInput(EditorInfo attribute, boolean restarting) { - super.onStartInput(attribute, restarting); - - // Reset our state. We want to do this even if restarting, because - // the underlying state of the text editor could have changed in any way. - mComposingText.setLength(0); - mComposingWord.setLength(0); - updateCandidates(); - - if (!restarting) { - // Clear shift states. - mMetaState = 0; - } - - mPredictionOn = false; - mCompletionOn = false; - mCompletions = null; - - int res1 = - mTranslator.getSourceLanguage().getKeyboardPage1Resource(); - int res2 = - mTranslator.getSourceLanguage().getKeyboardPage2Resource(); - mModeId = R.string.normalKeyboardMode; - if (attribute.extras != null && - !attribute.extras.getBoolean("show_language_toggle", true)) { - mModeId = R.string.internalKeyboardMode; - } - mAttribute = attribute; - mLanguagePage1Keyboard = new TranslatorKeyboard(this, res1, mModeId); - mLanguagePage2Keyboard = new TranslatorKeyboard(this, res2, mModeId); - mSymbolsPage1Keyboard = new TranslatorKeyboard(this, R.xml.symbols_page1, mModeId); - mSymbolsPage2Keyboard = new TranslatorKeyboard(this, R.xml.symbols_page2, mModeId); - - // We are now going to initialize our state based on the type of - // text being edited. - switch (attribute.inputType & InputType.TYPE_MASK_CLASS) { - case InputType.TYPE_CLASS_NUMBER: - case InputType.TYPE_CLASS_DATETIME: - // Numbers and dates default to the symbols keyboard, with - // no extra features. - mCurKeyboard = mSymbolsPage1Keyboard; - break; - - case InputType.TYPE_CLASS_PHONE: - // Phones will also default to the symbols keyboard, though - // often you will want to have a dedicated phone keyboard. - mCurKeyboard = mSymbolsPage1Keyboard; - break; - - case InputType.TYPE_CLASS_TEXT: - // This is general text editing. We will default to the - // normal alphabetic keyboard, and assume that we should - // be doing predictive text (showing candidates as the - // user types). - mCurKeyboard = mLanguagePage1Keyboard; - mPredictionOn = true; - - // We now look for a few special variations of text that will - // modify our behavior. - int variation = attribute.inputType & InputType.TYPE_MASK_VARIATION; - if (variation == InputType.TYPE_TEXT_VARIATION_PASSWORD || - variation == InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD || - variation == InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD) { - // Do not display predictions / what the user is typing - // when they are entering a password. - mPredictionOn = false; - } - - if (variation == InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS || - variation == InputType.TYPE_TEXT_VARIATION_URI || - variation == InputType.TYPE_TEXT_VARIATION_FILTER) { - // Our predictions are not useful for e-mail addresses - // or URIs. - mPredictionOn = false; - } - - if ((attribute.inputType & InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE) != 0) { - // If this is an auto-complete text view, then our predictions - // will not be shown and instead we will allow the editor - // to supply their own. We only show the editor's - // candidates when in full-screen mode, otherwise relying - // own it displaying its own UI. - mPredictionOn = false; - mCompletionOn = isFullscreenMode(); - } - - // We also want to look at the current state of the editor - // to decide whether our alphabetic keyboard should start out - // shifted. - updateShiftKeyState(attribute); - break; - - default: - // For all unknown input types, default to the alphabetic - // keyboard with no special features. - mCurKeyboard = mLanguagePage1Keyboard; - updateShiftKeyState(attribute); - } - - mActionId = attribute.imeOptions & (EditorInfo.IME_MASK_ACTION | EditorInfo.IME_FLAG_NO_ENTER_ACTION); - mLanguagePage1Keyboard.setImeOptions(getResources(), attribute.imeOptions); - mLanguagePage2Keyboard.setImeOptions(getResources(), attribute.imeOptions); - - mInstance = this; - } - - @Override - public void onFinishInput() { - super.onFinishInput(); - - // Clear current composing text and candidates. - mComposingText.setLength(0); - mComposingWord.setLength(0); - updateCandidates(); - - // We only hide the candidates window when finishing input on - // a particular editor, to avoid popping the underlying application - // up and down if the user is entering text into the bottom of - // its window. - setCandidatesViewShown(false); - - mCurKeyboard = mLanguagePage1Keyboard; - if (mInputView != null) { - mInputView.closing(); - } - - mInstance = null; - mAttribute = null; - } - - @Override - public void onStartInputView(EditorInfo attribute, boolean restarting) { - super.onStartInputView(attribute, restarting); - // Apply the selected keyboard to the input view. - mInputView.setKeyboard(mCurKeyboard); - mInputView.closing(); - } - - @Override - public void onUpdateSelection(int oldSelStart, int oldSelEnd, - int newSelStart, int newSelEnd, - int candidatesStart, int candidatesEnd) { - super.onUpdateSelection(oldSelStart, oldSelEnd, newSelStart, newSelEnd, - candidatesStart, candidatesEnd); - - // If the current selection in the text view changes, we should - // clear whatever candidate text we have. - if (mComposingText.length() + mComposingWord.length() > 0 && - (newSelStart != candidatesEnd || newSelEnd != candidatesEnd)) { - mComposingText.setLength(0); - mComposingWord.setLength(0); - updateCandidates(); - InputConnection ic = getCurrentInputConnection(); - if (ic != null) { - ic.finishComposingText(); - } - } - } - - @Override - public void onDisplayCompletions(CompletionInfo[] completions) { - if (mCompletionOn) { - mCompletions = completions; - if (completions == null) { - setSuggestions(null, false, false); - return; - } - - setSuggestions(completions, true, true); - } - } - - /** - * This translates incoming hard key events in to edit operations on an - * InputConnection. It is only needed when using the - * PROCESS_HARD_KEYS option. - */ - private boolean translateKeyDown(int keyCode, KeyEvent event) { - mMetaState = MetaKeyKeyListener.handleKeyDown(mMetaState, - keyCode, event); - int c = event.getUnicodeChar(MetaKeyKeyListener.getMetaState(mMetaState)); - mMetaState = MetaKeyKeyListener.adjustMetaAfterKeypress(mMetaState); - InputConnection ic = getCurrentInputConnection(); - if (c == 0 || ic == null) { - return false; - } - - if ((c & KeyCharacterMap.COMBINING_ACCENT) != 0) { - c = c & KeyCharacterMap.COMBINING_ACCENT_MASK; - } - - if (mComposingWord.length() > 0) { - char accent = mComposingWord.charAt(mComposingWord.length()-1); - int composed = KeyEvent.getDeadChar(accent, c); - - if (composed != 0) { - c = composed; - mComposingWord.setLength(mComposingWord.length()-1); - } - } - - onKey(c, null); - - return true; - } - - @Override - public boolean onKeyDown(int keyCode, KeyEvent event) { - switch (keyCode) { - case KeyEvent.KEYCODE_BACK: - // The InputMethodService already takes care of the back - // key for us, to dismiss the input method if it is shown. - // However, our keyboard could be showing a pop-up window - // that back should dismiss, so we first allow it to do that. - if (event.getRepeatCount() == 0 && mInputView != null) { - if (mInputView.handleBack()) { - return true; - } - } - break; - - case KeyEvent.KEYCODE_DEL: - // Special handling of the delete key: if we currently are - // composing text for the user, we want to modify that instead - // of let the application to the delete itself. - if (mComposingText.length() + mComposingWord.length() > 0) { - onKey(TranslatorKeyboard.KEYCODE_DELETE, null); - return true; - } - break; - - case KeyEvent.KEYCODE_ENTER: - // Let the underlying text editor always handle these. - return false; - - default: - if (mPredictionOn && translateKeyDown(keyCode, event)) { - return true; - } - } - - return super.onKeyDown(keyCode, event); - } - - /** - * Helper function to commit any text being composed in to the editor. - */ - private void commitTyped(InputConnection inputConnection) { - if (mComposingText.length() + mComposingWord.length() > 0) { - String s = getComposingString(); - inputConnection.commitText(s, s.length()); - mComposingText.setLength(0); - mComposingWord.setLength(0); - updateCandidates(); - } - } - - /** - * Helper to update the shift state of our keyboard based on the initial - * editor state. - */ - private void updateShiftKeyState(EditorInfo attr) { - if (attr != null && mInputView != null && - (mLanguagePage1Keyboard == mInputView.getKeyboard() || - mLanguagePage2Keyboard == mInputView.getKeyboard())) { - int caps = 0; - EditorInfo ei = getCurrentInputEditorInfo(); - if (ei != null && ei.inputType != InputType.TYPE_NULL) { - caps = getCurrentInputConnection().getCursorCapsMode(attr.inputType); - } - mInputView.setShifted(mCapsLock || caps != 0); - } - } - - /** - * Helper to send a key down / key up pair to the current editor. - */ - private void keyDownUp(int keyEventCode) { - getCurrentInputConnection().sendKeyEvent( - new KeyEvent(KeyEvent.ACTION_DOWN, keyEventCode)); - getCurrentInputConnection().sendKeyEvent( - new KeyEvent(KeyEvent.ACTION_UP, keyEventCode)); - } - - // Implementation of KeyboardViewListener - public void onKey(int primaryCode, int[] keyCodes) { - if (primaryCode == TranslatorKeyboard.KEYCODE_DELETE) { - handleBackspace(); - } else if (primaryCode == TranslatorKeyboard.KEYCODE_SHIFT) { - handleShift(); - } else if (primaryCode == TranslatorKeyboard.KEYCODE_SOURCE_LANGUAGE - && mInputView != null) { - mTranslator.switchLanguages(); - handleSwitchLanguages(); - } else if (primaryCode < TranslatorKeyboard.KEYCODE_SOURCE_LANGUAGE && - primaryCode > TranslatorKeyboard.KEYCODE_SOURCE_LANGUAGE-TranslatorKeyboard.MAX_LANGUAGE_KEYCODES) { - Language newSource = - mTranslator.getAvailableLanguages().get(TranslatorKeyboard.KEYCODE_SOURCE_LANGUAGE-primaryCode-1); - mTranslator.setSourceLanguage(newSource); - handleChangeSourceLanguage(newSource); - } else if (primaryCode == TranslatorKeyboard.KEYCODE_TARGET_LANGUAGE) { - String translation = mTranslator.translate(getComposingString()).first; - if (translation.startsWith("% ") || translation.startsWith("* ") || translation.startsWith("+ ")) - translation = translation.substring(2); - getCurrentInputConnection().commitText(translation, 1); - return; - } else if (primaryCode < TranslatorKeyboard.KEYCODE_TARGET_LANGUAGE && - primaryCode > TranslatorKeyboard.KEYCODE_TARGET_LANGUAGE-TranslatorKeyboard.MAX_LANGUAGE_KEYCODES) { - Language newTarget = - mTranslator.getAvailableLanguages().get(TranslatorKeyboard.KEYCODE_TARGET_LANGUAGE-primaryCode-1); - mTranslator.setTargetLanguage(newTarget); - handleChangeTargetLanguage(newTarget); - } else if (primaryCode == TranslatorKeyboard.KEYCODE_MODE_CHANGE && - mInputView != null) { - TranslatorKeyboard current = (TranslatorKeyboard) mInputView.getKeyboard(); - if (current == mSymbolsPage1Keyboard || current == mSymbolsPage2Keyboard) { - current = mLanguagePage1Keyboard; - } else { - current = mSymbolsPage1Keyboard; - } - mInputView.setKeyboard(current); - if (current == mSymbolsPage1Keyboard) { - current.setShifted(false); - } - } else if (primaryCode == TranslatorKeyboard.KEYCODE_PAGE_CHANGE && - mInputView != null) { - TranslatorKeyboard current = (TranslatorKeyboard) mInputView.getKeyboard(); - if (current == mLanguagePage1Keyboard) { - current = mLanguagePage2Keyboard; - } else { - current = mLanguagePage1Keyboard; - } - mInputView.setKeyboard(current); - } else if (primaryCode == 10) { - if ((mActionId & EditorInfo.IME_FLAG_NO_ENTER_ACTION) == 0) - getCurrentInputConnection().performEditorAction(mActionId & EditorInfo.IME_MASK_ACTION); - else - handleCharacter(primaryCode, keyCodes); - } else if (primaryCode == ' ') { - if (mComposingText.length() + mComposingWord.length() == 0) - getCurrentInputConnection().commitText(" ", 1); - else if (mComposingWord.length() > 0) { - mComposingText.append(mComposingWord); - mComposingText.append(' '); - mComposingWord.setLength(0); - getCurrentInputConnection().setComposingText(getComposingString(), 1); - } else { - mComposingText.append(' '); - getCurrentInputConnection().setComposingText(getComposingString(), 1); - } - } else { - handleCharacter(primaryCode, keyCodes); - } - } - - public void onText(CharSequence text) { - InputConnection ic = getCurrentInputConnection(); - if (ic == null) return; - ic.beginBatchEdit(); - if (mComposingText.length() > 0) { - commitTyped(ic); - } - ic.commitText(text, 0); - ic.endBatchEdit(); - updateShiftKeyState(getCurrentInputEditorInfo()); - } - - /** - * Update the list of available candidates from the current composing - * text. This will need to be filled in by however you are determining - * candidates. - */ - private void updateCandidates() { - if (!mCompletionOn) { - if (mComposingWord.length() > 1) { - mCompletions = - mTranslator.lookupWordPrefix(mComposingWord.toString()); - setSuggestions(mCompletions, true, true); - } else { - setSuggestions(null, false, false); - } - } - } - - public void setSuggestions(CompletionInfo[] completions, boolean isCompletions, - boolean typedWordValid) { - if (completions != null && completions.length > 0) { - setCandidatesViewShown(true); - } else if (isExtractViewShown()) { - setCandidatesViewShown(true); - } - if (mCandidateView != null) { - mCandidateView.setSuggestions(completions, isCompletions, typedWordValid); - } - } - - private void handleBackspace() { - int wordLength = mComposingWord.length(); - int textLength = mComposingText.length(); - if (wordLength > 1) { - mComposingWord.delete(wordLength - 1, wordLength); - getCurrentInputConnection().setComposingText(getComposingString(), 1); - if (mPredictionOn) - updateCandidates(); - } else if (wordLength > 0) { - mComposingWord.setLength(0); - getCurrentInputConnection().setComposingText(getComposingString(), 1); - updateCandidates(); - } else if (textLength > 0) { - if (mComposingText.charAt(textLength - 1) == ' ') { - mComposingText.delete(textLength - 1, textLength); - getCurrentInputConnection().setComposingText(getComposingString(), 1); - } else { - mComposingText.delete(textLength - 1, textLength); - textLength--; - int index = mComposingText.lastIndexOf(" "); - if (index == -1) { - mComposingWord.append(mComposingText.toString()); - mComposingText.setLength(0); - } else { - mComposingWord.append(mComposingText.substring(index+1, textLength)); - mComposingText.delete(index+1, textLength); - } - getCurrentInputConnection().setComposingText(getComposingString(), 1); - } - updateCandidates(); - } else { - keyDownUp(KeyEvent.KEYCODE_DEL); - } - updateShiftKeyState(getCurrentInputEditorInfo()); - } - - private void handleShift() { - if (mInputView == null) { - return; - } - - TranslatorKeyboard currentKeyboard = (TranslatorKeyboard) mInputView.getKeyboard(); - if (mLanguagePage1Keyboard == currentKeyboard || - mLanguagePage2Keyboard == currentKeyboard) { - // Alphabet keyboard - checkToggleCapsLock(); - mInputView.setShifted(mCapsLock || !mInputView.isShifted()); - } else if (currentKeyboard == mSymbolsPage1Keyboard) { - mSymbolsPage1Keyboard.setShifted(true); - mInputView.setKeyboard(mSymbolsPage2Keyboard); - mSymbolsPage2Keyboard.setShifted(true); - } else if (currentKeyboard == mSymbolsPage2Keyboard) { - mSymbolsPage2Keyboard.setShifted(false); - mInputView.setKeyboard(mSymbolsPage1Keyboard); - mSymbolsPage1Keyboard.setShifted(false); - } - } - - private String getComposingString() { - return mComposingText.toString() + mComposingWord.toString(); - } - - private void handleCharacter(int primaryCode, int[] keyCodes) { - if (keyCodes.length > 0 && keyCodes[0] > 0) { - for (int i = 0; i < keyCodes.length && keyCodes[i] > 0; i++) { - int code = keyCodes[i]; - if (mInputView.isShifted()) - code = Character.toUpperCase(code); - mComposingWord.append((char) code); - } - } else { - if (mInputView.isShifted()) - primaryCode = Character.toUpperCase(primaryCode); - mComposingWord.append((char) primaryCode); - } - - if (primaryCode == 10) - commitTyped(getCurrentInputConnection()); - else - getCurrentInputConnection().setComposingText(getComposingString(), 1); - updateShiftKeyState(getCurrentInputEditorInfo()); - - if (mPredictionOn) { - updateCandidates(); - } - } - - private void handleClose() { - commitTyped(getCurrentInputConnection()); - requestHideSelf(0); - mInputView.closing(); - } - - void handleChangeSourceLanguage(Language newSource) { - updateLanguageKeyboard(newSource); - mSymbolsPage1Keyboard.updateLanguageKeyLabels(); - mSymbolsPage2Keyboard.updateLanguageKeyLabels(); - if (mInputView != null) { - mInputView.setKeyboard(mCurKeyboard); - } - } - - void handleChangeTargetLanguage(Language newTarget) { - mLanguagePage1Keyboard.updateLanguageKeyLabels(); - mLanguagePage2Keyboard.updateLanguageKeyLabels(); - mSymbolsPage1Keyboard.updateLanguageKeyLabels(); - mSymbolsPage2Keyboard.updateLanguageKeyLabels(); - if (mInputView != null) { - mInputView.invalidateAllKeys(); - } - } - - void handleSwitchLanguages() { - Language newSource = mTranslator.getSourceLanguage(); - updateLanguageKeyboard(newSource); - mSymbolsPage1Keyboard.updateLanguageKeyLabels(); - mSymbolsPage2Keyboard.updateLanguageKeyLabels(); - if (mInputView != null) - mInputView.setKeyboard(mCurKeyboard); - } - - private void updateLanguageKeyboard(Language language) { - TranslatorKeyboard keyboard1 = - new TranslatorKeyboard(this, language.getKeyboardPage1Resource(), mModeId); - TranslatorKeyboard keyboard2 = - new TranslatorKeyboard(this, language.getKeyboardPage2Resource(), mModeId); - keyboard1.setImeOptions(getResources(), mAttribute.imeOptions); - keyboard2.setImeOptions(getResources(), mAttribute.imeOptions); - if (mCurKeyboard == mLanguagePage1Keyboard) { - mCurKeyboard = keyboard1; - } else if (mCurKeyboard == mLanguagePage2Keyboard) { - mCurKeyboard = keyboard2; - } - mLanguagePage1Keyboard = keyboard1; - mLanguagePage2Keyboard = keyboard2; - } - - private void checkToggleCapsLock() { - long now = System.currentTimeMillis(); - if (mLastShiftTime + 800 > now) { - mCapsLock = !mCapsLock; - mLastShiftTime = 0; - } else { - mLastShiftTime = now; - } - } - - public void pickDefaultCandidate() { - pickSuggestionManually(0); - } - - public void pickSuggestionManually(int index) { - if (mCompletions != null && - index >= 0 && index < mCompletions.length) { - CompletionInfo ci = mCompletions[index]; - - if (mCompletionOn) - getCurrentInputConnection().commitCompletion(ci); - else { - mComposingWord.setLength(0); - mComposingWord.append(ci.getText()); - getCurrentInputConnection().setComposingText(getComposingString(), 1); - } - - if (mCandidateView != null) { - mCandidateView.clear(); - } - updateShiftKeyState(getCurrentInputEditorInfo()); - } - } - - public void swipeRight() { - if (mCompletionOn) { - pickDefaultCandidate(); - } - } - - public void swipeLeft() { - handleBackspace(); - } - - public void swipeDown() { - handleClose(); - } - - public void swipeUp() { - } - - public void onPress(int primaryCode) { - } - - public void onRelease(int primaryCode) { - } -} diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/TranslatorKeyboard.java b/src/ui/android/src/org/grammaticalframework/ui/android/TranslatorKeyboard.java deleted file mode 100644 index 876f660da..000000000 --- a/src/ui/android/src/org/grammaticalframework/ui/android/TranslatorKeyboard.java +++ /dev/null @@ -1,107 +0,0 @@ -package org.grammaticalframework.ui.android; - -import java.util.Locale; - -import android.content.Context; -import android.content.res.Resources; -import android.content.res.XmlResourceParser; -import android.view.inputmethod.EditorInfo; -import android.inputmethodservice.Keyboard; - -public class TranslatorKeyboard extends Keyboard { - - private Key mEnterKey; - private Key mSourceLanguageKey; - private Key mTargetLanguageKey; - - static final int KEYCODE_PAGE_CHANGE = -10; - static final int KEYCODE_SOURCE_LANGUAGE = -100; - static final int KEYCODE_TARGET_LANGUAGE = -200; - static final int MAX_LANGUAGE_KEYCODES = 99; - - private Translator mTranslator; - - public TranslatorKeyboard(Context context, int xmlLayoutResId, int modeId) { - super(context, xmlLayoutResId, modeId); - - mTranslator = ((GFTranslator) context.getApplicationContext()).getTranslator(); - updateLanguageKeyLabels(); - } - - public void updateLanguageKeyLabels() { - if (mSourceLanguageKey != null) - mSourceLanguageKey.label = getLanguageKeyLabel(mTranslator.getSourceLanguage()); - - if (mTargetLanguageKey != null) - mTargetLanguageKey.label = getLanguageKeyLabel(mTranslator.getTargetLanguage()); - } - - public static String getLanguageKeyLabel(Language lang) { - if ("cmn-hans-cn".equalsIgnoreCase(lang.getLangCode())) // this one has no ISO code - return "chi"; - else - return - LocaleUtils.parseJavaLocale(lang.getLangCode(), Locale.getDefault()) - .getISO3Language(); - } - - @Override - protected Key createKeyFromXml(Resources res, Row parent, int x, int y, - XmlResourceParser parser) { - Key key = new Key(res, parent, x, y, parser); - if (key.codes[0] == 10) { - mEnterKey = key; - } else if (key.codes[0] == KEYCODE_SOURCE_LANGUAGE) { - mSourceLanguageKey = key; - } else if (key.codes[0] == KEYCODE_TARGET_LANGUAGE) { - mTargetLanguageKey = key; - } - return key; - } - - /** - * This looks at the ime options given by the current editor, to set the - * appropriate label on the keyboard's enter key (if it has one). - */ - void setImeOptions(Resources res, int options) { - if (mEnterKey == null) { - return; - } - - switch (options&(EditorInfo.IME_MASK_ACTION|EditorInfo.IME_FLAG_NO_ENTER_ACTION)) { - case EditorInfo.IME_ACTION_DONE: - mEnterKey.iconPreview = null; - mEnterKey.icon = null; - mEnterKey.label = res.getText(R.string.label_done_key); - break; - case EditorInfo.IME_ACTION_GO: - mEnterKey.iconPreview = null; - mEnterKey.icon = null; - mEnterKey.label = res.getText(R.string.label_go_key); - break; - case EditorInfo.IME_ACTION_NEXT: - mEnterKey.iconPreview = null; - mEnterKey.icon = null; - mEnterKey.label = res.getText(R.string.label_next_key); - break; - case EditorInfo.IME_ACTION_PREVIOUS: - mEnterKey.iconPreview = null; - mEnterKey.icon = null; - mEnterKey.label = res.getText(R.string.label_previous_key); - break; - case EditorInfo.IME_ACTION_SEARCH: - mEnterKey.icon = res.getDrawable(R.drawable.sym_keyboard_search); - mEnterKey.label = null; - break; - case EditorInfo.IME_ACTION_SEND: - mEnterKey.iconPreview = null; - mEnterKey.icon = null; - mEnterKey.label = res.getText(R.string.label_send_key); - break; - default: - mEnterKey.icon = res.getDrawable(R.drawable.sym_keyboard_return); - mEnterKey.label = null; - break; - } - } -}
\ No newline at end of file diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/TranslatorKeyboardView.java b/src/ui/android/src/org/grammaticalframework/ui/android/TranslatorKeyboardView.java deleted file mode 100644 index 0a42eca2d..000000000 --- a/src/ui/android/src/org/grammaticalframework/ui/android/TranslatorKeyboardView.java +++ /dev/null @@ -1,128 +0,0 @@ -package org.grammaticalframework.ui.android; - -import org.grammaticalframework.ui.android.TranslatorKeyboard; - -import android.content.Context; -import android.graphics.Point; -import android.inputmethodservice.Keyboard.Key; -import android.inputmethodservice.KeyboardView; -import android.util.AttributeSet; -import android.view.Display; -import android.view.Gravity; -import android.view.LayoutInflater; -import android.view.View; -import android.view.WindowManager; -import android.widget.Button; -import android.widget.PopupWindow; -import android.widget.TableLayout; -import android.widget.TableRow; - -public class TranslatorKeyboardView extends KeyboardView { - - private Translator mTranslator; - - public TranslatorKeyboardView(Context context, AttributeSet attrs) { - super(context, attrs); - mTranslator = ((GFTranslator) context.getApplicationContext()).getTranslator(); - } - - public TranslatorKeyboardView(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - mTranslator = ((GFTranslator) context.getApplicationContext()).getTranslator(); - } - - private PopupWindow mLanguagesPopup = null; - private Key mLanguagesKey = null; - - private void showLanguageOptions(Key popupKey) { - if (mLanguagesPopup == null) { - LayoutInflater inflater = (LayoutInflater) getContext().getSystemService( - Context.LAYOUT_INFLATER_SERVICE); - TableLayout popupContainer = (TableLayout) - inflater.inflate(R.layout.keyboard_languages_options, null); - - int index = 0; - TableRow row = null; - for (Language lang : mTranslator.getAvailableLanguages()) { - int col_index = index % 4; - if (col_index == 0) { - row = new TableRow(getContext()); - popupContainer.addView(row); - } - - Button item = new Button(getContext()); - item.setText(TranslatorKeyboard.getLanguageKeyLabel(lang)); - item.setTag(index); - item.setOnClickListener(this); - row.addView(item, col_index); - index++; - } - - WindowManager wm = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE); - Display display = wm.getDefaultDisplay(); - Point size = new Point(); - display.getSize(size); - - popupContainer.measure( - MeasureSpec.makeMeasureSpec(size.x, MeasureSpec.AT_MOST), - MeasureSpec.makeMeasureSpec(size.y, MeasureSpec.AT_MOST)); - - mLanguagesPopup = new PopupWindow(getContext()); - mLanguagesPopup.setWidth(popupContainer.getMeasuredWidth()); - mLanguagesPopup.setHeight(popupContainer.getMeasuredHeight()); - mLanguagesPopup.setContentView(popupContainer); - - int[] windowOffset = new int[2]; - getLocationInWindow(windowOffset); - int popupX = popupKey.x + popupKey.width - popupContainer.getMeasuredWidth(); - int popupY = popupKey.y - popupContainer.getMeasuredHeight(); - final int x = popupX + popupContainer.getPaddingRight() + windowOffset[0]; - final int y = popupY + popupContainer.getPaddingBottom() + windowOffset[1]; - mLanguagesPopup.showAtLocation(this, Gravity.NO_GRAVITY, x, y); - - View closeButton = popupContainer.findViewById(R.id.closeButton); - if (closeButton != null) closeButton.setOnClickListener(this); - } - - mLanguagesKey = popupKey; - } - - private void dismissLanguages() { - if (mLanguagesPopup != null) { - mLanguagesPopup.dismiss(); - mLanguagesPopup = null; - mLanguagesKey = null; - } - } - - @Override - public void onClick(View v) { - super.onClick(v); - - if (v.getTag() != null) { - if (mLanguagesKey.codes[0] == TranslatorKeyboard.KEYCODE_SOURCE_LANGUAGE || - mLanguagesKey.codes[0] == TranslatorKeyboard.KEYCODE_TARGET_LANGUAGE) { - int keyCode = mLanguagesKey.codes[0] - ((Integer) v.getTag()) - 1; - getOnKeyboardActionListener().onKey(keyCode, new int[] {keyCode}); - } - } - - dismissLanguages(); - } - - public void closing() { - super.closing(); - dismissLanguages(); - } - - @Override - protected boolean onLongPress(Key key) { - if (key.codes[0] == TranslatorKeyboard.KEYCODE_SOURCE_LANGUAGE || - key.codes[0] == TranslatorKeyboard.KEYCODE_TARGET_LANGUAGE) { - showLanguageOptions(key); - return true; - } else { - return super.onLongPress(key); - } - } -} diff --git a/src/ui/android/src/se/chalmers/phrasebook/backend/Model.java b/src/ui/android/src/se/chalmers/phrasebook/backend/Model.java deleted file mode 100644 index 8e4b07b21..000000000 --- a/src/ui/android/src/se/chalmers/phrasebook/backend/Model.java +++ /dev/null @@ -1,206 +0,0 @@ -package se.chalmers.phrasebook.backend; - -import org.w3c.dom.*; -import org.xml.sax.*; -import org.w3c.dom.ls.*; - -import java.io.*; -import java.util.*; -import javax.xml.parsers.*; - -import org.grammaticalframework.pgf.Expr; -import org.grammaticalframework.ui.android.R; -import org.grammaticalframework.ui.android.GFTranslator; -import se.chalmers.phrasebook.backend.syntax.*; - -public class Model { - private static Model model; - - private List<SyntaxTree> phrases; - private Map<String,List<SyntaxTree>> groups; - - private Model() { - try { - DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - InputStream is = GFTranslator.get().getAssets().open("phrases.xml"); - Document document = documentBuilder.parse(is); - parseSentencesData(document); - is.close(); - } catch (ParserConfigurationException e) { - e.printStackTrace(); - } catch (SAXException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - } - - public static Model getInstance() { - if (model == null) model = getSync(); - return model; - } - - private synchronized static Model getSync() { - if (model == null) model = new Model(); - return model; - } - - public List<SyntaxTree> getSentences() { - return phrases; - } - - public List<SyntaxTree> getGroup(String id) { - return groups.get(id); - } - - private void parseSentencesData(Document document) { - phrases = new ArrayList<SyntaxTree>(); - groups = new HashMap<String,List<SyntaxTree>>(); - Map<String,SyntaxNode> ids = new HashMap<String,SyntaxNode>(); - List<SyntaxNodeCall> calls = new ArrayList<SyntaxNodeCall>(); - - NodeList nodesList = document.getDocumentElement().getChildNodes(); - for (int i = 0; i < nodesList.getLength(); i++) { - Node node = nodesList.item(i); - - if (node != null && - node.getNodeType() == Node.ELEMENT_NODE && - node.getNodeName().equals("sentence")) { - NamedNodeMap attributes = node.getAttributes(); - - if (attributes == null) - continue; - - String desc = ""; - if (attributes.getNamedItem("desc") != null) { - desc = attributes.getNamedItem("desc").getNodeValue(); - } - - SyntaxNode[] nodes = constructSyntaxNodeList(node, ids, calls); - if (nodes.length > 0) - phrases.add(new SyntaxTree(desc, nodes[0])); - } else if (node != null && - node.getNodeType() == Node.ELEMENT_NODE && - node.getNodeName().equals("group")) { - - NamedNodeMap attributes = node.getAttributes(); - if (attributes == null) - continue; - - String id = null; - if (attributes.getNamedItem("id") != null) { - id = attributes.getNamedItem("id").getNodeValue(); - } - if (id == null) - continue; - - List<SyntaxTree> group_phrases = new ArrayList<SyntaxTree>(); - - NodeList nodesList2 = node.getChildNodes(); - for (int j = 0; j < nodesList2.getLength(); j++) { - node = nodesList2.item(j); - - if (node != null && - node.getNodeType() == Node.ELEMENT_NODE && - node.getNodeName().equals("sentence")) { - attributes = node.getAttributes(); - - if (attributes == null) - continue; - - String desc = ""; - if (attributes.getNamedItem("desc") != null) { - desc = attributes.getNamedItem("desc").getNodeValue(); - } - - SyntaxNode[] nodes = constructSyntaxNodeList(node, ids, calls); - if (nodes.length > 0) { - SyntaxTree tree = new SyntaxTree(desc, nodes[0]); - phrases.add(tree); - group_phrases.add(tree); - } - } - } - - groups.put(id, group_phrases); - } else if (node.getAttributes() != null && node.getAttributes().getNamedItem("id") != null) { - String id = node.getAttributes().getNamedItem("id").getNodeValue(); - SyntaxNode snode = constructSyntaxNode(node, ids, calls); - if (snode == null) { - throw new IllegalArgumentException(outerXml(node)); - } - ids.put(id,snode); - } - } - - for (SyntaxNodeCall call : calls) { - call.bind(ids); - } - } - - private SyntaxNode constructSyntaxNode(Node node, Map<String,SyntaxNode> ids, List<SyntaxNodeCall> calls) { - NamedNodeMap attributes = node.getAttributes(); - if (attributes == null) - return null; - - String desc = ""; - if (attributes.getNamedItem("desc") != null) { - desc = attributes.getNamedItem("desc").getNodeValue(); - } - - if (node.getNodeName().equals("function")) { - String function = attributes.getNamedItem("name").getNodeValue(); - SyntaxNode[] arguments = constructSyntaxNodeList(node, ids, calls); - return new SyntaxNodeFunction(desc, function, arguments); - } else if (node.getNodeName().equals("numeral")) { - return new SyntaxNodeNumeral(desc, 1, 100); - } else if (node.getNodeName().equals("option")) { - SyntaxNode[] options = constructSyntaxNodeList(node, ids, calls); - return new SyntaxNodeOption(desc, options); - } else if (node.getNodeName().equals("boolean")) { - SyntaxNode[] options = constructSyntaxNodeList(node, ids, calls); - return new SyntaxNodeBoolean(desc, options); - } else if (node.getNodeName().equals("call")) { - if (attributes.getNamedItem("ref") == null) - return null; - - String ref = attributes.getNamedItem("ref").getNodeValue(); - SyntaxNode[] arguments = constructSyntaxNodeList(node, ids, calls); - SyntaxNodeCall call = new SyntaxNodeCall(desc, ref, arguments); - calls.add(call); - return call; - } else if (node.getNodeName().equals("argument")) { - int d = 0; - if (attributes.getNamedItem("index") != null) - d = Integer.parseInt(attributes.getNamedItem("index").getNodeValue()); - return new SyntaxNodeArgument(desc, d); - } - - return null; - } - - private SyntaxNode[] constructSyntaxNodeList(Node root, Map<String,SyntaxNode> ids, List<SyntaxNodeCall> calls) { - NodeList nl = root.getChildNodes(); - - int index = 0; - SyntaxNode[] list = new SyntaxNode[nl.getLength()]; - for (int i = 0; i < nl.getLength(); i++) { - Node node = nl.item(i); - if (node != null && node.getNodeType() == Node.ELEMENT_NODE) { - list[index] = constructSyntaxNode(node, ids, calls); - if (list[index] == null) - throw new IllegalArgumentException(outerXml(node)); - index++; - } - } - return Arrays.copyOf(list, index); - } - - private String outerXml(Node node) { - DOMImplementationLS lsImpl = (DOMImplementationLS)node.getOwnerDocument().getImplementation().getFeature("LS", "3.0"); - LSSerializer lsSerializer = lsImpl.createLSSerializer(); - lsSerializer.getDomConfig().setParameter("xml-declaration", false); - return lsSerializer.writeToString(node); - } -} - diff --git a/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/ChoiceContext.java b/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/ChoiceContext.java deleted file mode 100644 index 3995ad063..000000000 --- a/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/ChoiceContext.java +++ /dev/null @@ -1,61 +0,0 @@ -package se.chalmers.phrasebook.backend.syntax; - -import java.util.*; - -public class ChoiceContext { - private int pos; - private List<SyntacticChoice> choices; - private List<SyntaxNode[]> stack; - - public ChoiceContext() { - this.pos = pos; - this.choices = new ArrayList<SyntacticChoice>(); - this.stack = new ArrayList<SyntaxNode[]>(); - } - - public void reset() { - pos = 0; - stack.clear(); - } - - public void trim() { - while (pos < choices.size()) - choices.remove(choices.size()-1); - } - - public int choose(SyntaxNode node) { - SyntacticChoice choice = null; - - if (pos < choices.size()) { - if (choices.get(pos).getNode().unlink() == node.unlink()) { - choice = choices.get(pos); - } else { - trim(); - } - } - - if (choice == null) { - choice = new SyntacticChoice(node); - choices.add(choice); - } - - pos++; - return choice.getChoice(); - } - - public void push(SyntaxNode[] args) { - stack.add(args); - } - - public SyntaxNode[] pop() { - return stack.remove(stack.size()-1); - } - - public SyntaxNode getArgument(int i) { - return stack.get(stack.size()-1)[i]; - } - - public List<SyntacticChoice> getChoices() { - return choices; - } -} diff --git a/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntacticChoice.java b/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntacticChoice.java deleted file mode 100644 index 709893504..000000000 --- a/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntacticChoice.java +++ /dev/null @@ -1,25 +0,0 @@ -package se.chalmers.phrasebook.backend.syntax; - -import java.io.*; - -public class SyntacticChoice implements Serializable { - private int choice; - private SyntaxNode node; - - public SyntacticChoice(SyntaxNode node) { - this.node = node; - this.choice = node.getDefaultChoice(); - } - - public SyntaxNode getNode() { - return node; - } - - public int getChoice() { - return choice; - } - - public void setChoice(int choice) { - this.choice = choice; - } -} diff --git a/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntaxNode.java b/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntaxNode.java deleted file mode 100644 index 5268e41d4..000000000 --- a/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntaxNode.java +++ /dev/null @@ -1,33 +0,0 @@ -package se.chalmers.phrasebook.backend.syntax; - -import java.io.Serializable; -import org.grammaticalframework.pgf.Expr; - -public class SyntaxNode implements Serializable { - private String desc; - - public SyntaxNode(String desc) { - this.desc = desc; - } - - public String getDesc() { - return desc; - } - - public String getAbstractSyntax(ChoiceContext context) { - return null; - } - - public int getDefaultChoice() { - return 0; - } - - public SyntaxNode unlink() { - return this; - } - - @Override - public String toString() { - return desc; - } -} diff --git a/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntaxNodeArgument.java b/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntaxNodeArgument.java deleted file mode 100644 index 12b13aa4b..000000000 --- a/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntaxNodeArgument.java +++ /dev/null @@ -1,15 +0,0 @@ -package se.chalmers.phrasebook.backend.syntax; - -public class SyntaxNodeArgument extends SyntaxNode { - private int index; - - public SyntaxNodeArgument(String desc, int index) { - super(desc); - this.index = index; - } - - @Override - public String getAbstractSyntax(ChoiceContext context) { - return context.getArgument(index).getAbstractSyntax(context); - } -} diff --git a/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntaxNodeBoolean.java b/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntaxNodeBoolean.java deleted file mode 100644 index da1e95e04..000000000 --- a/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntaxNodeBoolean.java +++ /dev/null @@ -1,7 +0,0 @@ -package se.chalmers.phrasebook.backend.syntax; - -public class SyntaxNodeBoolean extends SyntaxNodeOption { - public SyntaxNodeBoolean(String desc, SyntaxNode[] options) { - super(desc,options); - } -} diff --git a/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntaxNodeCall.java b/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntaxNodeCall.java deleted file mode 100644 index 199c818ae..000000000 --- a/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntaxNodeCall.java +++ /dev/null @@ -1,52 +0,0 @@ -package se.chalmers.phrasebook.backend.syntax; - -import java.util.*; - -public class SyntaxNodeCall extends SyntaxNode { - private String id; - private SyntaxNode ref; - private SyntaxNode[] arguments; - - public SyntaxNodeCall(String desc, String id, SyntaxNode[] arguments) { - super(desc); - this.id = id; - this.ref = null; - this.arguments = arguments; - } - - public String getDesc() { - String desc = super.getDesc(); - if (desc == null || desc.isEmpty()) - return ref.getDesc(); - return desc; - } - - @Override - public String getAbstractSyntax(ChoiceContext context) { - context.push(arguments); - String res = ref.getAbstractSyntax(context); - context.pop(); - return res; - } - - @Override - public SyntaxNode unlink() { - return ref.unlink(); - } - - public String getId() { - return id; - } - - public SyntaxNode getRef() { - return ref; - } - - public void bind(Map<String,SyntaxNode> ids) { - if (ref == null) { - ref = ids.get(id); - if (ref == null) - throw new IllegalArgumentException("Missing reference to "+id); - } - } -} diff --git a/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntaxNodeFunction.java b/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntaxNodeFunction.java deleted file mode 100644 index 2bc6e187d..000000000 --- a/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntaxNodeFunction.java +++ /dev/null @@ -1,39 +0,0 @@ -package se.chalmers.phrasebook.backend.syntax; - -import java.util.*; - -public class SyntaxNodeFunction extends SyntaxNode { - private String function; - private SyntaxNode[] arguments; - - public SyntaxNodeFunction(String desc, String function, SyntaxNode[] arguments) { - super(desc); - this.function = function; - this.arguments = arguments; - } - - public String getFunction() { - return function; - } - - public SyntaxNode[] getArguments() { - return arguments; - } - - @Override - public String getAbstractSyntax(ChoiceContext context) { - if (arguments == null || arguments.length == 0) - return function; - - StringBuilder builder = new StringBuilder(); - builder.append(function); - for (SyntaxNode argument : arguments) { - builder.append(' '); - builder.append('('); - builder.append(argument.getAbstractSyntax(context)); - builder.append(')'); - } - - return builder.toString(); - } -} diff --git a/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntaxNodeNumeral.java b/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntaxNodeNumeral.java deleted file mode 100644 index 11a6b4103..000000000 --- a/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntaxNodeNumeral.java +++ /dev/null @@ -1,84 +0,0 @@ -package se.chalmers.phrasebook.backend.syntax; - -public class SyntaxNodeNumeral extends SyntaxNode { - private int min; - private int max; - - public SyntaxNodeNumeral(String desc, int min, int max) { - super(desc); - this.min = min; - this.max = max; - } - - public String getAbstractSyntax(ChoiceContext context) { - return nbrToSyntax(context.choose(this)); - } - - @Override - public int getDefaultChoice() { - return 1; - } - - public int getMin() { - return min; - } - - public int getMax() { - return max; - } - - private String nbrToSyntax(int nbr) throws IllegalArgumentException { - String syntax = ""; - if(nbr < 1000000 && nbr > 0) { - if (nbr <=999) { - syntax = "(num (pot2as3 " + subs1000(nbr) + "))"; - } else if(nbr % 1000 == 0) { - syntax = "(num (pot3 " + subs1000(nbr/1000) + "))"; - } else if(nbr > 1000 && nbr%1000 != 0) { - syntax = "(num (pot3plus " + subs1000(nbr/1000) + " " + - subs1000(nbr%1000) + "))"; - } - } else { - throw new IllegalArgumentException("Input must be between 1 and 999999"); - } - return syntax; - } - - private String subs1000(int nbr) { - String syntax = ""; - if(nbr < 100) { - syntax = "(pot1as2 " + subs100(nbr) + ")"; - } else if(nbr % 100 == 0) { - syntax = "(pot2 " + subs10(nbr/100) + ")"; - } else if(nbr > 100 && nbr%100 != 0) { - syntax = "(pot2plus " + subs10(nbr/100) + " " + subs100(nbr%100) + ")"; - } - return syntax; - } - - private String subs100(int nbr) { - String syntax = ""; - if(nbr < 10) { - syntax = "(pot0as1 " + subs10(nbr) + ")"; - } else if(nbr == 10 || nbr == 11) { - syntax = "pot1" + nbr; - } else if(nbr >= 12 && nbr <= 19) { - syntax = "(pot1to19 n" + nbr%10 + ")"; - } else if(nbr >= 20 && nbr%10 == 0) { - syntax = "(pot1 n" + Integer.toString(nbr/10) + ")"; - } else if(nbr%10 != 0) { - syntax = "(pot1plus n" + nbr/10 + " " + subs10(nbr%10) + ")"; - } - return syntax; - } - - private String subs10(int nbr) { - String syntax = ""; - if (nbr == 1) { - syntax = "pot01"; - } else if (nbr >= 2 && nbr <= 9) { - syntax = "(pot0 n" + nbr + ")"; - } - return syntax; - } -} diff --git a/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntaxNodeOption.java b/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntaxNodeOption.java deleted file mode 100644 index d7dc4ca83..000000000 --- a/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntaxNodeOption.java +++ /dev/null @@ -1,22 +0,0 @@ -package se.chalmers.phrasebook.backend.syntax; - -import java.util.*; -import se.chalmers.phrasebook.backend.*; - -public class SyntaxNodeOption extends SyntaxNode { - private SyntaxNode[] options; - - public SyntaxNodeOption(String desc, SyntaxNode[] options) { - super(desc); - this.options = options; - } - - public SyntaxNode[] getOptions() { - return options; - } - - @Override - public String getAbstractSyntax(ChoiceContext context) { - return options[context.choose(this)].getAbstractSyntax(context); - } -} diff --git a/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntaxTree.java b/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntaxTree.java deleted file mode 100644 index 964f07d0b..000000000 --- a/src/ui/android/src/se/chalmers/phrasebook/backend/syntax/SyntaxTree.java +++ /dev/null @@ -1,33 +0,0 @@ -package se.chalmers.phrasebook.backend.syntax; - -import java.io.Serializable; -import org.grammaticalframework.pgf.Expr; - -public class SyntaxTree implements Serializable { - private String desc; - private SyntaxNode root; - - public SyntaxTree(String desc, SyntaxNode root) { - this.desc = desc; - this.root = root; - } - - public String getDesc() { - return desc; - } - - public SyntaxNode getRoot() { - return root; - } - - public Expr getAbstractSyntax(ChoiceContext choices) { - Expr expr = Expr.readExpr(root.getAbstractSyntax(choices)); - choices.trim(); - return expr; - } - - @Override - public String toString() { - return desc; - } -} diff --git a/src/ui/android/src/se/chalmers/phrasebook/gui/activities/NavigationActivity.java b/src/ui/android/src/se/chalmers/phrasebook/gui/activities/NavigationActivity.java deleted file mode 100644 index 1dc754380..000000000 --- a/src/ui/android/src/se/chalmers/phrasebook/gui/activities/NavigationActivity.java +++ /dev/null @@ -1,79 +0,0 @@ -package se.chalmers.phrasebook.gui.activities; - -import android.app.ActionBar; -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; -import android.graphics.Color; -import android.graphics.drawable.ColorDrawable; -import android.os.Bundle; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentActivity; -import android.support.v4.app.FragmentTransaction; -import android.support.v4.content.LocalBroadcastManager; -import android.support.v4.widget.DrawerLayout; - -import org.grammaticalframework.ui.android.R; -import se.chalmers.phrasebook.backend.Model; -import se.chalmers.phrasebook.backend.syntax.*; -import se.chalmers.phrasebook.gui.fragments.PhraseListFragment; -import se.chalmers.phrasebook.gui.fragments.TranslatorFragment; - -public class NavigationActivity extends FragmentActivity { - - /** - * Used to store the last screen title. For use in {@link #restoreActionBar()}. - */ - private CharSequence mTitle; - private Fragment mContent; - - private Model mModel; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_navigation); - - mModel = Model.getInstance(); - mTitle = getTitle(); - - FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); - transaction.replace(R.id.container, PhraseListFragment.newInstance("Phrasebook")); - transaction.commit(); - } - - public void switchContent(Fragment fragment, String message) { - mContent = fragment; - - FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); - transaction.replace(R.id.container, fragment); - transaction.addToBackStack(message); - transaction.commit(); - } - - public void restoreActionBar() { - ActionBar actionBar = getActionBar(); - actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); - actionBar.setDisplayShowTitleEnabled(true); - actionBar.setTitle(mTitle); - } - - @Override - public void onBackPressed() { - if (getSupportFragmentManager().getBackStackEntryCount() > 1) { - getSupportFragmentManager().popBackStack(); - getSupportFragmentManager().beginTransaction().commit(); - //Switches to the previous entry on the stack to ensure - //that mContent is preserved - mContent = getSupportFragmentManager().getFragments() - .get(getSupportFragmentManager().getFragments().size() - 2); - } else { - super.onBackPressed(); - } - } - - public void setToTranslationFragment(SyntaxTree phrase) { - switchContent(TranslatorFragment.newInstance(phrase), ""); - } -} diff --git a/src/ui/android/src/se/chalmers/phrasebook/gui/fragments/PhraseListFragment.java b/src/ui/android/src/se/chalmers/phrasebook/gui/fragments/PhraseListFragment.java deleted file mode 100644 index 7e3c09ada..000000000 --- a/src/ui/android/src/se/chalmers/phrasebook/gui/fragments/PhraseListFragment.java +++ /dev/null @@ -1,86 +0,0 @@ -package se.chalmers.phrasebook.gui.fragments; - -import android.os.Bundle; - -import java.util.*; - -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import android.support.v4.app.Fragment; -import android.support.v4.content.LocalBroadcastManager; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.AdapterView; -import android.widget.ArrayAdapter; -import android.widget.ListView; - -import java.util.ArrayList; - -import org.grammaticalframework.ui.android.R; -import se.chalmers.phrasebook.backend.Model; -import se.chalmers.phrasebook.backend.syntax.SyntaxTree; -import se.chalmers.phrasebook.gui.activities.NavigationActivity; - - -/** - * Created by Björn on 2016-04-25. - */ -public class PhraseListFragment extends Fragment { - - protected Model model; - private String title; - private String id; - - public static PhraseListFragment newInstance(String title) { - PhraseListFragment fragment = new PhraseListFragment(); - Bundle args = new Bundle(); - args.putString("title", title); - fragment.setArguments(args); - return fragment; - } - - public static PhraseListFragment newInstance(String title, String id) { - PhraseListFragment fragment = new PhraseListFragment(); - Bundle args = new Bundle(); - args.putString("title", title); - args.putString("id", id); - fragment.setArguments(args); - return fragment; - } - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - model = Model.getInstance(); - title = getArguments().getString("title"); - id = getArguments().getString("id"); - } - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - - View view = inflater.inflate(R.layout.fragment_phrase_list, container, false); - getActivity().getActionBar().setTitle(title); - - final List<SyntaxTree> sentences = (id == null) ? model.getSentences() : model.getGroup(id); - ArrayAdapter<SyntaxTree> adapter = new ArrayAdapter<SyntaxTree>(getActivity(), R.layout.phrase_list_item, sentences); - - final ListView phraseListView = (ListView) view.findViewById(R.id.phrase_listView); - phraseListView.setAdapter(adapter); - - phraseListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { - @Override - public void onItemClick(AdapterView<?> parent, View view, int position, long item_id) { - SyntaxTree phrase = sentences.get(position); - getActivity().getActionBar().setTitle(phrase.getDesc()); - ((NavigationActivity) getActivity()).setToTranslationFragment(phrase); - } - }); - - return view; - } -} diff --git a/src/ui/android/src/se/chalmers/phrasebook/gui/fragments/TranslatorFragment.java b/src/ui/android/src/se/chalmers/phrasebook/gui/fragments/TranslatorFragment.java deleted file mode 100644 index cb5d50841..000000000 --- a/src/ui/android/src/se/chalmers/phrasebook/gui/fragments/TranslatorFragment.java +++ /dev/null @@ -1,253 +0,0 @@ -package se.chalmers.phrasebook.gui.fragments; - -import java.util.*; - -import android.os.Bundle; -import android.content.Context; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentTransaction; -import android.view.*; -import android.widget.*; -import android.text.Editable; -import android.text.TextWatcher; -import android.text.method.PasswordTransformationMethod; - -import org.grammaticalframework.pgf.Expr; -import org.grammaticalframework.ui.android.Translator; -import org.grammaticalframework.ui.android.GFTranslator; -import org.grammaticalframework.ui.android.TTS; -import org.grammaticalframework.ui.android.R; -import se.chalmers.phrasebook.backend.*; -import se.chalmers.phrasebook.backend.syntax.*; - -/** - * Created by matilda on 04/04/16. - */ -public class TranslatorFragment extends Fragment { - protected Model model; - Translator mTranslator; - private TTS mTts; - - private TextView origin,target; - private ListView list; - SyntaxTree phrase; - - ChoiceContext mContext; - ArrayAdapter<SyntacticChoice> mAdapter; - - public static TranslatorFragment newInstance(SyntaxTree phrase) { - TranslatorFragment translatorFragment = new TranslatorFragment(); - Bundle args = new Bundle(); - args.putSerializable("phrase", phrase); - translatorFragment.setArguments(args); - return translatorFragment; - } - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - phrase = (SyntaxTree) getArguments().getSerializable("phrase"); - model = Model.getInstance(); - mTranslator = ((GFTranslator) getContext().getApplicationContext()).getTranslator(); - mTts = new TTS(getActivity()); - mContext = new ChoiceContext(); - - - mAdapter = - new ArrayAdapter<SyntacticChoice>(getActivity(), R.layout.spinner_input_list_item, mContext.getChoices()) { - LayoutInflater inflater = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - - @Override - public View getView (int position, View convertView, ViewGroup parent) { - SyntacticChoice choice = mContext.getChoices().get(position); - View view = null; - if (choice.getNode() instanceof SyntaxNodeBoolean) { - view = createCheckBoxInputView(inflater, choice, (SyntaxNodeBoolean) choice.getNode(), parent); - } else if (choice.getNode() instanceof SyntaxNodeOption) { - view = createSpinnerInputView(inflater, choice, (SyntaxNodeOption) choice.getNode(), parent); - } else if (choice.getNode() instanceof SyntaxNodeNumeral) { - view = createNumeralInputView(inflater, choice, (SyntaxNodeNumeral) choice.getNode(), parent); - } - return view; - } - }; - } - - @Override - public View onCreateView(final LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - View view = inflater.inflate(R.layout.fragment_translator, container, false); - origin = (TextView) view.findViewById(R.id.origin_phrase); - target = (TextView) view.findViewById(R.id.target_phrase); - list = (ListView) view.findViewById(R.id.input_holder); - list.setAdapter(mAdapter); - - ImageView button = (ImageView) view.findViewById(R.id.button3); - button.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - mTts.speak(mTranslator.getTargetLanguage().getLangCode(), (String) target.getText()); - } - }); - - updateSyntax(); - return view; - } - - private View createSpinnerInputView(LayoutInflater inflater, final SyntacticChoice choice, final SyntaxNodeOption options, ViewGroup parent) { - View view = inflater.inflate(R.layout.spinner_input_list_item, parent, false); - TextView viewLabel = (TextView) view.findViewById(R.id.text_view_spinner); - Spinner spinner = (Spinner) view.findViewById(R.id.choice_spinner); - - String label = options.getDesc(); - if (label == null || label.isEmpty()) { - viewLabel.setVisibility(View.GONE); - } else { - viewLabel.setText(label); - } - - final ArrayAdapter<SyntaxNode> adapter = new ArrayAdapter<SyntaxNode>(getActivity(), android.R.layout.simple_list_item_1,options.getOptions()); - adapter.setDropDownViewResource(android.R.layout.simple_list_item_1); - spinner.setAdapter(adapter); - - spinner.setSelection(choice.getChoice()); - spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { - - @Override - public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { - if (position != choice.getChoice()) { - choice.setChoice(position); - updateSyntax(); - } - } - - @Override - public void onNothingSelected(AdapterView<?> parent) { - } - }); - - return view; - } - - private class NumericKeyBoardTransformationMethod extends PasswordTransformationMethod { - @Override - public CharSequence getTransformation(CharSequence source, View view) { - return source; - } - } - - private View createNumeralInputView(LayoutInflater inflater, final SyntacticChoice choice, final SyntaxNodeNumeral numeral, ViewGroup parent) { - View view = inflater.inflate(R.layout.number_input_list_item, parent, false); - TextView viewLabel = (TextView) view.findViewById(R.id.textView_number); - final SeekBar seekBar = (SeekBar) view.findViewById(R.id.seekBar); - final EditText editNumber = (EditText) view.findViewById(R.id.editNumber); - - String label = choice.getNode().getDesc(); - if (label == null || label.isEmpty()) { - viewLabel.setVisibility(View.GONE); - } else { - viewLabel.setText(label); - } - - seekBar.setProgress(choice.getChoice()); - editNumber.setText(Integer.toString(choice.getChoice())); - - editNumber.setTransformationMethod(new NumericKeyBoardTransformationMethod()); - editNumber.requestFocus(); - seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { - @Override - public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { - editNumber.setText(Integer.toString(progress+1)); - } - - @Override - public void onStartTrackingTouch(SeekBar seekBar) { - - } - - @Override - public void onStopTrackingTouch(SeekBar seekBar) { - } - }); - - - editNumber.addTextChangedListener(new TextWatcher() { - @Override - public void beforeTextChanged(CharSequence s, int start, int count, int after) { - - } - - @Override - public void onTextChanged(CharSequence s, int start, int before, int count) { - - } - - @Override - public void afterTextChanged(Editable s) { - int number; - boolean update = false; - try { - if(editNumber.getText().toString().equals("")) { - number = numeral.getMin(); - } else { - number = Integer.parseInt(editNumber.getText().toString()); - if (number < numeral.getMin()) { - number = numeral.getMin(); - update = true; - } - if (number > numeral.getMax()) { - number = numeral.getMax(); - update = true; - } - editNumber.setInputType(0); - } - } catch (NumberFormatException e) { - number = choice.getChoice(); - update = true; - } - choice.setChoice(number); - if (update) - editNumber.setText(Integer.toString(number)); - seekBar.setProgress(number-numeral.getMin()); - updateSyntax(); - } - }); - - return view; - } - - private View createCheckBoxInputView(LayoutInflater inflater, final SyntacticChoice choice, final SyntaxNodeBoolean options, ViewGroup parent) { - View view = inflater.inflate(R.layout.checkbox_input_list_item, parent, false); - final CheckBox checkBox = (CheckBox) view.findViewById(R.id.choice_checkbox); - - String label = options.getDesc(); - if (label != null && !label.isEmpty()) { - checkBox.setText(label); - } - - checkBox.setChecked(choice.getChoice() == 1); - checkBox.setOnClickListener(new View.OnClickListener() { - - @Override - public void onClick(View view) { - int position = checkBox.isChecked() ? 1 : 0; - if (position != choice.getChoice()) { - choice.setChoice(position); - updateSyntax(); - } - } - }); - - return view; - } - - public void updateSyntax() { - mContext.reset(); - - Expr expr = phrase.getAbstractSyntax(mContext); - origin.setText(mTranslator.linearizeSource(expr)); - target.setText(mTranslator.linearize(expr)); - mAdapter.notifyDataSetChanged(); - } -} diff --git a/src/ui/android/topics.txt b/src/ui/android/topics.txt deleted file mode 100644 index 785d07ba4..000000000 --- a/src/ui/android/topics.txt +++ /dev/null @@ -1,951 +0,0 @@ -<afghanistan_PN,topic,country_N> -<albania_PN,topic,country_N> -<algeria_PN,topic,country_N> -<andorra_PN,topic,country_N> -<angola_PN,topic,country_N> -<anguilla_PN,topic,country_N> -<argentina_PN,topic,country_N> -<australia_PN,topic,country_N> -<austria_PN,topic,country_N> -<bahamas_PN,topic,country_N> -<bahrain_PN,topic,country_N> -<bangladesh_PN,topic,country_N> -<barbados_PN,topic,country_N> -<belgium_PN,topic,country_N> -<benin_PN,topic,country_N> -<bermuda_PN,topic,country_N> -<bhutan_PN,topic,country_N> -<bolivia_PN,topic,country_N> -<brazil_PN,topic,country_N> -<britain_PN,topic,country_N> -<brunei_PN,topic,country_N> -<bulgaria_PN,topic,country_N> -<burma_PN,topic,country_N> -<burundi_PN,topic,country_N> -<cambodia_PN,topic,country_N> -<cameroon_PN,topic,country_N> -<canada_PN,topic,country_N> -<chad_PN,topic,country_N> -<chile_PN,topic,country_N> -<china_PN,topic,country_N> -<colombia_PN,topic,country_N> -<congo_PN,topic,country_N> -<cuba_PN,topic,country_N> -<cyprus_PN,topic,country_N> -<denmark_PN,topic,country_N> -<djibouti_PN,topic,country_N> -<ecuador_PN,topic,country_N> -<egypt_PN,topic,country_N> -<el_salvador_PN,topic,country_N> -<eritrea_PN,topic,country_N> -<ethiopia_PN,topic,country_N> -<fiji_PN,topic,country_N> -<finland_PN,topic,country_N> -<france_PN,topic,country_N> -<gabon_PN,topic,country_N> -<gambia_PN,topic,country_N> -<georgia_PN,topic,country_N> -<germany_PN,topic,country_N> -<ghana_PN,topic,country_N> -<gibraltar_PN,topic,country_N> -<greece_PN,topic,country_N> -<grenada_PN,topic,country_N> -<guatemala_PN,topic,country_N> -<guinea_PN,topic,country_N> -<guyana_PN,topic,country_N> -<haiti_PN,topic,country_N> -<honduras_PN,topic,country_N> -<iceland_PN,topic,country_N> -<india_PN,topic,country_N> -<indonesia_PN,topic,country_N> -<iran_PN,topic,country_N> -<iraq_PN,topic,country_N> -<ireland_PN,topic,country_N> -<israel_PN,topic,country_N> -<italy_PN,topic,country_N> -<jamaica_PN,topic,country_N> -<japan_PN,topic,country_N> -<jordan_PN,topic,country_N> -<kenya_PN,topic,country_N> -<kuwait_PN,topic,country_N> -<lebanon_PN,topic,country_N> -<liberia_PN,topic,country_N> -<libya_PN,topic,country_N> -<malawi_PN,topic,country_N> -<malaysia_PN,topic,country_N> -<mali_PN,topic,country_N> -<malta_PN,topic,country_N> -<mauritania_PN,topic,country_N> -<mauritius_PN,topic,country_N> -<mexico_PN,topic,country_N> -<mongolia_PN,topic,country_N> -<montserrat_PN,topic,country_N> -<morocco_PN,topic,country_N> -<mozambique_PN,topic,country_N> -<namibia_PN,topic,country_N> -<nauru_PN,topic,country_N> -<nepal_PN,topic,country_N> -<nicaragua_PN,topic,country_N> -<niger_PN,topic,country_N> -<nigeria_PN,topic,country_N> -<norway_PN,topic,country_N> -<oman_PN,topic,country_N> -<pakistan_PN,topic,country_N> -<palestine_PN,topic,country_N> -<panama_PN,topic,country_N> -<paraguay_PN,topic,country_N> -<peru_PN,topic,country_N> -<philippines_PN,topic,country_N> -<poland_PN,topic,country_N> -<portugal_PN,topic,country_N> -<qatar_PN,topic,country_N> -<romania_PN,topic,country_N> -<russia_PN,topic,country_N> -<rwanda_PN,topic,country_N> -<samoa_PN,topic,country_N> -<senegal_PN,topic,country_N> -<seychelles_PN,topic,country_N> -<singapore_PN,topic,country_N> -<somalia_PN,topic,country_N> -<spain_PN,topic,country_N> -<sudan_PN,topic,country_N> -<swaziland_PN,topic,country_N> -<sweden_PN,topic,country_N> -<switzerland_PN,topic,country_N> -<syria_PN,topic,country_N> -<taiwan_PN,topic,country_N> -<tanzania_PN,topic,country_N> -<thailand_PN,topic,country_N> -<togo_PN,topic,country_N> -<tonga_PN,topic,country_N> -<tunisia_PN,topic,country_N> -<turkey_PN,topic,country_N> -<uganda_PN,topic,country_N> -<uruguay_PN,topic,country_N> -<venezuela_PN,topic,country_N> -<vietnam_PN,topic,country_N> -<yemen_PN,topic,country_N> -<zambia_PN,topic,country_N> -<zimbabwe_PN,topic,country_N> -<europe_PN,topic,continent_N> -<africa_PN,topic,continent_N> -<mercury_PN,topic,planet_N> -<venus_PN,topic,planet_N> -<mars_PN,topic,planet_N> -<earth_N,topic,planet_N> -<jupiter_PN,topic,planet_N> -<saturn_PN,topic,planet_N> -<uranus_PN,topic,planet_N> -<neptune_PN,topic,planet_N> -<pluto_PN,topic,planet_N> -<albania_PN,continent,europe_PN> -<andorra_PN,continent,europe_PN> -<austria_PN,continent,europe_PN> -<belgium_PN,continent,europe_PN> -<britain_PN,continent,europe_PN> -<bulgaria_PN,continent,europe_PN> -<denmark_PN,continent,europe_PN> -<finland_PN,continent,europe_PN> -<france_PN,continent,europe_PN> -<germany_PN,continent,europe_PN> -<gibraltar_PN,continent,europe_PN> -<greece_PN,continent,europe_PN> -<ireland_PN,continent,europe_PN> -<italy_PN,continent,europe_PN> -<malta_PN,continent,europe_PN> -<norway_PN,continent,europe_PN> -<poland_PN,continent,europe_PN> -<portugal_PN,continent,europe_PN> -<romania_PN,continent,europe_PN> -<russia_PN,continent,europe_PN> -<spain_PN,continent,europe_PN> -<sweden_PN,continent,europe_PN> -<switzerland_PN,continent,europe_PN> -<turkey_PN,continent,europe_PN> -<afghanistan_PN,countryAdjective,afghan_A> -<albania_PN,countryAdjective,albanian_A> -<algeria_PN,countryAdjective,algerian_A> -<andorra_PN,countryAdjective,andorran_A> -<angola_PN,countryAdjective,angolan_A> -<anguilla_PN,countryAdjective,anguillan_A> -<argentina_PN,countryAdjective,argentine_PN> -<australia_PN,countryAdjective,australian_A> -<austria_PN,countryAdjective,austrian_A> -<bahamas_PN,countryAdjective,bahamian_A> -<bahrain_PN,countryAdjective,bahraini_A> -<bangladesh_PN,countryAdjective,bangladeshi_A> -<barbados_PN,countryAdjective,barbadian_A> -<belgium_PN,countryAdjective,belgian_A> -<benin_PN,countryAdjective,beninese_A> -<bermuda_PN,countryAdjective,bermudan_A> -<bhutan_PN,countryAdjective,bhutani_A> -<bolivia_PN,countryAdjective,bolivian_A> -<brazil_PN,countryAdjective,brazilian_A> -<britain_PN,countryAdjective,british_A> -<brunei_PN,countryAdjective,bruneian_A> -<bulgaria_PN,countryAdjective,bulgarian_A> -<burma_PN,countryAdjective,burmese_A> -<burundi_PN,countryAdjective,burundian_A> -<cambodia_PN,countryAdjective,cambodian_A> -<cameroon_PN,countryAdjective,cameroonian_A> -<canada_PN,countryAdjective,canadian_A> -<chad_PN,countryAdjective,chadian_A> -<chile_PN,countryAdjective,chilean_A> -<china_PN,countryAdjective,chinese_A> -<colombia_PN,countryAdjective,colombian_A> -<congo_PN,countryAdjective,congolese_A> -<cuba_PN,countryAdjective,cuban_A> -<cyprus_PN,countryAdjective,cypriot_A> -<denmark_PN,countryAdjective,danish_A> -<djibouti_PN,countryAdjective,djiboutian_A> -<ecuador_PN,countryAdjective,ecuadorian_A> -<egypt_PN,countryAdjective,egyptian_A> -<el_salvador_PN,countryAdjective,salvadorean_A> -<england_PN,countryAdjective,english_A> -<eritrea_PN,countryAdjective,eritrean_A> -<ethiopia_PN,countryAdjective,ethiopian_A> -<europe_PN,countryAdjective,european_A> -<fiji_PN,countryAdjective,fijian_A> -<finland_PN,countryAdjective,finnish_A> -<france_PN,countryAdjective,french_A> -<gabon_PN,countryAdjective,gabonese_A> -<gambia_PN,countryAdjective,gambian_A> -<georgia_PN,countryAdjective,georgian_A> -<germany_PN,countryAdjective,german_A> -<ghana_PN,countryAdjective,ghanaian_A> -<gibraltar_PN,countryAdjective,gibraltarian_A> -<greece_PN,countryAdjective,greek_A> -<grenada_PN,countryAdjective,grenadian_A> -<guatemala_PN,countryAdjective,guatemalan_A> -<guinea_PN,countryAdjective,guinean_A> -<guyana_PN,countryAdjective,guyanese_A> -<haiti_PN,countryAdjective,haitian_A> -<honduras_PN,countryAdjective,honduran_A> -<iceland_PN,countryAdjective,icelandic_A> -<india_PN,countryAdjective,indian_A> -<indonesia_PN,countryAdjective,indonesian_A> -<iran_PN,countryAdjective,iranian_A> -<iraq_PN,countryAdjective,iraqi_A> -<ireland_PN,countryAdjective,irish_A> -<israel_PN,countryAdjective,israeli_A> -<italy_PN,countryAdjective,italian_A> -<jamaica_PN,countryAdjective,jamaican_A> -<japan_PN,countryAdjective,japanese_A> -<jordan_PN,countryAdjective,jordanian_A> -<kenya_PN,countryAdjective,kenyan_A> -<kuwait_PN,countryAdjective,kuwaiti_A> -<lebanon_PN,countryAdjective,lebanese_A> -<liberia_PN,countryAdjective,liberian_A> -<libya_PN,countryAdjective,libyan_A> -<malawi_PN,countryAdjective,malawian_A> -<malaysia_PN,countryAdjective,malaysian_A> -<mali_PN,countryAdjective,malian_A> -<malta_PN,countryAdjective,maltese_A> -<mauritania_PN,countryAdjective,mauritanian_A> -<mauritius_PN,countryAdjective,mauritian_A> -<mexico_PN,countryAdjective,mexican_A> -<mongolia_PN,countryAdjective,mongolian_A> -<montserrat_PN,countryAdjective,montserratian_A> -<morocco_PN,countryAdjective,moroccan_A> -<mozambique_PN,countryAdjective,mozambican_A> -<namibia_PN,countryAdjective,namibian_A> -<nauru_PN,countryAdjective,nauruan_A> -<nepal_PN,countryAdjective,nepalese_A> -<nicaragua_PN,countryAdjective,nicaraguan_A> -<niger_PN,countryAdjective,nigerien_A> -<nigeria_PN,countryAdjective,nigerian_A> -<norway_PN,countryAdjective,norwegian_A> -<oman_PN,countryAdjective,omani_A> -<pakistan_PN,countryAdjective,pakistani_A> -<palestine_PN,countryAdjective,palestinian_A> -<panama_PN,countryAdjective,panamanian_A> -<paraguay_PN,countryAdjective,paraguayan_A> -<peru_PN,countryAdjective,peruvian_A> -<philippines_PN,countryAdjective,philippine_A> -<poland_PN,countryAdjective,polish_A> -<portugal_PN,countryAdjective,portuguese_A> -<qatar_PN,countryAdjective,qatari_A> -<romania_PN,countryAdjective,romanian_A> -<russia_PN,countryAdjective,russian_A> -<rwanda_PN,countryAdjective,rwandan_A> -<samoa_PN,countryAdjective,samoan_A> -<scotland_PN,countryAdjective,scottish_A> -<senegal_PN,countryAdjective,senegalese_A> -<seychelles_PN,countryAdjective,seychellois_A> -<singapore_PN,countryAdjective,singaporean_A> -<somalia_PN,countryAdjective,somali_A> -<spain_PN,countryAdjective,spanish_A> -<sudan_PN,countryAdjective,sudanese_A> -<swaziland_PN,countryAdjective,swazi_A> -<sweden_PN,countryAdjective,swedish_A> -<switzerland_PN,countryAdjective,swiss_A> -<syria_PN,countryAdjective,syrian_A> -<taiwan_PN,countryAdjective,taiwanese_A> -<tanzania_PN,countryAdjective,tanzanian_A> -<thailand_PN,countryAdjective,thai_A> -<togo_PN,countryAdjective,togolese_A> -<tonga_PN,countryAdjective,tongan_A> -<tunisia_PN,countryAdjective,tunisian_A> -<turkey_PN,countryAdjective,turkish_A> -<uganda_PN,countryAdjective,ugandan_A> -<uruguay_PN,countryAdjective,uruguayan_A> -<venezuela_PN,countryAdjective,venezuelan_A> -<vietnam_PN,countryAdjective,vietnamese_A> -<yemen_PN,countryAdjective,yemeni_A> -<zambia_PN,countryAdjective,zambian_A> -<zimbabwe_PN,countryAdjective,zimbabwean_A> -<afghani_N,topic,currency_N> -<dollar_N,topic,currency_N> -<euro_N,topic,currency_N> -<franc_N,topic,currency_N> -<lev_N,topic,currency_N> -<pound_2_N,topic,currency_N> -<rouble_N,topic,currency_N> -<rupee_N,topic,currency_N> -<leu_N,topic,currency_N> -<yuan_N,topic,currency_N> -<zloty_N,topic,currency_N> -<austral_N,topic,currency_N> -<baht_N,topic,currency_N> -<balboa_N,topic,currency_N> -<birr_N,topic,currency_N> -<bolivar_N,topic,currency_N> -<cedi_N,topic,currency_N> -<dalasi_N,topic,currency_N> -<dinar_N,topic,currency_N> -<dong_N,topic,currency_N> -<drachma_N,topic,currency_N> -<escudo_N,topic,currency_N> -<forint_N,topic,currency_N> -<krona_N,topic,currency_N> -<krone_N,topic,currency_N> -<gourde_N,topic,currency_N> -<gulden_N,topic,currency_N> -<inti_N,topic,currency_N> -<kip_2_N,topic,currency_N> -<kwacha_N,topic,currency_N> -<kwanza_N,topic,currency_N> -<kyat_N,topic,currency_N> -<lek_N,topic,currency_N> -<lempira_N,topic,currency_N> -<lilangeni_N,topic,currency_N> -<lira_N,topic,currency_N> -<loti_N,topic,currency_N> -<markka_N,topic,currency_N> -<metical_N,topic,currency_N> -<naira_N,topic,currency_N> -<ngultrum_N,topic,currency_N> -<ouguiya_N,topic,currency_N> -<paanga_N,topic,currency_N> -<pataca_N,topic,currency_N> -<peseta_N,topic,currency_N> -<boliviano_N,topic,currency_N> -<cordoba_N,topic,currency_N> -<peso_N,topic,currency_N> -<pula_N,topic,currency_N> -<quetzal_N,topic,currency_N> -<riel_N,topic,currency_N> -<ringgit_N,topic,currency_N> -<dram_N,topic,currency_N> -<manat_N,topic,currency_N> -<rubel_N,topic,currency_N> -<kroon_N,topic,currency_N> -<lari_N,topic,currency_N> -<tenge_N,topic,currency_N> -<lats_N,topic,currency_N> -<litas_N,topic,currency_N> -<som_N,topic,currency_N> -<ruble_N,topic,currency_N> -<hryvnia_N,topic,currency_N> -<rupiah_N,topic,currency_N> -<schilling_N,topic,currency_N> -<shekel_N,topic,currency_N> -<shilling_N,topic,currency_N> -<sucre_N,topic,currency_N> -<taka_N,topic,currency_N> -<tugrik_N,topic,currency_N> -<yen_N,topic,currency_N> -<zaire_N,topic,currency_N> -<real_2_N,topic,currency_N> -<austral_N,currencyUse,argentina_PN> -<baht_N,currencyUse,thailand_PN> -<satang_N,fractionCurrency,baht_N> -<balboa_N,currencyUse,panama_PN> -<birr_N,currencyUse,ethiopia_PN> -<bolivar_N,currencyUse,venezuela_PN> -<centimo_N,fractionCurrency,bolivar_N> -<cedi_N,currencyUse,ghana_PN> -<pesewa_N,fractionCurrency,cedi_N> -<dalasi_N,currencyUse,gambia_PN> -<butut_N,fractionCurrency,dalasi_N> -<dinar_N,currencyUse,algeria_PN> -<dinar_N,currencyUse,bahrain_PN> -<dinar_N,currencyUse,jordan_PN> -<dinar_N,currencyUse,kuwait_PN> -<dinar_N,currencyUse,libya_PN> -<dinar_N,currencyUse,tunisia_PN> -<dinar_N,currencyUse,morocco_PN> -<dong_N,currencyUse,vietnam_PN> -<hao_N,fractionCurrency,dong_N> -<drachma_N,currencyUse,greece_N> -<lepton_1_N,fractionCurrency,drachma_N> -<escudo_N,currencyUse,portugal_N> -<forint_N,currencyUse,hungary_N> -<filler_N,fractionCurrency,forint_N> -<dollar_N,currencyUse,australia_PN> -<dollar_N,currencyUse,bahamas_PN> -<dollar_N,currencyUse,barbados_PN> -<dollar_N,currencyUse,bermuda_PN> -<dollar_N,currencyUse,brunei_PN> -<dollar_N,currencyUse,canada_PN> -<dollar_N,currencyUse,fiji_PN> -<dollar_N,currencyUse,grenada_PN> -<dollar_N,currencyUse,guyana_PN> -<dollar_N,currencyUse,hong_kong_PN> -<dollar_N,currencyUse,jamaica_PN> -<dollar_N,currencyUse,liberia_PN> -<dollar_N,currencyUse,singapore_PN> -<dollar_N,currencyUse,taiwan_PN> -<dollar_N,currencyUse,trinidad_PN> -<dollar_N,currencyUse,us_PN> -<dollar_N,currencyUse,zimbabwe_PN> -<franc_N,currencyUse,belgium_PN> -<franc_N,currencyUse,benin_PN> -<franc_N,currencyUse,burundi_PN> -<franc_N,currencyUse,cameroon_PN> -<franc_N,currencyUse,chad_PN> -<franc_N,currencyUse,congo_PN> -<franc_N,currencyUse,djibouti_PN> -<franc_N,currencyUse,france_PN> -<franc_N,currencyUse,gabon_PN> -<franc_N,currencyUse,luxembourg_PN> -<franc_N,currencyUse,madagascar_PN> -<franc_N,currencyUse,mali_PN> -<franc_N,currencyUse,niger_PN> -<franc_N,currencyUse,rwanda_PN> -<franc_N,currencyUse,senegal_PN> -<franc_N,currencyUse,switzerland_PN> -<franc_N,currencyUse,togo_PN> -<franc_N,currencyUse,guinea_PN> -<lev_N,currencyUse,bulgaria_PN> -<stotinka_N,fractionCurrency,lev_N> -<krona_N,currencyUse,sweden_PN> -<krone_N,currencyUse,norway_PN> -<krone_N,currencyUse,danmark_PN> -<pound_2_N,currencyUse,britain_PN> -<rouble_N,currencyUse,russia_PN> -<rupee_N,currencyUse,india_PN> -<leu_N,currencyUse,romania_PN> -<yuan_N,currencyUse,china_PN> -<zloty_N,currencyUse,poland_PN> -<gourde_N,currencyUse,haiti_PN> -<guarani_N,currencyUse,paraguay_PN> -<centimo_N,fractionCurrency,guarani_N> -<gulden_N,currencyUse,netherland_PN> -<gulden_N,currencyUse,suriname_PN> -<inti_N,currencyUse,peru_PN> -<kip_2_N,currencyUse,laos_PN> -<at_N,fractionCurrency,kip_2_N> -<haler_N,fractionCurrency,koruna_N> -<krona_N,currencyUse,iceland_PN> -<kwacha_N,currencyUse,malawi_PN> -<tambala_N,fractionCurrency,kwacha_N> -<kwacha_N,currencyUse,zambia_PN> -<kwanza_N,currencyUse,angola_PN> -<lwei_N,fractionCurrency,kwanza_N> -<kyat_N,currencyUse,myanmar_PN> -<pya_N,fractionCurrency,kyat_N> -<lek_N,currencyUse,albania_PN> -<qindarka_N,fractionCurrency,lek_N> -<lempira_N,currencyUse,honduras_N> -<ban_N,fractionCurrency,leu_N> -<lilangeni_N,currencyUse,swaziland_PN> -<lira_N,currencyUse,italy_PN> -<lira_N,currencyUse,turkey_PN> -<loti_N,currencyUse,lesotho_PN> -<sente_N,fractionCurrency,lesotho_PN> -<markka_N,currencyUse,finland_PN> -<metical_N,currencyUse,mozambique_PN> -<naira_N,currencyUse,nigeria_PN> -<kobo_N,fractionCurrency,naira_N> -<ngultrum_N,currencyUse,bhutan_PN> -<chetrum_N,fractionCurrency,ngultrum_N> -<ouguiya_N,currencyUse,mauritania_PN> -<khoum_N,fractionCurrency,ouguiya_PN> -<paanga_N,currencyUse,tonga_PN> -<seniti_N,fractionCurrency,paanga_N> -<pataca_N,currencyUse,macao_N> -<avo_N,fractionCurrency,pataca_N> -<peseta_N,currencyUse,spain_PN> -<boliviano_N,currencyUse,bolivia_PN> -<cordoba_N,currencyUse,nicaragua_PN> -<peso_N,currencyUse,chile_PN> -<peso_N,currencyUse,colombia_PN> -<peso_N,currencyUse,cuba_PN> -<peso_N,currencyUse,mexico_PN> -<peso_N,currencyUse,philippines_PN> -<peso_N,currencyUse,uruguay_PN> -<pound_2_N,currencyUse,cyprus_PN> -<pound_2_N,currencyUse,egypt_PN> -<pound_2_N,currencyUse,ireland_PN> -<pound_2_N,currencyUse,lebanon_PN> -<lira_N,currencyUse,malta_PN> -<pound_2_N,currencyUse,sudan_PN> -<pound_2_N,currencyUse,syria_PN> -<pula_N,currencyUse,botswana_PN> -<thebe_N,fractionCurrency,pula_N> -<quetzal_N,currencyUse,guatemala_PN> -<dinar_N,currencyUse,iran_PN> -<riel_N,currencyUse,cambodia_PN> -<ringgit_N,currencyUse,malaysia_PN> -<kopek_N,fractionCurrency,ruble_N> -<dram_N,currencyUse,armenia_PN> -<manat_N,currencyUse,azerbaijan_PN> -<rubel_N,currencyUse,belarus_PN> -<kroon_N,currencyUse,estonia_PN> -<lari_N,currencyUse,georgia_PN> -<tenge_N,currencyUse,kazakhstan_PN> -<lats_N,currencyUse,latvia_PN> -<litas_N,currencyUse,lithuania_PN> -<som_N,currencyUse,kyrgyzstan_PN> -<leu_N,currencyUse,moldova_PN> -<ruble_N,currencyUse,tajikistan_PN> -<tanga_N,fractionCurrency,ruble_N> -<manat_N,currencyUse,turkmenistan_PN> -<hryvnia_N,currencyUse,ukraine_PN> -<som_N,currencyUse,uzbekistan_PN> -<rupee_N,currencyUse,pakistan_PN> -<rupee_N,currencyUse,mauritius_PN> -<rupee_N,currencyUse,nepal_PN> -<rupee_N,currencyUse,seychelles_PN> -<rupee_N,currencyUse,sri_lanka_PN> -<rupiah_N,currencyUse,indonesia_PN> -<schilling_N,currencyUse,austria_PN> -<shekel_N,currencyUse,israel_PN> -<shilling_N,currencyUse,kenya_PN> -<shilling_N,currencyUse,somalia_PN> -<shilling_N,currencyUse,tanzania_PN> -<shilling_N,currencyUse,uganda_PN> -<sucre_N,currencyUse,ecuador_PN> -<taka_N,currencyUse,bangladesh_PN> -<tugrik_N,currencyUse,mongolia_PN> -<yen_N,currencyUse,japan_PN> -<zaire_N,currencyUse,zaire_PN> -<real_2_N,currencyUse,brazil_PN> -<january_Month,topic,month_N> -<february_Month,topic,month_N> -<march_Month,topic,month_N> -<april_Month,topic,month_N> -<may_Month,topic,month_N> -<june_Month,topic,month_N> -<july_Month,topic,month_N> -<august_Month,topic,month_N> -<september_Month,topic,month_N> -<october_Month,topic,month_N> -<november_Month,topic,month_N> -<december_Month,topic,month_N> -<monday_Weekday,topic,PartNP (UseN day_N) (DetCN (DetQuant DefArt NumSg) (UseN week_N))> -<tuesday_Weekday,topic,PartNP (UseN day_N) (DetCN (DetQuant DefArt NumSg) (UseN week_N))> -<wednesday_Weekday,topic,PartNP (UseN day_N) (DetCN (DetQuant DefArt NumSg) (UseN week_N))> -<thursday_Weekday,topic,PartNP (UseN day_N) (DetCN (DetQuant DefArt NumSg) (UseN week_N))> -<friday_Weekday,topic,PartNP (UseN day_N) (DetCN (DetQuant DefArt NumSg) (UseN week_N))> -<saturday_Weekday,topic,PartNP (UseN day_N) (DetCN (DetQuant DefArt NumSg) (UseN week_N))> -<sunday_Weekday,topic,PartNP (UseN day_N) (DetCN (DetQuant DefArt NumSg) (UseN week_N))> -<summer_N,topic,season_N> -<autumn_N,topic,season_N> -<winter_N,topic,season_N> -<spring_1_N,topic,season_N> -<beer_N,topic,drink_N> -<ale_N,topic,drink_N> -<bread_N,topic,food_N> -<cheese_N,topic,food_N> -<chicken_N,topic,food_N> -<chicken_N,topic,animal_N> -<coffee_N,topic,drink_N> -<fish_N,topic,food_N> -<meat_N,topic,food_N> -<milk_N,topic,drink_N> -<pizza_N,topic,food_N> -<salt_N,topic,food_N> -<salt_N,topic,spice_N> -<tea_N,topic,drink_N> -<water_N,topic,drink_N> -<wine_N,topic,drink_N> -<i_Pron,topic,people_N> -<iFem_Pron,topic,people_N> -<youSg_Pron,topic,people_N> -<youSgFem_Pron,topic,people_N> -<youPol_Pron,topic,people_N> -<youPolFem_Pron,topic,people_N> -<he_Pron,topic,people_N> -<she_Pron,topic,people_N> -<we_Pron,topic,people_N> -<weFem_Pron,topic,people_N> -<youPl_Pron,topic,people_N> -<youPlFem_Pron,topic,people_N> -<they_Pron,topic,people_N> -<theyFem_Pron,topic,people_N> -<i_Pron,topic,pronoun_N> -<iFem_Pron,topic,pronoun_N> -<youSg_Pron,topic,pronoun_N> -<youSgFem_Pron,topic,pronoun_N> -<youPol_Pron,topic,pronoun_N> -<youPolFem_Pron,topic,pronoun_N> -<he_Pron,topic,pronoun_N> -<she_Pron,topic,pronoun_N> -<we_Pron,topic,pronoun_N> -<weFem_Pron,topic,pronoun_N> -<youPl_Pron,topic,pronoun_N> -<youPlFem_Pron,topic,pronoun_N> -<they_Pron,topic,pronoun_N> -<theyFem_Pron,topic,pronoun_N> -<wife_N,topic,people_N> -<husband_N,topic,people_N> -<daughter_N,topic,people_N> -<son_N,topic,people_N> -<child_N,topic,people_N> -<wife_N,topic,family_N> -<husband_N,topic,family_N> -<daughter_N,topic,family_N> -<son_N,topic,family_N> -<child_N,topic,family_N> -<afrikaans_Language,topic,language_N> -<amharic_Language,topic,language_N> -<arabic_Language,topic,language_N> -<bulgarian_Language,topic,language_N> -<catalan_Language,topic,language_N> -<chinese_Language,topic,language_N> -<danish_Language,topic,language_N> -<dutch_Language,topic,language_N> -<english_Language,topic,language_N> -<estonian_Language,topic,language_N> -<finnish_Language,topic,language_N> -<french_Language,topic,language_N> -<german_Language,topic,language_N> -<greek_Language,topic,language_N> -<hebrew_Language,topic,language_N> -<hindi_Language,topic,language_N> -<japanese_Language,topic,language_N> -<italian_Language,topic,language_N> -<latin_Language,topic,language_N> -<latvian_Language,topic,language_N> -<maltese_Language,topic,language_N> -<nepali_Language,topic,language_N> -<norwegian_Language,topic,language_N> -<persian_Language,topic,language_N> -<polish_Language,topic,language_N> -<punjabi_Language,topic,language_N> -<romanian_Language,topic,language_N> -<russian_Language,topic,language_N> -<sindhi_Language,topic,language_N> -<spanish_Language,topic,language_N> -<swahili_Language,topic,language_N> -<swedish_Language,topic,language_N> -<thai_Language,topic,language_N> -<turkish_Language,topic,language_N> -<urdu_Language,topic,language_N> -<airport_N,topic,place_N> -<bank_2_N,topic,place_N> -<bar_1_N,topic,place_N> -<cafeteria_N,topic,place_N> -<centre_N,topic,place_N> -<church_N,topic,place_N> -<cinema_N,topic,place_N> -<disco_2_N,topic,place_N> -<hospital_N,topic,place_N> -<hotel_N,topic,place_N> -<museum_N,topic,place_N> -<park_N,topic,place_N> -<pharmacy_2_N,topic,place_N> -<pub_N,topic,place_N> -<restaurant_N,topic,place_N> -<school_1_N,topic,place_N> -<shop_N,topic,place_N> -<station_2_N,topic,place_N> -<supermarket_N,topic,place_N> -<theatre_N,topic,place_N> -<toilet_N,topic,place_N> -<university_N,topic,place_N> -<zoo_N,topic,place_N> -<ackee_N,topic,fruit_N> -<anjou_N,topic,fruit_N> -<apple_N,topic,fruit_N> -<avocado_N,topic,fruit_N> -<bartlett_N,topic,fruit_N> -<berry_N,topic,fruit_N> -<blackberry_N,topic,fruit_N> -<bosc_N,topic,fruit_N> -<casaba_N,topic,fruit_N> -<citron_N,topic,fruit_N> -<citrus_N,topic,fruit_N> -<currant_N,topic,fruit_N> -<damson_N,topic,fruit_N> -<date_7_N,topic,fruit_N> -<genipap_N,topic,fruit_N> -<grape_N,topic,fruit_N> -<greengage_N,topic,fruit_N> -<honeydew_N,topic,fruit_N> -<lanseh_N,topic,fruit_N> -<lemon_N,topic,fruit_N> -<lychee_N,topic,fruit_N> -<melon_N,topic,fruit_N> -<orange_1_N,topic,fruit_N> -<pear_N,topic,fruit_N> -<pearmain_N,topic,fruit_N> -<pippin_N,topic,fruit_N> -<prune_N,topic,fruit_N> -<raisin_N,topic,fruit_N> -<ribier_N,topic,fruit_N> -<saskatoon_N,topic,fruit_N> -<scuppernong_N,topic,fruit_N> -<seckel_N,topic,fruit_N> -<sorb_N,topic,fruit_N> -<strawberry_N,topic,fruit_N> -<sultana_N,topic,fruit_N> -<peach_N,topic,fruit_N> -<raspberry_N,topic,fruit_N> -<mandarin_N,topic,fruit_N> -<banana_N,topic,fruit_N> -<crab_apple_N,topic,fruit_N> -<bilberry_N,topic,fruit_N> -<huckleberry_N,topic,fruit_N> -<blueberry_N,topic,fruit_N> -<wintergreen_N,topic,fruit_N> -<teaberry_N,topic,fruit_N> -<cranberry_N,topic,fruit_N> -<lingonberry_N,topic,fruit_N> -<cowberry_N,topic,fruit_N> -<gooseberry_N,topic,fruit_N> -<boysenberry_N,topic,fruit_N> -<dewberry_N,topic,fruit_N> -<loganberry_N,topic,fruit_N> -<sugarberry_N,topic,fruit_N> -<hackberry_N,topic,fruit_N> -<persimmon_N,topic,fruit_N> -<acerola_N,topic,fruit_N> -<mulberry_N,topic,fruit_N> -<carambola_N,topic,fruit_N> -<ceriman_N,topic,fruit_N> -<monstera_N,topic,fruit_N> -<clementine_N,topic,fruit_N> -<satsuma_N,topic,fruit_N> -<tangerine_N,topic,fruit_N> -<kumquat_N,topic,fruit_N> -<lime_2_N,topic,fruit_N> -<grapefruit_N,topic,fruit_N> -<pomelo_N,topic,fruit_N> -<shaddock_N,topic,fruit_N> -<citrange_N,topic,fruit_N> -<tangelo_N,topic,fruit_N> -<apricot_N,topic,fruit_N> -<nectarine_N,topic,fruit_N> -<pitahaya_N,topic,fruit_N> -<plum_N,topic,fruit_N> -<sloe_N,topic,fruit_N> -<fig_N,topic,fruit_N> -<pineapple_N,topic,fruit_N> -<granadilla_N,topic,fruit_N> -<breadfruit_N,topic,fruit_N> -<jackfruit_N,topic,fruit_N> -<canistel_N,topic,fruit_N> -<muskmelon_N,topic,fruit_N> -<cantaloupe_N,topic,fruit_N> -<watermelon_N,topic,fruit_N> -<cherry_N,topic,fruit_N> -<blackheart_N,topic,fruit_N> -<capulin_N,topic,fruit_N> -<amarelle_N,topic,fruit_N> -<morello_N,topic,fruit_N> -<muscadine_N,topic,fruit_N> -<emperor_N,topic,fruit_N> -<muscat_N,topic,fruit_N> -<muscatel_N,topic,fruit_N> -<cherimoya_N,topic,fruit_N> -<soursop_N,topic,fruit_N> -<sweetsop_N,topic,fruit_N> -<ilama_N,topic,fruit_N> -<papaw_N,topic,fruit_N> -<pawpaw_N,topic,fruit_N> -<papaya_N,topic,fruit_N> -<ketembilla_N,topic,fruit_N> -<durian_N,topic,fruit_N> -<feijoa_N,topic,fruit_N> -<genip_N,topic,fruit_N> -<kiwi_N,topic,fruit_N> -<loquat_N,topic,fruit_N> -<mangosteen_N,topic,fruit_N> -<mango_N,topic,fruit_N> -<sapodilla_N,topic,fruit_N> -<sapote_N,topic,fruit_N> -<tamarind_N,topic,fruit_N> -<elderberry_N,topic,fruit_N> -<guava_N,topic,fruit_N> -<mombin_N,topic,fruit_N> -<jaboticaba_N,topic,fruit_N> -<jujube_N,topic,fruit_N> -<longanberry_N,topic,fruit_N> -<mamey_N,topic,fruit_N> -<marang_N,topic,fruit_N> -<medlar_N,topic,fruit_N> -<plumcot_N,topic,fruit_N> -<pomegranate_N,topic,fruit_N> -<garambulla_N,topic,fruit_N> -<quandong_N,topic,fruit_N> -<quince_N,topic,fruit_N> -<rambutan_N,topic,fruit_N> -<pulasan_N,topic,fruit_N> -<ackee_N,topic,food_N> -<anjou_N,topic,food_N> -<apple_N,topic,food_N> -<avocado_N,topic,food_N> -<bartlett_N,topic,food_N> -<berry_N,topic,food_N> -<blackberry_N,topic,food_N> -<bosc_N,topic,food_N> -<casaba_N,topic,food_N> -<citron_N,topic,food_N> -<citrus_N,topic,food_N> -<currant_N,topic,food_N> -<damson_N,topic,food_N> -<date_7_N,topic,food_N> -<genipap_N,topic,food_N> -<grape_N,topic,food_N> -<greengage_N,topic,food_N> -<honeydew_N,topic,food_N> -<lanseh_N,topic,food_N> -<lemon_N,topic,food_N> -<lychee_N,topic,food_N> -<melon_N,topic,food_N> -<orange_1_N,topic,food_N> -<pear_N,topic,food_N> -<pearmain_N,topic,food_N> -<pippin_N,topic,food_N> -<prune_N,topic,food_N> -<raisin_N,topic,food_N> -<ribier_N,topic,food_N> -<saskatoon_N,topic,food_N> -<scuppernong_N,topic,food_N> -<seckel_N,topic,food_N> -<sorb_N,topic,food_N> -<strawberry_N,topic,food_N> -<sultana_N,topic,food_N> -<peach_N,topic,food_N> -<raspberry_N,topic,food_N> -<mandarin_N,topic,food_N> -<banana_N,topic,food_N> -<crab_apple_N,topic,food_N> -<bilberry_N,topic,food_N> -<huckleberry_N,topic,food_N> -<blueberry_N,topic,food_N> -<wintergreen_N,topic,food_N> -<teaberry_N,topic,food_N> -<cranberry_N,topic,food_N> -<lingonberry_N,topic,food_N> -<cowberry_N,topic,food_N> -<gooseberry_N,topic,food_N> -<boysenberry_N,topic,food_N> -<dewberry_N,topic,food_N> -<loganberry_N,topic,food_N> -<sugarberry_N,topic,food_N> -<hackberry_N,topic,food_N> -<persimmon_N,topic,food_N> -<acerola_N,topic,food_N> -<mulberry_N,topic,food_N> -<carambola_N,topic,food_N> -<ceriman_N,topic,food_N> -<monstera_N,topic,food_N> -<clementine_N,topic,food_N> -<satsuma_N,topic,food_N> -<tangerine_N,topic,food_N> -<kumquat_N,topic,food_N> -<lime_2_N,topic,food_N> -<grapefruit_N,topic,food_N> -<pomelo_N,topic,food_N> -<shaddock_N,topic,food_N> -<citrange_N,topic,food_N> -<tangelo_N,topic,food_N> -<apricot_N,topic,food_N> -<nectarine_N,topic,food_N> -<pitahaya_N,topic,food_N> -<plum_N,topic,food_N> -<sloe_N,topic,food_N> -<fig_N,topic,food_N> -<pineapple_N,topic,food_N> -<granadilla_N,topic,food_N> -<breadfruit_N,topic,food_N> -<jackfruit_N,topic,food_N> -<canistel_N,topic,food_N> -<muskmelon_N,topic,food_N> -<cantaloupe_N,topic,food_N> -<watermelon_N,topic,food_N> -<cherry_N,topic,food_N> -<blackheart_N,topic,food_N> -<capulin_N,topic,food_N> -<amarelle_N,topic,food_N> -<morello_N,topic,food_N> -<muscadine_N,topic,food_N> -<emperor_N,topic,food_N> -<muscat_N,topic,food_N> -<muscatel_N,topic,food_N> -<cherimoya_N,topic,food_N> -<soursop_N,topic,food_N> -<sweetsop_N,topic,food_N> -<ilama_N,topic,food_N> -<papaw_N,topic,food_N> -<pawpaw_N,topic,food_N> -<papaya_N,topic,food_N> -<ketembilla_N,topic,food_N> -<durian_N,topic,food_N> -<feijoa_N,topic,food_N> -<genip_N,topic,food_N> -<kiwi_N,topic,food_N> -<loquat_N,topic,food_N> -<mangosteen_N,topic,food_N> -<mango_N,topic,food_N> -<sapodilla_N,topic,food_N> -<sapote_N,topic,food_N> -<tamarind_N,topic,food_N> -<elderberry_N,topic,food_N> -<guava_N,topic,food_N> -<mombin_N,topic,food_N> -<jaboticaba_N,topic,food_N> -<jujube_N,topic,food_N> -<longanberry_N,topic,food_N> -<mamey_N,topic,food_N> -<marang_N,topic,food_N> -<medlar_N,topic,food_N> -<plumcot_N,topic,food_N> -<pomegranate_N,topic,food_N> -<garambulla_N,topic,food_N> -<quandong_N,topic,food_N> -<quince_N,topic,food_N> -<rambutan_N,topic,food_N> -<pulasan_N,topic,food_N> -<mandarin_N,topic,citrus_N> -<orange_1_N,topic,citrus_N> -<lemon_N,topic,citrus_N> -<citron_N,topic,citrus_N> -<pomelo_N,topic,citrus_N> -<clementine_N,topic,citrus_N> -<satsuma_N,topic,citrus_N> -<tangerine_N,topic,citrus_N> -<lime_2_N,topic,citrus_N> -<mandarin_N,topic,tropical_A> -<orange_1_N,topic,tropical_A> -<lemon_N,topic,tropical_A> -<citron_N,topic,tropical_A> -<banana_N,topic,tropical_A> -<avocado_N,topic,tropical_A> -<lychee_N,topic,tropical_A> -<ackee_N,topic,tropical_A> -<acerola_N,topic,tropical_A> -<guava_N,topic,tropical_A> -<canistel_N,topic,tropical_A> -<cherimoya_N,topic,tropical_A> -<damson_N,topic,tropical_A> -<granadilla_N,topic,tropical_A> -<hackberry_N,topic,tropical_A> -<huckleberry_N,topic,tropical_A> -<papaya_N,topic,tropical_A> -<pineapple_N,topic,tropical_A> -<pomelo_N,topic,tropical_A> diff --git a/src/ui/gwt/.classpath b/src/ui/gwt/.classpath deleted file mode 100644 index 781d7a2f8..000000000 --- a/src/ui/gwt/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
- <classpathentry kind="output" path="src"/>
-</classpath>
diff --git a/src/ui/gwt/.project b/src/ui/gwt/.project deleted file mode 100644 index dfd6dab3f..000000000 --- a/src/ui/gwt/.project +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>GF-GWT</name>
- <comment>GF-GWT project</comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>com.google.gwt.eclipse.core.gwtNature</nature>
- </natures>
-</projectDescription>
diff --git a/src/ui/gwt/Editor-compile b/src/ui/gwt/Editor-compile deleted file mode 100644 index 4106298ea..000000000 --- a/src/ui/gwt/Editor-compile +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -APPDIR=`dirname $0`; - -if [ -z "$GWT_CLASSPATH" ]; then - echo 'ERROR: $GWT_CLASSPATH is not set' - echo 'Set $GWT_CLASSPATH to point to the GWT JAR files. For example:' - echo 'export GWT_DIR="/Users/bringert/src/gwt-2.0.4"' - echo 'export GWT_CLASSPATH="$GWT_DIR/gwt-user.jar:$GWT_DIR/gwt-dev.jar"' - exit 1 -fi - -if [ `uname` = "Darwin" ]; then - GWT_JAVA_OPTS=-XstartOnFirstThread -fi - -java $GWT_JAVA_OPTS -Xmx256M -cp "$APPDIR/src:$APPDIR/bin:$GWT_CLASSPATH" com.google.gwt.dev.Compiler -war "$APPDIR/www/editor" "$@" org.grammaticalframework.ui.gwt.EditorApp; diff --git a/src/ui/gwt/Editor-compile.bat b/src/ui/gwt/Editor-compile.bat deleted file mode 100644 index 2c9b77f4e..000000000 --- a/src/ui/gwt/Editor-compile.bat +++ /dev/null @@ -1,7 +0,0 @@ -@echo off - -set APPDIR=. -set GWT_DIR=C:\Program Files\eclipse\plugins\com.google.gwt.eclipse.sdkbundle.2.0.4_2.0.4.v201006301254\gwt-2.0.4 -set GWT_CLASSPATH=%GWT_DIR%\gwt-user.jar;%GWT_DIR%\gwt-dev.jar - -java %GWT_JAVA_OPTS% -Xmx256M -cp "%APPDIR%\src;%GWT_CLASSPATH%" com.google.gwt.dev.Compiler -war "%APPDIR%\www\editor" org.grammaticalframework.ui.gwt.EditorApp -style PRETTY diff --git a/src/ui/gwt/Fridge-compile b/src/ui/gwt/Fridge-compile deleted file mode 100644 index 887e253bc..000000000 --- a/src/ui/gwt/Fridge-compile +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -APPDIR=`dirname $0`; - -if [ -z "$GWT_CLASSPATH" ]; then - echo 'ERROR: $GWT_CLASSPATH is not set' - echo 'Set $GWT_CLASSPATH to point to the GWT JAR files. For example:' - echo 'export GWT_DIR="/Users/bringert/src/gwt-2.0.4"' - echo 'export GWT_CLASSPATH="$GWT_DIR/gwt-user.jar:$GWT_DIR/gwt-dev.jar"' - exit 1 -fi - -if [ `uname` = "Darwin" ]; then - GWT_JAVA_OPTS=-XstartOnFirstThread -fi - -java $GWT_JAVA_OPTS -Xmx256M -cp "$APPDIR/src:$APPDIR/bin:$GWT_CLASSPATH" com.google.gwt.dev.Compiler -war "$APPDIR/www/fridge" "$@" org.grammaticalframework.ui.gwt.FridgeApp; diff --git a/src/ui/gwt/Fridge-compile-fast b/src/ui/gwt/Fridge-compile-fast deleted file mode 100644 index 1a7a4df03..000000000 --- a/src/ui/gwt/Fridge-compile-fast +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -APPDIR=`dirname $0`; - -if [ -z "$GWT_CLASSPATH" ]; then - echo 'ERROR: $GWT_CLASSPATH is not set' - echo 'Set $GWT_CLASSPATH to point to the GWT JAR files. For example:' - echo 'export GWT_DIR="/Users/bringert/src/gwt-mac-1.5.2"' - echo 'export GWT_CLASSPATH="$GWT_DIR/gwt-user.jar:$GWT_DIR/gwt-dev-mac.jar"' - exit 1 -fi - -if [ `uname` = "Darwin" ]; then - GWT_JAVA_OPTS=-XstartOnFirstThread -fi - -LIBS=$APPDIR/lib/gwt-dnd-2.5.6.jar - -java $GWT_JAVA_OPTS -Xmx256M -cp "$APPDIR/src:$APPDIR/bin:$LIBS:$GWT_CLASSPATH" com.google.gwt.dev.GWTCompiler -out "$APPDIR/www" -style DETAILED "$@" se.chalmers.cs.gf.gwt.FridgeApp_IE6; diff --git a/src/ui/gwt/Fridge-compile.bat b/src/ui/gwt/Fridge-compile.bat deleted file mode 100644 index 8617d8528..000000000 --- a/src/ui/gwt/Fridge-compile.bat +++ /dev/null @@ -1,9 +0,0 @@ -@echo off - -set APPDIR=. -set GWT_DIR=c:\gwt-windows-1.5.2 -set GWT_CLASSPATH="%GWT_DIR%\gwt-user.jar;%GWT_DIR%\gwt-dev-windows.jar" - -set LIBS=%APPDIR%\lib\gwt-dnd-2.5.6.jar - -java %GWT_JAVA_OPTS% -Xmx256M -cp "%APPDIR%\src;%APPDIR%\bin;%LIBS%;%GWT_CLASSPATH%" com.google.gwt.dev.GWTCompiler -out "%APPDIR%\www\fridge" se.chalmers.cs.gf.gwt.FridgeApp diff --git a/src/ui/gwt/Fridge-shell-external b/src/ui/gwt/Fridge-shell-external deleted file mode 100644 index 1209047ed..000000000 --- a/src/ui/gwt/Fridge-shell-external +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -APPDIR=`dirname $0`; - -if [ -z "$GWT_CLASSPATH" ]; then - echo 'ERROR: $GWT_CLASSPATH is not set' - echo 'Set $GWT_CLASSPATH to point to the GWT JAR files. For example:' - echo 'export GWT_DIR="/Users/bringert/src/gwt-mac-1.5.2"' - echo 'export GWT_CLASSPATH="$GWT_DIR/gwt-user.jar:$GWT_DIR/gwt-dev-mac.jar"' - exit 1 -fi - -if [ `uname` = "Darwin" ]; then - GWT_JAVA_OPTS=-XstartOnFirstThread -fi - -LIBS=$APPDIR/lib/gwt-dnd-2.5.6.jar - -java $GWT_JAVA_OPTS -Xmx256M -cp "$APPDIR/src:$APPDIR/bin:$LIBS:$GWT_CLASSPATH" com.google.gwt.dev.GWTShell -out "$APPDIR/www" -noserver "$@" http://localhost:41296/fridge/; diff --git a/src/ui/gwt/Morpho-compile b/src/ui/gwt/Morpho-compile deleted file mode 100644 index 234e18322..000000000 --- a/src/ui/gwt/Morpho-compile +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -APPDIR=`dirname $0`; - -if [ -z "$GWT_CLASSPATH" ]; then - echo 'ERROR: $GWT_CLASSPATH is not set' - echo 'Set $GWT_CLASSPATH to point to the GWT JAR files. For example:' - echo 'export GWT_DIR="/Users/bringert/src/gwt-2.0.4"' - echo 'export GWT_CLASSPATH="$GWT_DIR/gwt-user.jar:$GWT_DIR/gwt-dev.jar"' - exit 1 -fi - -if [ `uname` = "Darwin" ]; then - GWT_JAVA_OPTS=-XstartOnFirstThread -fi - -java $GWT_JAVA_OPTS -Xmx256M -cp "$APPDIR/src:$APPDIR/bin:$LIBS:$GWT_CLASSPATH" com.google.gwt.dev.Compiler -war "$APPDIR/www/morpho" "$@" org.grammaticalframework.ui.gwt.MorphoApp; diff --git a/src/ui/gwt/Translate-compile b/src/ui/gwt/Translate-compile deleted file mode 100644 index 220cf4a46..000000000 --- a/src/ui/gwt/Translate-compile +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -APPDIR=`dirname $0`; - -if [ -z "$GWT_CLASSPATH" ]; then - echo 'ERROR: $GWT_CLASSPATH is not set' - echo 'Set $GWT_CLASSPATH to point to the GWT JAR files. For example:' - echo 'export GWT_DIR="/Users/bringert/src/gwt-2.0.4"' - echo 'export GWT_CLASSPATH="$GWT_DIR/gwt-user.jar:$GWT_DIR/gwt-dev.jar"' - exit 1 -fi - -if [ `uname` = "Darwin" ]; then - GWT_JAVA_OPTS=-XstartOnFirstThread -fi - -java $GWT_JAVA_OPTS -Xmx256M -cp "$APPDIR/src:$APPDIR/bin:$GWT_CLASSPATH" com.google.gwt.dev.Compiler -war "$APPDIR/www/translate" "$@" org.grammaticalframework.ui.gwt.TranslateApp; diff --git a/src/ui/gwt/Translate-compile.bat b/src/ui/gwt/Translate-compile.bat deleted file mode 100644 index df3ee9389..000000000 --- a/src/ui/gwt/Translate-compile.bat +++ /dev/null @@ -1,9 +0,0 @@ -@echo off - -set APPDIR=. -set GWT_DIR=c:\gwt-windows-1.5.2 -set GWT_CLASSPATH="%GWT_DIR%\gwt-user.jar;%GWT_DIR%\gwt-dev-windows.jar" - -set LIBS=%APPDIR%\lib\gwt-dnd-2.5.6.jar - -java %GWT_JAVA_OPTS% -Xmx256M -cp "%APPDIR%\src;%APPDIR%\bin;%LIBS%;%GWT_CLASSPATH%" com.google.gwt.dev.GWTCompiler -out "%APPDIR%\www\translate" se.chalmers.cs.gf.gwt.TranslateApp diff --git a/src/ui/gwt/Translate-shell-external b/src/ui/gwt/Translate-shell-external deleted file mode 100644 index b1e58f019..000000000 --- a/src/ui/gwt/Translate-shell-external +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -APPDIR=`dirname $0`; - -if [ -z "$GWT_CLASSPATH" ]; then - echo 'ERROR: $GWT_CLASSPATH is not set' - echo 'Set $GWT_CLASSPATH to point to the GWT JAR files. For example:' - echo 'export GWT_DIR="/Users/bringert/src/gwt-mac-1.5.2"' - echo 'export GWT_CLASSPATH="$GWT_DIR/gwt-user.jar:$GWT_DIR/gwt-dev-mac.jar"' - exit 1 -fi - -if [ `uname` = "Darwin" ]; then - GWT_JAVA_OPTS=-XstartOnFirstThread -fi - -LIBS=$APPDIR/lib/gwt-dnd-2.5.6.jar - -java $GWT_JAVA_OPTS -Xmx256M -cp "$APPDIR/src:$APPDIR/bin:$LIBS:$GWT_CLASSPATH" com.google.gwt.dev.GWTShell -out "$APPDIR/www" -noserver "$@" http://localhost:41296/translate/; diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/EditorApp.gwt.xml b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/EditorApp.gwt.xml deleted file mode 100644 index a7b24c1af..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/EditorApp.gwt.xml +++ /dev/null @@ -1,27 +0,0 @@ -<module> - - <!-- Inherit the core Web Toolkit stuff. --> - <inherits name="com.google.gwt.user.User" /> - <inherits name="com.google.gwt.xml.XML" /> - - <inherits name="org.grammaticalframework.ui.gwt.PGF" /> - - <!-- Inherit the default GWT style sheet. You can change --> - <!-- the theme of your GWT application by uncommenting --> - <!-- any one of the following lines. --> - <inherits name="com.google.gwt.user.theme.standard.Standard"/> - <!-- <inherits name="com.google.gwt.user.theme.chrome.Chrome"/> --> - <!-- <inherits name="com.google.gwt.user.theme.dark.Dark"/> --> - - <replace-with class="org.grammaticalframework.ui.gwt.client.selection.support.InternetExplorerSelectionSupport"> - <when-type-is class="org.grammaticalframework.ui.gwt.client.selection.support.SelectionSupport"/> - <when-property-is name="user.agent" value="ie6"/> - </replace-with> - - <!-- Specify the app entry point class. --> - <entry-point class="org.grammaticalframework.ui.gwt.client.EditorApp" /> - - <!-- Specify the application specific style sheet. --> - <stylesheet src="Editor.css" /> - -</module> diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/FridgeApp.gwt.xml b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/FridgeApp.gwt.xml deleted file mode 100644 index b041f9830..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/FridgeApp.gwt.xml +++ /dev/null @@ -1,25 +0,0 @@ -<module> - - <!-- Inherit the core Web Toolkit stuff. --> - <inherits name="com.google.gwt.user.User" /> - <inherits name="com.google.gwt.xml.XML" /> - - <inherits name="org.grammaticalframework.ui.gwt.PGF" /> - - <!-- Inherit the default GWT style sheet. You can change --> - <!-- the theme of your GWT application by uncommenting --> - <!-- any one of the following lines. --> - <inherits name="com.google.gwt.user.theme.standard.Standard"/> - <!-- <inherits name="com.google.gwt.user.theme.chrome.Chrome"/> --> - <!-- <inherits name="com.google.gwt.user.theme.dark.Dark"/> --> - - <!-- Other module inherits --> - - - <!-- Specify the app entry point class. --> - <entry-point class="org.grammaticalframework.ui.gwt.client.FridgeApp" /> - - <!-- Specify the application specific style sheet. --> - <stylesheet src="Fridge.css" /> - -</module> diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/FridgeApp_IE6.gwt.xml b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/FridgeApp_IE6.gwt.xml deleted file mode 100644 index 70d2b1714..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/FridgeApp_IE6.gwt.xml +++ /dev/null @@ -1,5 +0,0 @@ -<module rename-to="org.grammaticalframework.ui.gwt.FridgeApp"> - <inherits name="org.grammaticalframework.ui.gwt.FridgeApp" /> - <set-property name="user.agent" value="ie6" /> - <set-property name="locale" value="default" /> -</module>
\ No newline at end of file diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/MorphoApp.gwt.xml b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/MorphoApp.gwt.xml deleted file mode 100644 index 9bdd8d5ac..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/MorphoApp.gwt.xml +++ /dev/null @@ -1,20 +0,0 @@ -<module> - - <!-- Inherit the core Web Toolkit stuff. --> - <inherits name="com.google.gwt.user.User" /> - <inherits name="com.google.gwt.xml.XML" /> - - <!-- Inherit the default GWT style sheet. You can change --> - <!-- the theme of your GWT application by uncommenting --> - <!-- any one of the following lines. --> - <inherits name="com.google.gwt.user.theme.standard.Standard"/> - <!-- <inherits name="com.google.gwt.user.theme.chrome.Chrome"/> --> - <!-- <inherits name="com.google.gwt.user.theme.dark.Dark"/> --> - - <!-- Specify the app entry point class. --> - <entry-point class="org.grammaticalframework.ui.gwt.client.MorphoApp" /> - - <!-- Specify the application specific style sheet. --> - <stylesheet src="Morpho.css" /> - -</module> diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/PGF.gwt.xml b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/PGF.gwt.xml deleted file mode 100644 index 549a16f0d..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/PGF.gwt.xml +++ /dev/null @@ -1,9 +0,0 @@ -<module> - - <!-- Inherit the core Web Toolkit stuff. --> - <inherits name="com.google.gwt.user.User" /> - <inherits name="com.google.gwt.http.HTTP" /> - <inherits name="com.google.gwt.json.JSON" /> - <inherits name="com.google.gwt.xml.XML" /> - -</module> diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/TranslateApp.gwt.xml b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/TranslateApp.gwt.xml deleted file mode 100644 index ef51227ec..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/TranslateApp.gwt.xml +++ /dev/null @@ -1,25 +0,0 @@ -<module> - - <!-- Inherit the core Web Toolkit stuff. --> - <inherits name="com.google.gwt.user.User" /> - <inherits name="com.google.gwt.xml.XML" /> - - <inherits name="org.grammaticalframework.ui.gwt.PGF" /> - - <!-- Inherit the default GWT style sheet. You can change --> - <!-- the theme of your GWT application by uncommenting --> - <!-- any one of the following lines. --> - <inherits name="com.google.gwt.user.theme.standard.Standard"/> - <!-- <inherits name="com.google.gwt.user.theme.chrome.Chrome"/> --> - <!-- <inherits name="com.google.gwt.user.theme.dark.Dark"/> --> - - <!-- Other module inherits --> - - - <!-- Specify the app entry point class. --> - <entry-point class="org.grammaticalframework.ui.gwt.client.TranslateApp" /> - - <!-- Specify the application specific style sheet. --> - <stylesheet src="Translate.css" /> - -</module> diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/BrowsePanel.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/BrowsePanel.java deleted file mode 100644 index 3f4c8a9a4..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/BrowsePanel.java +++ /dev/null @@ -1,269 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import java.util.*; -import com.google.gwt.user.client.History; -import com.google.gwt.user.client.HistoryListener; -import com.google.gwt.user.client.Command; -import com.google.gwt.user.client.DeferredCommand; -import com.google.gwt.user.client.ui.*; -import com.google.gwt.http.client.*; -import com.google.gwt.xml.client.*; -import com.google.gwt.event.logical.shared.*; - -public class BrowsePanel extends Composite { - - private PGFWrapper pgf; - private StatusPopup statusPopup; - private HTML sourceView; - private SuggestBox searchBox; - private CompletionOracle oracle; - private List<String> identifiers = null; - - public BrowsePanel(PGFWrapper pgf, StatusPopup statusPopup) { - this.pgf = pgf; - this.statusPopup = statusPopup; - - oracle = new CompletionOracle(); - - HorizontalPanel browsePanel = new HorizontalPanel(); - VerticalPanel vPanel = new VerticalPanel(); - vPanel.add(createSearchPanel(oracle)); - vPanel.add(createTreeView()); - browsePanel.add(vPanel); - browsePanel.add(createSourcePanel()); - browsePanel.setCellWidth(sourceView,"100%"); - - initWidget(browsePanel); - setStylePrimaryName("my-BrowsePanel"); - - pgf.addSettingsListener(new MySettingsListener(pgf)); - } - - public native void onActivate() /*-{ - $doc.browsePanel = this; - $doc.callBrowse = @org.grammaticalframework.ui.gwt.client.BrowsePanel::callBrowse(Lorg/grammaticalframework/ui/gwt/client/BrowsePanel;Ljava/lang/String;); - }-*/; - - protected Widget createSearchPanel(CompletionOracle oracle) { - searchBox = new SuggestBox(oracle); - searchBox.setLimit(10); - searchBox.addKeyboardListener(new KeyboardListenerAdapter() { - public void onKeyUp (Widget sender, char keyCode, int modifiers) { - if (keyCode == KEY_ENTER) { - callBrowse(BrowsePanel.this,searchBox.getText()); - } - } - }); - - DecoratorPanel decorator = new DecoratorPanel(); - VerticalPanel vPanel = new VerticalPanel(); - vPanel.add(new Label("Search")); - vPanel.add(searchBox); - decorator.add(vPanel); - return decorator; - } - - private static void callBrowse(BrowsePanel panel, String id) { - panel.browse(id); - History.newItem("browse:"+id, false); - } - - public void browse(final String id) { - if (id == null || id.equals("")) { - sourceView.setHTML(""); - return; - } - - pgf.browse(id, "javascript:document.callBrowse(document.browsePanel,'$ID')", - "my-identifierLink", - new RequestCallback() { - public void onResponseReceived(Request request, Response response) { - sourceView.setHTML(response.getText()); - } - - public void onError(Request request, java.lang.Throwable e) { - statusPopup.showError("Cannot load the page", e); - } - }); - } - - protected Widget createTreeView() { - hierarchyTree = new Tree(); - hierarchyTree.addSelectionHandler(new SelectionHandler<TreeItem>() { - public void onSelection(SelectionEvent<TreeItem> event) { - TreeItem item = event.getSelectedItem(); - callBrowse(BrowsePanel.this,item.getText()); - } - }); - return hierarchyTree; - } - - protected Widget createSourcePanel() { - sourceView = new HTML(); - sourceView.setStylePrimaryName("source"); - return sourceView; - } - - protected class CompletionOracle extends SuggestOracle { - - public CompletionOracle() { - } - - public void requestSuggestions(SuggestOracle.Request request, SuggestOracle.Callback callback) { - List<CompletionSuggestion> list = new ArrayList(); - - int index = Collections.binarySearch(identifiers, request.getQuery()); - index = (index >= 0) ? index : -(index+1); - - for (; index < identifiers.size(); index++) { - String id = identifiers.get(index); - - if (id.startsWith(request.getQuery())) { - list.add(new CompletionSuggestion(id)); - } - else - break; - - if (list.size() > request.getLimit()) - break; - } - - callback.onSuggestionsReady(request, new SuggestOracle.Response(list)); - } - } - - protected static class CompletionSuggestion implements SuggestOracle.Suggestion { - private String string; - - public CompletionSuggestion(String string) { - this.string = string; - } - - public String getDisplayString() { - return string; - } - - public String getReplacementString() { - return string; - } - } - - Tree hierarchyTree = null; - - protected void reloadHierarchyTree() { - hierarchyTree.clear(); - - final String url = pgf.getGrammarURL()+".xml"; - RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, URL.encode(url)); - try - { - builder.sendRequest(null, new RequestCallback() { - public void onResponseReceived(Request request, Response response) - { - if (200 == response.getStatusCode()) - { - try - { - Document browseDoc = XMLParser.parse(response.getText()); - - TreeLoader loader = new TreeLoader(); - - Element element = browseDoc.getDocumentElement(); - NodeList children = element.getChildNodes(); - for (int i = 0; i < children.getLength(); i++) { - Node node = children.item(i); - if (node instanceof Element) { - Element childElement = (Element) node; - TreeItem childItem = hierarchyTree.addItem(childElement.getAttribute("name")); - loader.push(childElement, childItem); - } - } - - loader.execute(); - } - catch (DOMException e) - { - } - } - else - { - } - } - - public void onError(Request request, Throwable e) - { - } - }); - } - catch (RequestException e) - { - } - } - - private class TreeLoader implements Command { - private int count = 0; - private ArrayList<Element> elements = new ArrayList<Element>(); - private ArrayList<TreeItem> items = new ArrayList<TreeItem>(); - - public void execute() { - for (int n = 0; n < 100; n++) { - if (count <= 0) - return; - - int index = --count; - Element element = (Element) elements.remove(index); - TreeItem item = (TreeItem) items.remove(index); - - NodeList children = element.getChildNodes(); - for (int i = 0; i < children.getLength(); i++) { - Node node = children.item(i); - if (node instanceof Element) { - Element childElement = (Element) node; - TreeItem childItem = item.addItem(childElement.getAttribute("name")); - push(childElement, childItem); - } - } - } - DeferredCommand.addCommand(this); - } - - public final void push(Element element, TreeItem item) { - elements.add(element); - items.add(item); - count++; - } - } - - protected class MySettingsListener implements SettingsListener { - - private PGFWrapper pgf; - - public MySettingsListener(PGFWrapper pgf) { - this.pgf = pgf; - } - - public void onAvailableGrammarsChanged() { } - public void onSelectedGrammarChanged() - { - List<String> ids = new ArrayList(); - - for (int i = 0; i < pgf.getCategories().length(); i++) { - ids.add(pgf.getCategories().get(i)); - } - for (int i = 0; i < pgf.getFunctions().length(); i++) { - ids.add(pgf.getFunctions().get(i)); - } - - Collections.sort(ids); - - identifiers = ids; - sourceView.setText(""); - searchBox.setText(""); - reloadHierarchyTree(); - } - public void onInputLanguageChanged() { } - public void onOutputLanguageChanged() { } - public void onStartCategoryChanged() { } - public void onSettingsError(String msg, Throwable e) { } - } -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/CompletionOracle.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/CompletionOracle.java deleted file mode 100644 index 7ea5d2be6..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/CompletionOracle.java +++ /dev/null @@ -1,152 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import com.google.gwt.user.client.ui.SuggestOracle; - -public class CompletionOracle extends SuggestOracle { - - private static final int LIMIT_SCALE_FACTOR = 4; - - private PGFWrapper pgf; - - private ErrorHandler errorHandler; - - private JSONRequest jsonRequest = null; - - private String oldQuery = null; - - private List<CompletionSuggestion> oldSuggestions = Collections.emptyList(); - - - public CompletionOracle (PGFWrapper pgf) { - this(pgf, null); - } - - public CompletionOracle (PGFWrapper pgf, ErrorHandler errorHandler) { - this.pgf = pgf; - this.errorHandler = errorHandler; - pgf.addSettingsListener(new SettingsListener() { - public void onAvailableGrammarsChanged() { clearState(); } - public void onSelectedGrammarChanged() { clearState(); } - public void onInputLanguageChanged() { clearState(); } - public void onOutputLanguageChanged() { clearState(); } - public void onStartCategoryChanged() { clearState(); } - public void onSettingsError(String msg, Throwable e) { clearState(); } - }); - } - - private void clearState () { - this.oldQuery = null; - this.oldSuggestions = Collections.emptyList(); - if (jsonRequest != null) { - jsonRequest.cancel(); - jsonRequest = null; - } - } - - public void setErrorHandler(ErrorHandler errorHandler) { - this.errorHandler = errorHandler; - } - - public static interface ErrorHandler { - public void onError(Throwable e); - } - - public static class CompletionSuggestion implements SuggestOracle.Suggestion { - private String string; - public CompletionSuggestion(String string) { - this.string = string; - } - - public String getDisplayString() { - return string; - } - - public String getReplacementString() { - return string; - } - } - - public void requestSuggestions(SuggestOracle.Request request, SuggestOracle.Callback callback) { - // Only allow a single completion request at a time - if (jsonRequest != null) { - jsonRequest.cancel(); - jsonRequest = null; - } - - List<CompletionSuggestion> suggestions = filterOldSuggestions(request); - if (suggestions != null) { - suggestionsReady(request, callback, suggestions); - } else { - retrieveSuggestions(request, callback); - } - } - - /** Filters old suggestions and checks if we still have enough suggestions. */ - private List<CompletionSuggestion> filterOldSuggestions(SuggestOracle.Request request) { - String query = request.getQuery(); - if (query.length() > 0 && oldQuery != null && query.startsWith(oldQuery)) { - // If the prefix had no completions, there is no way that the current input will. - if (oldSuggestions.isEmpty()) { - return Collections.emptyList(); - } - // If the new input since the previous query ends in whitespace, - // always get completions from the server, - // since the old suggestions won't include the next word. - if (query.indexOf(' ', oldQuery.length()) != -1) { - return null; - } - List<CompletionSuggestion> suggestions = new ArrayList<CompletionSuggestion>(); - for (CompletionSuggestion c : oldSuggestions) { - if (c.getReplacementString().startsWith(query)) { - suggestions.add(c); - } - } - if (suggestions.size() >= request.getLimit() || oldSuggestions.size() < request.getLimit()) { - return suggestions; - } - } - return null; - } - - private void retrieveSuggestions(final SuggestOracle.Request request, final SuggestOracle.Callback callback) { - // hack: first report no completions, to hide suggestions until we get the new completions - callback.onSuggestionsReady(request, new SuggestOracle.Response(Collections.<CompletionSuggestion>emptyList())); - - jsonRequest = pgf.complete(request.getQuery(), LIMIT_SCALE_FACTOR * request.getLimit(), - new PGF.CompleteCallback() { - public void onResult(IterableJsArray<PGF.Completion> completions) { - jsonRequest = null; - List<CompletionSuggestion> suggestions = new ArrayList<CompletionSuggestion>(); - for (PGF.Completion completion : completions.iterable()) { - String text = completion.getBracketedString().render(); - for (String tokn : completion.getCompletions()) { - StringBuilder sbuilder = new StringBuilder(); - sbuilder.append(text); - if (sbuilder.length() > 0) - sbuilder.append(' '); - sbuilder.append(tokn); - suggestions.add(new CompletionSuggestion(sbuilder.toString())); - } - } - suggestionsReady(request, callback, suggestions); - } - - public void onError(Throwable e) { - errorHandler.onError(e); - } - - }); - } - - private void suggestionsReady(SuggestOracle.Request request, SuggestOracle.Callback callback, List<CompletionSuggestion> suggestions) { - this.oldQuery = request.getQuery(); - this.oldSuggestions = suggestions; - suggestions = suggestions.size() <= request.getLimit() ? suggestions : SubList.makeSubList(suggestions, 0, request.getLimit()); - callback.onSuggestionsReady(request, new SuggestOracle.Response(suggestions)); - } - -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/ContentService.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/ContentService.java deleted file mode 100644 index fd336bf34..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/ContentService.java +++ /dev/null @@ -1,136 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import org.grammaticalframework.ui.gwt.client.JSONRequestBuilder.Arg; - -import java.util.*; -import com.google.gwt.core.client.*; - -public class ContentService { - - // Event listeners - private List<SettingsListener> listeners = new LinkedList<SettingsListener>(); - private List<GrammarInfo> grammars = null; - - - public ContentService() { - } - - public static class Init extends JavaScriptObject { - protected Init() { } - - public final native String getUserId() /*-{ return this.userId; }-*/; - public final native String getUserURL() /*-{ return this.userURL; }-*/; - public final native String getUserEMail() /*-{ return this.userEMail; }-*/; - public final native String getContentURL() /*-{ return this.contentURL; }-*/; - } - - public static final native Init getInit() /*-{ - return $wnd.__gfInit; - }-*/; - - public void addSettingsListener(SettingsListener listener) { - listeners.add(listener); - } - - public void updateAvailableGrammars() { - List<Arg> args = new ArrayList<Arg>(); - args.add(new Arg("userId", getInit().getUserId())); - args.add(new Arg("command", "grammars")); - JSONRequestBuilder.sendRequest(getInit().getContentURL(), args, new GrammarsCallback() { - public void onResult(IterableJsArray<ContentService.GrammarInfo> grammars_) { - grammars = new ArrayList<GrammarInfo>(); - for (ContentService.GrammarInfo grammar : grammars_.iterable()) { - grammars.add(grammar); - } - - for (SettingsListener listener : listeners) { - listener.onAvailableGrammarsChanged(); - } - } - - public void onError(Throwable e) { - } - }); - } - - public List<GrammarInfo> getGrammars() { - return grammars; - } - - public interface GrammarsCallback extends JSONCallback<IterableJsArray<GrammarInfo>> {} - - public static class GrammarInfo extends JavaScriptObject { - protected GrammarInfo() { } - - public final native String getURL() /*-{ return this.url; }-*/; - public final native String getName() /*-{ return this.name; }-*/; - public final native String getDescription() /*-{ return this.description; }-*/; - } - - public JSONRequest deleteGrammar(String grammarURL, DeleteCallback callback) { - List<Arg> args = new ArrayList<Arg>(); - args.add(new Arg("url", grammarURL)); - args.add(new Arg("userId", getInit().getUserId())); - args.add(new Arg("command", "delete_grammar")); - return JSONRequestBuilder.sendRequest(getInit().getContentURL(), args, callback); - } - - public JSONRequest save(Object id, String content, SaveCallback callback) { - List<Arg> args = new ArrayList<Arg>(); - if (id != null) - args.add(new Arg("id", id.toString())); - args.add(new Arg("command", "save")); - return JSONRequestBuilder.sendDataRequest(getInit().getContentURL(), args, content, callback); - } - - public interface SaveCallback extends JSONCallback<DocumentSignature> {} - - public JSONRequest load(Object id, LoadCallback callback) { - List<Arg> args = new ArrayList<Arg>(); - args.add(new Arg("command", "load")); - args.add(new Arg("id", id.toString())); - return JSONRequestBuilder.sendRequest(getInit().getContentURL(), args, callback); - } - - public interface LoadCallback extends JSONCallback<Document> {} - - public JSONRequest search(String fullTextQuery, SearchCallback callback) { - List<Arg> args = new ArrayList<Arg>(); - args.add(new Arg("command", "search")); - args.add(new Arg("query", fullTextQuery)); - return JSONRequestBuilder.sendRequest(getInit().getContentURL(), args, callback); - } - - public interface SearchCallback extends JSONCallback<IterableJsArray<DocumentSignature>> {} - - public static class DocumentSignature extends JavaScriptObject { - protected DocumentSignature() { } - - public final native int getId() /*-{ return this.id; }-*/; - public final native String getTitle() /*-{ return this.title; }-*/; - public final native String getCreated() /*-{ return this.created; }-*/; - public final native String getModified() /*-{ return this.modified; }-*/; - } - - public static class Document extends DocumentSignature { - protected Document() { } - - public final native String getContent() /*-{ return this.content; }-*/; - } - - public JSONRequest delete(List ids, DeleteCallback callback) { - List<Arg> args = new ArrayList<Arg>(); - args.add(new Arg("command", "delete")); - for (Object id : ids) { - args.add(new Arg("id", id.toString())); - } - return JSONRequestBuilder.sendRequest(getInit().getContentURL(), args, callback); - } - - public interface DeleteCallback extends JSONCallback<DeleteResult> {} - - public static class DeleteResult extends JavaScriptObject { - protected DeleteResult() { } - } - -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/DocumentsPanel.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/DocumentsPanel.java deleted file mode 100644 index 09acce5f5..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/DocumentsPanel.java +++ /dev/null @@ -1,142 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import java.util.*; -import com.google.gwt.user.client.*; -import com.google.gwt.user.client.ui.*; -import com.google.gwt.http.client.*; -import com.google.gwt.xml.client.*; -import com.google.gwt.event.logical.shared.*; -import com.google.gwt.event.dom.client.*; -import com.google.gwt.event.shared.*; - -public class DocumentsPanel extends Composite implements HasSelectionHandlers<Object> { - - private PGFWrapper pgf; - private ContentService contentService; - private StatusPopup statusPopup; - private FlexTable table; - private ArrayList documentIds = new ArrayList(); - - public DocumentsPanel(PGFWrapper pgf, ContentService contentService, StatusPopup statusPopup) { - this.pgf = pgf; - this.contentService = contentService; - this.statusPopup = statusPopup; - - VerticalPanel documentsPanel = new VerticalPanel(); - documentsPanel.setStylePrimaryName("my-DocumentsFrame"); - - HorizontalPanel searchPanel = new HorizontalPanel(); - searchPanel.setStylePrimaryName("my-DocumentsSearchFrame"); - final TextBox searchBox = new TextBox(); - searchBox.setWidth("20em"); - final Button searchBtn = new Button("Search"); - searchPanel.add(searchBox); - searchPanel.add(searchBtn); - documentsPanel.add(searchPanel); - - Image deleteButton = new Image("org.grammaticalframework.ui.gwt.EditorApp/trash-button.png"); - deleteButton.setTitle("Deletes the selected documents."); - deleteButton.setStylePrimaryName("toolbar-button"); - deleteButton.addClickListener(new ClickListener () { - public void onClick(Widget sender) { - deleteSelected(); - } - }); - - FlexTable header = new FlexTable(); - header.setStylePrimaryName("my-TableHeader"); - header.setText(0,0,"Documents"); - header.setWidget(0,1,deleteButton); - header.getColumnFormatter().setWidth(1,"20px"); - documentsPanel.add(header); - - table = new FlexTable(); - table.setCellPadding(2); - table.setStylePrimaryName("my-DocumentsTable"); - table.getColumnFormatter().setWidth(1,"80em"); - table.getColumnFormatter().setWidth(2,"80em"); - documentsPanel.add(table); - - searchBtn.addClickHandler(new ClickHandler() { - public void onClick(ClickEvent event) { - searchDocuments(searchBox.getText()); - } - }); - table.addClickHandler(new ClickHandler() { - public void onClick(ClickEvent event) { - HTMLTable.Cell cell = table.getCellForEvent(event); - if (cell != null) { - int row = cell.getRowIndex(); - selectDocument(row); - } - } - }); - - initWidget(documentsPanel); - setStylePrimaryName("my-DocumentsPanel"); - } - - public HandlerRegistration addSelectionHandler(SelectionHandler<Object> handler) { - return addHandler(handler, SelectionEvent.getType()); - } - - protected void selectDocument(int row) { - SelectionEvent.fire(this, documentIds.get(row)); - } - - protected void searchDocuments(String fullTextQuery) { - statusPopup.setStatus("Searching..."); - - documentIds.clear(); - while (table.getRowCount() > 0) - table.removeRow(0); - - contentService.search(fullTextQuery, new ContentService.SearchCallback() { - public void onResult(IterableJsArray<ContentService.DocumentSignature> documents) { - for (ContentService.DocumentSignature sign : documents.iterable()) { - int row = table.getRowCount(); - table.setWidget(row, 0, new CheckBox(sign.getTitle())); - table.setText(row, 1, sign.getCreated()); - table.setText(row, 2, sign.getModified()); - table.getRowFormatter().addStyleName(row, "row"); - documentIds.add(sign.getId()); - } - - statusPopup.clearStatus(); - } - - public void onError(Throwable e) { - statusPopup.showError("Search failed", e); - } - }); - } - - protected void deleteSelected() { - statusPopup.setStatus("Deleting..."); - - final ArrayList ids = new ArrayList(); - final ArrayList<Integer> rows = new ArrayList<Integer>(); - for (int row = 0; row < table.getRowCount(); row++) { - CheckBox checkBox = (CheckBox) table.getWidget(row,0); - if (checkBox.isChecked()) { - ids.add(documentIds.get(row)); - rows.add(new Integer(row)); - } - } - - contentService.delete(ids, new ContentService.DeleteCallback() { - public void onResult(ContentService.DeleteResult result) { - for (Integer row : rows) { - table.removeRow(row.intValue()); - } - - statusPopup.clearStatus(); - } - - public void onError(Throwable e) { - statusPopup.showError("Delete failed", e); - } - }); - - } -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/EditorApp.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/EditorApp.java deleted file mode 100644 index ece9ecac8..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/EditorApp.java +++ /dev/null @@ -1,461 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import java.util.*; - -import com.google.gwt.core.client.*; -import com.google.gwt.user.client.*; -import com.google.gwt.user.client.ui.*; -import com.google.gwt.event.dom.client.*; -import com.google.gwt.event.logical.shared.*; -import com.google.gwt.event.shared.*; - -public class EditorApp implements EntryPoint { - - protected ContentService contentService; - protected PGFWrapper pgf; - - protected SettingsPanel settingsPanel; - protected VerticalPanel outputPanel; - protected Widget editorPanel; - protected BrowsePanel browsePanel; - protected QueryPanel queryPanel; - protected DocumentsPanel documentsPanel; - protected GrammarsPanel grammarsPanel; - protected StatusPopup statusPopup; - protected TextInputPanel textPanel; - protected FridgeBagPanel bagPanel; - protected MagnetFactory magnetFactory; - protected TabBar tabBar; - - private JSONRequest completeRequest = null; - private JSONRequest translateRequest = null; - - private int maxMagnets = 100; - private static final int LIMIT_SCALE_FACTOR = 4; - - private String cachedPrefix = null; - private List<Magnet> cachedMagnets = Collections.emptyList(); - - // - // Update - // - protected void update() { - clearMagnetCache(); - updateBag(""); - updateTranslation(); - } - - protected void clearMagnetCache() { - cachedPrefix = null; - cachedMagnets = Collections.emptyList(); - } - - protected void updateTranslation() { - if (translateRequest != null) { - translateRequest.cancel(); - } - - outputPanel.clear(); - outputPanel.addStyleDependentName("working"); - translateRequest = pgf.translate(textPanel.getText(), - new PGF.TranslateCallback() { - public void onResult (IterableJsArray<PGF.TranslationResult> translations) { - translateRequest = null; - - outputPanel.clear(); - outputPanel.removeStyleDependentName("working"); - for (PGF.TranslationResult tr : translations.iterable()) { - textPanel.renderBracketedString(tr.getBracketedString()); - - if (tr.getTranslations() != null) - for (PGF.Linearizations lins : tr.getTranslations().iterable()) { - LinearizationsPanel lin = new LinearizationsPanel(pgf, lins); - lin.setWidth("100%"); - outputPanel.add(lin); - } - - if (tr.getTypeErrors() != null && tr.getTypeErrors().length > 0) { - for (PGF.TcError error : tr.getTypeErrors()) { - VerticalPanel panel = new VerticalPanel(); - panel.addStyleName("my-typeError"); - Label errLabel = new Label("Type Error"); - errLabel.addStyleName("title"); - panel.add(errLabel); - panel.add(createErrorMsg(error)); - outputPanel.add(panel); - } - textPanel.showError(tr.getTypeErrors()[0].getFId()); - } - } - } - public void onError (Throwable e) { - translateRequest = null; - - statusPopup.showError("Translation failed", e); - } - }); - } - - private class Callback { - private String prefix; - - public Callback(String prefix) { - this.prefix = prefix; - } - - public void onResult(List<Magnet> magnets) { - bagPanel.fill(magnets); - - if (magnets.size() == 0) { - if (prefix.isEmpty()) { - textPanel.hideSearchBox(); - textPanel.setFocus(true); - } - else - textPanel.showSearchError(); - } else { - textPanel.clearSearchError(); - } - } - } - - public void updateBag(String prefix) { - Callback callback = new Callback(prefix); - List<Magnet> magnets = filterCachedMagnets(prefix); - if (magnets != null) - callback.onResult(magnets); - else - retrieveMagnets(prefix, callback); - } - - public List<Magnet> filterCachedMagnets(final String prefix) { - if (prefix.length() > 0 && cachedPrefix != null && prefix.startsWith(cachedPrefix)) { - // If the prefix had no completions, there is no way that the current input will. - if (cachedMagnets.isEmpty()) { - return Collections.emptyList(); - } - - List<Magnet> magnets = new ArrayList<Magnet>(); - for (Magnet magnet : cachedMagnets) { - if (magnet.getWord().startsWith(prefix)) { - magnets.add(magnet); - if (magnets.size() >= maxMagnets) - return magnets; - } - } - } - return null; - } - - public void retrieveMagnets(final String prefix, final Callback callback) { - final String query = textPanel.getText() + " " + prefix; - - if (completeRequest != null) { - completeRequest.cancel(); - } - - bagPanel.clear(); - completeRequest = pgf.complete(query, LIMIT_SCALE_FACTOR * maxMagnets, - new PGF.CompleteCallback() { - public void onResult(IterableJsArray<PGF.Completion> completions) { - completeRequest = null; - - cachedPrefix = query; - cachedMagnets = new ArrayList<Magnet>(); - - for (PGF.Completion completion : completions.iterable()) { - textPanel.renderBracketedString(completion.getBracketedString()); - if (completion.getCompletions() != null) { - if (completion.getText() != prefix) - textPanel.setSearchTerm(completion.getText()); - - for (String word : completion.getCompletions()) { - Magnet magnet = magnetFactory.createMagnet(word, completion.getFrom()); - cachedMagnets.add(magnet); - } - } else { - textPanel.setSearchTerm(completion.getText()); - } - } - - List<Magnet> magnets = new ArrayList<Magnet>(); - for (Magnet magnet : cachedMagnets) { - magnets.add(magnet); - if (magnets.size() >= maxMagnets) - break; - } - callback.onResult(magnets); - } - - public void onError(Throwable e) { - completeRequest = null; - - statusPopup.showError("Getting completions failed", e); - } - }); - } - - // - // GUI - // - - protected Widget createUI() { - editorPanel = createEditorPanel(); - browsePanel = createBrowsePanel(); - queryPanel = createQueryPanel(); - documentsPanel = createDocumentsPanel(); - grammarsPanel = createGrammarsPanel(); - - VerticalPanel vPanel = new VerticalPanel(); - vPanel.setWidth("100%"); - vPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER); - - HorizontalPanel hPanel = new HorizontalPanel(); - hPanel.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE); - hPanel.setStylePrimaryName("my-HeaderPanel"); - - TabBar linksPanel = createLinksPanel(vPanel); - hPanel.add(linksPanel); - hPanel.setCellHorizontalAlignment(linksPanel,HorizontalPanel.ALIGN_LEFT); - linksPanel.selectTab(1); - - settingsPanel = createSettingsPanel(); - hPanel.add(settingsPanel); - hPanel.setCellHorizontalAlignment(settingsPanel,HorizontalPanel.ALIGN_RIGHT); - - vPanel.add(hPanel); - vPanel.add(editorPanel); - - return vPanel; - } - - protected SettingsPanel createSettingsPanel () { - return new SettingsPanel(pgf, contentService, statusPopup); - } - - protected Widget createEditorPanel() { - textPanel = new TextInputPanel(contentService, statusPopup); - textPanel.addValueChangeHandler(new ValueChangeHandler<String>() { - public void onValueChange(ValueChangeEvent<String> event) { - update(); - } - }); - textPanel.addSelectionHandler(new SelectionHandler<String>() { - public void onSelection(SelectionEvent<String> event) { - String prefix = event.getSelectedItem(); - char lastChar = prefix.charAt(prefix.length()-1); - - Iterator<Magnet> iter = bagPanel.iterator(); - if ((Character.isSpace(lastChar) || lastChar == 160) && iter.hasNext()) { - Magnet magnet = iter.next(); - textPanel.setSearchTerm(""); - textPanel.addMagnet(magnet); - } - else - updateBag(prefix); - } - }); - - final ClickListener magnetClickListener = new ClickListener () { - public void onClick(Widget widget) { - Magnet magnet = (Magnet)widget; - textPanel.hideSearchBox(); - textPanel.addMagnet(magnet); - textPanel.setFocus(true); - } - }; - magnetFactory = new MagnetFactory(magnetClickListener); - - bagPanel = new FridgeBagPanel(); - - outputPanel = new VerticalPanel(); - outputPanel.addStyleName("my-translations"); - - final DockPanel editorPanel = new DockPanel(); - editorPanel.setStyleName("my-EditorPanel"); - editorPanel.add(textPanel, DockPanel.NORTH); - editorPanel.add(bagPanel, DockPanel.CENTER); - editorPanel.add(outputPanel, DockPanel.EAST); - - editorPanel.setCellHeight(bagPanel, "100%"); - editorPanel.setCellWidth(bagPanel, "70%"); - editorPanel.setCellHeight(outputPanel, "100%"); - editorPanel.setCellWidth(outputPanel, "30%"); - editorPanel.setCellVerticalAlignment(bagPanel, HasVerticalAlignment.ALIGN_TOP); - editorPanel.setCellHorizontalAlignment(outputPanel, HasHorizontalAlignment.ALIGN_RIGHT); - - Window.addWindowResizeListener(new WindowResizeListener() { - public void onWindowResized(int w, int h) { - editorPanel.setPixelSize(w-20, h-50); - } - }); - int w = Window.getClientWidth(); - int h = Window.getClientHeight(); - editorPanel.setPixelSize(w-20, h-50); - - return editorPanel; - } - - protected BrowsePanel createBrowsePanel() { - return new BrowsePanel(pgf, statusPopup); - } - - protected QueryPanel createQueryPanel() { - return new QueryPanel(pgf, statusPopup); - } - - protected DocumentsPanel createDocumentsPanel() { - DocumentsPanel panel = new DocumentsPanel(pgf, contentService, statusPopup); - panel.addSelectionHandler(new SelectionHandler<Object>() { - public void onSelection(SelectionEvent<Object> event) { - tabBar.selectTab(1); - textPanel.load(event.getSelectedItem()); - } - }); - return panel; - } - - protected GrammarsPanel createGrammarsPanel() { - return new GrammarsPanel(pgf, contentService, statusPopup); - } - - protected TabBar createLinksPanel(final Panel parent) { - tabBar = new TabBar(); - tabBar.setStylePrimaryName("my-LinksPanel"); - tabBar.addTab("Documents"); - tabBar.addTab("Editor"); - tabBar.addTab("Query"); - tabBar.addTab("Browse"); - tabBar.addTab("Grammars"); - - NavigationHandler handler = new NavigationHandler(tabBar, parent); - tabBar.addSelectionHandler(handler); - History.addHistoryListener(handler); - - return tabBar; - } - - // - // History stuff - // - - protected class NavigationHandler implements HistoryListener, SelectionHandler<Integer> { - private final TabBar linksPanel; - private final Panel parent; - private int level = 0; - - public NavigationHandler(TabBar linksPanel, Panel parent) { - this.linksPanel = linksPanel; - this.parent = parent; - } - - public void onSelection(SelectionEvent<Integer> event) { - parent.remove(documentsPanel); - parent.remove(editorPanel); - parent.remove(queryPanel); - parent.remove(browsePanel); - parent.remove(grammarsPanel); - - switch (event.getSelectedItem().intValue()) { - case 0: parent.add(documentsPanel); - if (level == 0) History.newItem("documents", false); - break; - case 1: parent.add(editorPanel); - if (level == 0) History.newItem("editor", false); - break; - case 2: parent.add(queryPanel); - if (level == 0) History.newItem("query", false); - break; - case 3: parent.add(browsePanel); - if (level == 0) History.newItem("browse", false); - browsePanel.onActivate(); - break; - case 4: parent.add(grammarsPanel); - if (level == 0) History.newItem("grammars", false); - break; - } - } - - public void onHistoryChanged(String token) { - level++; - - if (token.equals("documents")) { - linksPanel.selectTab(0); - } else if (token.equals("editor")) { - linksPanel.selectTab(1); - } else if (token.equals("query")) { - linksPanel.selectTab(2); - } else if (token.equals("browse")) { - linksPanel.selectTab(3); - browsePanel.onActivate(); - browsePanel.browse(null); - } else if (token.startsWith("browse:")) { - linksPanel.selectTab(3); - browsePanel.browse(token.substring(7)); - } else if (token.equals("grammars")) { - linksPanel.selectTab(4); - } - - level--; - } - }; - - protected Widget createErrorMsg(final PGF.TcError error) { - HTML msgHTML = new HTML("<pre>"+error.getMsg()+"</pre>"); - msgHTML.addStyleName("content"); - msgHTML.addClickListener(new ClickListener() { - public void onClick(Widget sender) { - textPanel.showError(error.getFId()); - } - }); - return msgHTML; - } - - // - // Initialization - // - - protected class MySettingsListener implements SettingsListener { - // Will only happen on load - public void onAvailableGrammarsChanged() { - if (pgf.getGrammarURL() == null) { - List<String> grammars = pgf.getGrammars(); - if (!grammars.isEmpty()) { - pgf.setGrammarURL(grammars.get(0)); - } - } - } - public void onSelectedGrammarChanged() { - textPanel.clear(); - if (pgf.getInputLanguage() == null) { - GWT.log("Setting input language to user language: " + pgf.getUserLanguage(), null); - pgf.setInputLanguage(pgf.getUserLanguage()); - } - update(); - } - public void onInputLanguageChanged() { - update(); - } - public void onOutputLanguageChanged() { - update(); - } - public void onStartCategoryChanged() { - update(); - } - public void onSettingsError(String msg, Throwable e) { - statusPopup.showError(msg,e); - } - } - - public void onModuleLoad() { - statusPopup = new StatusPopup(); - - pgf = new PGFWrapper(); - contentService = new ContentService(); - RootPanel.get().add(createUI()); - pgf.addSettingsListener(new MySettingsListener()); - contentService.updateAvailableGrammars(); - - textPanel.setFocus(true); - } -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/FridgeApp.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/FridgeApp.java deleted file mode 100644 index 4e9963451..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/FridgeApp.java +++ /dev/null @@ -1,338 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import java.util.*; - -import com.google.gwt.core.client.EntryPoint; -import com.google.gwt.user.client.*; -import com.google.gwt.user.client.ui.*; - - -public class FridgeApp implements EntryPoint { - - protected static final String pgfBaseURL = "/grammars"; - - protected PGFWrapper pgf; - - protected JSONRequest completeRequest = null; - protected JSONRequest translateRequest = null; - - private FridgeBagPanel bagPanel; - private FridgeTextPanel textPanel; - protected VerticalPanel outputPanel; - protected StatusPopup statusPopup; - - private FlowPanel prefixPanel; - private LinkedHashSet<String> prefixes = new LinkedHashSet<String>(); - - private int maxMagnets = 100; - - private MagnetFactory magnetFactory; - - // - // Text - // - - protected void update () { - updateBag(getText()); - translate(); - } - - public void updateBag (String text) { - updateBag(text, ""); - } - - public void updateBag (final String text, String prefix) { - if (completeRequest != null) { - completeRequest.cancel(); - } - final boolean updatePrefixes = prefix.equals(""); - bagPanel.clear(); - bagPanel.addStyleDependentName("empty"); - if (updatePrefixes) { clearPrefixes(); } - int limit = updatePrefixes ? 0 : maxMagnets; - completeRequest = pgf.complete(text + " " + prefix, - limit, new PGF.CompleteCallback() { - public void onResult(IterableJsArray<PGF.Completion> completions) { - List<Magnet> magnets = new ArrayList<Magnet>(); - for (PGF.Completion completion : completions.iterable()) { - for (String word : completion.getCompletions()) { - if (updatePrefixes) { - addPrefix(text, word.substring(0,1)); - } - if (magnets.size() < maxMagnets) { - Magnet magnet = magnetFactory.createMagnet(word, completion.getFrom()); - magnets.add(magnet); - } else { - prefixPanel.setVisible(true); - } - } - } - bagPanel.fill(magnets); - } - public void onError(Throwable e) { - showError("Translation failed", e); - } - }); - } - - protected void clearPrefixes () { - prefixes.clear(); - prefixPanel.clear(); - prefixPanel.setVisible(false); - } - - protected void addPrefix(final String text, final String prefix) { - if (prefixes.add(prefix)) { - Button prefixButton = new Button(prefix, new ClickListener() { - public void onClick(Widget sender) { - updateBag(text, prefix); - } - }); - prefixButton.setTitle("Show only magnets stating with '" + prefix + "'"); - prefixPanel.add(prefixButton); - } - } - - // - // Translation - // - - protected void translate() { - outputPanel.clear(); - outputPanel.addStyleDependentName("working"); - if (translateRequest != null) { - translateRequest.cancel(); - } - translateRequest = pgf.translate(getText(), - new PGF.TranslateCallback() { - public void onResult (IterableJsArray<PGF.TranslationResult> translations) { - outputPanel.removeStyleDependentName("working"); - for (PGF.TranslationResult tr : translations.iterable()) { - if (tr.getTranslations() != null) - for (PGF.Linearizations t : tr.getTranslations().iterable()) { - for (PGF.Linearization l : t.getLinearizations().iterable()) { - outputPanel.add(createTranslation(l.getTo(), l.getText())); - } - } - - if (tr.getTypeErrors() != null) - for (PGF.TcError error : tr.getTypeErrors()) { - SimplePanel panel = new SimplePanel(); - panel.addStyleName("my-typeError"); - panel.add(new HTML("<pre>"+error.getMsg()+"</pre>")); - outputPanel.add(panel); - } - } - } - public void onError (Throwable e) { - showError("Translation failed", e); - } - }); - } - - protected ClickListener translationClickListener = new ClickListener () { - public void onClick(Widget widget) { - Magnet magnet = (Magnet)widget; - setInputLanguage(magnet.getLanguage()); // FIXME: this causes an unnecessary update() - setText(magnet.getText(), magnet.getLanguage()); - } - }; - - protected Widget createTranslation(String language, String text) { - Magnet magnet = magnetFactory.createUsedMagnet(text, language); - magnet.addClickListener(translationClickListener); - String lang = pgf.getLanguageCode(language); - if (lang != null) { - magnet.getElement().setLang(lang); - } - return magnet; - } - - // - // Current text - // - - public String getText () { - return textPanel.getText(); - } - - public void setText(String text, String language) { - textPanel.setText(text, language); - } - - private void clear() { - textPanel.clear(); - } - - - // - // Status stuff - // - - protected void setStatus(String msg) { - statusPopup.setStatus(msg); - } - - protected void showError(String msg, Throwable e) { - statusPopup.showError(msg, e); - } - - protected void clearStatus() { - statusPopup.clearStatus(); - } - - // GUI - - protected Widget createUI() { - ClickListener magnetClickListener = new ClickListener () { - public void onClick(Widget widget) { - Magnet magnet = (Magnet)widget; - textPanel.addMagnet(magnet); - } - }; - magnetFactory = new MagnetFactory(magnetClickListener); - - textPanel = new FridgeTextPanel(magnetFactory); - textPanel.addChangeListener(new ChangeListener() { - public void onChange(Widget widget) { - update(); - } - }); - prefixPanel = new FlowPanel(); - prefixPanel.setStylePrimaryName("my-PrefixPanel"); - bagPanel = new FridgeBagPanel(); - outputPanel = new TranslationsPanel(); - SettingsPanel settingsPanel = new SettingsPanel(pgf, null, statusPopup); - - VerticalPanel vPanel = new VerticalPanel(); - vPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER); - vPanel.setWidth("100%"); - vPanel.add(prefixPanel); - vPanel.add(bagPanel); - - final DockPanel mainPanel = new DockPanel(); - mainPanel.setStyleName("my-FridgeApp"); - mainPanel.add(textPanel, DockPanel.NORTH); - mainPanel.add(settingsPanel, DockPanel.SOUTH); - mainPanel.add(vPanel, DockPanel.CENTER); - mainPanel.add(outputPanel, DockPanel.EAST); - - mainPanel.setCellHeight(vPanel, "100%"); - mainPanel.setCellWidth(vPanel, "80%"); - mainPanel.setCellHeight(outputPanel, "100%"); - mainPanel.setCellWidth(outputPanel, "20%"); - mainPanel.setCellVerticalAlignment(vPanel, HasVerticalAlignment.ALIGN_TOP); - mainPanel.setCellHorizontalAlignment(outputPanel, HasHorizontalAlignment.ALIGN_RIGHT); - mainPanel.setCellWidth(settingsPanel, "100%"); - - Window.addWindowResizeListener(new WindowResizeListener() { - public void onWindowResized(int w, int h) { - mainPanel.setPixelSize(w, h); - } - }); - int w = Window.getClientWidth(); - int h = Window.getClientHeight(); - mainPanel.setPixelSize(w, h); - - return mainPanel; - } - - private static class TranslationsPanel extends VerticalPanel { - public TranslationsPanel () { - setStylePrimaryName("my-TranslationsPanel"); - addStyleDependentName("empty"); - } - - public void clear () { - super.clear(); - addStyleDependentName("empty"); - } - - public void add(Widget w) { - removeStyleDependentName("empty"); - super.add(w); - } - - } - - - // - // History stuff - // - - protected class MyHistoryListener implements HistoryListener { - public void onHistoryChanged(String historyToken) { - updateSettingsFromHistoryToken(); - } - }; - - protected void updateSettingsFromHistoryToken() { - updateSettingsFromHistoryToken(History.getToken().split("/")); - } - - protected void updateSettingsFromHistoryToken(String[] tokenParts) { - if (tokenParts.length >= 1 && tokenParts[0].length() > 0) { - setGrammarURL(tokenParts[0]); - } - if (tokenParts.length >= 2 && tokenParts[1].length() > 0) { - setInputLanguage(tokenParts[1]); - } - } - - protected void setGrammarURL(String url) { - if (url != null && !url.equals(pgf.getGrammarURL())) { - pgf.setGrammarURL(url); - } - } - - protected void setInputLanguage (String inputLanguage) { - if (inputLanguage != null && !inputLanguage.equals(pgf.getInputLanguage())) { - pgf.setInputLanguage(inputLanguage); - } - } - - // - // Initialization - // - - protected class MySettingsListener implements SettingsListener { - // Will only happen on load - public void onAvailableGrammarsChanged() { - if (pgf.getGrammarURL() == null) { - List<String> grammars = pgf.getGrammars(); - if (!grammars.isEmpty()) { - pgf.setGrammarURL(grammars.get(0)); - } - } - } - public void onSelectedGrammarChanged() { - if (pgf.getInputLanguage() == null) { - pgf.setInputLanguage(pgf.getUserLanguage()); - } - } - public void onInputLanguageChanged() { - clear(); - } - public void onOutputLanguageChanged() { - update(); - } - public void onStartCategoryChanged() { - update(); - } - public void onSettingsError(String msg, Throwable e) { - showError(msg,e); - } - } - - public void onModuleLoad() { - statusPopup = new StatusPopup(); - - pgf = new PGFWrapper(); - RootPanel.get().add(createUI()); - pgf.addSettingsListener(new MySettingsListener()); - History.addHistoryListener(new MyHistoryListener()); - updateSettingsFromHistoryToken(); - pgf.updateAvailableGrammars(); - } - -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/FridgeBagPanel.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/FridgeBagPanel.java deleted file mode 100644 index bab14808e..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/FridgeBagPanel.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import java.util.*; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.user.client.ui.*; - -public class FridgeBagPanel extends Composite implements Iterable<Magnet> { - - private FlowPanel mainPanel; - - public FridgeBagPanel () { - mainPanel = new FlowPanel(); - - initWidget(new ScrollPanel(mainPanel)); - setStylePrimaryName("my-FridgeBagPanel"); - addStyleDependentName("empty"); - } - - public void clear() { - mainPanel.clear(); - } - - public void fill(List<Magnet> magnets) { - for (Magnet magnet : magnets) { - mainPanel.add(magnet); - } - - if (mainPanel.getWidgetCount() == 0) - addStyleDependentName("empty"); - else - removeStyleDependentName("empty"); - } - - public Iterator<Magnet> iterator() { - return (Iterator<Magnet>) (Iterator) mainPanel.iterator(); - } -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/FridgeTextPanel.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/FridgeTextPanel.java deleted file mode 100644 index a44a72446..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/FridgeTextPanel.java +++ /dev/null @@ -1,113 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import com.google.gwt.user.client.ui.*; - -public class FridgeTextPanel extends Composite { - - private MagnetFactory magnetFactory; - - private FlowPanel mainPanel; - - private ChangeListenerCollection listeners = null; - - public FridgeTextPanel (MagnetFactory magnetFactory) { - this.magnetFactory = magnetFactory; - mainPanel = new FlowPanel(); - mainPanel.setStylePrimaryName("magnets"); - DockPanel wrapper = new DockPanel(); - wrapper.add(mainPanel, DockPanel.CENTER); - Widget buttons = createButtonPanel(); - wrapper.add(buttons, DockPanel.EAST); - wrapper.setCellWidth(mainPanel, "100%"); - wrapper.setCellWidth(buttons, "6em"); - wrapper.setHorizontalAlignment(DockPanel.ALIGN_RIGHT); - initWidget(wrapper); - setStylePrimaryName("my-FridgeTextPanel"); - } - - - protected Widget createButtonPanel () { - Panel buttons = new VerticalPanel(); - buttons.setStylePrimaryName("buttons"); - PushButton deleteLastButton = new PushButton(new Image("org.grammaticalframework.ui.gwt.FridgeApp/delete-last.png")); - deleteLastButton.setTitle("Removes the last magnet."); - deleteLastButton.addClickListener(new ClickListener () { - public void onClick(Widget sender) { - deleteLast(); - } - }); - buttons.add(deleteLastButton); - PushButton clearButton = new PushButton("Clear"); - clearButton.addClickListener(new ClickListener () { - public void onClick(Widget sender) { - clear(); - } - }); - clearButton.setTitle("Removes all magnets."); - buttons.add(clearButton); - return buttons; - } - - public void setEngaged(boolean engaged) { - if (engaged) { - addStyleDependentName("engage"); - } else { - removeStyleDependentName("engage"); - } - } - - public String getText () { - StringBuilder sb = new StringBuilder(); - for (Widget w : mainPanel) { - if (w instanceof Magnet) { - String word = ((Magnet)w).getText(); - if (sb.length() > 0) { - sb.append(' '); - } - sb.append(word); - } - } - return sb.toString(); - } - - public void setText (String text, String language) { - if (!text.equals(getText())) { - mainPanel.clear(); - for (String word : text.split("\\s+")) { - if (word.length() > 0) { - mainPanel.add(magnetFactory.createUsedMagnet(word, language)); - } - } - fireChange(); - } - } - - public void clear () { - mainPanel.clear(); - fireChange(); - } - - public void addMagnet (Magnet magnet) { - mainPanel.add(magnetFactory.createUsedMagnet(magnet)); - fireChange(); - } - - public void deleteLast() { - int c = mainPanel.getWidgetCount(); - if (c > 0) { - mainPanel.remove(c-1); - fireChange(); - } - } - - protected void fireChange() { - listeners.fireChange(this); - } - - public void addChangeListener(ChangeListener listener) { - if (listeners == null) { - listeners = new ChangeListenerCollection(); - } - listeners.add(listener); - } -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/GrammarsPanel.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/GrammarsPanel.java deleted file mode 100644 index 0857c3c4e..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/GrammarsPanel.java +++ /dev/null @@ -1,201 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import java.util.*; -import com.google.gwt.user.client.*; -import com.google.gwt.user.client.ui.*; -import com.google.gwt.http.client.*; -import com.google.gwt.xml.client.*; -import com.google.gwt.event.logical.shared.*; -import com.google.gwt.event.dom.client.*; -import com.google.gwt.event.shared.*; - -public class GrammarsPanel extends Composite { - - private PGFWrapper pgf; - private ContentService contentService; - private StatusPopup statusPopup; - - private VerticalPanel grammarsPanel; - private FormPanel form = null; - - public GrammarsPanel(PGFWrapper pgf, ContentService contentService, StatusPopup statusPopup) { - this.pgf = pgf; - this.contentService = contentService; - this.statusPopup = statusPopup; - - VerticalPanel vpanel = new VerticalPanel(); - - Button btnNew = new Button("New Grammar"); - btnNew.addClickListener(new ClickListener() { - public void onClick(Widget sender) { - if (form == null) { - grammarsPanel.insert(new GrammarInfoPanel(null),0); - } - } - }); - vpanel.add(btnNew); - - grammarsPanel = new VerticalPanel(); - grammarsPanel.setWidth("100%"); - vpanel.add(grammarsPanel); - - initWidget(vpanel); - setStylePrimaryName("my-GrammarsPanel"); - - contentService.addSettingsListener(new MySettingsListener()); - } - - private class GrammarInfoPanel extends Composite { - public GrammarInfoPanel(final ContentService.GrammarInfo grammar) { - final VerticalPanel vpanel = new VerticalPanel(); - - if (grammar != null) { - FlexTable header = new FlexTable(); - header.setStylePrimaryName("my-TableHeader"); - header.setText(0,0,grammar.getName()); - vpanel.add(header); - - final Image updateButton = new Image("org.grammaticalframework.ui.gwt.EditorApp/grammar-buttons.png",0,0,20,20); - updateButton.setTitle("Edit the grammar definition."); - updateButton.setStylePrimaryName("toolbar-button"); - header.setWidget(0,1,updateButton); - header.getColumnFormatter().setWidth(1,"20px"); - - final Image deleteButton = new Image("org.grammaticalframework.ui.gwt.EditorApp/grammar-buttons.png",20,0,20,20); - deleteButton.setTitle("Delete this grammar."); - deleteButton.setStylePrimaryName("toolbar-button"); - header.setWidget(0,2,deleteButton); - header.getColumnFormatter().setWidth(2,"20px"); - - final Label descr = new Label(grammar.getDescription()); - descr.setStylePrimaryName("descr-label"); - vpanel.add(descr); - - updateButton.addClickListener(new ClickListener () { - public void onClick(Widget sender) { - if (form == null) { - vpanel.remove(descr); - vpanel.add(form = createUploadForm(grammar)); - } - } - }); - - deleteButton.addClickListener(new ClickListener () { - public void onClick(Widget sender) { - contentService.deleteGrammar(grammar.getURL(), new ContentService.DeleteCallback() { - public void onResult(ContentService.DeleteResult result) { - contentService.updateAvailableGrammars(); - } - - public void onError(Throwable e) { - statusPopup.showError("Delete failed", e); - } - }); - } - }); - } else { - FlexTable header = new FlexTable(); - header.setStylePrimaryName("my-TableHeader"); - header.setText(0,0,"Add New Grammar"); - vpanel.add(header); - vpanel.add(form = createUploadForm(grammar)); - } - - initWidget(vpanel); - setStylePrimaryName("my-GrammarInfoPanel"); - } - - public FormPanel createUploadForm(final ContentService.GrammarInfo grammar) { - UploadFormHandler uploadFormHandler = new UploadFormHandler(); - - final FormPanel form = new FormPanel(); - form.setWidth("100%"); - form.setEncoding(FormPanel.ENCODING_MULTIPART); - form.setMethod(FormPanel.METHOD_POST); - form.setAction(ContentService.getInit().getContentURL()); - form.addSubmitHandler(uploadFormHandler); - form.addSubmitCompleteHandler(uploadFormHandler); - - VerticalPanel vPanel = new VerticalPanel(); - vPanel.setWidth("100%"); - form.add(vPanel); - - vPanel.add(new HTML("<input type=\"hidden\" name=\"userId\" value=\""+ContentService.getInit().getUserId()+"\"/>\n"+ - "<input type=\"hidden\" name=\"command\" value=\"update_grammar\"/>")); - - HorizontalPanel hPanel = new HorizontalPanel(); - hPanel.setSpacing(8); - hPanel.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE); - vPanel.add(hPanel); - - final FileUpload fileUpload = new FileUpload(); - fileUpload.setName("file"); - hPanel.add(fileUpload); - - hPanel.add(new HTML(" ")); - - hPanel.add(new Label("Name:")); - final TextBox grammarName = new TextBox(); - grammarName.setName("name"); - grammarName.setWidth("300px"); - hPanel.add(grammarName); - - hPanel.add(new HTML(" ")); - - hPanel.add(new Button("Upload", new ClickListener() { - public void onClick(Widget sender) { - if (grammar == null && - fileUpload.getFilename().equals("")) - statusPopup.showError("You must select a file to upload", null); - else - form.submit(); - } - })); - hPanel.add(new Button("Cancel", new ClickListener() { - public void onClick(Widget sender) { - contentService.updateAvailableGrammars(); - } - })); - - vPanel.add(new Label("Description:")); - TextArea grammarDescr = new TextArea(); - grammarDescr.setName("description"); - grammarDescr.setWidth("100%"); - grammarDescr.setHeight("50px"); - vPanel.add(grammarDescr); - - if (grammar != null) { - grammarName.setText(grammar.getName()); - grammarDescr.setText(grammar.getDescription()); - - vPanel.add(new HTML("<input type=\"hidden\" name=\"url\" value=\""+grammar.getURL()+"\"/>")); - } - - return form; - } - - private class UploadFormHandler implements FormPanel.SubmitHandler, FormPanel.SubmitCompleteHandler { - public void onSubmit(FormPanel.SubmitEvent event) { - } - - public void onSubmitComplete(FormPanel.SubmitCompleteEvent event) { - contentService.updateAvailableGrammars(); - } - } - } - - private class MySettingsListener implements SettingsListener { - public void onAvailableGrammarsChanged() { - form = null; - grammarsPanel.clear(); - for (ContentService.GrammarInfo grammar : contentService.getGrammars()) { - grammarsPanel.add(new GrammarInfoPanel(grammar)); - } - } - public void onSelectedGrammarChanged() { } - public void onInputLanguageChanged() { } - public void onOutputLanguageChanged() { } - public void onStartCategoryChanged() { } - public void onSettingsError(String msg, Throwable e) { } - } -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/IterableJsArray.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/IterableJsArray.java deleted file mode 100644 index b1d501ddb..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/IterableJsArray.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import java.util.Iterator; -import java.util.NoSuchElementException; - -import com.google.gwt.core.client.JavaScriptObject; -import com.google.gwt.core.client.JsArray; - -public class IterableJsArray<T extends JavaScriptObject> extends JsArray<T> { - - protected IterableJsArray() {} - - public final boolean isEmpty() { - return length() == 0; - } - - public final Iterable<T> iterable() { - return new Iterable<T>() { - public Iterator<T> iterator() { - return new Iterator<T>() { - private int i = 0; - public boolean hasNext() { - return i < length(); - } - public T next() { - if (!hasNext()) { - throw new NoSuchElementException(); - } - return get(i++); - } - public void remove() { - throw new UnsupportedOperationException(); - } - }; - } - }; - } - -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/JSONCallback.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/JSONCallback.java deleted file mode 100644 index 485173b49..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/JSONCallback.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import com.google.gwt.core.client.JavaScriptObject; - -public interface JSONCallback<T extends JavaScriptObject> { - public void onResult (T result) ; - public void onError (Throwable e) ; -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/JSONRequest.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/JSONRequest.java deleted file mode 100644 index 15da7caf0..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/JSONRequest.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import com.google.gwt.http.client.*; - -public class JSONRequest { - - private Request httpRequest; - - JSONRequest (Request httpRequest) { - this.httpRequest = httpRequest; - } - - public void cancel() { - if (httpRequest != null) { - httpRequest.cancel(); - } - } - -}
\ No newline at end of file diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/JSONRequestBuilder.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/JSONRequestBuilder.java deleted file mode 100644 index e2e83dc6f..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/JSONRequestBuilder.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import com.google.gwt.core.client.JavaScriptObject; -import com.google.gwt.http.client.Request; -import com.google.gwt.http.client.RequestBuilder; -import com.google.gwt.http.client.RequestCallback; -import com.google.gwt.http.client.RequestException; -import com.google.gwt.http.client.Response; -import com.google.gwt.http.client.URL; - -import java.util.List; - -public class JSONRequestBuilder { - - public static class Arg { - public final String name; - public final String value; - public Arg (String name, String value) { - this.name = name; - this.value = value; - } - public Arg (String name, int value) { - this(name, Integer.toString(value)); - } - } - - public static <T extends JavaScriptObject> JSONRequest sendRequest (String base, List<Arg> vars, final JSONCallback<T> callback) { - String url = getQueryURL(base,vars); - RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url); - builder.setTimeoutMillis(30000); - builder.setHeader("Accept","text/plain, text/html;q=0.5, */*;q=0.1"); - Request request = null; - - try { - request = builder.sendRequest(null, new RequestCallback() { - public void onError(Request request, Throwable e) { - callback.onError(e); - } - - public void onResponseReceived(Request request, Response response) { - if (200 == response.getStatusCode()) { - callback.onResult(JSONRequestBuilder.<T>eval(response.getText())); - } else { - RequestException e = new RequestException("Response not OK: " + response.getStatusCode() + ". " + response.getText()); - callback.onError(e); - } - } - }); - } catch (RequestException e) { - callback.onError(e); - } - - return new JSONRequest(request); - } - - public static <T extends JavaScriptObject> JSONRequest sendDataRequest (String base, List<Arg> vars, String content, final JSONCallback<T> callback) { - String url = getQueryURL(base,vars); - RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, url); - builder.setTimeoutMillis(30000); - builder.setHeader("Content-Length", Integer.toString(content.length())); - builder.setHeader("Accept","text/plain, text/html;q=0.5, */*;q=0.1"); - Request request = null; - - try { - request = builder.sendRequest(content, new RequestCallback() { - public void onError(Request request, Throwable e) { - callback.onError(e); - } - - public void onResponseReceived(Request request, Response response) { - if (200 == response.getStatusCode()) { - callback.onResult(JSONRequestBuilder.<T>eval(response.getText())); - } else { - RequestException e = new RequestException("Response not OK: " + response.getStatusCode() + ". " + response.getText()); - callback.onError(e); - } - } - }); - } catch (RequestException e) { - callback.onError(e); - } - - return new JSONRequest(request); - } - - private static native <T extends JavaScriptObject> T eval(String json) /*-{ - return eval('(' + json + ')'); - }-*/; - - public static String getQueryURL(String base, List<Arg> args) { - StringBuffer sb = new StringBuffer(); - sb.append(base); - sb.append("?"); - if (args != null) { - for (Arg arg : args) { - if (arg.value != null) { - if (sb.length() > 0) { - sb.append("&"); - } - sb.append(URL.encodeComponent(arg.name)); - sb.append("="); - sb.append(URL.encodeComponent(arg.value)); - } - } - } - return sb.toString(); - } - -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/LinearizationsPanel.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/LinearizationsPanel.java deleted file mode 100644 index 04aa5d5d7..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/LinearizationsPanel.java +++ /dev/null @@ -1,150 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import java.util.*; - -import com.google.gwt.core.client.*; -import com.google.gwt.user.client.*; -import com.google.gwt.user.client.ui.*; -import com.google.gwt.event.dom.client.*; -import com.google.gwt.event.logical.shared.*; -import com.google.gwt.event.shared.*; - -public class LinearizationsPanel extends Composite { - - protected PGFWrapper pgf; - - public LinearizationsPanel(PGFWrapper pgf, PGF.Linearizations lins) { - this.pgf = pgf; - - HorizontalPanel hPanel = new HorizontalPanel(); - VerticalPanel linsPanel = new VerticalPanel(); - linsPanel.addStyleName("my-translation-bar"); - hPanel.add(linsPanel); - HorizontalPanel btnPanel = new HorizontalPanel(); - btnPanel.addStyleName("my-translation-btns"); - btnPanel.setSpacing(4); - btnPanel.add(createAbsTreeButton(lins.getTree())); - btnPanel.add(createAlignButton(lins.getTree())); - hPanel.add(btnPanel); - hPanel.setCellHorizontalAlignment(btnPanel,HasHorizontalAlignment.ALIGN_RIGHT); - - for (PGF.Linearization l : lins.getLinearizations().iterable()) { - linsPanel.add(createTranslation(l.getTo(), lins.getTree(), l.getText())); - } - - initWidget(hPanel); - setStylePrimaryName("my-translation-frame"); - } - - protected Widget createAbsTreeButton(final String abstractTree) { - Image treeBtn = new Image("org.grammaticalframework.ui.gwt.EditorApp/tree-btn.png"); - treeBtn.setTitle("Displays the abstract syntax tree."); - treeBtn.addClickListener( - new ClickListener() { - public void onClick(Widget sender) { - // Create a dialog box and set the caption text - final DialogBox dialogBox = new DialogBox(); - dialogBox.setText("Abstract Syntax Tree"); - - // Create a table to layout the content - HorizontalPanel dialogContents = new HorizontalPanel(); - dialogContents.setSpacing(4); - dialogBox.setWidget(dialogContents); - - // Add an image to the dialog - - Frame image = new Frame(pgf.graphvizAbstractTree(abstractTree)); - image.addStyleName("my-treeimage"); - dialogContents.add(image); - - // Add a close button at the bottom of the dialog - Button closeButton = new Button("Close", - new ClickListener() { - public void onClick(Widget sender) { - dialogBox.hide(); - } - }); - dialogContents.add(closeButton); - - dialogBox.center(); - dialogBox.show(); - } - }); - return treeBtn; - } - - protected Widget createAlignButton(final String abstractTree) { - Image alignBtn = new Image("org.grammaticalframework.ui.gwt.EditorApp/align-btn.png"); - alignBtn.setTitle("Displays word-alignment diagram."); - alignBtn.addClickListener( - new ClickListener() { - public void onClick(Widget sender) { - // Create a dialog box and set the caption text - final DialogBox dialogBox = new DialogBox(); - dialogBox.setText("Word Alignment"); - - // Create a table to layout the content - HorizontalPanel dialogContents = new HorizontalPanel(); - dialogContents.setSpacing(4); - dialogBox.setWidget(dialogContents); - - // Add an image to the dialog - Frame image = new Frame(pgf.graphvizAlignment(abstractTree)); - image.addStyleName("my-alignmentimage"); - dialogContents.add(image); - - // Add a close button at the bottom of the dialog - Button closeButton = new Button("Close", - new ClickListener() { - public void onClick(Widget sender) { - dialogBox.hide(); - } - }); - dialogContents.add(closeButton); - - dialogBox.center(); - dialogBox.show(); - } - }); - return alignBtn; - } - - protected Widget createTranslation(final String language, final String abstractTree, String text) { - Label l = new Label(text); - l.addStyleName("my-translation"); - String lang = pgf.getLanguageCode(language); - if (lang != null) { - l.getElement().setLang(lang); - } - l.addClickListener(new ClickListener() { - public void onClick(Widget sender) { - // Create a dialog box and set the caption text - final DialogBox dialogBox = new DialogBox(); - dialogBox.setText("Parse Tree"); - - // Create a table to layout the content - HorizontalPanel dialogContents = new HorizontalPanel(); - dialogContents.setSpacing(4); - dialogBox.setWidget(dialogContents); - - // Add an image to the dialog - Frame image = new Frame(pgf.graphvizParseTree(abstractTree, language)); - image.addStyleName("my-treeimage"); - dialogContents.add(image); - - // Add a close button at the bottom of the dialog - Button closeButton = new Button("Close", - new ClickListener() { - public void onClick(Widget sender) { - dialogBox.hide(); - } - }); - dialogContents.add(closeButton); - - dialogBox.center(); - dialogBox.show(); - } - }); - return l; - } -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/Magnet.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/Magnet.java deleted file mode 100644 index ded8a171a..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/Magnet.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import com.google.gwt.user.client.ui.HTML; - -public class Magnet extends HTML { - - private String language; - - public Magnet (String text, String language) { - this.language = language; - setHTML(text); - setStylePrimaryName("my-Magnet"); - } - - public String getLanguage() { - return language; - } - - public String getWord() { - return getHTML(); - } -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/MagnetFactory.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/MagnetFactory.java deleted file mode 100644 index 5bb780456..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/MagnetFactory.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import com.google.gwt.user.client.ui.*; - -public class MagnetFactory { - - private ClickListener clickListener; - - public MagnetFactory (ClickListener clickListener) { - this.clickListener = clickListener; - } - - public Magnet createUsedMagnet(Magnet magnet) { - return createUsedMagnet(magnet.getText(), magnet.getLanguage()); - } - - public Magnet createUsedMagnet(String text, String language) { - return new Magnet(text, language); - } - - public Magnet createMagnet(Magnet magnet) { - return createMagnet(magnet.getText(), magnet.getLanguage()); - } - - public Magnet createMagnet(String text, String language) { - Magnet magnet = new Magnet(text, language); - magnet.addClickListener(clickListener); - return magnet; - } - -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/MagnetSearchBox.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/MagnetSearchBox.java deleted file mode 100644 index 5a2a70401..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/MagnetSearchBox.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import java.util.*; - -import com.google.gwt.core.client.*; -import com.google.gwt.user.client.*; -import com.google.gwt.user.client.ui.*; -import com.google.gwt.event.dom.client.*; -import com.google.gwt.event.logical.shared.*; -import com.google.gwt.event.shared.*; -import com.google.gwt.dom.client.Node; -import com.google.gwt.dom.client.Text; -import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.Document; -import org.grammaticalframework.ui.gwt.client.selection.*; - -public class MagnetSearchBox extends FocusWidget { - public MagnetSearchBox() { - this(Document.get().createDivElement()); - } - - public MagnetSearchBox(Element elem) { - super(elem); - elem.setAttribute("contentEditable", "true"); - setStyleName("searchbox"); - } - - public String getText() { - return getElement().getInnerText(); - } - - public void setText(String s) { - getElement().setInnerText(s); - } - - public int getCursorPos() { - return 0; - } - - public void setCursorPos(int pos) { - Node child = getElement().getFirstChild(); - if (child instanceof Text) { - SelectionEndPoint selPoint = new SelectionEndPoint((Text) child,pos); - Selection sel = Selection.getSelection(); - sel.select(selPoint,selPoint); - } - return; - } -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/MorphoApp.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/MorphoApp.java deleted file mode 100644 index 44e7bacb6..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/MorphoApp.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import java.util.*; - -import com.google.gwt.core.client.*; -import com.google.gwt.user.client.ui.*; -import com.google.gwt.core.client.JavaScriptObject; - -public class MorphoApp implements EntryPoint { - private TextBox lemmaBox = new TextBox(); - private Button submitButton = new Button("Submit"); - private Grid outputGrid = new Grid(2,0); - - public void onModuleLoad() { - HorizontalPanel inputPanel = new HorizontalPanel(); - inputPanel.add(lemmaBox); - inputPanel.add(submitButton); - - submitButton.addClickListener(new ClickListener() { - public void onClick(Widget sender) { - - String url = "http://localhost:41296/morpho/morpho.fcgi/eval"; - List<JSONRequestBuilder.Arg> args = new ArrayList<JSONRequestBuilder.Arg>(); - args.add(new JSONRequestBuilder.Arg("term", lemmaBox.getText())); - - JSONRequestBuilder.sendRequest(url, args, new TableCallback() { - public void onResult (IterableJsArray<InflectionForm> table) - { - outputGrid.resize(table.length(),2); - int row = 0; - for (InflectionForm form : table.iterable()) { - outputGrid.setText(row,0,form.getName()); - outputGrid.setText(row,1,form.getValue()); - row++; - } - } - - public void onError (Throwable e) - { - outputGrid.resize(1,1); - outputGrid.setText(0,0,e.toString()); - } - }); - } - }); - - - VerticalPanel mainPanel = new VerticalPanel(); - mainPanel.add(inputPanel); - mainPanel.add(outputGrid); - RootPanel.get().add(mainPanel); - } - - public interface TableCallback extends JSONCallback<IterableJsArray<InflectionForm>> { } - - public static class InflectionForm extends JavaScriptObject { - protected InflectionForm() { } - - public final native String getName() /*-{ return this.name; }-*/; - - public final native String getValue() /*-{ return this.value; }-*/; - } -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/MyListBox.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/MyListBox.java deleted file mode 100644 index ce716b91d..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/MyListBox.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import java.util.Collection; - -import com.google.gwt.user.client.ui.ListBox; - -public class MyListBox extends ListBox { - - public MyListBox () { } - - public void clearSelection () { - setSelectedIndex(-1); - } - - public String getSelectedValue() { - int i = getSelectedIndex(); - return i == -1 ? null : getValue(i); - } - - public void setSelectedValue(String value) { - if (value == null) { - clearSelection(); - } else { - int c = getItemCount(); - for (int i = 0; i < c; i++) { - if (getValue(i).equals(value)) { - setSelectedIndex(i); - return; - } - } - } - } - - public void addItems(Collection<String> items) { - for (String item : items) { - addItem(item); - } - } - -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/PGF.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/PGF.java deleted file mode 100644 index 17eef12bb..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/PGF.java +++ /dev/null @@ -1,241 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import org.grammaticalframework.ui.gwt.client.JSONRequestBuilder.Arg; - -import java.util.*; -import com.google.gwt.core.client.*; -import com.google.gwt.http.client.*; - -public class PGF { - - public PGF () { - } - - /* Grammar */ - - public JSONRequest grammar (String pgfURL, final GrammarCallback callback) { - return sendGrammarRequest(pgfURL, "grammar", new ArrayList<Arg>(), callback); - } - - public interface GrammarCallback extends JSONCallback<Grammar> { } - - public static class Grammar extends JavaScriptObject { - protected Grammar() { } - - public final native String getName() /*-{ return this.name; }-*/; - - public final native String getUserLanguage() /*-{ return this.userLanguage; }-*/; - - public final native IterableJsArray<Language> getLanguages() /*-{ return this.languages; }-*/; - - public final native JsArrayString getCategories() /*-{ return this.categories; }-*/; - - public final native JsArrayString getFunctions() /*-{ return this.functions; }-*/; - } - - public static class Language extends JavaScriptObject { - protected Language() { } - - public final native String getName() /*-{ return this.name; }-*/; - public final native String getLanguageCode() /*-{ return this.languageCode; }-*/; - } - - /* Translation */ - - public JSONRequest translate (String pgfURL, String input, String fromLang, String cat, String toLang, - final TranslateCallback callback) { - List<Arg> args = new ArrayList<Arg>(); - args.add(new Arg("input", input)); - args.add(new Arg("from", fromLang)); - args.add(new Arg("cat", cat)); - args.add(new Arg("to", toLang)); - return sendGrammarRequest(pgfURL, "translate", args, callback); - } - - public interface TranslateCallback extends JSONCallback<IterableJsArray<TranslationResult>> { } - - public static class TranslationResult extends JavaScriptObject { - protected TranslationResult() { } - - public final native String getFrom() /*-{ return this.from; }-*/; - public final native BracketedString getBracketedString() /*-{ return this.brackets; }-*/; - public final native IterableJsArray<Linearizations> getTranslations() /*-{ return this.translations; }-*/; - public final native TcError[] getTypeErrors() /*-{ return this.typeErrors; }-*/; - } - - public static class Linearizations extends JavaScriptObject { - protected Linearizations() { } - - public final native String getTree() /*-{ return this.tree; }-*/; - public final native IterableJsArray<Linearization> getLinearizations() /*-{ return this.linearizations; }-*/; - } - - /* Completion */ - - /** - * Get suggestions for completing the input. - * @param limit The number of suggestions to get. - * If -1 is passed, all available suggestions are retrieved. - */ - public JSONRequest complete (String pgfURL, String input, String fromLang, String cat, int limit, final CompleteCallback callback) { - List<Arg> args = new ArrayList<Arg>(); - args.add(new Arg("input", input)); - args.add(new Arg("from", fromLang)); - args.add(new Arg("cat", cat)); - if (limit > 0) { - args.add(new Arg("limit", limit)); - } - return sendGrammarRequest(pgfURL, "complete", args, callback); - } - - public interface CompleteCallback extends JSONCallback<IterableJsArray<Completion>> { } - - public static class Completion extends JavaScriptObject { - protected Completion() { } - - public final native String getFrom() /*-{ return this.from; }-*/; - public final native BracketedString getBracketedString() /*-{ return this.brackets; }-*/; - public final native String[] getCompletions() /*-{ return this.completions; }-*/; - public final native String getText() /*-{ return this.text; }-*/; - } - - /* Parsing */ - - public JSONRequest parse (String pgfURL, String input, String fromLang, String cat, final ParseCallback callback) { - List<Arg> args = new ArrayList<Arg>(); - args.add(new Arg("input", input)); - args.add(new Arg("from", fromLang)); - args.add(new Arg("cat", cat)); - return sendGrammarRequest(pgfURL, "parse", args, callback); - } - - public interface ParseCallback extends JSONCallback<IterableJsArray<ParseResult>> { } - - public static class ParseResult extends JavaScriptObject { - protected ParseResult() { } - - public final native String getFrom() /*-{ return this.from; }-*/; - public final native BracketedString getBracketedString() /*-{ return this.brackets; }-*/; - public final native String[] getTrees() /*-{ return this.trees; }-*/; - public final native TcError[] getTypeErrors() /*-{ return this.typeErrors; }-*/; - } - - public static class BracketedString extends JavaScriptObject { - protected BracketedString() { } - - public final native String getToken() /*-{ return this.token; }-*/; - - public final native String getCat() /*-{ return this.cat; }-*/; - public final native int getFId() /*-{ return this.fid; }-*/; - public final native int getIndex() /*-{ return this.index; }-*/; - public final native BracketedString[] getChildren() /*-{ return this.children; }-*/; - - public final String render() { - if (getToken() != null) - return getToken(); - else { - StringBuilder sbuilder = new StringBuilder(); - for (BracketedString bs : getChildren()) { - if (sbuilder.length() > 0) - sbuilder.append(' '); - sbuilder.append(bs.render()); - } - return sbuilder.toString(); - } - } - } - - public static class TcError extends JavaScriptObject { - protected TcError() { } - - public final native int getFId() /*-{ return this.fid; }-*/; - public final native String getMsg() /*-{ return this.msg; }-*/; - } - - - /* Linearization */ - - public JSONRequest linearize (String pgfURL, String tree, String toLang, final LinearizeCallback callback) { - List<Arg> args = new ArrayList<Arg>(); - args.add(new Arg("tree", tree)); - args.add(new Arg("to", toLang)); - return sendGrammarRequest(pgfURL, "linearize", args, callback); - } - - public interface LinearizeCallback extends JSONCallback<IterableJsArray<Linearization>> { } - - public static class Linearization extends JavaScriptObject { - protected Linearization() { } - - public final native String getTo() /*-{ return this.to; }-*/; - public final native String getText() /*-{ return this.text; }-*/; - } - - public String graphvizAbstractTree(String pgfURL, String abstractTree) { - List<Arg> args = new ArrayList<Arg>(); - args.add(new Arg("command", "abstrtree")); - args.add(new Arg("tree", abstractTree)); - return JSONRequestBuilder.getQueryURL(pgfURL,args); - } - - public String graphvizParseTree(String pgfURL, String abstractTree, String lang) { - List<Arg> args = new ArrayList<Arg>(); - args.add(new Arg("command", "parsetree")); - args.add(new Arg("tree", abstractTree)); - args.add(new Arg("from", lang)); - return JSONRequestBuilder.getQueryURL(pgfURL,args); - } - - public String graphvizAlignment(String pgfURL, String abstractTree) { - List<Arg> args = new ArrayList<Arg>(); - args.add(new Arg("command", "alignment")); - args.add(new Arg("tree", abstractTree)); - return JSONRequestBuilder.getQueryURL(pgfURL,args); - } - - public Request browse(String pgfURL, String id, String href, String cssClass, RequestCallback callback) { - List<Arg> args = new ArrayList<Arg>(); - args.add(new Arg("command", "browse")); - args.add(new Arg("id", id)); - args.add(new Arg("href", href)); - args.add(new Arg("css-class", cssClass)); - - Request request = null; - try { - RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, - JSONRequestBuilder.getQueryURL(pgfURL,args)); - builder.setCallback(callback); - request = builder.send(); - } catch (RequestException ex) { - callback.onError(request, ex); - } - - return request; - } - - public JSONRequest generateAll(String pgfURL, String cat, int depth, int limit, String toLang, GenerationCallback callback) { - List<Arg> args = new ArrayList<Arg>(); - args.add(new Arg("cat", cat)); - args.add(new Arg("depth", depth)); - args.add(new Arg("limit", limit)); - args.add(new Arg("to", toLang)); - return sendGrammarRequest(pgfURL, "generate", args, callback); - } - - public JSONRequest generateRandom(String pgfURL, String cat, int depth, int limit, String toLang, GenerationCallback callback) { - List<Arg> args = new ArrayList<Arg>(); - args.add(new Arg("cat", cat)); - args.add(new Arg("depth", depth)); - args.add(new Arg("limit", limit)); - args.add(new Arg("to", toLang)); - return sendGrammarRequest(pgfURL, "random", args, callback); - } - - public interface GenerationCallback extends JSONCallback<IterableJsArray<Linearizations>> {} - - public <T extends JavaScriptObject> JSONRequest sendGrammarRequest(String pgfURL, String resource, List<Arg> args, final JSONCallback<T> callback) { - args.add(new Arg("command", resource)); - return JSONRequestBuilder.sendRequest(pgfURL, args, callback); - } - -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/PGFWrapper.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/PGFWrapper.java deleted file mode 100644 index 1e248fa40..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/PGFWrapper.java +++ /dev/null @@ -1,294 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import com.google.gwt.http.client.*; -import com.google.gwt.xml.client.*; -import com.google.gwt.core.client.*; - -public class PGFWrapper { - - private String grammarURL = null; - - private PGF pgf; - - private String inputLanguage = null; - - private String outputLanguage = null; - - private String cat = null; - - // Cached info about the available grammars - - private List<String> grammars; - - // Cached info about the currently selected grammar - - private String userLanguage; - - private LinkedHashMap<String,PGF.Language> languages; - - private JsArrayString categories; - private JsArrayString functions; - - // Event listeners - - private List<SettingsListener> listeners = new LinkedList<SettingsListener>(); - - - public PGFWrapper() { - this.pgf = new PGF(); - } - - public void updateAvailableGrammars() { - String url = "/grammars.xml"; - RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, URL.encode(url)); - try - { - builder.sendRequest(null, new RequestCallback() { - public void onResponseReceived(Request request, Response response) - { - if (200 == response.getStatusCode()) - { - grammars = new ArrayList<String>(); - try - { - Document grammarsDoc = XMLParser.parse(response.getText()); - - NodeList grammarsList = grammarsDoc.getElementsByTagName("grammar"); - for (int i = 0; i < grammarsList.getLength(); i++) - { - Node grammarNode = grammarsList.item(i); - grammars.add(((Element)grammarNode).getAttribute("name")); - } - } - catch (DOMException e) - { - fireSettingsError("Could not parse XML document.", e); - } - fireAvailableGrammarsChanged(); - } - else - { - fireSettingsError("Error getting grammar list", null); - } - } - - public void onError(Request request, Throwable e) - { - fireSettingsError("Error getting grammar list", e); - } - }); - } - catch (RequestException e) - { - fireSettingsError("Couldn't connect to server", e); - } - } - - protected void updateSelectedGrammar () { - if (grammarURL == null) - return; - - clearCachedInfo(); - pgf.grammar(grammarURL, new PGF.GrammarCallback() { - public void onResult(PGF.Grammar grammar) { - userLanguage = grammar.getUserLanguage(); - languages = new LinkedHashMap<String,PGF.Language>(); - for (PGF.Language l : grammar.getLanguages().iterable()) { - String name = l.getName(); - languages.put(name, l); - } - - categories = grammar.getCategories(); - functions = grammar.getFunctions(); - - fireSelectedGrammarChanged(); - } - - public void onError (Throwable e) { - fireSettingsError("Error getting language information", e); - } - }); - } - - // - // PGF functionality - // - - public JSONRequest translate (String input, final PGF.TranslateCallback callback) { - return pgf.translate(grammarURL, input, inputLanguage, cat, outputLanguage, callback); - } - - public JSONRequest complete (String input, int limit, final PGF.CompleteCallback callback) { - return pgf.complete(grammarURL, input, inputLanguage, cat, limit, callback); - } - - public JSONRequest parse (String input, final PGF.ParseCallback callback) { - return pgf.parse(grammarURL, input, inputLanguage, cat, callback); - } - - public JSONRequest linearize (String tree, final PGF.LinearizeCallback callback) { - return pgf.linearize(grammarURL, tree, outputLanguage, callback); - } - - public String graphvizAbstractTree(String abstractTree) { - return pgf.graphvizAbstractTree(grammarURL,abstractTree); - } - - public String graphvizParseTree(String abstractTree, String lang) { - return pgf.graphvizParseTree(grammarURL,abstractTree,lang); - } - - public String graphvizAlignment(String abstractTree) { - return pgf.graphvizAlignment(grammarURL,abstractTree); - } - - public Request browse(String id, String href, String cssClass, RequestCallback callback) { - return pgf.browse(grammarURL, id, href, cssClass, callback); - } - - public JSONRequest generateAll(String cat, int depth, int limit, PGF.GenerationCallback callback) { - return pgf.generateAll(grammarURL, cat, depth, limit, outputLanguage, callback); - } - - public JSONRequest generateRandom(String cat, int depth, int limit, PGF.GenerationCallback callback) { - return pgf.generateRandom(grammarURL, cat, depth, limit, outputLanguage, callback); - } - - // - // Settings - // - - public String getGrammarURL() { - return grammarURL; - } - - public void setGrammarURL(String grammarURL) { - this.grammarURL = grammarURL; - this.inputLanguage = null; - this.outputLanguage = null; - this.cat = null; - updateSelectedGrammar(); - } - - public String getInputLanguage() { - return inputLanguage; - } - - public void setInputLanguage(String inputLanguage) { - this.inputLanguage = inputLanguage; - fireInputLanguageChanged(); - } - - public String getOutputLanguage() { - return outputLanguage; - } - - public void setOutputLanguage(String outputLanguage) { - this.outputLanguage = outputLanguage; - fireOutputLanguageChanged(); - } - - public String getStartCategory() { - return cat; - } - - public void setStartCategory(String cat) { - this.cat = cat; - fireStartCategoryChanged(); - } - - public JsArrayString getCategories() { - return categories; - } - - public JsArrayString getFunctions() { - return functions; - } - - - // - // Information about the available grammars - // - public List<String> getGrammars() { - return grammars; - } - - // - // Information about the selected grammar - // - private void clearCachedInfo () { - languages = null; - } - - public String getUserLanguage () { - return userLanguage; - } - - public String getLanguageCode (String language) { - PGF.Language l = languages.get(language); - return l == null ? null : l.getLanguageCode(); - } - - public Collection<String> getAllLanguages() { - return languages.keySet(); - } - - // - // Listeners - // - - public static class SettingsAdapter implements SettingsListener { - public void onAvailableGrammarsChanged() {} - public void onSelectedGrammarChanged() {} - public void onInputLanguageChanged() {} - public void onOutputLanguageChanged() {} - public void onStartCategoryChanged() {} - public void onSettingsError(String msg, Throwable e) {} - } - - public void addSettingsListener(SettingsListener listener) { - listeners.add(listener); - } - - protected void fireAvailableGrammarsChanged() { - for (SettingsListener listener : listeners) { - listener.onAvailableGrammarsChanged(); - } - } - - protected void fireSelectedGrammarChanged() { - for (SettingsListener listener : listeners) { - listener.onSelectedGrammarChanged(); - } - } - - protected void fireInputLanguageChanged() { - for (SettingsListener listener : listeners) { - listener.onInputLanguageChanged(); - } - } - - protected void fireOutputLanguageChanged() { - for (SettingsListener listener : listeners) { - listener.onOutputLanguageChanged(); - } - } - - protected void fireStartCategoryChanged() { - for (SettingsListener listener : listeners) { - listener.onStartCategoryChanged(); - } - } - - protected void fireSettingsError(String msg, Throwable e) { - for (SettingsListener listener : listeners) { - listener.onSettingsError(msg, e); - } - } - -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/QueryPanel.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/QueryPanel.java deleted file mode 100644 index b364ed0b6..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/QueryPanel.java +++ /dev/null @@ -1,144 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import java.util.*; - -import com.google.gwt.http.client.*; -import com.google.gwt.user.client.ui.*; - -public class QueryPanel extends Composite { - - private PGFWrapper pgf; - private StatusPopup statusPopup; - private TextArea queryBox; - private VerticalPanel outputPanel; - private JSONRequest executeRequest = null; - - public QueryPanel(PGFWrapper pgf, StatusPopup statusPopup) { - this.pgf = pgf; - this.statusPopup = statusPopup; - - VerticalPanel vPanel = new VerticalPanel(); - vPanel.add(createQueryPanel()); - - initWidget(vPanel); - setStylePrimaryName("my-QueryPanel"); - - pgf.addSettingsListener(new MySettingsListener()); - } - - protected Widget createQueryPanel() { - queryBox = new TextArea(); - queryBox.setStylePrimaryName("my-QueryBox"); - queryBox.setTitle("Goal category"); - - HorizontalPanel boxPanel = new HorizontalPanel(); - boxPanel.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE); - boxPanel.setSpacing(5); - - final TextBox limitBox = new TextBox(); - limitBox.setTitle("Upper limit of the number of examples generated"); - limitBox.setWidth("5em"); - limitBox.setText("10"); - boxPanel.add(new Label("limit:")); - boxPanel.add(limitBox); - - boxPanel.add(new HTML("")); - - final TextBox depthBox = new TextBox(); - depthBox.setTitle("Maximal depth for every example"); - depthBox.setWidth("5em"); - depthBox.setText("4"); - boxPanel.add(new Label("depth:")); - boxPanel.add(depthBox); - - boxPanel.add(new HTML("")); - - final CheckBox randomBox = new CheckBox(); - randomBox.setTitle("random/exhaustive generation"); - randomBox.setText("random"); - boxPanel.add(randomBox); - - outputPanel = new VerticalPanel(); - outputPanel.addStyleName("my-translations"); - outputPanel.addStyleDependentName("working"); - - Button execButton = new Button("Execute"); - - DecoratorPanel queryDecorator = new DecoratorPanel(); - VerticalPanel vPanel = new VerticalPanel(); - vPanel.add(new Label("Query")); - HorizontalPanel hPanel = new HorizontalPanel(); - hPanel.add(queryBox); - hPanel.add(execButton); - vPanel.add(hPanel); - vPanel.add(boxPanel); - queryDecorator.add(vPanel); - - VerticalPanel queryPanel = new VerticalPanel(); - queryPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER); - queryPanel.add(queryDecorator); - queryPanel.add(outputPanel); - - execButton.addClickListener(new ClickListener() { - public void onClick(Widget sender) { - if (executeRequest != null) { - executeRequest.cancel(); - } - - PGF.GenerationCallback callback = new PGF.GenerationCallback() { - public void onResult(IterableJsArray<PGF.Linearizations> result) { - executeRequest = null; - - outputPanel.clear(); - outputPanel.removeStyleDependentName("working"); - - for (PGF.Linearizations lins : result.iterable()) { - LinearizationsPanel lin = new LinearizationsPanel(pgf, lins); - lin.setWidth("100%"); - outputPanel.add(lin); - } - } - - public void onError(Throwable e) { - executeRequest = null; - statusPopup.showError("The execution failed", e); - } - }; - - int depth, limit; - try { - depth = Integer.parseInt(depthBox.getText()); - limit = Integer.parseInt(limitBox.getText()); - } catch (NumberFormatException e) { - statusPopup.showError("Invalid depth/limit parameter", e); - return; - } - - if (randomBox.getValue()) - executeRequest = pgf.generateRandom(queryBox.getText(), depth, limit, callback); - else - executeRequest = pgf.generateAll(queryBox.getText(), depth, limit, callback); - } - }); - - return queryPanel; - } - - protected class MySettingsListener implements SettingsListener { - - public MySettingsListener() { - } - - public void onAvailableGrammarsChanged() { } - - public void onSelectedGrammarChanged() { - queryBox.setText(""); - outputPanel.clear(); - } - - public void onInputLanguageChanged() { } - public void onOutputLanguageChanged() { } - public void onStartCategoryChanged() { } - public void onSettingsError(String msg, Throwable e) { } - } -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/SettingsListener.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/SettingsListener.java deleted file mode 100644 index 494c990f6..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/SettingsListener.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -public interface SettingsListener { - public void onAvailableGrammarsChanged(); - public void onSelectedGrammarChanged(); - public void onInputLanguageChanged(); - public void onOutputLanguageChanged(); - public void onStartCategoryChanged(); - public void onSettingsError(String msg, Throwable e); -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/SettingsPanel.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/SettingsPanel.java deleted file mode 100644 index b3c22572c..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/SettingsPanel.java +++ /dev/null @@ -1,136 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import com.google.gwt.user.client.ui.*; - -public class SettingsPanel extends Composite { - - private PGFWrapper pgf; - private ContentService contentService; - private StatusPopup statusPopup; - - private MyListBox grammarBox; - private MyListBox fromLangBox; - private MyListBox toLangBox; - - public SettingsPanel (PGFWrapper pgf, ContentService contentService, StatusPopup statusPopup) { - this.pgf = pgf; - this.contentService = contentService; - this.statusPopup = statusPopup; - - HorizontalPanel settingsPanel = new HorizontalPanel(); - settingsPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER); - settingsPanel.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE); - - grammarBox = new MyListBox(); - grammarBox.addChangeListener(new ChangeListener() { - public void onChange(Widget sender) { - SettingsPanel.this.pgf.setGrammarURL(grammarBox.getSelectedValue()); - } - }); - settingsPanel.add(new FormWidget("Grammar:", grammarBox)); - - fromLangBox = new MyListBox(); - fromLangBox.addChangeListener(new ChangeListener() { - public void onChange(Widget sender) { - SettingsPanel.this.pgf.setInputLanguage(fromLangBox.getSelectedValue()); - } - }); - settingsPanel.add(new FormWidget("From:", fromLangBox)); - - toLangBox = new MyListBox(); - toLangBox.addChangeListener(new ChangeListener() { - public void onChange(Widget sender) { - SettingsPanel.this.pgf.setOutputLanguage(toLangBox.getSelectedValue()); - } - }); - settingsPanel.add(new FormWidget("To:", toLangBox)); - - if (contentService.getInit().getUserEMail() != null) { - String url = contentService.getInit().getContentURL(); - settingsPanel.add(new FormWidget(contentService.getInit().getUserEMail(), - new HTML("<A href='"+url+"'>Sign Out</A>"))); - } else { - String url = contentService.getInit().getContentURL(); - url = "https://www.google.com/accounts/o8/ud" - + "?openid.ns=http://specs.openid.net/auth/2.0" - + "&openid.ns.max_auth_age=300" - + "&openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select" - + "&openid.identity=http://specs.openid.net/auth/2.0/identifier_select" - + "&openid.return_to=http://localhost:8080"+url - + "&openid.realm=http://localhost:8080/" - + "&openid.mode=checkid_setup" - + "&openid.ns.ax=http://openid.net/srv/ax/1.0" - + "&openid.ax.mode=fetch_request" - + "&openid.ax.type.email=http://axschema.org/contact/email" - + "&openid.ax.required=email"; - settingsPanel.add(new FormWidget("", - new HTML("<A href='"+url+"'>Sign In</A>"))); - } - - initWidget(settingsPanel); - setStylePrimaryName("my-SettingsPanel"); - - pgf.addSettingsListener(new MySettingsListener()); - contentService.addSettingsListener(new MySettingsListener()); - } - - private static class FormWidget extends HorizontalPanel { - public FormWidget(String label, Widget w) { - setStylePrimaryName("form-widget"); - setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE); - add(new Label(label)); - add(w); - } - } - - private class MySettingsListener implements SettingsListener { - public void onAvailableGrammarsChanged() { - if (grammarBox != null) { - grammarBox.clear(); - fromLangBox.clear(); - toLangBox.clear(); - - for (ContentService.GrammarInfo grammar : contentService.getGrammars()) { - grammarBox.addItem(grammar.getName(), grammar.getURL()); - } - pgf.setGrammarURL(grammarBox.getSelectedValue()); - } - } - public void onSelectedGrammarChanged() { - if (grammarBox != null) { - grammarBox.setSelectedValue(pgf.getGrammarURL()); - } - if (fromLangBox != null) { - fromLangBox.clear(); - fromLangBox.addItem("Any language", ""); - fromLangBox.addItems(pgf.getAllLanguages()); - String inputLanguage = pgf.getInputLanguage(); - if (inputLanguage != null) { - fromLangBox.setSelectedValue(inputLanguage); - } - } - if (toLangBox != null) { - toLangBox.clear(); - toLangBox.addItem("All languages", ""); - toLangBox.addItems(pgf.getAllLanguages()); - String outputLanguage = pgf.getOutputLanguage(); - if (outputLanguage != null) { - fromLangBox.setSelectedValue(outputLanguage); - } - } - } - public void onInputLanguageChanged() { - if (fromLangBox != null) { - fromLangBox.setSelectedValue(pgf.getInputLanguage()); - } - } - public void onOutputLanguageChanged() { - if (toLangBox != null) { - toLangBox.setSelectedValue(pgf.getOutputLanguage()); - } - } - public void onStartCategoryChanged() { } - public void onSettingsError(String msg, Throwable e) { } - } - -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/StatusPopup.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/StatusPopup.java deleted file mode 100644 index 73ff82e0d..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/StatusPopup.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.user.client.ui.Label; -import com.google.gwt.user.client.ui.PopupPanel; - -public class StatusPopup extends PopupPanel { - - private Label label = new Label(); - - public StatusPopup () { - super(true, true); - label = new Label(); - add(label); - } - - public void setStatus(String msg) { - removeStyleDependentName("error"); - label.setText(msg); - center(); - } - - public void showError(String msg, Throwable e) { - GWT.log(msg, e); - addStyleDependentName("error"); - label.setText(msg); - center(); - } - - public void clearStatus() { - removeStyleDependentName("error"); - label.setText(""); - hide(); - } - -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/SubList.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/SubList.java deleted file mode 100644 index 9d3221f39..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/SubList.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import java.util.AbstractList; -import java.util.List; - -/** Work-around for missing List.subList() method in GWT JRE API emulation. */ -public class SubList<T> extends AbstractList<T> { - - private List<T> list; - - private int fromIndex; - - private int toIndex; - - public SubList(List<T> list, int fromIndex, int toIndex) { - this.list = list; - this.fromIndex = fromIndex; - this.toIndex = toIndex; - if (fromIndex < 0 || toIndex > list.size()) - throw new IndexOutOfBoundsException("Endpoint index value out of range"); - if (fromIndex > toIndex) - throw new IllegalArgumentException("Endpoint indices out of order"); - } - - public T get(int index) { - return list.get(fromIndex + index); - } - - public int size() { - return toIndex - fromIndex; - } - - public static <T> SubList<T> makeSubList(List<T> list, int fromIndex, int toIndex) { - return new SubList<T>(list, fromIndex, toIndex); - } - -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/SuggestPanel.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/SuggestPanel.java deleted file mode 100644 index 8e2edf582..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/SuggestPanel.java +++ /dev/null @@ -1,102 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import java.util.LinkedList; -import java.util.List; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.user.client.ui.*; - -public class SuggestPanel extends Composite implements HasText { - - private SuggestBox suggest; - private Button submitButton; - - private List<SubmitListener> listeners = new LinkedList<SubmitListener>(); - - public SuggestPanel (PGFWrapper pgf) { - - CompletionOracle oracle = new CompletionOracle(pgf, new CompletionOracle.ErrorHandler() { - public void onError(Throwable e) { - GWT.log("Completion failed", e); - } - }); - - suggest = new SuggestBox(oracle); - suggest.setLimit(10); - suggest.addKeyboardListener(new KeyboardListenerAdapter() { - public void onKeyUp (Widget sender, char keyCode, int modifiers) { - if (keyCode == KEY_ENTER) { - submit(); - } - } - }); - - submitButton = new Button("Submit"); - submitButton.addClickListener(new ClickListener() { - public void onClick(Widget sender) { - submit(); - } - }); - - DockPanel mainPanel = new DockPanel(); - mainPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); - mainPanel.add(suggest, DockPanel.CENTER); - mainPanel.add(submitButton, DockPanel.EAST); - - initWidget(mainPanel); - setStylePrimaryName("my-SuggestPanel"); - - } - - public int getLimit() { - return suggest.getLimit(); - } - - public String getText() { - return suggest.getText(); - } - - public String getTitle() { - return suggest.getTitle(); - } - - public void onLoad() { - suggest.setFocus(true); - } - - public void setButtonText (String text) { - submitButton.setText(text); - } - - public void setEnabled(boolean enabled) { - submitButton.setEnabled(enabled); - } - - public void setLimit(int limit) { - suggest.setLimit(limit); - } - - public void setText (String text) { - suggest.setText(text); - } - - public void setTitle(String title) { - suggest.setTitle(title); - } - - public void addSubmitListener(SubmitListener listener) { - listeners.add(listener); - } - - public void submit() { - String text = getText(); - for (SubmitListener listener : listeners) { - listener.onSubmit(text); - } - } - - public interface SubmitListener { - public void onSubmit(String text); - } - -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/TextInputPanel.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/TextInputPanel.java deleted file mode 100644 index bf2c04a03..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/TextInputPanel.java +++ /dev/null @@ -1,600 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import java.util.*; - -import com.google.gwt.core.client.*; -import com.google.gwt.user.client.*; -import com.google.gwt.user.client.ui.*; -import com.google.gwt.event.dom.client.*; -import com.google.gwt.event.logical.shared.*; -import com.google.gwt.event.shared.*; - -public class TextInputPanel extends Composite implements Focusable, HasValueChangeHandlers<String>, HasSelectionHandlers<String> { - - protected ContentService contentService; - protected StatusPopup statusPopup; - protected FlowPanel textPanel = null; - protected FlowPanel mainPanel = null; - protected FocusPanel focusPanel = null; - protected Panel focusedPanel = null; - protected List<Panel> selectedPanels = null; - protected List<Panel> errorPanels = null; - protected Panel tempPanel = null; - protected Label status = null; - protected NavigationController navigationController; - protected MagnetSearchBox searchBox = null; - - private List<Label> words = new ArrayList<Label>(); - - private Map<Panel, Phrase> mapPanel2Phrase = new HashMap<Panel, Phrase>(); - private Map<Integer, Phrase> mapFId2Phrase = new HashMap<Integer, Phrase>(); - - private ChangeListenerCollection changeListeners = null; - - private Integer docId = null; - - public TextInputPanel(ContentService contentService, StatusPopup statusPopup) { - this.contentService = contentService; - this.statusPopup = statusPopup; - - mainPanel = new FlowPanel(); - mainPanel.setStylePrimaryName("wordspanel"); - - textPanel = new FlowPanel(); - textPanel.add(mainPanel); - textPanel.setStylePrimaryName("wordspanel"); - - Label space = new Label(" "); - space.setStylePrimaryName("wordspace"); - textPanel.add(space); - - Panel contentPanel = new FlowPanel(); - contentPanel.add(textPanel); - contentPanel.setStylePrimaryName("text"); - - focusPanel = new FocusPanel(); - focusPanel.setWidget(contentPanel); - focusPanel.setStylePrimaryName("frame"); - - Widget buttons = createToolbarPanel(); - - VerticalPanel wrapper = new VerticalPanel(); - wrapper.add(buttons); - wrapper.add(focusPanel); - initWidget(wrapper); - setStylePrimaryName("my-TextInputPanel"); - - navigationController = new NavigationController(); - focusPanel.addKeyDownHandler(navigationController); - } - - protected Widget createToolbarPanel() { - HorizontalPanel toolbar = new HorizontalPanel(); - toolbar.setStylePrimaryName("toolbar"); - - Panel buttons = new HorizontalPanel(); - toolbar.add(buttons); - toolbar.setCellHorizontalAlignment(buttons,HorizontalPanel.ALIGN_LEFT); - toolbar.setCellVerticalAlignment(buttons,HorizontalPanel.ALIGN_MIDDLE); - - Image clearButton = new Image("org.grammaticalframework.ui.gwt.EditorApp/textinput-buttons.png",0,0,20,20); - clearButton.setTitle("Clears the whole document."); - clearButton.setStylePrimaryName("toolbar-button"); - clearButton.addClickListener(new ClickListener () { - public void onClick(Widget sender) { - clear(); - } - }); - buttons.add(clearButton); - - Image saveButton = new Image("org.grammaticalframework.ui.gwt.EditorApp/textinput-buttons.png",20,0,20,20); - saveButton.setTitle("Save the document."); - saveButton.setStylePrimaryName("toolbar-button"); - saveButton.addClickListener(new ClickListener () { - public void onClick(Widget sender) { - save(); - } - }); - buttons.add(saveButton); - - Image deleteLastButton = new Image("org.grammaticalframework.ui.gwt.EditorApp/textinput-buttons.png",40,0,20,20); - deleteLastButton.setTitle("Removes the last word."); - deleteLastButton.setStylePrimaryName("toolbar-button"); - deleteLastButton.addClickListener(new ClickListener () { - public void onClick(Widget sender) { - deleteLast(); - } - }); - buttons.add(deleteLastButton); - - status = new Label(); - status.setTitle("The currently selected category."); - status.setStylePrimaryName("status"); - toolbar.add(status); - toolbar.setCellHorizontalAlignment(status,HorizontalPanel.ALIGN_RIGHT); - toolbar.setCellVerticalAlignment(status,HorizontalPanel.ALIGN_MIDDLE); - - return toolbar; - } - - public void renderBracketedString(final PGF.BracketedString bs) { - words.clear(); - mapPanel2Phrase.clear(); - mapFId2Phrase.clear(); - mainPanel.clear(); - selectedPanels = null; - focusedPanel = null; - errorPanels = null; - tempPanel = null; - - Widget widget = createWordPanels(bs); - mainPanel.add(widget); - } - - private Widget createWordPanels(final PGF.BracketedString bs) { - if (bs.getToken() != null) { - Label wordLabel = new Label(bs.getToken()); - wordLabel.setStylePrimaryName("wordlabel"); - wordLabel.addClickListener(navigationController); - words.add(wordLabel); - return wordLabel; - } else { - FlowPanel panel = new FlowPanel(); - panel.setStylePrimaryName("wordspanel"); - - Integer fid = new Integer(bs.getFId()); - Phrase phrase = mapFId2Phrase.get(fid); - if (phrase == null) { - phrase = new Phrase(); - phrase.cat = bs.getCat(); - phrase.panels = new ArrayList<Panel>(); - mapFId2Phrase.put(fid,phrase); - } - phrase.panels.add(panel); - mapPanel2Phrase.put(panel, phrase); - - for (PGF.BracketedString child : bs.getChildren()) { - if (panel.getWidgetCount() > 0) { - Label space = new Label(" "); - space.setStylePrimaryName("wordspace"); - panel.add(space); - } - panel.add(createWordPanels(child)); - } - return panel; - } - } - - public void clear() { - setSearchTerm(""); - words.clear(); - mapPanel2Phrase.clear(); - mapFId2Phrase.clear(); - mainPanel.clear(); - selectedPanels = null; - focusedPanel = null; - errorPanels = null; - tempPanel = null; - docId = null; - fireValueChange(); - } - - public void save() { - statusPopup.setStatus("Saving..."); - - contentService.save(docId, getText(), new ContentService.SaveCallback() { - public void onResult(ContentService.DocumentSignature sign) { - docId = new Integer(sign.getId()); - statusPopup.clearStatus(); - } - - public void onError(Throwable e) { - statusPopup.showError("Saving failed", e); - } - }); - } - - public void load(Object id) { - statusPopup.setStatus("Loading..."); - - contentService.load(id, new ContentService.LoadCallback() { - public void onResult(ContentService.Document document) { - clear(); - - docId = new Integer(document.getId()); - showSearchBox(); - searchBox.setText(document.getContent()); - - statusPopup.clearStatus(); - } - - public void onError(Throwable e) { - statusPopup.showError("Saving failed", e); - } - }); - } - - public void addMagnet(Magnet magnet) { - Label wordLabel = new Label(magnet.getText()); - wordLabel.setStylePrimaryName("wordlabel"); - getTempPanel().add(wordLabel); - words.add(wordLabel); - - fireValueChange(); - } - - public String deleteLast() { - int wordsCount = words.size(); - if (wordsCount <= 0) - return null; - Label lastWord = words.remove(wordsCount-1); - - setSearchTerm(""); - mapPanel2Phrase.clear(); - mapFId2Phrase.clear(); - mainPanel.clear(); - selectedPanels = null; - focusedPanel = null; - errorPanels = null; - tempPanel = null; - for (Label word : words) { - if (((FlowPanel) getTempPanel()).getWidgetCount() > 0) { - Label space = new Label(" "); - space.setStylePrimaryName("wordspace"); - getTempPanel().add(space); - } - getTempPanel().add(word); - } - fireValueChange(); - - return lastWord.getText(); - } - - public void showSearchBox() { - if (searchBox == null) { - searchBox = new MagnetSearchBox(); - SearchBoxKeyboardHandler handler = new SearchBoxKeyboardHandler(); - searchBox.addKeyUpHandler(handler); - searchBox.addKeyDownHandler(handler); - - textPanel.add(searchBox); - searchBox.setFocus(true); - } - } - - public void hideSearchBox() { - if (searchBox != null) { - searchBox.removeFromParent(); - searchBox = null; - } - } - - public void setSearchTerm(String term) { - if (searchBox != null) { - searchBox.setText(term); - if ("".equals(term)) - searchBox.setCursorPos(0); - } - } - - public String getSearchTerm() { - if (searchBox != null) - return searchBox.getText(); - else - return null; - } - - public void showSearchError() { - if (searchBox != null) { - searchBox.addStyleDependentName("error"); - } - } - - public void clearSearchError() { - if (searchBox != null) { - searchBox.removeStyleDependentName("error"); - } - } - - public void showError(int fid) { - if (errorPanels != null) { - for (Panel panel : errorPanels) { - panel.removeStyleDependentName("error"); - } - errorPanels = null; - } - - Phrase phrase = mapFId2Phrase.get(fid); - if (phrase != null) { - errorPanels = phrase.panels; - if (errorPanels != null) { - for (Panel selPanel : errorPanels) { - selPanel.addStyleDependentName("error"); - } - } - } - } - - private Panel getTempPanel() { - if (tempPanel == null) { - if (mainPanel.getWidgetCount() > 0) { - Label space = new Label(" "); - space.setStylePrimaryName("wordspace"); - mainPanel.add(space); - } - - tempPanel = new FlowPanel(); - tempPanel.setStylePrimaryName("wordspanel"); - mainPanel.add(tempPanel); - } - return tempPanel; - } - - protected void fireValueChange() { - DeferredCommand.addCommand(new Command() { - public void execute() { - ValueChangeEvent.fire(TextInputPanel.this, getText()); - } - }); - } - - protected void fireSelection() { - SelectionEvent.fire(this, (searchBox == null) ? "" : searchBox.getText()); - } - - public HandlerRegistration addValueChangeHandler(ValueChangeHandler<String> handler) { - return addHandler(handler, ValueChangeEvent.getType()); - } - - public HandlerRegistration addSelectionHandler(SelectionHandler<String> handler) { - return addHandler(handler, SelectionEvent.getType()); - } - - public String getText () { - StringBuilder sb = new StringBuilder(); - for (Label word : words) { - if (sb.length() > 0) { - sb.append(' '); - } - sb.append(word.getText()); - } - return sb.toString(); - } - - public int getTabIndex() { - return focusPanel.getTabIndex(); - } - - public void setTabIndex(int index) { - focusPanel.setTabIndex(index); - } - - public void setAccessKey(char key) { - focusPanel.setAccessKey(key); - } - - public void setFocus(boolean focused) { - focusPanel.setFocus(focused); - } - - private class Phrase { - public String cat; - public ArrayList<Panel> panels; - } - - private final class NavigationController implements KeyDownHandler, ClickListener { - - public void onKeyDown(KeyDownEvent event) { - switch (event.getNativeKeyCode()) { - case KeyCodes.KEY_UP: - if (focusedPanel != null) { - Panel firstUp = null; - FlowPanel parent = (FlowPanel) focusedPanel.getParent(); - while (parent != mainPanel) { - if (parent.getWidgetCount() > 1) { - firstUp = parent; - break; - } - - parent = (FlowPanel) parent.getParent(); - } - - if (firstUp != null) - setFocusedPanel(firstUp); - event.stopPropagation(); - } - break; - case KeyCodes.KEY_DOWN: - if (focusedPanel != null) { - Panel firstDown = null; - for (Widget child : focusedPanel) { - if (child instanceof Panel) { - firstDown = (Panel) child; - break; - } - } - if (firstDown != null) - setFocusedPanel(firstDown); - event.stopPropagation(); - } - break; - case KeyCodes.KEY_LEFT: - if (focusedPanel != null) { - Panel firstLeft = null; - Panel parent = (Panel) focusedPanel.getParent(); - for (Widget child : parent) { - if (child instanceof Panel) { - if (child == focusedPanel) - break; - firstLeft = (Panel) child; - } - } - - if (firstLeft == null) { - if (parent != mainPanel) - firstLeft = parent; - } else { - for (;;) { - Panel lastChild = null; - for (Widget child : firstLeft) { - if (child instanceof Panel) { - lastChild = (Panel) child; - } - } - if (lastChild == null) - break; - firstLeft = lastChild; - } - } - if (firstLeft != null) - setFocusedPanel(firstLeft); - event.stopPropagation(); - } - break; - case KeyCodes.KEY_RIGHT: - if (focusedPanel != null) { - Panel firstRight = null; - Panel parent = (Panel) focusedPanel.getParent(); - Widget prev = null; - for (Widget child : parent) { - if (child instanceof Panel) { - if (prev == focusedPanel) { - firstRight = (Panel) child; - break; - } - prev = child; - } - } - - if (firstRight == null) { - if (parent != mainPanel) - firstRight = parent; - } else { - for (;;) { - Panel firstChild = null; - for (Widget child : firstRight) { - if (child instanceof Panel) { - firstChild = (Panel) child; - break; - } - } - if (firstChild == null) - break; - firstRight = firstChild; - } - } - if (firstRight != null) - setFocusedPanel(firstRight); - event.stopPropagation(); - } - break; - case KeyCodes.KEY_ENTER: - case KeyCodes.KEY_ESCAPE: - break; - default: - if (searchBox == null) { - showSearchBox(); - searchBox.fireEvent(event); - } - } - } - - public void onClick(Widget sender) { - FlowPanel panel = (FlowPanel) sender.getParent(); - FlowPanel tmpPanel = panel; - while (tmpPanel != mainPanel) { - FlowPanel parent = (FlowPanel) tmpPanel.getParent(); - - if (tmpPanel == focusedPanel && parent != mainPanel) { - panel = parent; - break; - } - - tmpPanel = parent; - } - - tmpPanel = (FlowPanel) panel.getParent(); - while (tmpPanel != mainPanel) { - if (tmpPanel.getWidgetCount() > 1) - break; - - panel = tmpPanel; - tmpPanel = (FlowPanel) panel.getParent(); - } - - setFocusedPanel(panel); - } - - private void setFocusedPanel(Panel panel) { - if (selectedPanels != null) { - for (Panel tmpPanel : selectedPanels) { - tmpPanel.removeStyleDependentName("selected"); - } - selectedPanels = null; - } - - if (focusedPanel != null) { - focusedPanel.removeStyleDependentName("focused"); - focusedPanel = null; - } - - Phrase phrase = mapPanel2Phrase.get(panel); - if (phrase != null) { - status.setText(phrase.cat); - selectedPanels = phrase.panels; - if (selectedPanels != null) { - for (Panel selPanel : selectedPanels) { - selPanel.addStyleDependentName("selected"); - } - } - - focusedPanel = panel; - focusedPanel.addStyleDependentName("focused"); - } - } - } - - private final class SearchBoxKeyboardHandler implements KeyUpHandler, KeyDownHandler { - - public void onKeyDown(KeyDownEvent event) { - switch (event.getNativeKeyCode()) { - case KeyCodes.KEY_ESCAPE: - hideSearchBox(); - fireSelection(); - setFocus(true); - event.stopPropagation(); - break; - case KeyCodes.KEY_ENTER: - searchBox.setText(searchBox.getText()+" "); - fireSelection(); - hideSearchBox(); - setFocus(true); - event.stopPropagation(); - break; - case KeyCodes.KEY_BACKSPACE: - if ("".equals(searchBox.getText())) { - String word = deleteLast(); - searchBox.setText(word); - searchBox.setCursorPos(word.length()); - event.stopPropagation(); - event.preventDefault(); - } - break; - } - } - - public void onKeyUp(KeyUpEvent event) { - switch (event.getNativeKeyCode()) { - case KeyCodes.KEY_ESCAPE: - case KeyCodes.KEY_ENTER: - case KeyCodes.KEY_UP: - case KeyCodes.KEY_DOWN: - case KeyCodes.KEY_LEFT: - case KeyCodes.KEY_RIGHT: - break; - default: - fireSelection(); - } - } - } -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/TranslateApp.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/TranslateApp.java deleted file mode 100644 index e6c58c1d8..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/TranslateApp.java +++ /dev/null @@ -1,321 +0,0 @@ -package org.grammaticalframework.ui.gwt.client; - -import java.util.List; - -import com.google.gwt.core.client.*; -import com.google.gwt.user.client.*; -import com.google.gwt.user.client.ui.*; - - -public class TranslateApp implements EntryPoint { - - protected static final String pgfBaseURL = "/grammars"; - - protected PGFWrapper pgf; - - protected SuggestPanel suggestPanel; - protected VerticalPanel outputPanel; - protected StatusPopup statusPopup; - - // - // Text - // - - public String getText () { - return suggestPanel.getText(); - } - - protected void update () { - translate(); - } - - // - // Translation - // - - protected void translate() { - outputPanel.clear(); - outputPanel.addStyleDependentName("working"); - pgf.translate(getText(), - new PGF.TranslateCallback() { - public void onResult (IterableJsArray<PGF.TranslationResult> translations) { - outputPanel.clear(); - outputPanel.removeStyleDependentName("working"); - for (PGF.TranslationResult tr : translations.iterable()) { - if (tr.getTranslations() != null) { - for (PGF.Linearizations t : tr.getTranslations().iterable()) { - outputPanel.add(new LinearizationsPanel(pgf, t)); - } - } - - if (tr.getTypeErrors() != null && tr.getTypeErrors().length > 0) { - for (PGF.TcError error : tr.getTypeErrors()) { - VerticalPanel panel = new VerticalPanel(); - panel.addStyleName("my-typeError"); - Label errLabel = new Label("Type Error"); - errLabel.addStyleName("my-error-title"); - HTML msgHTML = new HTML("<pre>"+error.getMsg()+"</pre>"); - panel.add(errLabel); - panel.add(msgHTML); - outputPanel.add(panel); - } - } - } - } - public void onError (Throwable e) { - showError("Translation failed", e); - } - }); - } - - protected Widget createAbsTreeButton(final String abstractTree) { - Image treeBtn = new Image("org.grammaticalframework.ui.gwt.TranslateApp/tree-btn.png"); - treeBtn.addClickListener( - new ClickListener() { - public void onClick(Widget sender) { - // Create a dialog box and set the caption text - final DialogBox dialogBox = new DialogBox(); - dialogBox.setText("Abstract Syntax Tree"); - - // Create a table to layout the content - HorizontalPanel dialogContents = new HorizontalPanel(); - dialogContents.setSpacing(4); - dialogBox.setWidget(dialogContents); - - // Add an image to the dialog - - Frame image = new Frame(pgf.graphvizAbstractTree(abstractTree)); - image.addStyleName("my-treeimage"); - dialogContents.add(image); - - // Add a close button at the bottom of the dialog - Button closeButton = new Button("Close", - new ClickListener() { - public void onClick(Widget sender) { - dialogBox.hide(); - } - }); - dialogContents.add(closeButton); - - dialogBox.center(); - dialogBox.show(); - } - }); - return treeBtn; - } - - protected Widget createAlignButton(final String abstractTree) { - Image alignBtn = new Image("org.grammaticalframework.ui.gwt.TranslateApp/align-btn.png"); - alignBtn.addClickListener( - new ClickListener() { - public void onClick(Widget sender) { - // Create a dialog box and set the caption text - final DialogBox dialogBox = new DialogBox(); - dialogBox.setText("Word Alignment"); - - // Create a table to layout the content - HorizontalPanel dialogContents = new HorizontalPanel(); - dialogContents.setSpacing(4); - dialogBox.setWidget(dialogContents); - - // Add an image to the dialog - Frame image = new Frame(pgf.graphvizAlignment(abstractTree)); - image.addStyleName("my-alignmentimage"); - dialogContents.add(image); - - // Add a close button at the bottom of the dialog - Button closeButton = new Button("Close", - new ClickListener() { - public void onClick(Widget sender) { - dialogBox.hide(); - } - }); - dialogContents.add(closeButton); - - dialogBox.center(); - dialogBox.show(); - } - }); - return alignBtn; - } - - protected Widget createTranslation(final String language, final String abstractTree, String text) { - Label l = new Label(text); - l.addStyleName("my-translation"); - String lang = pgf.getLanguageCode(language); - if (lang != null) { - l.getElement().setLang(lang); - } - l.addClickListener(new ClickListener() { - public void onClick(Widget sender) { - // Create a dialog box and set the caption text - final DialogBox dialogBox = new DialogBox(); - dialogBox.setText("Parse Tree"); - - // Create a table to layout the content - HorizontalPanel dialogContents = new HorizontalPanel(); - dialogContents.setSpacing(4); - dialogBox.setWidget(dialogContents); - - // Add an image to the dialog - Frame image = new Frame(pgf.graphvizParseTree(abstractTree, language)); - image.addStyleName("my-treeimage"); - dialogContents.add(image); - - // Add a close button at the bottom of the dialog - Button closeButton = new Button("Close", - new ClickListener() { - public void onClick(Widget sender) { - dialogBox.hide(); - } - }); - dialogContents.add(closeButton); - - dialogBox.center(); - dialogBox.show(); - } - }); - return l; - } - - // - // Status stuff - // - - protected void setStatus(String msg) { - statusPopup.setStatus(msg); - } - - protected void showError(String msg, Throwable e) { - statusPopup.showError(msg, e); - } - - protected void clearStatus() { - statusPopup.clearStatus(); - } - - // - // GUI - // - - protected Widget createUI() { - VerticalPanel vPanel = new VerticalPanel(); - vPanel.setWidth("100%"); - vPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER); - vPanel.add(createSuggestPanel()); - vPanel.add(createSettingsPanel()); - vPanel.add(createTranslationsPanel()); - - return vPanel; - } - - protected Widget createSuggestPanel () { - suggestPanel = new SuggestPanel(pgf); - suggestPanel.setButtonText("Translate"); - suggestPanel.addSubmitListener(new SuggestPanel.SubmitListener() { - public void onSubmit(String text) { - translate(); - } - }); - return suggestPanel; - } - - protected Widget createSettingsPanel () { - return new SettingsPanel(pgf, null, statusPopup); - } - - protected Widget createTranslationsPanel () { - outputPanel = new VerticalPanel(); - outputPanel.addStyleName("my-translations"); - return outputPanel; - } - - protected Widget createLoadingWidget () { - VerticalPanel loadingPanel = new VerticalPanel(); - loadingPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER); - loadingPanel.add(new Label("Loading...")); - return loadingPanel; - } - - // - // History stuff - // - - protected class MyHistoryListener implements HistoryListener { - public void onHistoryChanged(String historyToken) { - updateSettingsFromHistoryToken(); - } - }; - - protected void updateSettingsFromHistoryToken() { - updateSettingsFromHistoryToken(History.getToken().split("/")); - } - - protected void updateSettingsFromHistoryToken(String[] tokenParts) { - if (tokenParts.length >= 1 && tokenParts[0].length() > 0) { - setGrammarURL(tokenParts[0]); - } - if (tokenParts.length >= 2 && tokenParts[1].length() > 0) { - setInputLanguage(tokenParts[1]); - } - } - - protected void setGrammarURL (String url) { - if (url != null && !url.equals(pgf.getGrammarURL())) { - pgf.setGrammarURL(url); - } - } - - protected void setInputLanguage (String inputLanguage) { - if (inputLanguage != null && !inputLanguage.equals(pgf.getInputLanguage())) { - pgf.setInputLanguage(inputLanguage); - } - } - - // - // Initialization - // - - protected class MySettingsListener implements SettingsListener { - // Will only happen on load - public void onAvailableGrammarsChanged() { - if (pgf.getGrammarURL() == null) { - List<String> grammars = pgf.getGrammars(); - if (!grammars.isEmpty()) { - pgf.setGrammarURL(grammars.get(0)); - } - } - } - public void onSelectedGrammarChanged() { - if (pgf.getInputLanguage() == null) { - GWT.log("Setting input language to user language: " + pgf.getUserLanguage(), null); - pgf.setInputLanguage(pgf.getUserLanguage()); - } - update(); - } - public void onInputLanguageChanged() { - update(); - } - public void onOutputLanguageChanged() { - update(); - } - public void onStartCategoryChanged() { - update(); - } - public void onSettingsError(String msg, Throwable e) { - showError(msg,e); - } - } - - public void onModuleLoad() { - statusPopup = new StatusPopup(); - - pgf = new PGFWrapper(); - RootPanel.get().add(createUI()); - pgf.addSettingsListener(new MySettingsListener()); - History.addHistoryListener(new MyHistoryListener()); - updateSettingsFromHistoryToken(); - pgf.updateAvailableGrammars(); - } - -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/selection/Selection.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/selection/Selection.java deleted file mode 100644 index ceee8c1a7..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/selection/Selection.java +++ /dev/null @@ -1,66 +0,0 @@ -/*
- * Copyright Miroslav Pokorny
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package org.grammaticalframework.ui.gwt.client.selection;
-
-import org.grammaticalframework.ui.gwt.client.selection.support.SelectionSupport;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.core.client.JavaScriptObject;
-import com.google.gwt.user.client.Element;
-import com.google.gwt.user.client.ui.RootPanel;
-
-/**
- * The Selection class is a singleton that represents any selection made by the
- * user typically done with the mouse.
- *
- * @author Miroslav Pokorny (mP)
- */
-public class Selection extends JavaScriptObject {
-
- /**
- * The browser aware support that takes care of browser difference nasties.
- */
- static private SelectionSupport support = (SelectionSupport) GWT.create(SelectionSupport.class);
-
- static SelectionSupport getSupport() {
- return Selection.support;
- }
-
- /**
- * Returns the document Selection singleton
- *
- * @return The singleton instance
- */
- static public Selection getSelection() {
- return Selection.support.getSelection();
- }
-
- protected Selection() {
- super();
- }
-
- final public SelectionEndPoint getStart() {
- return Selection.getSupport().getStart(this);
- }
-
- final public SelectionEndPoint getEnd() {
- return Selection.getSupport().getEnd(this);
- }
-
- final public void select(final SelectionEndPoint start, final SelectionEndPoint end) {
- Selection.getSupport().select(this, start, end);
- }
-}
diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/selection/SelectionEndPoint.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/selection/SelectionEndPoint.java deleted file mode 100644 index d429b4b19..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/selection/SelectionEndPoint.java +++ /dev/null @@ -1,69 +0,0 @@ -/*
- * Copyright Miroslav Pokorny
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package org.grammaticalframework.ui.gwt.client.selection;
-
-import com.google.gwt.dom.client.Text;
-
-/**
- * An end point uses a combination of a textNode and offset to mark the
- * start/end of a selection
- *
- * @author Miroslav Pokorny (mP)
- */
-public class SelectionEndPoint {
-
- public SelectionEndPoint() {
- super();
- }
-
- public SelectionEndPoint(Text text, final int offset) {
- super();
-
- this.setTextNode(text);
- this.setOffset(offset);
- }
-
- /**
- * The textNode containing the start/end of the selection.
- */
- private Text textNode;
-
- public Text getTextNode() {
- return textNode;
- }
-
- public void setTextNode(final Text textNode) {
- this.textNode = textNode;
- }
-
- /**
- * The number of characters starting from the beginning of the textNode
- * where the selection begins/ends.
- */
- public int offset;
-
- public int getOffset() {
- return offset;
- }
-
- public void setOffset(final int offset) {
- this.offset = offset;
- }
-
- public String toString() {
- return super.toString() + ", offset: " + offset + ", textNode\"" + this.textNode + "\"";
- }
-}
diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/selection/support/InternetExplorerSelectionSupport.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/selection/support/InternetExplorerSelectionSupport.java deleted file mode 100644 index f986365c7..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/selection/support/InternetExplorerSelectionSupport.java +++ /dev/null @@ -1,248 +0,0 @@ -/*
- * Copyright Miroslav Pokorny
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package org.grammaticalframework.ui.gwt.client.selection.support;
-
-import org.grammaticalframework.ui.gwt.client.selection.Selection;
-import org.grammaticalframework.ui.gwt.client.selection.SelectionEndPoint;
-
-import com.google.gwt.core.client.JavaScriptObject;
-import com.google.gwt.dom.client.Text;
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Element;
-
-/**
- * A specialised SelectionSupport class that is adapted to handle
- * InternetExplorer differences from the standard implementation.
- *
- * @author Miroslav Pokorny (mP)
- */
-public class InternetExplorerSelectionSupport extends SelectionSupport {
-
- final static String PARENT_NODE = "parentNode";
-
- @Override
- native public Selection getSelection()/*-{
- return $wnd.document.selection;
- }-*/;
-
- @Override
- public SelectionEndPoint getStart(final Selection selection) {
- return this.getStart0(selection);
- }
-
- native protected SelectionEndPoint getStart0(final Selection selection) /*-{
- var selectionRange = selection.createRange();
- var element = selectionRange.parentElement();
-
- return this.@org.grammaticalframework.ui.gwt.client.selection.support.InternetExplorerSelectionSupport::getStart1(Lorg/grammaticalframework/ui/gwt/client/selection/Selection;Lcom/google/gwt/user/client/Element;)(selection,element);
- }-*/;
-
- native protected SelectionEndPoint getStart1(final Selection selection, final Element element)/*-{
- var endPoint = null;
-
- if(! selection.createRange ){
- alert( "selection.createRange" + selection.createRange );
- }
-
- var selectionRange = selection.createRange();
-
- var range = selectionRange.duplicate();
- range.moveToElementText( element );
- range.collapse();
-
- // loop thru all the childNodes belonging to element.
- var childNodes = element.childNodes;
- for( var i = 0; i < childNodes.length; i++ ){
- var node = childNodes[ i ];
- var nodeType = node.nodeType;
-
- // found an element check its child nodes...
- if( 1 == nodeType ){
- endPoint = this.@org.grammaticalframework.ui.gwt.client.selection.support.InternetExplorerSelectionSupport::getStart1(Lorg/grammaticalframework/ui/gwt/client/selection/Selection;Lcom/google/gwt/user/client/Element;)(selection,node);
-
- if( null == endPoint ){
- range.move( "character", node.innerText.toString().length );
- continue;
- }
- // endPoint found stop searching....
- break;
- }
-
- // found a textNode...
- if( 3 == nodeType ){
- var text = node.data;
- for( var j = 0; j < text.length; j++ ){
- // found selection start stop searching!
- if( selectionRange.compareEndPoints( "StartToStart", range ) == 0 ){
- endPoint = @org.grammaticalframework.ui.gwt.client.selection.SelectionEndPoint::new(Lcom/google/gwt/dom/client/Text;I)(node,j);
- break;
- }
- range.move("character", 1 );
- }
- // did the above for loop find the start ? if so stop escape!
- if( null != endPoint ){
- break;
- }
- }
- }
-
- return endPoint;
- }-*/;
-
- @Override
- public void select(final Selection selection, final SelectionEndPoint start, final SelectionEndPoint end) {
- this.setStart0(selection, start.getTextNode(), start.getOffset());
- this.setEnd0(selection, end.getTextNode(), end.getOffset());
- }
-
- native private void setStart0(final Selection selection, final Text textNode, final int offset)/*-{
- var rangeOffset = offset;
- var moveToElement = null;
-
- // try an element before $textNode counting the number of characters one has moved backwards...
- var node = textNode.previousSibling;
-
- while( node ){
- // if a textNode is try its previous sibling...
- if( node.nodeType == 3 ){
- rangeOffset = rangeOffset + node.data.length;
- continue;
- }
-
- // found an element stop searching...
- if( node.nodeType == 1 ){
- moveToElement = node;
- rangeOffset = rangeOffset + node.innerText.toString().length;
- break;
- }
-
- // ignore other types...
- node = node.previousSibling;
- }
-
- // if moveToElement is null use textNode's parent.
- if( ! moveToElement ){
- moveToElement = textNode.parentNode;
- }
-
- // update the start of selection range...
- var range = selection.createRange();
- range.moveToElementText( moveToElement );
- range.moveStart( "character", rangeOffset );
- range.select();
- }-*/;
-
- native private void setEnd0(final Selection selection, final Text textNode, final int offset)/*-{
- var rangeOffset = offset;
- var moveToElement = null;
-
- // try an element before $textNode counting the number of characters one has moved backwards...
- var node = textNode.previousSibling;
-
- while( node ){
- // if textNode is try its previous sibling...
- if( node.nodeType == 3 ){
- rangeOffset = rangeOffset + node.data.length;
- continue;
- }
-
- // found an element stop searching...
- if( node.nodeType == 1 ){
- moveToElement = node;
- rangeOffset = rangeOffset + node.innerText.toString().length;
- break;
- }
-
- // ignore other types...
- node = node.previousSibling;
- }
-
- // if moveToElement is null use textNode's parent.
- if( ! moveToElement ){
- moveToElement = textNode.parentNode;
- }
-
- // update the end of selection range...
- var range = selection.createRange();
- range.moveToElementText( moveToElement );
- range.moveStart( "character", rangeOffset );
- range.collapse();
-
- var selectionRange = selection.createRange();
- selectionRange.setEndPoint( "EndToStart", range );
- selectionRange.select();
- }-*/;
-
- @Override
- public SelectionEndPoint getEnd(final Selection selection) {
- return this.getEnd0(selection);
- }
-
- protected native SelectionEndPoint getEnd0(final Selection selection) /*-{
- var selectionRange = selection.createRange();
- var element = selectionRange.parentElement();
-
- return this.@org.grammaticalframework.ui.gwt.client.selection.support.InternetExplorerSelectionSupport::getEnd1(Lorg/grammaticalframework/ui/gwt/client/selection/Selection;Lcom/google/gwt/user/client/Element;)(selection,element);
- }-*/;
-
- protected native SelectionEndPoint getEnd1(final Selection selection, final Element element)/*-{
- var endPoint = null;
-
- var selectionRange = selection.createRange();
-
- var range = selectionRange.duplicate();
- range.moveToElementText( element );
- range.collapse( true );
-
- // loop thru all the childNodes belonging to element.
- var childNodes = element.childNodes;
- for( var i = 0; i < childNodes.length; i++ ){
- var node = childNodes[ i ];
- var nodeType = node.nodeType;
-
- // found an element check its child nodes...
- if( 1 == nodeType ){
- endPoint = this.@org.grammaticalframework.ui.gwt.client.selection.support.InternetExplorerSelectionSupport::getEnd1(Lorg/grammaticalframework/ui/gwt/client/selection/Selection;Lcom/google/gwt/user/client/Element;)(selection,node);
-
- if( null == endPoint ){
- range.move( "character", node.innerText.toString().length );
- continue;
- }
- // endPoint found stop searching....
- break;
- }
-
- // found a textNode...
- if( 3 == nodeType ){
- var text = node.data;
- for( var j = 0; j < text.length; j++ ){
- // found selection end stop searching!
- if( selectionRange.compareEndPoints( "EndToStart", range ) == 0 ){
- endPoint = @org.grammaticalframework.ui.gwt.client.selection.SelectionEndPoint::new(Lcom/google/gwt/dom/client/Text;I)(node,j);
- break;
- }
- range.move( "character", 1 );
- }
- // did the above for loop find the end ? if so stop escape!
- if( null != endPoint ){
- break;
- }
- }
- }
-
- return endPoint;
- }-*/;
-}
diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/selection/support/SelectionSupport.java b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/selection/support/SelectionSupport.java deleted file mode 100644 index 946c2a812..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/client/selection/support/SelectionSupport.java +++ /dev/null @@ -1,69 +0,0 @@ -/*
- * Copyright Miroslav Pokorny
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package org.grammaticalframework.ui.gwt.client.selection.support;
-
-import org.grammaticalframework.ui.gwt.client.selection.Selection;
-import org.grammaticalframework.ui.gwt.client.selection.SelectionEndPoint;
-
-import com.google.gwt.core.client.JavaScriptObject;
-import com.google.gwt.dom.client.Text;
-import com.google.gwt.user.client.Element;
-
-/**
- * This class provides the standard implementation of
- *
- * @author Miroslav Pokorny (mP)
- */
-public class SelectionSupport {
-
- public SelectionEndPoint getStart(final Selection selection) {
- return getStart0(selection);
- }
-
- native private SelectionEndPoint getStart0(final Selection selection) /*-{
- var node = selection.anchorNode || null;
- var offset = selection.anchorOffset;
- return @org.grammaticalframework.ui.gwt.client.selection.SelectionEndPoint::new(Lcom/google/gwt/dom/client/Text;I)(value,j);
- }-*/;
-
- public SelectionEndPoint getEnd(final Selection selection) {
- return getEnd0(selection);
- }
-
- native private SelectionEndPoint getEnd0(final Selection selection) /*-{
- var node = selection.focusNode || null;
- var offset = selection.focusOffset;
- return @org.grammaticalframework.ui.gwt.client.selection.SelectionEndPoint::new(Lcom/google/gwt/dom/client/Text;I)(value,j);
- }-*/;
-
- public void select(final Selection selection, final SelectionEndPoint start, final SelectionEndPoint end) {
- select0(selection, start.getTextNode(), start.getOffset(), end.getTextNode(), end.getOffset());
- }
-
- native private void select0(final Selection selection, final Text startNode, final int startOffset, final Text endNode, final int endOffset)/*-{
- var range = startNode.ownerDocument.createRange();
- range.setStart(startNode, startOffset);
- range.setEnd(endNode, endOffset);
-
- // delete all ranges then recreate...
- selection.removeAllRanges();
- selection.addRange(range);
- }-*/;
-
- native public Selection getSelection()/*-{
- return $wnd.getSelection();
- }-*/;
-}
diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/Editor.css b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/Editor.css deleted file mode 100644 index f568ab96e..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/Editor.css +++ /dev/null @@ -1,333 +0,0 @@ -.my-DocumentsPanel { - padding: 1em; - width: 100%; -} - -.my-DocumentsFrame { - width: 100%; -} - -.my-DocumentsSearchFrame { - margin-bottom: 0.5em; -} - -.my-DocumentsSearchFrame * { - margin: 0 0.4em; -} - -.my-DocumentsTable { - width: 100%; - border: 1px solid #E5E5E5; - border-collapse: collapse; -} - -.my-DocumentsTable .row td { - cursor:pointer; - border: 1px solid #E5E5E5; -} - -.my-DocumentsTable .row:hover { - background-color: rgb(147, 194, 241); -} - -.my-GrammarsPanel { - padding: 1em; - width: 100%; -} - -.my-GrammarInfoPanel { - width: 100%; - border: 1px solid #E5E5E5; - margin-top: 5px; - margin-bottom: 5px; -} - -.my-GrammarInfoPanel .descr-label { - width: 100%; - height: 50px; - padding: 3px; -} - -.my-TableHeader { - width: 100%; - background-attachement: scroll; - background-color: #E5E5E5; - background-image: url("background.png"); - background-position: 0px -192px; - background-repeat: repeat-x; - font-size: 150%; -} - -.my-EditorPanel { - padding-top: 1em; - padding-bottom: 1em -} - -.my-TextInputPanel { - width: 100%; -} - -.my-TextInputPanel .frame { - margin: 0; - padding: 1em; - background-color: #F3F3F3; - outline: 0; -} - -.my-TextInputPanel .text { - padding: 1em; - background-color: white; - border-top: 1px solid #CCCCCC; - border-left: 1px solid #CCCCCC; - border-bottom: 2px solid #BBBBBB; - border-right: 2px solid #BBBBBB; - min-width: 100px; - min-height: 100px; -} - -.my-TextInputPanel .toolbar { - width: 100%; - padding: 3px; - background-attachement: scroll; - background-color: #E5E5E5; - background-image: url("background.png"); - background-position: 0px -192px; - background-repeat: repeat-x; -} - -.toolbar-button { - float: left; - margin: 2px; -} - -.toolbar-button:hover { - margin: 1px; - border: 1px solid rgb(147,194,241); -} - -.my-TextInputPanel .toolbar .status { - padding: 1px; - background-color: #E5E5E5; - border: 1px solid #BBBBBB; - float: right; -} - -.my-TextInputPanel .searchbox { - font-size: 150%; - padding: 2px; - display: inline; - border-bottom: 1px dashed green; - outline: 0; -} - -.my-TextInputPanel .searchbox-error { - border-bottom: 1px dashed red; -} - -.my-TextInputPanel .wordspanel { - padding: 0; - display: inline; -} - -.my-TextInputPanel .wordspanel-selected { - background-color: rgb(147,194,241); -} - -.my-TextInputPanel .wordspanel-focused { - background-color: rgb(147,194,241); - border: 1px solid #666; -} - -.my-TextInputPanel .wordspanel-error { - border-bottom: 1px dashed red; -} - -.my-TextInputPanel .wordlabel { - display: inline; - font-size: 150%; -} - -.my-TextInputPanel .wordspace { - display: inline; - font-size: 150%; -} - -.my-SettingsPanel { -} - -.my-SettingsPanel .form-widget { - margin: 0 0.4em; -} - -.my-SettingsPanel .form-widget * { - margin: 0 0.1em; -} - -.my-LinksPanel * { - margin: 0 0.2em; -} - -.my-LinksPanel .gwt-TabBarItem { - font-weight: normal; - color: gray; - outline: 0; -} - -.my-LinksPanel .gwt-TabBarItem-selected { - font-weight: bold; - color: black; -} - -.my-LinksPanel .gwt-TabBarItem:hover { - text-decoration: underline; -} - -.my-LinksPanel .gwt-TabBarItem-selected:hover { - text-decoration: none; -} - -.my-HeaderPanel { - width: 100%; - margin: 0 0.1em; - padding-top: 2px; - padding-bottom: 2px; - border-bottom-style: solid; - border-bottom-width: 1px; - border-bottom-color: rgb(122,165,214); -} - -.my-BrowsePanel { - width: 100%; - margin: 1em; - border-width: 5px; - border-color: rgb(122,165,214); -} - -.my-BrowsePanel .source { - padding: 1em; -} - -.my-BrowseFrame { - width: 100%; - height: 100%; - margin: 1em; - border-style:none; -} - -.my-QueryPanel { - margin: 1em; - border-width: 5px; - border-color: rgb(122,165,214); -} - -.my-QueryBox { - min-width: 630px; - min-height: 94px; -} - -.my-translations { - margin-top: 1em; -} - -.my-translation-frame { - margin: 0.5em; - background: #D0E4F6; -} - -.my-translation-bar { - padding-left: 25px; - padding-right: 25px; - width: 100%; -} - -.my-translation { - margin: 0.2em; - font-size: 150%; - background-repeat: no-repeat; - background-position: 0% 50%; - cursor:pointer; -} - -.my-translation-btns { - background: #DDDDDD; - cursor:pointer; -} - -.my-treeimage { - width: 650px; - height: 520px; -} - -.my-alignmentimage { - width: 450px; - height: 300px; -} - -.my-typeError { - margin: 2px; - padding: 12px; - font-size: 150%; - font-weight: bold; - background: #CDFFDA; -} - -.my-typeError .title { - background: #DDDDDD; -} - -.my-typeError .content { - cursor:pointer; -} - -.my-identifierLink:link { - text-decoration: none; - color: black; -} - -.my-identifierLink:hover { - text-decoration: none; - color: black; - background-color: rgb(147, 194, 241); -} - -.my-FridgeBagPanel { - padding: 0.2em; - margin-top: 1.5em; - border: 3px solid #dddddd; -} - -.my-FridgeBagPanel-empty { - visibility: hidden; -} - -.my-Magnet { - float: left; - margin: 0.3em; - border-width: 1px; - border-style: solid; - border-color: black; - padding: 0.3em; - color: black; - background-color: white; -} - -.my-SyntaxTable { - font-size: 120%; -} - -.my-SyntaxRow { - margin: 1px; -} - -.my-SyntaxLang { - background: rgb(147,194,241); - padding: 2px; -} - -.my-SyntaxLin { - border: 1px solid rgb(147,194,241); - padding-left: 8px; - padding-right: 8px; - padding-top: 2px; - padding-bottom: 2px; -} diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/Fridge.css b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/Fridge.css deleted file mode 100644 index 5816831ad..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/Fridge.css +++ /dev/null @@ -1,89 +0,0 @@ -body { - background: url("brushed-metal.png"); -} - -.my-FridgeApp { - -} - -.my-FridgeTextPanel { - padding: 0.2em; - width: 100%; - border: 3px dashed #dddddd; -} - -.my-FridgeTextPanel .magnets { - width: 100%; -} - -.my-FridgeTextPanel .buttons { - width: 100%; -} - -.my-FridgeTextPanel .buttons button { - width: 100%; -} - -.my-FridgeTextPanel-engage { - border-color: #666666; - background-color: #dddddd; -} - -.my-FridgeBagPanel { - padding: 0.2em; - border: 3px solid #dddddd; -} - -.my-FridgeBagPanel-empty { - visibility: hidden; -} - -.my-PrefixPanel { - margin-bottom: 1em; -} - -.my-FridgeTextPanel .my-Magnet { - font-size: 150%; -} - -.my-Magnet { - float: left; - margin: 0.3em; - border-width: 1px; - border-style: solid; - border-color: black; - padding: 0.3em; - color: black; - background-color: white; -} - -.my-TranslationsPanel { - padding: 0.2em; - border: 3px solid #dddddd; - width: 100%; -} - -.my-TranslationsPanel-empty { - visibility: hidden; -} - -.my-translation { - margin: 0.2em; -} - -.my-typeError { - padding: 6px; - font-size: 150%; - font-weight: bold; - background: #B9BEC0; -} - -.my-SettingsPanel { - width: 100%; - padding: 0.5em 0; - border-top: 1px solid #dddddd; -} - -.my-SettingsPanel .my-FormWidget { - margin: 0.2em; -}
\ No newline at end of file diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/Translate.css b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/Translate.css deleted file mode 100644 index 0c08422d6..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/Translate.css +++ /dev/null @@ -1,82 +0,0 @@ -/** Add css rules here for your application. */ - -.my-SuggestPanel { - margin: 1em 0 0.5em 0; -} - -.my-SuggestPanel .gwt-SuggestBox { - width: 400px; - font-size: 150%; - margin: 0; -} - -.my-SuggestPanel .gwt-Button { - font-size: 150%; - margin: 0; - margin-left: 2px; -} - -.my-SettingsPanel * { - margin: 0 0.4em; -} - -.my-translations { - margin-top: 1em; -} - -.my-translation-frame { - width: 100%; - margin: 0.5em; - background: #D0E4F6; -} - -.my-translation-bar { - padding-left: 25px; - padding-right: 25px; - width: 100%; -} - -.my-translation { - margin: 0.2em; - font-size: 150%; - background-repeat: no-repeat; - background-position: 0% 50%; - cursor:pointer; -} - -.my-typeError { - padding: 12px; - font-size: 150%; - font-weight: bold; - background: #CDFFDA; -} - -.my-translation-btns { - background: #DDDDDD; - cursor:pointer; -} - -.my-treeimage { - width: 650px; - height: 520px; -} - -.my-alignmentimage { - width: 450px; - height: 300px; -} - -/* -* [LANG=bg] { background-image: url("flags/bg.png"); } -* [LANG=ca] { background-image: url("flags/catalonia.png"); } -* [LANG=da] { background-image: url("flags/dk.png"); } -* [LANG=de] { background-image: url("flags/de.png"); } -* [LANG=en] { background-image: url("flags/gb.png"); } -* [LANG=fi] { background-image: url("flags/fi.png"); } -* [LANG=fr] { background-image: url("flags/fr.png"); } -* [LANG=it] { background-image: url("flags/it.png"); } -* [LANG=no] { background-image: url("flags/no.png"); } -* [LANG=ru] { background-image: url("flags/ru.png"); } -* [LANG=es] { background-image: url("flags/es.png"); } -* [LANG=sv] { background-image: url("flags/se.png"); } -*/ diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/align-btn.png b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/align-btn.png Binary files differdeleted file mode 100644 index ca6a391c1..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/align-btn.png +++ /dev/null diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/background.png b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/background.png Binary files differdeleted file mode 100644 index 4c1e4989e..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/background.png +++ /dev/null diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/brushed-metal.png b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/brushed-metal.png Binary files differdeleted file mode 100644 index c2f03fe7d..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/brushed-metal.png +++ /dev/null diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/delete-last.png b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/delete-last.png Binary files differdeleted file mode 100644 index f984b976e..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/delete-last.png +++ /dev/null diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/grammar-buttons.png b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/grammar-buttons.png Binary files differdeleted file mode 100644 index 6cb89ca4b..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/grammar-buttons.png +++ /dev/null diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/new.png b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/new.png Binary files differdeleted file mode 100644 index 6f13ca749..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/new.png +++ /dev/null diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/textinput-buttons.png b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/textinput-buttons.png Binary files differdeleted file mode 100644 index 9f6017f70..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/textinput-buttons.png +++ /dev/null diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/trash-button.png b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/trash-button.png Binary files differdeleted file mode 100644 index 11536bc01..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/trash-button.png +++ /dev/null diff --git a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/tree-btn.png b/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/tree-btn.png Binary files differdeleted file mode 100644 index ebd243617..000000000 --- a/src/ui/gwt/src/org/grammaticalframework/ui/gwt/public/tree-btn.png +++ /dev/null diff --git a/src/ui/gwt/www/editor/editor.html b/src/ui/gwt/www/editor/editor.html deleted file mode 100644 index 114a88ccb..000000000 --- a/src/ui/gwt/www/editor/editor.html +++ /dev/null @@ -1,36 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<!-- The HTML 4.01 Transitional DOCTYPE declaration--> -<!-- above set at the top of the file will set --> -<!-- the browser's rendering engine into --> -<!-- "Quirks Mode". Replacing this declaration --> -<!-- with a "Standards Mode" doctype is supported, --> -<!-- but may lead to some differences in layout. --> - -<html> - <head> - <meta http-equiv="content-type" content="text/html; charset=UTF-8"> - <!-- --> - <!-- Any title is fine --> - <!-- --> - <title>Editor</title> - - <!-- --> - <!-- This script loads your compiled module. --> - <!-- If you add any GWT meta tags, they must --> - <!-- be added before this line. --> - <!-- --> - <script type="text/javascript" language="javascript" src="org.grammaticalframework.ui.gwt.EditorApp/org.grammaticalframework.ui.gwt.EditorApp.nocache.js"></script> - </head> - - <!-- --> - <!-- The body can have arbitrary html, or --> - <!-- you can leave the body empty if you want --> - <!-- to create a completely dynamic UI. --> - <!-- --> - <body> - - <!-- OPTIONAL: include this if you want history support --> - <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe> - - </body> -</html> diff --git a/src/ui/gwt/www/editor/index.html b/src/ui/gwt/www/editor/index.html deleted file mode 100644 index 1af492b4a..000000000 --- a/src/ui/gwt/www/editor/index.html +++ /dev/null @@ -1,4 +0,0 @@ -<HEAD> -<META HTTP-EQUIV="REFRESH" - content="0; url=https://www.google.com/accounts/o8/ud?openid.ns=http://specs.openid.net/auth/2.0&openid.ns.max_auth_age=300&openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select&openid.identity=http://specs.openid.net/auth/2.0/identifier_select&openid.return_to=http://localhost:8080/editor/grammars.content&openid.realm=http://localhost:8080/&openid.mode=checkid_immediate&openid.ns.ax=http://openid.net/srv/ax/1.0&openid.ax.mode=fetch_request&openid.ax.type.email=http://axschema.org/contact/email&openid.ax.required=email"> -</HEAD> diff --git a/src/ui/gwt/www/fridge/index.html b/src/ui/gwt/www/fridge/index.html deleted file mode 100644 index 723e8a252..000000000 --- a/src/ui/gwt/www/fridge/index.html +++ /dev/null @@ -1,36 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<!-- The HTML 4.01 Transitional DOCTYPE declaration--> -<!-- above set at the top of the file will set --> -<!-- the browser's rendering engine into --> -<!-- "Quirks Mode". Replacing this declaration --> -<!-- with a "Standards Mode" doctype is supported, --> -<!-- but may lead to some differences in layout. --> - -<html> - <head> - <meta http-equiv="content-type" content="text/html; charset=UTF-8"> - <!-- --> - <!-- Any title is fine --> - <!-- --> - <title>Fridge</title> - - <!-- --> - <!-- This script loads your compiled module. --> - <!-- If you add any GWT meta tags, they must --> - <!-- be added before this line. --> - <!-- --> - <script type="text/javascript" language="javascript" src="org.grammaticalframework.ui.gwt.FridgeApp/org.grammaticalframework.ui.gwt.FridgeApp.nocache.js"></script> - </head> - - <!-- --> - <!-- The body can have arbitrary html, or --> - <!-- you can leave the body empty if you want --> - <!-- to create a completely dynamic UI. --> - <!-- --> - <body> - - <!-- OPTIONAL: include this if you want history support --> - <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe> - - </body> -</html> diff --git a/src/ui/gwt/www/morpho/index.html b/src/ui/gwt/www/morpho/index.html deleted file mode 100644 index d524b3e91..000000000 --- a/src/ui/gwt/www/morpho/index.html +++ /dev/null @@ -1,36 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<!-- The HTML 4.01 Transitional DOCTYPE declaration--> -<!-- above set at the top of the file will set --> -<!-- the browser's rendering engine into --> -<!-- "Quirks Mode". Replacing this declaration --> -<!-- with a "Standards Mode" doctype is supported, --> -<!-- but may lead to some differences in layout. --> - -<html> - <head> - <meta http-equiv="content-type" content="text/html; charset=UTF-8"> - <!-- --> - <!-- Any title is fine --> - <!-- --> - <title>Morpho</title> - - <!-- --> - <!-- This script loads your compiled module. --> - <!-- If you add any GWT meta tags, they must --> - <!-- be added before this line. --> - <!-- --> - <script type="text/javascript" language="javascript" src="org.grammaticalframework.ui.gwt.MorphoApp/org.grammaticalframework.ui.gwt.MorphoApp.nocache.js"></script> - </head> - - <!-- --> - <!-- The body can have arbitrary html, or --> - <!-- you can leave the body empty if you want --> - <!-- to create a completely dynamic UI. --> - <!-- --> - <body> - - <!-- OPTIONAL: include this if you want history support --> - <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe> - - </body> -</html> diff --git a/src/ui/gwt/www/morpho/morpho.fcgi b/src/ui/gwt/www/morpho/morpho.fcgi deleted file mode 100644 index 8d1c8b69c..000000000 --- a/src/ui/gwt/www/morpho/morpho.fcgi +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/ui/gwt/www/translate/index.html b/src/ui/gwt/www/translate/index.html deleted file mode 100644 index 4b6abf89a..000000000 --- a/src/ui/gwt/www/translate/index.html +++ /dev/null @@ -1,36 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<!-- The HTML 4.01 Transitional DOCTYPE declaration--> -<!-- above set at the top of the file will set --> -<!-- the browser's rendering engine into --> -<!-- "Quirks Mode". Replacing this declaration --> -<!-- with a "Standards Mode" doctype is supported, --> -<!-- but may lead to some differences in layout. --> - -<html> - <head> - <meta http-equiv="content-type" content="text/html; charset=UTF-8"> - <!-- --> - <!-- Any title is fine --> - <!-- --> - <title>Translate</title> - - <!-- --> - <!-- This script loads your compiled module. --> - <!-- If you add any GWT meta tags, they must --> - <!-- be added before this line. --> - <!-- --> - <script type="text/javascript" language="javascript" src="org.grammaticalframework.ui.gwt.TranslateApp/org.grammaticalframework.ui.gwt.TranslateApp.nocache.js"></script> - </head> - - <!-- --> - <!-- The body can have arbitrary html, or --> - <!-- you can leave the body empty if you want --> - <!-- to create a completely dynamic UI. --> - <!-- --> - <body> - - <!-- OPTIONAL: include this if you want history support --> - <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe> - - </body> -</html> diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator.xcodeproj/project.pbxproj b/src/ui/ios/GF-Offline-Translator/GF Offline Translator.xcodeproj/project.pbxproj deleted file mode 100644 index e445fac4f..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator.xcodeproj/project.pbxproj +++ /dev/null @@ -1,1189 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 82BDC7DA1BFC9222006E3F07 /* AppEst.pgf_c in Resources */ = {isa = PBXBuildFile; fileRef = 82BDC7D91BFC9222006E3F07 /* AppEst.pgf_c */; }; - 8B13021503B4FFDE467D3DA9 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ABB9B7B89581859D72BD5CEC /* libPods.a */; }; - CC020CFE1AF76A6C0050AE38 /* PhraseTranslation.m in Sources */ = {isa = PBXBuildFile; fileRef = CC020CFD1AF76A6C0050AE38 /* PhraseTranslation.m */; }; - CC022FB01AF8D8CF0067A675 /* SLKTextView+TextInputMode.m in Sources */ = {isa = PBXBuildFile; fileRef = CC022FAF1AF8D8CE0067A675 /* SLKTextView+TextInputMode.m */; }; - CC1DCA271B32EE2D00AFA6C1 /* SentenceTranslationUITableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = CC1DCA261B32EE2D00AFA6C1 /* SentenceTranslationUITableViewCell.m */; }; - CC2E85D11B1E4F2500F4BC47 /* AppTha.pgf_c in Resources */ = {isa = PBXBuildFile; fileRef = CC2E85D01B1E4F2500F4BC47 /* AppTha.pgf_c */; }; - CC2E85D31B1E4F3000F4BC47 /* AppJpn.pgf_c in Resources */ = {isa = PBXBuildFile; fileRef = CC2E85D21B1E4F3000F4BC47 /* AppJpn.pgf_c */; }; - CC54E7031B1F83E500B3BECC /* NSString+StringToArray.m in Sources */ = {isa = PBXBuildFile; fileRef = CC54E7021B1F83E400B3BECC /* NSString+StringToArray.m */; }; - CC54E7061B1F947E00B3BECC /* WordTranslation.m in Sources */ = {isa = PBXBuildFile; fileRef = CC54E7051B1F947E00B3BECC /* WordTranslation.m */; }; - CC54E7091B1F94AC00B3BECC /* Translation.m in Sources */ = {isa = PBXBuildFile; fileRef = CC54E7081B1F94AC00B3BECC /* Translation.m */; }; - CC57C23E1AEE23D000051DE4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CC57C23D1AEE23D000051DE4 /* main.m */; }; - CC57C2411AEE23D000051DE4 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CC57C2401AEE23D000051DE4 /* AppDelegate.m */; }; - CC57C2471AEE23D000051DE4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CC57C2451AEE23D000051DE4 /* Main.storyboard */; }; - CC57C2491AEE23D000051DE4 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CC57C2481AEE23D000051DE4 /* Images.xcassets */; }; - CC57C2581AEE23D000051DE4 /* GF_Offline_TranslatorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CC57C2571AEE23D000051DE4 /* GF_Offline_TranslatorTests.m */; }; - CC619ED91AEE5793003A6EC7 /* TranslationTextViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CC619ED81AEE5793003A6EC7 /* TranslationTextViewController.m */; }; - CC619EDC1AEE5968003A6EC7 /* TranslationInputTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = CC619EDB1AEE5968003A6EC7 /* TranslationInputTableViewCell.xib */; }; - CC619EDF1AEE59F8003A6EC7 /* TranslationTextTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = CC619EDE1AEE59F8003A6EC7 /* TranslationTextTableViewCell.m */; }; - CC619EE41AEE60BB003A6EC7 /* TranslationOutputTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = CC619EE21AEE60BB003A6EC7 /* TranslationOutputTableViewCell.xib */; }; - CC722BF51B11F83A0022DD7C /* MorphAnalyser.m in Sources */ = {isa = PBXBuildFile; fileRef = CC722BF41B11F83A0022DD7C /* MorphAnalyser.m */; }; - CC722BF81B13B0530022DD7C /* WebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CC722BF71B13B0530022DD7C /* WebViewController.m */; }; - CC8E007C1AEE32B20040920E /* assert.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00191AEE32810040920E /* assert.h */; }; - CC8E007D1AEE32B20040920E /* bits.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E001A1AEE32810040920E /* bits.c */; }; - CC8E007E1AEE32B20040920E /* bits.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E001B1AEE32810040920E /* bits.h */; }; - CC8E007F1AEE32B20040920E /* choice.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E001C1AEE32810040920E /* choice.c */; }; - CC8E00801AEE32B20040920E /* choice.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E001D1AEE32810040920E /* choice.h */; }; - CC8E00811AEE32B20040920E /* defs.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E001E1AEE32810040920E /* defs.c */; }; - CC8E00821AEE32B20040920E /* defs.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E001F1AEE32810040920E /* defs.h */; }; - CC8E00831AEE32B20040920E /* enum.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00201AEE32810040920E /* enum.c */; }; - CC8E00841AEE32B20040920E /* enum.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00211AEE32810040920E /* enum.h */; }; - CC8E00851AEE32B20040920E /* exn.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00221AEE32810040920E /* exn.c */; }; - CC8E00861AEE32B20040920E /* exn.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00231AEE32810040920E /* exn.h */; }; - CC8E00871AEE32B20040920E /* file.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00241AEE32810040920E /* file.c */; }; - CC8E00881AEE32B20040920E /* file.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00251AEE32810040920E /* file.h */; }; - CC8E00891AEE32B20040920E /* fun.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00261AEE32810040920E /* fun.c */; }; - CC8E008A1AEE32B20040920E /* fun.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00271AEE32810040920E /* fun.h */; }; - CC8E008B1AEE32B20040920E /* hash.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00281AEE32810040920E /* hash.c */; }; - CC8E008C1AEE32B20040920E /* hash.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00291AEE32810040920E /* hash.h */; }; - CC8E008D1AEE32B20040920E /* in.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E002A1AEE32810040920E /* in.c */; }; - CC8E008E1AEE32B20040920E /* in.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E002B1AEE32810040920E /* in.h */; }; - CC8E008F1AEE32B20040920E /* map.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E002C1AEE32810040920E /* map.c */; }; - CC8E00901AEE32B20040920E /* map.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E002D1AEE32810040920E /* map.h */; }; - CC8E00911AEE32B20040920E /* mem.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E002E1AEE32810040920E /* mem.c */; }; - CC8E00921AEE32B20040920E /* mem.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E002F1AEE32810040920E /* mem.h */; }; - CC8E00931AEE32B20040920E /* out.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00301AEE32810040920E /* out.c */; }; - CC8E00941AEE32B20040920E /* out.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00311AEE32810040920E /* out.h */; }; - CC8E00951AEE32B20040920E /* prime.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00321AEE32810040920E /* prime.c */; }; - CC8E00961AEE32B20040920E /* prime.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00331AEE32810040920E /* prime.h */; }; - CC8E00971AEE32B20040920E /* seq.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00341AEE32810040920E /* seq.c */; }; - CC8E00981AEE32B20040920E /* seq.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00351AEE32810040920E /* seq.h */; }; - CC8E00991AEE32B20040920E /* string.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00361AEE32810040920E /* string.c */; }; - CC8E009A1AEE32B20040920E /* string.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00371AEE32810040920E /* string.h */; }; - CC8E009B1AEE32B20040920E /* sysdeps.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00381AEE32810040920E /* sysdeps.h */; }; - CC8E009C1AEE32B20040920E /* ucs.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00391AEE32810040920E /* ucs.c */; }; - CC8E009D1AEE32B20040920E /* ucs.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E003A1AEE32810040920E /* ucs.h */; }; - CC8E009E1AEE32B20040920E /* utf8.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E003B1AEE32810040920E /* utf8.c */; }; - CC8E009F1AEE32B20040920E /* utf8.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E003C1AEE32810040920E /* utf8.h */; }; - CC8E00A01AEE32B20040920E /* variant.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E003D1AEE32810040920E /* variant.c */; }; - CC8E00A11AEE32B20040920E /* variant.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E003E1AEE32810040920E /* variant.h */; }; - CC8E00A21AEE32C40040920E /* aligner.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00401AEE32810040920E /* aligner.c */; }; - CC8E00A31AEE32C40040920E /* data.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00411AEE32810040920E /* data.c */; }; - CC8E00A41AEE32C40040920E /* data.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00421AEE32810040920E /* data.h */; }; - CC8E00A51AEE32C40040920E /* evaluator.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00431AEE32810040920E /* evaluator.c */; }; - CC8E00A61AEE32C40040920E /* evaluator.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00441AEE32810040920E /* evaluator.h */; }; - CC8E00A71AEE32C40040920E /* expr.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00451AEE32810040920E /* expr.c */; }; - CC8E00A81AEE32C40040920E /* expr.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00461AEE32810040920E /* expr.h */; }; - CC8E00A91AEE32C40040920E /* graphviz.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00471AEE32810040920E /* graphviz.c */; }; - CC8E00AA1AEE32C40040920E /* graphviz.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00481AEE32810040920E /* graphviz.h */; }; - CC8E00AB1AEE32C40040920E /* hopu.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00491AEE32810040920E /* hopu.c */; }; - CC8E00AC1AEE32C40040920E /* hopu.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E004A1AEE32810040920E /* hopu.h */; }; - CC8E00AD1AEE32C40040920E /* jit.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E004B1AEE32810040920E /* jit.c */; }; - CC8E00AE1AEE32C40040920E /* asm.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E004E1AEE32810040920E /* asm.h */; }; - CC8E00AF1AEE32C40040920E /* core.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E004F1AEE32810040920E /* core.h */; }; - CC8E00B01AEE32C40040920E /* fp-swf.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00501AEE32810040920E /* fp-swf.h */; }; - CC8E00B11AEE32C40040920E /* fp-vfp.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00511AEE32810040920E /* fp-vfp.h */; }; - CC8E00B21AEE32C40040920E /* fp.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00521AEE32810040920E /* fp.h */; }; - CC8E00B31AEE32C40040920E /* funcs.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00531AEE32810040920E /* funcs.h */; }; - CC8E00B41AEE32C40040920E /* asm-common.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00541AEE32810040920E /* asm-common.h */; }; - CC8E00B51AEE32C40040920E /* core-common.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00551AEE32810040920E /* core-common.h */; }; - CC8E00B61AEE32C40040920E /* fp-common.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00561AEE32810040920E /* fp-common.h */; }; - CC8E00B71AEE32C40040920E /* funcs-common.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00571AEE32810040920E /* funcs-common.h */; }; - CC8E00B81AEE32C40040920E /* asm-32.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00591AEE32810040920E /* asm-32.h */; }; - CC8E00B91AEE32C40040920E /* asm-64.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E005A1AEE32810040920E /* asm-64.h */; }; - CC8E00BA1AEE32C40040920E /* asm.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E005B1AEE32810040920E /* asm.h */; }; - CC8E00BB1AEE32C40040920E /* core-32.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E005C1AEE32810040920E /* core-32.h */; }; - CC8E00BC1AEE32C40040920E /* core-64.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E005D1AEE32810040920E /* core-64.h */; }; - CC8E00BD1AEE32C40040920E /* core.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E005E1AEE32810040920E /* core.h */; }; - CC8E00BE1AEE32C40040920E /* fp-32.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E005F1AEE32810040920E /* fp-32.h */; }; - CC8E00BF1AEE32C40040920E /* fp-64.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00601AEE32810040920E /* fp-64.h */; }; - CC8E00C01AEE32C40040920E /* fp.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00611AEE32810040920E /* fp.h */; }; - CC8E00C11AEE32C40040920E /* funcs.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00621AEE32810040920E /* funcs.h */; }; - CC8E00C21AEE32C40040920E /* asm.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00641AEE32810040920E /* asm.h */; }; - CC8E00C31AEE32C40040920E /* core.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00651AEE32810040920E /* core.h */; }; - CC8E00C41AEE32C40040920E /* fp.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00661AEE32810040920E /* fp.h */; }; - CC8E00C51AEE32C40040920E /* funcs.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00671AEE32810040920E /* funcs.h */; }; - CC8E00C61AEE32C40040920E /* asm.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00691AEE32810040920E /* asm.h */; }; - CC8E00C71AEE32C40040920E /* core.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E006A1AEE32810040920E /* core.h */; }; - CC8E00C81AEE32C40040920E /* fp.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E006B1AEE32810040920E /* fp.h */; }; - CC8E00C91AEE32C40040920E /* funcs.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E006C1AEE32810040920E /* funcs.h */; }; - CC8E00CA1AEE32C40040920E /* lightning.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E006D1AEE32810040920E /* lightning.h */; }; - CC8E00CB1AEE32C40040920E /* linearizer.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E006E1AEE32810040920E /* linearizer.c */; }; - CC8E00CC1AEE32C40040920E /* linearizer.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E006F1AEE32810040920E /* linearizer.h */; }; - CC8E00CD1AEE32C40040920E /* literals.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00701AEE32810040920E /* literals.c */; }; - CC8E00CE1AEE32C40040920E /* literals.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00711AEE32810040920E /* literals.h */; }; - CC8E00CF1AEE32C40040920E /* parser.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00721AEE32810040920E /* parser.c */; }; - CC8E00D01AEE32C40040920E /* parseval.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00731AEE32810040920E /* parseval.c */; }; - CC8E00D11AEE32C40040920E /* pgf.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00741AEE32810040920E /* pgf.c */; }; - CC8E00D21AEE32C40040920E /* pgf.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00751AEE32810040920E /* pgf.h */; }; - CC8E00D31AEE32C40040920E /* printer.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00761AEE32810040920E /* printer.c */; }; - CC8E00D41AEE32C40040920E /* reader.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00771AEE32810040920E /* reader.c */; }; - CC8E00D51AEE32C40040920E /* reader.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00781AEE32810040920E /* reader.h */; }; - CC8E00D61AEE32C40040920E /* reasoner.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00791AEE32810040920E /* reasoner.c */; }; - CC8E00D71AEE32C40040920E /* reasoner.h in Sources */ = {isa = PBXBuildFile; fileRef = CC8E007A1AEE32810040920E /* reasoner.h */; }; - CC8E00D81AEE32C40040920E /* typechecker.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E007B1AEE32810040920E /* typechecker.c */; }; - CC8E00DA1AEE34E70040920E /* assert.c in Sources */ = {isa = PBXBuildFile; fileRef = CC8E00D91AEE34E70040920E /* assert.c */; }; - CC8E01031AEE38600040920E /* App.pgf in Resources */ = {isa = PBXBuildFile; fileRef = CC8E00F61AEE38600040920E /* App.pgf */; }; - CC8E01041AEE38600040920E /* AppBul.pgf_c in Resources */ = {isa = PBXBuildFile; fileRef = CC8E00F71AEE38600040920E /* AppBul.pgf_c */; }; - CC8E01051AEE38600040920E /* AppCat.pgf_c in Resources */ = {isa = PBXBuildFile; fileRef = CC8E00F81AEE38600040920E /* AppCat.pgf_c */; }; - CC8E01061AEE38600040920E /* AppChi.pgf_c in Resources */ = {isa = PBXBuildFile; fileRef = CC8E00F91AEE38600040920E /* AppChi.pgf_c */; }; - CC8E01071AEE38600040920E /* AppDut.pgf_c in Resources */ = {isa = PBXBuildFile; fileRef = CC8E00FA1AEE38600040920E /* AppDut.pgf_c */; }; - CC8E01081AEE38600040920E /* AppEng.pgf_c in Resources */ = {isa = PBXBuildFile; fileRef = CC8E00FB1AEE38600040920E /* AppEng.pgf_c */; }; - CC8E01091AEE38600040920E /* AppFin.pgf_c in Resources */ = {isa = PBXBuildFile; fileRef = CC8E00FC1AEE38600040920E /* AppFin.pgf_c */; }; - CC8E010A1AEE38600040920E /* AppFre.pgf_c in Resources */ = {isa = PBXBuildFile; fileRef = CC8E00FD1AEE38600040920E /* AppFre.pgf_c */; }; - CC8E010B1AEE38600040920E /* AppGer.pgf_c in Resources */ = {isa = PBXBuildFile; fileRef = CC8E00FE1AEE38600040920E /* AppGer.pgf_c */; }; - CC8E010C1AEE38600040920E /* AppHin.pgf_c in Resources */ = {isa = PBXBuildFile; fileRef = CC8E00FF1AEE38600040920E /* AppHin.pgf_c */; }; - CC8E010D1AEE38600040920E /* AppIta.pgf_c in Resources */ = {isa = PBXBuildFile; fileRef = CC8E01001AEE38600040920E /* AppIta.pgf_c */; }; - CC8E010E1AEE38600040920E /* AppSpa.pgf_c in Resources */ = {isa = PBXBuildFile; fileRef = CC8E01011AEE38600040920E /* AppSpa.pgf_c */; }; - CC8E010F1AEE38600040920E /* AppSwe.pgf_c in Resources */ = {isa = PBXBuildFile; fileRef = CC8E01021AEE38600040920E /* AppSwe.pgf_c */; }; - CC98AF0F1AEE72D800DFA116 /* LanguagesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CC98AF0E1AEE72D800DFA116 /* LanguagesViewController.m */; }; - CC98AF121AEE76D100DFA116 /* ArrowsButton.m in Sources */ = {isa = PBXBuildFile; fileRef = CC98AF111AEE76D100DFA116 /* ArrowsButton.m */; }; - CC98AF181AEE78E800DFA116 /* StyleKitGF.m in Sources */ = {isa = PBXBuildFile; fileRef = CC98AF171AEE78E800DFA116 /* StyleKitGF.m */; }; - CC98AF1B1AEF71B300DFA116 /* Language.m in Sources */ = {isa = PBXBuildFile; fileRef = CC98AF1A1AEF71B300DFA116 /* Language.m */; }; - CC98AF1F1AEF772200DFA116 /* Grammar.m in Sources */ = {isa = PBXBuildFile; fileRef = CC98AF1E1AEF772200DFA116 /* Grammar.m */; }; - CC98AF221AEF773500DFA116 /* Translator.m in Sources */ = {isa = PBXBuildFile; fileRef = CC98AF211AEF773500DFA116 /* Translator.m */; }; - CC98AF281AEFB4CF00DFA116 /* MenuView.m in Sources */ = {isa = PBXBuildFile; fileRef = CC98AF271AEFB4CF00DFA116 /* MenuView.m */; }; - CCA994DD1AF7907900FB04D6 /* UIColor+TranslationsResults.m in Sources */ = {isa = PBXBuildFile; fileRef = CCA994DC1AF7907900FB04D6 /* UIColor+TranslationsResults.m */; }; - CCCBEA071B00D18F00C5143D /* UITableViewCell+Customize.m in Sources */ = {isa = PBXBuildFile; fileRef = CCCBEA061B00D18F00C5143D /* UITableViewCell+Customize.m */; }; - CCDC6FE81B01465300C2B3FF /* TranslationOptionsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CCDC6FE71B01465300C2B3FF /* TranslationOptionsViewController.m */; }; - CCE9113F1B3445AF0064D971 /* help_content.html in Resources */ = {isa = PBXBuildFile; fileRef = CCE9113E1B3445AF0064D971 /* help_content.html */; }; - CCE911421B386FE00064D971 /* TranslatorStore.m in Sources */ = {isa = PBXBuildFile; fileRef = CCE911411B386FE00064D971 /* TranslatorStore.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - CC57C2521AEE23D000051DE4 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = CC57C2301AEE23D000051DE4 /* Project object */; - proxyType = 1; - remoteGlobalIDString = CC57C2371AEE23D000051DE4; - remoteInfo = "GF Offline Translator"; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 82BDC7D91BFC9222006E3F07 /* AppEst.pgf_c */ = {isa = PBXFileReference; lastKnownFileType = file; path = AppEst.pgf_c; sourceTree = "<group>"; }; - 9D996C5B51A0CAF9741D9356 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; }; - ABB9B7B89581859D72BD5CEC /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; - B4E29C5D7044D408E488C0F3 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; }; - CC020CFC1AF76A6C0050AE38 /* PhraseTranslation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PhraseTranslation.h; sourceTree = "<group>"; }; - CC020CFD1AF76A6C0050AE38 /* PhraseTranslation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PhraseTranslation.m; sourceTree = "<group>"; }; - CC022FAE1AF8D8CE0067A675 /* SLKTextView+TextInputMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "SLKTextView+TextInputMode.h"; sourceTree = "<group>"; }; - CC022FAF1AF8D8CE0067A675 /* SLKTextView+TextInputMode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "SLKTextView+TextInputMode.m"; sourceTree = "<group>"; }; - CC1DCA251B32EE2D00AFA6C1 /* SentenceTranslationUITableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SentenceTranslationUITableViewCell.h; sourceTree = "<group>"; }; - CC1DCA261B32EE2D00AFA6C1 /* SentenceTranslationUITableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SentenceTranslationUITableViewCell.m; sourceTree = "<group>"; }; - CC2E85D01B1E4F2500F4BC47 /* AppTha.pgf_c */ = {isa = PBXFileReference; lastKnownFileType = file; path = AppTha.pgf_c; sourceTree = "<group>"; }; - CC2E85D21B1E4F3000F4BC47 /* AppJpn.pgf_c */ = {isa = PBXFileReference; lastKnownFileType = file; path = AppJpn.pgf_c; sourceTree = "<group>"; }; - CC54E7011B1F83E400B3BECC /* NSString+StringToArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+StringToArray.h"; sourceTree = "<group>"; }; - CC54E7021B1F83E400B3BECC /* NSString+StringToArray.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+StringToArray.m"; sourceTree = "<group>"; }; - CC54E7041B1F947E00B3BECC /* WordTranslation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WordTranslation.h; sourceTree = "<group>"; }; - CC54E7051B1F947E00B3BECC /* WordTranslation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WordTranslation.m; sourceTree = "<group>"; }; - CC54E7071B1F94AC00B3BECC /* Translation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Translation.h; sourceTree = "<group>"; }; - CC54E7081B1F94AC00B3BECC /* Translation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Translation.m; sourceTree = "<group>"; }; - CC57C2381AEE23D000051DE4 /* GF Offline Translator.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "GF Offline Translator.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - CC57C23C1AEE23D000051DE4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; - CC57C23D1AEE23D000051DE4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; - CC57C23F1AEE23D000051DE4 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; }; - CC57C2401AEE23D000051DE4 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; }; - CC57C2461AEE23D000051DE4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; - CC57C2481AEE23D000051DE4 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; }; - CC57C2511AEE23D000051DE4 /* GF Offline TranslatorTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "GF Offline TranslatorTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - CC57C2561AEE23D000051DE4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; - CC57C2571AEE23D000051DE4 /* GF_Offline_TranslatorTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GF_Offline_TranslatorTests.m; sourceTree = "<group>"; }; - CC619ED71AEE5793003A6EC7 /* TranslationTextViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TranslationTextViewController.h; sourceTree = "<group>"; }; - CC619ED81AEE5793003A6EC7 /* TranslationTextViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TranslationTextViewController.m; sourceTree = "<group>"; }; - CC619EDB1AEE5968003A6EC7 /* TranslationInputTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TranslationInputTableViewCell.xib; sourceTree = "<group>"; }; - CC619EDD1AEE59F8003A6EC7 /* TranslationTextTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TranslationTextTableViewCell.h; sourceTree = "<group>"; }; - CC619EDE1AEE59F8003A6EC7 /* TranslationTextTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TranslationTextTableViewCell.m; sourceTree = "<group>"; }; - CC619EE21AEE60BB003A6EC7 /* TranslationOutputTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TranslationOutputTableViewCell.xib; sourceTree = "<group>"; }; - CC722BF31B11F83A0022DD7C /* MorphAnalyser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MorphAnalyser.h; sourceTree = "<group>"; }; - CC722BF41B11F83A0022DD7C /* MorphAnalyser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MorphAnalyser.m; sourceTree = "<group>"; }; - CC722BF61B13B0530022DD7C /* WebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewController.h; sourceTree = "<group>"; }; - CC722BF71B13B0530022DD7C /* WebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewController.m; sourceTree = "<group>"; }; - CC8E00191AEE32810040920E /* assert.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = assert.h; sourceTree = "<group>"; }; - CC8E001A1AEE32810040920E /* bits.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = bits.c; sourceTree = "<group>"; }; - CC8E001B1AEE32810040920E /* bits.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = bits.h; sourceTree = "<group>"; }; - CC8E001C1AEE32810040920E /* choice.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = choice.c; sourceTree = "<group>"; }; - CC8E001D1AEE32810040920E /* choice.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = choice.h; sourceTree = "<group>"; }; - CC8E001E1AEE32810040920E /* defs.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = defs.c; sourceTree = "<group>"; }; - CC8E001F1AEE32810040920E /* defs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = defs.h; sourceTree = "<group>"; }; - CC8E00201AEE32810040920E /* enum.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = enum.c; sourceTree = "<group>"; }; - CC8E00211AEE32810040920E /* enum.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = enum.h; sourceTree = "<group>"; }; - CC8E00221AEE32810040920E /* exn.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = exn.c; sourceTree = "<group>"; }; - CC8E00231AEE32810040920E /* exn.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = exn.h; sourceTree = "<group>"; }; - CC8E00241AEE32810040920E /* file.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = file.c; sourceTree = "<group>"; }; - CC8E00251AEE32810040920E /* file.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = file.h; sourceTree = "<group>"; }; - CC8E00261AEE32810040920E /* fun.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fun.c; sourceTree = "<group>"; }; - CC8E00271AEE32810040920E /* fun.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fun.h; sourceTree = "<group>"; }; - CC8E00281AEE32810040920E /* hash.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = hash.c; sourceTree = "<group>"; }; - CC8E00291AEE32810040920E /* hash.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = hash.h; sourceTree = "<group>"; }; - CC8E002A1AEE32810040920E /* in.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = in.c; sourceTree = "<group>"; }; - CC8E002B1AEE32810040920E /* in.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = in.h; sourceTree = "<group>"; }; - CC8E002C1AEE32810040920E /* map.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = map.c; sourceTree = "<group>"; }; - CC8E002D1AEE32810040920E /* map.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = map.h; sourceTree = "<group>"; }; - CC8E002E1AEE32810040920E /* mem.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = mem.c; sourceTree = "<group>"; }; - CC8E002F1AEE32810040920E /* mem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mem.h; sourceTree = "<group>"; }; - CC8E00301AEE32810040920E /* out.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = out.c; sourceTree = "<group>"; }; - CC8E00311AEE32810040920E /* out.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = out.h; sourceTree = "<group>"; }; - CC8E00321AEE32810040920E /* prime.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = prime.c; sourceTree = "<group>"; }; - CC8E00331AEE32810040920E /* prime.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = prime.h; sourceTree = "<group>"; }; - CC8E00341AEE32810040920E /* seq.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = seq.c; sourceTree = "<group>"; }; - CC8E00351AEE32810040920E /* seq.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = seq.h; sourceTree = "<group>"; }; - CC8E00361AEE32810040920E /* string.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = string.c; sourceTree = "<group>"; }; - CC8E00371AEE32810040920E /* string.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = string.h; sourceTree = "<group>"; }; - CC8E00381AEE32810040920E /* sysdeps.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = sysdeps.h; sourceTree = "<group>"; }; - CC8E00391AEE32810040920E /* ucs.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ucs.c; sourceTree = "<group>"; }; - CC8E003A1AEE32810040920E /* ucs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ucs.h; sourceTree = "<group>"; }; - CC8E003B1AEE32810040920E /* utf8.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = utf8.c; sourceTree = "<group>"; }; - CC8E003C1AEE32810040920E /* utf8.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = utf8.h; sourceTree = "<group>"; }; - CC8E003D1AEE32810040920E /* variant.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = variant.c; sourceTree = "<group>"; }; - CC8E003E1AEE32810040920E /* variant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = variant.h; sourceTree = "<group>"; }; - CC8E00401AEE32810040920E /* aligner.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = aligner.c; sourceTree = "<group>"; }; - CC8E00411AEE32810040920E /* data.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = data.c; sourceTree = "<group>"; }; - CC8E00421AEE32810040920E /* data.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = data.h; sourceTree = "<group>"; }; - CC8E00431AEE32810040920E /* evaluator.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = evaluator.c; sourceTree = "<group>"; }; - CC8E00441AEE32810040920E /* evaluator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = evaluator.h; sourceTree = "<group>"; }; - CC8E00451AEE32810040920E /* expr.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = expr.c; sourceTree = "<group>"; }; - CC8E00461AEE32810040920E /* expr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = expr.h; sourceTree = "<group>"; }; - CC8E00471AEE32810040920E /* graphviz.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = graphviz.c; sourceTree = "<group>"; }; - CC8E00481AEE32810040920E /* graphviz.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = graphviz.h; sourceTree = "<group>"; }; - CC8E00491AEE32810040920E /* hopu.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = hopu.c; sourceTree = "<group>"; }; - CC8E004A1AEE32810040920E /* hopu.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = hopu.h; sourceTree = "<group>"; }; - CC8E004B1AEE32810040920E /* jit.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = jit.c; sourceTree = "<group>"; }; - CC8E004E1AEE32810040920E /* asm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = asm.h; sourceTree = "<group>"; }; - CC8E004F1AEE32810040920E /* core.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = core.h; sourceTree = "<group>"; }; - CC8E00501AEE32810040920E /* fp-swf.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "fp-swf.h"; sourceTree = "<group>"; }; - CC8E00511AEE32810040920E /* fp-vfp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "fp-vfp.h"; sourceTree = "<group>"; }; - CC8E00521AEE32810040920E /* fp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fp.h; sourceTree = "<group>"; }; - CC8E00531AEE32810040920E /* funcs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = funcs.h; sourceTree = "<group>"; }; - CC8E00541AEE32810040920E /* asm-common.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "asm-common.h"; sourceTree = "<group>"; }; - CC8E00551AEE32810040920E /* core-common.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "core-common.h"; sourceTree = "<group>"; }; - CC8E00561AEE32810040920E /* fp-common.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "fp-common.h"; sourceTree = "<group>"; }; - CC8E00571AEE32810040920E /* funcs-common.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "funcs-common.h"; sourceTree = "<group>"; }; - CC8E00591AEE32810040920E /* asm-32.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "asm-32.h"; sourceTree = "<group>"; }; - CC8E005A1AEE32810040920E /* asm-64.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "asm-64.h"; sourceTree = "<group>"; }; - CC8E005B1AEE32810040920E /* asm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = asm.h; sourceTree = "<group>"; }; - CC8E005C1AEE32810040920E /* core-32.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "core-32.h"; sourceTree = "<group>"; }; - CC8E005D1AEE32810040920E /* core-64.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "core-64.h"; sourceTree = "<group>"; }; - CC8E005E1AEE32810040920E /* core.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = core.h; sourceTree = "<group>"; }; - CC8E005F1AEE32810040920E /* fp-32.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "fp-32.h"; sourceTree = "<group>"; }; - CC8E00601AEE32810040920E /* fp-64.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "fp-64.h"; sourceTree = "<group>"; }; - CC8E00611AEE32810040920E /* fp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fp.h; sourceTree = "<group>"; }; - CC8E00621AEE32810040920E /* funcs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = funcs.h; sourceTree = "<group>"; }; - CC8E00641AEE32810040920E /* asm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = asm.h; sourceTree = "<group>"; }; - CC8E00651AEE32810040920E /* core.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = core.h; sourceTree = "<group>"; }; - CC8E00661AEE32810040920E /* fp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fp.h; sourceTree = "<group>"; }; - CC8E00671AEE32810040920E /* funcs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = funcs.h; sourceTree = "<group>"; }; - CC8E00691AEE32810040920E /* asm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = asm.h; sourceTree = "<group>"; }; - CC8E006A1AEE32810040920E /* core.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = core.h; sourceTree = "<group>"; }; - CC8E006B1AEE32810040920E /* fp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fp.h; sourceTree = "<group>"; }; - CC8E006C1AEE32810040920E /* funcs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = funcs.h; sourceTree = "<group>"; }; - CC8E006D1AEE32810040920E /* lightning.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = lightning.h; sourceTree = "<group>"; }; - CC8E006E1AEE32810040920E /* linearizer.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = linearizer.c; sourceTree = "<group>"; }; - CC8E006F1AEE32810040920E /* linearizer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = linearizer.h; sourceTree = "<group>"; }; - CC8E00701AEE32810040920E /* literals.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = literals.c; sourceTree = "<group>"; }; - CC8E00711AEE32810040920E /* literals.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = literals.h; sourceTree = "<group>"; }; - CC8E00721AEE32810040920E /* parser.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = parser.c; sourceTree = "<group>"; }; - CC8E00731AEE32810040920E /* parseval.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = parseval.c; sourceTree = "<group>"; }; - CC8E00741AEE32810040920E /* pgf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = pgf.c; sourceTree = "<group>"; }; - CC8E00751AEE32810040920E /* pgf.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = pgf.h; sourceTree = "<group>"; }; - CC8E00761AEE32810040920E /* printer.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = printer.c; sourceTree = "<group>"; }; - CC8E00771AEE32810040920E /* reader.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = reader.c; sourceTree = "<group>"; }; - CC8E00781AEE32810040920E /* reader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = reader.h; sourceTree = "<group>"; }; - CC8E00791AEE32810040920E /* reasoner.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = reasoner.c; sourceTree = "<group>"; }; - CC8E007A1AEE32810040920E /* reasoner.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = reasoner.h; sourceTree = "<group>"; }; - CC8E007B1AEE32810040920E /* typechecker.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = typechecker.c; sourceTree = "<group>"; }; - CC8E00D91AEE34E70040920E /* assert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = assert.c; sourceTree = "<group>"; }; - CC8E00F61AEE38600040920E /* App.pgf */ = {isa = PBXFileReference; lastKnownFileType = file; path = App.pgf; sourceTree = "<group>"; }; - CC8E00F71AEE38600040920E /* AppBul.pgf_c */ = {isa = PBXFileReference; lastKnownFileType = file; path = AppBul.pgf_c; sourceTree = "<group>"; }; - CC8E00F81AEE38600040920E /* AppCat.pgf_c */ = {isa = PBXFileReference; lastKnownFileType = file; path = AppCat.pgf_c; sourceTree = "<group>"; }; - CC8E00F91AEE38600040920E /* AppChi.pgf_c */ = {isa = PBXFileReference; lastKnownFileType = file; path = AppChi.pgf_c; sourceTree = "<group>"; }; - CC8E00FA1AEE38600040920E /* AppDut.pgf_c */ = {isa = PBXFileReference; lastKnownFileType = file; path = AppDut.pgf_c; sourceTree = "<group>"; }; - CC8E00FB1AEE38600040920E /* AppEng.pgf_c */ = {isa = PBXFileReference; lastKnownFileType = file; path = AppEng.pgf_c; sourceTree = "<group>"; }; - CC8E00FC1AEE38600040920E /* AppFin.pgf_c */ = {isa = PBXFileReference; lastKnownFileType = file; path = AppFin.pgf_c; sourceTree = "<group>"; }; - CC8E00FD1AEE38600040920E /* AppFre.pgf_c */ = {isa = PBXFileReference; lastKnownFileType = file; path = AppFre.pgf_c; sourceTree = "<group>"; }; - CC8E00FE1AEE38600040920E /* AppGer.pgf_c */ = {isa = PBXFileReference; lastKnownFileType = file; path = AppGer.pgf_c; sourceTree = "<group>"; }; - CC8E00FF1AEE38600040920E /* AppHin.pgf_c */ = {isa = PBXFileReference; lastKnownFileType = file; path = AppHin.pgf_c; sourceTree = "<group>"; }; - CC8E01001AEE38600040920E /* AppIta.pgf_c */ = {isa = PBXFileReference; lastKnownFileType = file; path = AppIta.pgf_c; sourceTree = "<group>"; }; - CC8E01011AEE38600040920E /* AppSpa.pgf_c */ = {isa = PBXFileReference; lastKnownFileType = file; path = AppSpa.pgf_c; sourceTree = "<group>"; }; - CC8E01021AEE38600040920E /* AppSwe.pgf_c */ = {isa = PBXFileReference; lastKnownFileType = file; path = AppSwe.pgf_c; sourceTree = "<group>"; }; - CC98AF0D1AEE72D800DFA116 /* LanguagesViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LanguagesViewController.h; sourceTree = "<group>"; }; - CC98AF0E1AEE72D800DFA116 /* LanguagesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LanguagesViewController.m; sourceTree = "<group>"; }; - CC98AF101AEE76D100DFA116 /* ArrowsButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrowsButton.h; sourceTree = "<group>"; }; - CC98AF111AEE76D100DFA116 /* ArrowsButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ArrowsButton.m; sourceTree = "<group>"; }; - CC98AF161AEE78E800DFA116 /* StyleKitGF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleKitGF.h; sourceTree = "<group>"; }; - CC98AF171AEE78E800DFA116 /* StyleKitGF.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StyleKitGF.m; sourceTree = "<group>"; }; - CC98AF191AEF71B300DFA116 /* Language.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Language.h; sourceTree = "<group>"; }; - CC98AF1A1AEF71B300DFA116 /* Language.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Language.m; sourceTree = "<group>"; }; - CC98AF1D1AEF772200DFA116 /* Grammar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Grammar.h; sourceTree = "<group>"; }; - CC98AF1E1AEF772200DFA116 /* Grammar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Grammar.m; sourceTree = "<group>"; }; - CC98AF201AEF773500DFA116 /* Translator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Translator.h; sourceTree = "<group>"; }; - CC98AF211AEF773500DFA116 /* Translator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Translator.m; sourceTree = "<group>"; }; - CC98AF261AEFB4CF00DFA116 /* MenuView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MenuView.h; sourceTree = "<group>"; }; - CC98AF271AEFB4CF00DFA116 /* MenuView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MenuView.m; sourceTree = "<group>"; }; - CCA994DB1AF7907900FB04D6 /* UIColor+TranslationsResults.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+TranslationsResults.h"; sourceTree = "<group>"; }; - CCA994DC1AF7907900FB04D6 /* UIColor+TranslationsResults.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+TranslationsResults.m"; sourceTree = "<group>"; }; - CCCBEA051B00D18F00C5143D /* UITableViewCell+Customize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITableViewCell+Customize.h"; sourceTree = "<group>"; }; - CCCBEA061B00D18F00C5143D /* UITableViewCell+Customize.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITableViewCell+Customize.m"; sourceTree = "<group>"; }; - CCDC6FE61B01465300C2B3FF /* TranslationOptionsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TranslationOptionsViewController.h; sourceTree = "<group>"; }; - CCDC6FE71B01465300C2B3FF /* TranslationOptionsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TranslationOptionsViewController.m; sourceTree = "<group>"; }; - CCE9113E1B3445AF0064D971 /* help_content.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = help_content.html; sourceTree = "<group>"; }; - CCE911401B386FE00064D971 /* TranslatorStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TranslatorStore.h; sourceTree = "<group>"; }; - CCE911411B386FE00064D971 /* TranslatorStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TranslatorStore.m; sourceTree = "<group>"; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - CC57C2351AEE23D000051DE4 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 8B13021503B4FFDE467D3DA9 /* libPods.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CC57C24E1AEE23D000051DE4 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 757F278DD9C30A2622F179EA /* Frameworks */ = { - isa = PBXGroup; - children = ( - ABB9B7B89581859D72BD5CEC /* libPods.a */, - ); - name = Frameworks; - sourceTree = "<group>"; - }; - CC0A61661B24D17300CF1D1E /* Categories */ = { - isa = PBXGroup; - children = ( - CC54E7011B1F83E400B3BECC /* NSString+StringToArray.h */, - CC54E7021B1F83E400B3BECC /* NSString+StringToArray.m */, - ); - name = Categories; - sourceTree = "<group>"; - }; - CC1DCA241B32ECF500AFA6C1 /* Storyboard */ = { - isa = PBXGroup; - children = ( - CC57C2451AEE23D000051DE4 /* Main.storyboard */, - ); - name = Storyboard; - sourceTree = "<group>"; - }; - CC57C22F1AEE23D000051DE4 = { - isa = PBXGroup; - children = ( - CC57C23A1AEE23D000051DE4 /* GF Offline Translator */, - CC57C2541AEE23D000051DE4 /* GF Offline TranslatorTests */, - CC57C2391AEE23D000051DE4 /* Products */, - DBEB5864D0802AB27690957F /* Pods */, - 757F278DD9C30A2622F179EA /* Frameworks */, - ); - sourceTree = "<group>"; - }; - CC57C2391AEE23D000051DE4 /* Products */ = { - isa = PBXGroup; - children = ( - CC57C2381AEE23D000051DE4 /* GF Offline Translator.app */, - CC57C2511AEE23D000051DE4 /* GF Offline TranslatorTests.xctest */, - ); - name = Products; - sourceTree = "<group>"; - }; - CC57C23A1AEE23D000051DE4 /* GF Offline Translator */ = { - isa = PBXGroup; - children = ( - CCE9113E1B3445AF0064D971 /* help_content.html */, - CC1DCA241B32ECF500AFA6C1 /* Storyboard */, - CC0A61661B24D17300CF1D1E /* Categories */, - CC619EDA1AEE589D003A6EC7 /* Grammatical Framework */, - CC98AF1C1AEF71BF00DFA116 /* Model */, - CC619EE51AEE6A1D003A6EC7 /* Views */, - CC98AF0C1AEE72A200DFA116 /* Controllers */, - CC57C2481AEE23D000051DE4 /* Images.xcassets */, - CC57C23B1AEE23D000051DE4 /* Supporting Files */, - ); - path = "GF Offline Translator"; - sourceTree = "<group>"; - }; - CC57C23B1AEE23D000051DE4 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - CC57C23F1AEE23D000051DE4 /* AppDelegate.h */, - CC57C2401AEE23D000051DE4 /* AppDelegate.m */, - CC57C23C1AEE23D000051DE4 /* Info.plist */, - CC57C23D1AEE23D000051DE4 /* main.m */, - ); - name = "Supporting Files"; - sourceTree = "<group>"; - }; - CC57C2541AEE23D000051DE4 /* GF Offline TranslatorTests */ = { - isa = PBXGroup; - children = ( - CC57C2571AEE23D000051DE4 /* GF_Offline_TranslatorTests.m */, - CC57C2551AEE23D000051DE4 /* Supporting Files */, - ); - path = "GF Offline TranslatorTests"; - sourceTree = "<group>"; - }; - CC57C2551AEE23D000051DE4 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - CC57C2561AEE23D000051DE4 /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = "<group>"; - }; - CC619EDA1AEE589D003A6EC7 /* Grammatical Framework */ = { - isa = PBXGroup; - children = ( - CC8E00181AEE32810040920E /* gu */, - CC8E003F1AEE32810040920E /* pgf */, - CC8E00F51AEE38600040920E /* grammars */, - ); - name = "Grammatical Framework"; - sourceTree = "<group>"; - }; - CC619EE51AEE6A1D003A6EC7 /* Views */ = { - isa = PBXGroup; - children = ( - CC98AF101AEE76D100DFA116 /* ArrowsButton.h */, - CC98AF111AEE76D100DFA116 /* ArrowsButton.m */, - CC98AF261AEFB4CF00DFA116 /* MenuView.h */, - CC98AF271AEFB4CF00DFA116 /* MenuView.m */, - CC1DCA251B32EE2D00AFA6C1 /* SentenceTranslationUITableViewCell.h */, - CC1DCA261B32EE2D00AFA6C1 /* SentenceTranslationUITableViewCell.m */, - CC022FAE1AF8D8CE0067A675 /* SLKTextView+TextInputMode.h */, - CC022FAF1AF8D8CE0067A675 /* SLKTextView+TextInputMode.m */, - CC98AF161AEE78E800DFA116 /* StyleKitGF.h */, - CC98AF171AEE78E800DFA116 /* StyleKitGF.m */, - CC619EDB1AEE5968003A6EC7 /* TranslationInputTableViewCell.xib */, - CC619EE21AEE60BB003A6EC7 /* TranslationOutputTableViewCell.xib */, - CC619EDD1AEE59F8003A6EC7 /* TranslationTextTableViewCell.h */, - CC619EDE1AEE59F8003A6EC7 /* TranslationTextTableViewCell.m */, - CCA994DB1AF7907900FB04D6 /* UIColor+TranslationsResults.h */, - CCA994DC1AF7907900FB04D6 /* UIColor+TranslationsResults.m */, - CCCBEA051B00D18F00C5143D /* UITableViewCell+Customize.h */, - CCCBEA061B00D18F00C5143D /* UITableViewCell+Customize.m */, - ); - name = Views; - sourceTree = "<group>"; - }; - CC8E00181AEE32810040920E /* gu */ = { - isa = PBXGroup; - children = ( - CC8E00D91AEE34E70040920E /* assert.c */, - CC8E00191AEE32810040920E /* assert.h */, - CC8E001A1AEE32810040920E /* bits.c */, - CC8E001B1AEE32810040920E /* bits.h */, - CC8E001C1AEE32810040920E /* choice.c */, - CC8E001D1AEE32810040920E /* choice.h */, - CC8E001E1AEE32810040920E /* defs.c */, - CC8E001F1AEE32810040920E /* defs.h */, - CC8E00201AEE32810040920E /* enum.c */, - CC8E00211AEE32810040920E /* enum.h */, - CC8E00221AEE32810040920E /* exn.c */, - CC8E00231AEE32810040920E /* exn.h */, - CC8E00241AEE32810040920E /* file.c */, - CC8E00251AEE32810040920E /* file.h */, - CC8E00261AEE32810040920E /* fun.c */, - CC8E00271AEE32810040920E /* fun.h */, - CC8E00281AEE32810040920E /* hash.c */, - CC8E00291AEE32810040920E /* hash.h */, - CC8E002A1AEE32810040920E /* in.c */, - CC8E002B1AEE32810040920E /* in.h */, - CC8E002C1AEE32810040920E /* map.c */, - CC8E002D1AEE32810040920E /* map.h */, - CC8E002E1AEE32810040920E /* mem.c */, - CC8E002F1AEE32810040920E /* mem.h */, - CC8E00301AEE32810040920E /* out.c */, - CC8E00311AEE32810040920E /* out.h */, - CC8E00321AEE32810040920E /* prime.c */, - CC8E00331AEE32810040920E /* prime.h */, - CC8E00341AEE32810040920E /* seq.c */, - CC8E00351AEE32810040920E /* seq.h */, - CC8E00361AEE32810040920E /* string.c */, - CC8E00371AEE32810040920E /* string.h */, - CC8E00381AEE32810040920E /* sysdeps.h */, - CC8E00391AEE32810040920E /* ucs.c */, - CC8E003A1AEE32810040920E /* ucs.h */, - CC8E003B1AEE32810040920E /* utf8.c */, - CC8E003C1AEE32810040920E /* utf8.h */, - CC8E003D1AEE32810040920E /* variant.c */, - CC8E003E1AEE32810040920E /* variant.h */, - ); - name = gu; - path = ../../../../runtime/c/gu; - sourceTree = "<group>"; - }; - CC8E003F1AEE32810040920E /* pgf */ = { - isa = PBXGroup; - children = ( - CC8E00401AEE32810040920E /* aligner.c */, - CC8E00411AEE32810040920E /* data.c */, - CC8E00421AEE32810040920E /* data.h */, - CC8E00431AEE32810040920E /* evaluator.c */, - CC8E00441AEE32810040920E /* evaluator.h */, - CC8E00451AEE32810040920E /* expr.c */, - CC8E00461AEE32810040920E /* expr.h */, - CC8E00471AEE32810040920E /* graphviz.c */, - CC8E00481AEE32810040920E /* graphviz.h */, - CC8E00491AEE32810040920E /* hopu.c */, - CC8E004A1AEE32810040920E /* hopu.h */, - CC8E004B1AEE32810040920E /* jit.c */, - CC8E004C1AEE32810040920E /* lightning */, - CC8E006D1AEE32810040920E /* lightning.h */, - CC8E006E1AEE32810040920E /* linearizer.c */, - CC8E006F1AEE32810040920E /* linearizer.h */, - CC8E00701AEE32810040920E /* literals.c */, - CC8E00711AEE32810040920E /* literals.h */, - CC8E00721AEE32810040920E /* parser.c */, - CC8E00731AEE32810040920E /* parseval.c */, - CC8E00741AEE32810040920E /* pgf.c */, - CC8E00751AEE32810040920E /* pgf.h */, - CC8E00761AEE32810040920E /* printer.c */, - CC8E00771AEE32810040920E /* reader.c */, - CC8E00781AEE32810040920E /* reader.h */, - CC8E00791AEE32810040920E /* reasoner.c */, - CC8E007A1AEE32810040920E /* reasoner.h */, - CC8E007B1AEE32810040920E /* typechecker.c */, - ); - name = pgf; - path = ../../../../runtime/c/pgf; - sourceTree = "<group>"; - }; - CC8E004C1AEE32810040920E /* lightning */ = { - isa = PBXGroup; - children = ( - CC8E004D1AEE32810040920E /* arm */, - CC8E00541AEE32810040920E /* asm-common.h */, - CC8E00551AEE32810040920E /* core-common.h */, - CC8E00561AEE32810040920E /* fp-common.h */, - CC8E00571AEE32810040920E /* funcs-common.h */, - CC8E00581AEE32810040920E /* i386 */, - CC8E00631AEE32810040920E /* ppc */, - CC8E00681AEE32810040920E /* sparc */, - ); - path = lightning; - sourceTree = "<group>"; - }; - CC8E004D1AEE32810040920E /* arm */ = { - isa = PBXGroup; - children = ( - CC8E004E1AEE32810040920E /* asm.h */, - CC8E004F1AEE32810040920E /* core.h */, - CC8E00501AEE32810040920E /* fp-swf.h */, - CC8E00511AEE32810040920E /* fp-vfp.h */, - CC8E00521AEE32810040920E /* fp.h */, - CC8E00531AEE32810040920E /* funcs.h */, - ); - path = arm; - sourceTree = "<group>"; - }; - CC8E00581AEE32810040920E /* i386 */ = { - isa = PBXGroup; - children = ( - CC8E00591AEE32810040920E /* asm-32.h */, - CC8E005A1AEE32810040920E /* asm-64.h */, - CC8E005B1AEE32810040920E /* asm.h */, - CC8E005C1AEE32810040920E /* core-32.h */, - CC8E005D1AEE32810040920E /* core-64.h */, - CC8E005E1AEE32810040920E /* core.h */, - CC8E005F1AEE32810040920E /* fp-32.h */, - CC8E00601AEE32810040920E /* fp-64.h */, - CC8E00611AEE32810040920E /* fp.h */, - CC8E00621AEE32810040920E /* funcs.h */, - ); - path = i386; - sourceTree = "<group>"; - }; - CC8E00631AEE32810040920E /* ppc */ = { - isa = PBXGroup; - children = ( - CC8E00641AEE32810040920E /* asm.h */, - CC8E00651AEE32810040920E /* core.h */, - CC8E00661AEE32810040920E /* fp.h */, - CC8E00671AEE32810040920E /* funcs.h */, - ); - path = ppc; - sourceTree = "<group>"; - }; - CC8E00681AEE32810040920E /* sparc */ = { - isa = PBXGroup; - children = ( - CC8E00691AEE32810040920E /* asm.h */, - CC8E006A1AEE32810040920E /* core.h */, - CC8E006B1AEE32810040920E /* fp.h */, - CC8E006C1AEE32810040920E /* funcs.h */, - ); - path = sparc; - sourceTree = "<group>"; - }; - CC8E00F51AEE38600040920E /* grammars */ = { - isa = PBXGroup; - children = ( - 82BDC7D91BFC9222006E3F07 /* AppEst.pgf_c */, - CC8E00F61AEE38600040920E /* App.pgf */, - CC8E00F71AEE38600040920E /* AppBul.pgf_c */, - CC8E00F81AEE38600040920E /* AppCat.pgf_c */, - CC8E00F91AEE38600040920E /* AppChi.pgf_c */, - CC8E00FA1AEE38600040920E /* AppDut.pgf_c */, - CC8E00FB1AEE38600040920E /* AppEng.pgf_c */, - CC8E00FC1AEE38600040920E /* AppFin.pgf_c */, - CC8E00FD1AEE38600040920E /* AppFre.pgf_c */, - CC8E00FE1AEE38600040920E /* AppGer.pgf_c */, - CC8E00FF1AEE38600040920E /* AppHin.pgf_c */, - CC8E01001AEE38600040920E /* AppIta.pgf_c */, - CC2E85D21B1E4F3000F4BC47 /* AppJpn.pgf_c */, - CC8E01011AEE38600040920E /* AppSpa.pgf_c */, - CC8E01021AEE38600040920E /* AppSwe.pgf_c */, - CC2E85D01B1E4F2500F4BC47 /* AppTha.pgf_c */, - ); - path = grammars; - sourceTree = "<group>"; - }; - CC98AF0C1AEE72A200DFA116 /* Controllers */ = { - isa = PBXGroup; - children = ( - CC619ED71AEE5793003A6EC7 /* TranslationTextViewController.h */, - CC619ED81AEE5793003A6EC7 /* TranslationTextViewController.m */, - CC98AF0D1AEE72D800DFA116 /* LanguagesViewController.h */, - CC98AF0E1AEE72D800DFA116 /* LanguagesViewController.m */, - CCDC6FE61B01465300C2B3FF /* TranslationOptionsViewController.h */, - CCDC6FE71B01465300C2B3FF /* TranslationOptionsViewController.m */, - CC722BF61B13B0530022DD7C /* WebViewController.h */, - CC722BF71B13B0530022DD7C /* WebViewController.m */, - ); - name = Controllers; - sourceTree = "<group>"; - }; - CC98AF1C1AEF71BF00DFA116 /* Model */ = { - isa = PBXGroup; - children = ( - CC98AF191AEF71B300DFA116 /* Language.h */, - CC98AF1A1AEF71B300DFA116 /* Language.m */, - CC98AF1D1AEF772200DFA116 /* Grammar.h */, - CC98AF1E1AEF772200DFA116 /* Grammar.m */, - CC98AF201AEF773500DFA116 /* Translator.h */, - CC98AF211AEF773500DFA116 /* Translator.m */, - CC722BF31B11F83A0022DD7C /* MorphAnalyser.h */, - CC722BF41B11F83A0022DD7C /* MorphAnalyser.m */, - CC020CFC1AF76A6C0050AE38 /* PhraseTranslation.h */, - CC020CFD1AF76A6C0050AE38 /* PhraseTranslation.m */, - CC54E7041B1F947E00B3BECC /* WordTranslation.h */, - CC54E7051B1F947E00B3BECC /* WordTranslation.m */, - CC54E7071B1F94AC00B3BECC /* Translation.h */, - CC54E7081B1F94AC00B3BECC /* Translation.m */, - CCE911401B386FE00064D971 /* TranslatorStore.h */, - CCE911411B386FE00064D971 /* TranslatorStore.m */, - ); - name = Model; - sourceTree = "<group>"; - }; - DBEB5864D0802AB27690957F /* Pods */ = { - isa = PBXGroup; - children = ( - 9D996C5B51A0CAF9741D9356 /* Pods.debug.xcconfig */, - B4E29C5D7044D408E488C0F3 /* Pods.release.xcconfig */, - ); - name = Pods; - sourceTree = "<group>"; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - CC57C2371AEE23D000051DE4 /* GF Offline Translator */ = { - isa = PBXNativeTarget; - buildConfigurationList = CC57C25B1AEE23D000051DE4 /* Build configuration list for PBXNativeTarget "GF Offline Translator" */; - buildPhases = ( - 5E7D20D814FB848D56153D89 /* Check Pods Manifest.lock */, - CC57C2341AEE23D000051DE4 /* Sources */, - CC57C2351AEE23D000051DE4 /* Frameworks */, - CC57C2361AEE23D000051DE4 /* Resources */, - CB7F42FAC05C039EDE36C01D /* Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "GF Offline Translator"; - productName = "GF Offline Translator"; - productReference = CC57C2381AEE23D000051DE4 /* GF Offline Translator.app */; - productType = "com.apple.product-type.application"; - }; - CC57C2501AEE23D000051DE4 /* GF Offline TranslatorTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = CC57C25E1AEE23D000051DE4 /* Build configuration list for PBXNativeTarget "GF Offline TranslatorTests" */; - buildPhases = ( - CC57C24D1AEE23D000051DE4 /* Sources */, - CC57C24E1AEE23D000051DE4 /* Frameworks */, - CC57C24F1AEE23D000051DE4 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - CC57C2531AEE23D000051DE4 /* PBXTargetDependency */, - ); - name = "GF Offline TranslatorTests"; - productName = "GF Offline TranslatorTests"; - productReference = CC57C2511AEE23D000051DE4 /* GF Offline TranslatorTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - CC57C2301AEE23D000051DE4 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0630; - ORGANIZATIONNAME = "Grammatical Framework"; - TargetAttributes = { - CC57C2371AEE23D000051DE4 = { - CreatedOnToolsVersion = 6.3.1; - DevelopmentTeam = 4BJ69CG5TM; - }; - CC57C2501AEE23D000051DE4 = { - CreatedOnToolsVersion = 6.3.1; - TestTargetID = CC57C2371AEE23D000051DE4; - }; - }; - }; - buildConfigurationList = CC57C2331AEE23D000051DE4 /* Build configuration list for PBXProject "GF Offline Translator" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = CC57C22F1AEE23D000051DE4; - productRefGroup = CC57C2391AEE23D000051DE4 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - CC57C2371AEE23D000051DE4 /* GF Offline Translator */, - CC57C2501AEE23D000051DE4 /* GF Offline TranslatorTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - CC57C2361AEE23D000051DE4 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - CC57C2471AEE23D000051DE4 /* Main.storyboard in Resources */, - CC8E01091AEE38600040920E /* AppFin.pgf_c in Resources */, - CC8E010C1AEE38600040920E /* AppHin.pgf_c in Resources */, - CC619EE41AEE60BB003A6EC7 /* TranslationOutputTableViewCell.xib in Resources */, - CC8E01041AEE38600040920E /* AppBul.pgf_c in Resources */, - CC8E01061AEE38600040920E /* AppChi.pgf_c in Resources */, - CC8E010D1AEE38600040920E /* AppIta.pgf_c in Resources */, - CC57C2491AEE23D000051DE4 /* Images.xcassets in Resources */, - CC8E01051AEE38600040920E /* AppCat.pgf_c in Resources */, - CC2E85D31B1E4F3000F4BC47 /* AppJpn.pgf_c in Resources */, - CC619EDC1AEE5968003A6EC7 /* TranslationInputTableViewCell.xib in Resources */, - CC8E010F1AEE38600040920E /* AppSwe.pgf_c in Resources */, - CC8E01031AEE38600040920E /* App.pgf in Resources */, - CC2E85D11B1E4F2500F4BC47 /* AppTha.pgf_c in Resources */, - CC8E010B1AEE38600040920E /* AppGer.pgf_c in Resources */, - CCE9113F1B3445AF0064D971 /* help_content.html in Resources */, - CC8E010E1AEE38600040920E /* AppSpa.pgf_c in Resources */, - CC8E01071AEE38600040920E /* AppDut.pgf_c in Resources */, - CC8E01081AEE38600040920E /* AppEng.pgf_c in Resources */, - 82BDC7DA1BFC9222006E3F07 /* AppEst.pgf_c in Resources */, - CC8E010A1AEE38600040920E /* AppFre.pgf_c in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CC57C24F1AEE23D000051DE4 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 5E7D20D814FB848D56153D89 /* Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Check Pods Manifest.lock"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - CB7F42FAC05C039EDE36C01D /* Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - CC57C2341AEE23D000051DE4 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - CC8E00A21AEE32C40040920E /* aligner.c in Sources */, - CC8E00A31AEE32C40040920E /* data.c in Sources */, - CC8E00A41AEE32C40040920E /* data.h in Sources */, - CC8E00A51AEE32C40040920E /* evaluator.c in Sources */, - CC8E00A61AEE32C40040920E /* evaluator.h in Sources */, - CC8E00A71AEE32C40040920E /* expr.c in Sources */, - CC8E00A81AEE32C40040920E /* expr.h in Sources */, - CC8E00A91AEE32C40040920E /* graphviz.c in Sources */, - CC8E00AA1AEE32C40040920E /* graphviz.h in Sources */, - CC54E7031B1F83E500B3BECC /* NSString+StringToArray.m in Sources */, - CC8E00AB1AEE32C40040920E /* hopu.c in Sources */, - CC8E00AC1AEE32C40040920E /* hopu.h in Sources */, - CC98AF121AEE76D100DFA116 /* ArrowsButton.m in Sources */, - CC8E00AD1AEE32C40040920E /* jit.c in Sources */, - CC8E00AE1AEE32C40040920E /* asm.h in Sources */, - CC8E00AF1AEE32C40040920E /* core.h in Sources */, - CC8E00B01AEE32C40040920E /* fp-swf.h in Sources */, - CC8E00B11AEE32C40040920E /* fp-vfp.h in Sources */, - CCE911421B386FE00064D971 /* TranslatorStore.m in Sources */, - CC8E00B21AEE32C40040920E /* fp.h in Sources */, - CC8E00B31AEE32C40040920E /* funcs.h in Sources */, - CC8E00B41AEE32C40040920E /* asm-common.h in Sources */, - CC722BF51B11F83A0022DD7C /* MorphAnalyser.m in Sources */, - CC8E00B51AEE32C40040920E /* core-common.h in Sources */, - CC8E00B61AEE32C40040920E /* fp-common.h in Sources */, - CC8E00B71AEE32C40040920E /* funcs-common.h in Sources */, - CC8E00B81AEE32C40040920E /* asm-32.h in Sources */, - CC8E00B91AEE32C40040920E /* asm-64.h in Sources */, - CC98AF281AEFB4CF00DFA116 /* MenuView.m in Sources */, - CC8E00BA1AEE32C40040920E /* asm.h in Sources */, - CC8E00BB1AEE32C40040920E /* core-32.h in Sources */, - CC98AF1B1AEF71B300DFA116 /* Language.m in Sources */, - CC8E00BC1AEE32C40040920E /* core-64.h in Sources */, - CC8E00BD1AEE32C40040920E /* core.h in Sources */, - CC8E00BE1AEE32C40040920E /* fp-32.h in Sources */, - CC8E00BF1AEE32C40040920E /* fp-64.h in Sources */, - CCA994DD1AF7907900FB04D6 /* UIColor+TranslationsResults.m in Sources */, - CC8E00C01AEE32C40040920E /* fp.h in Sources */, - CC98AF221AEF773500DFA116 /* Translator.m in Sources */, - CC8E00C11AEE32C40040920E /* funcs.h in Sources */, - CC98AF0F1AEE72D800DFA116 /* LanguagesViewController.m in Sources */, - CC98AF1F1AEF772200DFA116 /* Grammar.m in Sources */, - CC8E00C21AEE32C40040920E /* asm.h in Sources */, - CC8E00C31AEE32C40040920E /* core.h in Sources */, - CC022FB01AF8D8CF0067A675 /* SLKTextView+TextInputMode.m in Sources */, - CC722BF81B13B0530022DD7C /* WebViewController.m in Sources */, - CC8E00C41AEE32C40040920E /* fp.h in Sources */, - CC8E00C51AEE32C40040920E /* funcs.h in Sources */, - CC8E00C61AEE32C40040920E /* asm.h in Sources */, - CC8E00C71AEE32C40040920E /* core.h in Sources */, - CC8E00C81AEE32C40040920E /* fp.h in Sources */, - CC8E00C91AEE32C40040920E /* funcs.h in Sources */, - CC8E00CA1AEE32C40040920E /* lightning.h in Sources */, - CC8E00CB1AEE32C40040920E /* linearizer.c in Sources */, - CC8E00CC1AEE32C40040920E /* linearizer.h in Sources */, - CC8E00CD1AEE32C40040920E /* literals.c in Sources */, - CC8E00CE1AEE32C40040920E /* literals.h in Sources */, - CC619ED91AEE5793003A6EC7 /* TranslationTextViewController.m in Sources */, - CC8E00CF1AEE32C40040920E /* parser.c in Sources */, - CC8E00D01AEE32C40040920E /* parseval.c in Sources */, - CC8E00D11AEE32C40040920E /* pgf.c in Sources */, - CC8E00D21AEE32C40040920E /* pgf.h in Sources */, - CC8E00D31AEE32C40040920E /* printer.c in Sources */, - CC8E00D41AEE32C40040920E /* reader.c in Sources */, - CC8E00D51AEE32C40040920E /* reader.h in Sources */, - CCDC6FE81B01465300C2B3FF /* TranslationOptionsViewController.m in Sources */, - CC8E00D61AEE32C40040920E /* reasoner.c in Sources */, - CC8E00D71AEE32C40040920E /* reasoner.h in Sources */, - CC8E00D81AEE32C40040920E /* typechecker.c in Sources */, - CC8E007C1AEE32B20040920E /* assert.h in Sources */, - CC8E007D1AEE32B20040920E /* bits.c in Sources */, - CC8E007E1AEE32B20040920E /* bits.h in Sources */, - CC8E007F1AEE32B20040920E /* choice.c in Sources */, - CC8E00801AEE32B20040920E /* choice.h in Sources */, - CC8E00811AEE32B20040920E /* defs.c in Sources */, - CC8E00821AEE32B20040920E /* defs.h in Sources */, - CC8E00831AEE32B20040920E /* enum.c in Sources */, - CC8E00841AEE32B20040920E /* enum.h in Sources */, - CC8E00851AEE32B20040920E /* exn.c in Sources */, - CCCBEA071B00D18F00C5143D /* UITableViewCell+Customize.m in Sources */, - CC619EDF1AEE59F8003A6EC7 /* TranslationTextTableViewCell.m in Sources */, - CC8E00861AEE32B20040920E /* exn.h in Sources */, - CC8E00871AEE32B20040920E /* file.c in Sources */, - CC8E00881AEE32B20040920E /* file.h in Sources */, - CC8E00891AEE32B20040920E /* fun.c in Sources */, - CC8E008A1AEE32B20040920E /* fun.h in Sources */, - CC8E008B1AEE32B20040920E /* hash.c in Sources */, - CC8E008C1AEE32B20040920E /* hash.h in Sources */, - CC54E7061B1F947E00B3BECC /* WordTranslation.m in Sources */, - CC8E008D1AEE32B20040920E /* in.c in Sources */, - CC8E008E1AEE32B20040920E /* in.h in Sources */, - CC8E008F1AEE32B20040920E /* map.c in Sources */, - CC8E00901AEE32B20040920E /* map.h in Sources */, - CC8E00911AEE32B20040920E /* mem.c in Sources */, - CC8E00921AEE32B20040920E /* mem.h in Sources */, - CC8E00931AEE32B20040920E /* out.c in Sources */, - CC020CFE1AF76A6C0050AE38 /* PhraseTranslation.m in Sources */, - CC8E00941AEE32B20040920E /* out.h in Sources */, - CC54E7091B1F94AC00B3BECC /* Translation.m in Sources */, - CC8E00DA1AEE34E70040920E /* assert.c in Sources */, - CC8E00951AEE32B20040920E /* prime.c in Sources */, - CC8E00961AEE32B20040920E /* prime.h in Sources */, - CC8E00971AEE32B20040920E /* seq.c in Sources */, - CC8E00981AEE32B20040920E /* seq.h in Sources */, - CC8E00991AEE32B20040920E /* string.c in Sources */, - CC8E009A1AEE32B20040920E /* string.h in Sources */, - CC8E009B1AEE32B20040920E /* sysdeps.h in Sources */, - CC8E009C1AEE32B20040920E /* ucs.c in Sources */, - CC8E009D1AEE32B20040920E /* ucs.h in Sources */, - CC8E009E1AEE32B20040920E /* utf8.c in Sources */, - CC8E009F1AEE32B20040920E /* utf8.h in Sources */, - CC98AF181AEE78E800DFA116 /* StyleKitGF.m in Sources */, - CC8E00A01AEE32B20040920E /* variant.c in Sources */, - CC1DCA271B32EE2D00AFA6C1 /* SentenceTranslationUITableViewCell.m in Sources */, - CC8E00A11AEE32B20040920E /* variant.h in Sources */, - CC57C2411AEE23D000051DE4 /* AppDelegate.m in Sources */, - CC57C23E1AEE23D000051DE4 /* main.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CC57C24D1AEE23D000051DE4 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - CC57C2581AEE23D000051DE4 /* GF_Offline_TranslatorTests.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - CC57C2531AEE23D000051DE4 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = CC57C2371AEE23D000051DE4 /* GF Offline Translator */; - targetProxy = CC57C2521AEE23D000051DE4 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - CC57C2451AEE23D000051DE4 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - CC57C2461AEE23D000051DE4 /* Base */, - ); - name = Main.storyboard; - sourceTree = "<group>"; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - CC57C2591AEE23D000051DE4 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - CC57C25A1AEE23D000051DE4 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - CC57C25C1AEE23D000051DE4 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9D996C5B51A0CAF9741D9356 /* Pods.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - "$(SRCROOT)/../../../runtime/c", - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - ); - INFOPLIST_FILE = "GF Offline Translator/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = ""; - }; - name = Debug; - }; - CC57C25D1AEE23D000051DE4 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = B4E29C5D7044D408E488C0F3 /* Pods.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - "$(SRCROOT)/../../../runtime/c", - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - ); - INFOPLIST_FILE = "GF Offline Translator/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = ""; - }; - name = Release; - }; - CC57C25F1AEE23D000051DE4 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = "GF Offline TranslatorTests/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GF Offline Translator.app/GF Offline Translator"; - }; - name = Debug; - }; - CC57C2601AEE23D000051DE4 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); - INFOPLIST_FILE = "GF Offline TranslatorTests/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GF Offline Translator.app/GF Offline Translator"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - CC57C2331AEE23D000051DE4 /* Build configuration list for PBXProject "GF Offline Translator" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - CC57C2591AEE23D000051DE4 /* Debug */, - CC57C25A1AEE23D000051DE4 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - CC57C25B1AEE23D000051DE4 /* Build configuration list for PBXNativeTarget "GF Offline Translator" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - CC57C25C1AEE23D000051DE4 /* Debug */, - CC57C25D1AEE23D000051DE4 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - CC57C25E1AEE23D000051DE4 /* Build configuration list for PBXNativeTarget "GF Offline TranslatorTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - CC57C25F1AEE23D000051DE4 /* Debug */, - CC57C2601AEE23D000051DE4 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = CC57C2301AEE23D000051DE4 /* Project object */; -} diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/src/ui/ios/GF-Offline-Translator/GF Offline Translator.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 1d8df4c23..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<Workspace - version = "1.0"> - <FileRef - location = "self:GF Offline Translator.xcodeproj"> - </FileRef> -</Workspace> diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator.xcodeproj/project.xcworkspace/xcuserdata/cennydavidsson.xcuserdatad/UserInterfaceState.xcuserstate b/src/ui/ios/GF-Offline-Translator/GF Offline Translator.xcodeproj/project.xcworkspace/xcuserdata/cennydavidsson.xcuserdatad/UserInterfaceState.xcuserstate Binary files differdeleted file mode 100644 index 79c35e937..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator.xcodeproj/project.xcworkspace/xcuserdata/cennydavidsson.xcuserdatad/UserInterfaceState.xcuserstate +++ /dev/null diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator.xcodeproj/xcuserdata/cennydavidsson.xcuserdatad/xcschemes/GF Offline Translator.xcscheme b/src/ui/ios/GF-Offline-Translator/GF Offline Translator.xcodeproj/xcuserdata/cennydavidsson.xcuserdatad/xcschemes/GF Offline Translator.xcscheme deleted file mode 100644 index 09d5bd327..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator.xcodeproj/xcuserdata/cennydavidsson.xcuserdatad/xcschemes/GF Offline Translator.xcscheme +++ /dev/null @@ -1,112 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<Scheme - LastUpgradeVersion = "0630" - version = "1.3"> - <BuildAction - parallelizeBuildables = "YES" - buildImplicitDependencies = "YES"> - <BuildActionEntries> - <BuildActionEntry - buildForTesting = "YES" - buildForRunning = "YES" - buildForProfiling = "YES" - buildForArchiving = "YES" - buildForAnalyzing = "YES"> - <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "CC57C2371AEE23D000051DE4" - BuildableName = "GF Offline Translator.app" - BlueprintName = "GF Offline Translator" - ReferencedContainer = "container:GF Offline Translator.xcodeproj"> - </BuildableReference> - </BuildActionEntry> - <BuildActionEntry - buildForTesting = "YES" - buildForRunning = "YES" - buildForProfiling = "NO" - buildForArchiving = "NO" - buildForAnalyzing = "YES"> - <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "CC57C2501AEE23D000051DE4" - BuildableName = "GF Offline TranslatorTests.xctest" - BlueprintName = "GF Offline TranslatorTests" - ReferencedContainer = "container:GF Offline Translator.xcodeproj"> - </BuildableReference> - </BuildActionEntry> - </BuildActionEntries> - </BuildAction> - <TestAction - selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" - selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - shouldUseLaunchSchemeArgsEnv = "YES" - buildConfiguration = "Debug"> - <Testables> - <TestableReference - skipped = "NO"> - <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "CC57C2501AEE23D000051DE4" - BuildableName = "GF Offline TranslatorTests.xctest" - BlueprintName = "GF Offline TranslatorTests" - ReferencedContainer = "container:GF Offline Translator.xcodeproj"> - </BuildableReference> - </TestableReference> - </Testables> - <MacroExpansion> - <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "CC57C2371AEE23D000051DE4" - BuildableName = "GF Offline Translator.app" - BlueprintName = "GF Offline Translator" - ReferencedContainer = "container:GF Offline Translator.xcodeproj"> - </BuildableReference> - </MacroExpansion> - </TestAction> - <LaunchAction - selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" - selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - launchStyle = "0" - useCustomWorkingDirectory = "NO" - buildConfiguration = "Debug" - ignoresPersistentStateOnLaunch = "NO" - debugDocumentVersioning = "YES" - allowLocationSimulation = "YES"> - <BuildableProductRunnable - runnableDebuggingMode = "0"> - <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "CC57C2371AEE23D000051DE4" - BuildableName = "GF Offline Translator.app" - BlueprintName = "GF Offline Translator" - ReferencedContainer = "container:GF Offline Translator.xcodeproj"> - </BuildableReference> - </BuildableProductRunnable> - <AdditionalOptions> - </AdditionalOptions> - </LaunchAction> - <ProfileAction - shouldUseLaunchSchemeArgsEnv = "YES" - savedToolIdentifier = "" - useCustomWorkingDirectory = "NO" - buildConfiguration = "Release" - debugDocumentVersioning = "YES"> - <BuildableProductRunnable - runnableDebuggingMode = "0"> - <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "CC57C2371AEE23D000051DE4" - BuildableName = "GF Offline Translator.app" - BlueprintName = "GF Offline Translator" - ReferencedContainer = "container:GF Offline Translator.xcodeproj"> - </BuildableReference> - </BuildableProductRunnable> - </ProfileAction> - <AnalyzeAction - buildConfiguration = "Debug"> - </AnalyzeAction> - <ArchiveAction - buildConfiguration = "Release" - revealArchiveInOrganizer = "YES"> - </ArchiveAction> -</Scheme> diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator.xcodeproj/xcuserdata/cennydavidsson.xcuserdatad/xcschemes/xcschememanagement.plist b/src/ui/ios/GF-Offline-Translator/GF Offline Translator.xcodeproj/xcuserdata/cennydavidsson.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 0ee0733fc..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator.xcodeproj/xcuserdata/cennydavidsson.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>SchemeUserState</key> - <dict> - <key>GF Offline Translator.xcscheme</key> - <dict> - <key>orderHint</key> - <integer>0</integer> - </dict> - </dict> - <key>SuppressBuildableAutocreation</key> - <dict> - <key>CC57C2371AEE23D000051DE4</key> - <dict> - <key>primary</key> - <true/> - </dict> - <key>CC57C2501AEE23D000051DE4</key> - <dict> - <key>primary</key> - <true/> - </dict> - </dict> -</dict> -</plist> diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator.xcworkspace/contents.xcworkspacedata b/src/ui/ios/GF-Offline-Translator/GF Offline Translator.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 7f4dd6dea..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<Workspace - version = "1.0"> - <FileRef - location = "group:GF Offline Translator.xcodeproj"> - </FileRef> - <FileRef - location = "group:Pods/Pods.xcodeproj"> - </FileRef> -</Workspace> diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator.xcworkspace/xcuserdata/cennydavidsson.xcuserdatad/WorkspaceSettings.xcsettings b/src/ui/ios/GF-Offline-Translator/GF Offline Translator.xcworkspace/xcuserdata/cennydavidsson.xcuserdatad/WorkspaceSettings.xcsettings deleted file mode 100644 index bfffcfe01..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator.xcworkspace/xcuserdata/cennydavidsson.xcuserdatad/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges</key> - <true/> - <key>SnapshotAutomaticallyBeforeSignificantChanges</key> - <false/> -</dict> -</plist> diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/AppDelegate.h b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/AppDelegate.h deleted file mode 100644 index 841083385..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/AppDelegate.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// AppDelegate.h -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-04-27. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import <UIKit/UIKit.h> - -@class Translator; - -@interface AppDelegate : UIResponder <UIApplicationDelegate> - -@property (strong, nonatomic) UIWindow *window; -@property (strong, nonatomic) Translator *translator; - -@end - diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/AppDelegate.m b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/AppDelegate.m deleted file mode 100644 index ec2a0a85f..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/AppDelegate.m +++ /dev/null @@ -1,50 +0,0 @@ -// -// AppDelegate.m -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-04-27. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import "AppDelegate.h" - -#import "TranslatorStore.h" - -@interface AppDelegate () - -@end - -@implementation AppDelegate - - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // Override point for customization after application launch. - - - return YES; -} - -- (void)applicationWillResignActive:(UIApplication *)application { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. -} - -- (void)applicationDidEnterBackground:(UIApplication *)application { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - [TranslatorStore saveCurrentGrammarsFromTranslator:self.translator]; -} - -- (void)applicationWillEnterForeground:(UIApplication *)application { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. -} - -- (void)applicationDidBecomeActive:(UIApplication *)application { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. -} - -- (void)applicationWillTerminate:(UIApplication *)application { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. -} - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/ArrowsButton.h b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/ArrowsButton.h deleted file mode 100644 index 31a30c8b9..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/ArrowsButton.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// ArrowsButton.h -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-04-27. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import <UIKit/UIKit.h> - -@interface ArrowsButton : UIButton - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/ArrowsButton.m b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/ArrowsButton.m deleted file mode 100644 index c2d890f32..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/ArrowsButton.m +++ /dev/null @@ -1,23 +0,0 @@ -// -// ArrowsButton.m -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-04-27. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import "ArrowsButton.h" -#import "StyleKitGF.h" - -@implementation ArrowsButton - - -// Only override drawRect: if you perform custom drawing. -// An empty implementation adversely affects performance during animation. -- (void)drawRect:(CGRect)rect { - // Drawing code - [StyleKitGF drawArrowsWithFrame:rect]; -} - - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Base.lproj/Main.storyboard b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Base.lproj/Main.storyboard deleted file mode 100644 index 59b5cbbbf..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Base.lproj/Main.storyboard +++ /dev/null @@ -1,311 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="xFI-0W-N5x"> - <dependencies> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/> - <capability name="Constraints to layout margins" minToolsVersion="6.0"/> - </dependencies> - <scenes> - <!--Translation Text View Controller--> - <scene sceneID="tne-QT-ifu"> - <objects> - <viewController id="BYZ-38-t0r" customClass="TranslationTextViewController" sceneMemberID="viewController"> - <layoutGuides> - <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/> - <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/> - </layoutGuides> - <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> - <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> - <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> - </view> - <navigationItem key="navigationItem" id="St3-7e-rXA"> - <barButtonItem key="rightBarButtonItem" title="Info" id="pCM-e5-4xf"> - <connections> - <segue destination="dgk-2A-luy" kind="show" identifier="Info" id="X1I-na-NNV"/> - </connections> - </barButtonItem> - </navigationItem> - <connections> - <segue destination="B6l-9t-iLr" kind="presentation" identifier="ChangeLanguage" id="wkV-br-4Id"/> - <segue destination="Vu1-QE-7az" kind="show" identifier="TranslationOptions" id="zeM-mX-HkR"/> - </connections> - </viewController> - <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> - </objects> - <point key="canvasLocation" x="1166" y="-372"/> - </scene> - <!--Choose language--> - <scene sceneID="vPx-fF-xJR"> - <objects> - <tableViewController id="Fe0-Ou-Rlf" customClass="LanguagesViewController" sceneMemberID="viewController"> - <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" id="2Mo-cK-SuX"> - <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> - <color key="backgroundColor" red="0.93725490196078431" green="0.93725490196078431" blue="0.95686274509803926" alpha="1" colorSpace="calibratedRGB"/> - <prototypes> - <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="LanguageCell" textLabel="qme-rd-ja5" style="IBUITableViewCellStyleDefault" id="NLI-62-k37"> - <rect key="frame" x="0.0" y="114" width="600" height="44"/> - <autoresizingMask key="autoresizingMask"/> - <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="NLI-62-k37" id="fZN-04-6Tc"> - <rect key="frame" x="0.0" y="0.0" width="600" height="43"/> - <autoresizingMask key="autoresizingMask"/> - <subviews> - <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Swedish" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="qme-rd-ja5"> - <rect key="frame" x="15" y="0.0" width="570" height="43"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> - <fontDescription key="fontDescription" type="system" pointSize="16"/> - <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> - <nil key="highlightedColor"/> - </label> - </subviews> - </tableViewCellContentView> - </tableViewCell> - <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" textLabel="hKD-Nt-QPD" style="IBUITableViewCellStyleDefault" id="JwG-RO-i9T"> - <rect key="frame" x="0.0" y="158" width="600" height="44"/> - <autoresizingMask key="autoresizingMask"/> - <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="JwG-RO-i9T" id="JAV-RA-w7z"> - <rect key="frame" x="0.0" y="0.0" width="600" height="43"/> - <autoresizingMask key="autoresizingMask"/> - <subviews> - <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="English" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="hKD-Nt-QPD"> - <rect key="frame" x="15" y="0.0" width="570" height="43"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> - <fontDescription key="fontDescription" type="system" pointSize="16"/> - <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> - <nil key="highlightedColor"/> - </label> - </subviews> - </tableViewCellContentView> - </tableViewCell> - <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" textLabel="9kF-jW-ZZq" style="IBUITableViewCellStyleDefault" id="haA-Gu-nbG"> - <rect key="frame" x="0.0" y="202" width="600" height="44"/> - <autoresizingMask key="autoresizingMask"/> - <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="haA-Gu-nbG" id="T9t-BH-xD6"> - <rect key="frame" x="0.0" y="0.0" width="600" height="43"/> - <autoresizingMask key="autoresizingMask"/> - <subviews> - <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Spanish" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="9kF-jW-ZZq"> - <rect key="frame" x="15" y="0.0" width="570" height="43"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> - <fontDescription key="fontDescription" type="system" pointSize="16"/> - <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> - <nil key="highlightedColor"/> - </label> - </subviews> - </tableViewCellContentView> - </tableViewCell> - </prototypes> - <sections/> - <connections> - <outlet property="dataSource" destination="Fe0-Ou-Rlf" id="aoc-Vz-oLo"/> - <outlet property="delegate" destination="Fe0-Ou-Rlf" id="Dst-b0-Mzq"/> - </connections> - </tableView> - <navigationItem key="navigationItem" title="Choose language" id="iGz-3o-bcY"> - <barButtonItem key="leftBarButtonItem" systemItem="cancel" id="XEa-C1-DUt"> - <connections> - <action selector="cancel:" destination="Fe0-Ou-Rlf" id="uO1-fV-m5z"/> - </connections> - </barButtonItem> - </navigationItem> - </tableViewController> - <placeholder placeholderIdentifier="IBFirstResponder" id="ADZ-WF-Rrq" userLabel="First Responder" sceneMemberID="firstResponder"/> - </objects> - <point key="canvasLocation" x="2690" y="30"/> - </scene> - <!--Navigation Controller--> - <scene sceneID="Huc-dh-g8v"> - <objects> - <navigationController automaticallyAdjustsScrollViewInsets="NO" id="xFI-0W-N5x" sceneMemberID="viewController"> - <toolbarItems/> - <navigationBar key="navigationBar" contentMode="scaleToFill" id="xvB-hQ-an3"> - <rect key="frame" x="0.0" y="0.0" width="320" height="44"/> - <autoresizingMask key="autoresizingMask"/> - </navigationBar> - <nil name="viewControllers"/> - <connections> - <segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="CD4-Hh-94z"/> - </connections> - </navigationController> - <placeholder placeholderIdentifier="IBFirstResponder" id="1PJ-ar-1KV" userLabel="First Responder" sceneMemberID="firstResponder"/> - </objects> - <point key="canvasLocation" x="426" y="-372"/> - </scene> - <!--Info--> - <scene sceneID="nXS-Na-9ij"> - <objects> - <viewController title="Info" id="dgk-2A-luy" customClass="WebViewController" sceneMemberID="viewController"> - <layoutGuides> - <viewControllerLayoutGuide type="top" id="muk-1p-gTk"/> - <viewControllerLayoutGuide type="bottom" id="wdN-RZ-bap"/> - </layoutGuides> - <view key="view" contentMode="scaleToFill" id="0BT-Mn-C5l"> - <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> - <subviews> - <webView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rac-eS-ve4"> - <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - </webView> - </subviews> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <constraints> - <constraint firstItem="rac-eS-ve4" firstAttribute="top" secondItem="0BT-Mn-C5l" secondAttribute="top" id="7cM-HO-6vz"/> - <constraint firstItem="rac-eS-ve4" firstAttribute="leading" secondItem="0BT-Mn-C5l" secondAttribute="leading" id="F2R-VX-m9g"/> - <constraint firstAttribute="trailing" secondItem="rac-eS-ve4" secondAttribute="trailing" id="Prv-Ph-Otq"/> - <constraint firstItem="wdN-RZ-bap" firstAttribute="top" secondItem="rac-eS-ve4" secondAttribute="bottom" id="Row-Zp-YvG"/> - </constraints> - </view> - <connections> - <outlet property="webView" destination="rac-eS-ve4" id="GhE-qg-QnW"/> - </connections> - </viewController> - <placeholder placeholderIdentifier="IBFirstResponder" id="RKo-u1-dmE" userLabel="First Responder" sceneMemberID="firstResponder"/> - </objects> - <point key="canvasLocation" x="1880" y="-1478"/> - </scene> - <!--Translation Options View Controller--> - <scene sceneID="Gym-bd-J1L"> - <objects> - <tableViewController id="Vu1-QE-7az" customClass="TranslationOptionsViewController" sceneMemberID="viewController"> - <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="52" sectionHeaderHeight="10" sectionFooterHeight="10" id="9Ly-b2-546"> - <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> - <color key="backgroundColor" red="0.93725490196078431" green="0.93725490196078431" blue="0.95686274509803926" alpha="1" colorSpace="calibratedRGB"/> - <prototypes> - <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="Cell" id="bD0-ad-CEO" customClass="SentenceTranslationUITableViewCell"> - <rect key="frame" x="0.0" y="114" width="600" height="52"/> - <autoresizingMask key="autoresizingMask"/> - <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="bD0-ad-CEO" id="ZlP-Qe-UAj"> - <rect key="frame" x="0.0" y="0.0" width="600" height="51"/> - <autoresizingMask key="autoresizingMask"/> - <subviews> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="249" text="Label" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lB8-TQ-gOC"> - <rect key="frame" x="14" y="29" width="548" height="14"/> - <fontDescription key="fontDescription" type="system" pointSize="12"/> - <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> - <nil key="highlightedColor"/> - </label> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="249" verticalCompressionResistancePriority="751" text="Label" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gZT-bJ-Kpt"> - <rect key="frame" x="8" y="8" width="554" height="21"/> - <fontDescription key="fontDescription" type="system" pointSize="17"/> - <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> - <nil key="highlightedColor"/> - </label> - <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="infoLight" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="nkL-os-Edb"> - <rect key="frame" x="570" y="15" width="22" height="22"/> - <connections> - <action selector="showTree:" destination="bD0-ad-CEO" eventType="touchUpInside" id="mwb-KY-CKE"/> - </connections> - </button> - </subviews> - <constraints> - <constraint firstItem="gZT-bJ-Kpt" firstAttribute="leading" secondItem="ZlP-Qe-UAj" secondAttribute="leadingMargin" id="0dY-24-331"/> - <constraint firstItem="nkL-os-Edb" firstAttribute="trailing" secondItem="ZlP-Qe-UAj" secondAttribute="trailingMargin" id="62L-Lw-qMg"/> - <constraint firstAttribute="bottomMargin" secondItem="gZT-bJ-Kpt" secondAttribute="bottom" constant="14" id="7R4-WV-G6b"/> - <constraint firstItem="lB8-TQ-gOC" firstAttribute="top" secondItem="gZT-bJ-Kpt" secondAttribute="bottom" id="8io-C1-3lS"/> - <constraint firstItem="lB8-TQ-gOC" firstAttribute="leading" secondItem="ZlP-Qe-UAj" secondAttribute="leadingMargin" constant="6" id="FPJ-ge-w3P"/> - <constraint firstItem="gZT-bJ-Kpt" firstAttribute="trailing" secondItem="ZlP-Qe-UAj" secondAttribute="trailingMargin" constant="-30" id="WO6-jN-5Sg"/> - <constraint firstItem="nkL-os-Edb" firstAttribute="leading" secondItem="gZT-bJ-Kpt" secondAttribute="trailing" constant="8" id="X3h-hy-uPh"/> - <constraint firstItem="lB8-TQ-gOC" firstAttribute="trailing" secondItem="ZlP-Qe-UAj" secondAttribute="trailingMargin" constant="-30" id="e2a-zj-bAf"/> - <constraint firstItem="nkL-os-Edb" firstAttribute="top" secondItem="ZlP-Qe-UAj" secondAttribute="topMargin" constant="7" id="kHq-Qe-pd8"/> - <constraint firstItem="gZT-bJ-Kpt" firstAttribute="top" secondItem="ZlP-Qe-UAj" secondAttribute="topMargin" id="rQg-rd-NdA"/> - <constraint firstAttribute="bottomMargin" secondItem="nkL-os-Edb" secondAttribute="bottom" constant="6" id="tod-J2-c7w"/> - <constraint firstItem="lB8-TQ-gOC" firstAttribute="bottom" secondItem="ZlP-Qe-UAj" secondAttribute="bottomMargin" id="uU7-Mw-1Hj"/> - </constraints> - <variation key="default"> - <mask key="constraints"> - <exclude reference="7R4-WV-G6b"/> - </mask> - </variation> - </tableViewCellContentView> - <connections> - <outlet property="translationSentance" destination="gZT-bJ-Kpt" id="CkR-a4-myk"/> - <outlet property="translationTree" destination="lB8-TQ-gOC" id="R1v-e6-Dec"/> - </connections> - </tableViewCell> - <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="Basic" textLabel="Whx-GO-JX3" style="IBUITableViewCellStyleDefault" id="8A5-Qc-R0d" customClass="SentenceTranslationUITableViewCell"> - <rect key="frame" x="0.0" y="166" width="600" height="52"/> - <autoresizingMask key="autoresizingMask"/> - <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="8A5-Qc-R0d" id="2HZ-Yy-h5F"> - <rect key="frame" x="0.0" y="0.0" width="600" height="51"/> - <autoresizingMask key="autoresizingMask"/> - <subviews> - <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Whx-GO-JX3"> - <rect key="frame" x="15" y="0.0" width="570" height="51"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> - <fontDescription key="fontDescription" type="system" pointSize="16"/> - <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> - <nil key="highlightedColor"/> - </label> - </subviews> - </tableViewCellContentView> - </tableViewCell> - </prototypes> - <connections> - <outlet property="dataSource" destination="Vu1-QE-7az" id="aaA-LZ-lYo"/> - <outlet property="delegate" destination="Vu1-QE-7az" id="MZf-as-uDy"/> - </connections> - </tableView> - <navigationItem key="navigationItem" id="gHe-8r-vSO"/> - <connections> - <segue destination="4Hm-Xx-a85" kind="show" identifier="WebView" id="maE-LZ-yt0"/> - </connections> - </tableViewController> - <placeholder placeholderIdentifier="IBFirstResponder" id="VmA-sb-BbB" userLabel="First Responder" sceneMemberID="firstResponder"/> - </objects> - <point key="canvasLocation" x="1880" y="-784"/> - </scene> - <!--Web View Controller--> - <scene sceneID="X2Q-9F-hid"> - <objects> - <viewController id="4Hm-Xx-a85" customClass="WebViewController" sceneMemberID="viewController"> - <layoutGuides> - <viewControllerLayoutGuide type="top" id="UCN-ya-kgJ"/> - <viewControllerLayoutGuide type="bottom" id="8GP-cw-HP4"/> - </layoutGuides> - <view key="view" contentMode="scaleToFill" id="e4f-Yd-GYs"> - <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> - <subviews> - <webView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Spb-gc-bFg"> - <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - </webView> - </subviews> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <constraints> - <constraint firstItem="Spb-gc-bFg" firstAttribute="top" secondItem="e4f-Yd-GYs" secondAttribute="top" id="2Iw-Fw-8mr"/> - <constraint firstAttribute="trailing" secondItem="Spb-gc-bFg" secondAttribute="trailing" id="LPO-8J-Adk"/> - <constraint firstItem="Spb-gc-bFg" firstAttribute="leading" secondItem="e4f-Yd-GYs" secondAttribute="leading" id="nDD-5G-4me"/> - <constraint firstItem="8GP-cw-HP4" firstAttribute="top" secondItem="Spb-gc-bFg" secondAttribute="bottom" id="rhL-KZ-bwq"/> - </constraints> - </view> - <connections> - <outlet property="webView" destination="Spb-gc-bFg" id="aHr-v4-S6W"/> - </connections> - </viewController> - <placeholder placeholderIdentifier="IBFirstResponder" id="yzz-Gx-TbE" userLabel="First Responder" sceneMemberID="firstResponder"/> - </objects> - <point key="canvasLocation" x="2606" y="-784"/> - </scene> - <!--Navigation Controller--> - <scene sceneID="WFo-Wh-qjb"> - <objects> - <navigationController automaticallyAdjustsScrollViewInsets="NO" id="B6l-9t-iLr" sceneMemberID="viewController"> - <toolbarItems/> - <navigationBar key="navigationBar" contentMode="scaleToFill" id="lfh-gu-V91"> - <rect key="frame" x="0.0" y="0.0" width="320" height="44"/> - <autoresizingMask key="autoresizingMask"/> - </navigationBar> - <nil name="viewControllers"/> - <connections> - <segue destination="Fe0-Ou-Rlf" kind="relationship" relationship="rootViewController" id="mmI-Sf-zMe"/> - </connections> - </navigationController> - <placeholder placeholderIdentifier="IBFirstResponder" id="saS-qW-BUT" userLabel="First Responder" sceneMemberID="firstResponder"/> - </objects> - <point key="canvasLocation" x="1880" y="30"/> - </scene> - </scenes> -</document> diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Grammar.h b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Grammar.h deleted file mode 100644 index 70f842633..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Grammar.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// Grammar.h -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-04-28. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import <Foundation/Foundation.h> -#import "pgf/pgf.h" - -@class Language; -@class Translator; - -@interface Grammar : NSObject -@property (nonatomic) Language *language; -@property (nonatomic) PgfConcr *concrete; - -+ (Grammar *)loadGrammarFromLanguage:(Language *)language withTranslator:(Translator *)translator; - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Grammar.m b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Grammar.m deleted file mode 100644 index 5ce6c0269..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Grammar.m +++ /dev/null @@ -1,45 +0,0 @@ -// -// Grammar.m -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-04-28. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import "Grammar.h" -#import "Translator.h" -#import "Language.h" - -// Grammatical Framework -#import "pgf/pgf.h" -#import "gu/mem.h" -#import "gu/exn.h" -#import "gu/file.h" - -@implementation Grammar - -+ (Grammar *)loadGrammarFromLanguage:(Language *)language withTranslator:(Translator *)translator { - Grammar *grammar = [Grammar new]; - - // Load the file - NSString *appLanguage = [NSString stringWithFormat:@"App%@",language.abbreviation]; - - PgfConcr *concr = pgf_get_language(translator.pgf, [appLanguage UTF8String]); - NSString *path = [[NSBundle mainBundle] pathForResource:appLanguage ofType:@"pgf_c"]; - FILE *file = fopen([path UTF8String], "r"); - - GuIn *guIn = gu_file_in(file, translator.pool); - - pgf_concrete_load(concr, guIn, translator.err); - - grammar.concrete = concr; - grammar.language = language; - - return grammar; -} - -- (void)dealloc { - pgf_concrete_unload(self.concrete); -} - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Contents.json b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index c04dfd8f3..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,137 +0,0 @@ -{ - "images" : [ - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-Small.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-Small@2x.png", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-Spotlight-40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-60@3x.png", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-Spotlight-40.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-Spotlight-40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-76.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-76@2x.png", - "scale" : "2x" - }, - { - "size" : "24x24", - "idiom" : "watch", - "scale" : "2x", - "role" : "notificationCenter", - "subtype" : "38mm" - }, - { - "size" : "27.5x27.5", - "idiom" : "watch", - "scale" : "2x", - "role" : "notificationCenter", - "subtype" : "42mm" - }, - { - "size" : "29x29", - "idiom" : "watch", - "role" : "companionSettings", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "watch", - "filename" : "Icon-Small@3x.png", - "role" : "companionSettings", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "watch", - "scale" : "2x", - "role" : "appLauncher", - "subtype" : "38mm" - }, - { - "size" : "44x44", - "idiom" : "watch", - "scale" : "2x", - "role" : "longLook", - "subtype" : "42mm" - }, - { - "size" : "86x86", - "idiom" : "watch", - "scale" : "2x", - "role" : "quickLook", - "subtype" : "38mm" - }, - { - "size" : "98x98", - "idiom" : "watch", - "scale" : "2x", - "role" : "quickLook", - "subtype" : "42mm" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -}
\ No newline at end of file diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-60.png b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-60.png Binary files differdeleted file mode 100644 index 76758a145..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-60.png +++ /dev/null diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png Binary files differdeleted file mode 100644 index 57aab6c95..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png +++ /dev/null diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png Binary files differdeleted file mode 100644 index b71f5aa7e..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png +++ /dev/null diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-76.png b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-76.png Binary files differdeleted file mode 100644 index 8f9c74d48..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-76.png +++ /dev/null diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png Binary files differdeleted file mode 100644 index 85d1b9518..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-76@2x.png +++ /dev/null diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-76@3x.png b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-76@3x.png Binary files differdeleted file mode 100644 index 6f4587895..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-76@3x.png +++ /dev/null diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-Small.png b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-Small.png Binary files differdeleted file mode 100644 index 526eaeeb7..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-Small.png +++ /dev/null diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png Binary files differdeleted file mode 100644 index c707559a8..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png +++ /dev/null diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png Binary files differdeleted file mode 100644 index a2c8d23b7..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png +++ /dev/null diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40.png b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40.png Binary files differdeleted file mode 100644 index 562c13758..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40.png +++ /dev/null diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png Binary files differdeleted file mode 100644 index c9cd5bcd8..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png +++ /dev/null diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@3x.png b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@3x.png Binary files differdeleted file mode 100644 index f823628f9..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@3x.png +++ /dev/null diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Info.plist b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Info.plist deleted file mode 100644 index 11cf2a677..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Info.plist +++ /dev/null @@ -1,47 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleDevelopmentRegion</key> - <string>en</string> - <key>CFBundleExecutable</key> - <string>$(EXECUTABLE_NAME)</string> - <key>CFBundleIdentifier</key> - <string>GF.$(PRODUCT_NAME:rfc1034identifier)</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundleName</key> - <string>$(PRODUCT_NAME)</string> - <key>CFBundlePackageType</key> - <string>APPL</string> - <key>CFBundleShortVersionString</key> - <string>0.2</string> - <key>CFBundleSignature</key> - <string>????</string> - <key>CFBundleVersion</key> - <string>8</string> - <key>LSRequiresIPhoneOS</key> - <true/> - <key>UILaunchStoryboardName</key> - <string>Main</string> - <key>UIMainStoryboardFile</key> - <string>Main</string> - <key>UIRequiredDeviceCapabilities</key> - <array> - <string>armv7</string> - </array> - <key>UISupportedInterfaceOrientations</key> - <array> - <string>UIInterfaceOrientationPortrait</string> - <string>UIInterfaceOrientationLandscapeLeft</string> - <string>UIInterfaceOrientationLandscapeRight</string> - </array> - <key>UISupportedInterfaceOrientations~ipad</key> - <array> - <string>UIInterfaceOrientationPortrait</string> - <string>UIInterfaceOrientationPortraitUpsideDown</string> - <string>UIInterfaceOrientationLandscapeLeft</string> - <string>UIInterfaceOrientationLandscapeRight</string> - </array> -</dict> -</plist> diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Language.h b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Language.h deleted file mode 100644 index 921929cb3..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Language.h +++ /dev/null @@ -1,25 +0,0 @@ -// -// Language.h -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-04-28. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import <Foundation/Foundation.h> - -@interface Language : NSObject - -@property (nonatomic, copy) NSString *name; -@property (nonatomic, copy) NSString *abbreviation; -@property (nonatomic, copy) NSString *bcp; - - -- (instancetype)initWithName:(NSString *)name - abbreviation:(NSString *)abbreviation - bcp:(NSString *)bcp; - -- (BOOL)isEqualToLanguage:(Language *)language; -+ (NSArray *)allLanguages; - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Language.m b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Language.m deleted file mode 100644 index ba0b526e9..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Language.m +++ /dev/null @@ -1,75 +0,0 @@ -// -// Language.m -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-04-28. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import "Language.h" - - -@implementation Language - -- (instancetype)initWithName:(NSString *)name - abbreviation:(NSString *)abbreviation - bcp:(NSString *)bcp { - self = [super init]; - if (self) { - _name = name; - _abbreviation = abbreviation; - _bcp = bcp; - } - return self; -} - -- (BOOL)isEqualToLanguage:(Language *)language { - if (!language) { - return NO; - } - - BOOL haveEqualNames = (!self.name && !language.name) || [self.name isEqualToString:language.name]; - BOOL haveEqualBcp = (!self.bcp && !language.bcp) || [self.bcp isEqualToString:language.bcp]; - - return haveEqualNames && haveEqualBcp; -} - -+ (NSArray *)allLanguages { - return @[ - [[Language alloc] initWithName:@"Bulgarian" abbreviation:@"Bul" bcp:@"en-GB"], - [[Language alloc] initWithName:@"Chinese" abbreviation:@"Chi" bcp:@"zh-CN"], - [[Language alloc] initWithName:@"Catalan" abbreviation:@"Cat" bcp:@"ca-ES"], - [[Language alloc] initWithName:@"Dutch" abbreviation:@"Dut" bcp:@"nl-NL"], - [[Language alloc] initWithName:@"English" abbreviation:@"Eng" bcp:@"en-GB"], - [[Language alloc] initWithName:@"Estonian" abbreviation:@"Est" bcp:@"es-EE"], - [[Language alloc] initWithName:@"Finnish" abbreviation:@"Fin" bcp:@"fi-FI"], - [[Language alloc] initWithName:@"French" abbreviation:@"Fre" bcp:@"fr-FR"], - [[Language alloc] initWithName:@"German" abbreviation:@"Ger" bcp:@"de-DE"], - [[Language alloc] initWithName:@"Hindi" abbreviation:@"Hin" bcp:@"hi-IN"], - [[Language alloc] initWithName:@"Italian" abbreviation:@"Ita" bcp:@"it-IT"], - [[Language alloc] initWithName:@"Japanese" abbreviation:@"Jpn" bcp:@"ja-JP"], - [[Language alloc] initWithName:@"Spanish" abbreviation:@"Spa" bcp:@"es-ES"], - [[Language alloc] initWithName:@"Swedish" abbreviation:@"Swe" bcp:@"sv-SE"], - [[Language alloc] initWithName:@"Thai" abbreviation:@"Tha" bcp:@"th-TH"] - ]; -} - -#pragma mark - NSObject - -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - - if (![object isKindOfClass:[Language class]]) { - return NO; - } - - return [self isEqualToLanguage:(Language *)object]; -} - -- (NSUInteger)hash { - return [self.name hash] ^ [self.bcp hash]; -} - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/LanguagesViewController.h b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/LanguagesViewController.h deleted file mode 100644 index 278d8cf96..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/LanguagesViewController.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// LanguagesViewController.h -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-04-27. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import <UIKit/UIKit.h> -#import "TranslationTextViewController.h" -@class Language; - - -@interface LanguagesViewController : UITableViewController -@property (nonatomic, weak) id<TranslationTextViewControllerDelegate> delegate; -@property (nonatomic) NSArray *currentLanguages; -@property (nonatomic) BOOL fromLanguage; - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/LanguagesViewController.m b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/LanguagesViewController.m deleted file mode 100644 index 22616501e..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/LanguagesViewController.m +++ /dev/null @@ -1,62 +0,0 @@ -// -// LanguagesViewController.m -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-04-27. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import "LanguagesViewController.h" -#import "Language.h" -#import "UITableViewCell+Customize.h" - -@interface LanguagesViewController () - -@property (nonatomic) NSArray *languages; - -@end - -@implementation LanguagesViewController - -#pragma mark - View lifecycle - -- (void)viewDidLoad { - [super viewDidLoad]; - - // Removes already used languages - NSMutableArray *allLanguagesMutableCopy = Language.allLanguages.mutableCopy; - [allLanguagesMutableCopy removeObjectsInArray:self.currentLanguages]; - self.languages = allLanguagesMutableCopy.copy; -} - -#pragma mark - User Interaction - -- (IBAction)cancel:(UIBarButtonItem *)sender { - [self dismissViewControllerAnimated:YES completion:nil]; -} - -#pragma mark - Table view data source - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return self.languages.count; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"LanguageCell" forIndexPath:indexPath]; - - Language *language = self.languages[indexPath.row]; - cell.textLabel.text = language.name; - - return cell; -} - -#pragma mark - Table view delegate - -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - Language *language = self.languages[indexPath.row]; - - [self.delegate changeLanguageToLanguage:language isFrom:self.fromLanguage]; - [self dismissViewControllerAnimated:YES completion:nil]; -} - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/MenuView.h b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/MenuView.h deleted file mode 100644 index ac0efa162..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/MenuView.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// MenuViewItem.h -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-04-28. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import <UIKit/UIKit.h> - -@interface MenuView : UIButton - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/MenuView.m b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/MenuView.m deleted file mode 100644 index 858d553f1..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/MenuView.m +++ /dev/null @@ -1,23 +0,0 @@ -// -// MenuViewItem.m -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-04-28. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import "MenuView.h" -#import "StyleKitGF.h" - -@implementation MenuView - - -// Only override drawRect: if you perform custom drawing. -// An empty implementation adversely affects performance during animation. -- (void)drawRect:(CGRect)rect { - // Drawing code - [StyleKitGF drawMenyItemWithFrame:rect]; -} - - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/MorphAnalyser.h b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/MorphAnalyser.h deleted file mode 100644 index 59c5d164f..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/MorphAnalyser.h +++ /dev/null @@ -1,32 +0,0 @@ -// -// MorphAnalyser.h -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-05-24. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import <Foundation/Foundation.h> - -// Grammitcal framework -#import "pgf.h" - -@class Grammar; - -@interface MorphAnalyser : NSObject - -@property (nonatomic) PgfPGF *pgf; -@property (nonatomic) GuExn *err; - -@property (nonatomic, strong) Grammar *to; -@property (nonatomic, strong) Grammar *from; - -@property (nonatomic, readonly) NSArray *analysedWords; -@property (nonatomic, readonly) NSString *bestTranslation; -@property (nonatomic, readonly) NSMutableArray *html; - - -- (instancetype)initWithPgf:(PgfPGF *)pgf err:(GuExn *)err to:(Grammar *)to from:(Grammar *)from; -- (void)analysWord:(NSString *)word; - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/MorphAnalyser.m b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/MorphAnalyser.m deleted file mode 100644 index 81af81407..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/MorphAnalyser.m +++ /dev/null @@ -1,194 +0,0 @@ -// -// MorphAnalyser.m -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-05-24. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import "MorphAnalyser.h" - -// Model -#import "Grammar.h" - -// Grammatical Framework -#import "pgf/pgf.h" -#import "gu/mem.h" -#import "gu/exn.h" -#import "gu/file.h" - - -typedef struct { - PgfMorphoCallback callback; - PgfPGF* pgf; - PgfConcr* src; - PgfConcr* tgt; -} PgfLinLemmasCallback; - -NSMutableArray *morphWords; -NSMutableArray *htmls; - -void print_lemma(PgfMorphoCallback* _self, - PgfCId lemma, GuString analysis, prob_t prob, - GuExn* err) { - - PgfLinLemmasCallback* this = gu_container(_self, PgfMorphoCallback, callback); - - // Here we print the lemmas. One and the same lemma could - // appear several times if there are different analyses. - // In this case "barn" is child but it could be in singular, - // in plural or it could be used as a compound form. - // Duplications should be eliminated in the user interface. - - printf("%s (%s)\n", lemma, analysis); - - GuPool* tmp_pool = gu_new_pool(); - GuStringBuf* buf = gu_string_buf(tmp_pool); - GuOut* out = gu_string_buf_out(buf); - - // Now we build an expression from the lemma. - PgfApplication app = {lemma, 0}; - PgfExpr expr = pgf_expr_apply(&app, tmp_pool); - - // Now we linearize the expression in the source language - pgf_linearize(this->src, expr, out, err); - - if (pgf_has_linearization(this->tgt, lemma)) - gu_puts(" - ", out, err); - else - gu_puts(" ", out, err); - - // Here we extract the type of the lemma - // N for nouns, V,V2,V3,V2V,... for verbs, A for adjectives, - // Prep for prepositions, etc. - PgfType* ty = pgf_function_type(this->pgf, lemma); - - NSString *inflectionCid = [NSString stringWithFormat:@"Inflection%@", - [NSString stringWithUTF8String:ty->cid]]; - - BOOL hasLinearization = pgf_has_linearization(this->tgt, [inflectionCid UTF8String]); - - // Here we get the tag that should be shown in the UI - { - // The purpose of this buffer is to just construct an expression. - // Maybe there is an easier way in ObjectiveC - GuStringBuf* expr_buf = gu_string_buf(tmp_pool); - GuOut* expr_out = gu_string_buf_out(expr_buf); - - - - if (hasLinearization) { - gu_printf(expr_out, err, "MkTag (Inflection%s %s)",ty->cid ,lemma); - GuString s = gu_string_buf_freeze(expr_buf, tmp_pool); - GuIn* in = gu_string_in(s, tmp_pool); - PgfExpr tag_expr = pgf_read_expr(in, tmp_pool, err); - - pgf_linearize(this->tgt, tag_expr, out, err); - - gu_puts(". ", out, err); - } - } - - if (pgf_has_linearization(this->tgt, lemma)) { - - - // Now we linearize the expression in the target language - // This is the only thing that needs to be done for - // visualization in the first view. Everything else - // is useful only for the second view which shows - // inflection tables and alternative translations. - pgf_linearize(this->tgt, expr, out, err); - } else { -// gu_puts(".", out, err); - } - - // Finally we get the string which is used for describing - // the different lexical entries in the translations view - GuString s = gu_string_buf_freeze(buf, tmp_pool); - printf("entry: %s\n", s); - - NSString *translation = [NSString stringWithUTF8String:s]; - if ([morphWords containsObject:translation]) { //|| -// [[translation stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] hasSuffix:@"."]) { - return; - } - - [morphWords addObject:translation]; - - // Here we get the html for the inflection table - if (hasLinearization) { - // The purpose of this buffer is to just construct an expression. - // Maybe there is an easier way in ObjectiveC - GuStringBuf* expr_buf = gu_string_buf(tmp_pool); - GuOut* expr_out = gu_string_buf_out(expr_buf); - gu_printf(expr_out, err, "MkDocument \"\" (Inflection%s %s) \"\"",ty->cid, lemma); - GuString s = gu_string_buf_freeze(expr_buf, tmp_pool); - GuIn* in = gu_string_in(s, tmp_pool); - PgfExpr html_expr = pgf_read_expr(in, tmp_pool, err); - - GuStringBuf* html_buf = gu_string_buf(tmp_pool); - GuOut* html_out = gu_string_buf_out(html_buf); - pgf_linearize(this->tgt, html_expr, html_out, err); - GuString lin = gu_string_buf_freeze(html_buf, tmp_pool); - printf("html:\n%s\n", lin); - - NSString *htmlString = [NSString stringWithUTF8String:lin]; - - if (htmlString.length > 0) { - NSMutableString *html = [NSMutableString stringWithString: @"<html><head><title></title></head><body style=\"background:transparent;\">"]; - [html appendString:htmlString]; - [html appendString:@"</body></html>"]; - [htmls addObject:html]; - } - } else { - [htmls addObject:@""]; - } - - printf("\n"); - gu_pool_free(tmp_pool); -} - - -@implementation MorphAnalyser - -- (instancetype)initWithPgf:(PgfPGF *)pgf err:(GuExn *)err to:(Grammar *)to from:(Grammar *)from { - self = [super init]; - - if (self) { - _pgf = pgf; - _err = err; - _to = to; - _from = from; - } - return self; -} - - -- (NSString *)bestTranslation { - if (self.analysedWords.count) { - for (NSString *translation in self.analysedWords) { - if (![[translation stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] hasSuffix:@"."]) { - return [[translation componentsSeparatedByString:@" "].lastObject stringByAppendingString:@" "]; - } - } - } - return nil; -} - -- (void)analysWord:(NSString *)word { - - morphWords = [NSMutableArray new]; - htmls = [NSMutableArray new]; - - PgfLinLemmasCallback callback = { { print_lemma }, self.pgf, self.from.concrete, self.to.concrete }; - pgf_lookup_morpho(self.from.concrete, [word UTF8String], &callback.callback, self.err); - - _analysedWords = morphWords; - _html = htmls; - - htmls = nil; - morphWords = nil; -} - - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/NSString+StringToArray.h b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/NSString+StringToArray.h deleted file mode 100644 index 209a1dd55..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/NSString+StringToArray.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// NSString+stringToArray.h -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-06-03. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import <Foundation/Foundation.h> - -@interface NSString (StringToArray) - -- (NSArray *)stringToArray; - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/NSString+StringToArray.m b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/NSString+StringToArray.m deleted file mode 100644 index a023673f3..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/NSString+StringToArray.m +++ /dev/null @@ -1,22 +0,0 @@ -// -// NSString+stringToArray.m -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-06-03. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import "NSString+stringToArray.h" - -@implementation NSString (StringToArray) - -- (NSArray *)stringToArray { - NSMutableArray *array = [NSMutableArray array]; - for (int i = 0; i < [self length]; i++) { - NSString *character = [self substringWithRange:NSMakeRange(i, 1)]; - [array addObject:character]; - } - return array; -} - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/PhraseTranslation.h b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/PhraseTranslation.h deleted file mode 100644 index 8499cf34c..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/PhraseTranslation.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// Translation.h -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-05-04. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import <Foundation/Foundation.h> -#import "Translation.h" - - - -@interface PhraseTranslation : Translation - -@property (nonatomic, strong) NSArray *sequences; - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/PhraseTranslation.m b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/PhraseTranslation.m deleted file mode 100644 index 308f49546..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/PhraseTranslation.m +++ /dev/null @@ -1,19 +0,0 @@ -// -// Translation.m -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-05-04. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import <UIKit/UIKit.h> -#import "PhraseTranslation.h" -#import "UIColor+TranslationsResults.h" - - - -@implementation PhraseTranslation - - - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/SLKTextView+TextInputMode.h b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/SLKTextView+TextInputMode.h deleted file mode 100644 index e997c1e06..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/SLKTextView+TextInputMode.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// SLKTextView+TextInputMode.h -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-05-05. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import "SLKTextView.h" - -@interface SLKTextView (TextInputMode) - -@property (nonatomic,retain) NSString *userDefinedKeyboardLanguage; - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/SLKTextView+TextInputMode.m b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/SLKTextView+TextInputMode.m deleted file mode 100644 index 278f22e3f..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/SLKTextView+TextInputMode.m +++ /dev/null @@ -1,45 +0,0 @@ -// -// SLKTextView+TextInputMode.m -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-05-05. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import "SLKTextView+TextInputMode.h" -#import <objc/runtime.h> - -@implementation SLKTextView (TextInputMode) - -static char userDefinedKeyboardLanguageKey; - -- (NSString *)userDefinedKeyboardLanguage { - return objc_getAssociatedObject(self, &userDefinedKeyboardLanguageKey); -} - -- (void)setUserDefinedKeyboardLanguage:(NSString *)aString { - objc_setAssociatedObject(self, &userDefinedKeyboardLanguageKey, aString, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -- (UITextInputMode *) textInputMode { - for (UITextInputMode *tim in [UITextInputMode activeInputModes]) { - if ([[SLKTextView langFromLocale:self.userDefinedKeyboardLanguage] isEqualToString:[SLKTextView langFromLocale:tim.primaryLanguage]]) { - return tim; - } - } - return [super textInputMode]; -} - -+ (NSString *)langFromLocale:(NSString *)locale { - NSRange rangeOne = [locale rangeOfString:@"_"]; - if (rangeOne.length == 0) - rangeOne.location = locale.length; - - NSRange rangeTwo = [locale rangeOfString:@"-"]; - if (rangeTwo.length == 0) - rangeTwo.location = locale.length; - - return [[locale substringToIndex:MIN(rangeOne.location, rangeTwo.location)] lowercaseString]; -} - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/SentenceTranslationUITableViewCell.h b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/SentenceTranslationUITableViewCell.h deleted file mode 100644 index 97eb3bfc9..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/SentenceTranslationUITableViewCell.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// SentenceTranslationUITableViewCell.h -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-06-18. -// Copyright © 2015 Grammatical Framework. All rights reserved. -// - -#import <UIKit/UIKit.h> - - -@interface SentenceTranslationUITableViewCell : UITableViewCell - -- (void)configureCellWithSentenceInTableView:(UITableView *)tableView withTranslation:(NSString *)translation andTree:(NSString *)tree; -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/SentenceTranslationUITableViewCell.m b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/SentenceTranslationUITableViewCell.m deleted file mode 100644 index 06325637c..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/SentenceTranslationUITableViewCell.m +++ /dev/null @@ -1,56 +0,0 @@ -// -// SentenceTranslationUITableViewCell.m -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-06-18. -// Copyright © 2015 Grammatical Framework. All rights reserved. -// - -#import "SentenceTranslationUITableViewCell.h" -#import "PhraseTranslation.h" - -@interface SentenceTranslationUITableViewCell () -@property (weak, nonatomic) IBOutlet UILabel *translationSentance; -@property (weak, nonatomic) IBOutlet UILabel *translationTree; - -@property (weak, nonatomic) UITableView *tableView; - -@property (strong, nonatomic) NSString *translationTreeText; - -@end - -@implementation SentenceTranslationUITableViewCell - -- (void)configureCellWithSentenceInTableView:(UITableView *)tableView withTranslation:(NSString *)translation andTree:(NSString *)tree { - self.tableView = tableView; - self.translationSentance.text = translation; - self.translationTreeText = tree; - - self.translationTree.text = @""; -} -- (IBAction)showTree:(id)sender { - - if ([self.translationTree.text isEqualToString:@""]) { - self.translationTree.alpha = 0; - - [self.tableView beginUpdates]; - self.translationTree.text = self.translationTreeText; - [self.tableView endUpdates]; - - [UIView animateWithDuration:0.25 delay:0.15 options:0 animations:^{ - self.translationTree.alpha = 1; - } completion:nil]; - - } else { - [UIView animateWithDuration:0.25 animations:^{ - self.translationTree.alpha = 0; - } completion:^(BOOL finished) { - [self.tableView beginUpdates]; - self.translationTree.text = @""; - [self.tableView endUpdates]; - }]; - } - -} - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/StyleKitGF.h b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/StyleKitGF.h deleted file mode 100644 index 568e09a31..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/StyleKitGF.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// StyleKitGF.h -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-06-19. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// -// Generated by PaintCode (www.paintcodeapp.com) -// - -#import <Foundation/Foundation.h> -#import <UIKit/UIKit.h> - - -@interface StyleKitGF : NSObject - -// Drawing Methods -+ (void)drawArrowsWithFrame: (CGRect)frame; -+ (void)drawMenyItemWithFrame: (CGRect)frame; - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/StyleKitGF.m b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/StyleKitGF.m deleted file mode 100644 index 7ca703152..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/StyleKitGF.m +++ /dev/null @@ -1,86 +0,0 @@ -// -// StyleKitGF.m -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-06-19. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// -// Generated by PaintCode (www.paintcodeapp.com) -// - -#import "StyleKitGF.h" - - -@implementation StyleKitGF - -#pragma mark Initialization - -+ (void)initialize -{ -} - -#pragma mark Drawing Methods - -+ (void)drawArrowsWithFrame: (CGRect)frame -{ - //// Color Declarations - UIColor* color = [UIColor colorWithRed: 0 green: 0.478 blue: 1 alpha: 1]; - - //// Bezier Drawing - UIBezierPath* bezierPath = UIBezierPath.bezierPath; - [bezierPath moveToPoint: CGPointMake(CGRectGetMinX(frame) + 0.77855 * CGRectGetWidth(frame), CGRectGetMinY(frame) + 0.53483 * CGRectGetHeight(frame))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frame) + 0.31140 * CGRectGetWidth(frame), CGRectGetMinY(frame) + 0.53483 * CGRectGetHeight(frame))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frame) + 0.31140 * CGRectGetWidth(frame), CGRectGetMinY(frame) + 0.45788 * CGRectGetHeight(frame))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frame) + 0.77855 * CGRectGetWidth(frame), CGRectGetMinY(frame) + 0.45788 * CGRectGetHeight(frame))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frame) + 0.77855 * CGRectGetWidth(frame), CGRectGetMinY(frame) + 0.53483 * CGRectGetHeight(frame))]; - [bezierPath closePath]; - [bezierPath moveToPoint: CGPointMake(CGRectGetMinX(frame) + 0.77855 * CGRectGetWidth(frame), CGRectGetMinY(frame) + 0.34247 * CGRectGetHeight(frame))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frame) + 0.77855 * CGRectGetWidth(frame), CGRectGetMinY(frame) + 0.64384 * CGRectGetHeight(frame))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frame) + 0.95436 * CGRectGetWidth(frame), CGRectGetMinY(frame) + 0.50918 * CGRectGetHeight(frame))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frame) + 0.77855 * CGRectGetWidth(frame), CGRectGetMinY(frame) + 0.34247 * CGRectGetHeight(frame))]; - [bezierPath closePath]; - [color setFill]; - [bezierPath fill]; - - - //// Bezier 2 Drawing - UIBezierPath* bezier2Path = UIBezierPath.bezierPath; - [bezier2Path moveToPoint: CGPointMake(CGRectGetMinX(frame) + 0.22452 * CGRectGetWidth(frame), CGRectGetMinY(frame) + 0.53483 * CGRectGetHeight(frame))]; - [bezier2Path addLineToPoint: CGPointMake(CGRectGetMinX(frame) + 0.68880 * CGRectGetWidth(frame), CGRectGetMinY(frame) + 0.53483 * CGRectGetHeight(frame))]; - [bezier2Path addLineToPoint: CGPointMake(CGRectGetMinX(frame) + 0.68880 * CGRectGetWidth(frame), CGRectGetMinY(frame) + 0.45788 * CGRectGetHeight(frame))]; - [bezier2Path addLineToPoint: CGPointMake(CGRectGetMinX(frame) + 0.22452 * CGRectGetWidth(frame), CGRectGetMinY(frame) + 0.45788 * CGRectGetHeight(frame))]; - [bezier2Path addLineToPoint: CGPointMake(CGRectGetMinX(frame) + 0.22452 * CGRectGetWidth(frame), CGRectGetMinY(frame) + 0.53483 * CGRectGetHeight(frame))]; - [bezier2Path closePath]; - [bezier2Path moveToPoint: CGPointMake(CGRectGetMinX(frame) + 0.22452 * CGRectGetWidth(frame), CGRectGetMinY(frame) + 0.34247 * CGRectGetHeight(frame))]; - [bezier2Path addLineToPoint: CGPointMake(CGRectGetMinX(frame) + 0.22452 * CGRectGetWidth(frame), CGRectGetMinY(frame) + 0.64384 * CGRectGetHeight(frame))]; - [bezier2Path addLineToPoint: CGPointMake(CGRectGetMinX(frame) + 0.04979 * CGRectGetWidth(frame), CGRectGetMinY(frame) + 0.50918 * CGRectGetHeight(frame))]; - [bezier2Path addLineToPoint: CGPointMake(CGRectGetMinX(frame) + 0.22452 * CGRectGetWidth(frame), CGRectGetMinY(frame) + 0.34247 * CGRectGetHeight(frame))]; - [bezier2Path closePath]; - [color setFill]; - [bezier2Path fill]; -} - -+ (void)drawMenyItemWithFrame: (CGRect)frame -{ - //// Color Declarations - UIColor* color = [UIColor colorWithRed: 0 green: 0.478 blue: 1 alpha: 1]; - - //// Oval Drawing - UIBezierPath* ovalPath = [UIBezierPath bezierPathWithOvalInRect: CGRectMake(CGRectGetMinX(frame) + 1, CGRectGetMinY(frame) + 3, floor((CGRectGetWidth(frame) - 1) * 0.28037 + 0.5), CGRectGetHeight(frame) - 6)]; - [color setFill]; - [ovalPath fill]; - - - //// Oval 2 Drawing - UIBezierPath* oval2Path = [UIBezierPath bezierPathWithOvalInRect: CGRectMake(CGRectGetMinX(frame) + floor(CGRectGetWidth(frame) * 0.36111 + 0.5), CGRectGetMinY(frame) + 3, floor(CGRectGetWidth(frame) * 0.63889 + 0.5) - floor(CGRectGetWidth(frame) * 0.36111 + 0.5), CGRectGetHeight(frame) - 6)]; - [color setFill]; - [oval2Path fill]; - - - //// Oval 3 Drawing - UIBezierPath* oval3Path = [UIBezierPath bezierPathWithOvalInRect: CGRectMake(CGRectGetMinX(frame) + floor((CGRectGetWidth(frame) - 2) * 0.71698 + 0.5), CGRectGetMinY(frame) + 3, CGRectGetWidth(frame) - 2 - floor((CGRectGetWidth(frame) - 2) * 0.71698 + 0.5), CGRectGetHeight(frame) - 6)]; - [color setFill]; - [oval3Path fill]; -} - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Translation.h b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Translation.h deleted file mode 100644 index 7b5d06aec..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Translation.h +++ /dev/null @@ -1,35 +0,0 @@ -// -// Translation.h -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-06-03. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import <Foundation/Foundation.h> - -@class Language; - -typedef NS_ENUM(NSUInteger, TranslationResult) { - WorstResult, - BestResult, - DefaultResult, - ParseByChunksResult, - InputSentence -}; - -@interface Translation : NSObject - -@property (nonatomic) NSString *fromText; -@property (nonatomic) NSString *toText; -@property (nonatomic) NSArray *toTexts; -@property (nonatomic) Language *fromLanguage; -@property (nonatomic) Language *toLanguage; -@property (nonatomic) TranslationResult result; - -+ (instancetype)translationWithText:(NSString *)fromText - toText:(NSString *)toText - fromLanguage:(Language *)fromLanguage - toLanguage:(Language *)toLanguage; -- (void)speak; -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Translation.m b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Translation.m deleted file mode 100644 index 8a2bc67fc..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Translation.m +++ /dev/null @@ -1,109 +0,0 @@ -// -// Translation.m -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-06-03. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import "Translation.h" -#import "Language.h" -#import <AVFoundation/AVFoundation.h> - - -@implementation Translation - -@synthesize toTexts = _toTexts; - -+ (instancetype)translationWithText:(NSString *)fromText - toText:(NSString *)toText - fromLanguage:(Language *)fromLanguage - toLanguage:(Language *)toLanguage { - Translation *translation = [self new]; - - translation.result = [Translation resultForText:toText]; - - translation.toText = [Translation formatTranslation:toText]; - translation.fromText = fromText; - - translation.fromLanguage = fromLanguage; - translation.toLanguage = toLanguage; - - return translation; -} - -+ (TranslationResult)resultForText:(NSString *)text { - - NSString *firstChar = [text substringToIndex:1]; - - if (text.length == 0) { - return DefaultResult; - } - - if ([firstChar isEqualToString:@"%"] || - [text rangeOfString:@"parse error:"].location != NSNotFound || - [text rangeOfString:@"["].location != NSNotFound) { - return WorstResult; - } - - if ([firstChar isEqualToString:@"*"]) { - return ParseByChunksResult; - } - - if ([firstChar isEqualToString:@"+"]) { - return BestResult; - } - - return DefaultResult; -} - -+ (NSString *)formatTranslation:(NSString *)text { - - if (text.length == 0) { - return text; - } - - NSCharacterSet *charsToRemove = [NSCharacterSet characterSetWithCharactersInString:@"+*% "]; - NSString *trimmedText = [text stringByTrimmingCharactersInSet:charsToRemove]; - - for (NSString *charToRemove in @[@"[", @"]", @"_"]) { - trimmedText =[trimmedText stringByReplacingOccurrencesOfString:charToRemove withString:@" "]; - } - - return trimmedText; -} - -- (void)speak { - AVSpeechUtterance *utterance = [[AVSpeechUtterance alloc] initWithString:self.toText]; - utterance.rate = AVSpeechUtteranceMinimumSpeechRate; - utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:self.toLanguage.bcp]; - - AVSpeechSynthesizer *synthesizer = [[AVSpeechSynthesizer alloc] init]; - [synthesizer speakUtterance:utterance]; -} - -#pragma mark - Setters & getters - -- (NSString *)toText { - if (!_toText) { - return _fromText; - } - return _toText; -} - -- (NSArray *)toTexts { - if (nil) { - return @[_fromText]; - } - return _toTexts; -} - -- (void)setToTexts:(NSArray *)toTexts { - NSMutableArray *formatedTexts = [NSMutableArray new]; - for (NSString *text in toTexts) { - [formatedTexts addObject:[Translation formatTranslation:text]]; - } - _toTexts = formatedTexts.copy; -} - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslationInputTableViewCell.xib b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslationInputTableViewCell.xib deleted file mode 100644 index 2b8a2a451..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslationInputTableViewCell.xib +++ /dev/null @@ -1,58 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES"> - <dependencies> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/> - <capability name="Constraints to layout margins" minToolsVersion="6.0"/> - </dependencies> - <objects> - <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> - <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> - <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="TranslationInput" id="UIw-HO-3Uj" customClass="TranslationTextTableViewCell"> - <rect key="frame" x="0.0" y="0.0" width="320" height="44"/> - <autoresizingMask key="autoresizingMask"/> - <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="UIw-HO-3Uj" id="7tu-Bs-CSE"> - <rect key="frame" x="0.0" y="0.0" width="320" height="43"/> - <autoresizingMask key="autoresizingMask"/> - <subviews> - <view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7To-y6-ppO"> - <rect key="frame" x="9" y="2" width="58" height="39"/> - <color key="backgroundColor" red="0.30855830201242807" green="0.77903700374603524" blue="1" alpha="1" colorSpace="calibratedRGB"/> - </view> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="249" verticalCompressionResistancePriority="751" misplaced="YES" text="Label" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="adT-pY-vJo"> - <rect key="frame" x="18" y="8" width="40" height="27"/> - <fontDescription key="fontDescription" type="system" pointSize="17"/> - <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> - <nil key="highlightedColor"/> - </label> - </subviews> - <constraints> - <constraint firstItem="7To-y6-ppO" firstAttribute="leading" secondItem="7tu-Bs-CSE" secondAttribute="leading" id="5hM-ra-fKy"/> - <constraint firstAttribute="trailingMargin" relation="greaterThanOrEqual" secondItem="adT-pY-vJo" secondAttribute="trailing" constant="25" id="69O-6f-UoR"/> - <constraint firstItem="adT-pY-vJo" firstAttribute="leading" secondItem="7tu-Bs-CSE" secondAttribute="leadingMargin" id="9Vd-9J-Rlw"/> - <constraint firstItem="adT-pY-vJo" firstAttribute="leading" secondItem="7tu-Bs-CSE" secondAttribute="leadingMargin" constant="10" id="IkA-0z-tjq"/> - <constraint firstItem="7To-y6-ppO" firstAttribute="trailing" secondItem="adT-pY-vJo" secondAttribute="trailing" id="NvK-qx-qu9"/> - <constraint firstAttribute="bottomMargin" secondItem="adT-pY-vJo" secondAttribute="bottom" id="OoV-Kh-Bco"/> - <constraint firstItem="adT-pY-vJo" firstAttribute="top" secondItem="7tu-Bs-CSE" secondAttribute="topMargin" id="WIB-Kb-Qc8"/> - <constraint firstItem="7To-y6-ppO" firstAttribute="trailing" secondItem="adT-pY-vJo" secondAttribute="trailing" constant="9" id="fs7-hl-Qh7"/> - <constraint firstAttribute="trailing" secondItem="7To-y6-ppO" secondAttribute="trailing" id="kaU-fi-tBu"/> - <constraint firstAttribute="bottom" secondItem="7To-y6-ppO" secondAttribute="bottom" constant="2" id="lcW-9e-wSN"/> - <constraint firstItem="7To-y6-ppO" firstAttribute="leading" secondItem="adT-pY-vJo" secondAttribute="leading" constant="-9" id="oN5-mX-1Gl"/> - <constraint firstItem="7To-y6-ppO" firstAttribute="top" secondItem="7tu-Bs-CSE" secondAttribute="top" constant="2" id="voa-C4-ldW"/> - </constraints> - <variation key="default"> - <mask key="constraints"> - <exclude reference="5hM-ra-fKy"/> - <exclude reference="NvK-qx-qu9"/> - <exclude reference="kaU-fi-tBu"/> - <exclude reference="9Vd-9J-Rlw"/> - </mask> - </variation> - </tableViewCellContentView> - <connections> - <outlet property="decorationView" destination="7To-y6-ppO" id="yF5-JS-aJv"/> - <outlet property="translationTextLabel" destination="adT-pY-vJo" id="Yma-rH-iaF"/> - </connections> - <point key="canvasLocation" x="678" y="412"/> - </tableViewCell> - </objects> -</document> diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslationOptionsViewController.h b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslationOptionsViewController.h deleted file mode 100644 index 08da46370..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslationOptionsViewController.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// TranslationOptionsViewController.h -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-05-11. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import <UIKit/UIKit.h> - -@class Translation; - -@interface TranslationOptionsViewController : UITableViewController -@property (nonatomic) Translation *translation; -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslationOptionsViewController.m b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslationOptionsViewController.m deleted file mode 100644 index c14238d83..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslationOptionsViewController.m +++ /dev/null @@ -1,106 +0,0 @@ -// -// TranslationOptionsViewController.m -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-05-11. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import "TranslationOptionsViewController.h" -#import "PhraseTranslation.h" -#import "WordTranslation.h" -#import "WebViewController.h" -#import "SentenceTranslationUITableViewCell.h" - -@implementation TranslationOptionsViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - - self.tableView.rowHeight = UITableViewAutomaticDimension; - self.tableView.estimatedRowHeight = 19; -} - -- (void)viewDidAppear:(BOOL)animated { - [super viewDidAppear:animated]; - - [self.tableView reloadData]; -} - -#pragma mark - Table view data source - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return self.translation.toTexts.count; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - - - if ([self.translation isMemberOfClass:[WordTranslation class]]) { - - NSString *identifier = @"Basic"; - - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier forIndexPath:indexPath]; - - WordTranslation *translation = (WordTranslation *)self.translation; - NSString *html = translation.html[indexPath.row]; - - cell.textLabel.text = translation.toTexts[indexPath.row]; - - if (html.length > 0) { - cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; - } else { - cell.accessoryType = UITableViewCellAccessoryNone; - } - - return cell; - } else if ([self.translation isMemberOfClass:[PhraseTranslation class]]) { - - NSString *identifier = @"Cell"; - - SentenceTranslationUITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier forIndexPath:indexPath]; - - PhraseTranslation *translation = (PhraseTranslation *)self.translation; - - [cell configureCellWithSentenceInTableView:tableView - withTranslation:translation.toTexts[indexPath.row] - andTree:translation.sequences[indexPath.row]]; - return cell; - } - - return nil; -} - -#pragma mark - Table view delegate - -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - - if ([self.translation isMemberOfClass:[WordTranslation class]]) { - WordTranslation *translation = (WordTranslation *)self.translation; - NSString *html = translation.html[indexPath.row]; - - if (html.length > 0) { - [self performSegueWithIdentifier:@"WebView" sender:indexPath]; - } - } -} - -#pragma mark - Navigation - -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - [super prepareForSegue:segue sender:sender]; - - // WebView - if ([sender isKindOfClass:[NSIndexPath class]] && - [self.translation isMemberOfClass:[WordTranslation class]]) { - - WordTranslation *translation = (WordTranslation *)self.translation; - NSIndexPath *indexPath = (NSIndexPath *)sender; - - WebViewController *webVC = segue.destinationViewController; - webVC.title = translation.toText; - webVC.htmlToRender = translation.html[indexPath.row]; - } -} - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslationOutputTableViewCell.xib b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslationOutputTableViewCell.xib deleted file mode 100644 index 9b56a1298..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslationOutputTableViewCell.xib +++ /dev/null @@ -1,45 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES"> - <dependencies> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/> - <capability name="Constraints to layout margins" minToolsVersion="6.0"/> - </dependencies> - <objects> - <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> - <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> - <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="TranslationOutput" id="KGk-i7-Jjw" customClass="TranslationTextTableViewCell"> - <rect key="frame" x="0.0" y="0.0" width="320" height="44"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> - <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM"> - <rect key="frame" x="0.0" y="0.0" width="320" height="43"/> - <autoresizingMask key="autoresizingMask"/> - <subviews> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="X0L-SM-Oy6"> - <rect key="frame" x="251" y="2" width="61" height="39"/> - <color key="backgroundColor" red="1" green="0.26915805189999997" blue="0.054802574200000002" alpha="1" colorSpace="calibratedRGB"/> - </view> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="249" verticalCompressionResistancePriority="751" text="Label" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uQa-0I-JXG"> - <rect key="frame" x="261" y="8" width="42" height="27"/> - <fontDescription key="fontDescription" type="system" pointSize="17"/> - <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> - <nil key="highlightedColor"/> - </label> - </subviews> - <constraints> - <constraint firstItem="uQa-0I-JXG" firstAttribute="bottom" secondItem="H2p-sc-9uM" secondAttribute="bottomMargin" id="0kp-2S-9HE"/> - <constraint firstItem="uQa-0I-JXG" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="H2p-sc-9uM" secondAttribute="leadingMargin" constant="25" id="7tz-W5-sjO"/> - <constraint firstItem="uQa-0I-JXG" firstAttribute="leading" secondItem="X0L-SM-Oy6" secondAttribute="leading" constant="10" id="PeL-5E-g6c"/> - <constraint firstItem="X0L-SM-Oy6" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="2" id="Y0H-g2-j15"/> - <constraint firstItem="uQa-0I-JXG" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="topMargin" id="aF2-US-9FV"/> - <constraint firstItem="uQa-0I-JXG" firstAttribute="trailing" secondItem="X0L-SM-Oy6" secondAttribute="trailing" constant="-9" id="iCN-4t-n07"/> - <constraint firstAttribute="bottom" secondItem="X0L-SM-Oy6" secondAttribute="bottom" constant="2" id="uf5-yE-V0h"/> - <constraint firstItem="uQa-0I-JXG" firstAttribute="trailing" secondItem="H2p-sc-9uM" secondAttribute="trailingMargin" constant="-9" id="vz1-Ju-XEr"/> - </constraints> - </tableViewCellContentView> - <connections> - <outlet property="decorationView" destination="X0L-SM-Oy6" id="hyg-YB-kiu"/> - <outlet property="translationTextLabel" destination="uQa-0I-JXG" id="E0m-m4-PbH"/> - </connections> - </tableViewCell> - </objects> -</document> diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslationTextTableViewCell.h b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslationTextTableViewCell.h deleted file mode 100644 index 75570c5ef..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslationTextTableViewCell.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// TranslationInputTableViewCell.h -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-04-27. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import <UIKit/UIKit.h> -@class PhraseTranslation; - -@interface TranslationTextTableViewCell : UITableViewCell - - -- (void)setCellWithLanguage:(PhraseTranslation *)translation fromLanguage:(BOOL)fromLanguage; - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslationTextTableViewCell.m b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslationTextTableViewCell.m deleted file mode 100644 index 733c1c344..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslationTextTableViewCell.m +++ /dev/null @@ -1,47 +0,0 @@ -// -// TranslationInputTableViewCell.m -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-04-27. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import "TranslationTextTableViewCell.h" -#import "PhraseTranslation.h" -#import "Language.h" -#import "UIColor+TranslationsResults.h" - -@interface TranslationTextTableViewCell () - -@property (weak, nonatomic) IBOutlet UILabel *translationTextLabel; -@property (weak, nonatomic) IBOutlet UIImageView *flagImageView; -@property (weak, nonatomic) IBOutlet UIView *decorationView; - -@end - -@implementation TranslationTextTableViewCell - -- (void)awakeFromNib { - self.decorationView.layer.cornerRadius = 5; - self.decorationView.layer.masksToBounds = YES; -} - -- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - [super setSelected:selected animated:animated]; - - // Configure the view for the selected state -} - -- (void)setCellWithLanguage:(PhraseTranslation *)translation fromLanguage:(BOOL)fromLanguage { - - Language *language = fromLanguage ? translation.fromLanguage : translation.toLanguage; - NSString *text = fromLanguage ? translation.fromText : translation.toText; - - NSString *imageName = language.abbreviation; - [self.flagImageView setImage:[UIImage imageNamed:imageName]]; - self.translationTextLabel.text = text; - TranslationResult resultColor = fromLanguage ? InputSentence : translation.result; - self.decorationView.backgroundColor = [UIColor colorForResult: resultColor]; -} - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslationTextViewController.h b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslationTextViewController.h deleted file mode 100644 index ef38e044c..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslationTextViewController.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// TranslationTextViewController.h -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-04-27. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import "SLKTextViewController.h" -@class Language; - -@protocol TranslationTextViewControllerDelegate <NSObject> - -- (void)changeLanguageToLanguage:(Language *)laguange isFrom:(BOOL)isFrom; - -@end - -@interface TranslationTextViewController : SLKTextViewController <TranslationTextViewControllerDelegate> - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslationTextViewController.m b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslationTextViewController.m deleted file mode 100644 index 9fe67a17b..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslationTextViewController.m +++ /dev/null @@ -1,307 +0,0 @@ - // -// TranslationTextViewController.m -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-04-27. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import "TranslationTextViewController.h" - -// Models -#import "Translator.h" -#import "Grammar.h" -#import "Language.h" -#import "PhraseTranslation.h" -#import "MorphAnalyser.h" -#import "TranslatorStore.h" -#import "NSString+StringToArray.h" - -// Views -#import "TranslationTextTableViewCell.h" -#import "ArrowsButton.h" -#import "MenuView.h" -#import "SLKTextView+TextInputMode.h" - -// Grammatical framework -#import "pgf/pgf.h" -#import "gu/mem.h" -#import "gu/exn.h" -#import "gu/file.h" - -// View controllers -#import "LanguagesViewController.h" -#import "TranslationOptionsViewController.h" -#import "WebViewController.h" - -@interface TranslationTextViewController () - -@property (nonatomic) Translator *translator; -@property (nonatomic, strong) NSMutableArray *inputs; -@property (nonatomic) BOOL isLoadingGrammar; -@property (nonatomic) UIBarButtonItem *leftLanguageButton; -@property (nonatomic) UIBarButtonItem *rightLanguageButton; - -@end - -@implementation TranslationTextViewController - -#pragma mark - Getters & setters - -- (NSMutableArray *)inputs { - if (!_inputs) { - _inputs = [NSMutableArray new]; - } - return _inputs; -} - -- (void)setIsLoadingGrammar:(BOOL)isLoadingGrammar { - _isLoadingGrammar = isLoadingGrammar; - - self.leftLanguageButton.enabled = !isLoadingGrammar; - self.rightLanguageButton.enabled = !isLoadingGrammar; -} - -#pragma mark - Initializer - -+ (UITableViewStyle)tableViewStyleForCoder:(NSCoder *)decoder { - return (UITableViewStyleGrouped); -} - -#pragma mark - View lifecycle - -- (void)viewDidLoad { - [super viewDidLoad]; - - // Setup keyboard - self.textView.autocapitalizationType = UITextAutocapitalizationTypeNone; - [self.textInputbar.rightButton setTitle:@"Translate" forState:UIControlStateNormal]; - [self.singleTapGesture addTarget:self action:@selector(didTapTableView:)]; - - // Register cells - UINib *nib = [UINib nibWithNibName:@"TranslationInputTableViewCell" bundle:nil]; - [[self tableView] registerNib:nib forCellReuseIdentifier:@"TranslationInput"]; - - nib = [UINib nibWithNibName:@"TranslationOutputTableViewCell" bundle:nil]; - [[self tableView] registerNib:nib forCellReuseIdentifier:@"TranslationOutput"]; - - // Setup table view - self.tableView.estimatedRowHeight = 89; - self.tableView.rowHeight = UITableViewAutomaticDimension; - self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; - self.tableView.allowsSelection = YES; - self.inverted = NO; - - // Setup buttons - ArrowsButton *arrows = [[ArrowsButton alloc] initWithFrame:CGRectMake(0, 0, 50, 30)]; - [arrows addTarget:self action:@selector(switchLanguage:) forControlEvents:UIControlEventTouchUpInside]; - arrows.backgroundColor = [UIColor clearColor]; - UIBarButtonItem *arrowsButton = [[UIBarButtonItem alloc] initWithCustomView:arrows]; - - self.leftLanguageButton = [[UIBarButtonItem alloc] initWithTitle:@"Loading" - style:(UIBarButtonItemStylePlain) - target:self - action:@selector(changeLanguage:)]; - self.rightLanguageButton = [[UIBarButtonItem alloc] initWithTitle:@"Loading" - style:(UIBarButtonItemStylePlain) - target:self - action:@selector(changeLanguage:)]; - - self.navigationItem.leftBarButtonItems = @[self.leftLanguageButton, arrowsButton, self.rightLanguageButton]; - - // Load grammars - self.isLoadingGrammar = YES; - - [TranslatorStore loadTranslatorWithCompletion:^(Translator *translator) { - self.translator = translator; - - self.isLoadingGrammar = NO; - [self updateButtonTitles]; - [self textDidUpdate:YES]; - self.textView.userDefinedKeyboardLanguage = self.translator.from.language.bcp; - }]; -} - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - - self.textView.userDefinedKeyboardLanguage = self.translator.from.language.bcp; -} - - -#pragma mark - Navigation - -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - [super prepareForSegue:segue sender:sender]; - - if ([segue.identifier isEqualToString:@"ChangeLanguage"]) { - UINavigationController *navigationController = segue.destinationViewController; - - LanguagesViewController *destinattionController = (LanguagesViewController *)navigationController.topViewController; - BOOL fromLanguage = sender == self.leftLanguageButton; - - destinattionController.currentLanguages = @[self.translator.from.language, self.translator.to.language]; - destinattionController.fromLanguage = fromLanguage; - destinattionController.delegate = self; - } else if ([segue.identifier isEqualToString:@"TranslationOptions"]) { - TranslationOptionsViewController *destinattionController = segue.destinationViewController; - destinattionController.title = ((Translation *)sender).fromText; - destinattionController.translation = sender; - } else if ([segue.identifier isEqualToString:@"Info"]) { - WebViewController *destinationController = (WebViewController *)segue.destinationViewController; - NSString *htmlFile = [[NSBundle mainBundle] pathForResource:@"help_content" ofType:@"html"]; - NSString* htmlString = [NSString stringWithContentsOfFile:htmlFile encoding:NSUTF8StringEncoding error:nil]; - - destinationController.htmlToRender = htmlString; - } -} - -- (void)goToHelp:(id)sender { - [self performSegueWithIdentifier:@"helpView" sender:nil]; -} - -- (void)changeLanguage:(id)sender { - [self performSegueWithIdentifier:@"ChangeLanguage" sender:sender]; -} - -#pragma mark - TranslationTextViewControllerDelegate - -- (void)changeLanguageToLanguage:(Language *)laguange isFrom:(BOOL)isFrom { - UIBarButtonItem *button = isFrom ? self.leftLanguageButton : self.rightLanguageButton; - button.title = @"loading"; - - self.isLoadingGrammar = YES; - [self textDidUpdate:YES]; - - [self.translator changeLanguageToLanguage:laguange isFrom:isFrom withCompletion:^{ - [self updateButtonTitles]; - self.isLoadingGrammar = NO; - [self textDidUpdate:YES]; - }]; -} - -#pragma mark - SLKTextViewController Events - - -- (BOOL)canPressRightButton { - // Asks if the right button can be pressed - if (self.isLoadingGrammar) { - return NO; - } - return [super canPressRightButton]; -} - -- (void)didPressRightButton:(id)sender { - - // Notifies the view controller when the right button's action has been triggered, manually or by using the keyboard return key. - // Must call super - - NSString *input = self.textView.text; - - // If chinese add input to chars - if ([self.translator.from.language.bcp isEqualToString:@"zh-CN"]) { - NSArray *array = [input stringToArray]; - input = [array componentsJoinedByString:@" "]; - } - - NSInteger wordsCount = [input componentsSeparatedByString:@" "].count; - - - dispatch_async(dispatch_queue_create("Load grammars",NULL), ^{ - Translation *newTranslation = (wordsCount == 1 ? (Translation *)[self.translator analysWord:input] : (Translation *)[self.translator translatePhrase:input]); - - dispatch_async(dispatch_get_main_queue(), ^{ - [self.inputs addObject:newTranslation]; - [self.tableView reloadData]; - - [newTranslation speak]; - -// [self.tableView slk_scrollToBottomAnimated:YES]; -// - NSIndexPath *bottomIndexPath = [NSIndexPath indexPathForRow:(self.inputs.count*2)-1 inSection:0]; - [self.tableView scrollToRowAtIndexPath:bottomIndexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES]; - }); - }); - - - - // This little trick validates any pending auto-correction or auto-spelling just after hitting the 'Send' button - [self.textView refreshFirstResponder]; - [super didPressRightButton:sender]; - - -} - -#pragma mark - <UITableViewDataSource> - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return self.inputs.count*2; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - - BOOL input = indexPath.row % 2 == 0; - NSString *identifier = input ? @"TranslationInput" : @"TranslationOutput"; - - TranslationTextTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier forIndexPath:indexPath]; - - PhraseTranslation *translation = self.inputs[indexPath.row/2]; - [cell setCellWithLanguage:translation fromLanguage:input]; - if (!input && (translation.toTexts.count || translation.sequences.count > 0)) { - cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; - cell.selectionStyle = UITableViewCellSelectionStyleDefault; - } else { - cell.accessoryType = UITableViewCellAccessoryNone; - cell.selectionStyle = UITableViewCellSelectionStyleNone; - } - - return cell; -} - -#pragma mark - <UITableViewDelegate> - - -// Uncomment this method to handle the cell selection -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - if (self.inputs.count == 0) { - return; - } - if ([tableView isEqual:self.tableView] && indexPath.row % 2 == 1) { - PhraseTranslation *translation = self.inputs[indexPath.row/2]; - if (translation.toTexts.count > 0 || translation.sequences.count > 0) { - [self performSegueWithIdentifier:@"TranslationOptions" sender:translation]; - } - } - if ([tableView isEqual:self.tableView] && indexPath.row % 2 == 0) { - PhraseTranslation *translation = self.inputs[indexPath.row/2]; - self.textInputbar.textView.text = translation.fromText; - } - [self.tableView deselectRowAtIndexPath:indexPath animated:YES]; -} - -#pragma mark - Gesture method - -- (void)didTapTableView:(UIGestureRecognizer *)gesture { - if (![self.textView isFirstResponder]) { - CGPoint touchLoaction = [gesture locationInView:self.tableView]; - NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:touchLoaction]; - [self.tableView.delegate tableView:self.tableView didSelectRowAtIndexPath:indexPath]; - } -} - -#pragma mark - Private helpers - -- (void)updateButtonTitles { - self.leftLanguageButton.title = self.translator.from.language.name; - self.rightLanguageButton.title = self.translator.to.language.name; -} - -- (void)switchLanguage:(id)sender { - [TranslatorStore switchLanguage:self.translator]; - - [self updateButtonTitles]; - self.textView.userDefinedKeyboardLanguage = self.translator.from.language.bcp; - [self.textView reloadInputViews]; -} - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Translator.h b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Translator.h deleted file mode 100644 index 5085b24c0..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Translator.h +++ /dev/null @@ -1,34 +0,0 @@ -// -// Translator.h -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-04-28. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import <Foundation/Foundation.h> - -// Grammitcal framework -#import "pgf.h" - -@class Grammar; -@class PhraseTranslation; -@class WordTranslation; -@class Language; - -@interface Translator : NSObject - -@property (nonatomic) PgfPGF *pgf; -@property (nonatomic) GuOut *fileOut; -@property (nonatomic) GuExn *err; -@property (nonatomic) GuPool *pool; - -@property (nonatomic, strong) Grammar *to; -@property (nonatomic, strong) Grammar *from; -@property (nonatomic, strong) Grammar *previous; - -- (PhraseTranslation *)translatePhrase:(NSString *)phrase; -- (WordTranslation *)analysWord:(NSString *)word; -- (void)changeLanguageToLanguage:(Language *)language isFrom:(BOOL)isFrom withCompletion:(void (^)(void))completion; - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Translator.m b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Translator.m deleted file mode 100644 index 0faceab43..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/Translator.m +++ /dev/null @@ -1,286 +0,0 @@ -// -// Translator.m -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-04-28. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import "Translator.h" - -// Model -#import "Grammar.h" -#import "PhraseTranslation.h" -#import "WordTranslation.h" -#import "MorphAnalyser.h" -#import "Language.h" - - -// Grammatical Framework -#import "pgf/literals.h" -#import "pgf/pgf.h" -#import "gu/mem.h" -#import "gu/exn.h" -#import "gu/file.h" - - -@interface Translator () - -@property (nonatomic, strong) NSArray *sequences; - -@end - -@implementation Translator - -#pragma mark - inits - -- (instancetype)init { - self = [super init]; - if (self) { - - NSBundle *bundle = [NSBundle mainBundle]; - NSString *path = [bundle pathForResource:@"App" ofType:@"pgf"]; - - // Create the pool that is used to allocate everything - _pool = gu_new_pool(); - - // Create an exception frame that catches all errors. - _err = gu_new_exn(_pool); - - // Read the PGF grammar. - _pgf = pgf_read([path UTF8String], _pool, _err); - } - return self; -} - -#pragma mark - Public translation method - -- (NSString *)getSequance:(NSString *)phrase ep:(PgfExprProb *)ep tmpErr:(GuExn *)tmpErr tmpPool:(GuPool *)tmpPool { - - - - GuPool* tmp_pool = gu_new_pool(); - GuStringBuf* buf = gu_string_buf(tmp_pool); - GuOut* outt = gu_string_buf_out(buf); - - - - // Write out the abstract syntax tree - gu_printf(outt, self.err, "", [phrase UTF8String]); - pgf_print_expr(ep->expr, NULL, 0, outt, self.err); - gu_putc('\n', outt, self.err); - - // pgf_linearize(self.to.concrete, html_expr, html_out, err); - GuString lin = gu_string_buf_freeze(buf, tmp_pool); - - NSString *string = [NSString stringWithUTF8String:lin]; - NSLog(@"%@", string); - - gu_exn_clear(tmpErr); - gu_pool_free(tmp_pool); - tmpPool = nil; - tmpErr = nil; - - return string; -} - -- (PhraseTranslation *)translatePhrase:(NSString *)phrase { - - GuPool *tmpPool = gu_new_pool(); - GuExn *tmpErr = gu_new_exn(tmpPool); - - PgfExprEnum *parsedExpressions = [self parsePhrase:[phrase stringByAppendingString:@" "] startCat:@"Phr" tmpPool:tmpPool tmpErr:tmpErr]; - NSArray *translatedText = nil; - - if (parsedExpressions != nil) { - translatedText = [self linearizeResult:parsedExpressions tmpPool:tmpPool tmpErr:tmpErr]; - if (translatedText.count == 0) { - translatedText = @[[self translateByLookUp:phrase]]; - } - } else { - translatedText = @[[self translateByLookUp:phrase]]; - } - - - - PhraseTranslation *translation = [PhraseTranslation translationWithText:phrase - toText:translatedText.firstObject - fromLanguage:self.from.language - toLanguage:self.to.language]; - - translation.toTexts = translatedText; - translation.sequences = self.sequences; - - if ([translation.toLanguage.bcp isEqualToString:@"th-TH"] || - [translation.toLanguage.bcp isEqualToString:@"ja-JP"] || - [translation.toLanguage.bcp isEqualToString:@"zh-CN"]) { - - NSMutableArray *trimmedArray = @[].mutableCopy; - - for (NSString *string in translation.toTexts) { - NSString *trimmed = [string stringByReplacingOccurrencesOfString:@" " withString:@""]; - [trimmedArray addObject:trimmed]; - } - NSString *trimmed = [translation.toText stringByReplacingOccurrencesOfString:@" " withString:@""]; - - translation.toText = trimmed; - translation.toTexts = trimmedArray.copy; - } - - return translation; -} - -- (WordTranslation *)analysWord:(NSString *)word; { - - MorphAnalyser *analyser = [[MorphAnalyser alloc] initWithPgf:self.pgf err:self.err to:self.to from:self.from]; - [analyser analysWord:word]; - - WordTranslation *translation = [WordTranslation translationWithText:word - toText:analyser.bestTranslation - fromLanguage:self.from.language - toLanguage:self.to.language]; - - translation.toTexts = analyser.analysedWords; - translation.html = analyser.html; - - return translation; -} - -#pragma mark - Private helpers - -- (NSString *)translateByLookUp:(NSString *)phrase { - NSMutableString *translation = @"%".mutableCopy; - NSArray *words = [phrase componentsSeparatedByString:@" "]; - - for (NSString *word in words) { - NSString *translatedWord = [self translateWord:word]; - [translation appendString: translatedWord ? [NSString stringWithFormat:@" %@", translatedWord] : [NSString stringWithFormat:@" %@", word]]; - } - return translation.copy; -} - -- (NSString *)translateWord:(NSString *)word { - GuPool *tmpPool = gu_new_pool(); - GuExn *tmpErr = gu_new_exn(tmpPool); - - PgfExprEnum *parse = [self parsePhrase:word startCat:@"Chunk" tmpPool:tmpPool tmpErr: tmpErr]; - NSString *translation = @""; - - if (parse) { - NSArray *results = [self linearizeResult:parse tmpPool:tmpPool tmpErr:tmpErr]; - - if (results.count) { - translation = results.firstObject; - } else { - translation = [self translateByLookUp:word]; - } - } else { - MorphAnalyser *analyser = [[MorphAnalyser alloc] initWithPgf:self.pgf err:self.err to:self.to from:self.from]; - [analyser analysWord:word]; - translation = analyser.bestTranslation; - } - - // Clear up resources - gu_exn_clear(tmpErr); - gu_pool_free(tmpPool); - tmpPool = nil; - tmpErr = nil; - - return translation; -} - -- (PgfExprEnum *)parsePhrase:(NSString *)phrase startCat:(NSString *)startCat tmpPool:(GuPool *)tmpPool tmpErr:(GuExn *)tmpErr { - - PgfCallbacksMap* callbacks = - pgf_new_callbacks_map(self.from.concrete, tmpPool); - pgf_callbacks_map_add_literal(self.from.concrete, callbacks, - "PN", &pgf_nerc_literal_callback); - - pgf_callbacks_map_add_literal(self.from.concrete, callbacks, - "Symb", &pgf_unknown_literal_callback); - - PgfExprEnum *result = pgf_parse_with_heuristics(self.from.concrete, "Phr", [phrase UTF8String], - -1, callbacks, - tmpErr, tmpPool, tmpPool); - - - -// PgfExprEnum *result = pgf_parse(self.from.concrete, [startCat UTF8String], [phrase UTF8String], tmpErr, tmpPool, tmpPool); - return gu_ok(tmpErr) ? result : nil; -} - --(NSArray *)linearizeResult:(PgfExprEnum *)result tmpPool:(GuPool *)tmpPool tmpErr:(GuExn *)tmpErr { - - NSMutableArray *translations = [NSMutableArray new]; - NSMutableArray *sequences = [NSMutableArray new]; - - PgfExprProb *ep; - gu_enum_next(result, &ep, tmpPool); - - - // If null reutrun empty array - if (!ep) { - return @[]; - } - - for (int i = 0; i <= 10 && ep != nil; i++) { - PgfExprProb parse = ep[0]; - - // Get translation - GuStringBuf *stringBuff = gu_string_buf(tmpPool); - GuOut *tmpOut = gu_string_buf_out(stringBuff); - pgf_linearize(self.to.concrete, parse.expr, tmpOut, tmpErr); - - // Get sequence - GuString lin = gu_string_buf_freeze(stringBuff, tmpPool); - NSString *phrase = [NSString stringWithUTF8String:lin]; - - NSString *translated = [NSString stringWithUTF8String:gu_string_buf_freeze(stringBuff, tmpPool)]; - - NSInteger resultIndex = [translations indexOfObjectPassingTest:^BOOL(NSString *str, NSUInteger idx, BOOL *stop) { - return [str isEqualToString:translated]; - }]; - - if (resultIndex == NSNotFound) { - [translations addObject:translated]; - [sequences addObject:[self getSequance:phrase ep:ep tmpErr:tmpErr tmpPool:tmpPool]]; - } - - gu_out_flush(tmpOut, tmpErr); - tmpOut = nil; - - gu_enum_next(result, &ep, tmpPool); - } - self.sequences = [sequences copy]; - - return [translations copy]; -} - -- (void)changeLanguageToLanguage:(Language *)language isFrom:(BOOL)isFrom withCompletion:(void (^)(void))completion { - - dispatch_async(dispatch_queue_create("Load grammars",NULL), ^{ - if ([self.previous.language isEqualToLanguage:language]) { - Grammar *temp = isFrom ? self.from : self.to; - if (isFrom) { - self.from = self.previous; - } else { - self.to = self.previous; - } - self.previous = temp; - } else { - self.previous = isFrom ? self.from : self.to; - if (isFrom) { - self.from = [Grammar loadGrammarFromLanguage:language withTranslator:self]; - } else { - self.to = [Grammar loadGrammarFromLanguage:language withTranslator:self]; - } - } - - dispatch_async(dispatch_get_main_queue(), ^{ - completion(); - }); - }); -} - - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslatorStore.h b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslatorStore.h deleted file mode 100644 index ede27a291..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslatorStore.h +++ /dev/null @@ -1,32 +0,0 @@ -// -// TranslatorStore.h -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-06-22. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import <Foundation/Foundation.h> - -@class Translator; - -@interface TranslatorStore : NSObject - -/** - * Loads a translator with the last saved grammars on a background thread, if can't find anyone it loads defaults grammars wich are - * Swedish -> English. - * - * @param completion A completion block with the loaded grammars - */ -+ (void)loadTranslatorWithCompletion:(void (^)(Translator *translator))completion; - -/** - * Saves the current grammars names to NSUserDefaults. - * - * @param translator The translator that contains the current grammars. - */ -+ (void)saveCurrentGrammarsFromTranslator:(Translator *)translator; - -+ (void)switchLanguage:(Translator *)translator; - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslatorStore.m b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslatorStore.m deleted file mode 100644 index 18c1e8cc0..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/TranslatorStore.m +++ /dev/null @@ -1,79 +0,0 @@ -// -// TranslatorStore.m -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-06-22. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import "TranslatorStore.h" -#import "AppDelegate.h" - -// Model -#import "Translator.h" -#import "Language.h" -#include "Grammar.h" - -@implementation TranslatorStore - -+ (void)loadTranslatorWithCompletion:(void (^)(Translator *translator))completion { - - // Load grammars strings from NSUserDefaults - NSString *fromLanguageString = [[NSUserDefaults standardUserDefaults] stringForKey:@"FromLanguage"]; - NSString *fromAbbreviationString = [[NSUserDefaults standardUserDefaults] stringForKey:@"FromAbbreviation"]; - NSString *fromBCPString = [[NSUserDefaults standardUserDefaults] stringForKey:@"FromBCP"]; - - NSString *toLanguageString = [[NSUserDefaults standardUserDefaults] stringForKey:@"toLanguage"]; - NSString *toAbbreviationString = [[NSUserDefaults standardUserDefaults] stringForKey:@"toAbbreviation"]; - NSString *toBCPString = [[NSUserDefaults standardUserDefaults] stringForKey:@"toBCP"]; - - if (!fromLanguageString) { - fromLanguageString = @"Swedish"; - fromAbbreviationString = @"Swe"; - fromBCPString = @"sv-SE"; - - toLanguageString = @"English"; - toAbbreviationString = @"Eng"; - toBCPString = @"en-GB"; - } - - // Setup translator - Language *fromLanguage = [[Language alloc] initWithName:fromLanguageString abbreviation:fromAbbreviationString bcp:fromBCPString]; - Language *toLanguage = [[Language alloc] initWithName:toLanguageString abbreviation:toAbbreviationString bcp:toBCPString]; - __block Translator *translator = [[Translator alloc] init]; - - dispatch_async(dispatch_queue_create("Load grammars",NULL), ^{ - translator.from = [Grammar loadGrammarFromLanguage:fromLanguage withTranslator:translator]; - translator.to = [Grammar loadGrammarFromLanguage:toLanguage withTranslator:translator]; - - AppDelegate *appDelegate = [UIApplication sharedApplication].delegate; - appDelegate.translator = translator; - - dispatch_async(dispatch_get_main_queue(), ^{ - completion(translator); - }); - }); -} - -+ (void)saveCurrentGrammarsFromTranslator:(Translator *)translator { - - - [[NSUserDefaults standardUserDefaults] setObject:translator.from.language.name forKey:@"FromLanguage"]; - [[NSUserDefaults standardUserDefaults] setObject:translator.from.language.abbreviation forKey:@"FromAbbreviation"]; - [[NSUserDefaults standardUserDefaults] setObject:translator.from.language.bcp forKey:@"FromBCP"]; - - [[NSUserDefaults standardUserDefaults] setObject:translator.to.language.name forKey:@"toLanguage"]; - [[NSUserDefaults standardUserDefaults] setObject:translator.to.language.abbreviation forKey:@"toAbbreviation"]; - [[NSUserDefaults standardUserDefaults] setObject:translator.to.language.bcp forKey:@"toBCP"]; - - [[NSUserDefaults standardUserDefaults] synchronize]; -} - -+ (void)switchLanguage:(Translator *)translator { - - Grammar *temp = translator.from; - translator.from = translator.to; - translator.to = temp; -} - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/UIColor+TranslationsResults.h b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/UIColor+TranslationsResults.h deleted file mode 100644 index cbdb33372..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/UIColor+TranslationsResults.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// UIColor+TranslationsResults.h -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-05-04. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import <UIKit/UIKit.h> -#import "PhraseTranslation.h" - -@interface UIColor (TranslationsResults) - -+ (UIColor *)colorForResult:(TranslationResult)result; - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/UIColor+TranslationsResults.m b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/UIColor+TranslationsResults.m deleted file mode 100644 index ea3026afc..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/UIColor+TranslationsResults.m +++ /dev/null @@ -1,57 +0,0 @@ -// -// UIColor+TranslationsResults.m -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-05-04. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import "UIColor+TranslationsResults.h" - -@implementation UIColor (TranslationsResults) - -+ (UIColor *)colorFromHexString:(NSString *)hexString { - unsigned rgbValue = 0; - NSScanner *scanner = [NSScanner scannerWithString:hexString]; - [scanner setScanLocation:1]; // bypass '#' character - [scanner scanHexInt:&rgbValue]; - return [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16)/255.0 green:((rgbValue & 0xFF00) >> 8)/255.0 blue:(rgbValue & 0xFF)/255.0 alpha:1.0]; -} - -+ (UIColor *)colorForResult:(TranslationResult)result { - switch (result) { - case BestResult: - return [UIColor bestResultColor]; - case WorstResult: - return [UIColor worstResultColor]; - case ParseByChunksResult: - return [UIColor parseByChunksResultColor]; - case InputSentence: - return [UIColor inputSentenceColor]; - default: - return [UIColor defaultResultColor]; - } -} - -+ (UIColor *)worstResultColor { - return [UIColor colorFromHexString:@"#FF303e"]; -} - -+ (UIColor *)defaultResultColor { - return [UIColor colorFromHexString:@"#FFFF99"]; -} - - -+ (UIColor *)parseByChunksResultColor { - return [UIColor colorFromHexString:@"#FFB2A5"]; -} - -+ (UIColor *)bestResultColor { - return [UIColor colorFromHexString:@"#75CD75"]; -} - -+ (UIColor *)inputSentenceColor { - return [UIColor colorFromHexString:@"#CDCDED"]; -} - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/UITableViewCell+Customize.h b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/UITableViewCell+Customize.h deleted file mode 100644 index 2ee3763a6..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/UITableViewCell+Customize.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// UITableViewCell+Customize.h -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-05-11. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import <UIKit/UIKit.h> - -@interface UITableViewCell (Customize) - -- (void)sizeImageViewToSize:(CGSize)size; - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/UITableViewCell+Customize.m b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/UITableViewCell+Customize.m deleted file mode 100644 index 28e86eb9a..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/UITableViewCell+Customize.m +++ /dev/null @@ -1,22 +0,0 @@ -// -// UITableViewCell+Customize.m -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-05-11. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import "UITableViewCell+Customize.h" - -@implementation UITableViewCell (Customize) - -- (void)sizeImageViewToSize:(CGSize)size { - - UIGraphicsBeginImageContextWithOptions(size, NO, UIScreen.mainScreen.scale); - CGRect imageRect = CGRectMake(0.0, 0.0, size.width, size.height); - [self.imageView.image drawInRect:imageRect]; - self.imageView.image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); -} - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/WebViewController.h b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/WebViewController.h deleted file mode 100644 index 18c05ae07..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/WebViewController.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// WebViewController.h -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-05-25. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import <UIKit/UIKit.h> - -@interface WebViewController : UIViewController -@property (nonatomic, strong) NSString *htmlToRender; -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/WebViewController.m b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/WebViewController.m deleted file mode 100644 index 0ea5eee4d..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/WebViewController.m +++ /dev/null @@ -1,25 +0,0 @@ -// -// WebViewController.m -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-05-25. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import "WebViewController.h" -#import "MorphAnalyser.h" - - -@interface WebViewController () -@property (weak, nonatomic) IBOutlet UIWebView *webView; - -@end - -@implementation WebViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - [self.webView loadHTMLString:self.htmlToRender baseURL:nil]; -} - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/WordTranslation.h b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/WordTranslation.h deleted file mode 100644 index 7abb76370..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/WordTranslation.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// WordTranslation.h -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-06-03. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import <Foundation/Foundation.h> -#import "Translation.h" - - -@interface WordTranslation : Translation - -@property (nonatomic, strong) NSArray *html; - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/WordTranslation.m b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/WordTranslation.m deleted file mode 100644 index 4a207e967..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/WordTranslation.m +++ /dev/null @@ -1,13 +0,0 @@ -// -// WordTranslation.m -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-06-03. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import "WordTranslation.h" - -@implementation WordTranslation - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/help_content.html b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/help_content.html deleted file mode 100644 index 446df43bb..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/help_content.html +++ /dev/null @@ -1,131 +0,0 @@ -<html> -<body> -</p> -<b>GF Offline Translator</b>: -text and speech translation for 14 languages with -quality control -</p> -<p> -<b>Speech input </b>: Tap microphone icon if available on the keyboard. -<br> -<b>Text input </b>: Select the text box at the bottom on the screen. -<br> -<b>Correction </b>: Tap input text to copy it to the text box. -<br> -<b>Alternatives </b>: Tap output text. -<br> -<b>Grammar info </b>: Tap any of the alternatives. -<br> -<b>Confidence </b>: colour of output text -<ul> -<li> <span style="background-color:palegreen">Green </span>: semantic, probably correct (but has alternatives) </li> -<li> <span style="background-color:yellow">Yellow </span>: syntactic, often incorrect (has alternatives) </li> -<li> <span style="background-color:pink">Light red </span>: chunk-based, probably incorrect (has alternatives) </li> -<li> <span style="background-color:red">Dark red </span>: word-based, often very bad </li> -</ul> -</p> - -<hr> - -<h2>More details</h2> -<p> -GF Offline Translator is based on grammar and semantics. It is compact in size -and gives control on quality. Its technology is inspired by compilers, which are -programs that translate computer languages. -Most other translators for human language are based on -statistics and have less control of quality and are much bigger, so that -they require either an internet connection or a huge storage on your phone. -</p> -The app indicates translation confidence with colours: -<ul> - <li><b>Green</b>: - semantic translation, should be correct. - But not necessarily the only correct one. - You can tap the output to see alternatives. - </li> - <li><b>Yellow</b>: - syntactic translation, should be grammatically correct. - But can be very strange in its interpretation and choice of words. - </li> - <li><b>Light red</b>: - chunk translation, probably incorrect. - Builds the translation from small pieces. - </li> - <li><b>Dark red</b>: - word-by-word translation, almost certainly incorrect. - Builds the translation word by word. - </li> -</ul> -The green translations come from a tourist phrasebook, which allows -you to translate things like "hello" and "how far is the airport from -the hotel". -</p> - -<p> -Translation works between any supported languages, which means 182 -language pairs in the current version. But different languages are on different levels of development. -The following table gives a rough idea of what to expect: -</p> - -<p> -<center> -<table rules=all border=yes> -<tr> <th></th> <th>coverage</th> <th>quality</th> <th>speed</th></tr> -<tr> <th>Bulgarian</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td> <td bgcolor=palegreen></td> </tr> -<tr> <th>Catalan</th> <td bgcolor=pink></td> <td bgcolor=yellow></td> <td bgcolor=pink></td> </tr> -<tr> <th>Chinese</th> <td bgcolor=pink></td> <td bgcolor=pink></td> <td bgcolor=palegreen></td> </tr> -<tr> <th>Dutch</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td> <td bgcolor=yellow></td> </tr> -<tr> <th>English</th> <td bgcolor=palegreen></td> <td bgcolor=palegreen></td> <td bgcolor=palegreen></td> </tr> -<tr> <th>Finnish</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td> <td bgcolor=pink></td> </tr> -<tr> <th>French</th> <td bgcolor=pink></td> <td bgcolor=yellow></td> <td bgcolor=pink></td> </tr> -<tr> <th>German</th> <td bgcolor=pink></td> <td bgcolor=yellow></td> <td bgcolor=pink></td> </tr> -<tr> <th>Hindi</th> <td bgcolor=pink></td> <td bgcolor=red></td> <td bgcolor=yellow></td> </tr> -<tr> <th>Italian</th> <td bgcolor=pink></td> <td bgcolor=pink></td> <td bgcolor=pink></td> </tr> -<tr> <th>Japanese</th> <td bgcolor=pink></td> <td bgcolor=pink></td> <td bgcolor=yellow></td> </tr> -<tr> <th>Spanish</th> <td bgcolor=pink></td> <td bgcolor=yellow></td> <td bgcolor=pink></td> </tr> -<tr> <th>Swedish</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td> <td bgcolor=palegreen></td> </tr> -<tr> <th>Thai</th> <td bgcolor=pink></td> <td bgcolor=red></td> <td bgcolor=yellow></td> </tr> -</table> -</center> -<br> -For <b>Japanse</b> and <b>Thai</b> input, words must be separated with spaces. -</p> - -<p> -When you tap on a translation you get a screen with <b>alternative translations</b>. -Tapping on each of the alternatives -gives you <b>grammatical information</b>: -an inflection table, if it is a single word, -and a syntax tree otherwise. -</p> - -<p> -To make it easier to input what you want to translate it is recommended to add that language keyboard in your settings on your iOS device. -You can add keyboards from Settings > General > Keyboard > Keyboards. - -If more than one language is added, you can change the language while typing. Follow these steps to change the language of your keyboard once you’ve added it: - <li>Tap the globe icon in the lower left corner to choose the next language on your keyboard. The chosen language appears on the Space bar. </li> - <li>Touch and hold the globe icon in the lower left to display a menu of enabled keyboards. Drag to choose a new keyboard. </li> -</p> - -<p> -The translation works <b>completely off-line</b>, without -internet connection, when doing text-based translation. -Speech input needs an connection to work. -</p> - -<p> -The GF Offline Translator is powered by -<a href="http://www.grammaticalframework.org/">GF</a>, Grammatical Framework. -It is open-source software, -built by support from the GF community and from <a href="http://www.digitalgrammars.com/">Digital Grammars</a>. -</p> - -<p> -<i>Digital Grammars is a company that can tailor this app to you needs and provide good -translation for the kind of vocabulary you need. Just tell us what you want to see - in the green area!</i> -</p> - -</body> -</html> diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/main.m b/src/ui/ios/GF-Offline-Translator/GF Offline Translator/main.m deleted file mode 100644 index c1018b339..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline Translator/main.m +++ /dev/null @@ -1,16 +0,0 @@ -// -// main.m -// GF Offline Translator -// -// Created by Cenny Davidsson on 2015-04-27. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import <UIKit/UIKit.h> -#import "AppDelegate.h" - -int main(int argc, char * argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline TranslatorTests/GF_Offline_TranslatorTests.m b/src/ui/ios/GF-Offline-Translator/GF Offline TranslatorTests/GF_Offline_TranslatorTests.m deleted file mode 100644 index 1e514080d..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline TranslatorTests/GF_Offline_TranslatorTests.m +++ /dev/null @@ -1,40 +0,0 @@ -// -// GF_Offline_TranslatorTests.m -// GF Offline TranslatorTests -// -// Created by Cenny Davidsson on 2015-04-27. -// Copyright (c) 2015 Grammatical Framework. All rights reserved. -// - -#import <UIKit/UIKit.h> -#import <XCTest/XCTest.h> - -@interface GF_Offline_TranslatorTests : XCTestCase - -@end - -@implementation GF_Offline_TranslatorTests - -- (void)setUp { - [super setUp]; - // Put setup code here. This method is called before the invocation of each test method in the class. -} - -- (void)tearDown { - // Put teardown code here. This method is called after the invocation of each test method in the class. - [super tearDown]; -} - -- (void)testExample { - // This is an example of a functional test case. - XCTAssert(YES, @"Pass"); -} - -- (void)testPerformanceExample { - // This is an example of a performance test case. - [self measureBlock:^{ - // Put the code you want to measure the time of here. - }]; -} - -@end diff --git a/src/ui/ios/GF-Offline-Translator/GF Offline TranslatorTests/Info.plist b/src/ui/ios/GF-Offline-Translator/GF Offline TranslatorTests/Info.plist deleted file mode 100644 index fe7f434fb..000000000 --- a/src/ui/ios/GF-Offline-Translator/GF Offline TranslatorTests/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleDevelopmentRegion</key> - <string>en</string> - <key>CFBundleExecutable</key> - <string>$(EXECUTABLE_NAME)</string> - <key>CFBundleIdentifier</key> - <string>GF.$(PRODUCT_NAME:rfc1034identifier)</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundleName</key> - <string>$(PRODUCT_NAME)</string> - <key>CFBundlePackageType</key> - <string>BNDL</string> - <key>CFBundleShortVersionString</key> - <string>1.0</string> - <key>CFBundleSignature</key> - <string>????</string> - <key>CFBundleVersion</key> - <string>1</string> -</dict> -</plist> diff --git a/src/ui/ios/GF-Offline-Translator/Podfile b/src/ui/ios/GF-Offline-Translator/Podfile deleted file mode 100644 index 342870005..000000000 --- a/src/ui/ios/GF-Offline-Translator/Podfile +++ /dev/null @@ -1,5 +0,0 @@ -# Uncomment this line to define a global platform for your project -# platform :ios, ’8.0’ - -pod 'SlackTextViewController' - diff --git a/src/ui/ios/GF-Offline-Translator/Podfile.lock b/src/ui/ios/GF-Offline-Translator/Podfile.lock deleted file mode 100644 index e8e8f7caa..000000000 --- a/src/ui/ios/GF-Offline-Translator/Podfile.lock +++ /dev/null @@ -1,10 +0,0 @@ -PODS: - - SlackTextViewController (1.5.2) - -DEPENDENCIES: - - SlackTextViewController - -SPEC CHECKSUMS: - SlackTextViewController: ab240cda4c7fe1f70f6c6cf64578f3fea495ce99 - -COCOAPODS: 0.36.1 diff --git a/src/ui/ios/GF-Offline-Translator/Pods/Manifest.lock b/src/ui/ios/GF-Offline-Translator/Pods/Manifest.lock deleted file mode 100644 index e8e8f7caa..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/Manifest.lock +++ /dev/null @@ -1,10 +0,0 @@ -PODS: - - SlackTextViewController (1.5.2) - -DEPENDENCIES: - - SlackTextViewController - -SPEC CHECKSUMS: - SlackTextViewController: ab240cda4c7fe1f70f6c6cf64578f3fea495ce99 - -COCOAPODS: 0.36.1 diff --git a/src/ui/ios/GF-Offline-Translator/Pods/Pods.xcodeproj/project.pbxproj b/src/ui/ios/GF-Offline-Translator/Pods/Pods.xcodeproj/project.pbxproj deleted file mode 100644 index feb81b1e7..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/Pods.xcodeproj/project.pbxproj +++ /dev/null @@ -1,499 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 07DA840C480DEF98FC6F0E0D /* UIScrollView+SLKAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = F294343CD38A6789868EF3AB /* UIScrollView+SLKAdditions.m */; }; - 16C7AE8DEA0077FB3D896BF0 /* SLKTextView.h in Headers */ = {isa = PBXBuildFile; fileRef = 7055B434E17A758334C4D690 /* SLKTextView.h */; }; - 32678D01710471A868EEF0AE /* SLKUIConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 784A38EF52EB47CE5E03AFEA /* SLKUIConstants.h */; }; - 32A92A492370904FDA401B29 /* UIView+SLKAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 201D11D9F140BA666D2ADC73 /* UIView+SLKAdditions.h */; }; - 42927E531994B740240AD1F8 /* SLKTextViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F0A7CDEDA02B55960040DCE /* SLKTextViewController.h */; }; - 457D66B4156AA1908749B089 /* SLKInputAccessoryView.m in Sources */ = {isa = PBXBuildFile; fileRef = 60EFC05743E457629F6FA3BE /* SLKInputAccessoryView.m */; }; - 5D47E178549F6D3808494181 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B41EF424A850AF9597402D7B /* Foundation.framework */; }; - 5EC3EF97656A41D44CF363B4 /* SLKTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = FAB2A620AECF49DF8EC027EB /* SLKTextView.m */; }; - 63EEAE6BC1F6324007967880 /* UIView+SLKAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = E91CE9439FF285A3B1918133 /* UIView+SLKAdditions.m */; }; - 8276AAEEBBAF4FEE31EEF70A /* SLKTypingIndicatorView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F3B904D76A0932EDC0DDC6C /* SLKTypingIndicatorView.h */; }; - 8F8598074DC5378DE846D9F7 /* SLKTextInputbar.h in Headers */ = {isa = PBXBuildFile; fileRef = CDD2299FFE62AC33DD5F6F21 /* SLKTextInputbar.h */; }; - A20C8CD4FA62A08EA32FB320 /* Pods-SlackTextViewController-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = A33FBE323AB331AA8305AE77 /* Pods-SlackTextViewController-dummy.m */; }; - A7A374D1CD4744F4774FAD99 /* SLKTextView+SLKAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 2630AA286F47284320CEDD6D /* SLKTextView+SLKAdditions.h */; }; - A891E95D7B87B4E183738431 /* SLKTypingIndicatorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 172242421980D777AB0996D9 /* SLKTypingIndicatorView.m */; }; - B294EBBAAA27FB04D4FE8DE0 /* Pods-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = E8468D560351CE3CFD012400 /* Pods-dummy.m */; }; - BF4B84A5AA10198C93EF73AB /* SLKTextView+SLKAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E88530B4D45296016366C45 /* SLKTextView+SLKAdditions.m */; }; - D484455BB70A68645DA6474A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B41EF424A850AF9597402D7B /* Foundation.framework */; }; - DAB3B22291DFA7F6D080EE66 /* UIResponder+SLKAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3ADF674E34301784035DA916 /* UIResponder+SLKAdditions.m */; }; - E8035C87DFD1E736BE9CCD9A /* SLKInputAccessoryView.h in Headers */ = {isa = PBXBuildFile; fileRef = EAF2276CEA5924314C150535 /* SLKInputAccessoryView.h */; }; - F1221A6E5E840FB484D12BFD /* UIResponder+SLKAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9827A079F152A80A7F332466 /* UIResponder+SLKAdditions.h */; }; - F3F121D9C25CBF2C8C5CB6FD /* SLKTextInputbar.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FF5C109F0F229E7A27AE4D5 /* SLKTextInputbar.m */; }; - FA0F22AE0A83CE07B10A234A /* SLKTextViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1930DF3ED38A6053FBBC8322 /* SLKTextViewController.m */; }; - FB64B1B87CE3B6BBF828598E /* UIScrollView+SLKAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = B66AACC28C7F958977E64248 /* UIScrollView+SLKAdditions.h */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 542E4E1AA94F676B09AEE37B /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 8B26729A3C6DF0B6B83B55BB /* Project object */; - proxyType = 1; - remoteGlobalIDString = BB9541CC3748C1191DEF8D25; - remoteInfo = "Pods-SlackTextViewController"; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 0E88530B4D45296016366C45 /* SLKTextView+SLKAdditions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "SLKTextView+SLKAdditions.m"; path = "Source/Additions/SLKTextView+SLKAdditions.m"; sourceTree = "<group>"; }; - 15722C6B56D29EE5F9D7B918 /* Pods-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-acknowledgements.markdown"; sourceTree = "<group>"; }; - 172242421980D777AB0996D9 /* SLKTypingIndicatorView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SLKTypingIndicatorView.m; path = Source/Classes/SLKTypingIndicatorView.m; sourceTree = "<group>"; }; - 1930DF3ED38A6053FBBC8322 /* SLKTextViewController.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SLKTextViewController.m; path = Source/Classes/SLKTextViewController.m; sourceTree = "<group>"; }; - 1B88B007510869623C9B933B /* Pods-SlackTextViewController.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SlackTextViewController.xcconfig"; sourceTree = "<group>"; }; - 1F0A7CDEDA02B55960040DCE /* SLKTextViewController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SLKTextViewController.h; path = Source/Classes/SLKTextViewController.h; sourceTree = "<group>"; }; - 1F3B904D76A0932EDC0DDC6C /* SLKTypingIndicatorView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SLKTypingIndicatorView.h; path = Source/Classes/SLKTypingIndicatorView.h; sourceTree = "<group>"; }; - 201D11D9F140BA666D2ADC73 /* UIView+SLKAdditions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+SLKAdditions.h"; path = "Source/Additions/UIView+SLKAdditions.h"; sourceTree = "<group>"; }; - 2630AA286F47284320CEDD6D /* SLKTextView+SLKAdditions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "SLKTextView+SLKAdditions.h"; path = "Source/Additions/SLKTextView+SLKAdditions.h"; sourceTree = "<group>"; }; - 2ECB69507C18B14A1DD3CE5E /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.debug.xcconfig; sourceTree = "<group>"; }; - 3665C875F733140A55AD452B /* Podfile */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - 383F6CE99248AAF4C3B60881 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.release.xcconfig; sourceTree = "<group>"; }; - 3ADF674E34301784035DA916 /* UIResponder+SLKAdditions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIResponder+SLKAdditions.m"; path = "Source/Additions/UIResponder+SLKAdditions.m"; sourceTree = "<group>"; }; - 3D3783BDE4D26D1475521002 /* Pods-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-resources.sh"; sourceTree = "<group>"; }; - 4449CD8C2533D423CEE6B594 /* libPods-SlackTextViewController.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SlackTextViewController.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 60EFC05743E457629F6FA3BE /* SLKInputAccessoryView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SLKInputAccessoryView.m; path = Source/Classes/SLKInputAccessoryView.m; sourceTree = "<group>"; }; - 6591BD5CAF7C70A208E5C5DB /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 7055B434E17A758334C4D690 /* SLKTextView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SLKTextView.h; path = Source/Classes/SLKTextView.h; sourceTree = "<group>"; }; - 784A38EF52EB47CE5E03AFEA /* SLKUIConstants.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SLKUIConstants.h; path = Source/Additions/SLKUIConstants.h; sourceTree = "<group>"; }; - 9827A079F152A80A7F332466 /* UIResponder+SLKAdditions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIResponder+SLKAdditions.h"; path = "Source/Additions/UIResponder+SLKAdditions.h"; sourceTree = "<group>"; }; - 9C15325AC04364EFC436831E /* Pods-SlackTextViewController-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SlackTextViewController-prefix.pch"; sourceTree = "<group>"; }; - 9FF5C109F0F229E7A27AE4D5 /* SLKTextInputbar.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SLKTextInputbar.m; path = Source/Classes/SLKTextInputbar.m; sourceTree = "<group>"; }; - A33FBE323AB331AA8305AE77 /* Pods-SlackTextViewController-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SlackTextViewController-dummy.m"; sourceTree = "<group>"; }; - A5535153937D8E4BC12C7188 /* Pods-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-acknowledgements.plist"; sourceTree = "<group>"; }; - B1C30DBE70E62F5C3FEF4944 /* Pods-SlackTextViewController-Private.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SlackTextViewController-Private.xcconfig"; sourceTree = "<group>"; }; - B41EF424A850AF9597402D7B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - B66AACC28C7F958977E64248 /* UIScrollView+SLKAdditions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIScrollView+SLKAdditions.h"; path = "Source/Additions/UIScrollView+SLKAdditions.h"; sourceTree = "<group>"; }; - CDD2299FFE62AC33DD5F6F21 /* SLKTextInputbar.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SLKTextInputbar.h; path = Source/Classes/SLKTextInputbar.h; sourceTree = "<group>"; }; - E8468D560351CE3CFD012400 /* Pods-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-dummy.m"; sourceTree = "<group>"; }; - E91CE9439FF285A3B1918133 /* UIView+SLKAdditions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIView+SLKAdditions.m"; path = "Source/Additions/UIView+SLKAdditions.m"; sourceTree = "<group>"; }; - EAF2276CEA5924314C150535 /* SLKInputAccessoryView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SLKInputAccessoryView.h; path = Source/Classes/SLKInputAccessoryView.h; sourceTree = "<group>"; }; - F294343CD38A6789868EF3AB /* UIScrollView+SLKAdditions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIScrollView+SLKAdditions.m"; path = "Source/Additions/UIScrollView+SLKAdditions.m"; sourceTree = "<group>"; }; - F66D65D2DDA9DCEB56C74350 /* Pods-environment.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-environment.h"; sourceTree = "<group>"; }; - FAB2A620AECF49DF8EC027EB /* SLKTextView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SLKTextView.m; path = Source/Classes/SLKTextView.m; sourceTree = "<group>"; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - C4247E842C0701BB7FF50710 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - D484455BB70A68645DA6474A /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - FBE955E2F286A978C3471329 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 5D47E178549F6D3808494181 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 04FBB9A3894582C5C79339A6 /* Support Files */ = { - isa = PBXGroup; - children = ( - 1B88B007510869623C9B933B /* Pods-SlackTextViewController.xcconfig */, - B1C30DBE70E62F5C3FEF4944 /* Pods-SlackTextViewController-Private.xcconfig */, - A33FBE323AB331AA8305AE77 /* Pods-SlackTextViewController-dummy.m */, - 9C15325AC04364EFC436831E /* Pods-SlackTextViewController-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/Pods-SlackTextViewController"; - sourceTree = "<group>"; - }; - 413C40B15216709EE64D28AF /* Pods */ = { - isa = PBXGroup; - children = ( - 15722C6B56D29EE5F9D7B918 /* Pods-acknowledgements.markdown */, - A5535153937D8E4BC12C7188 /* Pods-acknowledgements.plist */, - E8468D560351CE3CFD012400 /* Pods-dummy.m */, - F66D65D2DDA9DCEB56C74350 /* Pods-environment.h */, - 3D3783BDE4D26D1475521002 /* Pods-resources.sh */, - 2ECB69507C18B14A1DD3CE5E /* Pods.debug.xcconfig */, - 383F6CE99248AAF4C3B60881 /* Pods.release.xcconfig */, - ); - name = Pods; - path = "Target Support Files/Pods"; - sourceTree = "<group>"; - }; - 427BECA3398D88D929354AB6 /* Products */ = { - isa = PBXGroup; - children = ( - 6591BD5CAF7C70A208E5C5DB /* libPods.a */, - 4449CD8C2533D423CEE6B594 /* libPods-SlackTextViewController.a */, - ); - name = Products; - sourceTree = "<group>"; - }; - 7DE09A3B7A1C6B5C8C44A7EF /* Targets Support Files */ = { - isa = PBXGroup; - children = ( - 413C40B15216709EE64D28AF /* Pods */, - ); - name = "Targets Support Files"; - sourceTree = "<group>"; - }; - 9CFAE8514509E6C3EF2B39B3 /* SlackTextViewController */ = { - isa = PBXGroup; - children = ( - EAF2276CEA5924314C150535 /* SLKInputAccessoryView.h */, - 60EFC05743E457629F6FA3BE /* SLKInputAccessoryView.m */, - CDD2299FFE62AC33DD5F6F21 /* SLKTextInputbar.h */, - 9FF5C109F0F229E7A27AE4D5 /* SLKTextInputbar.m */, - 7055B434E17A758334C4D690 /* SLKTextView.h */, - FAB2A620AECF49DF8EC027EB /* SLKTextView.m */, - 2630AA286F47284320CEDD6D /* SLKTextView+SLKAdditions.h */, - 0E88530B4D45296016366C45 /* SLKTextView+SLKAdditions.m */, - 1F0A7CDEDA02B55960040DCE /* SLKTextViewController.h */, - 1930DF3ED38A6053FBBC8322 /* SLKTextViewController.m */, - 1F3B904D76A0932EDC0DDC6C /* SLKTypingIndicatorView.h */, - 172242421980D777AB0996D9 /* SLKTypingIndicatorView.m */, - 784A38EF52EB47CE5E03AFEA /* SLKUIConstants.h */, - 9827A079F152A80A7F332466 /* UIResponder+SLKAdditions.h */, - 3ADF674E34301784035DA916 /* UIResponder+SLKAdditions.m */, - B66AACC28C7F958977E64248 /* UIScrollView+SLKAdditions.h */, - F294343CD38A6789868EF3AB /* UIScrollView+SLKAdditions.m */, - 201D11D9F140BA666D2ADC73 /* UIView+SLKAdditions.h */, - E91CE9439FF285A3B1918133 /* UIView+SLKAdditions.m */, - 04FBB9A3894582C5C79339A6 /* Support Files */, - ); - path = SlackTextViewController; - sourceTree = "<group>"; - }; - B0D42594583157D20C51E87F /* Frameworks */ = { - isa = PBXGroup; - children = ( - F23F1F60BEAD735BCE6E238B /* iOS */, - ); - name = Frameworks; - sourceTree = "<group>"; - }; - B1E0B2AD9C1688CCAC638A01 = { - isa = PBXGroup; - children = ( - 3665C875F733140A55AD452B /* Podfile */, - B0D42594583157D20C51E87F /* Frameworks */, - D87B3D79ED4806259DDDFEF6 /* Pods */, - 427BECA3398D88D929354AB6 /* Products */, - 7DE09A3B7A1C6B5C8C44A7EF /* Targets Support Files */, - ); - sourceTree = "<group>"; - }; - D87B3D79ED4806259DDDFEF6 /* Pods */ = { - isa = PBXGroup; - children = ( - 9CFAE8514509E6C3EF2B39B3 /* SlackTextViewController */, - ); - name = Pods; - sourceTree = "<group>"; - }; - F23F1F60BEAD735BCE6E238B /* iOS */ = { - isa = PBXGroup; - children = ( - B41EF424A850AF9597402D7B /* Foundation.framework */, - ); - name = iOS; - sourceTree = "<group>"; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 03F7BD4F1B88344408E38DE6 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - E8035C87DFD1E736BE9CCD9A /* SLKInputAccessoryView.h in Headers */, - 8F8598074DC5378DE846D9F7 /* SLKTextInputbar.h in Headers */, - A7A374D1CD4744F4774FAD99 /* SLKTextView+SLKAdditions.h in Headers */, - 16C7AE8DEA0077FB3D896BF0 /* SLKTextView.h in Headers */, - 42927E531994B740240AD1F8 /* SLKTextViewController.h in Headers */, - 8276AAEEBBAF4FEE31EEF70A /* SLKTypingIndicatorView.h in Headers */, - 32678D01710471A868EEF0AE /* SLKUIConstants.h in Headers */, - F1221A6E5E840FB484D12BFD /* UIResponder+SLKAdditions.h in Headers */, - FB64B1B87CE3B6BBF828598E /* UIScrollView+SLKAdditions.h in Headers */, - 32A92A492370904FDA401B29 /* UIView+SLKAdditions.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - B54EC4326501540DDBBC9B97 /* Pods */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4B82C4FC01672BAF03F56AB0 /* Build configuration list for PBXNativeTarget "Pods" */; - buildPhases = ( - 7DE96EAA3669261071BAD3E4 /* Sources */, - FBE955E2F286A978C3471329 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - B75877BB9EA23200B958B82E /* PBXTargetDependency */, - ); - name = Pods; - productName = Pods; - productReference = 6591BD5CAF7C70A208E5C5DB /* libPods.a */; - productType = "com.apple.product-type.library.static"; - }; - BB9541CC3748C1191DEF8D25 /* Pods-SlackTextViewController */ = { - isa = PBXNativeTarget; - buildConfigurationList = D7E02682B457EF6A6280F9AE /* Build configuration list for PBXNativeTarget "Pods-SlackTextViewController" */; - buildPhases = ( - 2D95483827EDDA158405C5A3 /* Sources */, - C4247E842C0701BB7FF50710 /* Frameworks */, - 03F7BD4F1B88344408E38DE6 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "Pods-SlackTextViewController"; - productName = "Pods-SlackTextViewController"; - productReference = 4449CD8C2533D423CEE6B594 /* libPods-SlackTextViewController.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 8B26729A3C6DF0B6B83B55BB /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0510; - }; - buildConfigurationList = 8E9027938227B7173C82EA14 /* Build configuration list for PBXProject "Pods" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = B1E0B2AD9C1688CCAC638A01; - productRefGroup = 427BECA3398D88D929354AB6 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - B54EC4326501540DDBBC9B97 /* Pods */, - BB9541CC3748C1191DEF8D25 /* Pods-SlackTextViewController */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 2D95483827EDDA158405C5A3 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - A20C8CD4FA62A08EA32FB320 /* Pods-SlackTextViewController-dummy.m in Sources */, - 457D66B4156AA1908749B089 /* SLKInputAccessoryView.m in Sources */, - F3F121D9C25CBF2C8C5CB6FD /* SLKTextInputbar.m in Sources */, - BF4B84A5AA10198C93EF73AB /* SLKTextView+SLKAdditions.m in Sources */, - 5EC3EF97656A41D44CF363B4 /* SLKTextView.m in Sources */, - FA0F22AE0A83CE07B10A234A /* SLKTextViewController.m in Sources */, - A891E95D7B87B4E183738431 /* SLKTypingIndicatorView.m in Sources */, - DAB3B22291DFA7F6D080EE66 /* UIResponder+SLKAdditions.m in Sources */, - 07DA840C480DEF98FC6F0E0D /* UIScrollView+SLKAdditions.m in Sources */, - 63EEAE6BC1F6324007967880 /* UIView+SLKAdditions.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 7DE96EAA3669261071BAD3E4 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - B294EBBAAA27FB04D4FE8DE0 /* Pods-dummy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - B75877BB9EA23200B958B82E /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "Pods-SlackTextViewController"; - target = BB9541CC3748C1191DEF8D25 /* Pods-SlackTextViewController */; - targetProxy = 542E4E1AA94F676B09AEE37B /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 2052550A748A76EA30695CE5 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2ECB69507C18B14A1DD3CE5E /* Pods.debug.xcconfig */; - buildSettings = { - ENABLE_STRICT_OBJC_MSGSEND = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 26FB7D7741DD11D9B15ADF7F /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 383F6CE99248AAF4C3B60881 /* Pods.release.xcconfig */; - buildSettings = { - ENABLE_STRICT_OBJC_MSGSEND = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 603F72B2BF325C2D14018DA6 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = "RELEASE=1"; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 940B952B180C96F7963E6571 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = B1C30DBE70E62F5C3FEF4944 /* Pods-SlackTextViewController-Private.xcconfig */; - buildSettings = { - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_PREFIX_HEADER = "Target Support Files/Pods-SlackTextViewController/Pods-SlackTextViewController-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - A18066350F539C6D0471BE6B /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = B1C30DBE70E62F5C3FEF4944 /* Pods-SlackTextViewController-Private.xcconfig */; - buildSettings = { - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_PREFIX_HEADER = "Target Support Files/Pods-SlackTextViewController/Pods-SlackTextViewController-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - B1FB22DD2936B88C267CABCD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - ONLY_ACTIVE_ARCH = YES; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; - }; - name = Debug; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 4B82C4FC01672BAF03F56AB0 /* Build configuration list for PBXNativeTarget "Pods" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 2052550A748A76EA30695CE5 /* Debug */, - 26FB7D7741DD11D9B15ADF7F /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 8E9027938227B7173C82EA14 /* Build configuration list for PBXProject "Pods" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - B1FB22DD2936B88C267CABCD /* Debug */, - 603F72B2BF325C2D14018DA6 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - D7E02682B457EF6A6280F9AE /* Build configuration list for PBXNativeTarget "Pods-SlackTextViewController" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 940B952B180C96F7963E6571 /* Debug */, - A18066350F539C6D0471BE6B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 8B26729A3C6DF0B6B83B55BB /* Project object */; -} diff --git a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/LICENSE b/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/LICENSE deleted file mode 100644 index 5445d843e..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ - - Copyright 2015 Slack Technologies, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/README.md b/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/README.md deleted file mode 100644 index 777d9ea0b..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/README.md +++ /dev/null @@ -1,324 +0,0 @@ -#SlackTextViewController - -[](https://travis-ci.org/slackhq/SlackTextViewController) -[](https://coveralls.io/r/slackhq/SlackTextViewController) - -[](https://cocoadocs.org/docsets/SlackTextViewController) -[](https://github.com/Carthage/Carthage) -[](http://opensource.org/licenses/Apache2.0) - - -A drop-in UIViewController subclass with a growing text input view and other useful messaging features. Meant to be a replacement for UITableViewController & UICollectionViewController. - - - -This library is used in Slack's iOS app. It was built to fit our needs, but is flexible enough to be reused by others wanting to build great messaging apps for iOS. - -## Features - -### Core -- Works out of the box with [UITableView or UICollectionView or UIScrollView](https://github.com/slackhq/SlackTextViewController/tree/swift-example#subclassing) -- [Growing Text View](https://github.com/slackhq/SlackTextViewController#growing-text-view), with line count limit support -- Flexible UI built with Auto Layout -- Customizable: provides left and right button, and toolbar outlets -- Tap Gesture for dismissing the keyboard -- [Panning Gesture](https://github.com/slackhq/SlackTextViewController#panning-gesture) for sliding down the keyboard -- [External keyboard](https://github.com/slackhq/SlackTextViewController#external-keyboard) commands support -- Undo/Redo (with keyboard commands and UIMenuController) -- Text Appending APIs - -### Optional -- [Autocomplete Mode](https://github.com/slackhq/SlackTextViewController#autocompletion) by registering any prefix key (`@`, `#`, `/`) -- [Edit Mode](https://github.com/slackhq/SlackTextViewController#edit-mode) -- [Typing Indicator](https://github.com/slackhq/SlackTextViewController#typing-indicator) display -- [Shake Gesture](https://github.com/slackhq/SlackTextViewController#shake-gesture) for clearing text view -- Multimedia Pasting (png, gif, mov, etc.) -- [Inverted Mode](https://github.com/slackhq/SlackTextViewController#inverted-mode) for displaying cells upside-down (using CATransform) -- a necessary hack for some messaging apps. `YES` by default, so beware, your entire cells might be flipped! -- Bouncy Animations - -### Compatibility -- Swift: [A sample project is available in a different branch] (https://github.com/slackhq/SlackTextViewController/tree/swift-example) -- iOS 7 & 8 -- iPhone & iPad -- [Storyboard](https://github.com/slackhq/SlackTextViewController#storyboard) -- UIPopOverController & UITabBarController -- Container View Controller -- Auto-Rotation -- Localization - -## Installation - -###### With [Cocoa Pods](http://cocoapods.org): -```ruby -pod 'SlackTextViewController' -``` - -###### With [Carthage](https://github.com/Carthage/Carthage): -``` -github "slackhq/SlackTextViewController" -``` - -###### Manually: -There are two ways to do this: -- Copy and drag the `Source/` folder to your project. -- or compile the project located in `Builder/SlackTextViewController.xcodeproj` to create a `SlackTextViewController.framework` package. You could also [link the library into your project](https://developer.apple.com/library/ios/recipes/xcode_help-project_editor/Articles/AddingaLibrarytoaTarget.html#//apple_ref/doc/uid/TP40010155-CH17-SW1). - -##How to use - -###Subclassing -`SLKTextViewController` is meant to be subclassed, like you would normally do with UITableViewController or UICollectionViewController or UIScrollView. This pattern is a convenient way of extending UIViewController. SlackTextViewController manages a lot behind the scenes while still providing the ability to add custom behaviours. You may override methods, and decide to call super and perform additional logic, or not to call super and override default logic. - -Start by creating a new subclass of `SLKTextViewController`. - -In the init overriding method, if you wish to use the `UITableView` version, call: -```objc -[super initWithTableViewStyle:UITableViewStylePlain] -``` - -or the `UICollectionView` version: -```objc -[super initWithCollectionViewLayout:[UICollectionViewFlowLayout new]] -``` - -or the `UIScrollView` version: -```objc -[super initWithScrollView:self.myStrongScrollView] -``` - - -Protocols like `UITableViewDelegate` and `UITableViewDataSource` are already setup for you. You will be able to call whatever delegate and data source methods you need for customising your control. - -Calling `[super init]` will call `[super initWithTableViewStyle:UITableViewStylePlain]` by default. - - -###Growing Text View - - - -The text view expands automatically when a new line is required, until it reaches its `maxNumberOfLines`value. You may change this property's value in the textView. - -By default, the number of lines is set to best fit each device dimensions: -- iPhone 4 (<=480pts): 4 lines -- iPhone 5/6 (>=568pts): 6 lines -- iPad (>=768pts): 8 lines - -On iPhone devices, in landscape orientation, the maximum number of lines is changed to fit the available space. - -###Autocompletion - -We use autocompletion for many things: names, channels, emoji, and more. - - - -To set up autocompletion in your app, follow these simple steps: - -#### 1. Registration -You must first register all the prefixes you'd like to support for autocompletion detection: -````objc -[self registerPrefixesForAutoCompletion:@[@"#"]]; -```` - -#### 2. Processing -Every time a new character is inserted in the text view, the nearest word to the caret will be processed and verified if it contains any of the registered prefixes. - -Once the prefix has been detected, `-canShowAutoCompletion` will be called. This is the perfect place to populate your data source, and return a BOOL if the autocompletion view should actually be shown. So you must override it in your subclass, to be able to perform additional tasks. Default returns NO. - -````objc -- (BOOL)canShowAutoCompletion -{ - NSString *prefix = self.foundPrefix; - NSString *word = self.foundWord; - - self.searchResult = [[NSArray alloc] initWithArray:self.channels]; - - if ([prefix isEqualToString:@"#"]) - { - if (word.length > 0) { - self.searchResult = [self.searchResult filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"self BEGINSWITH[c] %@ AND self !=[c] %@", word, word]]; - } - } - - if (self.searchResult.count > 0) { - self.searchResult = [self.searchResult sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)]; - } - - return self.searchResult.count > 0; -} -```` - -The autocompletion view is a `UITableView` instance, so you will need to use `UITableViewDataSource` to populate its cells. You have complete freedom for customizing the cells. - -You don't need to call `-reloadData` yourself, since it will be called automatically if you return `YES` in `-canShowAutoCompletion` method. - -#### 3. Layout - -The maximum height of the autocompletion view is set to 140 pts by default. You can update this value anytime, so the view automatically adjusts based on the amount of displayed cells. - -````objc -- (CGFloat)heightForAutoCompletionView -{ - CGFloat cellHeight = 34.0; - return cellHeight*self.searchResult.count; -} -```` - -#### 4. Confirmation - -If the user selects any autocompletion view cell on `-tableView:didSelectRowAtIndexPath:`, you must call `-acceptAutoCompletionWithString:` to commit autocompletion. That method expects a string matching the selected item, that you would like to be inserted in the text view. - -`````objc -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath -{ - if ([tableView isEqual:self.autoCompletionView]) { - - NSString *item = self.searchResult[indexPath.row]; - - [self acceptAutoCompletionWithString:item]; - } -} -```` - -The autocompletion view will automatically be dismissed and the chosen string will be inserted in the text view, replacing the detected prefix and word. - -You can always call `-cancelAutoCompletion` to exit the autocompletion mode and refresh the UI. - - -###Edit Mode - - - -To enable edit mode, you simply need to call `[self editText:@"hello"];`, and the text input will switch to edit mode, removing both left and right buttons, extending the input bar a bit higher with "Accept" and "Cancel" buttons. Both of this buttons are accessible in the `SLKTextInputbar` instance for customisation. - -To capture the "Accept" or "Cancel" events, you must override the following methods. - -````objc -- (void)didCommitTextEditing:(id)sender -{ - NSString *message = [self.textView.text copy]; - - [self.messages removeObjectAtIndex:0]; - [self.messages insertObject:message atIndex:0]; - [self.tableView reloadData]; - - [super didCommitTextEditing:sender]; -} - -- (void)didCancelTextEditing:(id)sender -{ - [super didCancelTextEditing:sender]; -} -```` - -Notice that you must call `super` at some point, so the text input exits the edit mode, re-adjusting the layout and clearing the text view. -Use the `editing` property to know if the editing mode is on. - - -###Typing Indicator - - - -Optionally, you can enable a simple typing indicator, which will be displayed right above the text input. It shows the name of the people that are typing, and if more than 2, it will display "Several are typing" message. - -To enable the typing indicator, just call `[self.typingIndicatorView insertUsername:@"John"];` and the view will automatically be animated on top of the text input. After a default interval of 6 seconds, if the same name hasn't been assigned once more, the view will be dismissed with animation. - -You can remove names from the list by calling `[self.typingIndicatorView removeUsername:@"John"];` - -You can also dismiss it by calling `[self.typingIndicatorView dismissIndicator];` - -###Panning Gesture - -Dismissing the keyboard with a panning gesture is enabled by default with the `keyboardPanningEnabled` property. You can always disable it if you'd like. - -###Shake Gesture - - - -A shake gesture to clear text is enabled by default with the `undoShakingEnabled` property. - -You can optionally override `-willRequestUndo`, to implement your UI to ask the users if he would like to clean the text view's text. If there is not text entered, the method will not be called. - -If you don't override `-willRequestUndo` and `undoShakingEnabled` is set to `YES`, a system UIAlertView will prompt. - -###Inverted Mode - -Some UITableView layouts may require that new messages enter from bottom to top. To enable this, you must use the `inverted` flag property. This will actually invert the UITableView or UICollectionView, so you will need to do a transform adjustment in your UITableViewDataSource method `-tableView:cellForRowAtIndexPath:` for the cells to show correctly. - -````objc -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath -{ - UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:chatCellIdentifier]; - - // Cells must inherit the table view's transform - // This is very important, since the main table view may be inverted - cell.transform = self.tableView.transform; -} -```` - -###External Keyboard - -There a few basic key commands enabled by default: -- cmd + z -> undo -- shift + cmd + z -> redo -- return key -> calls `-didPressRightButton:`, or `-didCommitTextEditing:` if in edit mode -- shift/cmd + return key -> line break -- escape key -> exits edit mode, or auto-completion mode, or dismisses the keyboard -- up & down arrows -> vertical cursor movement - -To add additional key commands, simply override `-keyCommands` and append `super`'s array. - -`````objc -- (NSArray *)keyCommands -{ - NSMutableArray *commands = [NSMutableArray arrayWithArray:[super keyCommands]]; - - // Edit last message - [commands addObject:[UIKeyCommand keyCommandWithInput:UIKeyInputUpArrow - modifierFlags:0 - action:@selector(editLastMessage:)]]; - - return commands; -} -```` - -##Storyboard - -When using SlackTextViewController with storyboards, instead of overriding the traditional `initWithCoder:` you will need to override any of the two custom methods below. This approach helps preserving the exact same features from the programatic approach, but also limits the edition of the nib of your `SLKTextViewController` subclass since it doesn't layout subviews from the nib (subviews are still initialized and layed out programatically). - -if you wish to use the `UITableView` version, call: -```objc -+ (UITableViewStyle)tableViewStyleForCoder:(NSCoder *)decoder -{ - return UITableViewStylePlain; -} -``` - -or the `UICollectionView` version: -```objc -+ (UICollectionViewLayout *)collectionViewLayoutForCoder:(NSCoder *)decoder -{ - return [UICollectionViewFlowLayout new]; -} -``` - - -##Sample Project - -Check out the sample project, everything is demo'd there. -There are 2 main examples (different targets) for testing the programatic and storyboard approaches. - -A CollectionView example, using Swift, is in progress on the `swift-example` branch. The idea with this project is to build a custom collection view layout allowing to display cells from the bottom (currently working but needs serious tweaks to make it perfect). -Feel free to contribute! - - -##XCode Templates - - - -We have prepared a set of useful XCode templates so you can quickly start using SlackTextViewController. - -To install them, open up your terminal and type: -```bash -sh ./SlackTextViewController/File\ Templates/install.sh -``` - -These templates are also available in [Alcatraz](https://github.com/supermarin/Alcatraz). diff --git a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/SLKTextView+SLKAdditions.h b/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/SLKTextView+SLKAdditions.h deleted file mode 100644 index 13a058323..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/SLKTextView+SLKAdditions.h +++ /dev/null @@ -1,80 +0,0 @@ -// -// Copyright 2014 Slack Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import "SLKTextView.h" - -/** @name SLKTextView additional features used for SlackTextViewController. */ -@interface SLKTextView (SLKAdditions) - -/** - Clears the text. - - @param clearUndo YES if clearing the text should also clear the undo manager (if enabled). - */ -- (void)slk_clearText:(BOOL)clearUndo; - -/** - Scrolls to the very end of the content size, animated. - - @param animated YES if the scrolling should be animated. - */ -- (void)slk_scrollToBottomAnimated:(BOOL)animated; - -/** - Scrolls to the caret position, animated. - - @param animated YES if the scrolling should be animated. - */ -- (void)slk_scrollToCaretPositonAnimated:(BOOL)animated; - -/** - Inserts a line break at the caret's position. - */ -- (void)slk_insertNewLineBreak; - -/** - Inserts a string at the caret's position. - - @param text The string to be appended to the current text. - */ -- (void)slk_insertTextAtCaretRange:(NSString *)text; - -/** - Adds a string to a specific range. - - @param text The string to be appended to the current text. - @param range The range where to insert text. - - @return The range of the newly inserted text. - */ -- (NSRange)slk_insertText:(NSString *)text inRange:(NSRange)range; - -/** - Finds the word close to the caret's position, if any. - - @param range Returns the range of the found word. - @returns The found word. - */ -- (NSString *)slk_wordAtCaretRange:(NSRangePointer)range; - -/** - Registers the current text for future undo actions. - - @param description A simple description associated with the Undo or Redo command. - */ -- (void)slk_prepareForUndo:(NSString *)description; - -@end diff --git a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/SLKTextView+SLKAdditions.m b/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/SLKTextView+SLKAdditions.m deleted file mode 100644 index 03826d242..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/SLKTextView+SLKAdditions.m +++ /dev/null @@ -1,170 +0,0 @@ -// -// Copyright 2014 Slack Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import "SLKTextView+SLKAdditions.h" - -@implementation SLKTextView (SLKAdditions) - -- (void)slk_clearText:(BOOL)clearUndo -{ - // Important to call self implementation, as SLKTextView overrides setText: to add additional features. - [self setText:nil]; - - if (self.undoManagerEnabled && clearUndo) { - [self.undoManager removeAllActions]; - } -} - -- (void)slk_scrollToCaretPositonAnimated:(BOOL)animated -{ - if (animated) { - [self scrollRangeToVisible:self.selectedRange]; - } - else { - [UIView performWithoutAnimation:^{ - [self scrollRangeToVisible:self.selectedRange]; - }]; - } -} - -- (void)slk_scrollToBottomAnimated:(BOOL)animated -{ - CGRect rect = [self caretRectForPosition:self.selectedTextRange.end]; - rect.size.height += self.textContainerInset.bottom; - - if (animated) { - [self scrollRectToVisible:rect animated:animated]; - } - else { - [UIView performWithoutAnimation:^{ - [self scrollRectToVisible:rect animated:NO]; - }]; - } -} - -- (void)slk_insertNewLineBreak -{ - [self slk_insertTextAtCaretRange:@"\n"]; - - // if the text view cannot expand anymore, scrolling to bottom are not animated to fix a UITextView issue scrolling twice. - BOOL animated = !self.isExpanding; - - //Detected break. Should scroll to bottom if needed. - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.0125 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [self slk_scrollToBottomAnimated:animated]; - }); -} - -- (void)slk_insertTextAtCaretRange:(NSString *)text -{ - NSRange range = [self slk_insertText:text inRange:self.selectedRange]; - self.selectedRange = NSMakeRange(range.location, 0); -} - -- (NSRange)slk_insertText:(NSString *)text inRange:(NSRange)range -{ - // Skip if the text is empty - if (text.length == 0) { - return NSMakeRange(0, 0); - } - - // Registers for undo management - [self slk_prepareForUndo:@"Text appending"]; - - // Append the new string at the caret position - if (range.length == 0) - { - NSString *leftString = [self.text substringToIndex:range.location]; - NSString *rightString = [self.text substringFromIndex: range.location]; - - self.text = [NSString stringWithFormat:@"%@%@%@", leftString, text, rightString]; - - range.location += [text length]; - return range; - } - // Some text is selected, so we replace it with the new text - else if (range.location != NSNotFound && range.length > 0) - { - self.text = [self.text stringByReplacingCharactersInRange:range withString:text]; - - return NSMakeRange(range.location+[self.text rangeOfString:text].length, text.length); - } - - // No text has been inserted, but still return the caret range - return self.selectedRange; -} - -- (NSString *)slk_wordAtCaretRange:(NSRangePointer)range -{ - return [self slk_wordAtRange:self.selectedRange rangeInText:range]; -} - -- (NSString *)slk_wordAtRange:(NSRange)range rangeInText:(NSRangePointer)rangePointer -{ - NSString *text = self.text; - NSInteger location = range.location; - - // Aborts in case minimum requieres are not fufilled - if (text.length == 0 || location < 0 || (range.location+range.length) > text.length) { - *rangePointer = NSMakeRange(0, 0); - return nil; - } - - NSString *leftPortion = [text substringToIndex:location]; - NSArray *leftComponents = [leftPortion componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; - NSString *leftWordPart = [leftComponents lastObject]; - - NSString *rightPortion = [text substringFromIndex:location]; - NSArray *rightComponents = [rightPortion componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; - NSString *rightPart = [rightComponents firstObject]; - - if (location > 0) { - NSString *characterBeforeCursor = [text substringWithRange:NSMakeRange(location-1, 1)]; - - if ([characterBeforeCursor isEqualToString:@" "]) { - // At the start of a word, just use the word behind the cursor for the current word - *rangePointer = NSMakeRange(location, rightPart.length); - - return rightPart; - } - } - - // In the middle of a word, so combine the part of the word before the cursor, and after the cursor to get the current word - *rangePointer = NSMakeRange(location-leftWordPart.length, leftWordPart.length+rightPart.length); - NSString *word = [leftWordPart stringByAppendingString:rightPart]; - - // If a break is detected, return the last component of the string - if ([word rangeOfString:@"\n"].location != NSNotFound) { - *rangePointer = [text rangeOfString:word]; - word = [[word componentsSeparatedByString:@"\n"] lastObject]; - } - - return word; -} - -- (void)slk_prepareForUndo:(NSString *)description -{ - if (!self.undoManagerEnabled) { - return; - } - - SLKTextView *prepareInvocation = [self.undoManager prepareWithInvocationTarget:self]; - [prepareInvocation setText:self.text]; - [self.undoManager setActionName:description]; - -} - -@end diff --git a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/SLKUIConstants.h b/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/SLKUIConstants.h deleted file mode 100644 index f65ac47f4..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/SLKUIConstants.h +++ /dev/null @@ -1,61 +0,0 @@ -// -// Copyright 2014 Slack Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#define SLK_IS_LANDSCAPE ([[UIApplication sharedApplication] statusBarOrientation] == UIDeviceOrientationLandscapeLeft || [[UIApplication sharedApplication] statusBarOrientation] == UIDeviceOrientationLandscapeRight) -#define SLK_IS_IPAD ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) -#define SLK_IS_IPHONE ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) -#define SLK_IS_IPHONE4 (SLK_IS_IPHONE && [[UIScreen mainScreen] bounds].size.height < 568.0) -#define SLK_IS_IPHONE5 (SLK_IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 568.0) -#define SLK_IS_IPHONE6 (SLK_IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 667.0) -#define SLK_IS_IPHONE6PLUS (SLK_IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 736.0 || [[UIScreen mainScreen] bounds].size.width == 736.0) // Both orientations -#define SLK_IS_IOS8_AND_HIGHER ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) - -#define SLK_INPUT_ACCESSORY_DEBUG DEBUG && 0 // Renders a translucent red area representing the keyboard accessory view -#define SLK_KEYBOARD_NOTIFICATION_DEBUG DEBUG && 0 // Logs every keyboard notification being sent - -#if __has_attribute(objc_designated_initializer) -#define SLK_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) -#endif - -static NSString *SLKTextViewControllerDomain = @"com.slack.TextViewController"; - -inline static CGFloat minimumKeyboardHeight() -{ - if (SLK_IS_IPAD) { - if (SLK_IS_LANDSCAPE) return 352.f; - else return 264.f; - } - if (SLK_IS_IPHONE6PLUS) { - if (SLK_IS_LANDSCAPE) return 162.f; - else return 226.f; - } - else { - if (SLK_IS_LANDSCAPE) return 162.f; - else return 216.f; - } -} - -inline static CGRect SLKRectInvert(CGRect rect) -{ - CGRect invert = CGRectZero; - - invert.origin.x = rect.origin.y; - invert.origin.y = rect.origin.x; - invert.size.width = rect.size.height; - invert.size.height = rect.size.width; - - return invert; -}
\ No newline at end of file diff --git a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/UIResponder+SLKAdditions.h b/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/UIResponder+SLKAdditions.h deleted file mode 100644 index 3b126b2e5..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/UIResponder+SLKAdditions.h +++ /dev/null @@ -1,30 +0,0 @@ -// -// Copyright 2014 Slack Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import <UIKit/UIKit.h> - -/** @name UIResponder additional features used for SlackTextViewController. */ -@interface UIResponder (SLKAdditions) - -/** - Returns the current first responder object. - @discussion This is an experimental API. Use it at your own risk. - - @return A UIResponder instance. - */ -+ (instancetype)slk_currentFirstResponder; - -@end diff --git a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/UIResponder+SLKAdditions.m b/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/UIResponder+SLKAdditions.m deleted file mode 100644 index 799aba254..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/UIResponder+SLKAdditions.m +++ /dev/null @@ -1,39 +0,0 @@ -// -// Copyright 2014 Slack Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import "UIResponder+SLKAdditions.h" - -static __weak id ___currentFirstResponder; - -@implementation UIResponder (SLKAdditions) - -/** - Based on Jakob Egger's answer in http://stackoverflow.com/a/14135456/590010 - */ -+ (instancetype)slk_currentFirstResponder -{ - ___currentFirstResponder = nil; - [[UIApplication sharedApplication] sendAction:@selector(slk_findFirstResponder:) to:nil from:nil forEvent:nil]; - - return ___currentFirstResponder; -} - -- (void)slk_findFirstResponder:(id)sender -{ - ___currentFirstResponder = self; -} - -@end diff --git a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/UIScrollView+SLKAdditions.h b/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/UIScrollView+SLKAdditions.h deleted file mode 100644 index cc33a631c..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/UIScrollView+SLKAdditions.h +++ /dev/null @@ -1,48 +0,0 @@ -// -// Copyright 2014 Slack Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import <UIKit/UIKit.h> - -/** @name UIScrollView additional features used for SlackTextViewController. */ -@interface UIScrollView (SLKAdditions) - -/** YES if the scrollView's offset is at the very top. */ -@property (nonatomic, readonly) BOOL slk_isAtTop; -/** YES if the scrollView's offset is at the very bottom. */ -@property (nonatomic, readonly) BOOL slk_isAtBottom; -/** The visible area of the content size. */ -@property (nonatomic, readonly) CGRect slk_visibleRect; - -/** - Sets the content offset to the top. - - @param animated YES to animate the transition at a constant velocity to the new offset, NO to make the transition immediate. - */ -- (void)slk_scrollToTopAnimated:(BOOL)animated; - -/** - Sets the content offset to the bottom. - - @param animated YES to animate the transition at a constant velocity to the new offset, NO to make the transition immediate. - */ -- (void)slk_scrollToBottomAnimated:(BOOL)animated; - -/** - Stops scrolling, if it was scrolling. - */ -- (void)slk_stopScrolling; - -@end diff --git a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/UIScrollView+SLKAdditions.m b/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/UIScrollView+SLKAdditions.m deleted file mode 100644 index 2c745e412..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/UIScrollView+SLKAdditions.m +++ /dev/null @@ -1,73 +0,0 @@ -// -// Copyright 2014 Slack Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import "UIScrollView+SLKAdditions.h" - -@implementation UIScrollView (SLKAdditions) - -- (void)slk_scrollToTopAnimated:(BOOL)animated -{ - [self scrollRectToVisible:[self slk_topRect] animated:animated]; -} - -- (void)slk_scrollToBottomAnimated:(BOOL)animated -{ - [self scrollRectToVisible:[self slk_bottomRect] animated:animated]; -} - -- (BOOL)slk_isAtTop -{ - return CGRectGetMinY([self slk_visibleRect]) == CGRectGetMinY([self slk_topRect]); -} - -- (BOOL)slk_isAtBottom -{ - return CGRectGetMaxY([self slk_visibleRect]) == CGRectGetMaxY([self slk_bottomRect]); -} - -- (CGRect)slk_visibleRect -{ - CGRect visibleRect; - visibleRect.origin = self.contentOffset; - visibleRect.size = self.frame.size; - return visibleRect; -} - -- (CGRect)slk_topRect -{ - return CGRectMake(0, 0, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)); -} - -- (CGRect)slk_bottomRect -{ - return CGRectMake(0, self.contentSize.height - CGRectGetHeight(self.bounds), CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)); -} - -- (void)slk_stopScrolling -{ - if (!self.isDragging) { - return; - } - - CGPoint offset = self.contentOffset; - offset.y -= 1.0; - [self setContentOffset:offset]; - - offset.y += 1.0; - [self setContentOffset:offset]; -} - -@end diff --git a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/UIView+SLKAdditions.h b/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/UIView+SLKAdditions.h deleted file mode 100644 index 40c609608..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/UIView+SLKAdditions.h +++ /dev/null @@ -1,59 +0,0 @@ -// -// Copyright 2014 Slack Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import <UIKit/UIKit.h> - -/** @name UIView additional features used for SlackTextViewController. */ -@interface UIView (SLKAdditions) - -/** - Animates the view's constraints by calling layoutIfNeeded. - - @param bounce YES if the animation should use spring damping and velocity to give a bouncy effect to animations. - @param options A mask of options indicating how you want to perform the animations. - @param animations An additional block for custom animations. - */ -- (void)slk_animateLayoutIfNeededWithBounce:(BOOL)bounce options:(UIViewAnimationOptions)options animations:(void (^)(void))animations; - -/** - Animates the view's constraints by calling layoutIfNeeded. - - @param duration The total duration of the animations, measured in seconds. - @param bounce YES if the animation should use spring damping and velocity to give a bouncy effect to animations. - @param options A mask of options indicating how you want to perform the animations. - @param animations An additional block for custom animations. - */ -- (void)slk_animateLayoutIfNeededWithDuration:(NSTimeInterval)duration bounce:(BOOL)bounce options:(UIViewAnimationOptions)options animations:(void (^)(void))animations; - -/** - Returns the view constraints matching a specific layout attribute (top, bottom, left, right, leading, trailing, etc.) - - @param attribute The layout attribute to use for searching. - @return An array of matching constraints. - */ -- (NSArray *)slk_constraintsForAttribute:(NSLayoutAttribute)attribute; - -/** - Returns a layout constraint matching a specific layout attribute and relationship between 2 items, first and second items. - - @param attribute The layout attribute to use for searching. - @param first The first item in the relationship. - @param second The second item in the relationship. - @return A layout constraint. - */ -- (NSLayoutConstraint *)slk_constraintForAttribute:(NSLayoutAttribute)attribute firstItem:(id)first secondItem:(id)second; - -@end diff --git a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/UIView+SLKAdditions.m b/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/UIView+SLKAdditions.m deleted file mode 100644 index b82f9435d..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Additions/UIView+SLKAdditions.m +++ /dev/null @@ -1,73 +0,0 @@ -// -// Copyright 2014 Slack Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import "UIView+SLKAdditions.h" - -#import "SLKUIConstants.h" - -@implementation UIView (SLKAdditions) - -- (void)slk_animateLayoutIfNeededWithBounce:(BOOL)bounce options:(UIViewAnimationOptions)options animations:(void (^)(void))animations -{ - NSTimeInterval duration = bounce ? 0.5 : 0.2; - [self slk_animateLayoutIfNeededWithDuration:duration bounce:bounce options:options animations:animations]; -} - -- (void)slk_animateLayoutIfNeededWithDuration:(NSTimeInterval)duration bounce:(BOOL)bounce options:(UIViewAnimationOptions)options animations:(void (^)(void))animations -{ - if (bounce) { - [UIView animateWithDuration:duration - delay:0.0 - usingSpringWithDamping:0.7 - initialSpringVelocity:0.7 - options:options - animations:^{ - [self layoutIfNeeded]; - - if (animations) { - animations(); - } - } - completion:NULL]; - } - else { - [UIView animateWithDuration:duration - delay:0.0 - options:options - animations:^{ - [self layoutIfNeeded]; - - if (animations) { - animations(); - } - } - completion:NULL]; - } -} - -- (NSArray *)slk_constraintsForAttribute:(NSLayoutAttribute)attribute -{ - NSPredicate *predicate = [NSPredicate predicateWithFormat:@"firstAttribute = %d", attribute]; - return [self.constraints filteredArrayUsingPredicate:predicate]; -} - -- (NSLayoutConstraint *)slk_constraintForAttribute:(NSLayoutAttribute)attribute firstItem:(id)first secondItem:(id)second -{ - NSPredicate *predicate = [NSPredicate predicateWithFormat:@"firstAttribute = %d AND firstItem = %@ AND secondItem = %@", attribute, first, second]; - return [[self.constraints filteredArrayUsingPredicate:predicate] firstObject]; -} - -@end diff --git a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKInputAccessoryView.h b/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKInputAccessoryView.h deleted file mode 100644 index f72fd105c..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKInputAccessoryView.h +++ /dev/null @@ -1,23 +0,0 @@ -// -// Copyright 2014 Slack Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import <UIKit/UIKit.h> - -UIKIT_EXTERN NSString * const SLKInputAccessoryViewKeyboardFrameDidChangeNotification; - -@interface SLKInputAccessoryView : UIView - -@end diff --git a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKInputAccessoryView.m b/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKInputAccessoryView.m deleted file mode 100644 index e1a4cd561..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKInputAccessoryView.m +++ /dev/null @@ -1,100 +0,0 @@ -// -// Copyright 2014 Slack Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import "SLKInputAccessoryView.h" -#import "SLKUIConstants.h" - -NSString * const SLKInputAccessoryViewKeyboardFrameDidChangeNotification = @"SLKInputAccessoryViewKeyboardFrameDidChangeNotification"; - -@interface SLKInputAccessoryView () -@property (nonatomic, weak) UIView *observedSuperview; -@end - -@implementation SLKInputAccessoryView - -#pragma mark - Getters - -NSString *SLKKeyboardHandlingKeyPath() -{ - // Listening for the superview's frame doesn't work on iOS8 and above, so we use its center - if (SLK_IS_IOS8_AND_HIGHER) { - return NSStringFromSelector(@selector(center)); - } - else { - return NSStringFromSelector(@selector(frame)); - } -} - - -#pragma mark - Super Overrides - -- (void)willMoveToSuperview:(UIView *)newSuperview -{ - [self slk_removeSuperviewObserver]; - [self slk_addSuperviewObserver:newSuperview]; - - [super willMoveToSuperview:newSuperview]; -} - - -#pragma mark - Superview handling - -- (void)slk_addSuperviewObserver:(UIView *)superview -{ - if (!_observedSuperview && superview) { - _observedSuperview = superview; - [superview addObserver:self forKeyPath:SLKKeyboardHandlingKeyPath() options:0 context:NULL]; - } -} - -- (void)slk_removeSuperviewObserver -{ - if (_observedSuperview) { - [self.observedSuperview removeObserver:self forKeyPath:SLKKeyboardHandlingKeyPath()]; - _observedSuperview = nil; - } -} - - -#pragma mark - Events - -- (void)slk_didChangeKeyboardFrame:(CGRect)frame -{ - NSDictionary *userInfo = @{UIKeyboardFrameEndUserInfoKey:[NSValue valueWithCGRect:frame]}; - [[NSNotificationCenter defaultCenter] postNotificationName:SLKInputAccessoryViewKeyboardFrameDidChangeNotification object:nil userInfo:userInfo]; -} - - -#pragma mark - KVO Listener - -- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context -{ - if ([object isEqual:self.superview] && [keyPath isEqualToString:SLKKeyboardHandlingKeyPath()]) { - [self slk_didChangeKeyboardFrame:self.superview.frame]; - } - else { - [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; - } -} - -#pragma mark - Lifeterm - -- (void)dealloc -{ - [self slk_removeSuperviewObserver]; -} - -@end diff --git a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKTextInputbar.h b/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKTextInputbar.h deleted file mode 100644 index d179912d9..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKTextInputbar.h +++ /dev/null @@ -1,149 +0,0 @@ -// -// Copyright 2014 Slack Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import <UIKit/UIKit.h> - -@class SLKTextViewController; -@class SLKTextView; - -typedef NS_ENUM(NSUInteger, SLKCounterStyle) { - SLKCounterStyleNone, - SLKCounterStyleSplit, - SLKCounterStyleCountdown, - SLKCounterStyleCountdownReversed -}; - -typedef NS_ENUM(NSUInteger, SLKCounterPosition) { - SLKCounterPositionTop, - SLKCounterPositionBottom -}; - -/** @name A custom tool bar encapsulating messaging controls. */ -@interface SLKTextInputbar : UIToolbar - -/** A weak reference to the core view controller. */ -@property (nonatomic, weak) SLKTextViewController *controller; - -/** The centered text input view. - The maximum number of lines is configured by default, to best fit each devices dimensions. - For iPhone 4 (<=480pts): 4 lines - For iPhone 5 & 6 (>=568pts): 6 lines - For iPad (>=768pts): 8 lines - */ -@property (nonatomic, strong) SLKTextView *textView; - -/** The left action button action. */ -@property (nonatomic, strong) UIButton *leftButton; - -/** The right action button action. */ -@property (nonatomic, strong) UIButton *rightButton; - -/** YES if the right button should be hidden animatedly in case the text view has no text in it. Default is YES. */ -@property (nonatomic, readwrite) BOOL autoHideRightButton; - -/** The inner padding to use when laying out content in the view. Default is {5, 8, 5, 8}. */ -@property (nonatomic, assign) UIEdgeInsets contentInset; - -/** The minimum height based on the intrinsic content size's. */ -@property (nonatomic, readonly) CGFloat minimumInputbarHeight; - -/** The most appropriate height calculated based on the amount of lines of text and other factors. */ -@property (nonatomic, readonly) CGFloat appropriateHeight; - - -#pragma mark - Initialization -///------------------------------------------------ -/// @name Initialization -///------------------------------------------------ - -/** - Initializes a text input bar with a class to be used for the text view - - @param textViewClass The class to be used when creating the text view. May be nil. If provided, the class must be a subclass of SLKTextView - @return An initialized SLKTextInputbar object or nil if the object could not be created. - */ -- (instancetype)initWithTextViewClass:(Class)textViewClass; - - -#pragma mark - Text Editing -///------------------------------------------------ -/// @name Text Editing -///------------------------------------------------ - -/** The view displayed on top if the text input bar, containing the button outlets, when editing is enabled. */ -@property (nonatomic, strong) UIView *editorContentView; - -/** The title label displayed in the middle of the accessoryView. */ -@property (nonatomic, strong) UILabel *editorTitle; - -/** The 'cancel' button displayed left in the accessoryView. */ -@property (nonatomic, strong) UIButton *editortLeftButton; - -/** The 'accept' button displayed right in the accessoryView. */ -@property (nonatomic, strong) UIButton *editortRightButton; - -/** The accessory view's maximum height. Default is 38 pts. */ -@property (nonatomic, assign) CGFloat editorContentViewHeight; - -/** A Boolean value indicating whether the control is in edit mode. */ -@property (nonatomic, getter = isEditing) BOOL editing; - -/** - Verifies if the text can be edited. - - @param text The text to be edited. - @return YES if the text is editable. - */ -- (BOOL)canEditText:(NSString *)text; - -/** - Begins editing the text, by updating the 'editing' flag and the view constraints. - */ -- (void)beginTextEditing; - -/** - End editing the text, by updating the 'editing' flag and the view constraints. - */ -- (void)endTextEdition; - - -#pragma mark - Text Counting -///------------------------------------------------ -/// @name Text Counting -///------------------------------------------------ - -/** The label used to display the character counts. */ -@property (nonatomic, readonly) UILabel *charCountLabel; - -/** The maximum character count allowed. If larger than 0, a character count label will be displayed on top of the right button. Default is 0, which means limitless.*/ -@property (nonatomic, readwrite) NSUInteger maxCharCount; - -/** The character counter formatting. Ignored if maxCharCount is 0. Default is None. */ -@property (nonatomic, assign) SLKCounterStyle counterStyle; - -/** The character counter layout style. Ignored if maxCharCount is 0. Default is SLKCounterPositionTop. */ -@property (nonatomic, assign) SLKCounterPosition counterPosition; - -/** YES if the maxmimum character count has been exceeded. */ -@property (nonatomic, readonly) BOOL limitExceeded; - -/** The normal color used for character counter label. Default is lightGrayColor. */ -@property (nonatomic, strong, readwrite) UIColor *charCountLabelNormalColor; - -/** The color used for character counter label when it has exceeded the limit. Default is redColor. */ -@property (nonatomic, strong, readwrite) UIColor *charCountLabelWarningColor; - -@end diff --git a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKTextInputbar.m b/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKTextInputbar.m deleted file mode 100644 index 7e5f66ec8..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKTextInputbar.m +++ /dev/null @@ -1,707 +0,0 @@ -// -// Copyright 2014 Slack Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import "SLKTextInputbar.h" -#import "SLKTextViewController.h" -#import "SLKTextView.h" -#import "SLKTextView+SLKAdditions.h" -#import "SLKUIConstants.h" -#import "UIView+SLKAdditions.h" - -@interface SLKTextInputbar () - -@property (nonatomic, strong) NSLayoutConstraint *leftButtonWC; -@property (nonatomic, strong) NSLayoutConstraint *leftButtonHC; -@property (nonatomic, strong) NSLayoutConstraint *leftMarginWC; -@property (nonatomic, strong) NSLayoutConstraint *bottomMarginWC; -@property (nonatomic, strong) NSLayoutConstraint *rightButtonWC; -@property (nonatomic, strong) NSLayoutConstraint *rightMarginWC; -@property (nonatomic, strong) NSLayoutConstraint *editorContentViewHC; -@property (nonatomic, strong) NSArray *charCountLabelVCs; - -@property (nonatomic, strong) UILabel *charCountLabel; - -@property (nonatomic, strong) Class textViewClass; - -@end - -@implementation SLKTextInputbar - -#pragma mark - Initialization - -- (instancetype)initWithTextViewClass:(Class)textViewClass -{ - if (self = [super init]) { - self.textViewClass = textViewClass; - [self slk_commonInit]; - } - return self; -} - -- (id)init -{ - if (self = [super init]) { - [self slk_commonInit]; - } - return self; -} - -- (instancetype)initWithCoder:(NSCoder *)coder -{ - if (self = [super initWithCoder:coder]) { - [self slk_commonInit]; - } - return self; -} - -- (void)slk_commonInit -{ - self.charCountLabelNormalColor = [UIColor lightGrayColor]; - self.charCountLabelWarningColor = [UIColor redColor]; - - self.autoHideRightButton = YES; - self.editorContentViewHeight = 38.0; - self.contentInset = UIEdgeInsetsMake(5.0, 8.0, 5.0, 8.0); - - [self addSubview:self.editorContentView]; - [self addSubview:self.leftButton]; - [self addSubview:self.rightButton]; - [self addSubview:self.textView]; - [self addSubview:self.charCountLabel]; - - [self slk_setupViewConstraints]; - [self slk_updateConstraintConstants]; - - self.counterStyle = SLKCounterStyleNone; - self.counterPosition = SLKCounterPositionTop; - - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slk_didChangeTextViewText:) name:UITextViewTextDidChangeNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slk_didChangeTextViewContentSize:) name:SLKTextViewContentSizeDidChangeNotification object:nil]; - - [self.leftButton.imageView addObserver:self forKeyPath:NSStringFromSelector(@selector(image)) options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:NULL]; -} - - -#pragma mark - UIView Overrides - -- (void)layoutIfNeeded -{ - if (self.constraints.count == 0) { - return; - } - - [self slk_updateConstraintConstants]; - [super layoutIfNeeded]; -} - -- (CGSize)intrinsicContentSize -{ - return CGSizeMake(UIViewNoIntrinsicMetric, 44.0); -} - -+ (BOOL)requiresConstraintBasedLayout -{ - return YES; -} - - -#pragma mark - Getters - -- (SLKTextView *)textView -{ - if (!_textView) - { - Class class = self.textViewClass ? : [SLKTextView class]; - - _textView = [[class alloc] init]; - _textView.translatesAutoresizingMaskIntoConstraints = NO; - _textView.font = [UIFont systemFontOfSize:15.0]; - _textView.maxNumberOfLines = [self slk_defaultNumberOfLines]; - - _textView.typingSuggestionEnabled = YES; - _textView.autocapitalizationType = UITextAutocapitalizationTypeSentences; - _textView.keyboardType = UIKeyboardTypeTwitter; - _textView.returnKeyType = UIReturnKeyDefault; - _textView.enablesReturnKeyAutomatically = YES; - _textView.scrollIndicatorInsets = UIEdgeInsetsMake(0.0, -1.0, 0.0, 1.0); - _textView.textContainerInset = UIEdgeInsetsMake(8.0, 4.0, 8.0, 0.0); - _textView.layer.cornerRadius = 5.0; - _textView.layer.borderWidth = 0.5; - _textView.layer.borderColor = [UIColor colorWithRed:200.0/255.0 green:200.0/255.0 blue:205.0/255.0 alpha:1.0].CGColor; - - // Adds an aditional action to a private gesture to detect when the magnifying glass becomes visible - for (UIGestureRecognizer *gesture in _textView.gestureRecognizers) { - if ([gesture isKindOfClass:NSClassFromString(@"UIVariableDelayLoupeGesture")]) { - [gesture addTarget:self action:@selector(slk_willShowLoupe:)]; - } - } - } - return _textView; -} - -- (UIButton *)leftButton -{ - if (!_leftButton) - { - _leftButton = [UIButton buttonWithType:UIButtonTypeSystem]; - _leftButton.translatesAutoresizingMaskIntoConstraints = NO; - _leftButton.titleLabel.font = [UIFont systemFontOfSize:15.0]; - } - return _leftButton; -} - -- (UIButton *)rightButton -{ - if (!_rightButton) - { - _rightButton = [UIButton buttonWithType:UIButtonTypeSystem]; - _rightButton.translatesAutoresizingMaskIntoConstraints = NO; - _rightButton.titleLabel.font = [UIFont boldSystemFontOfSize:15.0]; - _rightButton.enabled = NO; - - [_rightButton setTitle:NSLocalizedString(@"Send", nil) forState:UIControlStateNormal]; - } - return _rightButton; -} - -- (UIView *)editorContentView -{ - if (!_editorContentView) - { - _editorContentView = [UIView new]; - _editorContentView.translatesAutoresizingMaskIntoConstraints = NO; - _editorContentView.backgroundColor = self.backgroundColor; - _editorContentView.clipsToBounds = YES; - _editorContentView.hidden = YES; - - _editorTitle = [UILabel new]; - _editorTitle.translatesAutoresizingMaskIntoConstraints = NO; - _editorTitle.text = NSLocalizedString(@"Editing Message", nil); - _editorTitle.textAlignment = NSTextAlignmentCenter; - _editorTitle.backgroundColor = [UIColor clearColor]; - _editorTitle.font = [UIFont boldSystemFontOfSize:15.0]; - [_editorContentView addSubview:self.editorTitle]; - - _editortLeftButton = [UIButton buttonWithType:UIButtonTypeSystem]; - _editortLeftButton.translatesAutoresizingMaskIntoConstraints = NO; - _editortLeftButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; - _editortLeftButton.titleLabel.font = [UIFont systemFontOfSize:15.0]; - [_editortLeftButton setTitle:NSLocalizedString(@"Cancel", nil) forState:UIControlStateNormal]; - [_editorContentView addSubview:self.editortLeftButton]; - - _editortRightButton = [UIButton buttonWithType:UIButtonTypeSystem]; - _editortRightButton.translatesAutoresizingMaskIntoConstraints = NO; - _editortRightButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight; - _editortRightButton.titleLabel.font = [UIFont boldSystemFontOfSize:15.0]; - _editortRightButton.enabled = NO; - [_editortRightButton setTitle:NSLocalizedString(@"Save", nil) forState:UIControlStateNormal]; - [_editorContentView addSubview:self.editortRightButton]; - - NSDictionary *views = @{@"label": self.editorTitle, - @"leftButton": self.editortLeftButton, - @"rightButton": self.editortRightButton, - }; - - NSDictionary *metrics = @{@"left" : @(self.contentInset.left), - @"right" : @(self.contentInset.right) - }; - - [_editorContentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-(left)-[leftButton(60)]-(left)-[label(>=0)]-(right)-[rightButton(60)]-(<=right)-|" options:0 metrics:metrics views:views]]; - [_editorContentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[leftButton]|" options:0 metrics:metrics views:views]]; - [_editorContentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[rightButton]|" options:0 metrics:metrics views:views]]; - [_editorContentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[label]|" options:0 metrics:metrics views:views]]; - } - return _editorContentView; -} - -- (UILabel *)charCountLabel -{ - if (!_charCountLabel) - { - _charCountLabel = [UILabel new]; - _charCountLabel.translatesAutoresizingMaskIntoConstraints = NO; - _charCountLabel.backgroundColor = [UIColor clearColor]; - _charCountLabel.textAlignment = NSTextAlignmentRight; - _charCountLabel.font = [UIFont systemFontOfSize:11.0]; - - _charCountLabel.hidden = NO; - } - return _charCountLabel; -} - -- (BOOL)isViewVisible -{ - SEL selector = NSSelectorFromString(@"isViewVisible"); - - if ([self.controller respondsToSelector:selector]) { - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Warc-performSelector-leaks" - BOOL visible = (BOOL)[self.controller performSelector:selector]; -#pragma clang diagnostic pop - - return visible; - } - return NO; -} - -- (CGFloat)minimumInputbarHeight -{ - return self.intrinsicContentSize.height; -} - -- (CGFloat)appropriateHeight -{ - CGFloat height = 0.0; - CGFloat minimumHeight = [self minimumInputbarHeight]; - - if (self.textView.numberOfLines == 1) { - height = minimumHeight; - } - else if (self.textView.numberOfLines < self.textView.maxNumberOfLines) { - height = [self slk_inputBarHeightForLines:self.textView.numberOfLines]; - } - else { - height = [self slk_inputBarHeightForLines:self.textView.maxNumberOfLines]; - } - - if (height < minimumHeight) { - height = minimumHeight; - } - - if (self.isEditing) { - height += self.editorContentViewHeight; - } - - return roundf(height); -} - -- (CGFloat)slk_deltaInputbarHeight -{ - return self.textView.intrinsicContentSize.height-self.textView.font.lineHeight; -} - -- (CGFloat)slk_inputBarHeightForLines:(NSUInteger)numberOfLines -{ - CGFloat height = [self slk_deltaInputbarHeight]; - - height += roundf(self.textView.font.lineHeight*numberOfLines); - height += self.contentInset.top+self.contentInset.bottom; - - return height; -} - -- (BOOL)limitExceeded -{ - NSString *text = [self.textView.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; - - if (self.maxCharCount > 0 && text.length > self.maxCharCount) { - return YES; - } - return NO; -} - -- (CGFloat)slk_appropriateRightButtonWidth -{ - NSString *title = [self.rightButton titleForState:UIControlStateNormal]; - CGSize rigthButtonSize = [title sizeWithAttributes:@{NSFontAttributeName: self.rightButton.titleLabel.font}]; - - if (self.autoHideRightButton) { - if (self.textView.text.length == 0) { - return 0.0; - } - } - return rigthButtonSize.width+self.contentInset.right; -} - -- (CGFloat)slk_appropriateRightButtonMargin -{ - if (self.autoHideRightButton) { - if (self.textView.text.length == 0) { - return 0.0; - } - } - return self.contentInset.right; -} - -- (NSUInteger)slk_defaultNumberOfLines -{ - if (SLK_IS_IPAD) { - return 8; - } - if (SLK_IS_IPHONE4) { - return 4; - } - else { - return 6; - } -} - - -#pragma mark - Setters - -- (void)setBackgroundColor:(UIColor *)color -{ - self.barTintColor = color; - self.textView.inputAccessoryView.backgroundColor = color; - self.editorContentView.backgroundColor = color; -} - -- (void)setAutoHideRightButton:(BOOL)hide -{ - if (self.autoHideRightButton == hide) { - return; - } - - _autoHideRightButton = hide; - - self.rightButtonWC.constant = [self slk_appropriateRightButtonWidth]; - [self layoutIfNeeded]; -} - -- (void)setContentInset:(UIEdgeInsets)insets -{ - if (UIEdgeInsetsEqualToEdgeInsets(self.contentInset, insets)) { - return; - } - - if (UIEdgeInsetsEqualToEdgeInsets(self.contentInset, UIEdgeInsetsZero)) { - _contentInset = insets; - return; - } - - _contentInset = insets; - - // Add new constraints - [self removeConstraints:self.constraints]; - [self slk_setupViewConstraints]; - - // Add constant values and refresh layout - [self slk_updateConstraintConstants]; - [super layoutIfNeeded]; -} - -- (void)setEditing:(BOOL)editing -{ - if (self.isEditing == editing) { - return; - } - - _editing = editing; - _editorContentView.hidden = !editing; -} - -- (void)setCounterPosition:(SLKCounterPosition)counterPosition -{ - if (self.counterPosition == counterPosition && self.charCountLabelVCs) { - return; - } - - // Clears the previous constraints - if (_charCountLabelVCs.count > 0) { - [self removeConstraints:_charCountLabelVCs]; - _charCountLabelVCs = nil; - } - - _counterPosition = counterPosition; - - NSDictionary *views = @{@"rightButton": self.rightButton, - @"charCountLabel": self.charCountLabel - }; - - NSDictionary *metrics = @{@"top" : @(self.contentInset.top), - @"bottom" : @(-self.contentInset.bottom/2.0) - }; - - // Constraints are different depending of the counter's position type - if (counterPosition == SLKCounterPositionBottom) { - _charCountLabelVCs = [NSLayoutConstraint constraintsWithVisualFormat:@"V:[charCountLabel]-(bottom)-[rightButton]" options:0 metrics:metrics views:views]; - } - else { - _charCountLabelVCs = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|-(<=top)-[charCountLabel]-(>=0)-|" options:0 metrics:metrics views:views]; - } - - [self addConstraints:self.charCountLabelVCs]; -} - - -#pragma mark - Text Editing - -- (BOOL)canEditText:(NSString *)text -{ - if (self.isEditing && [self.textView.text isEqualToString:text]) { - return NO; - } - - return YES; -} - -- (void)beginTextEditing -{ - if (self.isEditing) { - return; - } - - self.editing = YES; - - [self slk_updateConstraintConstants]; - - if (!self.isFirstResponder) { - [self layoutIfNeeded]; - } -} - -- (void)endTextEdition -{ - if (!self.isEditing) { - return; - } - - self.editing = NO; - [self slk_updateConstraintConstants]; -} - - -#pragma mark - Character Counter - -- (void)slk_updateCounter -{ - NSString *text = [self.textView.text stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]]; - NSString *counter = nil; - - if (self.counterStyle == SLKCounterStyleNone) { - counter = [NSString stringWithFormat:@"%lu", (unsigned long)text.length]; - } - if (self.counterStyle == SLKCounterStyleSplit) { - counter = [NSString stringWithFormat:@"%lu/%lu", (unsigned long)text.length, (unsigned long)self.maxCharCount]; - } - if (self.counterStyle == SLKCounterStyleCountdown) { - counter = [NSString stringWithFormat:@"%ld", (long)(text.length - self.maxCharCount)]; - } - if (self.counterStyle == SLKCounterStyleCountdownReversed) - { - counter = [NSString stringWithFormat:@"%ld", (long)(self.maxCharCount - text.length)]; - } - - self.charCountLabel.text = counter; - self.charCountLabel.textColor = [self limitExceeded] ? self.charCountLabelWarningColor : self.charCountLabelNormalColor; -} - - -#pragma mark - Magnifying Glass handling - -- (void)slk_willShowLoupe:(UIGestureRecognizer *)gesture -{ - if (gesture.state == UIGestureRecognizerStateChanged) { - self.textView.loupeVisible = YES; - } - else { - self.textView.loupeVisible = NO; - } - - // We still need to notify a selection change in the textview after the magnifying class is dismissed - if (gesture.state == UIGestureRecognizerStateEnded) { - if (self.textView.delegate && [self.textView.delegate respondsToSelector:@selector(textViewDidChangeSelection:)]) { - [self.textView.delegate textViewDidChangeSelection:self.textView]; - } - - [[NSNotificationCenter defaultCenter] postNotificationName:SLKTextViewSelectedRangeDidChangeNotification object:self.textView userInfo:nil]; - } -} - - -#pragma mark - Notification Events - -- (void)slk_didChangeTextViewText:(NSNotification *)notification -{ - SLKTextView *textView = (SLKTextView *)notification.object; - - // Skips this it's not the expected textView. - if (![textView isEqual:self.textView]) { - return; - } - - // Updates the char counter label - if (self.maxCharCount > 0) { - [self slk_updateCounter]; - } - - if (self.autoHideRightButton && !self.isEditing) - { - CGFloat rightButtonNewWidth = [self slk_appropriateRightButtonWidth]; - - if (self.rightButtonWC.constant == rightButtonNewWidth) { - return; - } - - self.rightButtonWC.constant = rightButtonNewWidth; - self.rightMarginWC.constant = [self slk_appropriateRightButtonMargin]; - - if (rightButtonNewWidth > 0) { - [self.rightButton sizeToFit]; - } - - BOOL bounces = self.controller.bounces && [self.textView isFirstResponder]; - - if ([self isViewVisible]) { - [self slk_animateLayoutIfNeededWithBounce:bounces - options:UIViewAnimationOptionCurveEaseInOut|UIViewAnimationOptionBeginFromCurrentState - animations:NULL]; - } - else { - [self layoutIfNeeded]; - } - } -} - -- (void)slk_didChangeTextViewContentSize:(NSNotification *)notification -{ - if (self.maxCharCount > 0) { - BOOL shouldHide = (self.textView.numberOfLines == 1) || self.editing; - self.charCountLabel.hidden = shouldHide; - } -} - - -#pragma mark - View Auto-Layout - -- (void)slk_setupViewConstraints -{ - UIImage *leftButtonImg = [self.leftButton imageForState:UIControlStateNormal]; - - [self.rightButton sizeToFit]; - - CGFloat leftVerMargin = (self.intrinsicContentSize.height - leftButtonImg.size.height) / 2.0; - CGFloat rightVerMargin = (self.intrinsicContentSize.height - CGRectGetHeight(self.rightButton.frame)) / 2.0; - - NSDictionary *views = @{@"textView": self.textView, - @"leftButton": self.leftButton, - @"rightButton": self.rightButton, - @"contentView": self.editorContentView, - @"charCountLabel": self.charCountLabel - }; - - NSDictionary *metrics = @{@"top" : @(self.contentInset.top), - @"bottom" : @(self.contentInset.bottom), - @"left" : @(self.contentInset.left), - @"right" : @(self.contentInset.right), - @"leftVerMargin" : @(leftVerMargin), - @"rightVerMargin" : @(rightVerMargin), - @"minTextViewHeight" : @(self.textView.intrinsicContentSize.height), - }; - - [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-(left)-[leftButton(0)]-(<=left)-[textView]-(right)-[rightButton(0)]-(right)-|" options:0 metrics:metrics views:views]]; - [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-(>=0)-[leftButton(0)]-(0@750)-|" options:0 metrics:metrics views:views]]; - [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-(>=rightVerMargin)-[rightButton]-(<=rightVerMargin)-|" options:0 metrics:metrics views:views]]; - [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-(left@250)-[charCountLabel(<=50@1000)]-(right@750)-|" options:0 metrics:metrics views:views]]; - - [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-0-[contentView(0)]-(<=top)-[textView(minTextViewHeight@250)]-(bottom)-|" options:0 metrics:metrics views:views]]; - [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[contentView]|" options:0 metrics:metrics views:views]]; - - self.editorContentViewHC = [self slk_constraintForAttribute:NSLayoutAttributeHeight firstItem:self.editorContentView secondItem:nil]; - - self.leftButtonWC = [self slk_constraintForAttribute:NSLayoutAttributeWidth firstItem:self.leftButton secondItem:nil]; - self.leftButtonHC = [self slk_constraintForAttribute:NSLayoutAttributeHeight firstItem:self.leftButton secondItem:nil]; - - self.leftMarginWC = [self slk_constraintsForAttribute:NSLayoutAttributeLeading][0]; - self.bottomMarginWC = [self slk_constraintForAttribute:NSLayoutAttributeBottom firstItem:self secondItem:self.leftButton]; - - self.rightButtonWC = [self slk_constraintForAttribute:NSLayoutAttributeWidth firstItem:self.rightButton secondItem:nil]; - self.rightMarginWC = [self slk_constraintsForAttribute:NSLayoutAttributeTrailing][0]; -} - -- (void)slk_updateConstraintConstants -{ - CGFloat zero = 0.0; - - if (self.isEditing) - { - self.editorContentViewHC.constant = self.editorContentViewHeight; - self.leftButtonWC.constant = zero; - self.leftButtonHC.constant = zero; - self.leftMarginWC.constant = zero; - self.bottomMarginWC.constant = zero; - self.rightButtonWC.constant = zero; - self.rightMarginWC.constant = zero; - } - else { - self.editorContentViewHC.constant = zero; - - CGSize leftButtonSize = [self.leftButton imageForState:self.leftButton.state].size; - - if (leftButtonSize.width > 0) { - self.leftButtonHC.constant = roundf(leftButtonSize.height); - self.bottomMarginWC.constant = roundf((self.intrinsicContentSize.height - leftButtonSize.height) / 2.0); - } - - self.leftButtonWC.constant = roundf(leftButtonSize.width); - self.leftMarginWC.constant = (leftButtonSize.width > 0) ? self.contentInset.left : zero; - - self.rightButtonWC.constant = [self slk_appropriateRightButtonWidth]; - self.rightMarginWC.constant = [self slk_appropriateRightButtonMargin]; - } -} - -#pragma mark - Observers - -- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context -{ - if ([object isEqual:self.leftButton.imageView] && [keyPath isEqualToString:NSStringFromSelector(@selector(image))]) { - UIImage *newImage = change[NSKeyValueChangeNewKey]; - UIImage *oldImage = change[NSKeyValueChangeOldKey]; - - if ([newImage isEqual:oldImage]) { - return; - } - - [self slk_updateConstraintConstants]; - } - else { - [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; - } -} - - -#pragma mark - Lifeterm - -- (void)dealloc -{ - [[NSNotificationCenter defaultCenter] removeObserver:self name:UITextViewTextDidChangeNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:SLKTextViewContentSizeDidChangeNotification object:nil]; - - [_leftButton.imageView removeObserver:self forKeyPath:NSStringFromSelector(@selector(image))]; - - _leftButton = nil; - _rightButton = nil; - - _textView.delegate = nil; - _textView = nil; - - _editorContentView = nil; - _editorTitle = nil; - _editortLeftButton = nil; - _editortRightButton = nil; - - _leftButtonWC = nil; - _leftButtonHC = nil; - _leftMarginWC = nil; - _bottomMarginWC = nil; - _rightButtonWC = nil; - _rightMarginWC = nil; - _editorContentViewHC = nil; -} - -@end diff --git a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKTextView.h b/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKTextView.h deleted file mode 100644 index 51532af17..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKTextView.h +++ /dev/null @@ -1,90 +0,0 @@ -// -// Copyright 2014 Slack Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import <UIKit/UIKit.h> - -UIKIT_EXTERN NSString * const SLKTextViewTextWillChangeNotification; -UIKIT_EXTERN NSString * const SLKTextViewContentSizeDidChangeNotification; -UIKIT_EXTERN NSString * const SLKTextViewSelectedRangeDidChangeNotification; -UIKIT_EXTERN NSString * const SLKTextViewDidPasteItemNotification; -UIKIT_EXTERN NSString * const SLKTextViewDidShakeNotification; - -UIKIT_EXTERN NSString * const SLKTextViewPastedItemContentType; -UIKIT_EXTERN NSString * const SLKTextViewPastedItemMediaType; -UIKIT_EXTERN NSString * const SLKTextViewPastedItemData; - -typedef NS_OPTIONS(NSUInteger, SLKPastableMediaType) { - SLKPastableMediaTypeNone = 0, - SLKPastableMediaTypePNG = 1 << 0, - SLKPastableMediaTypeJPEG = 1 << 1, - SLKPastableMediaTypeTIFF = 1 << 2, - SLKPastableMediaTypeGIF = 1 << 3, - SLKPastableMediaTypeMOV = 1 << 4, - SLKPastableMediaTypePassbook = 1 << 5, - SLKPastableMediaTypeImages = SLKPastableMediaTypePNG|SLKPastableMediaTypeJPEG|SLKPastableMediaTypeTIFF|SLKPastableMediaTypeGIF, - SLKPastableMediaTypeVideos = SLKPastableMediaTypeMOV, - SLKPastableMediaTypeAll = SLKPastableMediaTypeImages|SLKPastableMediaTypeMOV -}; - -/** @name A custom text input view. */ -@interface SLKTextView : UITextView - -/** The placeholder text string. Default is nil. */ -@property (nonatomic, copy) NSString *placeholder; - -/** The placeholder color. Default is lightGrayColor. */ -@property (nonatomic, copy) UIColor *placeholderColor; - -/** The maximum number of lines before enabling scrolling. Default is 0 wich means limitless. */ -@property (nonatomic, readwrite) NSUInteger maxNumberOfLines; - -/** The current displayed number of lines. */ -@property (nonatomic, readonly) NSUInteger numberOfLines; - -/** The supported media types allowed to be pasted in the text view, such as images or videos. Default is None. */ -@property (nonatomic) SLKPastableMediaType pastableMediaTypes; - -/** YES if the text view is and can still expand it self, depending if the maximum number of lines are reached. */ -@property (nonatomic, readonly) BOOL isExpanding; - -/** YES if quickly refreshed the textview without the intension to dismiss the keyboard. @view -disableQuicktypeBar: for more details. */ -@property (nonatomic, readwrite) BOOL didNotResignFirstResponder; - -/** YES if the magnifying glass is visible. */ -@property (nonatomic, getter=isLoupeVisible) BOOL loupeVisible; - -/** YES if autocorrection and spell checking are enabled. On iOS8, this property also controls the predictive QuickType bar from being visible. Default is YES. */ -@property (nonatomic, getter=isTypingSuggestionEnabled) BOOL typingSuggestionEnabled; - -/** YES if the text view supports undoing, either using UIMenuController, or with ctrl+z when using an external keyboard. Default is YES. */ -@property (nonatomic, readwrite) BOOL undoManagerEnabled; - -/** - Some text view properties don't update when it's already firstResponder (auto-correction, spelling-check, etc.) - To be able to update the text view while still being first responder, requieres to switch quickly from -resignFirstResponder to -becomeFirstResponder. - When doing so, the flag 'didNotResignFirstResponder' is momentarly set to YES before it goes back to -isFirstResponder, to be able to prevent some tasks to be excuted because of UIKeyboard notifications. - - You can also use this method to confirm an auto-correction programatically, before the text view resigns first responder. - */ -- (void)refreshFirstResponder; -- (void)refreshInputViews; - -/** - Notifies the text view that the user pressed any arrow key. This is used to move the cursor up and down while having multiple lines. - */ -- (void)didPressAnyArrowKey:(id)sender; - -@end diff --git a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKTextView.m b/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKTextView.m deleted file mode 100644 index e4898fdd4..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKTextView.m +++ /dev/null @@ -1,796 +0,0 @@ -// -// Copyright 2014 Slack Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import "SLKTextView.h" -#import "SLKTextView+SLKAdditions.h" -#import "SLKUIConstants.h" - -NSString * const SLKTextViewTextWillChangeNotification = @"SLKTextViewTextWillChangeNotification"; -NSString * const SLKTextViewContentSizeDidChangeNotification = @"SLKTextViewContentSizeDidChangeNotification"; -NSString * const SLKTextViewSelectedRangeDidChangeNotification = @"SLKTextViewSelectedRangeDidChangeNotification"; -NSString * const SLKTextViewDidPasteItemNotification = @"SLKTextViewDidPasteItemNotification"; -NSString * const SLKTextViewDidShakeNotification = @"SLKTextViewDidShakeNotification"; - -NSString * const SLKTextViewPastedItemContentType = @"SLKTextViewPastedItemContentType"; -NSString * const SLKTextViewPastedItemMediaType = @"SLKTextViewPastedItemMediaType"; -NSString * const SLKTextViewPastedItemData = @"SLKTextViewPastedItemData"; - -@interface SLKTextView () - -// The label used as placeholder -@property (nonatomic, strong) UILabel *placeholderLabel; - -// The keyboard commands available for external keyboards -@property (nonatomic, strong) NSArray *keyboardCommands; - -// Used for moving the care up/down -@property (nonatomic) UITextLayoutDirection verticalMoveDirection; -@property (nonatomic) CGRect verticalMoveStartCaretRect; -@property (nonatomic) CGRect verticalMoveLastCaretRect; - -// Used for detecting if the scroll indicator was previously flashed -@property (nonatomic) BOOL didFlashScrollIndicators; - -@end - -@implementation SLKTextView - -#pragma mark - Initialization - -- (instancetype)initWithFrame:(CGRect)frame textContainer:(NSTextContainer *)textContainer -{ - if (self = [super initWithFrame:frame textContainer:textContainer]) { - [self slk_commonInit]; - } - return self; -} - -- (instancetype)initWithCoder:(NSCoder *)coder -{ - if (self = [super initWithCoder:coder]) { - [self slk_commonInit]; - } - return self; -} - -- (void)slk_commonInit -{ - self.pastableMediaTypes = SLKPastableMediaTypeNone; - self.undoManagerEnabled = YES; - - self.font = [UIFont systemFontOfSize:14.0]; - self.editable = YES; - self.selectable = YES; - self.scrollEnabled = YES; - self.scrollsToTop = NO; - self.directionalLockEnabled = YES; - self.dataDetectorTypes = UIDataDetectorTypeNone; - - // UITextView notifications - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slk_didBeginEditing:) name:UITextViewTextDidBeginEditingNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slk_didChangeText:) name:UITextViewTextDidChangeNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slk_didEndEditing:) name:UITextViewTextDidEndEditingNotification object:nil]; - - [self addObserver:self forKeyPath:NSStringFromSelector(@selector(contentSize)) options:NSKeyValueObservingOptionNew context:NULL]; -} - - -#pragma mark - UIView Overrides - -- (CGSize)intrinsicContentSize -{ - return CGSizeMake(UIViewNoIntrinsicMetric, 34.0); -} - -+ (BOOL)requiresConstraintBasedLayout -{ - return YES; -} - -- (void)layoutIfNeeded -{ - [super layoutIfNeeded]; -} - -- (void)layoutSubviews -{ - [super layoutSubviews]; - - self.placeholderLabel.hidden = [self slk_shouldHidePlaceholder]; - - if (!self.placeholderLabel.hidden) { - - [UIView performWithoutAnimation:^{ - self.placeholderLabel.frame = [self slk_placeholderRectThatFits:self.bounds]; - [self sendSubviewToBack:self.placeholderLabel]; - }]; - } -} - - -#pragma mark - Getters - -- (UILabel *)placeholderLabel -{ - if (!_placeholderLabel) - { - _placeholderLabel = [UILabel new]; - _placeholderLabel.clipsToBounds = NO; - _placeholderLabel.autoresizesSubviews = NO; - _placeholderLabel.numberOfLines = 1; - _placeholderLabel.font = self.font; - _placeholderLabel.backgroundColor = [UIColor clearColor]; - _placeholderLabel.textColor = [UIColor lightGrayColor]; - _placeholderLabel.hidden = YES; - - [self addSubview:_placeholderLabel]; - } - return _placeholderLabel; -} - -- (NSString *)placeholder -{ - return self.placeholderLabel.text; -} - -- (UIColor *)placeholderColor -{ - return self.placeholderLabel.textColor; -} - -- (NSUInteger)numberOfLines -{ - return fabs(self.contentSize.height/self.font.lineHeight); -} - -// Returns a different number of lines when landscape and only on iPhone -- (NSUInteger)maxNumberOfLines -{ - if (SLK_IS_IPHONE && SLK_IS_LANDSCAPE) { - return 2.0; - } - return _maxNumberOfLines; -} - -- (BOOL)isTypingSuggestionEnabled -{ - return (self.autocorrectionType == UITextAutocorrectionTypeNo) ? NO : YES; -} - -// Returns only a supported pasted item -- (id)slk_pastedItem -{ - NSString *contentType = [self slk_pasteboardContentType]; - NSData *data = [[UIPasteboard generalPasteboard] dataForPasteboardType:contentType]; - - if (data && [data isKindOfClass:[NSData class]]) - { - SLKPastableMediaType mediaType = SLKPastableMediaTypeFromNSString(contentType); - - NSDictionary *userInfo = @{SLKTextViewPastedItemContentType: contentType, - SLKTextViewPastedItemMediaType: @(mediaType), - SLKTextViewPastedItemData: data}; - return userInfo; - } - if ([[UIPasteboard generalPasteboard] URL]) { - return [[[UIPasteboard generalPasteboard] URL] absoluteString]; - } - if ([[UIPasteboard generalPasteboard] string]) { - return [[UIPasteboard generalPasteboard] string]; - } - - return nil; -} - -// Checks if any supported media found in the general pasteboard -- (BOOL)slk_isPasteboardItemSupported -{ - if ([self slk_pasteboardContentType].length > 0) { - return YES; - } - return NO; -} - -- (NSString *)slk_pasteboardContentType -{ - NSArray *pasteboardTypes = [[UIPasteboard generalPasteboard] pasteboardTypes]; - NSMutableArray *subpredicates = [NSMutableArray new]; - - for (NSString *type in [self slk_supportedMediaTypes]) { - [subpredicates addObject:[NSPredicate predicateWithFormat:@"SELF == %@", type]]; - } - - return [[pasteboardTypes filteredArrayUsingPredicate:[NSCompoundPredicate orPredicateWithSubpredicates:subpredicates]] firstObject]; -} - -- (NSArray *)slk_supportedMediaTypes -{ - if (self.pastableMediaTypes == SLKPastableMediaTypeNone) { - return nil; - } - - NSMutableArray *types = [NSMutableArray new]; - - if (self.pastableMediaTypes & SLKPastableMediaTypePNG) { - [types addObject:NSStringFromSLKPastableMediaType(SLKPastableMediaTypePNG)]; - } - if (self.pastableMediaTypes & SLKPastableMediaTypeJPEG) { - [types addObject:NSStringFromSLKPastableMediaType(SLKPastableMediaTypeJPEG)]; - } - if (self.pastableMediaTypes & SLKPastableMediaTypeTIFF) { - [types addObject:NSStringFromSLKPastableMediaType(SLKPastableMediaTypeTIFF)]; - } - if (self.pastableMediaTypes & SLKPastableMediaTypeGIF) { - [types addObject:NSStringFromSLKPastableMediaType(SLKPastableMediaTypeGIF)]; - } - if (self.pastableMediaTypes & SLKPastableMediaTypeMOV) { - [types addObject:NSStringFromSLKPastableMediaType(SLKPastableMediaTypeMOV)]; - } - if (self.pastableMediaTypes & SLKPastableMediaTypePassbook) { - [types addObject:NSStringFromSLKPastableMediaType(SLKPastableMediaTypePassbook)]; - } - - if (self.pastableMediaTypes & SLKPastableMediaTypeImages) { - [types addObject:NSStringFromSLKPastableMediaType(SLKPastableMediaTypeImages)]; - } - - - return types; -} - -NSString *NSStringFromSLKPastableMediaType(SLKPastableMediaType type) -{ - if (type == SLKPastableMediaTypePNG) { - return @"public.png"; - } - if (type == SLKPastableMediaTypeJPEG) { - return @"public.jpeg"; - } - if (type == SLKPastableMediaTypeTIFF) { - return @"public.tiff"; - } - if (type == SLKPastableMediaTypeGIF) { - return @"com.compuserve.gif"; - } - if (type == SLKPastableMediaTypeMOV) { - return @"com.apple.quicktime"; - } - if (type == SLKPastableMediaTypePassbook) { - return @"com.apple.pkpass"; - } - if (type == SLKPastableMediaTypeImages) { - return @"com.apple.uikit.image"; - } - - return nil; -} - -SLKPastableMediaType SLKPastableMediaTypeFromNSString(NSString *string) -{ - if ([string isEqualToString:NSStringFromSLKPastableMediaType(SLKPastableMediaTypePNG)]) { - return SLKPastableMediaTypePNG; - } - if ([string isEqualToString:NSStringFromSLKPastableMediaType(SLKPastableMediaTypeJPEG)]) { - return SLKPastableMediaTypeJPEG; - } - if ([string isEqualToString:NSStringFromSLKPastableMediaType(SLKPastableMediaTypeTIFF)]) { - return SLKPastableMediaTypeTIFF; - } - if ([string isEqualToString:NSStringFromSLKPastableMediaType(SLKPastableMediaTypeGIF)]) { - return SLKPastableMediaTypeGIF; - } - if ([string isEqualToString:NSStringFromSLKPastableMediaType(SLKPastableMediaTypeMOV)]) { - return SLKPastableMediaTypeMOV; - } - if ([string isEqualToString:NSStringFromSLKPastableMediaType(SLKPastableMediaTypePassbook)]) { - return SLKPastableMediaTypePassbook; - } - if ([string isEqualToString:NSStringFromSLKPastableMediaType(SLKPastableMediaTypeImages)]) { - return SLKPastableMediaTypeImages; - } - return SLKPastableMediaTypeNone; -} - -- (BOOL)isExpanding -{ - if (self.numberOfLines >= self.maxNumberOfLines) { - return YES; - } - return NO; -} - -- (BOOL)slk_shouldHidePlaceholder -{ - if (self.placeholder.length == 0 || self.text.length > 0) { - return YES; - } - return NO; -} - -- (CGRect)slk_placeholderRectThatFits:(CGRect)bounds -{ - CGRect rect = CGRectZero; - rect.size = [self.placeholderLabel sizeThatFits:bounds.size]; - rect.origin = UIEdgeInsetsInsetRect(bounds, self.textContainerInset).origin; - - CGFloat padding = self.textContainer.lineFragmentPadding; - rect.origin.x += padding; - - return rect; -} - - -#pragma mark - Setters - -- (void)setPlaceholder:(NSString *)placeholder -{ - self.placeholderLabel.text = placeholder; - - [self setNeedsLayout]; -} - -- (void)setPlaceholderColor:(UIColor *)color -{ - self.placeholderLabel.textColor = color; -} - -- (void)setUndoManagerEnabled:(BOOL)enabled -{ - if (self.undoManagerEnabled == enabled) { - return; - } - - self.undoManager.levelsOfUndo = 10; - [self.undoManager removeAllActions]; - [self.undoManager setActionIsDiscardable:YES]; - - _undoManagerEnabled = enabled; -} - -- (void)setTypingSuggestionEnabled:(BOOL)enabled -{ - if (self.isTypingSuggestionEnabled == enabled) { - return; - } - - self.autocorrectionType = enabled ? UITextAutocorrectionTypeDefault : UITextAutocorrectionTypeNo; - self.spellCheckingType = enabled ? UITextSpellCheckingTypeDefault : UITextSpellCheckingTypeNo; - - [self refreshFirstResponder]; -} - - -#pragma mark - UITextView Overrides - -- (void)setSelectedRange:(NSRange)selectedRange -{ - [super setSelectedRange:selectedRange]; -} - -- (void)setSelectedTextRange:(UITextRange *)selectedTextRange -{ - [super setSelectedTextRange:selectedTextRange]; - - [[NSNotificationCenter defaultCenter] postNotificationName:SLKTextViewSelectedRangeDidChangeNotification object:self userInfo:nil]; -} - -- (void)setText:(NSString *)text -{ - // Registers for undo management - [self slk_prepareForUndo:@"Text Set"]; - - [super setText:text]; - - [[NSNotificationCenter defaultCenter] postNotificationName:UITextViewTextDidChangeNotification object:self]; -} - -- (void)setAttributedText:(NSAttributedString *)attributedText -{ - // Registers for undo management - [self slk_prepareForUndo:@"Attributed Text Set"]; - - [super setAttributedText:attributedText]; -} - -- (void)setFont:(UIFont *)font -{ - [super setFont:font]; - - // Updates the placeholder font too - self.placeholderLabel.font = self.font; -} - -- (void)setTextAlignment:(NSTextAlignment)textAlignment -{ - [super setTextAlignment:textAlignment]; - - // Updates the placeholder text alignment too - self.placeholderLabel.textAlignment = textAlignment; -} - - -#pragma mark - UITextInputTraits Overrides - -- (void)insertText:(NSString *)text -{ - [super insertText:text]; -} - - -#pragma mark - UIResponder Overrides - -- (BOOL)canBecomeFirstResponder -{ - // Adds undo/redo items to the Menu Controller - if (self.undoManagerEnabled) { - UIMenuItem *undo = [[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"Undo", nil) action:@selector(slk_undo:)]; - UIMenuItem *redo = [[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"Redo", nil) action:@selector(slk_redo:)]; - [[UIMenuController sharedMenuController] setMenuItems:@[undo,redo]]; - } - - return [super canBecomeFirstResponder]; -} - -- (BOOL)becomeFirstResponder -{ - return [super becomeFirstResponder]; -} - -- (BOOL)canResignFirstResponder -{ - // Removes undo/redo items - if (self.undoManagerEnabled) { - [[UIMenuController sharedMenuController] setMenuItems:@[]]; - [self.undoManager removeAllActions]; - } - - return [super canResignFirstResponder]; -} - -- (BOOL)resignFirstResponder -{ - return [super resignFirstResponder]; -} - -- (BOOL)canPerformAction:(SEL)action withSender:(id)sender -{ - if (action == @selector(delete:)) { - return NO; - } - - if ((action == @selector(copy:) || action == @selector(cut:)) - && self.selectedRange.length > 0) { - return YES; - } - - if (action == @selector(paste:) && [self slk_isPasteboardItemSupported]) { - return YES; - } - - if (self.undoManagerEnabled) { - if (action == @selector(slk_undo:)) { - if (self.undoManager.undoActionIsDiscardable) { - return NO; - } - return [self.undoManager canUndo]; - } - if (action == @selector(slk_redo:)) { - if (self.undoManager.redoActionIsDiscardable) { - return NO; - } - return [self.undoManager canRedo]; - } - } - - return [super canPerformAction:action withSender:sender]; -} - -- (void)paste:(id)sender -{ - id pastedItem = [self slk_pastedItem]; - - if ([pastedItem isKindOfClass:[NSDictionary class]]) { - [[NSNotificationCenter defaultCenter] postNotificationName:SLKTextViewDidPasteItemNotification object:nil userInfo:pastedItem]; - } - else if ([pastedItem isKindOfClass:[NSString class]]) { - // Respect the delegate yo! - if (self.delegate && [self.delegate respondsToSelector:@selector(textView:shouldChangeTextInRange:replacementText:)]) { - if (![self.delegate textView:self shouldChangeTextInRange:self.selectedRange replacementText:pastedItem]) { - return; - } - } - - // Inserting the text fixes a UITextView bug whitch automatically scrolls to the bottom - // and beyond scroll content size sometimes when the text is too long - [self slk_insertTextAtCaretRange:pastedItem]; - } -} - - -#pragma mark - Custom Actions - -- (void)slk_flashScrollIndicatorsIfNeeded -{ - if (self.numberOfLines == self.maxNumberOfLines+1) { - if (!_didFlashScrollIndicators) { - _didFlashScrollIndicators = YES; - [super flashScrollIndicators]; - } - } - else if (_didFlashScrollIndicators) { - _didFlashScrollIndicators = NO; - } -} - -- (void)refreshFirstResponder -{ - if (!self.isFirstResponder) { - return; - } - - _didNotResignFirstResponder = YES; - [self resignFirstResponder]; - - _didNotResignFirstResponder = NO; - [self becomeFirstResponder]; -} - -- (void)refreshInputViews -{ - _didNotResignFirstResponder = YES; - - [super reloadInputViews]; - - _didNotResignFirstResponder = NO; -} - -- (void)slk_undo:(id)sender -{ - [self.undoManager undo]; -} - -- (void)slk_redo:(id)sender -{ - [self.undoManager redo]; -} - - -#pragma mark - Notification Events - -- (void)slk_didBeginEditing:(NSNotification *)notification -{ - if (![notification.object isEqual:self]) { - return; - } - - // Do something -} - -- (void)slk_didChangeText:(NSNotification *)notification -{ - if (![notification.object isEqual:self]) { - return; - } - - if (self.placeholderLabel.hidden != [self slk_shouldHidePlaceholder]) { - [self setNeedsLayout]; - } - - [self slk_flashScrollIndicatorsIfNeeded]; -} - -- (void)slk_didEndEditing:(NSNotification *)notification -{ - if (![notification.object isEqual:self]) { - return; - } - - // Do something -} - - -#pragma mark - KVO Listener - -- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context -{ - if ([object isEqual:self] && [keyPath isEqualToString:NSStringFromSelector(@selector(contentSize))]) { - [[NSNotificationCenter defaultCenter] postNotificationName:SLKTextViewContentSizeDidChangeNotification object:self userInfo:nil]; - } - else { - [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; - } -} - - -#pragma mark - Motion Events - -- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event -{ - if (event.type == UIEventTypeMotion && event.subtype == UIEventSubtypeMotionShake) { - [[NSNotificationCenter defaultCenter] postNotificationName:SLKTextViewDidShakeNotification object:self]; - } -} - - -#pragma mark - External Keyboard Support - -- (NSArray *)keyCommands -{ - if (_keyboardCommands) { - return _keyboardCommands; - } - - _keyboardCommands = @[ - // Return - [UIKeyCommand keyCommandWithInput:@"\r" modifierFlags:UIKeyModifierShift action:@selector(slk_didPressLineBreakKeys:)], - [UIKeyCommand keyCommandWithInput:@"\r" modifierFlags:UIKeyModifierAlternate action:@selector(slk_didPressLineBreakKeys:)], - [UIKeyCommand keyCommandWithInput:@"\r" modifierFlags:UIKeyModifierControl action:@selector(slk_didPressLineBreakKeys:)], - - // Undo/Redo - [UIKeyCommand keyCommandWithInput:@"z" modifierFlags:UIKeyModifierCommand action:@selector(slk_didPressCommandZKeys:)], - [UIKeyCommand keyCommandWithInput:@"z" modifierFlags:UIKeyModifierShift|UIKeyModifierCommand action:@selector(slk_didPressCommandZKeys:)], - ]; - - return _keyboardCommands; -} - - -#pragma mark Line Break - -- (void)slk_didPressLineBreakKeys:(id)sender -{ - [self slk_insertNewLineBreak]; -} - - -#pragma mark Undo/Redo Text - -- (void)slk_didPressCommandZKeys:(id)sender -{ - if (!self.undoManagerEnabled) { - return; - } - - UIKeyCommand *keyCommand = (UIKeyCommand *)sender; - - if ((keyCommand.modifierFlags & UIKeyModifierShift) > 0) { - - if ([self.undoManager canRedo]) { - [self.undoManager redo]; - } - } - else { - if ([self.undoManager canUndo]) { - [self.undoManager undo]; - } - } -} - -#pragma mark Up/Down Cursor Movement - -- (void)didPressAnyArrowKey:(id)sender -{ - if (self.text.length == 0 || self.numberOfLines < 2) { - return; - } - - UIKeyCommand *keyCommand = (UIKeyCommand *)sender; - - if ([keyCommand.input isEqualToString:UIKeyInputUpArrow]) { - [self slk_moveCursorTodirection:UITextLayoutDirectionUp]; - } - else if ([keyCommand.input isEqualToString:UIKeyInputDownArrow]) { - [self slk_moveCursorTodirection:UITextLayoutDirectionDown]; - } -} - -- (void)slk_moveCursorTodirection:(UITextLayoutDirection)direction -{ - UITextPosition *start = (direction == UITextLayoutDirectionUp) ? self.selectedTextRange.start : self.selectedTextRange.end; - - if ([self slk_isNewVerticalMovementForPosition:start inDirection:direction]) { - self.verticalMoveDirection = direction; - self.verticalMoveStartCaretRect = [self caretRectForPosition:start]; - } - - if (start) { - - UITextPosition *end = [self slk_closestPositionToPosition:start inDirection:direction]; - - if (end) { - self.verticalMoveLastCaretRect = [self caretRectForPosition:end]; - self.selectedTextRange = [self textRangeFromPosition:end toPosition:end]; - - [self slk_scrollToCaretPositonAnimated:NO]; - } - } -} - -// Based on code from Ruben Cabaco -// https://gist.github.com/rcabaco/6765778 - -- (UITextPosition *)slk_closestPositionToPosition:(UITextPosition *)position inDirection:(UITextLayoutDirection)direction -{ - // Only up/down are implemented. No real need for left/right since that is native to UITextInput. - NSParameterAssert(direction == UITextLayoutDirectionUp || direction == UITextLayoutDirectionDown); - - // Translate the vertical direction to a horizontal direction. - UITextLayoutDirection lookupDirection = (direction == UITextLayoutDirectionUp) ? UITextLayoutDirectionLeft : UITextLayoutDirectionRight; - - // Walk one character at a time in `lookupDirection` until the next line is reached. - UITextPosition *checkPosition = position; - UITextPosition *closestPosition = position; - CGRect startingCaretRect = [self caretRectForPosition:position]; - CGRect nextLineCaretRect; - BOOL isInNextLine = NO; - - while (YES) { - UITextPosition *nextPosition = [self positionFromPosition:checkPosition inDirection:lookupDirection offset:1]; - - // End of line. - if (!nextPosition || [self comparePosition:checkPosition toPosition:nextPosition] == NSOrderedSame) { - break; - } - - checkPosition = nextPosition; - CGRect checkRect = [self caretRectForPosition:checkPosition]; - if (CGRectGetMidY(startingCaretRect) != CGRectGetMidY(checkRect)) { - // While on the next line stop just above/below the starting position. - if (lookupDirection == UITextLayoutDirectionLeft && CGRectGetMidX(checkRect) <= CGRectGetMidX(self.verticalMoveStartCaretRect)) { - closestPosition = checkPosition; - break; - } - if (lookupDirection == UITextLayoutDirectionRight && CGRectGetMidX(checkRect) >= CGRectGetMidX(self.verticalMoveStartCaretRect)) { - closestPosition = checkPosition; - break; - } - // But don't skip lines. - if (isInNextLine && CGRectGetMidY(checkRect) != CGRectGetMidY(nextLineCaretRect)) { - break; - } - - isInNextLine = YES; - nextLineCaretRect = checkRect; - closestPosition = checkPosition; - } - } - return closestPosition; -} - -- (BOOL)slk_isNewVerticalMovementForPosition:(UITextPosition *)position inDirection:(UITextLayoutDirection)direction -{ - CGRect caretRect = [self caretRectForPosition:position]; - BOOL noPreviousStartPosition = CGRectEqualToRect(self.verticalMoveStartCaretRect, CGRectZero); - BOOL caretMovedSinceLastPosition = !CGRectEqualToRect(caretRect, self.verticalMoveLastCaretRect); - BOOL directionChanged = self.verticalMoveDirection != direction; - - BOOL newMovement = noPreviousStartPosition || caretMovedSinceLastPosition || directionChanged; - return newMovement; -} - - -#pragma mark - Lifeterm - -- (void)dealloc -{ - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - [self removeObserver:self forKeyPath:NSStringFromSelector(@selector(contentSize))]; - - _placeholderLabel = nil; -} - -@end diff --git a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKTextViewController.h b/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKTextViewController.h deleted file mode 100644 index cc7aedb2a..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKTextViewController.h +++ /dev/null @@ -1,468 +0,0 @@ -// -// Copyright 2014 Slack Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import <Foundation/Foundation.h> -#import <UIKit/UIKit.h> - -#import "SLKTextInputbar.h" -#import "SLKTypingIndicatorView.h" -#import "SLKTextView.h" - -#import "SLKTextView+SLKAdditions.h" -#import "UIScrollView+SLKAdditions.h" -#import "UIView+SLKAdditions.h" - -#import "SLKUIConstants.h" - -/** - UIKeyboard notification replacement, posting reliably only when showing/hiding the keyboard (not when resizing keyboard, or with inputAccessoryView reloads, etc). - Only triggered when using SLKTextViewController's text view. - */ -UIKIT_EXTERN NSString *const SLKKeyboardWillShowNotification; -UIKIT_EXTERN NSString *const SLKKeyboardDidShowNotification; -UIKIT_EXTERN NSString *const SLKKeyboardWillHideNotification; -UIKIT_EXTERN NSString *const SLKKeyboardDidHideNotification; - -typedef NS_ENUM(NSUInteger, SLKKeyboardStatus) { - SLKKeyboardStatusDidHide, - SLKKeyboardStatusWillShow, - SLKKeyboardStatusDidShow, - SLKKeyboardStatusWillHide -}; - -/** @name A drop-in UIViewController subclass with a growing text input view and other useful messaging features. */ -NS_CLASS_AVAILABLE_IOS(7_0) @interface SLKTextViewController : UIViewController <UITextViewDelegate, UITableViewDelegate, UITableViewDataSource, UICollectionViewDelegate, UICollectionViewDataSource, UIGestureRecognizerDelegate, UIAlertViewDelegate> - -/** The main table view managed by the controller object. Created by default initializing with -init or initWithNibName:bundle: */ -@property (nonatomic, readonly) UITableView *tableView; - -/** The main collection view managed by the controller object. Not nil if the controller is initialised with -initWithCollectionViewLayout: */ -@property (nonatomic, readonly) UICollectionView *collectionView; - -/** The main scroll view managed by the controller object. Not nil if the controller is initialised with -initWithScrollView: */ -@property (nonatomic, readonly) UIScrollView *scrollView; - -/** The bottom toolbar containing a text view and buttons. */ -@property (nonatomic, readonly) SLKTextInputbar *textInputbar; - -/** The typing indicator used to display user names horizontally. */ -@property (nonatomic, readonly) SLKTypingIndicatorView *typingIndicatorView; - -/** A single tap gesture used to dismiss the keyboard. */ -@property (nonatomic, readonly) UIGestureRecognizer *singleTapGesture; - -/** A vertical pan gesture used for bringing the keyboard from the bottom. */ -@property (nonatomic, readonly) UIPanGestureRecognizer *verticalPanGesture; - -/** YES if control's animation should have bouncy effects. Default is YES. */ -@property (nonatomic, assign) BOOL bounces; - -/** YES if text view's content can be cleaned with a shake gesture. Default is NO. */ -@property (nonatomic, assign) BOOL shakeToClearEnabled; - -/** YES if keyboard can be dismissed gradually with a vertical panning gesture. Default is YES. */ -@property (nonatomic, assign, getter = isKeyboardPanningEnabled) BOOL keyboardPanningEnabled; - -/** YES if an external keyboard has been detected (this value updates only when the text view becomes first responder). */ -@property (nonatomic, readonly) BOOL isExternalKeyboardDetected; - -/** YES if after right button press, the text view is cleared out. Default is YES. */ -@property (nonatomic, assign) BOOL shouldClearTextAtRightButtonPress; - -/** YES if the text input bar should still move up/down when other text inputs interacts with the keyboard. Default is NO. */ -@property (nonatomic, assign) BOOL shouldForceTextInputbarAdjustment DEPRECATED_MSG_ATTRIBUTE("Use -forceTextInputbarAdjustmentForResponder:"); - -/** YES if the scrollView should scroll to bottom when the keyboard is shown. Default is NO.*/ -@property (nonatomic, assign) BOOL shouldScrollToBottomAfterKeyboardShows; - -/** - YES if the main table view is inverted. Default is YES. - This allows the table view to start from the bottom like any typical messaging interface. - If inverted, you must assign the same transform property to your cells to match the orientation (ie: cell.transform = tableView.transform;) - Inverting the table view will enable some great features such as content offset corrections automatically when resizing the text input and/or showing autocompletion. - - Updating this value also changes 'edgesForExtendedLayout' value. When inverted, it must be UIRectEdgeNone, to display correctly all the elements. Otherwise, UIRectEdgeAll is set. - */ -@property (nonatomic, assign, getter = isInverted) BOOL inverted; - -/** YES if the view controller is presented inside of a popover controller. If YES, the keyboard won't move the text input bar and tapping on the tableView/collectionView will not cause the keyboard to be dismissed. This property is compatible only with iPad. */ -@property (nonatomic, assign, getter = isPresentedInPopover) BOOL presentedInPopover; - -/** Convenience accessors (accessed through the text input bar) */ -@property (nonatomic, readonly) SLKTextView *textView; -@property (nonatomic, readonly) UIButton *leftButton; -@property (nonatomic, readonly) UIButton *rightButton; - - -#pragma mark - Initialization -///------------------------------------------------ -/// @name Initialization -///------------------------------------------------ - -/** - Initializes a text view controller to manage a table view of a given style. - If you use the standard -init method, a table view with plain style will be created. - - @param style A constant that specifies the style of main table view that the controller object is to manage (UITableViewStylePlain or UITableViewStyleGrouped). - @return An initialized SLKTextViewController object or nil if the object could not be created. - */ -- (instancetype)initWithTableViewStyle:(UITableViewStyle)style SLK_DESIGNATED_INITIALIZER; - -/** - Initializes a collection view controller and configures the collection view with the provided layout. - If you use the standard -init method, a table view with plain style will be created. - - @param layout The layout object to associate with the collection view. The layout controls how the collection view presents its cells and supplementary views. - @return An initialized SLKTextViewController object or nil if the object could not be created. - */ -- (instancetype)initWithCollectionViewLayout:(UICollectionViewLayout *)layout SLK_DESIGNATED_INITIALIZER; - -/** - Initializes a text view controller to manage an arbitraty scroll view. The caller is responsible for configuration of the scroll view, including wiring the delegate. - - @param a UISCrollView to be used as the main content area. - @return An initialized SLKTextViewController object or nil if the object could not be created. - */ -- (instancetype)initWithScrollView:(UIScrollView *)scrollView SLK_DESIGNATED_INITIALIZER; - -/** - Initializes either a table or collection view controller. - You must override either +tableViewStyleForCoder: or +collectionViewLayoutForCoder: to define witch view to be layed out. - - @param decoder An unarchiver object. - @return An initialized SLKTextViewController object or nil if the object could not be created. - */ -- (instancetype)initWithCoder:(NSCoder *)decoder SLK_DESIGNATED_INITIALIZER; - -/** - Returns the tableView style to be configured when using Interface Builder. Default is UITableViewStylePlain. - You must override this method if you want to configure a tableView. - - @param decoder An unarchiver object. - @return The tableView style to be used in the new instantiated tableView. - */ -+ (UITableViewStyle)tableViewStyleForCoder:(NSCoder *)decoder; - -/** - Returns the tableView style to be configured when using Interface Builder. Default is nil. - You must override this method if you want to configure a collectionView. - - @param decoder An unarchiver object. - @return The collectionView style to be used in the new instantiated collectionView. - */ -+ (UICollectionViewLayout *)collectionViewLayoutForCoder:(NSCoder *)decoder; - - -#pragma mark - Keyboard Handling -///------------------------------------------------ -/// @name Keyboard Handling -///------------------------------------------------ - -/** - Presents the keyboard, if not already, animated. - - @param animated YES if the keyboard should show using an animation. - */ -- (void)presentKeyboard:(BOOL)animated; - -/** - Dimisses the keyboard, if not already, animated. - - @param animated YES if the keyboard should be dismissed using an animation. - */ -- (void)dismissKeyboard:(BOOL)animated; - -/** - Verifies if the text input bar should still move up/down even if it is not first responder. Default is NO. - You can override this method to perform additional tasks associated with presenting the view. You don't need call super since this method doesn't do anything. - - @param responder The current first responder object. - @return YES so the text input bar still move up/down. - */ -- (BOOL)forceTextInputbarAdjustmentForResponder:(UIResponder *)responder; - -/** - Notifies the view controller that the keyboard changed status. - You can override this method to perform additional tasks associated with presenting the view. You don't need call super since this method doesn't do anything. - - @param status The new keyboard status. - */ -- (void)didChangeKeyboardStatus:(SLKKeyboardStatus)status; - - -#pragma mark - Interaction Notifications -///------------------------------------------------ -/// @name Interaction Notifications -///------------------------------------------------ - -/** - Notifies the view controller that the text will update. - You can override this method to perform additional tasks associated with text changes. You MUST call super at some point in your implementation. - */ -- (void)textWillUpdate NS_REQUIRES_SUPER; - -/** - Notifies the view controller that the text did update. - You can override this method to perform additional tasks associated with text changes. You MUST call super at some point in your implementation. - - @param If YES, the text input bar will be resized using an animation. - */ -- (void)textDidUpdate:(BOOL)animated NS_REQUIRES_SUPER; - -/** - Notifies the view controller that the text selection did change. - Use this method a replacement of UITextViewDelegate's -textViewDidChangeSelection: which is not reliable enough when using third-party keyboards (they don't forward events properly sometimes). - - You can override this method to perform additional tasks associated with text changes. You MUST call super at some point in your implementation. - */ -- (void)textSelectionDidChange NS_REQUIRES_SUPER; - -/** - Notifies the view controller when the left button's action has been triggered, manually. - You can override this method to perform additional tasks associated with the left button. You don't need call super since this method doesn't do anything. - - @param sender The object calling this method. - */ -- (void)didPressLeftButton:(id)sender; - -/** - Notifies the view controller when the right button's action has been triggered, manually or by using the keyboard return key. - You can override this method to perform additional tasks associated with the right button. You MUST call super at some point in your implementation. - - @param sender The object calling this method. - */ -- (void)didPressRightButton:(id)sender NS_REQUIRES_SUPER; - -/** - Verifies if the right button can be pressed. If NO, the button is disabled. - You can override this method to perform additional tasks. You SHOULD call super to inherit some conditionals. - - @return YES if the right button can be pressed. - */ -- (BOOL)canPressRightButton; - -/** - Notifies the view controller when the user has pasted a supported media content (images and/or videos). - You can override this method to perform additional tasks associated with image/video pasting. You don't need to call super since this method doesn't do anything. - Only supported pastable medias configured in SLKTextView will be forwarded (take a look at SLKPastableMediaType). - - @para userInfo The payload containing the media data, content and media types. - */ -- (void)didPasteMediaContent:(NSDictionary *)userInfo; - -/** - Verifies that the typing indicator view should be shown. Default is YES, if meeting some requierements. - You can override this method to perform additional tasks. You SHOULD call super to inherit some conditionals. - - @return YES if the typing indicator view should be shown. - */ -- (BOOL)canShowTypeIndicator; - -/** - Notifies the view controller when the user has shaked the device for undoing text typing. - You can override this method to perform additional tasks associated with the shake gesture. Calling super will prompt a system alert view with undo option. This will not be called if 'undoShakingEnabled' is set to NO and/or if the text view's content is empty. - */ -- (void)willRequestUndo; - -/** - Notifies the view controller when the user has pressed the Return key (↵) with an external keyboard. - You can override this method to perform additional tasks. You MUST call super at some point in your implementation. - */ -- (void)didPressReturnKey:(id)sender NS_REQUIRES_SUPER; - -/** - Notifies the view controller when the user has pressed the Escape key (Esc) with an external keyboard. - You can override this method to perform additional tasks. You MUST call super at some point in your implementation. - */ -- (void)didPressEscapeKey:(id)sender NS_REQUIRES_SUPER; - -/** - Notifies the view controller when the user has pressed the arrow key with an external keyboard. - You can override this method to perform additional tasks. You MUST call super at some point in your implementation. - */ -- (void)didPressArrowKey:(id)sender NS_REQUIRES_SUPER; - - -#pragma mark - Text Edition -///------------------------------------------------ -/// @name Text Edition -///------------------------------------------------ - -/** YES if the text editing mode is active. */ -@property (nonatomic, readonly, getter = isEditing) BOOL editing; - -/** - Re-uses the text layout for edition, displaying an accessory view on top of the text input bar with options (cancel & save). - You can override this method to perform additional tasks. You MUST call super at some point in your implementation. - - @param text The string text to edit. - */ -- (void)editText:(NSString *)text NS_REQUIRES_SUPER; - -/** - Notifies the view controller when the editing bar's right button's action has been triggered, manually or by using the external keyboard's Return key. - You can override this method to perform additional tasks associated with accepting changes. You MUST call super at some point in your implementation. - - @param sender The object calling this method. - */ -- (void)didCommitTextEditing:(id)sender NS_REQUIRES_SUPER; - -/** - Notifies the view controller when the editing bar's right button's action has been triggered, manually or by using the external keyboard's Esc key. - You can override this method to perform additional tasks associated with accepting changes. You MUST call super at some point in your implementation. - - @param sender The object calling this method. - */ -- (void)didCancelTextEditing:(id)sender NS_REQUIRES_SUPER; - - -#pragma mark - Text Auto-Completion -///------------------------------------------------ -/// @name Text Auto-Completion -///------------------------------------------------ - -/** The table view used to display autocompletion results. */ -@property (nonatomic, readonly) UITableView *autoCompletionView; - -/** The recently found prefix symbol used as prefix for autocompletion mode. */ -@property (nonatomic, readonly, copy) NSString *foundPrefix; - -/** The range of the found prefix in the text view content. */ -@property (nonatomic, readonly) NSRange foundPrefixRange; - -/** The recently found word at the text view's caret position. */ -@property (nonatomic, readonly, copy) NSString *foundWord; - -/** YES if the autocompletion mode is active. */ -@property (nonatomic, readonly, getter = isAutoCompleting) BOOL autoCompleting; - -/** An array containing all the registered prefix strings for autocompletion. */ -@property (nonatomic, readonly, copy) NSArray *registeredPrefixes; - -/** - Registers any string prefix for autocompletion detection, useful for user mentions and/or hashtags autocompletion. - The prefix must be valid NSString (i.e: '@', '#', '\', and so on). This also checks if no repeated prefix is inserted. - - @param prefixes An array of prefix strings. - */ -- (void)registerPrefixesForAutoCompletion:(NSArray *)prefixes; - -/** - Verifies that the autocompletion view should be shown. Default is NO. - To enabled autocompletion, MUST override this method to perform additional tasks, before the autocompletion view is shown (i.e. populating the data source). - - @return YES if the autocompletion view should be shown. - */ -- (BOOL)canShowAutoCompletion; - -/** - Returns a custom height for the autocompletion view. Default is 0.0. - You can override this method to return a custom height. - - @return The autocompletion view's height. - */ -- (CGFloat)heightForAutoCompletionView; - -/** - Returns the maximum height for the autocompletion view. Default is 140 pts. - You can override this method to return a custom max height. - - @return The autocompletion view's max height. - */ -- (CGFloat)maximumHeightForAutoCompletionView; - -/** - Cancels and hides the autocompletion view, animated. - */ -- (void)cancelAutoCompletion; - -/** - Accepts the autocompletion, replacing the detected word with a new string, keeping the prefix. - This method is an abstraction of -acceptAutoCompletionWithString:keepPrefix: - - @param string The string to be used for replacing autocompletion placeholders. - */ -- (void)acceptAutoCompletionWithString:(NSString *)string; - -/** - Accepts the autocompletion, replacing the detected word with a new string, and optionally replacing the prefix too. - - @param string The string to be used for replacing autocompletion placeholders. - @param keepPrefix YES if the prefix shouldn't be replaced. - */ -- (void)acceptAutoCompletionWithString:(NSString *)string keepPrefix:(BOOL)keepPrefix; - - -#pragma mark - Text Caching -///------------------------------------------------ -/// @name Text Caching -///------------------------------------------------ - -/** - Returns the key to be associated with a given text to be cached. Default is nil. - To enable text caching, you must override this method to return valid key. - The text view will be populated automatically when the view controller is configured. - You don't need call super since this method doesn't do anything. - - @return The key for which to enable text caching. - */ -- (id)keyForTextCaching; - -/** - Removes the current's vien controller cached text. - To enable this, you must return a valid key string in -keyForTextCaching. - */ -- (void)clearCachedText; - -/** - Removes all the cached text from disk. - */ -+ (void)clearAllCachedText; - - -#pragma mark - Customization -///------------------------------------------------ -/// @name Customization -///------------------------------------------------ - -/** - Registers a class for customizing the behavior and appearance of the text view. - You need to call this method inside of any initialization method. - - @param textViewClass A SLKTextView subclass. - */ -- (void)registerClassForTextView:(Class)textViewClass; - - -#pragma mark - Delegate Methods Requiring Super -///------------------------------------------------ -/// @name Delegate Methods Requiring Super -///------------------------------------------------ - -/** UITextViewDelegate */ -- (BOOL)textView:(SLKTextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text NS_REQUIRES_SUPER; - -/** UIScrollViewDelegate */ -- (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollView NS_REQUIRES_SUPER; -- (void)scrollViewDidScroll:(UIScrollView *)scrollView NS_REQUIRES_SUPER; - -/** UIGestureRecognizerDelegate */ -- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer NS_REQUIRES_SUPER; - -/** UIAlertViewDelegate */ -- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex NS_REQUIRES_SUPER; - -@end diff --git a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKTextViewController.m b/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKTextViewController.m deleted file mode 100644 index 677d0267c..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKTextViewController.m +++ /dev/null @@ -1,1956 +0,0 @@ -// -// Copyright 2014 Slack Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import "SLKTextViewController.h" -#import "SLKInputAccessoryView.h" -#import "UIResponder+SLKAdditions.h" -#import "SLKUIConstants.h" - -NSString * const SLKKeyboardWillShowNotification = @"SLKKeyboardWillShowNotification"; -NSString * const SLKKeyboardDidShowNotification = @"SLKKeyboardDidShowNotification"; -NSString * const SLKKeyboardWillHideNotification = @"SLKKeyboardWillHideNotification"; -NSString * const SLKKeyboardDidHideNotification = @"SLKKeyboardDidHideNotification"; - -NSInteger const SLKAlertViewClearTextTag = 1534347677; // absolute hash of 'SLKTextViewController' string - -@interface SLKTextViewController () -{ - CGPoint _scrollViewOffsetBeforeDragging; - CGFloat _keyboardHeightBeforeDragging; -} - -// The shared scrollView pointer, either a tableView or collectionView -@property (nonatomic, weak) UIScrollView *scrollViewProxy; - -// A hairline displayed on top of the auto-completion view, to better separate the content from the control. -@property (nonatomic, strong) UIView *autoCompletionHairline; - -// Auto-Layout height constraints used for updating their constants -@property (nonatomic, strong) NSLayoutConstraint *scrollViewHC; -@property (nonatomic, strong) NSLayoutConstraint *textInputbarHC; -@property (nonatomic, strong) NSLayoutConstraint *typingIndicatorViewHC; -@property (nonatomic, strong) NSLayoutConstraint *autoCompletionViewHC; -@property (nonatomic, strong) NSLayoutConstraint *keyboardHC; - -// The keyboard commands available for external keyboards -@property (nonatomic, strong) NSArray *keyboardCommands; - -// YES if the user is moving the keyboard with a gesture -@property (nonatomic, assign, getter = isMovingKeyboard) BOOL movingKeyboard; - -// The setter of isExternalKeyboardDetected, for private use. -@property (nonatomic, assign) BOOL externalKeyboardDetected; - -// The current keyboard status (hidden, showing, etc.) -@property (nonatomic) SLKKeyboardStatus keyboardStatus; - -// YES if a new word has been typed recently -@property (nonatomic) BOOL newWordInserted; - -// YES if the view controller did appear and everything is finished configurating. This allows blocking some layout animations among other things. -@property (nonatomic, getter=isViewVisible) BOOL viewVisible; - -// The setter of isExternalKeyboardDetected, for private use. -@property (nonatomic, getter = isRotating) BOOL rotating; - -// The subclass of SLKTextView class to use -@property (nonatomic, strong) Class textViewClass; - -@end - -@implementation SLKTextViewController -@synthesize tableView = _tableView; -@synthesize collectionView = _collectionView; -@synthesize scrollView = _scrollView; -@synthesize typingIndicatorView = _typingIndicatorView; -@synthesize textInputbar = _textInputbar; -@synthesize autoCompletionView = _autoCompletionView; -@synthesize autoCompleting = _autoCompleting; -@synthesize scrollViewProxy = _scrollViewProxy; -@synthesize presentedInPopover = _presentedInPopover; - -#pragma mark - Initializer - -- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil -{ - return [self initWithTableViewStyle:UITableViewStylePlain]; -} - -- (instancetype)init -{ - return [self initWithTableViewStyle:UITableViewStylePlain]; -} - -- (instancetype)initWithTableViewStyle:(UITableViewStyle)style -{ - NSAssert([self class] != [SLKTextViewController class], @"Oops! You must subclass SLKTextViewController."); - - if (self = [super initWithNibName:nil bundle:nil]) - { - self.scrollViewProxy = [self tableViewWithStyle:style]; - [self slk_commonInit]; - } - return self; -} - -- (instancetype)initWithCollectionViewLayout:(UICollectionViewLayout *)layout -{ - NSAssert([self class] != [SLKTextViewController class], @"Oops! You must subclass SLKTextViewController."); - - if (self = [super initWithNibName:nil bundle:nil]) - { - self.scrollViewProxy = [self collectionViewWithLayout:layout]; - [self slk_commonInit]; - } - return self; -} - -- (instancetype)initWithScrollView:(UIScrollView *)scrollView -{ - NSAssert([self class] != [SLKTextViewController class], @"Oops! You must subclass SLKTextViewController."); - - if (self = [super initWithNibName:nil bundle:nil]) - { - _scrollView = scrollView; - _scrollView.translatesAutoresizingMaskIntoConstraints = NO; // Makes sure the scrollView plays nice with auto-layout - - self.scrollViewProxy = _scrollView; - [self slk_commonInit]; - } - return self; -} - -- (instancetype)initWithCoder:(NSCoder *)decoder -{ - NSAssert([self class] != [SLKTextViewController class], @"Oops! You must subclass SLKTextViewController."); - - if (self = [super initWithCoder:decoder]) - { - UITableViewStyle tableViewStyle = [[self class] tableViewStyleForCoder:decoder]; - UICollectionViewLayout *collectionViewLayout = [[self class] collectionViewLayoutForCoder:decoder]; - - if ([collectionViewLayout isKindOfClass:[UICollectionViewLayout class]]) { - self.scrollViewProxy = [self collectionViewWithLayout:collectionViewLayout]; - } - else { - self.scrollViewProxy = [self tableViewWithStyle:tableViewStyle]; - } - - [self slk_commonInit]; - } - return self; -} - -- (void)slk_commonInit -{ - [self slk_registerNotifications]; - - self.bounces = YES; - self.inverted = YES; - self.shakeToClearEnabled = NO; - self.keyboardPanningEnabled = YES; - self.shouldClearTextAtRightButtonPress = YES; - self.shouldScrollToBottomAfterKeyboardShows = NO; -} - - -#pragma mark - View lifecycle - -- (void)viewDidLoad -{ - [super viewDidLoad]; - - [self.view addSubview:self.scrollViewProxy]; - [self.view addSubview:self.autoCompletionView]; - [self.view addSubview:self.typingIndicatorView]; - [self.view addSubview:self.textInputbar]; - - [self slk_setupViewConstraints]; -} - -- (void)viewWillAppear:(BOOL)animated -{ - [super viewWillAppear:animated]; - - // Invalidates this flag when the view appears - self.textView.didNotResignFirstResponder = NO; - - [UIView performWithoutAnimation:^{ - // Reloads any cached text - [self slk_reloadTextView]; - }]; - - // Helps laying out subviews with recently added constraints. - [self.view layoutIfNeeded]; -} - -- (void)viewDidAppear:(BOOL)animated -{ - [super viewDidAppear:animated]; - - [self.scrollViewProxy flashScrollIndicators]; - - self.viewVisible = YES; -} - -- (void)viewWillDisappear:(BOOL)animated -{ - [super viewWillDisappear:animated]; - - // Stops the keyboard from being dismissed during the navigation controller's "swipe-to-pop" - self.textView.didNotResignFirstResponder = self.isMovingFromParentViewController; - - self.viewVisible = NO; - - // Caches the text before it's too late! - [self slk_cacheTextView]; -} - -- (void)viewDidDisappear:(BOOL)animated -{ - [super viewDidDisappear:animated]; -} - -- (void)viewWillLayoutSubviews -{ - [super viewWillLayoutSubviews]; - - [self slk_adjustContentConfigurationIfNeeded]; -} - -- (void)viewDidLayoutSubviews -{ - [super viewDidLayoutSubviews]; -} - - -#pragma mark - Getters - -+ (UITableViewStyle)tableViewStyleForCoder:(NSCoder *)decoder -{ - return UITableViewStylePlain; -} - -+ (UICollectionViewLayout *)collectionViewLayoutForCoder:(NSCoder *)decoder -{ - return nil; -} - -- (UITableView *)tableViewWithStyle:(UITableViewStyle)style -{ - if (!_tableView) - { - _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:style]; - _tableView.translatesAutoresizingMaskIntoConstraints = NO; - _tableView.backgroundColor = [UIColor whiteColor]; - _tableView.scrollsToTop = YES; - _tableView.dataSource = self; - _tableView.delegate = self; - } - return _tableView; -} - -- (UICollectionView *)collectionViewWithLayout:(UICollectionViewLayout *)layout -{ - if (!_collectionView) - { - _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; - _collectionView.translatesAutoresizingMaskIntoConstraints = NO; - _collectionView.backgroundColor = [UIColor whiteColor]; - _collectionView.scrollsToTop = YES; - _collectionView.dataSource = self; - _collectionView.delegate = self; - } - return _collectionView; -} - -- (UITableView *)autoCompletionView -{ - if (!_autoCompletionView) - { - _autoCompletionView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain]; - _autoCompletionView.translatesAutoresizingMaskIntoConstraints = NO; - _autoCompletionView.backgroundColor = [UIColor colorWithWhite:0.97 alpha:1.0]; - _autoCompletionView.scrollsToTop = NO; - _autoCompletionView.dataSource = self; - _autoCompletionView.delegate = self; - - CGRect rect = CGRectZero; - rect.size = CGSizeMake(CGRectGetWidth(self.view.frame), 0.5); - - _autoCompletionHairline = [[UIView alloc] initWithFrame:rect]; - _autoCompletionHairline.autoresizingMask = UIViewAutoresizingFlexibleWidth; - _autoCompletionHairline.backgroundColor = _autoCompletionView.separatorColor; - [_autoCompletionView addSubview:_autoCompletionHairline]; - } - return _autoCompletionView; -} - -- (SLKTextInputbar *)textInputbar -{ - if (!_textInputbar) - { - _textInputbar = [[SLKTextInputbar alloc] initWithTextViewClass:self.textViewClass]; - _textInputbar.translatesAutoresizingMaskIntoConstraints = NO; - _textInputbar.controller = self; - - [_textInputbar.leftButton addTarget:self action:@selector(didPressLeftButton:) forControlEvents:UIControlEventTouchUpInside]; - [_textInputbar.rightButton addTarget:self action:@selector(didPressRightButton:) forControlEvents:UIControlEventTouchUpInside]; - [_textInputbar.editortLeftButton addTarget:self action:@selector(didCancelTextEditing:) forControlEvents:UIControlEventTouchUpInside]; - [_textInputbar.editortRightButton addTarget:self action:@selector(didCommitTextEditing:) forControlEvents:UIControlEventTouchUpInside]; - - _textInputbar.textView.delegate = self; - - _verticalPanGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(slk_didPanTextView:)]; - _verticalPanGesture.delegate = self; - - [_textInputbar.textView addGestureRecognizer:self.verticalPanGesture]; - } - return _textInputbar; -} - -- (SLKTypingIndicatorView *)typingIndicatorView -{ - if (!_typingIndicatorView) - { - _typingIndicatorView = [SLKTypingIndicatorView new]; - _typingIndicatorView.translatesAutoresizingMaskIntoConstraints = NO; - _typingIndicatorView.canResignByTouch = NO; - } - return _typingIndicatorView; -} - -- (BOOL)isExternalKeyboardDetected -{ - return _externalKeyboardDetected; -} - -- (BOOL)isPresentedInPopover -{ - return _presentedInPopover && SLK_IS_IPAD; -} - -- (SLKTextView *)textView -{ - return self.textInputbar.textView; -} - -- (UIButton *)leftButton -{ - return self.textInputbar.leftButton; -} - -- (UIButton *)rightButton -{ - return self.textInputbar.rightButton; -} - -- (SLKInputAccessoryView *)emptyInputAccessoryView -{ - if (!self.isKeyboardPanningEnabled) { - return nil; - } - - SLKInputAccessoryView *view = [[SLKInputAccessoryView alloc] initWithFrame:self.textInputbar.bounds]; - view.backgroundColor = [UIColor clearColor]; - view.userInteractionEnabled = NO; - -#if SLK_INPUT_ACCESSORY_DEBUG - view.backgroundColor = [[UIColor redColor] colorWithAlphaComponent:0.5]; -#endif - - return view; -} - -- (UIModalPresentationStyle)modalPresentationStyle -{ - if (self.navigationController) { - return self.navigationController.modalPresentationStyle; - } - return [super modalPresentationStyle]; -} - -- (CGFloat)slk_appropriateKeyboardHeight:(NSNotification *)notification -{ - self.externalKeyboardDetected = [self slk_detectExternalKeyboardInNotification:notification]; - if (self.externalKeyboardDetected) { - return 0.0; - } - - CGRect endFrame = [self.view convertRect:[notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue] fromView:nil]; - return MAX(0.0, CGRectGetHeight(self.view.bounds) - CGRectGetMinY(endFrame) - CGRectGetHeight(self.textView.inputAccessoryView.bounds)); -} - -- (CGFloat)slk_appropriateScrollViewHeight -{ - CGFloat height = self.view.bounds.size.height; - - height -= self.keyboardHC.constant; - height -= self.textInputbarHC.constant; - height -= self.autoCompletionViewHC.constant; - height -= self.typingIndicatorViewHC.constant; - - if (height < 0) return 0; - else return roundf(height); -} - -- (CGFloat)slk_topBarsHeight -{ - // No need to adjust if the edge isn't available - if ((self.edgesForExtendedLayout & UIRectEdgeTop) == 0) { - return 0.0; - } - - CGFloat height = CGRectGetHeight(self.navigationController.navigationBar.frame); - - if (SLK_IS_IPHONE && SLK_IS_LANDSCAPE && SLK_IS_IOS8_AND_HIGHER) { - return height; - } - if (SLK_IS_IPAD && self.modalPresentationStyle == UIModalPresentationFormSheet) { - return height; - } - if (self.isPresentedInPopover) { - return height; - } - - height += CGRectGetHeight([UIApplication sharedApplication].statusBarFrame); - return height; -} - -- (NSString *)slk_appropriateKeyboardNotificationName:(NSNotification *)notification -{ - NSString *name = notification.name; - - if ([name isEqualToString:UIKeyboardWillShowNotification]) { - return SLKKeyboardWillShowNotification; - } - if ([name isEqualToString:UIKeyboardWillHideNotification]) { - return SLKKeyboardWillHideNotification; - } - if ([name isEqualToString:UIKeyboardDidShowNotification]) { - return SLKKeyboardDidShowNotification; - } - if ([name isEqualToString:UIKeyboardDidHideNotification]) { - return SLKKeyboardDidHideNotification; - } - return nil; -} - -- (SLKKeyboardStatus)slk_keyboardStatusForNotification:(NSNotification *)notification -{ - NSString *name = notification.name; - - if ([name isEqualToString:UIKeyboardWillShowNotification]) { - return SLKKeyboardStatusWillShow; - } - if ([name isEqualToString:UIKeyboardDidShowNotification]) { - return SLKKeyboardStatusDidShow; - } - if ([name isEqualToString:UIKeyboardWillHideNotification]) { - return SLKKeyboardStatusWillHide; - } - if ([name isEqualToString:UIKeyboardDidHideNotification]) { - return SLKKeyboardStatusDidHide; - } - return -1; -} - -- (BOOL)slk_isIllogicalKeyboardStatus:(SLKKeyboardStatus)status -{ - if ((self.keyboardStatus == 0 && status == 1) || - (self.keyboardStatus == 1 && status == 2) || - (self.keyboardStatus == 2 && status == 3) || - (self.keyboardStatus == 3 && status == 0)) { - return NO; - } - return YES; -} - - -#pragma mark - Setters - -- (void)setScrollViewProxy:(UIScrollView *)scrollView -{ - if ([_scrollViewProxy isEqual:scrollView]) { - return; - } - - _singleTapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(slk_didTapScrollView:)]; - _singleTapGesture.delegate = self; - [_singleTapGesture requireGestureRecognizerToFail:scrollView.panGestureRecognizer]; - - [scrollView addGestureRecognizer:self.singleTapGesture]; - - _scrollViewProxy = scrollView; -} - -- (void)setAutoCompleting:(BOOL)autoCompleting -{ - if (_autoCompleting == autoCompleting) { - return; - } - - _autoCompleting = autoCompleting; - - self.scrollViewProxy.scrollEnabled = !autoCompleting; -} - -- (void)setInverted:(BOOL)inverted -{ - if (_inverted == inverted) { - return; - } - - _inverted = inverted; - - self.scrollViewProxy.transform = inverted ? CGAffineTransformMake(1, 0, 0, -1, 0, 0) : CGAffineTransformIdentity; - self.automaticallyAdjustsScrollViewInsets = inverted ? NO : YES; -} - -- (void)setKeyboardPanningEnabled:(BOOL)enabled -{ - if (_keyboardPanningEnabled == enabled) { - return; - } - - _keyboardPanningEnabled = enabled; - - self.scrollViewProxy.keyboardDismissMode = enabled ? UIScrollViewKeyboardDismissModeInteractive : UIScrollViewKeyboardDismissModeNone; -} - -- (BOOL)slk_updateKeyboardStatus:(SLKKeyboardStatus)status -{ - // Skips if trying to update the same status - if (_keyboardStatus == status) { - return NO; - } - - // Skips illogical conditions - if ([self slk_isIllogicalKeyboardStatus:status]) { - return NO; - } - - _keyboardStatus = status; - - [self didChangeKeyboardStatus:status]; - - return YES; -} - - -#pragma mark - Public & Subclassable Methods - -- (void)presentKeyboard:(BOOL)animated -{ - // Skips if already first responder - if ([self.textView isFirstResponder]) { - return; - } - - if (!animated) { - [UIView performWithoutAnimation:^{ - [self.textView becomeFirstResponder]; - }]; - } - else { - [self.textView becomeFirstResponder]; - } -} - -- (void)dismissKeyboard:(BOOL)animated -{ - if (![self.textView isFirstResponder]) { - - // Dismisses the keyboard from any first responder in the window. - if (self.keyboardHC.constant > 0) { - [self.view.window endEditing:NO]; - } - return; - } - - if (!animated) - { - [UIView performWithoutAnimation:^{ - [self.textView resignFirstResponder]; - }]; - } - else { - [self.textView resignFirstResponder]; - } -} - -- (BOOL)forceTextInputbarAdjustmentForResponder:(UIResponder *)responder -{ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - return self.shouldForceTextInputbarAdjustment; -#pragma GCC diagnostic pop -} - -- (void)didChangeKeyboardStatus:(SLKKeyboardStatus)status -{ - // No implementation here. Meant to be overriden in subclass. -} - -- (void)textWillUpdate -{ - // No implementation here. Meant to be overriden in subclass. -} - -- (void)textDidUpdate:(BOOL)animated -{ - CGFloat inputbarHeight = self.textInputbar.appropriateHeight; - - self.textInputbar.rightButton.enabled = [self canPressRightButton]; - self.textInputbar.editortRightButton.enabled = [self canPressRightButton]; - - if (inputbarHeight != self.textInputbarHC.constant) - { - self.textInputbarHC.constant = inputbarHeight; - self.scrollViewHC.constant = [self slk_appropriateScrollViewHeight]; - - if (animated) { - - BOOL bounces = self.bounces && [self.textView isFirstResponder]; - - [self.view slk_animateLayoutIfNeededWithBounce:bounces - options:UIViewAnimationOptionCurveEaseInOut|UIViewAnimationOptionLayoutSubviews|UIViewAnimationOptionBeginFromCurrentState - animations:^{ - if (self.textInputbar.isEditing) { - [self.textView slk_scrollToCaretPositonAnimated:NO]; - } - }]; - } - else { - [self.view layoutIfNeeded]; - } - } - - // Only updates the input view if the number of line changed - [self slk_reloadInputAccessoryViewIfNeeded]; - - // Toggles auto-correction if requiered - [self slk_enableTypingSuggestionIfNeeded]; -} - -- (void)textSelectionDidChange -{ - // The text view must be first responder - if (![self.textView isFirstResponder]) { - return; - } - - // Skips if the loupe is visible or if there is a real text selection - if (self.textView.isLoupeVisible || self.textView.selectedRange.length > 0) { - return; - } - - // Process the text at every caret movement - [self slk_processTextForAutoCompletion]; -} - -- (BOOL)canPressRightButton -{ - NSString *text = [self.textView.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; - - if (text.length > 0 && ![self.textInputbar limitExceeded]) { - return YES; - } - - return NO; -} - -- (void)didPressLeftButton:(id)sender -{ - // No implementation here. Meant to be overriden in subclass. -} - -- (void)didPressRightButton:(id)sender -{ - if (self.shouldClearTextAtRightButtonPress) { - // Clears the text and the undo manager - [self.textView slk_clearText:YES]; - } - - // Clears cache - [self clearCachedText]; -} - -- (void)editText:(NSString *)text -{ - if (![self.textInputbar canEditText:text]) { - return; - } - - // Caches the current text, in case the user cancels the edition - [self slk_cacheTextToDisk:self.textView.text]; - - if (!SLK_IS_LANDSCAPE) { - [self.textView setText:text]; - } - - [self.textInputbar beginTextEditing]; - - // Setting the text after calling -beginTextEditing is safer when in landscape orientation - if (SLK_IS_LANDSCAPE) { - [self.textView setText:text]; - } - - [self.textView slk_scrollToCaretPositonAnimated:YES]; - - // Brings up the keyboard if needed - [self presentKeyboard:YES]; -} - -- (void)didCommitTextEditing:(id)sender -{ - if (!self.textInputbar.isEditing) { - return; - } - - [self.textInputbar endTextEdition]; - - // Clears the text and but not the undo manager - [self.textView slk_clearText:NO]; -} - -- (void)didCancelTextEditing:(id)sender -{ - if (!self.textInputbar.isEditing) { - return; - } - - [self.textInputbar endTextEdition]; - - // Clears the text and but not the undo manager - [self.textView slk_clearText:NO]; - - // Restores any previous cached text before entering in editing mode - [self slk_reloadTextView]; -} - -- (BOOL)canShowTypeIndicator -{ - // Don't show if the text is being edited or auto-completed. - if (self.textInputbar.isEditing || self.isAutoCompleting) { - return NO; - } - - // Don't show if the content offset is not at top (when inverted) or at bottom (when not inverted) - if ((self.isInverted && ![self.scrollViewProxy slk_isAtTop]) || (!self.isInverted && ![self.scrollViewProxy slk_isAtBottom])) { - return NO; - } - - return YES; -} - -- (BOOL)canShowAutoCompletion -{ - return NO; -} - -- (CGFloat)heightForAutoCompletionView -{ - return 0.0; -} - -- (CGFloat)maximumHeightForAutoCompletionView -{ - CGFloat maxiumumHeight = 140.0; - CGFloat scrollViewHeight = self.scrollViewHC.constant; - scrollViewHeight -= [self slk_topBarsHeight]; - - if (scrollViewHeight < maxiumumHeight) { - maxiumumHeight = scrollViewHeight; - } - - return maxiumumHeight; -} - -- (void)didPasteMediaContent:(NSDictionary *)userInfo -{ - // No implementation here. Meant to be overriden in subclass. -} - -- (void)willRequestUndo -{ - UIAlertView *alert = [UIAlertView new]; - [alert setTitle:NSLocalizedString(@"Undo Typing", nil)]; - [alert addButtonWithTitle:NSLocalizedString(@"Undo", nil)]; - [alert addButtonWithTitle:NSLocalizedString(@"Cancel", nil)]; - [alert setCancelButtonIndex:1]; - [alert setTag:SLKAlertViewClearTextTag]; - [alert setDelegate:self]; - [alert show]; -} - - -#pragma mark - Private Methods - -- (void)slk_didTapScrollView:(UIGestureRecognizer *)gesture -{ - if (!self.isPresentedInPopover && !self.isExternalKeyboardDetected) { - [self dismissKeyboard:YES]; - } -} - -- (void)slk_didPanTextView:(UIGestureRecognizer *)gesture -{ - [self presentKeyboard:YES]; -} - -- (void)slk_performRightAction -{ - NSArray *actions = [self.rightButton actionsForTarget:self forControlEvent:UIControlEventTouchUpInside]; - - if (actions.count > 0 && [self canPressRightButton]) { - [self.rightButton sendActionsForControlEvents:UIControlEventTouchUpInside]; - } -} - -- (void)slk_postKeyboarStatusNotification:(NSNotification *)notification -{ - if (self.isExternalKeyboardDetected || self.isRotating) { - return; - } - - NSMutableDictionary *userInfo = [notification.userInfo mutableCopy]; - - CGRect beginFrame = [notification.userInfo[UIKeyboardFrameBeginUserInfoKey] CGRectValue]; - CGRect endFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue]; - - // Fixes iOS7 oddness with inverted values on landscape orientation - if (!SLK_IS_IOS8_AND_HIGHER && SLK_IS_LANDSCAPE) { - beginFrame = SLKRectInvert(beginFrame); - endFrame = SLKRectInvert(endFrame); - } - - CGFloat keyboardHeight = CGRectGetHeight(endFrame)-CGRectGetHeight(self.textView.inputAccessoryView.bounds); - - beginFrame.size.height = keyboardHeight; - endFrame.size.height = keyboardHeight; - - [userInfo setObject:[NSValue valueWithCGRect:beginFrame] forKey:UIKeyboardFrameBeginUserInfoKey]; - [userInfo setObject:[NSValue valueWithCGRect:endFrame] forKey:UIKeyboardFrameEndUserInfoKey]; - - NSString *name = [self slk_appropriateKeyboardNotificationName:notification]; - [[NSNotificationCenter defaultCenter] postNotificationName:name object:self.textView userInfo:userInfo]; -} - -- (BOOL)slk_scrollToTopIfNeeded -{ - if (!self.scrollViewProxy.scrollsToTop || self.keyboardStatus == SLKKeyboardStatusWillShow) { - return NO; - } - - if (self.isInverted) { - [self.scrollViewProxy slk_scrollToTopAnimated:YES]; - return NO; - } - else { - return YES; - } -} - -- (BOOL)slk_scrollToBottomIfNeeded -{ - // Scrolls to bottom only if the keyboard is about to show. - if (!self.shouldScrollToBottomAfterKeyboardShows || self.keyboardStatus != SLKKeyboardStatusWillShow) { - return NO; - } - - if (self.isInverted) { - [self.scrollViewProxy slk_scrollToTopAnimated:YES]; - } - else { - [self.scrollViewProxy slk_scrollToBottomAnimated:YES]; - } - - return YES; -} - -- (void)slk_enableTypingSuggestionIfNeeded -{ - if (![self.textView isFirstResponder]) { - return; - } - - BOOL enable = !self.isAutoCompleting; - - // Toggling autocorrect on Japanese keyboards breaks autocompletion by replacing the autocompletion prefix by an empty string. - // So for now, let's not disable autocorrection for Japanese. - if ([self.textView.textInputMode.primaryLanguage isEqualToString:@"ja-JP"]) { - return; - } - - // During text autocompletion, the iOS 8 QuickType bar is hidden and auto-correction and spell checking are disabled. - [self.textView setTypingSuggestionEnabled:enable]; -} - -- (void)slk_dismissTextInputbarIfNeeded -{ - if (self.keyboardHC.constant == 0) { - return; - } - - self.keyboardHC.constant = 0.0; - self.scrollViewHC.constant = [self slk_appropriateScrollViewHeight]; - - [self slk_hideAutoCompletionViewIfNeeded]; - - // Forces the keyboard status change - [self slk_updateKeyboardStatus:SLKKeyboardStatusDidHide]; - - [self.view layoutIfNeeded]; -} - -- (BOOL)slk_detectExternalKeyboardInNotification:(NSNotification *)notification -{ - if (!self.isMovingKeyboard) { - // Based on http://stackoverflow.com/a/5760910/287403 - // We can determine if the external keyboard is showing by adding the origin.y of the target finish rect (end when showing, begin when hiding) to the inputAccessoryHeight. - // If it's greater(or equal) the window height, it's an external keyboard. - CGFloat inputAccessoryHeight = self.textView.inputAccessoryView.frame.size.height; - CGRect beginRect = [notification.userInfo[UIKeyboardFrameBeginUserInfoKey] CGRectValue]; - CGRect endRect = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue]; - - // Grab the base view for conversions as we don't want window coordinates in < iOS 8 - // iOS 8 fixes the whole coordinate system issue for us, but iOS 7 doesn't rotate the app window coordinate space. - UIView *baseView = ((UIWindow *)self.view.window).rootViewController.view; - - // Convert the main screen bounds into the correct coordinate space but ignore the origin. - CGRect bounds = [self.view convertRect:[UIScreen mainScreen].bounds fromView:nil]; - bounds = CGRectMake(0, 0, bounds.size.width, bounds.size.height); - - // We want these rects in the correct coordinate space as well. - CGRect convertBegin = [baseView convertRect:beginRect fromView:nil]; - CGRect convertEnd = [baseView convertRect:endRect fromView:nil]; - - if ([notification.name isEqualToString:UIKeyboardWillShowNotification]) { - if (convertEnd.origin.y + inputAccessoryHeight >= bounds.size.height) { - return YES; - } - } - else if ([notification.name isEqualToString:UIKeyboardWillHideNotification]) { - // The additional logic check here (== to width) accounts for a glitch (iOS 8 only?) where the window has rotated it's coordinates - // but the beginRect doesn't yet reflect that. It should never cause a false positive. - if (convertBegin.origin.y + inputAccessoryHeight >= bounds.size.height || - convertBegin.origin.y + inputAccessoryHeight == bounds.size.width) { - return YES; - } - } - } - return NO; -} - -- (void)slk_reloadInputAccessoryViewIfNeeded -{ - // Reload only if the input views if the text view is first responder. - if (!self.isKeyboardPanningEnabled || ![self.textView isFirstResponder]) { - - // Disables the input accessory when not first responder so when showing the keyboard back, there is no delay in the animation. - if (self.textView.inputAccessoryView) { - self.textView.inputAccessoryView = nil; - [self.textView refreshInputViews]; - } - } - // Reload only if the input views if the frame doesn't match the text input bar's. - else if (CGRectGetHeight(self.textView.inputAccessoryView.frame) != CGRectGetHeight(self.textInputbar.bounds)) { - self.textView.inputAccessoryView = [self emptyInputAccessoryView]; - [self.textView refreshInputViews]; - } -} - -- (void)slk_adjustContentConfigurationIfNeeded -{ - // When inverted, we need to substract the top bars height (generally status bar + navigation bar's) to align the top of the - // scrollView correctly to its top edge. - if (self.inverted) { - UIEdgeInsets contentInset = self.scrollViewProxy.contentInset; - contentInset.bottom = [self slk_topBarsHeight]; - - self.scrollViewProxy.contentInset = contentInset; - self.scrollViewProxy.scrollIndicatorInsets = contentInset; - } - - // Substracts the bottom edge rect if present. This fixes the text input layout when using inside of a view controller container - // such as a UITabBarController or a custom container. - if (((self.edgesForExtendedLayout & UIRectEdgeBottom) > 0)) { - self.edgesForExtendedLayout = self.edgesForExtendedLayout & ~UIRectEdgeBottom; - } -} - -- (void)slk_prepareForInterfaceRotation -{ - [self.view layoutIfNeeded]; - - if ([self.textView isFirstResponder]) { - [self.textView slk_scrollToCaretPositonAnimated:NO]; - } - else { - [self.textView slk_scrollToBottomAnimated:NO]; - } -} - - -#pragma mark - Keyboard Events - -- (void)didPressReturnKey:(id)sender -{ - if (self.textInputbar.isEditing) { - [self didCommitTextEditing:sender]; - return; - } - - [self slk_performRightAction]; -} - -- (void)didPressEscapeKey:(id)sender -{ - if (self.isAutoCompleting) { - [self cancelAutoCompletion]; - } - else if (self.textInputbar.isEditing) { - [self didCancelTextEditing:sender]; - } - - if (self.isExternalKeyboardDetected || ([self.textView isFirstResponder] && self.keyboardHC.constant == 0)) { - return; - } - - [self dismissKeyboard:YES]; -} - -- (void)didPressArrowKey:(id)sender -{ - [self.textView didPressAnyArrowKey:sender]; -} - - -#pragma mark - Notification Events - -- (void)slk_willShowOrHideKeyboard:(NSNotification *)notification -{ - // Skips if the view isn't visible. - if (!self.view.window) { - return; - } - - // Skips if it is presented inside of a popover. - if (self.isPresentedInPopover) { - return; - } - - // Skips if textview did refresh only. - if (self.textView.didNotResignFirstResponder) { - return; - } - - // Skips this it's not the expected textView and shouldn't force adjustment of the text input bar. - // This will also dismiss the text input bar if it's visible, and exit auto-completion mode if enabled. - if (![self.textView isFirstResponder] && ![self forceTextInputbarAdjustmentForResponder:[UIResponder slk_currentFirstResponder]]) { - return [self slk_dismissTextInputbarIfNeeded]; - } - - NSInteger curve = [notification.userInfo[UIKeyboardAnimationCurveUserInfoKey] integerValue]; - NSTimeInterval duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue]; - - SLKKeyboardStatus status = [self slk_keyboardStatusForNotification:notification]; - - // Programatically stops scrolling before updating the view constraints (to avoid scrolling glitch). - if (status == SLKKeyboardStatusWillShow) { - [self.scrollViewProxy slk_stopScrolling]; - } - - // Hides the auto-completion view if the keyboard is being dismissed. - if (![self.textView isFirstResponder] || status == SLKKeyboardStatusWillHide) { - [self slk_hideAutoCompletionViewIfNeeded]; - } - - // Updates the height constraints' constants - self.keyboardHC.constant = [self slk_appropriateKeyboardHeight:notification]; - self.scrollViewHC.constant = [self slk_appropriateScrollViewHeight]; - - // Updates and notifies about the keyboard status update - if ([self slk_updateKeyboardStatus:status]) { - // Posts custom keyboard notification, if logical conditions apply - [self slk_postKeyboarStatusNotification:notification]; - } - - // Only for this animation, we set bo to bounce since we want to give the impression that the text input is glued to the keyboard. - [self.view slk_animateLayoutIfNeededWithDuration:duration - bounce:NO - options:(curve<<16)|UIViewAnimationOptionLayoutSubviews|UIViewAnimationOptionBeginFromCurrentState - animations:^{ - [self slk_scrollToBottomIfNeeded]; - }]; -} - -- (void)slk_didShowOrHideKeyboard:(NSNotification *)notification -{ - // Skips if the view isn't visible - if (!self.view.window) { - return; - } - - // Skips if it is presented inside of a popover - if (self.isPresentedInPopover) { - return; - } - - // Skips if textview did refresh only - if (self.textView.didNotResignFirstResponder) { - return; - } - - SLKKeyboardStatus status = [self slk_keyboardStatusForNotification:notification]; - - // Skips if it's the current status - if (self.keyboardStatus == status) { - return; - } - - // After showing keyboard, check if the current cursor position could diplay autocompletion - if ([self.textView isFirstResponder] && status == SLKKeyboardStatusDidShow && !self.isAutoCompleting) { - - // Wait till the end of the current run loop - dispatch_async(dispatch_get_main_queue(), ^{ - [self slk_processTextForAutoCompletion]; - }); - } - - // Updates and notifies about the keyboard status update - if ([self slk_updateKeyboardStatus:status]) { - // Posts custom keyboard notification, if logical conditions apply - [self slk_postKeyboarStatusNotification:notification]; - } - - // Updates the dismiss mode and input accessory view, if needed. - [self slk_reloadInputAccessoryViewIfNeeded]; - - // Very important to invalidate this flag after the keyboard is dismissed or presented, to start with a clean state next time. - self.movingKeyboard = NO; -} - -- (void)slk_didChangeKeyboardFrame:(NSNotification *)notification -{ - // Skips if the view isn't visible - if (!self.view.window) { - return; - } - - // Skips if it is presented inside of a popover - if (self.isPresentedInPopover) { - return; - } - - // Skips this if it's not the expected textView. - // Checking the keyboard height constant helps to disable the view constraints update on iPad when the keyboard is undocked. - // Checking the keyboard status allows to keep the inputAccessoryView valid when still reacing the bottom of the screen. - if (![self.textView isFirstResponder] || (self.keyboardHC.constant == 0 && self.keyboardStatus == SLKKeyboardStatusDidHide)) { - return; - } - - if (self.scrollViewProxy.isDragging) { - self.movingKeyboard = YES; - } - - if (self.isMovingKeyboard == NO) { - return; - } - - self.keyboardHC.constant = [self slk_appropriateKeyboardHeight:notification]; - self.scrollViewHC.constant = [self slk_appropriateScrollViewHeight]; - - // layoutIfNeeded must be called before any further scrollView internal adjustments (content offset and size) - [self.view layoutIfNeeded]; - - // Overrides the scrollView's contentOffset to allow following the same position when dragging the keyboard - CGPoint offset = _scrollViewOffsetBeforeDragging; - - if (self.isInverted) { - if (!self.scrollViewProxy.isDecelerating && self.scrollViewProxy.isTracking) { - self.scrollViewProxy.contentOffset = _scrollViewOffsetBeforeDragging; - } - } - else { - CGFloat keyboardHeightDelta = _keyboardHeightBeforeDragging-self.keyboardHC.constant; - offset.y -= keyboardHeightDelta; - - self.scrollViewProxy.contentOffset = offset; - } -} - -- (void)slk_didPostSLKKeyboardNotification:(NSNotification *)notification -{ - if (![notification.object isEqual:self.textView]) { - return; - } - - // Used for debug only - NSLog(@"%@ %s: %@", NSStringFromClass([self class]), __FUNCTION__, notification); -} - -- (void)slk_willChangeTextViewText:(NSNotification *)notification -{ - // Skips this it's not the expected textView. - if (![notification.object isEqual:self.textView]) { - return; - } - - [self textWillUpdate]; -} - -- (void)slk_didChangeTextViewText:(NSNotification *)notification -{ - // Skips this it's not the expected textView. - if (![notification.object isEqual:self.textView]) { - return; - } - - // Animated only if the view already appeared. - [self textDidUpdate:self.isViewVisible]; - - // Process the text at every change, when the view is visible - if (self.isViewVisible) { - [self slk_processTextForAutoCompletion]; - } -} - -- (void)slk_didChangeTextViewContentSize:(NSNotification *)notification -{ - // Skips this it's not the expected textView. - if (![notification.object isEqual:self.textView]) { - return; - } - - // Animated only if the view already appeared. - [self textDidUpdate:self.isViewVisible]; -} - -- (void)slk_didChangeTextViewSelectedRange:(NSNotification *)notification -{ - // Skips this it's not the expected textView. - if (![notification.object isEqual:self.textView]) { - return; - } - - [self textSelectionDidChange]; -} - -- (void)slk_didChangeTextViewPasteboard:(NSNotification *)notification -{ - // Skips this if it's not the expected textView. - if (![self.textView isFirstResponder]) { - return; - } - - // Notifies only if the pasted item is nested in a dictionary. - if ([notification.userInfo isKindOfClass:[NSDictionary class]]) { - [self didPasteMediaContent:notification.userInfo]; - } -} - -- (void)slk_didShakeTextView:(NSNotification *)notification -{ - // Skips this if it's not the expected textView. - if (![self.textView isFirstResponder]) { - return; - } - - // Notifies of the shake gesture if undo mode is on and the text view is not empty - if (self.shakeToClearEnabled && self.textView.text.length > 0) { - [self willRequestUndo]; - } -} - -- (void)slk_willShowOrHideTypeIndicatorView:(NSNotification *)notification -{ - SLKTypingIndicatorView *indicatorView = (SLKTypingIndicatorView *)notification.object; - - // Skips if it's not the expected typing indicator view. - if (![indicatorView isEqual:self.typingIndicatorView]) { - return; - } - - // Skips if the typing indicator should not show. Ignores the checking if it's trying to hide. - if (![self canShowTypeIndicator] && !self.typingIndicatorView.isVisible) { - return; - } - - self.typingIndicatorViewHC.constant = indicatorView.isVisible ? 0.0 : indicatorView.intrinsicContentSize.height; - self.scrollViewHC.constant -= self.typingIndicatorViewHC.constant; - - [self.view slk_animateLayoutIfNeededWithBounce:self.bounces - options:UIViewAnimationOptionCurveEaseInOut|UIViewAnimationOptionLayoutSubviews|UIViewAnimationOptionBeginFromCurrentState - animations:NULL]; -} - -- (void)slk_willTerminateApplication:(NSNotification *)notification -{ - // Caches the text before it's too late! - [self slk_cacheTextView]; -} - - -#pragma mark - Auto-Completion Text Processing - -- (void)registerPrefixesForAutoCompletion:(NSArray *)prefixes -{ - NSMutableArray *array = [NSMutableArray arrayWithArray:self.registeredPrefixes]; - - for (NSString *prefix in prefixes) { - // Skips if the prefix is not a valid string - if (![prefix isKindOfClass:[NSString class]] || prefix.length == 0) { - continue; - } - - // Adds the prefix if not contained already - if (![array containsObject:prefix]) { - [array addObject:prefix]; - } - } - - if (_registeredPrefixes) { - _registeredPrefixes = nil; - } - - _registeredPrefixes = [[NSArray alloc] initWithArray:array]; -} - -- (void)slk_processTextForAutoCompletion -{ - if (self.isRotating) { - return; - } - - // Avoids text processing for auto-completion if the registered prefix list is empty. - if (self.registeredPrefixes.count == 0) { - return; - } - - NSString *text = self.textView.text; - - // Skip, when there is no text to process - if (text.length == 0) { - return [self cancelAutoCompletion]; - } - - NSRange range; - NSString *word = [self.textView slk_wordAtCaretRange:&range]; - - [self slk_invalidateAutoCompletion]; - - if (word.length > 0) { - NSString *prefix = [word substringWithRange:NSMakeRange(0, 1)]; - - if ([self.registeredPrefixes containsObject:prefix]) { - // Captures the detected symbol prefix - _foundPrefix = prefix; - - // Used later for replacing the detected range with a new string alias returned in -acceptAutoCompletionWithString: - _foundPrefixRange = NSMakeRange(range.location, prefix.length); - } - } - - [self slk_handleProcessedWord:word range:range]; -} - -- (void)slk_handleProcessedWord:(NSString *)word range:(NSRange)range -{ - // Cancel auto-completion if the cursor is placed before the prefix - if (self.textView.selectedRange.location <= self.foundPrefixRange.location) { - return [self cancelAutoCompletion]; - } - - if (self.foundPrefix.length > 0) { - if (range.length == 0 || range.length != word.length) { - return [self cancelAutoCompletion]; - } - - if (word.length > 0) { - // Removes the found prefix - _foundWord = [word substringFromIndex:self.foundPrefix.length]; - - // If the prefix is still contained in the word, cancels - if ([self.foundWord rangeOfString:self.foundPrefix].location != NSNotFound) { - return [self cancelAutoCompletion]; - } - } - else { - return [self cancelAutoCompletion]; - } - } - else { - return [self cancelAutoCompletion]; - } - - [self slk_showAutoCompletionView:[self canShowAutoCompletion]]; -} - -- (void)cancelAutoCompletion -{ - [self slk_invalidateAutoCompletion]; - [self slk_hideAutoCompletionViewIfNeeded]; -} - -- (void)slk_invalidateAutoCompletion -{ - _foundPrefix = nil; - _foundWord = nil; - _foundPrefixRange = NSMakeRange(0, 0); - - [self.autoCompletionView setContentOffset:CGPointZero]; -} - -- (void)acceptAutoCompletionWithString:(NSString *)string -{ - [self acceptAutoCompletionWithString:string keepPrefix:YES]; -} - -- (void)acceptAutoCompletionWithString:(NSString *)string keepPrefix:(BOOL)keepPrefix -{ - if (string.length == 0) { - return; - } - - SLKTextView *textView = self.textView; - - NSUInteger location = self.foundPrefixRange.location; - if (keepPrefix) { - location += self.foundPrefixRange.length; - } - - NSUInteger length = self.foundWord.length; - if (!keepPrefix) { - length += self.foundPrefixRange.length; - } - - NSRange range = NSMakeRange(location, length); - NSRange insertionRange = [textView slk_insertText:string inRange:range]; - - textView.selectedRange = NSMakeRange(insertionRange.location, 0); - - [self cancelAutoCompletion]; - - [textView slk_scrollToCaretPositonAnimated:NO]; -} - -- (void)slk_hideAutoCompletionViewIfNeeded -{ - if (self.isAutoCompleting) { - [self slk_showAutoCompletionView:NO]; - } -} - -- (void)slk_showAutoCompletionView:(BOOL)show -{ - // Skips if rotating - if (self.isRotating) { - return; - } - - // Reloads the tableview before showing/hiding - [self.autoCompletionView reloadData]; - - self.autoCompleting = show; - - // Toggles auto-correction if requiered - [self slk_enableTypingSuggestionIfNeeded]; - - CGFloat viewHeight = show ? [self heightForAutoCompletionView] : 0.0; - - if (self.autoCompletionViewHC.constant == viewHeight) { - return; - } - - // If the auto-completion view height is bigger than the maximum height allows, it is reduce to that size. Default 140 pts. - CGFloat maximumHeight = [self maximumHeightForAutoCompletionView]; - - if (viewHeight > maximumHeight) { - viewHeight = maximumHeight; - } - - CGFloat tableHeight = self.scrollViewHC.constant + self.autoCompletionViewHC.constant; - - // On iPhone, the auto-completion view can't extend beyond the table view height - if (SLK_IS_IPHONE && viewHeight > tableHeight) { - viewHeight = tableHeight; - } - - self.autoCompletionViewHC.constant = viewHeight; - - [self.view slk_animateLayoutIfNeededWithBounce:self.bounces - options:UIViewAnimationOptionCurveEaseInOut|UIViewAnimationOptionLayoutSubviews|UIViewAnimationOptionBeginFromCurrentState - animations:NULL]; -} - - -#pragma mark - Text Caching - -- (NSString *)keyForTextCaching -{ - // No implementation here. Meant to be overriden in subclass. - return nil; -} - -- (NSString *)slk_keyForPersistency -{ - NSString *keyForTextCaching = [self keyForTextCaching]; - NSString *previousCachedText = [[NSUserDefaults standardUserDefaults] objectForKey:keyForTextCaching]; - - if ([previousCachedText isKindOfClass:[NSString class]]) { - return keyForTextCaching; - } - else { - return [NSString stringWithFormat:@"%@.%@", SLKTextViewControllerDomain, [self keyForTextCaching]]; - } -} - -- (void)slk_reloadTextView -{ - if (self.textView.text.length > 0 || !self.slk_isCachingEnabled) { - return; - } - - self.textView.text = [self slk_cachedText]; -} - -- (void)slk_cacheTextView -{ - [self slk_cacheTextToDisk:self.textView.text]; -} - -- (void)clearCachedText -{ - [self slk_cacheTextToDisk:nil]; -} - -+ (void)clearAllCachedText -{ - NSMutableArray *cachedKeys = [NSMutableArray new]; - - for (NSString *key in [[[NSUserDefaults standardUserDefaults] dictionaryRepresentation] allKeys]) { - if ([key rangeOfString:SLKTextViewControllerDomain].location != NSNotFound) { - [cachedKeys addObject:key]; - } - } - - if (cachedKeys.count == 0) { - return; - } - - for (NSString *cachedKey in cachedKeys) { - [[NSUserDefaults standardUserDefaults] removeObjectForKey:cachedKey]; - } - - [[NSUserDefaults standardUserDefaults] synchronize]; -} - -- (BOOL)slk_isCachingEnabled -{ - return ([self keyForTextCaching] != nil); -} - -- (NSString *)slk_cachedText -{ - if (!self.slk_isCachingEnabled) { - return nil; - } - - NSString *key = [self slk_keyForPersistency]; - return [[NSUserDefaults standardUserDefaults] objectForKey:key]; -} - -- (void)slk_cacheTextToDisk:(NSString *)text -{ - if (!self.slk_isCachingEnabled) { - return; - } - - NSString *cachedText = [self slk_cachedText]; - NSString *key = [self slk_keyForPersistency]; - - // Caches text only if its a valid string and not already cached - if (text.length > 0 && ![text isEqualToString:cachedText]) { - [[NSUserDefaults standardUserDefaults] setObject:text forKey:key]; - } - // Clears cache only if it exists - else if (text.length == 0 && cachedText.length > 0) { - [[NSUserDefaults standardUserDefaults] removeObjectForKey:key]; - } - else { - // Skips so it doesn't hit 'synchronize' unnecessarily - return; - } - - [[NSUserDefaults standardUserDefaults] synchronize]; -} - - -#pragma mark - Customization - -- (void)registerClassForTextView:(Class)textViewClass -{ - if (textViewClass == nil) { - return; - } - - NSAssert([textViewClass isSubclassOfClass:[SLKTextView class]], @"The registered class is invalid, it must be a subclass of SLKTextView."); - self.textViewClass = textViewClass; -} - - -#pragma mark - UITextViewDelegate Methods - -- (BOOL)textView:(SLKTextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text -{ - self.newWordInserted = ([text rangeOfCharacterFromSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]].location != NSNotFound); - - // It should not change if auto-completion is active and trying to replace with an auto-correction suggested text. - if (self.isAutoCompleting && text.length > 1) { - return NO; - } - - // Records text for undo for every new word - if (self.newWordInserted) { - [self.textView slk_prepareForUndo:@"Word Change"]; - } - - if ([text isEqualToString:@"\n"]) { - //Detected break. Should insert new line break manually. - [textView slk_insertNewLineBreak]; - - return NO; - } - else { - NSDictionary *userInfo = @{@"text": text, @"range": [NSValue valueWithRange:range]}; - [[NSNotificationCenter defaultCenter] postNotificationName:SLKTextViewTextWillChangeNotification object:self.textView userInfo:userInfo]; - - return YES; - } -} - -- (void)textViewDidChange:(UITextView *)textView -{ - // Keep to avoid unnecessary crashes. Was meant to be overriden in subclass while calling super. -} - -- (void)textViewDidChangeSelection:(UITextView *)textView -{ - // Keep to avoid unnecessary crashes. Was meant to be overriden in subclass while calling super. -} - - -#pragma mark - UITableViewDataSource Methods - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section -{ - return 0; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath -{ - return nil; -} - - -#pragma mark - UICollectionViewDataSource Methods - -- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section; -{ - return 0; -} - -- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath -{ - return nil; -} - - -#pragma mark - UIScrollViewDelegate Methods - -- (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollView -{ - return [self slk_scrollToTopIfNeeded]; -} - -- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate -{ - self.movingKeyboard = NO; -} - -- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView -{ - self.movingKeyboard = NO; -} - -- (void)scrollViewDidScroll:(UIScrollView *)scrollView -{ - if ([scrollView isEqual:self.autoCompletionView]) { - CGRect frame = self.autoCompletionHairline.frame; - frame.origin.y = scrollView.contentOffset.y; - self.autoCompletionHairline.frame = frame; - } - else { - if (!self.isMovingKeyboard) { - _scrollViewOffsetBeforeDragging = scrollView.contentOffset; - _keyboardHeightBeforeDragging = self.keyboardHC.constant; - } - } -} - - -#pragma mark - UIGestureRecognizerDelegate Methods - -- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gesture -{ - if ([gesture isEqual:self.singleTapGesture]) { - return [self.textView isFirstResponder] && !self.isExternalKeyboardDetected; - } - else if ([gesture isEqual:self.verticalPanGesture]) { - - if ([self.textView isFirstResponder]) { - return NO; - } - - CGPoint velocity = [self.verticalPanGesture velocityInView:self.view]; - - // Vertical panning, from bottom to top only - if (velocity.y < 0 && ABS(velocity.y) > ABS(velocity.x) && ![self.textInputbar.textView isFirstResponder]) { - return YES; - } - } - - return NO; -} - - -#pragma mark - UIAlertViewDelegate Methods - -- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex -{ - if (alertView.tag == SLKAlertViewClearTextTag && self.shakeToClearEnabled && buttonIndex != [alertView cancelButtonIndex] ) { - // Clears the text but doesn't clear the undo manager - [self.textView slk_clearText:NO]; - } -} - - -#pragma mark - View Auto-Layout - -- (void)slk_setupViewConstraints -{ - NSDictionary *views = @{@"scrollView": self.scrollViewProxy, - @"autoCompletionView": self.autoCompletionView, - @"typingIndicatorView": self.typingIndicatorView, - @"textInputbar": self.textInputbar, - }; - - [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[scrollView(0@750)][autoCompletionView(0@750)][typingIndicatorView(0)]-0@999-[textInputbar(>=0)]|" options:0 metrics:nil views:views]]; - [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[scrollView]|" options:0 metrics:nil views:views]]; - [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[autoCompletionView]|" options:0 metrics:nil views:views]]; - [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[typingIndicatorView]|" options:0 metrics:nil views:views]]; - [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[textInputbar]|" options:0 metrics:nil views:views]]; - - self.scrollViewHC = [self.view slk_constraintForAttribute:NSLayoutAttributeHeight firstItem:self.scrollViewProxy secondItem:nil]; - self.autoCompletionViewHC = [self.view slk_constraintForAttribute:NSLayoutAttributeHeight firstItem:self.autoCompletionView secondItem:nil]; - self.typingIndicatorViewHC = [self.view slk_constraintForAttribute:NSLayoutAttributeHeight firstItem:self.typingIndicatorView secondItem:nil]; - self.textInputbarHC = [self.view slk_constraintForAttribute:NSLayoutAttributeHeight firstItem:self.textInputbar secondItem:nil]; - self.keyboardHC = [self.view slk_constraintForAttribute:NSLayoutAttributeBottom firstItem:self.view secondItem:self.textInputbar]; - - self.textInputbarHC.constant = self.textInputbar.minimumInputbarHeight; - self.scrollViewHC.constant = [self slk_appropriateScrollViewHeight]; - - if (self.textInputbar.isEditing) { - self.textInputbarHC.constant += self.textInputbar.editorContentViewHeight; - } -} - - -#pragma mark - External Keyboard Support - -- (NSArray *)keyCommands -{ - if (_keyboardCommands) { - return _keyboardCommands; - } - - _keyboardCommands = @[ - // Pressing Return key - [UIKeyCommand keyCommandWithInput:@"\r" modifierFlags:0 action:@selector(didPressReturnKey:)], - // Pressing Esc key - [UIKeyCommand keyCommandWithInput:UIKeyInputEscape modifierFlags:0 action:@selector(didPressEscapeKey:)], - - // Arrow keys - [UIKeyCommand keyCommandWithInput:UIKeyInputUpArrow modifierFlags:0 action:@selector(didPressArrowKey:)], - [UIKeyCommand keyCommandWithInput:UIKeyInputDownArrow modifierFlags:0 action:@selector(didPressArrowKey:)], - ]; - - return _keyboardCommands; -} - - -#pragma mark - NSNotificationCenter register/unregister - -- (void)slk_registerNotifications -{ - // Keyboard notifications - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slk_willShowOrHideKeyboard:) name:UIKeyboardWillShowNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slk_willShowOrHideKeyboard:) name:UIKeyboardWillHideNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slk_didShowOrHideKeyboard:) name:UIKeyboardDidShowNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slk_didShowOrHideKeyboard:) name:UIKeyboardDidHideNotification object:nil]; - -#if SLK_KEYBOARD_NOTIFICATION_DEBUG - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slk_didPostSLKKeyboardNotification:) name:SLKKeyboardWillShowNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slk_didPostSLKKeyboardNotification:) name:SLKKeyboardDidShowNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slk_didPostSLKKeyboardNotification:) name:SLKKeyboardWillHideNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slk_didPostSLKKeyboardNotification:) name:SLKKeyboardDidHideNotification object:nil]; -#endif - - // Keyboard Accessory View notifications - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slk_didChangeKeyboardFrame:) name:SLKInputAccessoryViewKeyboardFrameDidChangeNotification object:nil]; - - // TextView notifications - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slk_willChangeTextViewText:) name:SLKTextViewTextWillChangeNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slk_didChangeTextViewText:) name:UITextViewTextDidChangeNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slk_didChangeTextViewContentSize:) name:SLKTextViewContentSizeDidChangeNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slk_didChangeTextViewSelectedRange:) name:SLKTextViewSelectedRangeDidChangeNotification object:nil]; - - - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slk_didChangeTextViewPasteboard:) name:SLKTextViewDidPasteItemNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slk_didShakeTextView:) name:SLKTextViewDidShakeNotification object:nil]; - - // TypeIndicator notifications - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slk_willShowOrHideTypeIndicatorView:) name:SLKTypingIndicatorViewWillShowNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slk_willShowOrHideTypeIndicatorView:) name:SLKTypingIndicatorViewWillHideNotification object:nil]; - - // Application notifications - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slk_willTerminateApplication:) name:UIApplicationWillTerminateNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slk_willTerminateApplication:) name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; -} - -- (void)slk_unregisterNotifications -{ - // Keyboard notifications - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillHideNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardDidShowNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardDidHideNotification object:nil]; - -#if SLK_KEYBOARD_NOTIFICATION_DEBUG - [[NSNotificationCenter defaultCenter] removeObserver:self name:SLKKeyboardWillShowNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:SLKKeyboardDidShowNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:SLKKeyboardWillHideNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:SLKKeyboardDidHideNotification object:nil]; -#endif - - // TextView notifications - [[NSNotificationCenter defaultCenter] removeObserver:self name:SLKInputAccessoryViewKeyboardFrameDidChangeNotification object:nil]; - - // TextView notifications - [[NSNotificationCenter defaultCenter] removeObserver:self name:UITextViewTextDidBeginEditingNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:UITextViewTextDidEndEditingNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:SLKTextViewTextWillChangeNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:UITextViewTextDidChangeNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:SLKTextViewContentSizeDidChangeNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:SLKTextViewSelectedRangeDidChangeNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:SLKTextViewDidPasteItemNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:SLKTextViewDidShakeNotification object:nil]; - - // TypeIndicator notifications - [[NSNotificationCenter defaultCenter] removeObserver:self name:SLKTypingIndicatorViewWillShowNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:SLKTypingIndicatorViewWillHideNotification object:nil]; - - // Application notifications - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationWillTerminateNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; -} - - -#pragma mark - View Auto-Rotation - -- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration -{ - self.rotating = YES; - - [self slk_prepareForInterfaceRotation]; -} - -- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation -{ - // Delays the rotation flag - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.25 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - self.rotating = NO; - }); -} - -- (NSUInteger)supportedInterfaceOrientations -{ - return UIInterfaceOrientationMaskAll; -} - -- (BOOL)shouldAutorotate -{ - return YES; -} - - -#pragma mark - View lifeterm - -- (void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; -} - -- (void)dealloc -{ - _tableView.delegate = nil; - _tableView.dataSource = nil; - _tableView = nil; - - _collectionView.delegate = nil; - _collectionView.dataSource = nil; - _collectionView = nil; - - _scrollView = nil; - - _autoCompletionView.delegate = nil; - _autoCompletionView.dataSource = nil; - _autoCompletionView = nil; - - _textInputbar.textView.delegate = nil; - _textInputbar = nil; - _typingIndicatorView = nil; - - _registeredPrefixes = nil; - _keyboardCommands = nil; - - _singleTapGesture.delegate = nil; - _singleTapGesture = nil; - _verticalPanGesture.delegate = nil; - _verticalPanGesture = nil; - _scrollViewHC = nil; - _textInputbarHC = nil; - _textInputbarHC = nil; - _typingIndicatorViewHC = nil; - _autoCompletionViewHC = nil; - _keyboardHC = nil; - - [self slk_unregisterNotifications]; -} - -@end diff --git a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKTypingIndicatorView.h b/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKTypingIndicatorView.h deleted file mode 100644 index 31f648199..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKTypingIndicatorView.h +++ /dev/null @@ -1,78 +0,0 @@ -// -// Copyright 2014 Slack Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import <UIKit/UIKit.h> - -UIKIT_EXTERN NSString * const SLKTypingIndicatorViewWillShowNotification; -UIKIT_EXTERN NSString * const SLKTypingIndicatorViewWillHideNotification; - -/** @name A custom view to display an indicator of users typing. */ -@interface SLKTypingIndicatorView : UIView - -/** The amount of time a name should keep visible. If is zero, the indicator will not remove nor disappear automatically. Default is 6.0 seconds*/ -@property (nonatomic, readwrite) NSTimeInterval interval; - -/** If YES, the user can dismiss the indicator by tapping on it. Default is YES. */ -@property (nonatomic, readwrite) BOOL canResignByTouch; - -/** Returns YES if the indicator is visible. */ -@property (nonatomic, readwrite, getter = isVisible) BOOL visible; - -/** The appropriate height of the view. */ -@property (nonatomic, readonly) CGFloat height; - -/** The color of the text. Default is grayColor. */ -@property (nonatomic, strong) UIColor *textColor; - -/** The font of the text. Default is system font, 12 pts. */ -@property (nonatomic, strong) UIFont *textFont; - -/** The font to be used when matching a username string. Default is system bold font, 12 pts. */ -@property (nonatomic, strong) UIFont *highlightFont; - -/** The inner padding to use when laying out content in the view. Default is {10, 40, 10, 10}. */ -@property (nonatomic, assign) UIEdgeInsets contentInset; - -/** - Inserts a user name, only if that user name is not yet on the list. - Each inserted name has an attached timer, which will automatically remove the name from the list once the interval is reached (default 6 seconds). - - The control follows a set of display rules, to accomodate the screen size: - - - When only 1 user name is set, it will display ":name is typing" - - - When only 2 user names are set, it will display ":name & :name are typing" - - - When more than 2 user names are set, it will display "several people are typing" - - @param username The user name string. - */ -- (void)insertUsername:(NSString *)username; - -/** - Removes a user name, if existent on the list. - Once there are no more items on the list, the indicator will automatically try to hide (by setting it self to visible = NO). - - @param username The user name string. - */ -- (void)removeUsername:(NSString *)username; - -/** - Dismisses the indicator view. - */ -- (void)dismissIndicator; - -@end diff --git a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKTypingIndicatorView.m b/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKTypingIndicatorView.m deleted file mode 100644 index fc299173c..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/SlackTextViewController/Source/Classes/SLKTypingIndicatorView.m +++ /dev/null @@ -1,358 +0,0 @@ -// -// Copyright 2014 Slack Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import "SLKTypingIndicatorView.h" -#import "UIView+SLKAdditions.h" -#import "SLKUIConstants.h" - -NSString * const SLKTypingIndicatorViewWillShowNotification = @"SLKTypingIndicatorViewWillShowNotification"; -NSString * const SLKTypingIndicatorViewWillHideNotification = @"SLKTypingIndicatorViewWillHideNotification"; - -#define SLKTypingIndicatorViewIdentifier [NSString stringWithFormat:@"%@.%@", SLKTextViewControllerDomain, NSStringFromClass([self class])] - -@interface SLKTypingIndicatorView () - -// The text label used to display the typing indicator content. -@property (nonatomic, strong) UILabel *textLabel; - -@property (nonatomic, strong) NSMutableArray *usernames; -@property (nonatomic, strong) NSMutableArray *timers; - -// Auto-Layout margin constraints used for updating their constants -@property (nonatomic, strong) NSLayoutConstraint *leftContraint; -@property (nonatomic, strong) NSLayoutConstraint *rightContraint; - -@end - -@implementation SLKTypingIndicatorView - -#pragma mark - Initializer - -- (id)init -{ - if (self = [super init]) { - [self slk_commonInit]; - } - return self; -} - -- (instancetype)initWithCoder:(NSCoder *)coder -{ - if (self = [super initWithCoder:coder]) { - [self slk_commonInit]; - } - return self; -} - -- (void)slk_commonInit -{ - self.interval = 6.0; - self.canResignByTouch = YES; - self.usernames = [NSMutableArray new]; - self.timers = [NSMutableArray new]; - - self.textColor = [UIColor grayColor]; - self.textFont = [UIFont systemFontOfSize:12.0]; - self.highlightFont = [UIFont boldSystemFontOfSize:12.0]; - self.contentInset = UIEdgeInsetsMake(10.0, 40.0, 10.0, 10.0); - - self.backgroundColor = [UIColor whiteColor]; - - [self addSubview:self.textLabel]; - - [self slk_setupConstraints]; -} - - -#pragma mark - UIView Overrides - -- (CGSize)intrinsicContentSize -{ - return CGSizeMake(UIViewNoIntrinsicMetric, [self height]); -} - -+ (BOOL)requiresConstraintBasedLayout -{ - return YES; -} - - -#pragma mark - Getters - -- (UILabel *)textLabel -{ - if (!_textLabel) - { - _textLabel = [UILabel new]; - _textLabel.translatesAutoresizingMaskIntoConstraints = NO; - _textLabel.backgroundColor = [UIColor clearColor]; - _textLabel.userInteractionEnabled = NO; - _textLabel.hidden = YES; - } - return _textLabel; -} - -- (NSAttributedString *)attributedString -{ - if (self.usernames.count == 0) { - return nil; - } - - NSString *text = nil; - NSString *firstObject = [self.usernames firstObject]; - NSString *lastObject = [self.usernames lastObject]; - - if (self.usernames.count == 1) { - text = [NSString stringWithFormat:NSLocalizedString(@"%@ is typing", nil), firstObject]; - } - else if (self.usernames.count == 2) { - text = [NSString stringWithFormat:NSLocalizedString(@"%@ & %@ are typing", nil), firstObject, lastObject]; - } - else if (self.usernames.count > 2) { - text = NSLocalizedString(@"Several people are typing", nil); - } - - NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init]; - style.alignment = NSTextAlignmentLeft; - style.lineBreakMode = NSLineBreakByTruncatingTail; - style.minimumLineHeight = 10.0; - - NSDictionary *attributes = @{NSFontAttributeName: self.textFont, - NSForegroundColorAttributeName: self.textColor, - NSParagraphStyleAttributeName: style, - }; - - NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:text attributes:attributes]; - - if (self.usernames.count <= 2) { - [attributedString addAttribute:NSFontAttributeName value:self.highlightFont range:[text rangeOfString:firstObject]]; - [attributedString addAttribute:NSFontAttributeName value:self.highlightFont range:[text rangeOfString:lastObject]]; - } - - return attributedString; -} - -- (CGFloat)height -{ - CGFloat height = self.textFont.lineHeight; - height += self.contentInset.top; - height += self.contentInset.bottom; - return height; -} - - -- (NSTimer *)slk_timerWithIdentifier:(NSString *)identifier -{ - for (NSTimer *timer in self.timers) { - if ([identifier isEqualToString:[timer.userInfo objectForKey:SLKTypingIndicatorViewIdentifier]]) { - return timer; - } - } - return nil; -} - - -#pragma mark - Setters - -- (void)setVisible:(BOOL)visible -{ - if (visible == self.visible) { - return; - } - - NSString *notificationName = visible ? SLKTypingIndicatorViewWillShowNotification : SLKTypingIndicatorViewWillHideNotification; - [[NSNotificationCenter defaultCenter] postNotificationName:notificationName object:self]; - - if (visible) { - self.textLabel.hidden = NO; - } - else { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - self.textLabel.hidden = YES; - }); - } - - _visible = visible; - - if (!visible) { - [self slk_cleanAll]; - } -} - -- (void)setContentInset:(UIEdgeInsets)insets -{ - if (UIEdgeInsetsEqualToEdgeInsets(self.contentInset, insets)) { - return; - } - - if (UIEdgeInsetsEqualToEdgeInsets(self.contentInset, UIEdgeInsetsZero)) { - _contentInset = insets; - return; - } - - _contentInset = insets; - - [self slk_updateConstraintConstants]; -} - - -#pragma mark - Public Methods - -- (void)insertUsername:(NSString *)username; -{ - if (!username) { - return; - } - - BOOL isShowing = [self.usernames containsObject:username]; - - if (_interval > 0.0) { - - if (isShowing) { - NSTimer *timer = [self slk_timerWithIdentifier:username]; - [self slk_invalidateTimer:timer]; - } - - NSTimer *timer = [NSTimer timerWithTimeInterval:_interval target:self selector:@selector(slk_shouldRemoveUsername:) userInfo:@{SLKTypingIndicatorViewIdentifier: username} repeats:NO]; - [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSDefaultRunLoopMode]; - [self.timers addObject:timer]; - } - - if (isShowing) { - return; - } - - [self.usernames addObject:username]; - - self.textLabel.attributedText = [self attributedString]; - - if (!self.isVisible) { - [self setVisible:YES]; - } -} - -- (void)removeUsername:(NSString *)username -{ - if (!username || ![self.usernames containsObject:username]) { - return; - } - - [self.usernames removeObject:username]; - - if (self.usernames.count > 0) { - self.textLabel.attributedText = [self attributedString]; - } - else if (self.isVisible) { - [self setVisible:NO]; - } -} - -- (void)dismissIndicator -{ - if (self.isVisible) { - [self setVisible:NO]; - } -} - - -#pragma mark - Private Methods - -- (void)slk_shouldRemoveUsername:(NSTimer *)timer -{ - NSString *identifier = [timer.userInfo objectForKey:SLKTypingIndicatorViewIdentifier]; - - [self removeUsername:identifier]; - [self slk_invalidateTimer:timer]; -} - -- (void)slk_invalidateTimer:(NSTimer *)timer -{ - if (timer) { - [timer invalidate]; - [self.timers removeObject:timer]; - timer = nil; - } -} - -- (void)slk_invalidateTimers -{ - for (NSTimer *timer in self.timers) { - [timer invalidate]; - } - - [self.timers removeAllObjects]; -} - -- (void)slk_cleanAll -{ - [self slk_invalidateTimers]; - - self.textLabel.text = nil; - - [self.usernames removeAllObjects]; -} - - -#pragma mark - View Auto-Layout - -- (void)slk_setupConstraints -{ - NSDictionary *views = @{@"textLabel": self.textLabel}; - - [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[textLabel]|" options:0 metrics:nil views:views]]; - [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-(0)-[textLabel]-(0@750)-|" options:0 metrics:nil views:views]]; - - self.leftContraint = [[self slk_constraintsForAttribute:NSLayoutAttributeLeading] firstObject]; - self.rightContraint = [[self slk_constraintsForAttribute:NSLayoutAttributeTrailing] firstObject]; - - [self slk_updateConstraintConstants]; -} - -- (void)slk_updateConstraintConstants -{ - self.leftContraint.constant = self.contentInset.left; - self.rightContraint.constant = self.contentInset.right; -} - - -#pragma mark - Hit Testing - -- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event -{ - UIView *view = [super hitTest:point withEvent:event]; - - if ([view isEqual:self]) { - if (self.isVisible && self.canResignByTouch) { - [self setVisible:NO]; - } - return view; - } - return view; -} - - -#pragma mark - Lifeterm - -- (void)dealloc -{ - [self slk_cleanAll]; - - _textLabel = nil; - _usernames = nil; - _timers = nil; -} - -@end
\ No newline at end of file diff --git a/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods-SlackTextViewController/Pods-SlackTextViewController-Private.xcconfig b/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods-SlackTextViewController/Pods-SlackTextViewController-Private.xcconfig deleted file mode 100644 index 8682d4301..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods-SlackTextViewController/Pods-SlackTextViewController-Private.xcconfig +++ /dev/null @@ -1,6 +0,0 @@ -#include "Pods-SlackTextViewController.xcconfig" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SlackTextViewController" "${PODS_ROOT}/Headers/Private/SlackTextViewController/Additions" "${PODS_ROOT}/Headers/Private/SlackTextViewController/Classes" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SlackTextViewController" "${PODS_ROOT}/Headers/Public/SlackTextViewController/Additions" "${PODS_ROOT}/Headers/Public/SlackTextViewController/Classes" -OTHER_LDFLAGS = -ObjC -PODS_ROOT = ${SRCROOT} -SKIP_INSTALL = YES
\ No newline at end of file diff --git a/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods-SlackTextViewController/Pods-SlackTextViewController-dummy.m b/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods-SlackTextViewController/Pods-SlackTextViewController-dummy.m deleted file mode 100644 index f66e118b8..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods-SlackTextViewController/Pods-SlackTextViewController-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import <Foundation/Foundation.h> -@interface PodsDummy_Pods_SlackTextViewController : NSObject -@end -@implementation PodsDummy_Pods_SlackTextViewController -@end diff --git a/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods-SlackTextViewController/Pods-SlackTextViewController-prefix.pch b/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods-SlackTextViewController/Pods-SlackTextViewController-prefix.pch deleted file mode 100644 index 95cf11d9f..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods-SlackTextViewController/Pods-SlackTextViewController-prefix.pch +++ /dev/null @@ -1,5 +0,0 @@ -#ifdef __OBJC__ -#import <UIKit/UIKit.h> -#endif - -#import "Pods-environment.h" diff --git a/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods-SlackTextViewController/Pods-SlackTextViewController.xcconfig b/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods-SlackTextViewController/Pods-SlackTextViewController.xcconfig deleted file mode 100644 index e69de29bb..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods-SlackTextViewController/Pods-SlackTextViewController.xcconfig +++ /dev/null diff --git a/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown b/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown deleted file mode 100644 index f6b96022c..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown +++ /dev/null @@ -1,21 +0,0 @@ -# Acknowledgements -This application makes use of the following third party libraries: - -## SlackTextViewController - - - Copyright 2015 Slack Technologies, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -Generated by CocoaPods - http://cocoapods.org diff --git a/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods/Pods-acknowledgements.plist b/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods/Pods-acknowledgements.plist deleted file mode 100644 index bb5d70f94..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods/Pods-acknowledgements.plist +++ /dev/null @@ -1,51 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>PreferenceSpecifiers</key> - <array> - <dict> - <key>FooterText</key> - <string>This application makes use of the following third party libraries:</string> - <key>Title</key> - <string>Acknowledgements</string> - <key>Type</key> - <string>PSGroupSpecifier</string> - </dict> - <dict> - <key>FooterText</key> - <string> - Copyright 2015 Slack Technologies, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -</string> - <key>Title</key> - <string>SlackTextViewController</string> - <key>Type</key> - <string>PSGroupSpecifier</string> - </dict> - <dict> - <key>FooterText</key> - <string>Generated by CocoaPods - http://cocoapods.org</string> - <key>Title</key> - <string></string> - <key>Type</key> - <string>PSGroupSpecifier</string> - </dict> - </array> - <key>StringsTable</key> - <string>Acknowledgements</string> - <key>Title</key> - <string>Acknowledgements</string> -</dict> -</plist> diff --git a/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods/Pods-dummy.m b/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods/Pods-dummy.m deleted file mode 100644 index ade64bd1a..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods/Pods-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import <Foundation/Foundation.h> -@interface PodsDummy_Pods : NSObject -@end -@implementation PodsDummy_Pods -@end diff --git a/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods/Pods-environment.h b/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods/Pods-environment.h deleted file mode 100644 index c4b8767fa..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods/Pods-environment.h +++ /dev/null @@ -1,14 +0,0 @@ - -// To check if a library is compiled with CocoaPods you -// can use the `COCOAPODS` macro definition which is -// defined in the xcconfigs so it is available in -// headers also when they are imported in the client -// project. - - -// SlackTextViewController -#define COCOAPODS_POD_AVAILABLE_SlackTextViewController -#define COCOAPODS_VERSION_MAJOR_SlackTextViewController 1 -#define COCOAPODS_VERSION_MINOR_SlackTextViewController 5 -#define COCOAPODS_VERSION_PATCH_SlackTextViewController 2 - diff --git a/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods/Pods-resources.sh b/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods/Pods-resources.sh deleted file mode 100644 index 0adecdd33..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods/Pods-resources.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh -set -e - -mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - -RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt -> "$RESOURCES_TO_COPY" - -XCASSET_FILES="" - -install_resource() -{ - case $1 in - *.storyboard) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" - ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" - ;; - *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" - ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" - ;; - *.framework) - echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - ;; - *.xcdatamodel) - echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" - xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" - ;; - *.xcdatamodeld) - echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" - xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" - ;; - *.xcmappingmodel) - echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" - xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" - ;; - *.xcassets) - XCASSET_FILES="$XCASSET_FILES '${PODS_ROOT}/$1'" - ;; - /*) - echo "$1" - echo "$1" >> "$RESOURCES_TO_COPY" - ;; - *) - echo "${PODS_ROOT}/$1" - echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" - ;; - esac -} - -rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -if [[ "${ACTION}" == "install" ]]; then - rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -fi -rm -f "$RESOURCES_TO_COPY" - -if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] -then - case "${TARGETED_DEVICE_FAMILY}" in - 1,2) - TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" - ;; - 1) - TARGET_DEVICE_ARGS="--target-device iphone" - ;; - 2) - TARGET_DEVICE_ARGS="--target-device ipad" - ;; - *) - TARGET_DEVICE_ARGS="--target-device mac" - ;; - esac - while read line; do XCASSET_FILES="$XCASSET_FILES '$line'"; done <<<$(find "$PWD" -name "*.xcassets" | egrep -v "^$PODS_ROOT") - echo $XCASSET_FILES | xargs actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -fi diff --git a/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods/Pods.debug.xcconfig b/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods/Pods.debug.xcconfig deleted file mode 100644 index 272611575..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods/Pods.debug.xcconfig +++ /dev/null @@ -1,6 +0,0 @@ -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SlackTextViewController" "${PODS_ROOT}/Headers/Public/SlackTextViewController/Additions" "${PODS_ROOT}/Headers/Public/SlackTextViewController/Classes" -OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SlackTextViewController" -isystem "${PODS_ROOT}/Headers/Public/SlackTextViewController/Additions" -isystem "${PODS_ROOT}/Headers/Public/SlackTextViewController/Classes" -OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-SlackTextViewController" -OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) -PODS_ROOT = ${SRCROOT}/Pods
\ No newline at end of file diff --git a/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods/Pods.release.xcconfig b/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods/Pods.release.xcconfig deleted file mode 100644 index 272611575..000000000 --- a/src/ui/ios/GF-Offline-Translator/Pods/Target Support Files/Pods/Pods.release.xcconfig +++ /dev/null @@ -1,6 +0,0 @@ -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SlackTextViewController" "${PODS_ROOT}/Headers/Public/SlackTextViewController/Additions" "${PODS_ROOT}/Headers/Public/SlackTextViewController/Classes" -OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SlackTextViewController" -isystem "${PODS_ROOT}/Headers/Public/SlackTextViewController/Additions" -isystem "${PODS_ROOT}/Headers/Public/SlackTextViewController/Classes" -OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-SlackTextViewController" -OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) -PODS_ROOT = ${SRCROOT}/Pods
\ No newline at end of file diff --git a/src/ui/ios/old-swift/gf-ios-swift.xcodeproj/project.pbxproj b/src/ui/ios/old-swift/gf-ios-swift.xcodeproj/project.pbxproj deleted file mode 100644 index ab3bf89e5..000000000 --- a/src/ui/ios/old-swift/gf-ios-swift.xcodeproj/project.pbxproj +++ /dev/null @@ -1,811 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - B62B413D1A5F513D00296901 /* Languages.swift in Sources */ = {isa = PBXBuildFile; fileRef = B62B413C1A5F513D00296901 /* Languages.swift */; }; - B62B413F1A61CCF700296901 /* Colors.swift in Sources */ = {isa = PBXBuildFile; fileRef = B62B413E1A61CCF700296901 /* Colors.swift */; }; - B62B41411A63241700296901 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B62B41401A63241700296901 /* UIKit.framework */; }; - B62C44F11A37A7DA003613DD /* grammars in Resources */ = {isa = PBXBuildFile; fileRef = B62C44F01A37A7DA003613DD /* grammars */; }; - B62E50921A3A628900805DD8 /* assert.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E502F1A3A628900805DD8 /* assert.c */; }; - B62E50931A3A628900805DD8 /* bits.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E50311A3A628900805DD8 /* bits.c */; }; - B62E50941A3A628900805DD8 /* choice.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E50331A3A628900805DD8 /* choice.c */; }; - B62E50951A3A628900805DD8 /* defs.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E50351A3A628900805DD8 /* defs.c */; }; - B62E50961A3A628900805DD8 /* enum.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E50371A3A628900805DD8 /* enum.c */; }; - B62E50971A3A628900805DD8 /* exn.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E50391A3A628900805DD8 /* exn.c */; }; - B62E50981A3A628900805DD8 /* file.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E503B1A3A628900805DD8 /* file.c */; }; - B62E50991A3A628900805DD8 /* fun.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E503D1A3A628900805DD8 /* fun.c */; }; - B62E509A1A3A628900805DD8 /* hash.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E503F1A3A628900805DD8 /* hash.c */; }; - B62E509B1A3A628900805DD8 /* in.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E50411A3A628900805DD8 /* in.c */; }; - B62E509C1A3A628900805DD8 /* map.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E50431A3A628900805DD8 /* map.c */; }; - B62E509D1A3A628900805DD8 /* mem.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E50451A3A628900805DD8 /* mem.c */; }; - B62E509E1A3A628900805DD8 /* out.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E50471A3A628900805DD8 /* out.c */; }; - B62E509F1A3A628900805DD8 /* prime.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E50491A3A628900805DD8 /* prime.c */; }; - B62E50A01A3A628900805DD8 /* seq.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E504B1A3A628900805DD8 /* seq.c */; }; - B62E50A11A3A628900805DD8 /* string.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E504D1A3A628900805DD8 /* string.c */; }; - B62E50A21A3A628900805DD8 /* ucs.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E50501A3A628900805DD8 /* ucs.c */; }; - B62E50A31A3A628900805DD8 /* utf8.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E50521A3A628900805DD8 /* utf8.c */; }; - B62E50A41A3A628900805DD8 /* variant.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E50541A3A628900805DD8 /* variant.c */; }; - B62E50A51A3A628900805DD8 /* data.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E50571A3A628900805DD8 /* data.c */; }; - B62E50A61A3A628900805DD8 /* evaluator.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E50591A3A628900805DD8 /* evaluator.c */; }; - B62E50A71A3A628900805DD8 /* expr.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E505B1A3A628900805DD8 /* expr.c */; }; - B62E50A81A3A628900805DD8 /* graphviz.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E505D1A3A628900805DD8 /* graphviz.c */; }; - B62E50A91A3A628900805DD8 /* hopu.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E505F1A3A628900805DD8 /* hopu.c */; }; - B62E50AA1A3A628900805DD8 /* jit.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E50611A3A628900805DD8 /* jit.c */; }; - B62E50AB1A3A628900805DD8 /* linearizer.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E50841A3A628900805DD8 /* linearizer.c */; }; - B62E50AC1A3A628900805DD8 /* literals.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E50861A3A628900805DD8 /* literals.c */; }; - B62E50AD1A3A628900805DD8 /* parser.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E50881A3A628900805DD8 /* parser.c */; }; - B62E50AE1A3A628900805DD8 /* parseval.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E50891A3A628900805DD8 /* parseval.c */; }; - B62E50AF1A3A628900805DD8 /* pgf.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E508A1A3A628900805DD8 /* pgf.c */; }; - B62E50B01A3A628900805DD8 /* printer.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E508C1A3A628900805DD8 /* printer.c */; }; - B62E50B11A3A628900805DD8 /* reader.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E508D1A3A628900805DD8 /* reader.c */; }; - B62E50B21A3A628900805DD8 /* reasoner.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E508F1A3A628900805DD8 /* reasoner.c */; }; - B62E50B31A3A628900805DD8 /* typechecker.c in Sources */ = {isa = PBXBuildFile; fileRef = B62E50911A3A628900805DD8 /* typechecker.c */; }; - B63010911A54C78400AD56A3 /* Translator.swift in Sources */ = {isa = PBXBuildFile; fileRef = B63010901A54C78400AD56A3 /* Translator.swift */; }; - B63010971A5716BF00AD56A3 /* ic_action_switch.png in Resources */ = {isa = PBXBuildFile; fileRef = B63010931A5716BF00AD56A3 /* ic_action_switch.png */; }; - B63010981A5716BF00AD56A3 /* ic_app.png in Resources */ = {isa = PBXBuildFile; fileRef = B63010941A5716BF00AD56A3 /* ic_app.png */; }; - B63010991A5716BF00AD56A3 /* ic_keyboard.png in Resources */ = {isa = PBXBuildFile; fileRef = B63010951A5716BF00AD56A3 /* ic_keyboard.png */; }; - B630109A1A5716BF00AD56A3 /* ic_mic.png in Resources */ = {isa = PBXBuildFile; fileRef = B63010961A5716BF00AD56A3 /* ic_mic.png */; }; - B630109C1A5764A700AD56A3 /* HelpViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B630109B1A5764A700AD56A3 /* HelpViewController.swift */; }; - B65248331A36598400C8BD53 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B65248321A36598400C8BD53 /* AppDelegate.swift */; }; - B65248351A36598400C8BD53 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B65248341A36598400C8BD53 /* ViewController.swift */; }; - B65248381A36598400C8BD53 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B65248361A36598400C8BD53 /* Main.storyboard */; }; - B652483A1A36598400C8BD53 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B65248391A36598400C8BD53 /* Images.xcassets */; }; - B652483D1A36598400C8BD53 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = B652483B1A36598400C8BD53 /* LaunchScreen.xib */; }; - B65248491A36598400C8BD53 /* gf_ios_swiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B65248481A36598400C8BD53 /* gf_ios_swiftTests.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - B65248431A36598400C8BD53 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = B65248251A36598400C8BD53 /* Project object */; - proxyType = 1; - remoteGlobalIDString = B652482C1A36598400C8BD53; - remoteInfo = "gf-ios-swift"; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - B62B413C1A5F513D00296901 /* Languages.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Languages.swift; sourceTree = "<group>"; }; - B62B413E1A61CCF700296901 /* Colors.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Colors.swift; sourceTree = "<group>"; }; - B62B41401A63241700296901 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - B62C44F01A37A7DA003613DD /* grammars */ = {isa = PBXFileReference; lastKnownFileType = folder; path = grammars; sourceTree = "<group>"; }; - B62C44F21A37AA7F003613DD /* gf-ios-swift-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "gf-ios-swift-Bridging-Header.h"; sourceTree = "<group>"; }; - B62E502F1A3A628900805DD8 /* assert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = assert.c; sourceTree = "<group>"; }; - B62E50301A3A628900805DD8 /* assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = assert.h; sourceTree = "<group>"; }; - B62E50311A3A628900805DD8 /* bits.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bits.c; sourceTree = "<group>"; }; - B62E50321A3A628900805DD8 /* bits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bits.h; sourceTree = "<group>"; }; - B62E50331A3A628900805DD8 /* choice.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = choice.c; sourceTree = "<group>"; }; - B62E50341A3A628900805DD8 /* choice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = choice.h; sourceTree = "<group>"; }; - B62E50351A3A628900805DD8 /* defs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = defs.c; sourceTree = "<group>"; }; - B62E50361A3A628900805DD8 /* defs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = defs.h; sourceTree = "<group>"; }; - B62E50371A3A628900805DD8 /* enum.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = enum.c; sourceTree = "<group>"; }; - B62E50381A3A628900805DD8 /* enum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = enum.h; sourceTree = "<group>"; }; - B62E50391A3A628900805DD8 /* exn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = exn.c; sourceTree = "<group>"; }; - B62E503A1A3A628900805DD8 /* exn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = exn.h; sourceTree = "<group>"; }; - B62E503B1A3A628900805DD8 /* file.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = file.c; sourceTree = "<group>"; }; - B62E503C1A3A628900805DD8 /* file.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = file.h; sourceTree = "<group>"; }; - B62E503D1A3A628900805DD8 /* fun.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fun.c; sourceTree = "<group>"; }; - B62E503E1A3A628900805DD8 /* fun.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fun.h; sourceTree = "<group>"; }; - B62E503F1A3A628900805DD8 /* hash.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hash.c; sourceTree = "<group>"; }; - B62E50401A3A628900805DD8 /* hash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hash.h; sourceTree = "<group>"; }; - B62E50411A3A628900805DD8 /* in.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = in.c; sourceTree = "<group>"; }; - B62E50421A3A628900805DD8 /* in.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = in.h; sourceTree = "<group>"; }; - B62E50431A3A628900805DD8 /* map.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = map.c; sourceTree = "<group>"; }; - B62E50441A3A628900805DD8 /* map.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = map.h; sourceTree = "<group>"; }; - B62E50451A3A628900805DD8 /* mem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mem.c; sourceTree = "<group>"; }; - B62E50461A3A628900805DD8 /* mem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mem.h; sourceTree = "<group>"; }; - B62E50471A3A628900805DD8 /* out.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = out.c; sourceTree = "<group>"; }; - B62E50481A3A628900805DD8 /* out.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = out.h; sourceTree = "<group>"; }; - B62E50491A3A628900805DD8 /* prime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = prime.c; sourceTree = "<group>"; }; - B62E504A1A3A628900805DD8 /* prime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = prime.h; sourceTree = "<group>"; }; - B62E504B1A3A628900805DD8 /* seq.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = seq.c; sourceTree = "<group>"; }; - B62E504C1A3A628900805DD8 /* seq.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = seq.h; sourceTree = "<group>"; }; - B62E504D1A3A628900805DD8 /* string.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = string.c; sourceTree = "<group>"; }; - B62E504E1A3A628900805DD8 /* string.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = string.h; sourceTree = "<group>"; }; - B62E504F1A3A628900805DD8 /* sysdeps.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sysdeps.h; sourceTree = "<group>"; }; - B62E50501A3A628900805DD8 /* ucs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ucs.c; sourceTree = "<group>"; }; - B62E50511A3A628900805DD8 /* ucs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ucs.h; sourceTree = "<group>"; }; - B62E50521A3A628900805DD8 /* utf8.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = utf8.c; sourceTree = "<group>"; }; - B62E50531A3A628900805DD8 /* utf8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utf8.h; sourceTree = "<group>"; }; - B62E50541A3A628900805DD8 /* variant.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = variant.c; sourceTree = "<group>"; }; - B62E50551A3A628900805DD8 /* variant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = variant.h; sourceTree = "<group>"; }; - B62E50571A3A628900805DD8 /* data.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = data.c; sourceTree = "<group>"; }; - B62E50581A3A628900805DD8 /* data.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = data.h; sourceTree = "<group>"; }; - B62E50591A3A628900805DD8 /* evaluator.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = evaluator.c; sourceTree = "<group>"; }; - B62E505A1A3A628900805DD8 /* evaluator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = evaluator.h; sourceTree = "<group>"; }; - B62E505B1A3A628900805DD8 /* expr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = expr.c; sourceTree = "<group>"; }; - B62E505C1A3A628900805DD8 /* expr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = expr.h; sourceTree = "<group>"; }; - B62E505D1A3A628900805DD8 /* graphviz.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = graphviz.c; sourceTree = "<group>"; }; - B62E505E1A3A628900805DD8 /* graphviz.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = graphviz.h; sourceTree = "<group>"; }; - B62E505F1A3A628900805DD8 /* hopu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hopu.c; sourceTree = "<group>"; }; - B62E50601A3A628900805DD8 /* hopu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hopu.h; sourceTree = "<group>"; }; - B62E50611A3A628900805DD8 /* jit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = jit.c; sourceTree = "<group>"; }; - B62E50641A3A628900805DD8 /* asm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asm.h; sourceTree = "<group>"; }; - B62E50651A3A628900805DD8 /* core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = core.h; sourceTree = "<group>"; }; - B62E50661A3A628900805DD8 /* fp-swf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "fp-swf.h"; sourceTree = "<group>"; }; - B62E50671A3A628900805DD8 /* fp-vfp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "fp-vfp.h"; sourceTree = "<group>"; }; - B62E50681A3A628900805DD8 /* fp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fp.h; sourceTree = "<group>"; }; - B62E50691A3A628900805DD8 /* funcs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = funcs.h; sourceTree = "<group>"; }; - B62E506A1A3A628900805DD8 /* asm-common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "asm-common.h"; sourceTree = "<group>"; }; - B62E506B1A3A628900805DD8 /* core-common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "core-common.h"; sourceTree = "<group>"; }; - B62E506C1A3A628900805DD8 /* fp-common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "fp-common.h"; sourceTree = "<group>"; }; - B62E506D1A3A628900805DD8 /* funcs-common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "funcs-common.h"; sourceTree = "<group>"; }; - B62E506F1A3A628900805DD8 /* asm-32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "asm-32.h"; sourceTree = "<group>"; }; - B62E50701A3A628900805DD8 /* asm-64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "asm-64.h"; sourceTree = "<group>"; }; - B62E50711A3A628900805DD8 /* asm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asm.h; sourceTree = "<group>"; }; - B62E50721A3A628900805DD8 /* core-32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "core-32.h"; sourceTree = "<group>"; }; - B62E50731A3A628900805DD8 /* core-64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "core-64.h"; sourceTree = "<group>"; }; - B62E50741A3A628900805DD8 /* core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = core.h; sourceTree = "<group>"; }; - B62E50751A3A628900805DD8 /* fp-32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "fp-32.h"; sourceTree = "<group>"; }; - B62E50761A3A628900805DD8 /* fp-64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "fp-64.h"; sourceTree = "<group>"; }; - B62E50771A3A628900805DD8 /* fp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fp.h; sourceTree = "<group>"; }; - B62E50781A3A628900805DD8 /* funcs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = funcs.h; sourceTree = "<group>"; }; - B62E507A1A3A628900805DD8 /* asm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asm.h; sourceTree = "<group>"; }; - B62E507B1A3A628900805DD8 /* core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = core.h; sourceTree = "<group>"; }; - B62E507C1A3A628900805DD8 /* fp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fp.h; sourceTree = "<group>"; }; - B62E507D1A3A628900805DD8 /* funcs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = funcs.h; sourceTree = "<group>"; }; - B62E507F1A3A628900805DD8 /* asm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asm.h; sourceTree = "<group>"; }; - B62E50801A3A628900805DD8 /* core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = core.h; sourceTree = "<group>"; }; - B62E50811A3A628900805DD8 /* fp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fp.h; sourceTree = "<group>"; }; - B62E50821A3A628900805DD8 /* funcs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = funcs.h; sourceTree = "<group>"; }; - B62E50831A3A628900805DD8 /* lightning.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lightning.h; sourceTree = "<group>"; }; - B62E50841A3A628900805DD8 /* linearizer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = linearizer.c; sourceTree = "<group>"; }; - B62E50851A3A628900805DD8 /* linearizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = linearizer.h; sourceTree = "<group>"; }; - B62E50861A3A628900805DD8 /* literals.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = literals.c; sourceTree = "<group>"; }; - B62E50871A3A628900805DD8 /* literals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = literals.h; sourceTree = "<group>"; }; - B62E50881A3A628900805DD8 /* parser.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = parser.c; sourceTree = "<group>"; }; - B62E50891A3A628900805DD8 /* parseval.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = parseval.c; sourceTree = "<group>"; }; - B62E508A1A3A628900805DD8 /* pgf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pgf.c; sourceTree = "<group>"; }; - B62E508B1A3A628900805DD8 /* pgf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pgf.h; sourceTree = "<group>"; }; - B62E508C1A3A628900805DD8 /* printer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = printer.c; sourceTree = "<group>"; }; - B62E508D1A3A628900805DD8 /* reader.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = reader.c; sourceTree = "<group>"; }; - B62E508E1A3A628900805DD8 /* reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reader.h; sourceTree = "<group>"; }; - B62E508F1A3A628900805DD8 /* reasoner.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = reasoner.c; sourceTree = "<group>"; }; - B62E50901A3A628900805DD8 /* reasoner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reasoner.h; sourceTree = "<group>"; }; - B62E50911A3A628900805DD8 /* typechecker.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = typechecker.c; sourceTree = "<group>"; }; - B63010901A54C78400AD56A3 /* Translator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Translator.swift; sourceTree = "<group>"; }; - B63010931A5716BF00AD56A3 /* ic_action_switch.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ic_action_switch.png; sourceTree = "<group>"; }; - B63010941A5716BF00AD56A3 /* ic_app.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ic_app.png; sourceTree = "<group>"; }; - B63010951A5716BF00AD56A3 /* ic_keyboard.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ic_keyboard.png; sourceTree = "<group>"; }; - B63010961A5716BF00AD56A3 /* ic_mic.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ic_mic.png; sourceTree = "<group>"; }; - B630109B1A5764A700AD56A3 /* HelpViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HelpViewController.swift; path = "gf-ios-swift/HelpViewController.swift"; sourceTree = SOURCE_ROOT; }; - B652482D1A36598400C8BD53 /* gf-ios-swift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "gf-ios-swift.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - B65248311A36598400C8BD53 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; - B65248321A36598400C8BD53 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; - B65248341A36598400C8BD53 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; }; - B65248371A36598400C8BD53 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; - B65248391A36598400C8BD53 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; }; - B652483C1A36598400C8BD53 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; }; - B65248421A36598400C8BD53 /* gf-ios-swiftTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "gf-ios-swiftTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - B65248471A36598400C8BD53 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; - B65248481A36598400C8BD53 /* gf_ios_swiftTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = gf_ios_swiftTests.swift; sourceTree = "<group>"; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - B652482A1A36598400C8BD53 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - B62B41411A63241700296901 /* UIKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B652483F1A36598400C8BD53 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - B62E502E1A3A628900805DD8 /* gu */ = { - isa = PBXGroup; - children = ( - B62E502F1A3A628900805DD8 /* assert.c */, - B62E50301A3A628900805DD8 /* assert.h */, - B62E50311A3A628900805DD8 /* bits.c */, - B62E50321A3A628900805DD8 /* bits.h */, - B62E50331A3A628900805DD8 /* choice.c */, - B62E50341A3A628900805DD8 /* choice.h */, - B62E50351A3A628900805DD8 /* defs.c */, - B62E50361A3A628900805DD8 /* defs.h */, - B62E50371A3A628900805DD8 /* enum.c */, - B62E50381A3A628900805DD8 /* enum.h */, - B62E50391A3A628900805DD8 /* exn.c */, - B62E503A1A3A628900805DD8 /* exn.h */, - B62E503B1A3A628900805DD8 /* file.c */, - B62E503C1A3A628900805DD8 /* file.h */, - B62E503D1A3A628900805DD8 /* fun.c */, - B62E503E1A3A628900805DD8 /* fun.h */, - B62E503F1A3A628900805DD8 /* hash.c */, - B62E50401A3A628900805DD8 /* hash.h */, - B62E50411A3A628900805DD8 /* in.c */, - B62E50421A3A628900805DD8 /* in.h */, - B62E50431A3A628900805DD8 /* map.c */, - B62E50441A3A628900805DD8 /* map.h */, - B62E50451A3A628900805DD8 /* mem.c */, - B62E50461A3A628900805DD8 /* mem.h */, - B62E50471A3A628900805DD8 /* out.c */, - B62E50481A3A628900805DD8 /* out.h */, - B62E50491A3A628900805DD8 /* prime.c */, - B62E504A1A3A628900805DD8 /* prime.h */, - B62E504B1A3A628900805DD8 /* seq.c */, - B62E504C1A3A628900805DD8 /* seq.h */, - B62E504D1A3A628900805DD8 /* string.c */, - B62E504E1A3A628900805DD8 /* string.h */, - B62E504F1A3A628900805DD8 /* sysdeps.h */, - B62E50501A3A628900805DD8 /* ucs.c */, - B62E50511A3A628900805DD8 /* ucs.h */, - B62E50521A3A628900805DD8 /* utf8.c */, - B62E50531A3A628900805DD8 /* utf8.h */, - B62E50541A3A628900805DD8 /* variant.c */, - B62E50551A3A628900805DD8 /* variant.h */, - ); - path = gu; - sourceTree = "<group>"; - }; - B62E50561A3A628900805DD8 /* pgf */ = { - isa = PBXGroup; - children = ( - B62E50571A3A628900805DD8 /* data.c */, - B62E50581A3A628900805DD8 /* data.h */, - B62E50591A3A628900805DD8 /* evaluator.c */, - B62E505A1A3A628900805DD8 /* evaluator.h */, - B62E505B1A3A628900805DD8 /* expr.c */, - B62E505C1A3A628900805DD8 /* expr.h */, - B62E505D1A3A628900805DD8 /* graphviz.c */, - B62E505E1A3A628900805DD8 /* graphviz.h */, - B62E505F1A3A628900805DD8 /* hopu.c */, - B62E50601A3A628900805DD8 /* hopu.h */, - B62E50611A3A628900805DD8 /* jit.c */, - B62E50621A3A628900805DD8 /* lightning */, - B62E50831A3A628900805DD8 /* lightning.h */, - B62E50841A3A628900805DD8 /* linearizer.c */, - B62E50851A3A628900805DD8 /* linearizer.h */, - B62E50861A3A628900805DD8 /* literals.c */, - B62E50871A3A628900805DD8 /* literals.h */, - B62E50881A3A628900805DD8 /* parser.c */, - B62E50891A3A628900805DD8 /* parseval.c */, - B62E508A1A3A628900805DD8 /* pgf.c */, - B62E508B1A3A628900805DD8 /* pgf.h */, - B62E508C1A3A628900805DD8 /* printer.c */, - B62E508D1A3A628900805DD8 /* reader.c */, - B62E508E1A3A628900805DD8 /* reader.h */, - B62E508F1A3A628900805DD8 /* reasoner.c */, - B62E50901A3A628900805DD8 /* reasoner.h */, - B62E50911A3A628900805DD8 /* typechecker.c */, - ); - path = pgf; - sourceTree = "<group>"; - }; - B62E50621A3A628900805DD8 /* lightning */ = { - isa = PBXGroup; - children = ( - B62E50631A3A628900805DD8 /* arm */, - B62E506A1A3A628900805DD8 /* asm-common.h */, - B62E506B1A3A628900805DD8 /* core-common.h */, - B62E506C1A3A628900805DD8 /* fp-common.h */, - B62E506D1A3A628900805DD8 /* funcs-common.h */, - B62E506E1A3A628900805DD8 /* i386 */, - B62E50791A3A628900805DD8 /* ppc */, - B62E507E1A3A628900805DD8 /* sparc */, - ); - path = lightning; - sourceTree = "<group>"; - }; - B62E50631A3A628900805DD8 /* arm */ = { - isa = PBXGroup; - children = ( - B62E50641A3A628900805DD8 /* asm.h */, - B62E50651A3A628900805DD8 /* core.h */, - B62E50661A3A628900805DD8 /* fp-swf.h */, - B62E50671A3A628900805DD8 /* fp-vfp.h */, - B62E50681A3A628900805DD8 /* fp.h */, - B62E50691A3A628900805DD8 /* funcs.h */, - ); - path = arm; - sourceTree = "<group>"; - }; - B62E506E1A3A628900805DD8 /* i386 */ = { - isa = PBXGroup; - children = ( - B62E506F1A3A628900805DD8 /* asm-32.h */, - B62E50701A3A628900805DD8 /* asm-64.h */, - B62E50711A3A628900805DD8 /* asm.h */, - B62E50721A3A628900805DD8 /* core-32.h */, - B62E50731A3A628900805DD8 /* core-64.h */, - B62E50741A3A628900805DD8 /* core.h */, - B62E50751A3A628900805DD8 /* fp-32.h */, - B62E50761A3A628900805DD8 /* fp-64.h */, - B62E50771A3A628900805DD8 /* fp.h */, - B62E50781A3A628900805DD8 /* funcs.h */, - ); - path = i386; - sourceTree = "<group>"; - }; - B62E50791A3A628900805DD8 /* ppc */ = { - isa = PBXGroup; - children = ( - B62E507A1A3A628900805DD8 /* asm.h */, - B62E507B1A3A628900805DD8 /* core.h */, - B62E507C1A3A628900805DD8 /* fp.h */, - B62E507D1A3A628900805DD8 /* funcs.h */, - ); - path = ppc; - sourceTree = "<group>"; - }; - B62E507E1A3A628900805DD8 /* sparc */ = { - isa = PBXGroup; - children = ( - B62E507F1A3A628900805DD8 /* asm.h */, - B62E50801A3A628900805DD8 /* core.h */, - B62E50811A3A628900805DD8 /* fp.h */, - B62E50821A3A628900805DD8 /* funcs.h */, - ); - path = sparc; - sourceTree = "<group>"; - }; - B63010921A5716BF00AD56A3 /* images */ = { - isa = PBXGroup; - children = ( - B63010931A5716BF00AD56A3 /* ic_action_switch.png */, - B63010941A5716BF00AD56A3 /* ic_app.png */, - B63010951A5716BF00AD56A3 /* ic_keyboard.png */, - B63010961A5716BF00AD56A3 /* ic_mic.png */, - ); - path = images; - sourceTree = "<group>"; - }; - B65248241A36598400C8BD53 = { - isa = PBXGroup; - children = ( - B62B41401A63241700296901 /* UIKit.framework */, - B62E502E1A3A628900805DD8 /* gu */, - B62E50561A3A628900805DD8 /* pgf */, - B62C44F01A37A7DA003613DD /* grammars */, - B652482F1A36598400C8BD53 /* gf-ios-swift */, - B65248451A36598400C8BD53 /* gf-ios-swiftTests */, - B652482E1A36598400C8BD53 /* Products */, - ); - sourceTree = "<group>"; - }; - B652482E1A36598400C8BD53 /* Products */ = { - isa = PBXGroup; - children = ( - B652482D1A36598400C8BD53 /* gf-ios-swift.app */, - B65248421A36598400C8BD53 /* gf-ios-swiftTests.xctest */, - ); - name = Products; - sourceTree = "<group>"; - }; - B652482F1A36598400C8BD53 /* gf-ios-swift */ = { - isa = PBXGroup; - children = ( - B65248321A36598400C8BD53 /* AppDelegate.swift */, - B630109B1A5764A700AD56A3 /* HelpViewController.swift */, - B65248341A36598400C8BD53 /* ViewController.swift */, - B62B413C1A5F513D00296901 /* Languages.swift */, - B65248361A36598400C8BD53 /* Main.storyboard */, - B65248391A36598400C8BD53 /* Images.xcassets */, - B652483B1A36598400C8BD53 /* LaunchScreen.xib */, - B65248301A36598400C8BD53 /* Supporting Files */, - B62C44F21A37AA7F003613DD /* gf-ios-swift-Bridging-Header.h */, - B63010901A54C78400AD56A3 /* Translator.swift */, - B62B413E1A61CCF700296901 /* Colors.swift */, - ); - path = "gf-ios-swift"; - sourceTree = "<group>"; - }; - B65248301A36598400C8BD53 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - B63010921A5716BF00AD56A3 /* images */, - B65248311A36598400C8BD53 /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = "<group>"; - }; - B65248451A36598400C8BD53 /* gf-ios-swiftTests */ = { - isa = PBXGroup; - children = ( - B65248481A36598400C8BD53 /* gf_ios_swiftTests.swift */, - B65248461A36598400C8BD53 /* Supporting Files */, - ); - path = "gf-ios-swiftTests"; - sourceTree = "<group>"; - }; - B65248461A36598400C8BD53 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - B65248471A36598400C8BD53 /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = "<group>"; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - B652482C1A36598400C8BD53 /* gf-ios-swift */ = { - isa = PBXNativeTarget; - buildConfigurationList = B652484C1A36598400C8BD53 /* Build configuration list for PBXNativeTarget "gf-ios-swift" */; - buildPhases = ( - B65248291A36598400C8BD53 /* Sources */, - B652482A1A36598400C8BD53 /* Frameworks */, - B652482B1A36598400C8BD53 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "gf-ios-swift"; - productName = "gf-ios-swift"; - productReference = B652482D1A36598400C8BD53 /* gf-ios-swift.app */; - productType = "com.apple.product-type.application"; - }; - B65248411A36598400C8BD53 /* gf-ios-swiftTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = B652484F1A36598400C8BD53 /* Build configuration list for PBXNativeTarget "gf-ios-swiftTests" */; - buildPhases = ( - B652483E1A36598400C8BD53 /* Sources */, - B652483F1A36598400C8BD53 /* Frameworks */, - B65248401A36598400C8BD53 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - B65248441A36598400C8BD53 /* PBXTargetDependency */, - ); - name = "gf-ios-swiftTests"; - productName = "gf-ios-swiftTests"; - productReference = B65248421A36598400C8BD53 /* gf-ios-swiftTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - B65248251A36598400C8BD53 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0610; - ORGANIZATIONNAME = Vyvyan; - TargetAttributes = { - B652482C1A36598400C8BD53 = { - CreatedOnToolsVersion = 6.1.1; - DevelopmentTeam = D6DRLEKR8M; - }; - B65248411A36598400C8BD53 = { - CreatedOnToolsVersion = 6.1.1; - TestTargetID = B652482C1A36598400C8BD53; - }; - }; - }; - buildConfigurationList = B65248281A36598400C8BD53 /* Build configuration list for PBXProject "gf-ios-swift" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = B65248241A36598400C8BD53; - productRefGroup = B652482E1A36598400C8BD53 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - B652482C1A36598400C8BD53 /* gf-ios-swift */, - B65248411A36598400C8BD53 /* gf-ios-swiftTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - B652482B1A36598400C8BD53 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - B63010971A5716BF00AD56A3 /* ic_action_switch.png in Resources */, - B630109A1A5716BF00AD56A3 /* ic_mic.png in Resources */, - B63010981A5716BF00AD56A3 /* ic_app.png in Resources */, - B63010991A5716BF00AD56A3 /* ic_keyboard.png in Resources */, - B65248381A36598400C8BD53 /* Main.storyboard in Resources */, - B652483D1A36598400C8BD53 /* LaunchScreen.xib in Resources */, - B62C44F11A37A7DA003613DD /* grammars in Resources */, - B652483A1A36598400C8BD53 /* Images.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B65248401A36598400C8BD53 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - B65248291A36598400C8BD53 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - B62E50B11A3A628900805DD8 /* reader.c in Sources */, - B62E50921A3A628900805DD8 /* assert.c in Sources */, - B62E509C1A3A628900805DD8 /* map.c in Sources */, - B62E50971A3A628900805DD8 /* exn.c in Sources */, - B62E50931A3A628900805DD8 /* bits.c in Sources */, - B62E50A21A3A628900805DD8 /* ucs.c in Sources */, - B62E50B01A3A628900805DD8 /* printer.c in Sources */, - B62E50A81A3A628900805DD8 /* graphviz.c in Sources */, - B62E50A51A3A628900805DD8 /* data.c in Sources */, - B62E50941A3A628900805DD8 /* choice.c in Sources */, - B62E509F1A3A628900805DD8 /* prime.c in Sources */, - B63010911A54C78400AD56A3 /* Translator.swift in Sources */, - B62E50A11A3A628900805DD8 /* string.c in Sources */, - B62E50AC1A3A628900805DD8 /* literals.c in Sources */, - B62E50AB1A3A628900805DD8 /* linearizer.c in Sources */, - B65248351A36598400C8BD53 /* ViewController.swift in Sources */, - B62E509E1A3A628900805DD8 /* out.c in Sources */, - B62E50AA1A3A628900805DD8 /* jit.c in Sources */, - B62E50A41A3A628900805DD8 /* variant.c in Sources */, - B62E50A91A3A628900805DD8 /* hopu.c in Sources */, - B62E50A31A3A628900805DD8 /* utf8.c in Sources */, - B65248331A36598400C8BD53 /* AppDelegate.swift in Sources */, - B62E50AF1A3A628900805DD8 /* pgf.c in Sources */, - B62B413D1A5F513D00296901 /* Languages.swift in Sources */, - B62E50951A3A628900805DD8 /* defs.c in Sources */, - B62E50A01A3A628900805DD8 /* seq.c in Sources */, - B62E50991A3A628900805DD8 /* fun.c in Sources */, - B62E50B21A3A628900805DD8 /* reasoner.c in Sources */, - B62E509D1A3A628900805DD8 /* mem.c in Sources */, - B62E509B1A3A628900805DD8 /* in.c in Sources */, - B62E509A1A3A628900805DD8 /* hash.c in Sources */, - B62B413F1A61CCF700296901 /* Colors.swift in Sources */, - B62E50B31A3A628900805DD8 /* typechecker.c in Sources */, - B630109C1A5764A700AD56A3 /* HelpViewController.swift in Sources */, - B62E50961A3A628900805DD8 /* enum.c in Sources */, - B62E50981A3A628900805DD8 /* file.c in Sources */, - B62E50A71A3A628900805DD8 /* expr.c in Sources */, - B62E50AD1A3A628900805DD8 /* parser.c in Sources */, - B62E50A61A3A628900805DD8 /* evaluator.c in Sources */, - B62E50AE1A3A628900805DD8 /* parseval.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B652483E1A36598400C8BD53 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - B65248491A36598400C8BD53 /* gf_ios_swiftTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - B65248441A36598400C8BD53 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = B652482C1A36598400C8BD53 /* gf-ios-swift */; - targetProxy = B65248431A36598400C8BD53 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - B65248361A36598400C8BD53 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - B65248371A36598400C8BD53 /* Base */, - ); - name = Main.storyboard; - sourceTree = "<group>"; - }; - B652483B1A36598400C8BD53 /* LaunchScreen.xib */ = { - isa = PBXVariantGroup; - children = ( - B652483C1A36598400C8BD53 /* Base */, - ); - name = LaunchScreen.xib; - sourceTree = "<group>"; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - B652484A1A36598400C8BD53 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - B652484B1A36598400C8BD53 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - B652484D1A36598400C8BD53 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "iPhone Developer"; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = "gf-ios-swift/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - "$(PROJECT_DIR)/gf-ios-swift", - ); - OTHER_CFLAGS = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/gf-ios-swift/gf-ios-swift-Bridging-Header.h"; - }; - name = Debug; - }; - B652484E1A36598400C8BD53 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "iPhone Developer"; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = "gf-ios-swift/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - "$(PROJECT_DIR)/gf-ios-swift", - ); - OTHER_CFLAGS = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/gf-ios-swift/gf-ios-swift-Bridging-Header.h"; - }; - name = Release; - }; - B65248501A36598400C8BD53 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = "gf-ios-swiftTests/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/gf-ios-swift.app/gf-ios-swift"; - }; - name = Debug; - }; - B65248511A36598400C8BD53 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); - INFOPLIST_FILE = "gf-ios-swiftTests/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/gf-ios-swift.app/gf-ios-swift"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - B65248281A36598400C8BD53 /* Build configuration list for PBXProject "gf-ios-swift" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - B652484A1A36598400C8BD53 /* Debug */, - B652484B1A36598400C8BD53 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - B652484C1A36598400C8BD53 /* Build configuration list for PBXNativeTarget "gf-ios-swift" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - B652484D1A36598400C8BD53 /* Debug */, - B652484E1A36598400C8BD53 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - B652484F1A36598400C8BD53 /* Build configuration list for PBXNativeTarget "gf-ios-swiftTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - B65248501A36598400C8BD53 /* Debug */, - B65248511A36598400C8BD53 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = B65248251A36598400C8BD53 /* Project object */; -} diff --git a/src/ui/ios/old-swift/gf-ios-swift.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/src/ui/ios/old-swift/gf-ios-swift.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index f22c50dca..000000000 --- a/src/ui/ios/old-swift/gf-ios-swift.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<Workspace - version = "1.0"> - <FileRef - location = "self:gf-ios-swift.xcodeproj"> - </FileRef> -</Workspace> diff --git a/src/ui/ios/old-swift/gf-ios-swift.xcodeproj/project.xcworkspace/xcshareddata/gf-ios-swift.xccheckout b/src/ui/ios/old-swift/gf-ios-swift.xcodeproj/project.xcworkspace/xcshareddata/gf-ios-swift.xccheckout deleted file mode 100644 index 96f26dba2..000000000 --- a/src/ui/ios/old-swift/gf-ios-swift.xcodeproj/project.xcworkspace/xcshareddata/gf-ios-swift.xccheckout +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>IDESourceControlProjectFavoriteDictionaryKey</key> - <false/> - <key>IDESourceControlProjectIdentifier</key> - <string>5CFAFFCD-97BB-4806-823D-973AFB2DB882</string> - <key>IDESourceControlProjectName</key> - <string>gf-ios-swift</string> - <key>IDESourceControlProjectOriginsDictionary</key> - <dict> - <key>716509F1F37F996016FEDF093BF5C7F801D32B1E</key> - <string>bitbucket.org:devalanteriel/gf-swift.git</string> - </dict> - <key>IDESourceControlProjectPath</key> - <string>gf-ios-swift/gf-ios-swift.xcodeproj</string> - <key>IDESourceControlProjectRelativeInstallPathDictionary</key> - <dict> - <key>716509F1F37F996016FEDF093BF5C7F801D32B1E</key> - <string>../../..</string> - </dict> - <key>IDESourceControlProjectURL</key> - <string>bitbucket.org:devalanteriel/gf-swift.git</string> - <key>IDESourceControlProjectVersion</key> - <integer>111</integer> - <key>IDESourceControlProjectWCCIdentifier</key> - <string>716509F1F37F996016FEDF093BF5C7F801D32B1E</string> - <key>IDESourceControlProjectWCConfigurations</key> - <array> - <dict> - <key>IDESourceControlRepositoryExtensionIdentifierKey</key> - <string>public.vcs.git</string> - <key>IDESourceControlWCCIdentifierKey</key> - <string>716509F1F37F996016FEDF093BF5C7F801D32B1E</string> - <key>IDESourceControlWCCName</key> - <string>gf-ios-swift</string> - </dict> - </array> -</dict> -</plist> diff --git a/src/ui/ios/old-swift/gf-ios-swift.xcodeproj/project.xcworkspace/xcuserdata/aarne.xcuserdatad/UserInterfaceState.xcuserstate b/src/ui/ios/old-swift/gf-ios-swift.xcodeproj/project.xcworkspace/xcuserdata/aarne.xcuserdatad/UserInterfaceState.xcuserstate Binary files differdeleted file mode 100644 index 079b665bb..000000000 --- a/src/ui/ios/old-swift/gf-ios-swift.xcodeproj/project.xcworkspace/xcuserdata/aarne.xcuserdatad/UserInterfaceState.xcuserstate +++ /dev/null diff --git a/src/ui/ios/old-swift/gf-ios-swift.xcodeproj/project.xcworkspace/xcuserdata/joelhinz.xcuserdatad/UserInterfaceState.xcuserstate b/src/ui/ios/old-swift/gf-ios-swift.xcodeproj/project.xcworkspace/xcuserdata/joelhinz.xcuserdatad/UserInterfaceState.xcuserstate Binary files differdeleted file mode 100644 index dce88ae26..000000000 --- a/src/ui/ios/old-swift/gf-ios-swift.xcodeproj/project.xcworkspace/xcuserdata/joelhinz.xcuserdatad/UserInterfaceState.xcuserstate +++ /dev/null diff --git a/src/ui/ios/old-swift/gf-ios-swift/AppDelegate.swift b/src/ui/ios/old-swift/gf-ios-swift/AppDelegate.swift deleted file mode 100644 index f70ff9aa2..000000000 --- a/src/ui/ios/old-swift/gf-ios-swift/AppDelegate.swift +++ /dev/null @@ -1,38 +0,0 @@ -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { - // Override point for customization after application launch. - return true - } - - func applicationWillResignActive(application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(application: UIApplication) { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - - -} - diff --git a/src/ui/ios/old-swift/gf-ios-swift/Base.lproj/LaunchScreen.xib b/src/ui/ios/old-swift/gf-ios-swift/Base.lproj/LaunchScreen.xib deleted file mode 100644 index 08d58bfed..000000000 --- a/src/ui/ios/old-swift/gf-ios-swift/Base.lproj/LaunchScreen.xib +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6254" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES"> - <dependencies> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6247"/> - <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/> - </dependencies> - <objects> - <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> - <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> - <view contentMode="scaleToFill" id="iN0-l3-epB"> - <rect key="frame" x="0.0" y="0.0" width="480" height="480"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> - <subviews> - <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="gf-ios-swift" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX"> - <rect key="frame" x="20" y="140" width="441" height="43"/> - <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/> - <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> - <nil key="highlightedColor"/> - </label> - </subviews> - <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> - <constraints> - <constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/> - <constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/> - <constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/> - </constraints> - <nil key="simulatedStatusBarMetrics"/> - <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> - <point key="canvasLocation" x="548" y="455"/> - </view> - </objects> -</document> diff --git a/src/ui/ios/old-swift/gf-ios-swift/Base.lproj/Main.storyboard b/src/ui/ios/old-swift/gf-ios-swift/Base.lproj/Main.storyboard deleted file mode 100644 index ff087bd67..000000000 --- a/src/ui/ios/old-swift/gf-ios-swift/Base.lproj/Main.storyboard +++ /dev/null @@ -1,242 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6254" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r"> - <dependencies> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6247"/> - <capability name="Alignment constraints to the first baseline" minToolsVersion="6.0"/> - <capability name="Alignment constraints with different attributes" minToolsVersion="5.1"/> - <capability name="Constraints to layout margins" minToolsVersion="6.0"/> - </dependencies> - <scenes> - <!--Main view controller--> - <scene sceneID="tne-QT-ifu"> - <objects> - <viewController title="Main view controller" id="BYZ-38-t0r" customClass="ViewController" customModule="gf_ios_swift" customModuleProvider="target" sceneMemberID="viewController"> - <layoutGuides> - <viewControllerLayoutGuide type="top" id="l7I-EE-PVz"/> - <viewControllerLayoutGuide type="bottom" id="2id-YU-Gsq"/> - </layoutGuides> - <view key="view" contentMode="scaleToFill" id="wae-JL-Lho"> - <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> - <subviews> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jLE-dy-saG"> - <rect key="frame" x="0.0" y="20" width="600" height="54"/> - <subviews> - <imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="ic_app.png" translatesAutoresizingMaskIntoConstraints="NO" id="uee-Kw-8PE"> - <rect key="frame" x="8" y="9" width="36" height="36"/> - </imageView> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="GF Offline Translator" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mPU-2n-FFA"> - <rect key="frame" x="52" y="16" width="157" height="21"/> - <fontDescription key="fontDescription" type="system" pointSize="17"/> - <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/> - <nil key="highlightedColor"/> - </label> - <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3n3-Sf-P9J"> - <rect key="frame" x="557" y="12" width="35" height="30"/> - <constraints> - <constraint firstAttribute="width" constant="35" id="qUL-Aa-ctK"/> - </constraints> - <state key="normal" title="Help"> - <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/> - </state> - <connections> - <segue destination="hV5-UM-8hP" kind="show" id="Wbx-xn-VFi"/> - </connections> - </button> - </subviews> - <color key="backgroundColor" red="0.2265625" green="0.2265625" blue="0.2265625" alpha="1" colorSpace="calibratedRGB"/> - <constraints> - <constraint firstAttribute="bottom" secondItem="mPU-2n-FFA" secondAttribute="bottom" constant="17" id="1y1-Dl-MV6"/> - <constraint firstItem="mPU-2n-FFA" firstAttribute="baseline" secondItem="3n3-Sf-P9J" secondAttribute="baseline" id="5g0-IW-7M5"/> - <constraint firstItem="uee-Kw-8PE" firstAttribute="leading" secondItem="jLE-dy-saG" secondAttribute="leadingMargin" id="CqM-xw-M6e"/> - <constraint firstItem="uee-Kw-8PE" firstAttribute="centerY" secondItem="3n3-Sf-P9J" secondAttribute="centerY" id="J2z-8G-1d5"/> - <constraint firstItem="mPU-2n-FFA" firstAttribute="leading" secondItem="uee-Kw-8PE" secondAttribute="trailing" constant="8" symbolic="YES" id="N02-lW-stz"/> - <constraint firstItem="3n3-Sf-P9J" firstAttribute="trailing" secondItem="jLE-dy-saG" secondAttribute="trailingMargin" id="Ydq-87-ZdY"/> - <constraint firstItem="mPU-2n-FFA" firstAttribute="top" secondItem="jLE-dy-saG" secondAttribute="top" constant="16" id="afL-yS-6ju"/> - <constraint firstItem="mPU-2n-FFA" firstAttribute="baseline" secondItem="3n3-Sf-P9J" secondAttribute="firstBaseline" id="ffK-JY-sh8"/> - <constraint firstItem="uee-Kw-8PE" firstAttribute="centerY" secondItem="jLE-dy-saG" secondAttribute="centerY" id="h0F-TI-Xbk"/> - </constraints> - </view> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wH0-0y-PJl"> - <rect key="frame" x="0.0" y="74" width="600" height="90"/> - <subviews> - <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="English" borderStyle="roundedRect" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="g1E-VP-f78"> - <rect key="frame" x="8" y="8" width="180" height="30"/> - <constraints> - <constraint firstAttribute="width" constant="180" id="KtT-7A-FcQ"/> - </constraints> - <fontDescription key="fontDescription" type="system" pointSize="12"/> - <textInputTraits key="textInputTraits"/> - </textField> - <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="Swedish" borderStyle="roundedRect" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="31S-0q-S0M"> - <rect key="frame" x="8" y="52" width="180" height="30"/> - <fontDescription key="fontDescription" type="system" pointSize="12"/> - <textInputTraits key="textInputTraits" enablesReturnKeyAutomatically="YES"/> - </textField> - <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="q8W-YQ-yVf"> - <rect key="frame" x="546" y="22" width="46" height="46"/> - <constraints> - <constraint firstAttribute="width" constant="46" id="wA6-fY-6Yn"/> - </constraints> - <state key="normal" backgroundImage="ic_mic.png"> - <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/> - </state> - <connections> - <action selector="openMicrophone:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Sxu-s0-KiU"/> - </connections> - </button> - <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Fcg-Gz-VL8"> - <rect key="frame" x="492" y="12" width="46" height="46"/> - <constraints> - <constraint firstAttribute="width" constant="46" id="2Iu-eu-EEi"/> - </constraints> - <state key="normal" backgroundImage="ic_keyboard.png"> - <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/> - </state> - <connections> - <action selector="openKeyboard:" destination="BYZ-38-t0r" eventType="touchUpInside" id="mXc-7v-Gym"/> - </connections> - </button> - <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="lZ6-Um-4nv"> - <rect key="frame" x="438" y="22" width="46" height="46"/> - <constraints> - <constraint firstAttribute="width" constant="46" id="skb-99-Z93"/> - </constraints> - <state key="normal" backgroundImage="ic_action_switch.png"> - <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/> - </state> - <connections> - <action selector="switchLanguages:" destination="BYZ-38-t0r" eventType="touchUpInside" id="gxh-Mn-swH"/> - </connections> - </button> - </subviews> - <color key="backgroundColor" red="0.83405991020000003" green="0.83405991020000003" blue="0.83405991020000003" alpha="1" colorSpace="calibratedRGB"/> - <constraints> - <constraint firstItem="g1E-VP-f78" firstAttribute="leading" secondItem="31S-0q-S0M" secondAttribute="leading" id="Axm-A7-AW5"/> - <constraint firstItem="31S-0q-S0M" firstAttribute="bottom" secondItem="wH0-0y-PJl" secondAttribute="bottomMargin" id="D3J-OI-cOp"/> - <constraint firstItem="g1E-VP-f78" firstAttribute="leading" secondItem="wH0-0y-PJl" secondAttribute="leadingMargin" id="Gb3-Nd-JYg"/> - <constraint firstItem="Fcg-Gz-VL8" firstAttribute="leading" secondItem="lZ6-Um-4nv" secondAttribute="trailing" constant="8" symbolic="YES" id="H09-XK-pR5"/> - <constraint firstAttribute="bottom" secondItem="Fcg-Gz-VL8" secondAttribute="bottom" constant="32" id="Jdk-k5-zmU"/> - <constraint firstItem="lZ6-Um-4nv" firstAttribute="baseline" secondItem="q8W-YQ-yVf" secondAttribute="baseline" id="R1m-B4-uTV"/> - <constraint firstItem="q8W-YQ-yVf" firstAttribute="trailing" secondItem="wH0-0y-PJl" secondAttribute="trailingMargin" id="SoL-3l-uQ3"/> - <constraint firstItem="q8W-YQ-yVf" firstAttribute="firstBaseline" secondItem="lZ6-Um-4nv" secondAttribute="firstBaseline" id="T7u-nU-sjg"/> - <constraint firstItem="g1E-VP-f78" firstAttribute="top" secondItem="wH0-0y-PJl" secondAttribute="topMargin" id="Why-mX-52K"/> - <constraint firstItem="Fcg-Gz-VL8" firstAttribute="top" secondItem="wH0-0y-PJl" secondAttribute="top" constant="12" id="ahZ-rS-wDW"/> - <constraint firstItem="lZ6-Um-4nv" firstAttribute="top" secondItem="q8W-YQ-yVf" secondAttribute="top" id="eGp-Dy-lng"/> - <constraint firstItem="lZ6-Um-4nv" firstAttribute="top" secondItem="wH0-0y-PJl" secondAttribute="top" constant="22" id="flR-i8-Tx1"/> - <constraint firstItem="q8W-YQ-yVf" firstAttribute="bottom" secondItem="lZ6-Um-4nv" secondAttribute="bottom" id="iqb-lC-ww8"/> - <constraint firstItem="q8W-YQ-yVf" firstAttribute="centerY" secondItem="wH0-0y-PJl" secondAttribute="centerY" id="mjJ-gt-CuI"/> - <constraint firstItem="g1E-VP-f78" firstAttribute="trailing" secondItem="31S-0q-S0M" secondAttribute="trailing" id="oUn-Pm-i8j"/> - <constraint firstItem="q8W-YQ-yVf" firstAttribute="leading" secondItem="Fcg-Gz-VL8" secondAttribute="trailing" constant="8" symbolic="YES" id="xwg-yQ-qaP"/> - </constraints> - </view> - <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="g83-TI-wJI"> - <rect key="frame" x="0.0" y="172" width="600" height="428"/> - </scrollView> - </subviews> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <constraints> - <constraint firstItem="g83-TI-wJI" firstAttribute="top" secondItem="wae-JL-Lho" secondAttribute="top" constant="180" id="0cO-n9-ttA"/> - <constraint firstItem="wH0-0y-PJl" firstAttribute="trailing" secondItem="jLE-dy-saG" secondAttribute="trailing" id="DXh-P8-F7d"/> - <constraint firstItem="jLE-dy-saG" firstAttribute="leading" secondItem="wH0-0y-PJl" secondAttribute="leading" id="Di9-vy-kd0"/> - <constraint firstItem="wH0-0y-PJl" firstAttribute="top" secondItem="jLE-dy-saG" secondAttribute="bottom" id="FNh-FO-Vt1"/> - <constraint firstItem="wH0-0y-PJl" firstAttribute="leading" secondItem="g83-TI-wJI" secondAttribute="leading" id="J9k-62-AZR"/> - <constraint firstItem="wH0-0y-PJl" firstAttribute="trailing" secondItem="g83-TI-wJI" secondAttribute="trailing" id="JwC-oH-gH3"/> - <constraint firstItem="g83-TI-wJI" firstAttribute="bottom" secondItem="2id-YU-Gsq" secondAttribute="top" id="NeO-Dx-ijg"/> - <constraint firstItem="wH0-0y-PJl" firstAttribute="leading" secondItem="wae-JL-Lho" secondAttribute="leading" id="Tdu-cl-vkb"/> - <constraint firstItem="jLE-dy-saG" firstAttribute="top" secondItem="l7I-EE-PVz" secondAttribute="bottom" id="l44-L7-DvW"/> - <constraint firstItem="g83-TI-wJI" firstAttribute="top" secondItem="wH0-0y-PJl" secondAttribute="bottom" constant="16" id="qEh-li-kCJ"/> - <constraint firstAttribute="trailing" secondItem="wH0-0y-PJl" secondAttribute="trailing" id="z8B-qQ-x9h"/> - </constraints> - </view> - <connections> - <outlet property="inLanguageField" destination="g1E-VP-f78" id="mYE-F2-WDr"/> - <outlet property="outLanguageField" destination="31S-0q-S0M" id="MtL-xd-MTp"/> - <outlet property="translationsView" destination="g83-TI-wJI" id="BQG-2F-M7R"/> - </connections> - </viewController> - <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> - </objects> - <point key="canvasLocation" x="441" y="260"/> - </scene> - <!--Help View Controller--> - <scene sceneID="B4j-Du-kfE"> - <objects> - <viewController id="hV5-UM-8hP" customClass="HelpViewController" customModule="gf_ios_swift" customModuleProvider="target" sceneMemberID="viewController"> - <layoutGuides> - <viewControllerLayoutGuide type="top" id="R7u-gU-P1Q"/> - <viewControllerLayoutGuide type="bottom" id="Rse-F6-hEW"/> - </layoutGuides> - <view key="view" contentMode="scaleToFill" id="bOe-jW-W6L"> - <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> - <subviews> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Uq7-9l-AXI"> - <rect key="frame" x="0.0" y="20" width="600" height="54"/> - <subviews> - <imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="ic_app.png" translatesAutoresizingMaskIntoConstraints="NO" id="FGK-rl-cxy"> - <rect key="frame" x="8" y="9" width="36" height="36"/> - </imageView> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="GF Offline Translator" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Fhs-5e-tT6"> - <rect key="frame" x="52" y="16" width="157" height="21"/> - <fontDescription key="fontDescription" type="system" pointSize="17"/> - <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/> - <nil key="highlightedColor"/> - </label> - <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rcA-bk-D0U"> - <rect key="frame" x="557" y="12" width="35" height="30"/> - <state key="normal" title="Back"> - <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/> - </state> - <connections> - <action selector="backToMain:" destination="hV5-UM-8hP" eventType="touchUpInside" id="gbz-vX-zeX"/> - </connections> - </button> - </subviews> - <color key="backgroundColor" red="0.2265625" green="0.2265625" blue="0.2265625" alpha="1" colorSpace="calibratedRGB"/> - <constraints> - <constraint firstItem="FGK-rl-cxy" firstAttribute="centerY" secondItem="Uq7-9l-AXI" secondAttribute="centerY" id="8jw-J3-DrQ"/> - <constraint firstItem="Fhs-5e-tT6" firstAttribute="top" secondItem="Uq7-9l-AXI" secondAttribute="top" constant="16" id="H3f-Ty-IXp"/> - <constraint firstItem="Fhs-5e-tT6" firstAttribute="leading" secondItem="FGK-rl-cxy" secondAttribute="trailing" constant="8" symbolic="YES" id="QiZ-YR-hv3"/> - <constraint firstItem="FGK-rl-cxy" firstAttribute="centerY" secondItem="rcA-bk-D0U" secondAttribute="centerY" id="WhQ-TP-XF6"/> - <constraint firstItem="rcA-bk-D0U" firstAttribute="trailing" secondItem="Uq7-9l-AXI" secondAttribute="trailingMargin" id="nK2-Dy-kAb"/> - <constraint firstItem="Fhs-5e-tT6" firstAttribute="baseline" secondItem="rcA-bk-D0U" secondAttribute="firstBaseline" id="nPm-M8-phv"/> - <constraint firstItem="rcA-bk-D0U" firstAttribute="baseline" secondItem="Fhs-5e-tT6" secondAttribute="baseline" id="rMp-YH-284"/> - <constraint firstItem="FGK-rl-cxy" firstAttribute="leading" secondItem="Uq7-9l-AXI" secondAttribute="leadingMargin" id="yKh-eI-L5b"/> - <constraint firstItem="FGK-rl-cxy" firstAttribute="top" secondItem="Uq7-9l-AXI" secondAttribute="top" constant="9" id="ynj-zV-Yd5"/> - </constraints> - </view> - <webView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bgm-Yn-C8w"> - <rect key="frame" x="0.0" y="74" width="600" height="526"/> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - </webView> - </subviews> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <constraints> - <constraint firstItem="Uq7-9l-AXI" firstAttribute="leading" secondItem="bOe-jW-W6L" secondAttribute="leading" id="Mom-vU-jac"/> - <constraint firstItem="bgm-Yn-C8w" firstAttribute="trailing" secondItem="Uq7-9l-AXI" secondAttribute="trailing" id="fc7-8r-ipb"/> - <constraint firstAttribute="trailing" secondItem="Uq7-9l-AXI" secondAttribute="trailing" id="pg0-uu-87C"/> - <constraint firstItem="bgm-Yn-C8w" firstAttribute="bottom" secondItem="Rse-F6-hEW" secondAttribute="top" id="ske-sI-SW3"/> - <constraint firstItem="bgm-Yn-C8w" firstAttribute="top" secondItem="Uq7-9l-AXI" secondAttribute="bottom" id="tLc-we-gBp"/> - <constraint firstItem="bgm-Yn-C8w" firstAttribute="leading" secondItem="Uq7-9l-AXI" secondAttribute="leading" id="wvo-y4-aJm"/> - <constraint firstItem="Uq7-9l-AXI" firstAttribute="top" secondItem="bOe-jW-W6L" secondAttribute="top" constant="20" id="x73-hi-CDW"/> - </constraints> - </view> - <connections> - <outlet property="helpView" destination="bgm-Yn-C8w" id="cm9-Jg-J95"/> - </connections> - </viewController> - <placeholder placeholderIdentifier="IBFirstResponder" id="qSQ-Y9-ECH" userLabel="First Responder" sceneMemberID="firstResponder"/> - </objects> - <point key="canvasLocation" x="1056" y="260"/> - </scene> - </scenes> - <resources> - <image name="ic_action_switch.png" width="48" height="48"/> - <image name="ic_app.png" width="36" height="36"/> - <image name="ic_keyboard.png" width="48" height="48"/> - <image name="ic_mic.png" width="48" height="48"/> - </resources> -</document> diff --git a/src/ui/ios/old-swift/gf-ios-swift/Colors.swift b/src/ui/ios/old-swift/gf-ios-swift/Colors.swift deleted file mode 100644 index 960d1bd35..000000000 --- a/src/ui/ios/old-swift/gf-ios-swift/Colors.swift +++ /dev/null @@ -1,72 +0,0 @@ -import UIKit -import Foundation - -// An extension to UIColor which allows the use of hex initialisation -extension UIColor { - - convenience init(hex: Int) { - - let components = ( - red: CGFloat((hex >> 16) & 0xff) / 255, - green: CGFloat((hex >> 08) & 0xff) / 255, - blue: CGFloat((hex >> 00) & 0xff) / 255 - ) - - self.init(red: components.red, green: components.green, blue: components.blue, alpha: 1.0) - - } - -} - -class Colors { - - // Set the background colours to use by the view controller - let backgroundColors = [ - "worst": UIColor(hex: 0xff303e), - "best": UIColor(hex: 0x75cd75), - "chunks": UIColor(hex: 0xffb2a5), - "default": UIColor(hex: 0xffff99), - "source": UIColor(hex: 0xcdcded) - ] - - // Checks a given translated string to see how good it is and hence which background colour it should have - func translationToUIColor(translation: String) -> UIColor { - - if (translation.isEmpty) { - return self.backgroundColors["default"]! - } - - var firstChar = String(Array(translation)[0]) - - // Parse by words, marked by %, darkest red color - if (firstChar == "%") { - return self.backgroundColors["worst"]! - } - - // Parse by chunks, marked by *, red color - if (firstChar == "*") { - return self.backgroundColors["chunks"]! - } - - // Parse error: darkest red color - if (translation.rangeOfString("parse error:") != nil) { - return self.backgroundColors["worst"]! - } - - // Unknown linearizations in output - if (translation.rangeOfString("[") != nil) { - return self.backgroundColors["worst"]! - } - - // Parse by domain grammar, marked by +, green color - if (firstChar == "+") { - return self.backgroundColors["best"]! - } - - // Otherwise, use the default colour - return self.backgroundColors["default"]! - - } - - -}
\ No newline at end of file diff --git a/src/ui/ios/old-swift/gf-ios-swift/HelpViewController.swift b/src/ui/ios/old-swift/gf-ios-swift/HelpViewController.swift deleted file mode 100644 index 7f924bcd4..000000000 --- a/src/ui/ios/old-swift/gf-ios-swift/HelpViewController.swift +++ /dev/null @@ -1,24 +0,0 @@ -import UIKit - -// The HelpViewController only contains static text and a back button -class HelpViewController: UIViewController { - - @IBOutlet weak var helpView: UIWebView! - - // Closes the view when the back button is blicked - @IBAction func backToMain(sender: UIButton) { - dismissViewControllerAnimated(true, completion: nil) - } - - override func viewDidLoad() { - super.viewDidLoad() - - // Sets the HTML for the UIWebView - self.helpView.loadHTMLString("<html><body><h1>HTML goes here</h1></body></html>", baseURL: nil) - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - } - -} diff --git a/src/ui/ios/old-swift/gf-ios-swift/Images.xcassets/AppIcon.appiconset/Contents.json b/src/ui/ios/old-swift/gf-ios-swift/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 36d2c80d8..000000000 --- a/src/ui/ios/old-swift/gf-ios-swift/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -}
\ No newline at end of file diff --git a/src/ui/ios/old-swift/gf-ios-swift/Info.plist b/src/ui/ios/old-swift/gf-ios-swift/Info.plist deleted file mode 100644 index 3fe4443b4..000000000 --- a/src/ui/ios/old-swift/gf-ios-swift/Info.plist +++ /dev/null @@ -1,47 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleDevelopmentRegion</key> - <string>en</string> - <key>CFBundleExecutable</key> - <string>$(EXECUTABLE_NAME)</string> - <key>CFBundleIdentifier</key> - <string>GF.$(PRODUCT_NAME:rfc1034identifier)</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundleName</key> - <string>$(PRODUCT_NAME)</string> - <key>CFBundlePackageType</key> - <string>APPL</string> - <key>CFBundleShortVersionString</key> - <string>1.0</string> - <key>CFBundleSignature</key> - <string>????</string> - <key>CFBundleVersion</key> - <string>1</string> - <key>LSRequiresIPhoneOS</key> - <true/> - <key>UILaunchStoryboardName</key> - <string>LaunchScreen</string> - <key>UIMainStoryboardFile</key> - <string>Main</string> - <key>UIRequiredDeviceCapabilities</key> - <array> - <string>armv7</string> - </array> - <key>UISupportedInterfaceOrientations</key> - <array> - <string>UIInterfaceOrientationPortrait</string> - <string>UIInterfaceOrientationLandscapeLeft</string> - <string>UIInterfaceOrientationLandscapeRight</string> - </array> - <key>UISupportedInterfaceOrientations~ipad</key> - <array> - <string>UIInterfaceOrientationPortrait</string> - <string>UIInterfaceOrientationPortraitUpsideDown</string> - <string>UIInterfaceOrientationLandscapeLeft</string> - <string>UIInterfaceOrientationLandscapeRight</string> - </array> -</dict> -</plist> diff --git a/src/ui/ios/old-swift/gf-ios-swift/Languages.swift b/src/ui/ios/old-swift/gf-ios-swift/Languages.swift deleted file mode 100644 index 91f0a22a4..000000000 --- a/src/ui/ios/old-swift/gf-ios-swift/Languages.swift +++ /dev/null @@ -1,39 +0,0 @@ -import Foundation - -// A simple class for a language, mostly just containing its name etc. -class Language { - - let name: String - let abbreviation: String - let bcp: String - - init(name: String, abbreviation: String, bcp: String) { - self.name = name - self.abbreviation = abbreviation - self.bcp = bcp - } - -} - -// If we need to set more languages in the app, this is the place to do it! -// Don't forget to also update the grammars folder :) -let allLanguages: Array<Language> = [ - Language(name: "Bulgarian", abbreviation: "Bul", bcp: "en-GB"), // lacks bcp-47 code in iOS, would be bg-BG - Language(name: "Chinese", abbreviation: "Chi", bcp: "zh-CN"), - Language(name: "Dutch", abbreviation: "Dut", bcp: "nl-NL"), - Language(name: "English", abbreviation: "Eng", bcp: "en-GB"), - Language(name: "Finnish", abbreviation: "Fin", bcp: "fi-FI"), - Language(name: "French", abbreviation: "Fre", bcp: "fr-FR"), - Language(name: "German", abbreviation: "Ger", bcp: "de-DE"), - Language(name: "Hindi", abbreviation: "Hin", bcp: "hi-IN"), - Language(name: "Italian", abbreviation: "Ita", bcp: "it-IT"), - Language(name: "Japanese", abbreviation: "Jpn", bcp: "ja-JP"), - Language(name: "Spanish", abbreviation: "Spa", bcp: "es-ES"), - Language(name: "Swedish", abbreviation: "Swe", bcp: "sv-SE"), - Language(name: "Thai", abbreviation: "Tha", bcp: "th-TH") - -] - -// Callback for morphological analysis - if it turns out this isn't needed, it could be removed -func morphoCallback(callback: UnsafeMutablePointer<PgfMorphoCallback>, lemma: PgfCId, analysis: GuString, prob: prob_t, err: UnsafeMutablePointer<GuExn>) -> Void { -}
\ No newline at end of file diff --git a/src/ui/ios/old-swift/gf-ios-swift/Translator.swift b/src/ui/ios/old-swift/gf-ios-swift/Translator.swift deleted file mode 100644 index bc4e1b232..000000000 --- a/src/ui/ios/old-swift/gf-ios-swift/Translator.swift +++ /dev/null @@ -1,210 +0,0 @@ -import UIKit -import Foundation - -class Translator { - - // Create allocation pool, exception frame, and pgf grammar - var pool: COpaquePointer - var err: UnsafeMutablePointer<GuExn> - var out: UnsafeMutablePointer<GuOut> - let pgf: UnsafeMutablePointer<PgfPGF> - - init() { - self.pool = gu_new_pool() - self.err = gu_new_exn(self.pool) - self.out = gu_file_out(stdout, self.pool) - - // Read the PGF grammar. - var pgfBundle = NSBundle .mainBundle() - var pgfStr = pgfBundle .pathForResource("App", ofType: "pgf", inDirectory: "grammars") - self.pgf = pgf_read(pgfStr!, self.pool, self.err) - } - - // Variable to hold concrete grammars - var grammars: [String: (name: String, concr: UnsafeMutablePointer<PgfConcr>)] = [ - "to": ("", UnsafeMutablePointer<PgfConcr>()), - "from": ("", UnsafeMutablePointer<PgfConcr>()), - "previous": ("", UnsafeMutablePointer<PgfConcr>()) - ] - - // Loads a grammar (but returns it, doesn't save it) - func loadGrammar(language: String, destination: String) -> Void { - - // Switch with the previously used language if applicable - if (language == self.grammars["previous"]!.name) { - return self.switchLanguages(destination, to: "third") - } - - // Load the file - var pgfBundle = NSBundle .mainBundle() - var concr = pgf_get_language(self.pgf, "App\(language)") - var fileStr = pgfBundle.pathForResource("App\(language)", ofType: "pgf_c", inDirectory: "grammars") - var file = fopen(fileStr!, "r") - - // Load the grammar - pgf_concrete_load(concr, gu_file_in(file, self.pool), self.err) - if (self.grammars[destination]!.concr != UnsafeMutablePointer<PgfConcr>()) { - pgf_concrete_unload(self.grammars[destination]!.concr) - } - self.grammars[destination]!.concr = nil - self.grammars[destination]!.concr = concr - - } - - // Switches place of from and to concrete grammars - func switchLanguages(from: String, to: String) -> Void { - let tmp = self.grammars[from]! - self.grammars[from] = self.grammars[to]! - self.grammars[to] = tmp - } - - // Translate a string - func translate(phrase: String) -> String { - - // Intialise temporary pools - var tmpPool = gu_new_pool() - var tmpErr = gu_new_exn(tmpPool) - - // Try to parse it fully - var parse = self.parse(phrase, startCat: "Phr", tmpPool: tmpPool, tmpErr: tmpErr) - var translation = "" - if (parse != nil) { - translation = self.linearize(parse, tmpPool: tmpPool, tmpErr: tmpErr) - } else { - translation = self.translateByLookup(phrase) - } - - // Clear up resources - gu_exn_clear(tmpErr) - gu_pool_free(tmpPool) - tmpPool = nil - tmpErr = nil - - return translation - } - - // Translates by lookup - that is, each word by itself - func translateByLookup(phrase: String) -> String { - var translation = "%" - var words = phrase.componentsSeparatedByString(" ") - for word in words { - translation += self.translateWord(word) + " " - } - return translation - } - - // Translates a single word - differs from phrase translation as it does morphological analysis - func translateWord(word: String) -> String { - - // Intialise temporary pools - var tmpPool = gu_new_pool() - var tmpErr = gu_new_exn(tmpPool) - - // Try to parse it fully - var parse = self.parse(word, startCat: "Chunk", tmpPool: tmpPool, tmpErr: tmpErr) - var translation = "" - if (parse != nil) { - translation = self.linearize(parse, tmpPool: tmpPool, tmpErr: tmpErr) - } else { - - // Full parse didn't work; try to make a morphological analysis - - // This functionality is currently missing due to pointer hell in Swift. - // The full temporary code is commented out below. For now, we just return the uppercased translation instead. - translation = word.uppercaseString - -// var lcWord = word.lowercaseString -// var p = UnsafeMutablePointer<(UnsafeMutablePointer<PgfMorphoCallback>, PgfCId, GuString, prob_t, UnsafeMutablePointer<GuExn>) -> ()>.alloc(1) -// p.initialize(morphoCallback) -// var cp = COpaquePointer(p) -// var fp = CFunctionPointer<(UnsafeMutablePointer<PgfMorphoCallback>, PgfCId, GuString, prob_t, UnsafeMutablePointer<GuExn>) -> ()>(cp) -// var callback = PgfMorphoCallback(callback: fp) -// pgf_lookup_morpho(self.grammars["from"]!.concr, word, &callback, tmpErr) -// if (gu_ok(tmpErr)) { -// var analyses = [] -// for analysis in analyses { -// var lemma = ??? -// if (self.hasLinearization(lemma)) { -// var sbuf = gu_string_buf(tmpPool) -// var sbufstr = gu_string_buf_freeze(sbuf, tmpPool) -// var tmpIn = gu_data_in(String(UTF8String: sbufstr)!, strlen(sbufstr), tmpPool) -// var expr = pgf_read_expr(tmpIn, tmpPool, tmpErr) -// var ep = PgfExprProb(prob: 0, expr: expr) -// translation = self.linearize(ep, tmpPool: tmpPool, tmpErr: tmpErr) -// break -// } -// } -// } else { - // Morphological analysis failed as well - just use the uppercased version of the word -// translation = word.uppercaseString -// } - - } - - // Clear up resources - gu_exn_clear(tmpErr) - gu_pool_free(tmpPool) - tmpPool = nil - tmpErr = nil - - return translation - - } - - // Checks whether a linearization exists for a given analysis - func hasLinearization(analysis: PgfCId) -> Bool { - var tmpPool = gu_new_pool() - var result = pgf_has_linearization(self.grammars["to"]!.concr, analysis) - gu_pool_free(tmpPool) - tmpPool = nil - return result - } - - // Wrapper to perform a parse and return either the parse or - func parse(phrase: String, startCat: String, tmpPool: COpaquePointer, tmpErr: UnsafeMutablePointer<GuExn>) -> UnsafeMutablePointer<PgfExprEnum> { - var result = pgf_parse(self.grammars["from"]!.concr, startCat, phrase, tmpErr, tmpPool, tmpPool) - if (!gu_ok(tmpErr)) { - return nil - } - return result - } - - // Takes a parse result and linearizes its first result - func linearize(result: UnsafeMutablePointer<PgfExprEnum>, tmpPool: COpaquePointer, tmpErr: UnsafeMutablePointer<GuExn>) -> String { - - // Get the first result - var ep = UnsafeMutablePointer<PgfExprProb>() - gu_enum_next(result, &ep, tmpPool) - var parse = ep[0] - - // Linearise it and convert it to a String literal - var sbuf = gu_string_buf(tmpPool) - var tmpOut = gu_string_buf_out(sbuf) - pgf_linearize(self.grammars["to"]!.concr, parse.expr, tmpOut, tmpErr) - var translation = String(UTF8String: gu_string_buf_freeze(sbuf, tmpPool))! - - // Clear up and return - gu_out_flush(tmpOut, tmpErr) - tmpOut = nil - return translation - - } - - // Removes characters that shouldn't be in the translated string - func formatTranslation(translation: String) -> String { - - if (translation.isEmpty) { - return translation - } - var copy = translation - var firstChar = String(Array(translation)[0]) - if (firstChar == "%" || firstChar == "*" || firstChar == "+") { - copy = copy.substringFromIndex(advance(copy.startIndex, 1)) - } - for char in ["[", "]", "_"] { - copy = copy.stringByReplacingOccurrencesOfString(char, withString: " ") - } - return copy - - } -}
\ No newline at end of file diff --git a/src/ui/ios/old-swift/gf-ios-swift/ViewController.swift b/src/ui/ios/old-swift/gf-ios-swift/ViewController.swift deleted file mode 100644 index 5766b340d..000000000 --- a/src/ui/ios/old-swift/gf-ios-swift/ViewController.swift +++ /dev/null @@ -1,223 +0,0 @@ -import UIKit -import AVFoundation - -class ViewController: UIViewController { - - // Set sizes used within the controller - let maxBoxWidth: CGFloat = 150 - let boxOffset: CGFloat = 10 - var scrollViewHeight: CGFloat = 0 - var scrollViewWidth: CGFloat = 0 - - // Translation properties - let translator = Translator() - let colors = Colors() - let synthesizer = AVSpeechSynthesizer() - let languages = allLanguages - var inLanguage: Language! - var outLanguage: Language! - - // Initiate picker views - let inPicker: UIPickerView = UIPickerView() - let outPicker: UIPickerView = UIPickerView() - - // UI connections - @IBOutlet weak var translationsView: UIScrollView! - @IBOutlet weak var inLanguageField: UITextField! - @IBOutlet weak var outLanguageField: UITextField! - - // Reverses to and from languages - @IBAction func switchLanguages(sender: UIButton) { - self.inLanguageField.text = self.outLanguage.name - self.outLanguageField.text = self.inLanguage.name - let tmpLanguage = self.inLanguage - self.inLanguage = self.outLanguage - self.outLanguage = tmpLanguage - self.translator.switchLanguages("from", to: "to") // to also switch concrete grammars - } - - // Creates a new translation field when the user clicks the keyboard icon - @IBAction func openKeyboard(sender: UIButton) { - let field = createFromView() - field.becomeFirstResponder() - } - - // Starts the speech recognition process when the user clicks the microphone icon - @IBAction func openMicrophone(sender: UIButton) { - self.createToView("microphone support is on its way") - } - - // Sums the heights of all translation boxes + margins - func calculateTranslationHeights() -> CGFloat { - var height = CGFloat(-29.5) // compensate for invisible scrollbars - for view in self.translationsView.subviews { - height += view.frame.height + self.boxOffset - } - height += self.boxOffset - return height - } - - // Creates a new "to translate" view and returns it for placement - func createFromView() -> UITextView { - let view = UITextView(frame: CGRect( - x: self.boxOffset, - y: self.calculateTranslationHeights(), - width: 20, - height: 30 - )) - view.backgroundColor = self.colors.backgroundColors["source"] - view.layer.cornerRadius = 5 - view.returnKeyType = UIReturnKeyType.Done - - view.delegate = self - self.translationsView.addSubview(view) - self.resizeTranslationsView() - return view - } - - // A UIScrollView doesn't know its own height; use this method to resize it - func resizeTranslationsView() -> Void { - var subviewHeights = self.calculateTranslationHeights() - if (subviewHeights > self.scrollViewHeight) { - self.translationsView.contentSize = CGSizeMake( - self.translationsView.frame.width, subviewHeights) - - // Also scroll to bottom - let offset = self.translationsView.contentSize.height - self.translationsView.bounds.size.height - let point = CGPointMake(0, offset) - self.translationsView.setContentOffset(point, animated: true) - - } - } - - // Creates and places a new "translated" view given the translated text - func createToView(translation: String) -> Void { - let view = UITextView(frame: CGRect( - x: 0, // we set the real value later a few lines down below - y: self.calculateTranslationHeights(), - width: self.maxBoxWidth, - height: 30 - )) - view.backgroundColor = self.colors.translationToUIColor(translation) - view.text = self.translator.formatTranslation(translation) - view.layer.cornerRadius = 5 - view.sizeToFit() - - // The view has been set, so we can now move it further to the right - view.frame.origin.x = self.scrollViewWidth - 10 - view.frame.width - self.translationsView.addSubview(view) - self.resizeTranslationsView() - } - - // Perform translation - func translate(phrase: String) -> Void { - var translation = self.translator.translate(phrase) - self.createToView(translation) - - // Run TTS except in simulator (because the simulator doesn't support it) - #if !arch(i386) && !arch(x86_64) - var utterance = AVSpeechUtterance(string: translation) - utterance.voice = AVSpeechSynthesisVoice(language: self.outLanguage.bcp) - self.synthesizer.speakUtterance(utterance) - #endif - - } - - override func viewDidLoad() { - super.viewDidLoad() - - // Set size variables (-162 for the height to compensate for the views above the scrollview) - self.scrollViewHeight = UIScreen.mainScreen().bounds.height - 162 - self.scrollViewWidth = UIScreen.mainScreen().bounds.width - - // Load view pickers - self.inPicker.delegate = self - self.inPicker.dataSource = self - - self.outPicker.delegate = self - self.outPicker.dataSource = self - - self.inLanguageField.inputView = inPicker - self.outLanguageField.inputView = outPicker - - // Load initial languages - self.inLanguage = self.languages[3] // English - self.outLanguage = self.languages[10] // Swedish - self.translator.loadGrammar("Eng", destination: "from") - self.translator.loadGrammar("Swe", destination: "to") - - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - } - -} - -// On selection functionality for the view pickers -extension ViewController: UIPickerViewDelegate { - - // Makes the picker views return a language rather than text - func pickerView(pickerView: UIPickerView!, titleForRow row: Int, forComponent component: Int) -> String - { - return self.languages[row].name - } - - // Row was selected: update buttons, load new grammar - func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) { - var language = self.languages[row] - - var fromTo: String - var textField = UITextField() - if (pickerView == self.inPicker) { - self.inLanguage = language - fromTo = "from" - textField = self.inLanguageField - } else { - self.outLanguage = language - fromTo = "to" - textField = self.outLanguageField - } - - self.translator.loadGrammar(language.abbreviation, destination: fromTo) - textField.text = language.name - textField.resignFirstResponder() - } - -} - -// View picker layout functionality -extension ViewController: UIPickerViewDataSource { - - func numberOfComponentsInPickerView(pickerView: UIPickerView) -> Int { - return 1 - } - - func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { - return self.languages.count - } - -} - -// Keyboard input functionality -extension ViewController: UITextViewDelegate { - - // Method is called on keypress - func textView(textView: UITextView, shouldChangeTextInRange range: NSRange, replacementText text: String) -> Bool { - - // UITextViews lack a method to close keyboard on enter, so we use this slight hack - if (text == "\n") { - textView.resignFirstResponder() - self.translate(textView.text) - return false - } - - // But if it wasn't the enter key, we resize the UITextView dynamically - textView.sizeToFit() - if (textView.frame.size.width < self.maxBoxWidth) { - textView.frame.size.width += 10 - } - return true - } - -}
\ No newline at end of file diff --git a/src/ui/ios/old-swift/gf-ios-swift/gf-ios-swift-Bridging-Header.h b/src/ui/ios/old-swift/gf-ios-swift/gf-ios-swift-Bridging-Header.h deleted file mode 100644 index 76ccbefde..000000000 --- a/src/ui/ios/old-swift/gf-ios-swift/gf-ios-swift-Bridging-Header.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef gf_ios_swift_gf_ios_swift_Bridging_Header_h -#define gf_ios_swift_gf_ios_swift_Bridging_Header_h - -#import "pgf/pgf.h" -#import "gu/file.h" -#import "gu/variant.h" -#import "gu/map.h" -#import "gu/enum.h" -#import "gu/exn.h" -#import "pgf/literals.h" -#import "pgf/linearizer.h" - -#endif
\ No newline at end of file diff --git a/src/ui/ios/old-swift/gf-ios-swift/images/ic_action_switch.png b/src/ui/ios/old-swift/gf-ios-swift/images/ic_action_switch.png Binary files differdeleted file mode 100644 index 5449a32b8..000000000 --- a/src/ui/ios/old-swift/gf-ios-swift/images/ic_action_switch.png +++ /dev/null diff --git a/src/ui/ios/old-swift/gf-ios-swift/images/ic_app copy.png b/src/ui/ios/old-swift/gf-ios-swift/images/ic_app copy.png Binary files differdeleted file mode 100644 index 8d9bdd820..000000000 --- a/src/ui/ios/old-swift/gf-ios-swift/images/ic_app copy.png +++ /dev/null diff --git a/src/ui/ios/old-swift/gf-ios-swift/images/ic_app.png b/src/ui/ios/old-swift/gf-ios-swift/images/ic_app.png Binary files differdeleted file mode 100644 index a9b17ee1c..000000000 --- a/src/ui/ios/old-swift/gf-ios-swift/images/ic_app.png +++ /dev/null diff --git a/src/ui/ios/old-swift/gf-ios-swift/images/ic_keyboard.png b/src/ui/ios/old-swift/gf-ios-swift/images/ic_keyboard.png Binary files differdeleted file mode 100644 index ce257a269..000000000 --- a/src/ui/ios/old-swift/gf-ios-swift/images/ic_keyboard.png +++ /dev/null diff --git a/src/ui/ios/old-swift/gf-ios-swift/images/ic_mic.png b/src/ui/ios/old-swift/gf-ios-swift/images/ic_mic.png Binary files differdeleted file mode 100644 index f79ff489b..000000000 --- a/src/ui/ios/old-swift/gf-ios-swift/images/ic_mic.png +++ /dev/null diff --git a/src/ui/ios/old-swift/gf-ios-swiftTests/Info.plist b/src/ui/ios/old-swift/gf-ios-swiftTests/Info.plist deleted file mode 100644 index fe7f434fb..000000000 --- a/src/ui/ios/old-swift/gf-ios-swiftTests/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleDevelopmentRegion</key> - <string>en</string> - <key>CFBundleExecutable</key> - <string>$(EXECUTABLE_NAME)</string> - <key>CFBundleIdentifier</key> - <string>GF.$(PRODUCT_NAME:rfc1034identifier)</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundleName</key> - <string>$(PRODUCT_NAME)</string> - <key>CFBundlePackageType</key> - <string>BNDL</string> - <key>CFBundleShortVersionString</key> - <string>1.0</string> - <key>CFBundleSignature</key> - <string>????</string> - <key>CFBundleVersion</key> - <string>1</string> -</dict> -</plist> diff --git a/src/ui/ios/old-swift/gf-ios-swiftTests/gf_ios_swiftTests.swift b/src/ui/ios/old-swift/gf-ios-swiftTests/gf_ios_swiftTests.swift deleted file mode 100644 index 8829b37a3..000000000 --- a/src/ui/ios/old-swift/gf-ios-swiftTests/gf_ios_swiftTests.swift +++ /dev/null @@ -1,28 +0,0 @@ -import UIKit -import XCTest - -class gf_ios_swiftTests: XCTestCase { - - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func testExample() { - // This is an example of a functional test case. - XCTAssert(true, "Pass") - } - - func testPerformanceExample() { - // This is an example of a performance test case. - self.measureBlock() { - // Put the code you want to measure the time of here. - } - } - -} |
