From b450cea7e249d521ba9ebf3d186db45656b9fcc4 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Tue, 15 Jan 2019 01:22:18 +0100 Subject: Android: starting to use CMake to build AndroidStudio files. --- CMake/Android/AndroidManifest.xml.in | 22 +++ CMake/Android/CMakeList.txt.in | 49 ++++++ CMake/Android/HelloAndroid.cxx.in | 138 +++++++++++++++++ CMake/Android/Roboto-Regular.ttf | Bin 0 -> 306672 bytes CMake/Android/abi-version.cmake.in | 31 ++++ CMake/Android/app.build.gradle.in | 26 ++++ CMake/Android/build.gradle.in | 17 +++ CMake/Android/hdpi.ic_launcher.png | Bin 0 -> 3418 bytes CMake/Android/mdpi.ic_launcher.png | Bin 0 -> 2206 bytes CMake/Android/settings.gradle.in | 2 + CMake/Android/strings.xml.in | 4 + CMake/Android/xhdpi.ic_launcher.png | Bin 0 -> 4842 bytes CMake/Android/xxhdpi.ic_launcher.png | Bin 0 -> 7718 bytes CMake/android.cmake | 79 ++++++++++ CMakeLists.txt | 8 - README.Android.md | 80 ++++++++++ README.Android.txt | 98 ------------ ide/AndroidStudio3/FL/abi-version.h | 31 ---- ide/AndroidStudio3/README.md | 46 ------ ide/AndroidStudio3/app/app.iml | 149 ------------------- ide/AndroidStudio3/app/build.gradle | 26 ---- .../app/src/main/AndroidManifest.xml | 22 --- .../app/src/main/assets/fonts/Roboto-Regular.ttf | Bin 306672 -> 0 bytes ide/AndroidStudio3/app/src/main/cpp/CMakeLists.txt | 47 ------ .../app/src/main/cpp/HelloAndroid.cxx | 138 ----------------- .../app/src/main/res/mipmap-hdpi/ic_launcher.png | Bin 3418 -> 0 bytes .../app/src/main/res/mipmap-mdpi/ic_launcher.png | Bin 2206 -> 0 bytes .../app/src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 4842 -> 0 bytes .../app/src/main/res/mipmap-xxhdpi/ic_launcher.png | Bin 7718 -> 0 bytes .../app/src/main/res/values/strings.xml | 4 - ide/AndroidStudio3/build.gradle | 17 --- .../gradle/wrapper/gradle-wrapper.jar | Bin 49896 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 - ide/AndroidStudio3/gradlew | 164 --------------------- ide/AndroidStudio3/gradlew.bat | 90 ----------- ide/AndroidStudio3/settings.gradle | 4 - test/CMakeLists.txt | 4 +- 37 files changed, 450 insertions(+), 852 deletions(-) create mode 100644 CMake/Android/AndroidManifest.xml.in create mode 100644 CMake/Android/CMakeList.txt.in create mode 100644 CMake/Android/HelloAndroid.cxx.in create mode 100644 CMake/Android/Roboto-Regular.ttf create mode 100644 CMake/Android/abi-version.cmake.in create mode 100644 CMake/Android/app.build.gradle.in create mode 100644 CMake/Android/build.gradle.in create mode 100644 CMake/Android/hdpi.ic_launcher.png create mode 100644 CMake/Android/mdpi.ic_launcher.png create mode 100644 CMake/Android/settings.gradle.in create mode 100644 CMake/Android/strings.xml.in create mode 100644 CMake/Android/xhdpi.ic_launcher.png create mode 100644 CMake/Android/xxhdpi.ic_launcher.png create mode 100644 README.Android.md delete mode 100644 README.Android.txt delete mode 100644 ide/AndroidStudio3/FL/abi-version.h delete mode 100644 ide/AndroidStudio3/README.md delete mode 100644 ide/AndroidStudio3/app/app.iml delete mode 100644 ide/AndroidStudio3/app/build.gradle delete mode 100644 ide/AndroidStudio3/app/src/main/AndroidManifest.xml delete mode 100644 ide/AndroidStudio3/app/src/main/assets/fonts/Roboto-Regular.ttf delete mode 100644 ide/AndroidStudio3/app/src/main/cpp/CMakeLists.txt delete mode 100644 ide/AndroidStudio3/app/src/main/cpp/HelloAndroid.cxx delete mode 100644 ide/AndroidStudio3/app/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 ide/AndroidStudio3/app/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 ide/AndroidStudio3/app/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 ide/AndroidStudio3/app/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 ide/AndroidStudio3/app/src/main/res/values/strings.xml delete mode 100644 ide/AndroidStudio3/build.gradle delete mode 100644 ide/AndroidStudio3/gradle/wrapper/gradle-wrapper.jar delete mode 100644 ide/AndroidStudio3/gradle/wrapper/gradle-wrapper.properties delete mode 100755 ide/AndroidStudio3/gradlew delete mode 100644 ide/AndroidStudio3/gradlew.bat delete mode 100644 ide/AndroidStudio3/settings.gradle diff --git a/CMake/Android/AndroidManifest.xml.in b/CMake/Android/AndroidManifest.xml.in new file mode 100644 index 000000000..e0131f422 --- /dev/null +++ b/CMake/Android/AndroidManifest.xml.in @@ -0,0 +1,22 @@ + + + + + + + + + + + + diff --git a/CMake/Android/CMakeList.txt.in b/CMake/Android/CMakeList.txt.in new file mode 100644 index 000000000..99019b009 --- /dev/null +++ b/CMake/Android/CMakeList.txt.in @@ -0,0 +1,49 @@ +# +# Copyright (C) The Android Open Source Project +# +# 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. +# + +cmake_minimum_required(VERSION 3.4.1) + +set(FLTK_DIR ../../../../../../..) +set(FLTK_IDE_DIR ../../../..) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + + +# FIXME: add as a second argument the binary build dir +# so that the first argument can link directly to FLTK +# instead of the fltk symlink, which is bad for SVN +add_subdirectory(${FLTK_DIR}/ "${CMAKE_CURRENT_BINARY_DIR}/lib" EXCLUDE_FROM_ALL) + +# now build app's shared lib +add_library(android-hello SHARED + HelloAndroid.cxx) + +target_include_directories(android-hello PRIVATE + ${FLTK_DIR}/ + ${FLTK_IDE_DIR}/ ) + +# Export ANativeActivity_onCreate(),
 +# Refer to: https://github.com/android-ndk/ndk/issues/381. +set(CMAKE_SHARED_LINKER_FLAGS + "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate") + +# add lib dependencies +target_link_libraries(android-hello + fltk + android + log + m +) + diff --git a/CMake/Android/HelloAndroid.cxx.in b/CMake/Android/HelloAndroid.cxx.in new file mode 100644 index 000000000..42cdba663 --- /dev/null +++ b/CMake/Android/HelloAndroid.cxx.in @@ -0,0 +1,138 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * 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. + * + */ + + +#include "../../../test/button.cxx" + + +/* + + Missing: + - screen scale and size: most desktop apps expect to be in a draggable window + on a larger desktop surface. For Android, there is usually no desktop, and + screen resolution is often very high, so that a regular FLTK window would + hide as a tiny gray spot in the top left corner + * windows should probably be centered by default + ? the screen resolution should adapt to the first opened window + ? we should be able to hint at a prefered screen resolution + * drawing call must scale at some point (line width!) + * rotating the screen must call the app handler and(?) window resize + * proportions: pixels should be square + Need Work: + - Fl_Android_Graphics_Driver::pie(int) needs refactoring + - ...::line(...) has round ing issues (see rounded box type) + - grab() not working when leaving window (adjuster...) + - scrolling if implemented as a complete redraw. Must implement real scrolling + - the 'hotspot' idea to position dialogs under the mouse cursor makes little sense on touch screen devices + - fix screen when keyboard pops up in front of the text cursor or input field (temporarily shift up?) + - ending 'message' will not quit the app right away, but wait for some timeout + - no support for dead-key entry + - no Shift-Tab + + * test/CubeMain.cxx : UNSUPPROTED - needs OpenGL + * test/CubeView.cxx : UNSUPPROTED - needs OpenGL + * test/shape.cxx : UNSUPPROTED - needs OpenGL + * test/cube.cxx : UNSUPPROTED - needs OpenGL + * test/fractals.cxx : UNSUPPROTED - needs OpenGL + * test/fracviewer.cxx : UNSUPPROTED - needs OpenGL + * test/fullscreen.cxx : UNSUPPROTED - needs OpenGL + * test/gl_overlay.cxx : UNSUPPROTED - needs OpenGL + * test/glpuzzle.cxx : UNSUPPROTED - needs OpenGL + * test/mandelbrot.cxx : UNSUPPORTED - needs Fluid + * test/keyboard.cxx : UNSUPPORTED - needs Fluid + * test/CubeViewUI.fl + * test/keyboard_ui.fl + * test/radio.fl + * test/tree.fl + * test/fast_slow.fl + * test/mandelbrot_ui.fl + * test/resize.fl + * test/valuators.fl + * test/inactive.fl + * test/preferences.fl + * test/tabs.fl + * test/cairo_test.cxx : UNSUPPORTED - needs Cairo + * test/connect.cxx : UNSUPPORTED - Android is not Linux + * test/tiled_image.cxx : UNSUPPORTED - X11 only + * test/forms.cxx : UNSUPPORTED - needs Forms + + * test/doublebuffer.cxx : FIXME - redering is completely wrong + * test/line_style.cxx : TODO - no line styles yet + * test/list_visuals.cxx : TODO - needs config.h + * test/threads.cxx : TODO - needs config.h for pthreads + * test/animated.cxx : TODO - redering errors (alpha channel?) + * test/native-filechooser.cxx : TODO - not yet implemented + * test/blocks.cxx : TODO - needs config.h + * test/offscreen.cxx : TODO - not yet implemented + * test/overlay.cxx : TODO - no overlay yet + * test/pixmap_browser.cxx : TODO - filebrowser not yet implemented, no images, no printer + * test/clock.cxx : TODO - no system clock call yet + * test/resizebox.cxx : TODO - no window manager yet + * test/rotated_text.cxx : TODO - no rotated text + * test/subwindow.cxx : TODO - no subwindows yet + * test/sudoku.cxx : TODO - sound support is in our way + * test/demo.cxx : TODO - fails to open window, but is is useful at all? + * test/device.cxx : TODO - printing support + * test/tile.cxx : TODO - subwindow support + * test/editor.cxx : TODO - file chooser missing + * test/file_chooser.cxx : TODO - file chooser missing + * test/fonts.cxx : TODO - works, but does not list system fonts or resource fonts + * test/help_dialog.cxx : TODO - not implemented + * test/icon.cxx : TODO - what does this do on Android? + * test/iconize.cxx : TODO - no window manager + * test/utf8.cxx : TODO - window manager, clipping + * test/windowfocus.cxx : TODO - what does this do? + * test/browser.cxx : TODO - needs text resource to load browser content + * test/unittests.cxx : TODO - crashing, no alpha in image drawing, clipping issues + + * test/image.cxx : + works + * test/twowin.cxx : + works + * test/table.cxx : + works, but window is much too large for mobile device + * test/cursor.cxx : + works, but no cursor on Android + * test/colbrowser.cxx : + works + * test/checkers.cxx : + works + * test/pixmap.cxx : + works + * test/navigation.cxx : + works + * test/curve.cxx : + works + * test/input_choice.cxx : + works + * test/input.cxx : + works + * test/scroll.cxx : - works ok + - some dirt when a popup draws over another menu button!? + - on touch-screens, menuitem should be selected when released + - on touch-screens, scroll groups should scroll on multitouch, or when not causing any other action + * test/bitmap.cxx : + 'bitmap' works + * test/message.cxx : - 'message' mostly works + - when ending the app, it will not close right away but instead hang around for a few seconds + * test/menubar.cxx : - 'menubar' mostly works including unicode + ! pressing 'button' will hang the app + - shortcut modifiers don't work + - right-click does not work (should this be emulated via click-and-hold?) + * test/output.cxx : + 'output' works + * test/ask.cxx : + 'ask' works + * test/button.cxx : + 'button' works, including beep + * test/pack.cxx : + 'pack' works + * test/adjuster.cxx : + 'adjuster' works + * test/arc.cxx : + 'arc' works as expected + * test/minimum.cxx : + 'minimum' works + * test/boxtype.cxx : + 'boxtype' works + * test/buttons.cxx : + 'buttons' works + * test/color_chooser.cxx: + 'color_chooser' works + * test/symbols.cxx : + 'symbols' working as expected + * test/hello.cxx : + 'hello' works fine, italics, shadow, etc. + * test/label.cxx : + 'label' works + + */ diff --git a/CMake/Android/Roboto-Regular.ttf b/CMake/Android/Roboto-Regular.ttf new file mode 100644 index 000000000..88dae907b Binary files /dev/null and b/CMake/Android/Roboto-Regular.ttf differ diff --git a/CMake/Android/abi-version.cmake.in b/CMake/Android/abi-version.cmake.in new file mode 100644 index 000000000..9a5e4b89f --- /dev/null +++ b/CMake/Android/abi-version.cmake.in @@ -0,0 +1,31 @@ +/* + * "$Id: abi-version.h 12196 2017-03-13 23:31:38Z AlbrechtS $" + * + * Configuration file for the Fast Light Tool Kit (FLTK). + * + * Copyright 1998-2015 by Bill Spitzak and others. + * + * This library is free software. Distribution and use rights are outlined in + * the file "COPYING" which should have been included with this file. If this + * file is missing or damaged, see the license at: + * + * http://www.fltk.org/COPYING.php + * + * Please report all bugs and problems on the following page: + * + * http://www.fltk.org/str.php + */ + +/* + ============================================================================ + DO NOT EDIT - This file is generated by CMake ! + ============================================================================ +*/ + +/* define FL_ABI_VERSION as 10x0y for FLTK ABI version 1.x.y */ + +/* #undef FL_ABI_VERSION */ + +/* + * End of "$Id: abi-version.h 12196 2017-03-13 23:31:38Z AlbrechtS $". + */ diff --git a/CMake/Android/app.build.gradle.in b/CMake/Android/app.build.gradle.in new file mode 100644 index 000000000..dd66c8d93 --- /dev/null +++ b/CMake/Android/app.build.gradle.in @@ -0,0 +1,26 @@ +apply plugin: 'com.android.application' + + android { + compileSdkVersion 25 + + defaultConfig { + applicationId 'org.fltk.android_hello' + minSdkVersion 14 + targetSdkVersion 25 + externalNativeBuild { + cmake { + arguments '-DANDROID_STL=c++_shared' + } + } + } + buildTypes { + release { + minifyEnabled false + } + } + externalNativeBuild { + cmake { + path 'src/main/cpp/CMakeLists.txt' + } + } + } diff --git a/CMake/Android/build.gradle.in b/CMake/Android/build.gradle.in new file mode 100644 index 000000000..f48a2c6ec --- /dev/null +++ b/CMake/Android/build.gradle.in @@ -0,0 +1,17 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +buildscript { + repositories { + jcenter() + google() + } + dependencies { + classpath 'com.android.tools.build:gradle:3.2.1' + } +} + +allprojects { + repositories { + jcenter() + google() + } +} diff --git a/CMake/Android/hdpi.ic_launcher.png b/CMake/Android/hdpi.ic_launcher.png new file mode 100644 index 000000000..cde69bccc Binary files /dev/null and b/CMake/Android/hdpi.ic_launcher.png differ diff --git a/CMake/Android/mdpi.ic_launcher.png b/CMake/Android/mdpi.ic_launcher.png new file mode 100644 index 000000000..c133a0cbd Binary files /dev/null and b/CMake/Android/mdpi.ic_launcher.png differ diff --git a/CMake/Android/settings.gradle.in b/CMake/Android/settings.gradle.in new file mode 100644 index 000000000..573abcb32 --- /dev/null +++ b/CMake/Android/settings.gradle.in @@ -0,0 +1,2 @@ +include ':app' + diff --git a/CMake/Android/strings.xml.in b/CMake/Android/strings.xml.in new file mode 100644 index 000000000..e2f60e96f --- /dev/null +++ b/CMake/Android/strings.xml.in @@ -0,0 +1,4 @@ + + + Hello Android + diff --git a/CMake/Android/xhdpi.ic_launcher.png b/CMake/Android/xhdpi.ic_launcher.png new file mode 100644 index 000000000..bfa42f0e7 Binary files /dev/null and b/CMake/Android/xhdpi.ic_launcher.png differ diff --git a/CMake/Android/xxhdpi.ic_launcher.png b/CMake/Android/xxhdpi.ic_launcher.png new file mode 100644 index 000000000..324e72cdd Binary files /dev/null and b/CMake/Android/xxhdpi.ic_launcher.png differ diff --git a/CMake/android.cmake b/CMake/android.cmake index cb4b790d7..75b3d4f4d 100644 --- a/CMake/android.cmake +++ b/CMake/android.cmake @@ -17,3 +17,82 @@ # http://www.fltk.org/str.php # +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/Android/settings.gradle.in" + "${CMAKE_CURRENT_BINARY_DIR}/AndroidStudio/settings.gradle" + @ONLY +) + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/Android/build.gradle.in" + "${CMAKE_CURRENT_BINARY_DIR}/AndroidStudio/build.gradle" + @ONLY +) + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/abi-version.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/AndroidStudio/FL/abi-version.h" + @ONLY +) + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/Android/app.build.gradle.in" + "${CMAKE_CURRENT_BINARY_DIR}/AndroidStudio/app/build.gradle" + @ONLY +) + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/Android/AndroidManifest.xml.in" + "${CMAKE_CURRENT_BINARY_DIR}/AndroidStudio/app/src/main/AndroidManifest.xml" + @ONLY +) + + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/Android/Roboto-Regular.ttf" + "${CMAKE_CURRENT_BINARY_DIR}/AndroidStudio/app/src/main/assets/fonts/Roboto-Regular.ttf" + COPYONLY +) + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/Android/mdpi.ic_launcher.png" + "${CMAKE_CURRENT_BINARY_DIR}/AndroidStudio/app/src/main/res/mipmap-mdpi/ic_launcher.png" + COPYONLY +) + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/Android/hdpi.ic_launcher.png" + "${CMAKE_CURRENT_BINARY_DIR}/AndroidStudio/app/src/main/res/mipmap-hdpi/ic_launcher.png" + COPYONLY +) + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/Android/xhdpi.ic_launcher.png" + "${CMAKE_CURRENT_BINARY_DIR}/AndroidStudio/app/src/main/res/mipmap-xhdpi/ic_launcher.png" + COPYONLY +) + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/Android/xxhdpi.ic_launcher.png" + "${CMAKE_CURRENT_BINARY_DIR}/AndroidStudio/app/src/main/res/mipmap-xxhdpi/ic_launcher.png" + COPYONLY +) + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/Android/strings.xml.in" + "${CMAKE_CURRENT_BINARY_DIR}/AndroidStudio/app/src/main/res/values/strings.xml" + @ONLY +) + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/Android/CMakeList.txt.in" + "${CMAKE_CURRENT_BINARY_DIR}/AndroidStudio/app/src/main/cpp/CMakeLists.txt" + @ONLY +) + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/Android/HelloAndroid.cxx.in" + "${CMAKE_CURRENT_BINARY_DIR}/AndroidStudio/app/src/main/cpp/HelloAndroid.cxx" + @ONLY +) + diff --git a/CMakeLists.txt b/CMakeLists.txt index 41cf9ac91..dd67da35e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,14 +96,6 @@ configure_file( @ONLY ) -if (OPTION_CREATE_ANDROID_STUDIO_IDE) - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/abi-version.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/AndroidStudio/FL/abi-version.h - @ONLY - ) -endif (OPTION_CREATE_ANDROID_STUDIO_IDE) - ####################################################################### # build examples - these have to be built after fluid is built/imported ####################################################################### diff --git a/README.Android.md b/README.Android.md new file mode 100644 index 000000000..f9854045a --- /dev/null +++ b/README.Android.md @@ -0,0 +1,80 @@ +README.Android.md + +# Building and Running FLTK with Android Studio 3 + + +WARNING: FLTK FOR ANDROID IS WORK IN PROGRESS IN A PRETTY EARLY STAGE. + + +## Contents + +1. Building FLTK with Android Studio 3 +2. Extensions and limitation of FLTK on Android +3. Document History + + +## Building FLTK with Android Studio 3 + +There is no need to ever write a single line of Java. + +Download and install AndroidStudio on your developer machine. If you use +AndroidStudio for the first time, use the IDE to download and build the +"Native Plasm" sample app. In the process, all resources required to build +FLTK will be installed. Once Native Plasm runs on your emulator or physical +device, you are ready to install FLTK. + +Build FLTK for your native platform first using CMake. AndroidStudio will need a native +version of the user interface design tool _Fluid_. + +The following example is for the _Xcode_ IDE on _macOS_. The same should work for +other IDEs and Makefiles on other platforms that run _AndroidStudio_. + +```bash +git clone https://github.com/fltk/fltk.git fltk-1.4.git +cd fltk-1.4.git +mkdir build +cd build +mkdir Xcode +cd Xcode +cmake -G "Unix Makefiles" \ + -D OPTION_USE_SYSTEM_LIBJPEG=Off \ + -D OPTION_USE_SYSTEM_ZLIB=Off \ + -D OPTION_USE_SYSTEM_LIBPNG=Off \ + -D OPTION_CREATE_ANDROID_STUDIO_IDE=On \ + ../.. +``` +Note the last option, `-D OPTION_CREATE_ANDROID_STUDIO_IDE=On`. This option will +create the file needed to create an FLTK demo project in +`fltk-1.4.git/build/Xcode/AndroidStudio`. + +- open the `build/Xcode/AndroidStudio/` directory as a project in AndroidStudio3 + +- click "run"; the project should compile and run out of the box + + +## Extensions and limitation of FLTK on Android + +Android support for FLTK is in an early stage. As of January 2019, most +rendering works, fonts work, bitmaps and pixmaps work, clipping works, window +layering works, and mouse clicks and keyboard events are handled + +When loading fonts: + - font names starting with a $ will have the system font path inserted + - font names starting with an @ will be loaded via the Asset Manager + - all other names will be used verbatim + +Limitations: + - the screen size is currently fixed to 600x800 and is scaled up + - many many big and little functions are not yet implemented + + +## Document History + +Jan 15 2019 - matt: rewrote document to explain the new CMake process +Mar 29 2018 - matt: many graphics functions have been implemented, keyboard +Mar 17 2018 - matt: added Android extensions for fonts +Mar 12 2018 - matt: started list of limitation that serevs as information to the + user as much as a todo list for core developers +Mar 6 2018 - matt: moved project to ide/AndroidStudio3/ +Mar 2 2018 - matt: rewriting Android port and documentation from scratch +Feb 9 2016 - matt: recreated document with more warnings and active support diff --git a/README.Android.txt b/README.Android.txt deleted file mode 100644 index fbbff3679..000000000 --- a/README.Android.txt +++ /dev/null @@ -1,98 +0,0 @@ - -README.Android.txt - Building and using FLTK with Android Studio 3 -================================================================== - - -WARNING: FLTK FOR ANDROID IS WORK IN PROGRESS IN A PRETTY EARLY STAGE. - - -CONTENTS --------- - - 1 Building FLTK with Android Studio 3 - 2 Building Apps on an Android device with C4Droid - 3 Extensions and limitation of FLTK on Android - 4 DOCUMENT HISTORY - - -BUILDING FLTK SAMPLE WITH ANDROID STUDIO 3 ------------------------------------------- - -There is no need to ever write a single line of Java. - -Download and install AndroidStudio on your developer machine. If you use -AndroidStudio for the first time, use the IDE to download and build the -"Native Plasm" sample app. In the process, all resources required to build -FLTK will be installed. Once Native Plasm runs on your emulator or physical -device, you are ready to install FLTK. - -- if your host machine runs MSWindows, rename the file - "ide/AndroidStudio3/gradlew.rename_to_bat" to "gradlew.bat" first - -- open the "ide/AndroidStudio3/" directory as a project in AndroidStudio - -- click "run"; the project should compile and run out of the box - - -Building Apps on an Android device with C4Droid ------------------------------------------------ - -WORK IN PROGRESS: -C4Droid is a minimal IDE that comes with gcc/g++ and runs directly on your -Android device. C4Droid supports Native Activities, SDL, SDL2, and even Qt. -FLTK uses the Native Activity mechanism, so why not write FLTK apps right -on your phone? - - - compile and test the Android test app in ide/HelloAndroid - - create /sdcard/include/ and /sdcard/lib/ on your Android device - - copy (fltk)/FL/ and its content into /sdcard/include/ - - copy (fltk)/ide/AndroidStudio3/FL/abi-version.h to /sdcard/include/FL/ - - copy (fltk)/ide/AndroidStudio3/./app/.externalNativeBuild/cmake/debug/arm64-v8a/fltk/lib/libfltk.a - to /sdcard/lib/ - - ... change Native Activity settings in c4Droid preferences - - ... remove native glue - - ... add include and library path, add library - - ... add support for (which?) STL library - - -Extensions and limitation of FLTK on Android --------------------------------------------- - -Android support for FLTK is in an early stage. As of March 2018, most -rendering works, fonts work, bitmaps and pixmaps work, clipping works, window -layering works, and mouse clicks and keyboard events are handled - -When loading fonts: - - font names starting with a $ will have the system font path inserted - - font names starting with an @ will be loaded via the Asset Manager - - all other names will be used verbatim - -Limitations: - - the screen size is currently fixed to 600x800 and is scaled up - - many many big and little functions are not yet implemented - - -Scratch Pad ------------ - -2019 approach: -```bash -cmake -G "Unix Makefiles" \ - -D OPTION_USE_SYSTEM_LIBJPEG=Off \ - -D OPTION_USE_SYSTEM_ZLIB=Off \ - -D OPTION_USE_SYSTEM_LIBPNG=Off \ - -D OPTION_CREATE_ANDROID_STUDIO_IDE=On \ - ../.. -``` - - -DOCUMENT HISTORY ----------------- - -Mar 29 2018 - matt: many graphics functions ahve been implemented, keyboard -Mar 17 2018 - matt: added Android extensions for fonts -Mar 12 2018 - matt: started list of limitation that serevs as information to the - user as much as a todo list for core developers -Mar 6 2018 - matt: moved project to ide/AndroidStudio3/ -Mar 2 2018 - matt: rewriting Android port and documentation from scratch -Feb 9 2016 - matt: recreated document with more warnings and active support diff --git a/ide/AndroidStudio3/FL/abi-version.h b/ide/AndroidStudio3/FL/abi-version.h deleted file mode 100644 index 9a5e4b89f..000000000 --- a/ide/AndroidStudio3/FL/abi-version.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * "$Id: abi-version.h 12196 2017-03-13 23:31:38Z AlbrechtS $" - * - * Configuration file for the Fast Light Tool Kit (FLTK). - * - * Copyright 1998-2015 by Bill Spitzak and others. - * - * This library is free software. Distribution and use rights are outlined in - * the file "COPYING" which should have been included with this file. If this - * file is missing or damaged, see the license at: - * - * http://www.fltk.org/COPYING.php - * - * Please report all bugs and problems on the following page: - * - * http://www.fltk.org/str.php - */ - -/* - ============================================================================ - DO NOT EDIT - This file is generated by CMake ! - ============================================================================ -*/ - -/* define FL_ABI_VERSION as 10x0y for FLTK ABI version 1.x.y */ - -/* #undef FL_ABI_VERSION */ - -/* - * End of "$Id: abi-version.h 12196 2017-03-13 23:31:38Z AlbrechtS $". - */ diff --git a/ide/AndroidStudio3/README.md b/ide/AndroidStudio3/README.md deleted file mode 100644 index 60bdbcaf9..000000000 --- a/ide/AndroidStudio3/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# Hello Android - -Hello Android is an FLTK sample app that derives from the Android Studio sample -project Native Plasma. This sample uses Android Studio 3 and CMake. - - -## Pre-requisites - -* Android Studio 3.0+ with [NDK](https://developer.android.com/ndk/) bundle. - - -## Getting Started - -1. [Download Android Studio](http://developer.android.com/sdk/index.html) -1. Launch Android Studio. -1. Open the `IDE` directory inside the FLTK directory. -1. Open the Android Studio project by loading the `AndroidStudio3` directory. -1. Click *Run/Run 'app'*. - - -## Support - -If you've found an error in these samples, please [file an issue](http://www.fltk.org/str.php). Patches are encouraged, and may be submitted via the same FLTK Bug & Feature system. - -Please visit the FLTK [Forum](http://www.fltk.org/newsgroups.php) for additional help. - - -## License - -FLTK is provided under the terms of the [GNU Library Public License, Version 2 with exceptions](http://www.fltk.org/COPYING.php) that allow for static linking. - - -## Android Shell - -List of short little helpers: - -```bash -am start -n org.fltk.android_hello/android.app.NativeActivity -am force-stop org.fltk.android_hello - -stop -setprop libc.debug.malloc 10 -// setprop libc.debug.malloc.program org.fltk.android_hello -setprop libc.debug.malloc.options "guard fill" -start -``` diff --git a/ide/AndroidStudio3/app/app.iml b/ide/AndroidStudio3/app/app.iml deleted file mode 100644 index 12e033381..000000000 --- a/ide/AndroidStudio3/app/app.iml +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ide/AndroidStudio3/app/build.gradle b/ide/AndroidStudio3/app/build.gradle deleted file mode 100644 index dd66c8d93..000000000 --- a/ide/AndroidStudio3/app/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -apply plugin: 'com.android.application' - - android { - compileSdkVersion 25 - - defaultConfig { - applicationId 'org.fltk.android_hello' - minSdkVersion 14 - targetSdkVersion 25 - externalNativeBuild { - cmake { - arguments '-DANDROID_STL=c++_shared' - } - } - } - buildTypes { - release { - minifyEnabled false - } - } - externalNativeBuild { - cmake { - path 'src/main/cpp/CMakeLists.txt' - } - } - } diff --git a/ide/AndroidStudio3/app/src/main/AndroidManifest.xml b/ide/AndroidStudio3/app/src/main/AndroidManifest.xml deleted file mode 100644 index e0131f422..000000000 --- a/ide/AndroidStudio3/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - diff --git a/ide/AndroidStudio3/app/src/main/assets/fonts/Roboto-Regular.ttf b/ide/AndroidStudio3/app/src/main/assets/fonts/Roboto-Regular.ttf deleted file mode 100644 index 88dae907b..000000000 Binary files a/ide/AndroidStudio3/app/src/main/assets/fonts/Roboto-Regular.ttf and /dev/null differ diff --git a/ide/AndroidStudio3/app/src/main/cpp/CMakeLists.txt b/ide/AndroidStudio3/app/src/main/cpp/CMakeLists.txt deleted file mode 100644 index c9f4fab48..000000000 --- a/ide/AndroidStudio3/app/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,47 +0,0 @@ -# -# Copyright (C) The Android Open Source Project -# -# 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. -# - -cmake_minimum_required(VERSION 3.4.1) - -set(FLTK_DIR ../../../../../..) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - - -# FIXME: add as a second argument the binary build dir -# so that the first argument can link directly to FLTK -# instead of the fltk symlink, which is bad for SVN -add_subdirectory(${FLTK_DIR}/ "${CMAKE_CURRENT_BINARY_DIR}/fltk" EXCLUDE_FROM_ALL) - -# now build app's shared lib -add_library(android-hello SHARED - HelloAndroid.cxx) - -target_include_directories(android-hello PRIVATE - ${FLTK_DIR}/ - ${FLTK_DIR}/ide/AndroidStudio3/) - -# Export ANativeActivity_onCreate(),
 -# Refer to: https://github.com/android-ndk/ndk/issues/381. -set(CMAKE_SHARED_LINKER_FLAGS - "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate") - -# add lib dependencies -target_link_libraries(android-hello - fltk - android - log - m) - diff --git a/ide/AndroidStudio3/app/src/main/cpp/HelloAndroid.cxx b/ide/AndroidStudio3/app/src/main/cpp/HelloAndroid.cxx deleted file mode 100644 index 1d0524bac..000000000 --- a/ide/AndroidStudio3/app/src/main/cpp/HelloAndroid.cxx +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (C) 2010 The Android Open Source Project - * - * 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. - * - */ - - -#include "../../test/button.cxx" - - -/* - - Missing: - - screen scale and size: most desktop apps expect to be in a draggable window - on a larger desktop surface. For Android, there is usually no desktop, and - screen resolution is often very high, so that a regular FLTK window would - hide as a tiny gray spot in the top left corner - * windows should probably be centered by default - ? the screen resolution should adapt to the first opened window - ? we should be able to hint at a prefered screen resolution - * drawing call must scale at some point (line width!) - * rotating the screen must call the app handler and(?) window resize - * proportions: pixels should be square - Need Work: - - Fl_Android_Graphics_Driver::pie(int) needs refactoring - - ...::line(...) has round ing issues (see rounded box type) - - grab() not working when leaving window (adjuster...) - - scrolling if implemented as a complete redraw. Must implement real scrolling - - the 'hotspot' idea to position dialogs under the mouse cursor makes little sense on touch screen devices - - fix screen when keyboard pops up in front of the text cursor or input field (temporarily shift up?) - - ending 'message' will not quit the app right away, but wait for some timeout - - no support for dead-key entry - - no Shift-Tab - - * test/CubeMain.cxx : UNSUPPROTED - needs OpenGL - * test/CubeView.cxx : UNSUPPROTED - needs OpenGL - * test/shape.cxx : UNSUPPROTED - needs OpenGL - * test/cube.cxx : UNSUPPROTED - needs OpenGL - * test/fractals.cxx : UNSUPPROTED - needs OpenGL - * test/fracviewer.cxx : UNSUPPROTED - needs OpenGL - * test/fullscreen.cxx : UNSUPPROTED - needs OpenGL - * test/gl_overlay.cxx : UNSUPPROTED - needs OpenGL - * test/glpuzzle.cxx : UNSUPPROTED - needs OpenGL - * test/mandelbrot.cxx : UNSUPPORTED - needs Fluid - * test/keyboard.cxx : UNSUPPORTED - needs Fluid - * test/CubeViewUI.fl - * test/keyboard_ui.fl - * test/radio.fl - * test/tree.fl - * test/fast_slow.fl - * test/mandelbrot_ui.fl - * test/resize.fl - * test/valuators.fl - * test/inactive.fl - * test/preferences.fl - * test/tabs.fl - * test/cairo_test.cxx : UNSUPPORTED - needs Cairo - * test/connect.cxx : UNSUPPORTED - Android is not Linux - * test/tiled_image.cxx : UNSUPPORTED - X11 only - * test/forms.cxx : UNSUPPORTED - needs Forms - - * test/doublebuffer.cxx : FIXME - redering is completely wrong - * test/line_style.cxx : TODO - no line styles yet - * test/list_visuals.cxx : TODO - needs config.h - * test/threads.cxx : TODO - needs config.h for pthreads - * test/animated.cxx : TODO - redering errors (alpha channel?) - * test/native-filechooser.cxx : TODO - not yet implemented - * test/blocks.cxx : TODO - needs config.h - * test/offscreen.cxx : TODO - not yet implemented - * test/overlay.cxx : TODO - no overlay yet - * test/pixmap_browser.cxx : TODO - filebrowser not yet implemented, no images, no printer - * test/clock.cxx : TODO - no system clock call yet - * test/resizebox.cxx : TODO - no window manager yet - * test/rotated_text.cxx : TODO - no rotated text - * test/subwindow.cxx : TODO - no subwindows yet - * test/sudoku.cxx : TODO - sound support is in our way - * test/demo.cxx : TODO - fails to open window, but is is useful at all? - * test/device.cxx : TODO - printing support - * test/tile.cxx : TODO - subwindow support - * test/editor.cxx : TODO - file chooser missing - * test/file_chooser.cxx : TODO - file chooser missing - * test/fonts.cxx : TODO - works, but does not list system fonts or resource fonts - * test/help_dialog.cxx : TODO - not implemented - * test/icon.cxx : TODO - what does this do on Android? - * test/iconize.cxx : TODO - no window manager - * test/utf8.cxx : TODO - window manager, clipping - * test/windowfocus.cxx : TODO - what does this do? - * test/browser.cxx : TODO - needs text resource to load browser content - * test/unittests.cxx : TODO - crashing, no alpha in image drawing, clipping issues - - * test/image.cxx : + works - * test/twowin.cxx : + works - * test/table.cxx : + works, but window is much too large for mobile device - * test/cursor.cxx : + works, but no cursor on Android - * test/colbrowser.cxx : + works - * test/checkers.cxx : + works - * test/pixmap.cxx : + works - * test/navigation.cxx : + works - * test/curve.cxx : + works - * test/input_choice.cxx : + works - * test/input.cxx : + works - * test/scroll.cxx : - works ok - - some dirt when a popup draws over another menu button!? - - on touch-screens, menuitem should be selected when released - - on touch-screens, scroll groups should scroll on multitouch, or when not causing any other action - * test/bitmap.cxx : + 'bitmap' works - * test/message.cxx : - 'message' mostly works - - when ending the app, it will not close right away but instead hang around for a few seconds - * test/menubar.cxx : - 'menubar' mostly works including unicode - ! pressing 'button' will hang the app - - shortcut modifiers don't work - - right-click does not work (should this be emulated via click-and-hold?) - * test/output.cxx : + 'output' works - * test/ask.cxx : + 'ask' works - * test/button.cxx : + 'button' works, including beep - * test/pack.cxx : + 'pack' works - * test/adjuster.cxx : + 'adjuster' works - * test/arc.cxx : + 'arc' works as expected - * test/minimum.cxx : + 'minimum' works - * test/boxtype.cxx : + 'boxtype' works - * test/buttons.cxx : + 'buttons' works - * test/color_chooser.cxx: + 'color_chooser' works - * test/symbols.cxx : + 'symbols' working as expected - * test/hello.cxx : + 'hello' works fine, italics, shadow, etc. - * test/label.cxx : + 'label' works - - */ diff --git a/ide/AndroidStudio3/app/src/main/res/mipmap-hdpi/ic_launcher.png b/ide/AndroidStudio3/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index cde69bccc..000000000 Binary files a/ide/AndroidStudio3/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/ide/AndroidStudio3/app/src/main/res/mipmap-mdpi/ic_launcher.png b/ide/AndroidStudio3/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index c133a0cbd..000000000 Binary files a/ide/AndroidStudio3/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/ide/AndroidStudio3/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/ide/AndroidStudio3/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index bfa42f0e7..000000000 Binary files a/ide/AndroidStudio3/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/ide/AndroidStudio3/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/ide/AndroidStudio3/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index 324e72cdd..000000000 Binary files a/ide/AndroidStudio3/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/ide/AndroidStudio3/app/src/main/res/values/strings.xml b/ide/AndroidStudio3/app/src/main/res/values/strings.xml deleted file mode 100644 index e2f60e96f..000000000 --- a/ide/AndroidStudio3/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - Hello Android - diff --git a/ide/AndroidStudio3/build.gradle b/ide/AndroidStudio3/build.gradle deleted file mode 100644 index f48a2c6ec..000000000 --- a/ide/AndroidStudio3/build.gradle +++ /dev/null @@ -1,17 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. -buildscript { - repositories { - jcenter() - google() - } - dependencies { - classpath 'com.android.tools.build:gradle:3.2.1' - } -} - -allprojects { - repositories { - jcenter() - google() - } -} diff --git a/ide/AndroidStudio3/gradle/wrapper/gradle-wrapper.jar b/ide/AndroidStudio3/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 8c0fb64a8..000000000 Binary files a/ide/AndroidStudio3/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/ide/AndroidStudio3/gradle/wrapper/gradle-wrapper.properties b/ide/AndroidStudio3/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index e023ccaff..000000000 --- a/ide/AndroidStudio3/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Fri Jan 04 18:34:29 CET 2019 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip diff --git a/ide/AndroidStudio3/gradlew b/ide/AndroidStudio3/gradlew deleted file mode 100755 index 91a7e269e..000000000 --- a/ide/AndroidStudio3/gradlew +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- -APP_HOME="`pwd -P`" -cd "$SAVED" >&- - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/ide/AndroidStudio3/gradlew.bat b/ide/AndroidStudio3/gradlew.bat deleted file mode 100644 index 8a0b282aa..000000000 --- a/ide/AndroidStudio3/gradlew.bat +++ /dev/null @@ -1,90 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/ide/AndroidStudio3/settings.gradle b/ide/AndroidStudio3/settings.gradle deleted file mode 100644 index c428c84b6..000000000 --- a/ide/AndroidStudio3/settings.gradle +++ /dev/null @@ -1,4 +0,0 @@ -include ':app' - -include ':FLTK' -project(':FLTK').projectDir = new File('../../') diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0ffe3f881..41145d7a4 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -39,7 +39,7 @@ include_directories( ) ####################################################################### -if(NOT ANDROID) +if(!ANDROID) CREATE_EXAMPLE(adjuster adjuster.cxx fltk) CREATE_EXAMPLE(arc arc.cxx fltk) CREATE_EXAMPLE(animated animated.cxx fltk) @@ -127,7 +127,7 @@ if(FLTK_HAVE_CAIRO) CREATE_EXAMPLE(cairo_test cairo_test.cxx "fltk;fltk_cairo") endif(FLTK_HAVE_CAIRO) -endif(NOT ANDROID) +endif(!ANDROID) # We need some support files for the demo programs: -- cgit v1.2.3