More Android changes.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12699 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher 2018-03-02 20:03:04 +00:00
parent b2da1fcbaf
commit 42555053a1
12 changed files with 227 additions and 213 deletions

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="HelloAndroid" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
<option name="BUILDABLE" value="false" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -0,0 +1,140 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":app" />
</configuration>
</facet>
<facet type="native-android-gradle" name="Native-Android-Gradle">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
</configuration>
</facet>
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<afterSyncTasks>
<task>generateDebugSources</task>
</afterSyncTasks>
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/cpp" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/check-manifest" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/cmake" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaPrecompile" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/prebuild" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/splits-support" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<content url="file://$MODULE_DIR$/../../../jpeg">
<sourceFolder url="file://$MODULE_DIR$/../../../jpeg" isTestSource="false" />
</content>
<content url="file://$MODULE_DIR$/../../../png">
<sourceFolder url="file://$MODULE_DIR$/../../../png" isTestSource="false" />
</content>
<content url="file://$MODULE_DIR$/../../../src">
<sourceFolder url="file://$MODULE_DIR$/../../../src" isTestSource="false" />
</content>
<content url="file://$MODULE_DIR$/../../../src/drivers/Android">
<sourceFolder url="file://$MODULE_DIR$/../../../src/drivers/Android" isTestSource="false" />
</content>
<content url="file://$MODULE_DIR$/../../../src/drivers/PostScript">
<sourceFolder url="file://$MODULE_DIR$/../../../src/drivers/PostScript" isTestSource="false" />
</content>
<content url="file://$MODULE_DIR$/../../../src/xutf8">
<sourceFolder url="file://$MODULE_DIR$/../../../src/xutf8" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -16,160 +16,10 @@
cmake_minimum_required(VERSION 3.4.1)
# ------------------------- Begin Generic CMake Variable Logging ------------------
# /* C++ comment style not allowed */
# if you are building in-source, this is the same as CMAKE_SOURCE_DIR, otherwise
# this is the top level directory of your build tree
MESSAGE( STATUS "CMAKE_BINARY_DIR: " ${CMAKE_BINARY_DIR} )
# if you are building in-source, this is the same as CMAKE_CURRENT_SOURCE_DIR, otherwise this
# is the directory where the compiled or generated files from the current CMakeLists.txt will go to
MESSAGE( STATUS "CMAKE_CURRENT_BINARY_DIR: " ${CMAKE_CURRENT_BINARY_DIR} )
# this is the directory, from which cmake was started, i.e. the top level source directory
MESSAGE( STATUS "CMAKE_SOURCE_DIR: " ${CMAKE_SOURCE_DIR} )
# this is the directory where the currently processed CMakeLists.txt is located in
MESSAGE( STATUS "CMAKE_CURRENT_SOURCE_DIR: " ${CMAKE_CURRENT_SOURCE_DIR} )
# contains the full path to the top level directory of your build tree
MESSAGE( STATUS "PROJECT_BINARY_DIR: " ${PROJECT_BINARY_DIR} )
# contains the full path to the root of your project source directory,
# i.e. to the nearest directory where CMakeLists.txt contains the PROJECT() command
MESSAGE( STATUS "PROJECT_SOURCE_DIR: " ${PROJECT_SOURCE_DIR} )
# set this variable to specify a common place where CMake should put all executable files
# (instead of CMAKE_CURRENT_BINARY_DIR)
MESSAGE( STATUS "EXECUTABLE_OUTPUT_PATH: " ${EXECUTABLE_OUTPUT_PATH} )
# set this variable to specify a common place where CMake should put all libraries
# (instead of CMAKE_CURRENT_BINARY_DIR)
MESSAGE( STATUS "LIBRARY_OUTPUT_PATH: " ${LIBRARY_OUTPUT_PATH} )
# tell CMake to search first in directories listed in CMAKE_MODULE_PATH
# when you use FIND_PACKAGE() or INCLUDE()
MESSAGE( STATUS "CMAKE_MODULE_PATH: " ${CMAKE_MODULE_PATH} )
# this is the complete path of the cmake which runs currently (e.g. /usr/local/bin/cmake)
MESSAGE( STATUS "CMAKE_COMMAND: " ${CMAKE_COMMAND} )
# this is the CMake installation directory
MESSAGE( STATUS "CMAKE_ROOT: " ${CMAKE_ROOT} )
# this is the filename including the complete path of the file where this variable is used.
MESSAGE( STATUS "CMAKE_CURRENT_LIST_FILE: " ${CMAKE_CURRENT_LIST_FILE} )
# this is linenumber where the variable is used
MESSAGE( STATUS "CMAKE_CURRENT_LIST_LINE: " ${CMAKE_CURRENT_LIST_LINE} )
# this is used when searching for include files e.g. using the FIND_PATH() command.
MESSAGE( STATUS "CMAKE_INCLUDE_PATH: " ${CMAKE_INCLUDE_PATH} )
# this is used when searching for libraries e.g. using the FIND_LIBRARY() command.
MESSAGE( STATUS "CMAKE_LIBRARY_PATH: " ${CMAKE_LIBRARY_PATH} )
# the complete system name, e.g. "Linux-2.4.22", "FreeBSD-5.4-RELEASE" or "Windows 5.1"
MESSAGE( STATUS "CMAKE_SYSTEM: " ${CMAKE_SYSTEM} )
# the short system name, e.g. "Linux", "FreeBSD" or "Windows"
MESSAGE( STATUS "CMAKE_SYSTEM_NAME: " ${CMAKE_SYSTEM_NAME} )
# only the version part of CMAKE_SYSTEM
MESSAGE( STATUS "CMAKE_SYSTEM_VERSION: " ${CMAKE_SYSTEM_VERSION} )
# the processor name (e.g. "Intel(R) Pentium(R) M processor 2.00GHz")
MESSAGE( STATUS "CMAKE_SYSTEM_PROCESSOR: " ${CMAKE_SYSTEM_PROCESSOR} )
# is TRUE on all UNIX-like OS's, including Apple OS X and CygWin
MESSAGE( STATUS "UNIX: " ${UNIX} )
# is TRUE on Windows, including CygWin
MESSAGE( STATUS "WIN32: " ${WIN32} )
# is TRUE on Apple OS X
MESSAGE( STATUS "APPLE: " ${APPLE} )
# is TRUE when using the MinGW compiler in Windows
MESSAGE( STATUS "MINGW: " ${MINGW} )
# is TRUE on Windows when using the CygWin version of cmake
MESSAGE( STATUS "CYGWIN: " ${CYGWIN} )
# is TRUE on Windows when using a Borland compiler
MESSAGE( STATUS "BORLAND: " ${BORLAND} )
# Microsoft compiler
MESSAGE( STATUS "MSVC: " ${MSVC} )
MESSAGE( STATUS "MSVC_IDE: " ${MSVC_IDE} )
MESSAGE( STATUS "MSVC60: " ${MSVC60} )
MESSAGE( STATUS "MSVC70: " ${MSVC70} )
MESSAGE( STATUS "MSVC71: " ${MSVC71} )
MESSAGE( STATUS "MSVC80: " ${MSVC80} )
MESSAGE( STATUS "CMAKE_COMPILER_2005: " ${CMAKE_COMPILER_2005} )
# set this to true if you don't want to rebuild the object files if the rules have changed,
# but not the actual source files or headers (e.g. if you changed the some compiler switches)
MESSAGE( STATUS "CMAKE_SKIP_RULE_DEPENDENCY: " ${CMAKE_SKIP_RULE_DEPENDENCY} )
# since CMake 2.1 the install rule depends on all, i.e. everything will be built before installing.
# If you don't like this, set this one to true.
MESSAGE( STATUS "CMAKE_SKIP_INSTALL_ALL_DEPENDENCY: " ${CMAKE_SKIP_INSTALL_ALL_DEPENDENCY} )
# If set, runtime paths are not added when using shared libraries. Default it is set to OFF
MESSAGE( STATUS "CMAKE_SKIP_RPATH: " ${CMAKE_SKIP_RPATH} )
# set this to true if you are using makefiles and want to see the full compile and link
# commands instead of only the shortened ones
MESSAGE( STATUS "CMAKE_VERBOSE_MAKEFILE: " ${CMAKE_VERBOSE_MAKEFILE} )
# this will cause CMake to not put in the rules that re-run CMake. This might be useful if
# you want to use the generated build files on another machine.
MESSAGE( STATUS "CMAKE_SUPPRESS_REGENERATION: " ${CMAKE_SUPPRESS_REGENERATION} )
# A simple way to get switches to the compiler is to use ADD_DEFINITIONS().
# But there are also two variables exactly for this purpose:
# the compiler flags for compiling C sources
MESSAGE( STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS} )
# the compiler flags for compiling C++ sources
MESSAGE( STATUS "CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
# Choose the type of build. Example: SET(CMAKE_BUILD_TYPE Debug)
MESSAGE( STATUS "CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE} )
# if this is set to ON, then all libraries are built as shared libraries by default.
MESSAGE( STATUS "BUILD_SHARED_LIBS: " ${BUILD_SHARED_LIBS} )
# the compiler used for C files
MESSAGE( STATUS "CMAKE_C_COMPILER: " ${CMAKE_C_COMPILER} )
# the compiler used for C++ files
MESSAGE( STATUS "CMAKE_CXX_COMPILER: " ${CMAKE_CXX_COMPILER} )
# if the compiler is a variant of gcc, this should be set to 1
MESSAGE( STATUS "CMAKE_COMPILER_IS_GNUCC: " ${CMAKE_COMPILER_IS_GNUCC} )
# if the compiler is a variant of g++, this should be set to 1
MESSAGE( STATUS "CMAKE_COMPILER_IS_GNUCXX : " ${CMAKE_COMPILER_IS_GNUCXX} )
# the tools for creating libraries
MESSAGE( STATUS "CMAKE_AR: " ${CMAKE_AR} )
MESSAGE( STATUS "CMAKE_RANLIB: " ${CMAKE_RANLIB} )
#
#MESSAGE( STATUS ": " ${} )
# ------------------------- End of Generic CMake Variable Logging ------------------
add_subdirectory(fltk, fltk.build)
# 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(../../../../../../ "${CMAKE_CURRENT_BINARY_DIR}/fltk" EXCLUDE_FROM_ALL)
# now build app's shared lib
add_library(android-hello SHARED

View File

@ -35,7 +35,7 @@ Fl_Button *btn;
#include <string.h>
#include <math.h>
#define LOG_TAG "libplasma"
#define LOG_TAG "HelloFLTK"
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
#define LOGW(...) __android_log_print(ANDROID_LOG_WARN,LOG_TAG,__VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
@ -521,8 +521,7 @@ void android_main(struct android_app* state) {
stats_init(&engine.stats);
win = new Fl_Window(10, 10, 600, 400, "Hallo");
btn = new Fl_Button(190, 200, 220, 35, "Hello, world!");
btn = new Fl_Button(190, 240, 220, 35, "O/\\!*()|");
btn = new Fl_Button(190, 200, 280, 35, "Hello, Android!");
win->show();

View File

@ -58,6 +58,7 @@ 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)

View File

@ -452,81 +452,81 @@ public:
protected:
int line_width_;
void cache_size(Fl_Image *img, int &width, int &height);
virtual Fl_Region scale_clip(float f)=0;
virtual Fl_Region scale_clip(float f) { return 0; }
void unscale_clip(Fl_Region r);
virtual void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
virtual void draw_unscaled(Fl_Pixmap *pxm, float s, int XP, int YP, int WP, int HP, int cx, int cy)=0;
virtual void draw_unscaled(Fl_Pixmap *pxm, float s, int XP, int YP, int WP, int HP, int cx, int cy) {}
virtual void draw(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy);
virtual void draw_unscaled(Fl_Bitmap *bm, float s, int XP, int YP, int WP, int HP, int cx, int cy)=0;
virtual void draw_unscaled(Fl_Bitmap *bm, float s, int XP, int YP, int WP, int HP, int cx, int cy) {}
virtual void draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy);
virtual void draw_unscaled(Fl_RGB_Image *img, float s, int XP, int YP, int WP, int HP, int cx, int cy)=0;
virtual void draw_unscaled(Fl_RGB_Image *img, float s, int XP, int YP, int WP, int HP, int cx, int cy) {}
virtual void draw(Fl_Shared_Image *shared, int X, int Y);
virtual void point(int x, int y);
virtual void point_unscaled(float x, float y) = 0;
virtual void point_unscaled(float x, float y) {}
virtual void rect(int x, int y, int w, int h);
virtual void rect_unscaled(float x, float y, float w, float h) = 0;
virtual void rect_unscaled(float x, float y, float w, float h) {}
virtual void rectf(int x, int y, int w, int h);
virtual void rectf_unscaled(float x, float y, float w, float h) = 0;
virtual void rectf_unscaled(float x, float y, float w, float h) {}
virtual void line(int x, int y, int x1, int y1);
virtual void line_unscaled(float x, float y, float x1, float y1) = 0;
virtual void line_unscaled(float x, float y, float x1, float y1) {}
virtual void line(int x, int y, int x1, int y1, int x2, int y2);
virtual void line_unscaled(float x, float y, float x1, float y1, float x2, float y2) = 0;
virtual void line_unscaled(float x, float y, float x1, float y1, float x2, float y2) {}
virtual void xyline(int x, int y, int x1);
virtual void xyline(int x, int y, int x1, int y2);
virtual void xyline(int x, int y, int x1, int y2, int x3);
virtual void xyline_unscaled(float x, float y, float x1)=0;
virtual void xyline_unscaled(float x, float y, float x1) {}
virtual void yxline(int x, int y, int y1);
virtual void yxline(int x, int y, int y1, int x2);
virtual void yxline(int x, int y, int y1, int x2, int y3);
virtual void yxline_unscaled(float x, float y, float y1)=0;
virtual void yxline_unscaled(float x, float y, float y1) {}
virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2);
virtual void loop_unscaled(float x0, float y0, float x1, float y1, float x2, float y2)=0;
virtual void loop_unscaled(float x0, float y0, float x1, float y1, float x2, float y2) {}
virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
virtual void loop_unscaled(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)=0;
virtual void loop_unscaled(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3) {}
virtual void polygon(int x0, int y0, int x1, int y1, int x2, int y2);
virtual void polygon_unscaled(float x0, float y0, float x1, float y1, float x2, float y2)=0;
virtual void polygon_unscaled(float x0, float y0, float x1, float y1, float x2, float y2) {}
virtual void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
virtual void polygon_unscaled(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)=0;
virtual void polygon_unscaled(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3) {}
virtual void circle(double x, double y, double r);
virtual void ellipse_unscaled(double xt, double yt, double rx, double ry)=0;
virtual void ellipse_unscaled(double xt, double yt, double rx, double ry) {}
virtual void font(Fl_Font face, Fl_Fontsize size);
virtual void font_unscaled(Fl_Font face, Fl_Fontsize size)=0;
virtual void font_unscaled(Fl_Font face, Fl_Fontsize size) {}
virtual double width(const char *str, int n);
virtual double width(unsigned int c);
virtual double width_unscaled(const char *str, int n)=0;
virtual double width_unscaled(unsigned int c)=0;
virtual double width_unscaled(const char *str, int n) { return 0.0; }
virtual double width_unscaled(unsigned int c) { return 0.0; }
virtual Fl_Fontsize size();
virtual Fl_Fontsize size_unscaled()=0;
virtual Fl_Fontsize size_unscaled() { return 0; }
virtual void text_extents(const char *str, int n, int &dx, int &dy, int &w, int &h);
virtual void text_extents_unscaled(const char *str, int n, int &dx, int &dy, int &w, int &h)=0;
virtual void text_extents_unscaled(const char *str, int n, int &dx, int &dy, int &w, int &h) {}
virtual int height();
virtual int descent();
virtual int height_unscaled()=0;
virtual int descent_unscaled()=0;
virtual int height_unscaled() { return 0; }
virtual int descent_unscaled() { return 0; }
virtual void draw(const char *str, int n, int x, int y);
virtual void draw_unscaled(const char *str, int n, int x, int y)=0;
virtual void draw_unscaled(const char *str, int n, int x, int y) {}
virtual void draw(int angle, const char *str, int n, int x, int y);
virtual void draw_unscaled(int angle, const char *str, int n, int x, int y)=0;
virtual void draw_unscaled(int angle, const char *str, int n, int x, int y) {}
virtual void rtl_draw(const char* str, int n, int x, int y);
virtual void rtl_draw_unscaled(const char* str, int n, int x, int y)=0;
virtual void rtl_draw_unscaled(const char* str, int n, int x, int y) {}
virtual void arc(int x, int y, int w, int h, double a1, double a2);
virtual void arc_unscaled(float x, float y, float w, float h, double a1, double a2)=0;
virtual void arc_unscaled(float x, float y, float w, float h, double a1, double a2) {}
virtual void pie(int x, int y, int w, int h, double a1, double a2);
virtual void pie_unscaled(float x, float y, float w, float h, double a1, double a2)=0;
virtual void pie_unscaled(float x, float y, float w, float h, double a1, double a2) {}
virtual void line_style(int style, int width=0, char* dashes=0);
virtual void line_style_unscaled(int style, float width, char* dashes)=0;
virtual void line_style_unscaled(int style, float width, char* dashes) {}
void draw_image_rescale(void *buf, Fl_Draw_Image_Cb cb, int X, int Y, int W, int H, int D, int L, bool mono, float s);
virtual void draw_image_unscaled(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0)=0;
virtual void draw_image_unscaled(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3)=0;
virtual void draw_image_unscaled(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0) {}
virtual void draw_image_unscaled(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3) {}
void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3);
virtual void draw_image_mono_unscaled(const uchar* buf, int x, int y, int w, int h, int d, int l)=0;
virtual void draw_image_mono_unscaled(const uchar* buf, int x, int y, int w, int h, int d, int l) {}
void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0);
virtual void draw_image_mono_unscaled(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1)=0;
virtual void draw_image_mono_unscaled(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1) {}
void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1);
void transformed_vertex(double xf, double yf);
virtual void transformed_vertex0(float x, float y)=0;
virtual void transformed_vertex0(float x, float y) {}
void vertex(double x, double y);
};
#endif // FL_DOXYGEN

View File

@ -70,37 +70,37 @@ public:
virtual void display(const char *disp);
virtual int visual(int flags);
// --- screen configuration
virtual void init() = 0;
virtual int x() = 0;
virtual int y() = 0;
virtual int w() = 0;
virtual int h() = 0;
virtual void init() {}
virtual int x() { return 0; }
virtual int y() { return 0; }
virtual int w() { return 800; } // default, override in driver!
virtual int h() { return 600; } // default, override in driver!
virtual int screen_count();
void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my);
virtual void screen_xywh(int &X, int &Y, int &W, int &H, int n) = 0;
virtual void screen_xywh(int &X, int &Y, int &W, int &H, int n) { X=0; Y=0; W=800; H=600; }
void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my, int mw, int mh);
virtual int screen_num(int x, int y);
virtual int screen_num(int x, int y, int w, int h);
virtual void screen_dpi(float &h, float &v, int n=0) = 0;
virtual void screen_dpi(float &h, float &v, int n=0) { h=72; v=72; } // override in driver!
void screen_work_area(int &X, int &Y, int &W, int &H, int mx, int my);
virtual void screen_work_area(int &X, int &Y, int &W, int &H, int n) = 0;
virtual void screen_work_area(int &X, int &Y, int &W, int &H, int n) { screen_xywh(X, Y, W, H, n); }
// --- audible output
virtual void beep(int type) = 0;
virtual void beep(int type) { }
// --- global events
virtual void flush() = 0;
virtual double wait(double time_to_wait) = 0;
virtual int ready() = 0;
virtual void grab(Fl_Window* win) = 0;
virtual void flush() { } // must override
virtual double wait(double time_to_wait) { return 0.0; } // must override
virtual int ready() { return 0; } // must override
virtual void grab(Fl_Window* win) { }
// --- global colors
/* the default implementation of parse_color() may be enough */
virtual int parse_color(const char* p, uchar& r, uchar& g, uchar& b);
virtual void get_system_colors() = 0;
virtual void get_system_colors() { }
virtual const char *get_system_scheme();
// --- global timers
virtual void add_timeout(double time, Fl_Timeout_Handler cb, void *argp) = 0;
virtual void repeat_timeout(double time, Fl_Timeout_Handler cb, void *argp) = 0;
virtual int has_timeout(Fl_Timeout_Handler cb, void *argp) = 0;
virtual void remove_timeout(Fl_Timeout_Handler cb, void *argp) = 0;
virtual void add_timeout(double time, Fl_Timeout_Handler cb, void *argp) { }
virtual void repeat_timeout(double time, Fl_Timeout_Handler cb, void *argp) { }
virtual int has_timeout(Fl_Timeout_Handler cb, void *argp) { return 0; }
virtual void remove_timeout(Fl_Timeout_Handler cb, void *argp) { }
static int secret_input_character;
/* Implement to indicate whether complex text input may involve marked text.

View File

@ -116,8 +116,8 @@ public:
void resize_after_scale_change(int ns, float old_f, float new_f);
// --- window data
virtual int decorated_w() = 0;
virtual int decorated_h() = 0;
virtual int decorated_w() { return w(); } // default, should be overidden by driver
virtual int decorated_h() { return h(); }
// --- window management
virtual void take_focus();

View File

@ -46,6 +46,7 @@ else ()
list(APPEND CPPFILES ExternalCodeEditor_UNIX.cxx)
endif (WIN32)
if(NOT ANDROID)
if(APPLE AND (NOT OPTION_APPLE_X11) AND (NOT OPTION_APPLE_SDL))
set( ICON_NAME fluid.icns )
set( ICON_PATH "${PROJECT_SOURCE_DIR}/fluid/Fluid.app/Contents/Resources/${ICON_NAME}" )
@ -53,6 +54,7 @@ if(APPLE AND (NOT OPTION_APPLE_X11) AND (NOT OPTION_APPLE_SDL))
else()
add_executable(fluid WIN32 ${CPPFILES})
endif(APPLE AND (NOT OPTION_APPLE_X11) AND (NOT OPTION_APPLE_SDL))
endif(NOT ANDROID)
target_link_libraries(fluid fltk fltk_images fltk_forms)

View File

@ -18,7 +18,7 @@
#include "../../config_lib.h"
#include "Fl_Android_Graphics_Driver.h"
#include "Fl_Android_Graphics_Driver.H"
#include <FL/Fl.H>
#include <FL/platform.H>
#include <errno.h>

View File

@ -373,7 +373,7 @@ int Fl_Widget::test_shortcut() {
return test_shortcut(label());
}
#if defined(FL_CFG_GFX_GDI) || defined(FL_PORTING)
#if defined(FL_CFG_GFX_GDI) || defined(FL_PORTING) || defined(__ANDROID__)
// This table must be in numeric order by fltk (X) keysym number:
Fl_System_Driver::Keyname Fl_System_Driver::table[] = {
{' ', "Space"},

View File

@ -39,6 +39,7 @@ include_directories(
)
#######################################################################
if(NOT ANDROID)
CREATE_EXAMPLE(adjuster adjuster.cxx fltk)
CREATE_EXAMPLE(arc arc.cxx fltk)
CREATE_EXAMPLE(animated animated.cxx fltk)
@ -126,6 +127,8 @@ if(FLTK_HAVE_CAIRO)
CREATE_EXAMPLE(cairo_test cairo_test.cxx "fltk;fltk_cairo")
endif(FLTK_HAVE_CAIRO)
endif(NOT ANDROID)
# We need some support files for the demo programs:
# Note: this is incomplete as of 11 Feb 2015