diff options
Diffstat (limited to 'CMake/Android')
| -rw-r--r-- | CMake/Android/AndroidManifest.xml.in | 22 | ||||
| -rw-r--r-- | CMake/Android/CMakeList.txt.in | 49 | ||||
| -rw-r--r-- | CMake/Android/HelloAndroid.cxx.in | 138 | ||||
| -rw-r--r-- | CMake/Android/Roboto-Regular.ttf | bin | 0 -> 306672 bytes | |||
| -rw-r--r-- | CMake/Android/abi-version.cmake.in | 31 | ||||
| -rw-r--r-- | CMake/Android/app.build.gradle.in | 26 | ||||
| -rw-r--r-- | CMake/Android/build.gradle.in | 17 | ||||
| -rw-r--r-- | CMake/Android/hdpi.ic_launcher.png | bin | 0 -> 3418 bytes | |||
| -rw-r--r-- | CMake/Android/mdpi.ic_launcher.png | bin | 0 -> 2206 bytes | |||
| -rw-r--r-- | CMake/Android/settings.gradle.in | 2 | ||||
| -rw-r--r-- | CMake/Android/strings.xml.in | 4 | ||||
| -rw-r--r-- | CMake/Android/xhdpi.ic_launcher.png | bin | 0 -> 4842 bytes | |||
| -rw-r--r-- | CMake/Android/xxhdpi.ic_launcher.png | bin | 0 -> 7718 bytes |
13 files changed, 289 insertions, 0 deletions
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 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="org.fltk.android_hello" + android:versionCode="1" + android:versionName="1.0"> + <application + android:allowBackup="false" + android:fullBackupContent="false" + android:icon="@mipmap/ic_launcher" + android:label="@string/app_name" + android:hasCode="false"> + <activity android:name="android.app.NativeActivity" + android:label="@string/app_name"> + <meta-data android:name="android.app.lib_name" + android:value="android-hello" /> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + </application> +</manifest> 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 Binary files differnew file mode 100644 index 000000000..88dae907b --- /dev/null +++ b/CMake/Android/Roboto-Regular.ttf 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 Binary files differnew file mode 100644 index 000000000..cde69bccc --- /dev/null +++ b/CMake/Android/hdpi.ic_launcher.png diff --git a/CMake/Android/mdpi.ic_launcher.png b/CMake/Android/mdpi.ic_launcher.png Binary files differnew file mode 100644 index 000000000..c133a0cbd --- /dev/null +++ b/CMake/Android/mdpi.ic_launcher.png 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 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <string name="app_name">Hello Android</string> +</resources> diff --git a/CMake/Android/xhdpi.ic_launcher.png b/CMake/Android/xhdpi.ic_launcher.png Binary files differnew file mode 100644 index 000000000..bfa42f0e7 --- /dev/null +++ b/CMake/Android/xhdpi.ic_launcher.png diff --git a/CMake/Android/xxhdpi.ic_launcher.png b/CMake/Android/xxhdpi.ic_launcher.png Binary files differnew file mode 100644 index 000000000..324e72cdd --- /dev/null +++ b/CMake/Android/xxhdpi.ic_launcher.png |
