Remove experimental platforms Android, Pico, SDL (PR #376)

... as discussed in fltk.coredev: "FLTK 1.4.0 release schedule"
https://groups.google.com/g/fltkcoredev/c/PDbHTRpXVh0/m/JqboexZ_AwAJ
This commit is contained in:
Albrecht Schlosser 2022-01-23 01:33:47 +01:00
parent b275ff0715
commit 04ccc8cc46
84 changed files with 74 additions and 16613 deletions

3
.gitattributes vendored
View File

@ -41,9 +41,6 @@ misc/update_config_scripts eol=lf
*.rc eol=crlf
*.bat eol=crlf
# Android Studio special support file (Windows .bat file)
ide/AndroidStudio3/gradlew.rename_to_bat eol=crlf
# binary files
*.ico binary

View File

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fltk.@ANDROID_APP_NAME@"
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="test_@ANDROID_APP_NAME@" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View File

@ -1,60 +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.
#
# Modified to be a template for Android builds in FLTK
# Copyright 2019 Matthias Melcher and others
#
cmake_minimum_required(VERSION 3.4.1)
set(FLTK_DIR "@ANDROID_FLTK_DIR@")
set(FLTK_IDE_DIR "../../../..")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
# FIXME: this includes the entire CMakeLists again, creating an entire library
# build in every target
# TODO: create separate targets for all fltk libraries that can be easily
# linked by all app targets
add_subdirectory("${FLTK_DIR}/" "${CMAKE_CURRENT_BINARY_DIR}/lib" EXCLUDE_FROM_ALL)
# run Fluid build steps for every .fl file, if any
@ANDROID_FLUID_COMMANDS@
# now build app's shared lib
add_library(
test_@ANDROID_APP_NAME@ SHARED
@ANDROID_APP_SOURCES@)
target_include_directories(
test_@ANDROID_APP_NAME@ 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
# FIXME: apps may depend on additional fltk libraries; thise dependencies
# must be created in the CREATE_ANDROID_IDE_FOR_TEST macro
target_link_libraries(
test_@ANDROID_APP_NAME@
fltk
android
log
m
)

View File

@ -1,137 +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/@ANDROID_APP_NAME@.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 : UNSUPPORTED - needs OpenGL
* test/CubeView.cxx : UNSUPPORTED - needs OpenGL
* test/shape.cxx : UNSUPPORTED - needs OpenGL
* test/cube.cxx : UNSUPPORTED - needs OpenGL
* test/fractals.cxx : UNSUPPORTED - needs OpenGL
* test/fracviewer.cxx : UNSUPPORTED - needs OpenGL
* test/fullscreen.cxx : UNSUPPORTED - needs OpenGL
* test/gl_overlay.cxx : UNSUPPORTED - needs OpenGL
* test/glpuzzle.cxx : UNSUPPORTED - 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/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
*/

Binary file not shown.

View File

@ -1,26 +0,0 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
defaultConfig {
applicationId 'org.fltk.@ANDROID_APP_NAME@'
minSdkVersion 14
targetSdkVersion 25
externalNativeBuild {
cmake {
arguments '-DANDROID_STL=c++_shared'
}
}
}
buildTypes {
release {
minifyEnabled false
}
}
externalNativeBuild {
cmake {
path 'src/main/cpp/CMakeLists.txt'
}
}
}

View File

@ -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()
}
}

View File

@ -1,25 +0,0 @@
/*
* Configuration file for the Fast Light Tool Kit (FLTK).
*
* Copyright 1998-2020 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:
*
* https://www.fltk.org/COPYING.php
*
* Please see the following page on how to report bugs and issues:
*
* https://www.fltk.org/bugs.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 */

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -1 +0,0 @@

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">@ANDROID_APP_NAME@</string>
</resources>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

View File

@ -1,169 +0,0 @@
# This module defines
# SDL2_LIBRARY, the name of the library to link against
# SDL2_FOUND, if false, do not try to link to SDL2
# SDL2_INCLUDE_DIR, where to find SDL.h
#
# This module responds to the the flag:
# SDL2_BUILDING_LIBRARY
# If this is defined, then no SDL2main will be linked in because
# only applications need main().
# Otherwise, it is assumed you are building an application and this
# module will attempt to locate and set the the proper link flags
# as part of the returned SDL2_LIBRARY variable.
#
# Don't forget to include SDLmain.h and SDLmain.m your project for the
# OS X framework based version. (Other versions link to -lSDL2main which
# this module will try to find on your behalf.) Also for OS X, this
# module will automatically add the -framework Cocoa on your behalf.
#
#
# Additional Note: If you see an empty SDL2_LIBRARY_TEMP in your configuration
# and no SDL2_LIBRARY, it means CMake did not find your SDL2 library
# (SDL2.dll, libsdl2.so, SDL2.framework, etc).
# Set SDL2_LIBRARY_TEMP to point to your SDL2 library, and configure again.
# Similarly, if you see an empty SDL2MAIN_LIBRARY, you should set this value
# as appropriate. These values are used to generate the final SDL2_LIBRARY
# variable, but when these values are unset, SDL2_LIBRARY does not get created.
#
#
# $SDL2DIR is an environment variable that would
# correspond to the ./configure --prefix=$SDL2DIR
# used in building SDL2.
# l.e.galup 9-20-02
#
# Modified by Eric Wing.
# Added code to assist with automated building by using environmental variables
# and providing a more controlled/consistent search behavior.
# Added new modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
# Also corrected the header search path to follow "proper" SDL guidelines.
# Added a search for SDL2main which is needed by some platforms.
# Added a search for threads which is needed by some platforms.
# Added needed compile switches for MinGW.
#
# On OSX, this will prefer the Framework version (if found) over others.
# People will have to manually change the cache values of
# SDL2_LIBRARY to override this selection or set the CMake environment
# CMAKE_INCLUDE_PATH to modify the search paths.
#
# Note that the header path has changed from SDL2/SDL.h to just SDL.h
# This needed to change because "proper" SDL convention
# is #include "SDL.h", not <SDL2/SDL.h>. This is done for portability
# reasons because not all systems place things in SDL2/ (see FreeBSD).
#=============================================================================
# Copyright 2003-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
message("<FindSDL2.cmake>")
SET(SDL2_SEARCH_PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
${SDL2_PATH}
)
FIND_PATH(SDL2_INCLUDE_DIR SDL.h
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES include/SDL2 include
PATHS ${SDL2_SEARCH_PATHS}
)
FIND_LIBRARY(SDL2_LIBRARY_TEMP
NAMES SDL2
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES lib64 lib
PATHS ${SDL2_SEARCH_PATHS}
)
IF(NOT SDL2_BUILDING_LIBRARY)
IF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
# Non-OS X framework versions expect you to also dynamically link to
# SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms
# seem to provide SDL2main for compatibility even though they don't
# necessarily need it.
FIND_LIBRARY(SDL2MAIN_LIBRARY
NAMES SDL2main
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES lib64 lib
PATHS ${SDL2_SEARCH_PATHS}
)
ENDIF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
ENDIF(NOT SDL2_BUILDING_LIBRARY)
# SDL2 may require threads on your system.
# The Apple build may not need an explicit flag because one of the
# frameworks may already provide it.
# But for non-OSX systems, I will use the CMake Threads package.
IF(NOT APPLE)
FIND_PACKAGE(Threads)
ENDIF(NOT APPLE)
# MinGW needs an additional library, mwindows
# It's total link flags should look like -lmingw32 -lSDL2main -lSDL2 -lmwindows
# (Actually on second look, I think it only needs one of the m* libraries.)
IF(MINGW)
SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
ENDIF(MINGW)
IF(SDL2_LIBRARY_TEMP)
# For SDL2main
IF(NOT SDL2_BUILDING_LIBRARY)
IF(SDL2MAIN_LIBRARY)
SET(SDL2_LIBRARY_TEMP ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY_TEMP})
ENDIF(SDL2MAIN_LIBRARY)
ENDIF(NOT SDL2_BUILDING_LIBRARY)
# For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
# CMake doesn't display the -framework Cocoa string in the UI even
# though it actually is there if I modify a pre-used variable.
# I think it has something to do with the CACHE STRING.
# So I use a temporary variable until the end so I can set the
# "real" variable in one-shot.
IF(APPLE)
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa")
ENDIF(APPLE)
# For threads, as mentioned Apple doesn't need this.
# In fact, there seems to be a problem if I used the Threads package
# and try using this line, so I'm just skipping it entirely for OS X.
IF(NOT APPLE)
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
ENDIF(NOT APPLE)
# For MinGW library
IF(MINGW)
SET(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP})
ENDIF(MINGW)
# Set the final string here so the GUI reflects the final state.
SET(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found")
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
SET(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
ENDIF(SDL2_LIBRARY_TEMP)
message("</FindSDL2.cmake>")
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)

View File

@ -1,141 +0,0 @@
#
# android.cmake to build the FLTK AndroidStudio project using CMake
# Written by Matthias Melcher
#
# Copyright 1998-2019 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:
#
# https://www.fltk.org/COPYING.php
#
# Please see the following page on how to report bugs and issues:
#
# https://www.fltk.org/bugs.php
#
# all target modules will be added here later
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/CMake/Android/settings.gradle.in"
"${CMAKE_CURRENT_BINARY_DIR}/AndroidStudio/settings.gradle"
@ONLY
)
# configuration file for all modules
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/CMake/Android/build.gradle.in"
"${CMAKE_CURRENT_BINARY_DIR}/AndroidStudio/build.gradle"
@ONLY
)
# create a custom abi file for this setup
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/fl_config.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/AndroidStudio/FL/fl_config.h"
@ONLY
)
# TODO: where should we create config.h?
macro(CREATE_ANDROID_IDE_FOR_TEST NAME SOURCES LIBRARIES)
# message(STATUS "Creating Android IDE for ${NAME}")
set (ANDROID_APP_NAME ${NAME})
set (ANDROID_FLTK_DIR ${CMAKE_SOURCE_DIR})
set (srcs)
set (ANDROID_APP_SOURCES)
set (ANDROID_FLUID_COMMANDS)
set (flsrcs) # fluid source files
foreach(src ${SOURCES})
if ("${src}" MATCHES "\\.fl$")
list(APPEND flsrcs ${src})
string(REGEX REPLACE "(.*).fl" \\1 basename ${src})
string(APPEND ANDROID_FLUID_COMMANDS
"add_custom_command(\n"
" OUTPUT \"\${FLTK_DIR}/test/${basename}.cxx\" \"\${FLTK_DIR}/test/${basename}.h\"\n"
" COMMAND fluid -c \"${src}\"\n"
" WORKING_DIRECTORY \"\${FLTK_DIR}/test\"\n"
" DEPENDS \"\${FLTK_DIR}/test/${src}\"\n"
" MAIN_DEPENDENCY \"\${FLTK_DIR}/test/${src}\"\n"
")\n\n"
)
file(TOUCH "${basename}.cxx")
file(TOUCH "${basename}.h")
file(TOUCH "${basename}.fl")
set(src_cxx ${basename}.cxx)
else ()
list(APPEND srcs ${src})
set(src_cxx ${src})
endif ("${src}" MATCHES "\\.fl$")
string(APPEND ANDROID_APP_SOURCES " \"\${FLTK_DIR}/test/${src_cxx}\"\n")
endforeach(src)
configure_file(
"${CMAKE_SOURCE_DIR}/CMake/Android/app.build.gradle.in"
"${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/build.gradle"
@ONLY
)
configure_file(
"${CMAKE_SOURCE_DIR}/CMake/Android/AndroidManifest.xml.in"
"${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/src/main/AndroidManifest.xml"
@ONLY
)
configure_file(
"${CMAKE_SOURCE_DIR}/CMake/Android/Roboto-Regular.ttf"
"${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/src/main/assets/fonts/Roboto-Regular.ttf"
COPYONLY
)
configure_file(
"${CMAKE_SOURCE_DIR}/CMake/Android/mdpi.ic_launcher.png"
"${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/src/main/res/mipmap-mdpi/ic_launcher.png"
COPYONLY
)
configure_file(
"${CMAKE_SOURCE_DIR}/CMake/Android/hdpi.ic_launcher.png"
"${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/src/main/res/mipmap-hdpi/ic_launcher.png"
COPYONLY
)
configure_file(
"${CMAKE_SOURCE_DIR}/CMake/Android/xhdpi.ic_launcher.png"
"${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/src/main/res/mipmap-xhdpi/ic_launcher.png"
COPYONLY
)
configure_file(
"${CMAKE_SOURCE_DIR}/CMake/Android/xxhdpi.ic_launcher.png"
"${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/src/main/res/mipmap-xxhdpi/ic_launcher.png"
COPYONLY
)
configure_file(
"${CMAKE_SOURCE_DIR}/CMake/Android/strings.xml.in"
"${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/src/main/res/values/strings.xml"
@ONLY
)
configure_file(
"${CMAKE_SOURCE_DIR}/CMake/Android/CMakeList.txt.in"
"${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/src/main/cpp/CMakeLists.txt"
@ONLY
)
file(APPEND "${CMAKE_BINARY_DIR}/AndroidStudio/settings.gradle" "include ':${ANDROID_APP_NAME}'\n")
endmacro(CREATE_ANDROID_IDE_FOR_TEST NAME SOURCES LIBRARIES)
macro(CREATE_ANDROID_IDE_WRAPUP)
# message(STATUS "Wrapping up Android IDE creation")
endmacro(CREATE_ANDROID_IDE_WRAPUP)

View File

@ -46,8 +46,7 @@
# quotes if more than one library is required, e.g. "fltk_gl;fltk"
#
# CREATE_EXAMPLE can have an optional fourth argument with a list of options
# - the option ANDROID_OK is set if CREATE_EXAMPLE creates code for Android
# builds in addition to the native build
# - these options are currently not used
#
################################################################################
@ -62,11 +61,11 @@ macro (CREATE_EXAMPLE NAME SOURCES LIBRARIES)
# create macOS bundle? 0 = no, 1 = yes
if (APPLE AND (NOT OPTION_APPLE_X11) AND (NOT OPTION_APPLE_SDL))
if (APPLE AND (NOT OPTION_APPLE_X11))
set (MAC_BUNDLE 1)
else ()
set (MAC_BUNDLE 0)
endif (APPLE AND (NOT OPTION_APPLE_X11) AND (NOT OPTION_APPLE_SDL))
endif (APPLE AND (NOT OPTION_APPLE_X11))
# rename target name "help" (reserved since CMake 2.8.12)
# FIXME: not necessary in FLTK 1.4 but left for compatibility (06/2020)
@ -164,15 +163,17 @@ macro (CREATE_EXAMPLE NAME SOURCES LIBRARIES)
endif (MAC_BUNDLE)
######################################################################
# Parse optional fourth argument "ANDROID_OK", see description above.
# Parse optional fourth argument, see description above.
######################################################################
if (${ARGC} GREATER 3)
foreach (OPTION ${ARGV3})
if (${OPTION} STREQUAL "ANDROID_OK" AND OPTION_CREATE_ANDROID_STUDIO_IDE)
CREATE_ANDROID_IDE_FOR_TEST (${NAME} ${SOURCES} ${LIBRARIES})
endif ()
endforeach ()
endif ()
# code left commented out as an example
# *unused* # if (${ARGC} GREATER 3)
# *unused* # foreach (OPTION ${ARGV3})
# *unused* # if (${OPTION} STREQUAL "xxx")
# *unused* # # do something ...
# *unused* # endif ()
# *unused* # endforeach ()
# *unused* # endif ()
endmacro (CREATE_EXAMPLE NAME SOURCES LIBRARIES)

View File

@ -65,7 +65,6 @@ endif (WIN32)
#######################################################################
if (APPLE)
option (OPTION_APPLE_X11 "use X11" OFF)
option (OPTION_APPLE_SDL "use SDL" OFF)
if (CMAKE_OSX_SYSROOT)
list (APPEND FLTK_CFLAGS "-isysroot ${CMAKE_OSX_SYSROOT}")
endif (CMAKE_OSX_SYSROOT)
@ -100,14 +99,6 @@ if (OPTION_APPLE_X11)
endif (X11_INCLUDE_DIR)
endif (OPTION_APPLE_X11)
if (OPTION_APPLE_SDL)
find_package (SDL2 REQUIRED)
if (SDL2_FOUND)
set (USE_SDL 1)
list (APPEND FLTK_LDLIBS SDL2_LIBRARY)
endif (SDL2_FOUND)
endif (OPTION_APPLE_SDL)
#######################################################################
option (OPTION_USE_POLL "use poll if available" OFF)
mark_as_advanced (OPTION_USE_POLL)
@ -238,8 +229,6 @@ if (OPTION_USE_GL)
set (OPENGL_LIBRARIES -L${PATH_TO_XLIBS} -lGLU -lGL)
unset(HAVE_GL_GLU_H CACHE)
find_file (HAVE_GL_GLU_H GL/glu.h PATHS ${X11_INCLUDE_DIR})
elseif (OPTION_APPLE_SDL)
set (OPENGL_FOUND FALSE)
else()
include (FindOpenGL)
if (APPLE)
@ -618,10 +607,6 @@ else ()
endif (OPTION_USE_KDIALOG)
#######################################################################
#######################################################################
option (OPTION_CREATE_ANDROID_STUDIO_IDE "create files needed to compile FLTK for Android" OFF)
#######################################################################
#######################################################################
option (CMAKE_SUPPRESS_REGENERATION "suppress rules to re-run CMake on rebuild" OFF)
mark_as_advanced (CMAKE_SUPPRESS_REGENERATION)

View File

@ -89,9 +89,6 @@ if (APPLE)
if (NOT(${CMAKE_SYSTEM_VERSION} VERSION_LESS 17.0.0)) # a.k.a. macOS version 10.13
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LIBCPP_HAS_THREAD_API_PTHREAD")
endif (NOT(${CMAKE_SYSTEM_VERSION} VERSION_LESS 17.0.0))
elseif (OPTION_APPLE_SDL)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SDL2_INCLUDE_DIRS} -U__APPLE__")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SDL2_INCLUDE_DIRS} -U__APPLE__")
else ()
set (__APPLE_QUARTZ__ 1)
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Cocoa")

View File

@ -41,8 +41,6 @@ endif (DEBUG_VARIABLES_CMAKE)
if (WIN32)
list (APPEND FLTK_LDLIBS -lole32 -luuid -lcomctl32 -lws2_32)
elseif (APPLE AND OPTION_APPLE_SDL)
# FIXME: do nothing?
elseif (APPLE AND NOT OPTION_APPLE_X11)
list (APPEND FLTK_LDLIBS "-framework Cocoa")
else ()

View File

@ -80,13 +80,6 @@ include (CMake/resources.cmake)
#######################################################################
include (CMake/options.cmake)
#######################################################################
# Android Studio setup
#######################################################################
if (OPTION_CREATE_ANDROID_STUDIO_IDE)
include (CMake/android.cmake)
endif (OPTION_CREATE_ANDROID_STUDIO_IDE)
#######################################################################
# print (debug) several build variables and options
#######################################################################
@ -102,7 +95,6 @@ if (debug_build)
fl_debug_var (MSVC)
fl_debug_var (UNIX)
fl_debug_var (APPLE)
fl_debug_var (ANDROID)
fl_debug_var (CMAKE_BUILD_TYPE)
fl_debug_var (CMAKE_SIZEOF_VOID_P)
fl_debug_var (OPTION_OPTIM)
@ -124,9 +116,7 @@ add_subdirectory(src)
# build fluid
#######################################################################
if (NOT ANDROID)
add_subdirectory(fluid)
endif()
add_subdirectory(fluid)
#######################################################################
# variables shared by export and install
@ -159,13 +149,6 @@ if (FLTK_BUILD_EXAMPLES)
add_subdirectory (examples)
endif (FLTK_BUILD_EXAMPLES)
#######################################################################
# Android Studio wrapup
#######################################################################
if (OPTION_CREATE_ANDROID_STUDIO_IDE)
CREATE_ANDROID_IDE_WRAPUP()
endif (OPTION_CREATE_ANDROID_STUDIO_IDE)
#######################################################################
# installation
#######################################################################

View File

@ -1,159 +0,0 @@
//
// Template header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 2016-2018 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:
//
// https://www.fltk.org/COPYING.php
//
// Please see the following page on how to report bugs and issues:
//
// https://www.fltk.org/bugs.php
//
// Do not directly include this file, instead use <FL/android.H>.
// These types and variables give access to internal, platform-specific data through the public API.
// They require to include platform.H (in contrast to types defined in platform_types.h)
#if !defined(FL_PLATFORM_H)
# error "Never use <FL/android.H> directly; include <FL/platform.H> instead."
#endif // !FL_PLATFORM_H
#ifdef __cplusplus
extern "C" {
#endif
/*
This is the function that application code must implement, representing
the main entry to the app.
*/
extern int main(int argc, char **argv);
#ifdef __cplusplus
}
#endif
typedef void *Window; // used by fl_find(), fl_xid() and class Fl_X
/* Reference to the current device context
For back-compatibility only. The preferred procedure to get this reference is
Fl_Surface_Device::surface()->driver()->gc().
*/
extern void *fl_gc;
/**
These events are specific to the Android OS driver system. They can
be read by adding a callback via Fl::add_system_handler() and reading Fl::event()
Don't change the order of these enums! See Fl_Android_Application.H .
*/
enum Fl_Android_Platform_Event
{
FL_ANDROID_EVENTS = 0x00010000,
/**
* Command from main thread: the AInputQueue has changed. Upon processing
* this command, android_app->inputQueue will be updated to the new queue
* (or NULL).
*/
FL_ANDROID_EVENT_INPUT_CHANGED,
/**
* Command from main thread: a new ANativeWindow is ready for use. Upon
* receiving this command, android_app->window will contain the new window
* surface.
*/
FL_ANDROID_EVENT_INIT_WINDOW,
/**
* Command from main thread: the existing ANativeWindow needs to be
* terminated. Upon receiving this command, android_app->window still
* contains the existing window; after calling android_app_exec_cmd
* it will be set to NULL.
*/
FL_ANDROID_EVENT_TERM_WINDOW,
/**
* Command from main thread: the current ANativeWindow has been resized.
* Please redraw with its new size.
*/
FL_ANDROID_EVENT_WINDOW_RESIZED,
/**
* Command from main thread: the system needs that the current ANativeWindow
* be redrawn. You should redraw the window before handing this to
* android_app_exec_cmd() in order to avoid transient drawing glitches.
*/
FL_ANDROID_EVENT_WINDOW_REDRAW_NEEDED,
/**
* Command from main thread: the content area of the window has changed,
* such as from the soft input window being shown or hidden. You can
* find the new content rect in android_app::contentRect.
*/
FL_ANDROID_EVENT_CONTENT_RECT_CHANGED,
/**
* Command from main thread: the app's activity window has gained
* input focus.
*/
FL_ANDROID_EVENT_GAINED_FOCUS,
/**
* Command from main thread: the app's activity window has lost
* input focus.
*/
FL_ANDROID_EVENT_LOST_FOCUS,
/**
* Command from main thread: the current device configuration has changed.
*/
FL_ANDROID_EVENT_CONFIG_CHANGED,
/**
* Command from main thread: the system is running low on memory.
* Try to reduce your memory use.
*/
FL_ANDROID_EVENT_LOW_MEMORY,
/**
* Command from main thread: the app's activity has been started.
*/
FL_ANDROID_EVENT_START,
/**
* Command from main thread: the app's activity has been resumed.
*/
FL_ANDROID_EVENT_RESUME,
/**
* Command from main thread: the app should generate a new saved state
* for itself, to restore from later if needed. If you have saved state,
* allocate it with malloc and place it in android_app.savedState with
* the size in android_app.savedStateSize. The will be freed for you
* later.
*/
FL_ANDROID_EVENT_SAVE_STATE,
/**
* Command from main thread: the app's activity has been paused.
*/
FL_ANDROID_EVENT_PAUSE,
/**
* Command from main thread: the app's activity has been stopped.
*/
FL_ANDROID_EVENT_STOP,
/**
* Command from main thread: the app's activity is being destroyed,
* and waiting for the app thread to clean up and exit before proceeding.
*/
FL_ANDROID_EVENT_DESTROY
};

View File

@ -37,8 +37,6 @@ class Fl_Window;
# include "win32.H"
# elif defined(__APPLE__)
# include "mac.H"
# elif defined(__ANDROID__)
# include "android.H"
# elif defined(FLTK_USE_X11)
# include "x11.H"
# endif // _WIN32

View File

@ -72,12 +72,6 @@ typedef opaque GLContext; /**< an OpenGL graphics context, into which all OpenGL
typedef intptr_t fl_intptr_t;
typedef uintptr_t fl_uintptr_t;
#elif defined(__ANDROID__)
#include <sys/stat.h>
typedef intptr_t fl_intptr_t;
typedef uintptr_t fl_uintptr_t;
#else /* ! _WIN64 */
typedef long fl_intptr_t;
@ -122,22 +116,6 @@ typedef struct HGLRC__ *GLContext;
struct dirent {char d_name[1];};
#endif
#elif defined(__ANDROID__)
#ifdef __cplusplus
typedef class Fl_Rect_Region *Fl_Region;
#else
typedef struct Fl_Rect_Region *Fl_Region;
#endif
// TODO: the types below have not yet been ported
typedef unsigned long Fl_Offscreen;
typedef unsigned long Fl_Bitmask;
typedef int FL_SOCKET;
typedef struct __GLXcontextRec *GLContext;
#include <sys/types.h>
#include <dirent.h>
#elif defined(FLTK_USE_X11)
typedef unsigned long Fl_Offscreen;

View File

@ -1,80 +0,0 @@
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