summaryrefslogtreecommitdiff
path: root/Android
diff options
context:
space:
mode:
Diffstat (limited to 'Android')
-rw-r--r--Android/FL/abi-version.h31
-rwxr-xr-xAndroid/adb-run.sh5
-rw-r--r--Android/config.h371
-rw-r--r--Android/jni/Android.mk178
-rwxr-xr-xAndroid/mk7
5 files changed, 589 insertions, 3 deletions
diff --git a/Android/FL/abi-version.h b/Android/FL/abi-version.h
new file mode 100644
index 000000000..0379081bb
--- /dev/null
+++ b/Android/FL/abi-version.h
@@ -0,0 +1,31 @@
+/*
+ * "$Id: abi-version.cmake.in 10788 2015-07-13 18:17:33Z 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.cmake.in 10788 2015-07-13 18:17:33Z AlbrechtS $".
+ */
diff --git a/Android/adb-run.sh b/Android/adb-run.sh
new file mode 100755
index 000000000..e28064e89
--- /dev/null
+++ b/Android/adb-run.sh
@@ -0,0 +1,5 @@
+PATH=$(dirname $(which android))/../build-tools/21.1.1:$PATH
+pkg=$(aapt dump badging $1|awk -F" " '/package/ {print $2}'|awk -F"'" '/name=/ {print $2}')
+act=$(aapt dump badging $1|awk -F" " '/launchable-activity/ {print $2}'|awk -F"'" '/name=/ {print $2}')
+adb shell am start -n $pkg/$act
+
diff --git a/Android/config.h b/Android/config.h
new file mode 100644
index 000000000..97133f88c
--- /dev/null
+++ b/Android/config.h
@@ -0,0 +1,371 @@
+/* config.h. Generated from configh.cmake.in by CMake. */
+/*
+ * "$Id: configh.cmake.in 11262 2016-03-02 00:54:37Z matt $"
+ *
+ * Configuration file for the Fast Light Tool Kit (FLTK).
+ *
+ * Copyright 1998-2016 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
+ */
+
+/*
+ * Where to find files...
+ */
+
+#define FLTK_DATADIR "/usr/local/share/fltk"
+#define FLTK_DOCDIR "/usr/local/share/doc/fltk"
+
+/*
+ * BORDER_WIDTH:
+ *
+ * Thickness of FL_UP_BOX and FL_DOWN_BOX. Current 1,2, and 3 are
+ * supported.
+ *
+ * 3 is the historic FLTK look.
+ * 2 is the default and looks like Microsoft Windows, KDE, and Qt.
+ * 1 is a plausible future evolution...
+ *
+ * Note that this may be simulated at runtime by redefining the boxtypes
+ * using Fl::set_boxtype().
+ */
+
+#define BORDER_WIDTH 2
+
+/*
+ * HAVE_GL:
+ *
+ * Do you have OpenGL? Set this to 0 if you don't have or plan to use
+ * OpenGL, and FLTK will be smaller.
+ */
+
+#undef HAVE_GL
+
+/*
+ * HAVE_GL_GLU_H:
+ *
+ * Do you have the OpenGL Utility Library header file?
+ * (many broken Mesa RPMs do not...)
+ */
+
+#undef HAVE_GL_GLU_H
+
+/*
+ * HAVE_GLXGETPROCADDRESSARB:
+ *
+ * Do you have the OpenGL glXGetProcAddressARB() function?
+ */
+
+/* #undef HAVE_GLXGETPROCADDRESSARB */
+
+/*
+ * USE_COLORMAP:
+ *
+ * Setting this to zero will save a good deal of code (especially for
+ * fl_draw_image), but FLTK will only work on TrueColor visuals.
+ */
+
+#define USE_COLORMAP 1
+
+/*
+ * HAVE_XINERAMA
+ *
+ * Do we have the Xinerama library to support multi-head displays?
+ */
+
+#define HAVE_XINERAMA 0
+
+/*
+ * USE_XFT
+ *
+ * Use the new Xft library to draw anti-aliased text.
+ */
+
+#define USE_XFT 0
+
+/*
+ * HAVE_XDBE:
+ *
+ * Do we have the X double-buffer extension?
+ */
+
+#define HAVE_XDBE 0
+
+/*
+ * USE_XDBE:
+ *
+ * Actually try to use the double-buffer extension?
+ */
+
+#define USE_XDBE HAVE_XDBE
+
+/*
+ * HAVE_XFIXES:
+ *
+ * Do we have the X fixes extension?
+ */
+
+#define HAVE_XFIXES 0
+
+/*
+ * HAVE_XCURSOR:
+ *
+ * Do we have the X cursor library?
+ */
+
+#define HAVE_XCURSOR 0
+
+/*
+ * HAVE_XRENDER:
+ *
+ * Do we have the X render library?
+ */
+
+#define HAVE_XRENDER 0
+
+/*
+ * HAVE_X11_XREGION_H:
+ *
+ * Do we have the X11 Xregion.h header file ?
+ */
+
+#define HAVE_X11_XREGION_H 1
+
+/*
+ * __APPLE_QUARTZ__:
+ *
+ * All Apple implementations are now based on Quartz and Cocoa,
+ * so this flag should always be on for Mac OS X. This flag has
+ * no meaning on operating systems other than Mac OS X.
+ */
+
+/* #undef __APPLE_QUARTZ__ */
+
+
+/*
+ * USE_X11
+ *
+ * Should we use X11 for the current platform
+ *
+ */
+
+/* #undef USE_X11 */
+
+/*
+ * USE_SDL
+ *
+ * Should we use SDL for the current platform
+ *
+ */
+
+//#define USE_SDL 1
+
+/*
+ * FL_PORTING
+ *
+ * A little helper that points to locations in the core that still need to be ported to
+ * the core driver setup.
+ */
+
+#define FL_PORTING 1
+
+/*
+ * HAVE_OVERLAY:
+ *
+ * Use the X overlay extension? FLTK will try to use an overlay
+ * visual for Fl_Overlay_Window, the Gl_Window overlay, and for the
+ * menus. Setting this to zero will remove a substantial amount of
+ * code from FLTK. Overlays have only been tested on SGI servers!
+ */
+
+#define HAVE_OVERLAY 0
+
+/*
+ * HAVE_GL_OVERLAY:
+ *
+ * It is possible your GL has an overlay even if X does not. If so,
+ * set this to 1.
+ */
+
+#define HAVE_GL_OVERLAY HAVE_OVERLAY
+
+/*
+ * WORDS_BIGENDIAN:
+ *
+ * Byte order of your machine: 1 = big-endian, 0 = little-endian.
+ */
+
+#ifdef __APPLE__
+#include <mac_endianness.h>
+#else
+#define WORDS_BIGENDIAN 0
+#endif
+
+/*
+ * U16, U32, U64:
+ *
+ * Types used by fl_draw_image. One of U32 or U64 must be defined.
+ * U16 is optional but FLTK will work better with it!
+ */
+
+#define U16 unsigned short
+#define U32 unsigned
+#define U64 unsigned long
+
+/*
+ * HAVE_DIRENT_H, HAVE_SYS_NDIR_H, HAVE_SYS_DIR_H, HAVE_NDIR_H,
+ * HAVE_SCANDIR, HAVE_SCANDIR_POSIX:
+ *
+ * Where is <dirent.h> (used only by fl_file_chooser and scandir).
+ */
+
+#define HAVE_DIRENT_H 1
+/* #undef HAVE_SYS_NDIR_H */
+/* #undef HAVE_SYS_DIR_H */
+/* #undef HAVE_NDIR_H */
+#define HAVE_SCANDIR 1
+#define HAVE_SCANDIR_POSIX 1
+
+/*
+ * Possibly missing sprintf-style functions:
+ */
+
+#define HAVE_VSNPRINTF 1
+#define HAVE_SNPRINTF 1
+
+/*
+ * String functions and headers...
+ */
+
+#define HAVE_STRINGS_H 1
+#define HAVE_STRCASECMP 1
+#define HAVE_STRLCAT 1
+#define HAVE_STRLCPY 1
+
+/*
+ * Do we have POSIX locale support?
+ */
+
+#define HAVE_LOCALE_H 1
+#define HAVE_LOCALECONV 1
+
+/*
+ * HAVE_SYS_SELECT_H:
+ *
+ * Whether or not select() call has its own header file.
+ */
+
+#define HAVE_SYS_SELECT_H 1
+
+/*
+ * HAVE_SYS_STDTYPES_H:
+ *
+ * Whether or not we have the <sys/stdtypes.h> header file.
+ */
+
+/* #undef HAVE_SYS_STDTYPES_H */
+
+/*
+ * USE_POLL:
+ *
+ * Use the poll() call provided on Linux and Irix instead of select()
+ */
+
+#define USE_POLL 0
+
+/*
+ * Do we have various image libraries?
+ */
+
+#define HAVE_LIBPNG 1
+#define HAVE_LIBZ 1
+#define HAVE_LIBJPEG 1
+
+/*
+ * FLTK_USE_CAIRO
+ *
+ * Do we have the cairo library available and want extended cairo use in FLTK ?
+ * This implies to link cairo.lib in all FLTK based apps.
+ */
+
+/* #undef FLTK_USE_CAIRO */
+
+/*
+ * FLTK_HAVE_CAIRO
+ *
+ * Do we have the cairo library available?
+ */
+
+/* #undef FLTK_HAVE_CAIRO */
+
+/*
+ * Which header file do we include for libpng?
+ */
+
+#define HAVE_PNG_H 1
+/* #undef HAVE_LIBPNG_PNG_H */
+
+/*
+ * Do we have the png_xyz() functions?
+ */
+
+#define HAVE_PNG_GET_VALID 1
+#define HAVE_PNG_SET_TRNS_TO_ALPHA 1
+
+/*
+ * Do we have POSIX threading?
+ */
+
+#define HAVE_PTHREAD 1
+#define HAVE_PTHREAD_H 1
+
+/*
+ * Do we have the ALSA library?
+ */
+
+/* #undef HAVE_ALSA_ASOUNDLIB_H */
+
+/*
+ * Do we have the long long type?
+ */
+
+#define HAVE_LONG_LONG 1
+
+#ifdef HAVE_LONG_LONG
+# define FLTK_LLFMT "%lld"
+# define FLTK_LLCAST (long long)
+#else
+# define FLTK_LLFMT "%ld"
+# define FLTK_LLCAST (long)
+#endif /* HAVE_LONG_LONG */
+
+/*
+ * Do we have the dlsym() function and header?
+ */
+
+#define HAVE_DLFCN_H 1
+#define HAVE_DLSYM 1
+
+/*
+ * Do we want print support?
+ */
+
+/* #undef NO_PRINT_SUPPORT */
+
+/*
+ * Do we want filename handling and a filechooser?
+ */
+
+/* #undef FL_CFG_NO_FILESYSTEM_SUPPORT */
+
+/*
+ * End of "$Id: configh.cmake.in 11262 2016-03-02 00:54:37Z matt $".
+ */
diff --git a/Android/jni/Android.mk b/Android/jni/Android.mk
index 9e64d8042..b42a34894 100644
--- a/Android/jni/Android.mk
+++ b/Android/jni/Android.mk
@@ -12,15 +12,187 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-LOCAL_PATH := $(call my-dir)
+TOP_PATH := $(call my-dir)/../..
+
+#################
+## FLTK library
include $(CLEAR_VARS)
+LOCAL_PATH += $(TOP_PATH)/Android
+LOCAL_PATH += $(TOP_PATH)
+LOCAL_MODULE := native-activity
+LOCAL_C_INCLUDES := $(TOP_PATH)
+
+LOCAL_SRC_FILES := \
+ src/Fl.cxx \
+ src/Fl_Adjuster.cxx \
+ src/Fl_Bitmap.cxx \
+ src/Fl_Browser.cxx \
+ src/Fl_Browser_.cxx \
+ src/Fl_Browser_load.cxx \
+ src/Fl_Box.cxx \
+ src/Fl_Button.cxx \
+ src/Fl_Chart.cxx \
+ src/Fl_Check_Browser.cxx \
+ src/Fl_Check_Button.cxx \
+ src/Fl_Choice.cxx \
+ src/Fl_Clock.cxx \
+ src/Fl_Color_Chooser.cxx \
+ src/Fl_Copy_Surface.cxx \
+ src/Fl_Counter.cxx \
+ src/Fl_Device.cxx \
+ src/Fl_Dial.cxx \
+ src/Fl_Help_Dialog_Dox.cxx \
+ src/Fl_Double_Window.cxx \
+ src/Fl_File_Browser.cxx \
+ src/Fl_File_Chooser.cxx \
+ src/Fl_File_Chooser2.cxx \
+ src/Fl_File_Icon.cxx \
+ src/Fl_File_Input.cxx \
+ src/Fl_Graphics_Driver.cxx \
+ src/Fl_Group.cxx \
+ src/Fl_Help_View.cxx \
+ src/Fl_Image.cxx \
+ src/Fl_Image_Surface.cxx \
+ src/Fl_Input.cxx \
+ src/Fl_Input_.cxx \
+ src/Fl_Light_Button.cxx \
+ src/Fl_Menu.cxx \
+ src/Fl_Menu_.cxx \
+ src/Fl_Menu_Bar.cxx \
+ src/Fl_Menu_Button.cxx \
+ src/Fl_Menu_Window.cxx \
+ src/Fl_Menu_add.cxx \
+ src/Fl_Menu_global.cxx \
+ src/Fl_Multi_Label.cxx \
+ src/Fl_Native_File_Chooser.cxx \
+ src/Fl_Overlay_Window.cxx \
+ src/Fl_Pack.cxx \
+ src/Fl_Paged_Device.cxx \
+ src/Fl_Pixmap.cxx \
+ src/Fl_Positioner.cxx \
+ src/Fl_Preferences.cxx \
+ src/Fl_Printer.cxx \
+ src/Fl_Progress.cxx \
+ src/Fl_Repeat_Button.cxx \
+ src/Fl_Return_Button.cxx \
+ src/Fl_Roller.cxx \
+ src/Fl_Round_Button.cxx \
+ src/Fl_Screen_Driver.cxx \
+ src/Fl_Scroll.cxx \
+ src/Fl_Scrollbar.cxx \
+ src/Fl_Shared_Image.cxx \
+ src/Fl_Single_Window.cxx \
+ src/Fl_Slider.cxx \
+ src/Fl_Table.cxx \
+ src/Fl_Table_Row.cxx \
+ src/Fl_Tabs.cxx \
+ src/Fl_Text_Buffer.cxx \
+ src/Fl_Text_Display.cxx \
+ src/Fl_Text_Editor.cxx \
+ src/Fl_Tile.cxx \
+ src/Fl_Tiled_Image.cxx \
+ src/Fl_Tooltip.cxx \
+ src/Fl_Tree.cxx \
+ src/Fl_Tree_Item_Array.cxx \
+ src/Fl_Tree_Item.cxx \
+ src/Fl_Tree_Prefs.cxx \
+ src/Fl_Valuator.cxx \
+ src/Fl_Value_Input.cxx \
+ src/Fl_Value_Output.cxx \
+ src/Fl_Value_Slider.cxx \
+ src/Fl_Widget.cxx \
+ src/Fl_Widget_Surface.cxx \
+ src/Fl_Window.cxx \
+ src/Fl_Window_Driver.cxx \
+ src/Fl_Window_fullscreen.cxx \
+ src/Fl_Window_hotspot.cxx \
+ src/Fl_Window_iconize.cxx \
+ src/Fl_Window_shape.cxx \
+ src/Fl_Wizard.cxx \
+ src/Fl_XBM_Image.cxx \
+ src/Fl_XPM_Image.cxx \
+ src/Fl_abort.cxx \
+ src/Fl_add_idle.cxx \
+ src/Fl_arg.cxx \
+ src/Fl_compose.cxx \
+ src/Fl_display.cxx \
+ src/Fl_get_key.cxx \
+ src/Fl_get_system_colors.cxx \
+ src/Fl_grab.cxx \
+ src/Fl_lock.cxx \
+ src/Fl_own_colormap.cxx \
+ src/Fl_visual.cxx \
+ src/Fl_x.cxx \
+ src/filename_absolute.cxx \
+ src/filename_expand.cxx \
+ src/filename_ext.cxx \
+ src/filename_isdir.cxx \
+ src/filename_list.cxx \
+ src/filename_match.cxx \
+ src/filename_setext.cxx \
+ src/fl_arc.cxx \
+ src/fl_ask.cxx \
+ src/fl_boxtype.cxx \
+ src/fl_color.cxx \
+ src/fl_cursor.cxx \
+ src/fl_curve.cxx \
+ src/fl_diamond_box.cxx \
+ src/fl_dnd.cxx \
+ src/fl_draw.cxx \
+ src/fl_draw_pixmap.cxx \
+ src/fl_engraved_label.cxx \
+ src/fl_file_dir.cxx \
+ src/fl_font.cxx \
+ src/fl_gleam.cxx \
+ src/fl_gtk.cxx \
+ src/fl_labeltype.cxx \
+ src/fl_line_style.cxx \
+ src/fl_open_uri.cxx \
+ src/fl_oval_box.cxx \
+ src/fl_overlay.cxx \
+ src/fl_overlay_visual.cxx \
+ src/fl_plastic.cxx \
+ src/fl_read_image.cxx \
+ src/fl_rect.cxx \
+ src/fl_round_box.cxx \
+ src/fl_rounded_box.cxx \
+ src/fl_set_font.cxx \
+ src/fl_scroll_area.cxx \
+ src/fl_shadow_box.cxx \
+ src/fl_shortcut.cxx \
+ src/fl_show_colormap.cxx \
+ src/fl_symbols.cxx \
+ src/fl_vertex.cxx \
+ src/screen_xywh.cxx \
+ src/fl_utf8.cxx \
+ src/fl_encoding_latin1.cxx \
+ src/fl_encoding_mac_roman.cxx \
+ src/drivers/Pico/Fl_Pico_System_Driver.cxx \
+ src/drivers/Pico/Fl_Pico_Screen_Driver.cxx \
+ src/drivers/Pico/Fl_Pico_Window_Driver.cxx \
+ src/drivers/Pico/Fl_Pico_Graphics_Driver.cxx \
+ src/drivers/Pico/Fl_Pico_Copy_Surface.cxx \
+ src/drivers/Pico/Fl_Pico_Image_Surface.cxx \
+ src/drivers/PicoAndroid/Fl_PicoAndroid_System_Driver.cxx \
+ src/drivers/PicoAndroid/Fl_PicoAndroid_Screen_Driver.cxx \
+ src/drivers/PicoAndroid/Fl_PicoAndroid_Window_Driver.cxx \
+ src/drivers/PicoAndroid/Fl_PicoAndroid_Graphics_Driver.cxx \
+ src/drivers/PicoAndroid/Fl_PicoAndroid_Copy_Surface.cxx \
+ src/drivers/PicoAndroid/Fl_PicoAndroid_Image_Surface.cxx \
+ test/hello.cxx
+
+#Android/jni/main.c
+
+
+LOCAL_CFLAGS := -DFL_PORTING -DANDROID -DFL_PICO_ANDROID -DFL_LIBRARY
-LOCAL_MODULE := native-activity
-LOCAL_SRC_FILES := main.c
LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv1_CM
LOCAL_STATIC_LIBRARIES := android_native_app_glue
include $(BUILD_SHARED_LIBRARY)
+
+
+
$(call import-module,android/native_app_glue)
diff --git a/Android/mk b/Android/mk
new file mode 100755
index 000000000..c921c69d7
--- /dev/null
+++ b/Android/mk
@@ -0,0 +1,7 @@
+
+ndk-build
+android update project --path . --name native
+ant debug
+adb install -r bin/native-debug.apk
+./adb-run.sh bin/native-debug.apk
+adb logcat | grep native-activity