# build options OS := $(shell uname) # compile with GPROF # GPROF = 1 # build for build platform API = 14 APP_PLATFORM = android-$(API) ANDR_ROOT = $(shell pwd) PROJ_ROOT = $(shell realpath $(ANDR_ROOT)/../..) APP_ROOT = $(ANDR_ROOT)/src/main GAMES_TO_COPY = minetest_game MODS_TO_COPY = VERSION_MAJOR := $(shell cat $(PROJ_ROOT)/CMakeLists.txt | \ grep ^set\(VERSION_MAJOR\ | sed 's/)/ /' | cut -f2 -d' ') VERSION_MINOR := $(shell cat $(PROJ_ROOT)/CMakeLists.txt | \ grep ^set\(VERSION_MINOR\ | sed 's/)/ /' | cut -f2 -d' ') VERSION_PATCH := $(shell cat $(PROJ_ROOT)/CMakeLists.txt | \ grep ^set\(VERSION_PATCH\ | sed 's/)/ /' | cut -f2 -d' ') ################################################################################ # toolchain config for arm new processors ################################################################################ TARGET_HOST = arm-linux TARGET_ABI = armeabi-v7a TARGET_LIBDIR = armeabi-v7a TARGET_TOOLCHAIN = arm-linux-androideabi- TARGET_CFLAGS_ADDON = -mfloat-abi=softfp -mfpu=vfpv3 -O3 -D__ANDROID_API__=$(API) TARGET_CXXFLAGS_ADDON = $(TARGET_CFLAGS_ADDON) TARGET_ARCH = armv7 CROSS_PREFIX = arm-linux-androideabi- COMPILER_VERSION = 4.9 HAVE_LEVELDB = 0 ################################################################################ # toolchain config for little endian mips ################################################################################ #TARGET_HOST = mipsel-linux #TARGET_ABI = mips #TARGET_LIBDIR = mips #TARGET_TOOLCHAIN = mipsel-linux-android- #TARGET_ARCH = mips32 #CROSS_PREFIX = mipsel-linux-android- #COMPILER_VERSION = 4.9 #HAVE_LEVELDB = 0 ################################################################################ # toolchain config for x86 ################################################################################ #TARGET_HOST = x86-linux #TARGET_ABI = x86 #TARGET_LIBDIR = x86 #TARGET_TOOLCHAIN = x86- #CROSS_PREFIX = i686-linux-android- #TARGET_ARCH = x86 #COMPILER_VERSION = 4.9 #HAVE_LEVELDB = 0 ################################################################################ ASSETS_TIMESTAMP = deps/assets_timestamp LEVELDB_DIR = $(ANDR_ROOT)/deps/leveldb/ LEVELDB_LIB = $(LEVELDB_DIR)libleveldb.a LEVELDB_TIMESTAMP = $(LEVELDB_DIR)/timestamp LEVELDB_TIMESTAMP_INT = $(ANDR_ROOT)/deps/leveldb_timestamp LEVELDB_URL_GIT = https://github.com/google/leveldb LEVELDB_COMMIT = 2d0320a458d0e6a20fff46d5f80b18bfdcce7018 OPENAL_DIR = $(ANDR_ROOT)/deps/openal-soft/ OPENAL_LIB = $(OPENAL_DIR)libs/$(TARGET_ABI)/libopenal.so OPENAL_TIMESTAMP = $(OPENAL_DIR)/timestamp OPENAL_TIMESTAMP_INT = $(ANDR_ROOT)/deps/openal_timestamp OPENAL_URL_GIT = https://github.com/apportable/openal-soft OGG_DIR = $(ANDR_ROOT)/deps/libvorbis-libogg-android/ OGG_LIB = $(OGG_DIR)libs/$(TARGET_ABI)/libogg.so VORBIS_LIB = $(OGG_DIR)libs/$(TARGET_ABI)/libogg.so OGG_TIMESTAMP = $(OGG_DIR)timestamp OGG_TIMESTAMP_INT = $(ANDR_ROOT)/deps/ogg_timestamp OGG_URL_GIT = https://github.com/vincentjames501/libvorbis-libogg-android IRRLICHT_REVISION = 5145 IRRLICHT_DIR = $(ANDR_ROOT)/deps/irrlicht/ IRRLICHT_LIB = $(IRRLICHT_DIR)lib/Android/libIrrlicht.a IRRLICHT_TIMESTAMP = $(IRRLICHT_DIR)timestamp IRRLICHT_TIMESTAMP_INT = $(ANDR_ROOT)/deps/irrlicht_timestamp IRRLICHT_URL_SVN = https://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@$(IRRLICHT_REVISION) OPENSSL_VERSION = 1.0.2k OPENSSL_BASEDIR = openssl-$(OPENSSL_VERSION) OPENSSL_DIR = $(ANDR_ROOT)/deps/$(OPENSSL_BASEDIR)/ OPENSSL_LIB = $(OPENSSL_DIR)/libssl.so.1.0.0 OPENSSL_TIMESTAMP = $(OPENSSL_DIR)timestamp OPENSSL_TIMESTAMP_INT = $(ANDR_ROOT)/deps/openssl_timestamp OPENSSL_URL = https://www.openssl.org/source/openssl-$(OPENSSL_VERSION).tar.gz CURL_VERSION = 7.54.0 CURL_DIR = $(ANDR_ROOT)/deps/curl-$(CURL_VERSION) CURL_LIB = $(CURL_DIR)/lib/.libs/libcurl.a CURL_TIMESTAMP = $(CURL_DIR)/timestamp CURL_TIMESTAMP_INT = $(ANDR_ROOT)/deps/curl_timestamp CURL_URL_HTTP = https://curl.haxx.se/download/curl-${CURL_VERSION}.tar.bz2 GMP_VERSION = 6.1.2 GMP_DIR = $(ANDR_ROOT)/deps/gmp-$(GMP_VERSION) GMP_LIB = $(GMP_DIR)/usr/lib/libgmp.so GMP_TIMESTAMP = $(GMP_DIR)/timestamp GMP_TIMESTAMP_INT = $(ANDR_ROOT)/deps/gmp_timestamp GMP_URL_HTTP = https://gmplib.org/download/gmp/gmp-$(GMP_VERSION).tar.bz2 FREETYPE_DIR = $(ANDR_ROOT)/deps/freetype2-android/ FREETYPE_LIB = $(FREETYPE_DIR)/Android/obj/local/$(TARGET_ABI)/libfreetype2-static.a FREETYPE_TIMESTAMP = $(FREETYPE_DIR)timestamp FREETYPE_TIMESTAMP_INT = $(ANDR_ROOT)/deps/freetype_timestamp FREETYPE_URL_GIT = https://github.com/cdave1/freetype2-android ICONV_VERSION = 1.14 ICONV_DIR = $(ANDR_ROOT)/deps/libiconv/ ICONV_LIB = $(ICONV_DIR)/lib/.libs/libiconv.so ICONV_TIMESTAMP = $(ICONV_DIR)timestamp ICONV_TIMESTAMP_INT = $(ANDR_ROOT)/deps/iconv_timestamp ICONV_URL_HTTP = https://ftp.gnu.org/pub/gnu/libiconv/libiconv-$(ICONV_VERSION).tar.gz SQLITE3_FOLDER = sqlite-amalgamation-3180000 SQLITE3_URL = https://www.sqlite.org/2017/$(SQLITE3_FOLDER).zip ANDROID_SDK = $(shell grep '^sdk\.dir' local.properties | sed 's/^.*=[[:space:]]*//') ANDROID_NDK = $(shell grep '^ndk\.dir' local.properties | sed 's/^.*=[[:space:]]*//') #use interim target variable to switch leveldb on or off ifeq ($(HAVE_LEVELDB),1) LEVELDB_TARGET = $(LEVELDB_LIB) endif .PHONY : debug release reconfig delconfig \ leveldb_download clean_leveldb leveldb\ irrlicht_download clean_irrlicht irrlicht \ clean_assets assets sqlite3_download \ freetype_download clean_freetype freetype \ apk clean_apk \ clean_all clean prep_srcdir \ install_debug install_release envpaths all \ $(ASSETS_TIMESTAMP) $(LEVELDB_TIMESTAMP) \ $(OPENAL_TIMESTAMP) $(OGG_TIMESTAMP) \ $(IRRLICHT_TIMESTAMP) $(CURL_TIMESTAMP) \ $(OPENSSL_TIMESTAMP) \ $(ANDR_ROOT)/jni/src/android_version.h \ $(ANDR_ROOT)/jni/src/android_version_githash.h debug : local.properties export NDEBUG=; \ export BUILD_TYPE=debug; \ $(MAKE) apk all : debug release release : local.properties @export NDEBUG=1; \ export BUILD_TYPE=release; \ $(MAKE) apk reconfig: delconfig @$(MAKE) local.properties delconfig: $(RM) local.properties local.properties: @echo "Please specify path of ANDROID NDK"; \ echo "e.g. $$HOME/Android/ndk-r11c/"; \ read ANDROID_NDK ; \ if [ ! -d $$ANDROID_NDK ] ; then \ echo "$$ANDROID_NDK is not a valid folder"; \ exit 1; \ fi; \ echo "ndk.dir = $$ANDROID_NDK" > local.properties; \ echo "Please specify path of ANDROID SDK"; \ echo "e.g. $$HOME/Android/sdk/"; \ read SDKFLDR ; \ if [ ! -d $$SDKFLDR ] ; then \ echo "$$SDKFLDR is not a valid folder"; \ exit 1; \ fi; \ echo "sdk.dir = $$SDKFLDR" >> local.properties; $(OPENAL_TIMESTAMP) : openal_download @LAST_MODIF=$$(find ${OPENAL_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \ if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \ touch ${OPENAL_TIMESTAMP}; \ fi openal_download : @if [ ! -d ${OPENAL_DIR} ] ; then \ echo "openal sources missing, downloading..."; \ mkdir -p ${ANDR_ROOT}/deps; \ cd ${ANDR_ROOT}/deps ; \ git clone ${OPENAL_URL_GIT} || exit 1; \ fi openal : $(OPENAL_LIB) $(OPENAL_LIB): $(OPENAL_TIMESTAMP) + @REFRESH=0; \ if [ ! -e ${OPENAL_TIMESTAMP_INT} ] ; then \ REFRESH=1; \ fi; \ if [ ${OPENAL_TIMESTAMP} -nt ${OPENAL_TIMESTAMP_INT} ] ; then \ REFRESH=1; // Copyright (C) 2002-2013 Nikolaus Gebhardt // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h #ifndef __C_INTL_GUI_EDIT_BOX_H_INCLUDED__ #define __C_INTL_GUI_EDIT_BOX_H_INCLUDED__ #include "IrrCompileConfig.h" //#ifdef _IRR_COMPILE_WITH_GUI_ #include "IGUIEditBox.h" #include "irrArray.h" #include "IOSOperator.h" namespace irr { namespace gui { class intlGUIEditBox : public IGUIEditBox { public: //! constructor intlGUIEditBox(const wchar_t* text, bool border, IGUIEnvironment* environment, IGUIElement* parent, s32 id, const core::rect<s32>& rectangle); //! destructor virtual ~intlGUIEditBox(); //! Sets another skin independent font. virtual void setOverrideFont(IGUIFont* font=0); //! Gets the override font (if any) /** \return The override font (may be 0) */ virtual IGUIFont* getOverrideFont() const; //! Get the font which is used right now for drawing /** Currently this is the override font when one is set and the font of the active skin otherwise */ virtual IGUIFont* getActiveFont() const; //! Sets another color for the text. virtual void setOverrideColor(video::SColor color); //! Gets the override color virtual video::SColor getOverrideColor() const; //! Sets if the text should use the overide color or the //! color in the gui skin. virtual void enableOverrideColor(bool enable); //! Checks if an override color is enabled /** \return true if the override color is enabled, false otherwise */ virtual bool isOverrideColorEnabled(void) const; //! Sets whether to draw the background virtual void setDrawBackground(bool draw); //! Turns the border on or off virtual void setDrawBorder(bool border); //! Enables or disables word wrap for using the edit box as multiline text editor. virtual void setWordWrap(bool enable); //! Checks if word wrap is enabled //! \return true if word wrap is enabled, false otherwise virtual bool isWordWrapEnabled() const; //! Enables or disables newlines. /** \param enable: If set to true, the EGET_EDITBOX_ENTER event will not be fired, instead a newline character will be inserted. */ virtual void setMultiLine(bool enable); //! Checks if multi line editing is enabled //! \return true if mult-line is enabled, false otherwise virtual bool isMultiLineEnabled() const; //! Enables or disables automatic scrolling with cursor position //! \param enable: If set to true, the text will move around with the cursor position virtual void setAutoScroll(bool enable); //! Checks to see if automatic scrolling is enabled //! \return true if automatic scrolling is enabled, false if not virtual bool isAutoScrollEnabled() const; //! Gets the size area of the text in the edit box //! \return Returns the size in pixels of the text virtual core::dimension2du getTextDimension(); //! Sets text justification virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical); //! called if an event happened. virtual bool OnEvent(const SEvent& event); //! draws the element and its children virtual void draw(); //! Sets the new caption of this element. virtual void setText(const wchar_t* text); //! Sets the maximum amount of characters which may be entered in the box. //! \param max: Maximum amount of characters. If 0, the character amount is //! infinity. virtual void setMax(u32 max); //! Returns maximum amount of characters, previously set by setMax(); virtual u32 getMax() const; //! Sets whether the edit box is a password box. Setting this to true will /** disable MultiLine, WordWrap and the ability to copy with ctrl+c or ctrl+x \param passwordBox: true to enable password, false to disable \param passwordChar: the character that is displayed instead of letters */ virtual void setPasswordBox(bool passwordBox, wchar_t passwordChar = L'*'); //! Returns true if the edit box is currently a password box. virtual bool isPasswordBox() const; //! Updates the absolute position, splits text if required virtual void updateAbsolutePosition(); //! Writes attributes of the element. virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const; //! Reads attributes of the element virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options); protected: //! Breaks the single text line. void breakText(); //! sets the area of the given line void setTextRect(s32 line); //! returns the line number that the cursor is on s32 getLineFromPos(s32 pos); //! adds a letter to the edit box void inputChar(wchar_t c); //! calculates the current scroll position void calculateScrollPos(); //! send some gui event to parent void sendGuiEvent(EGUI_EVENT_TYPE type); //! set text markers void setTextMarkers(s32 begin, s32 end); bool processKey(const SEvent& event); bool processMouse(const SEvent& event); s32 getCursorPos(s32 x, s32 y); bool MouseMarking; bool Border; bool OverrideColorEnabled; s32 MarkBegin; s32 MarkEnd; video::SColor OverrideColor; gui::IGUIFont *OverrideFont, *LastBreakFont; IOSOperator* Operator; u32 BlinkStartTime; s32 CursorPos; s32 HScrollPos, VScrollPos; // scroll position in characters u32 Max; bool WordWrap, MultiLine, AutoScroll, PasswordBox; wchar_t PasswordChar; EGUI_ALIGNMENT HAlign, VAlign; core::array< core::stringw > BrokenText; core::array< s32 > BrokenTextPositions; core::rect<s32> CurrentTextRect, FrameRect; // temporary values }; } // end namespace gui } // end namespace irr //#endif // _IRR_COMPILE_WITH_GUI_ #endif // __C_GUI_EDIT_BOX_H_INCLUDED__