Fixed Android build.

Minor fixes.
ecode: moved modules files.
This commit is contained in:
Martín Lucas Golini
2022-04-18 02:51:15 -03:00
parent d17ddef3f2
commit 5647f7a4bd
21 changed files with 1870 additions and 1855 deletions

View File

@@ -138,7 +138,7 @@
#define EE_LITTLE_ENDIAN 1
#define EE_BIG_ENDIAN 2
#if EE_PLATFORM == EE_PLATFORM_EMSCRIPTEN
#if EE_PLATFORM == EE_PLATFORM_EMSCRIPTEN || EE_PLATFORM == EE_PLATFORM_ANDROID
#define EE_ENDIAN EE_LITTLE_ENDIAN
#endif

View File

@@ -1107,7 +1107,7 @@ solution "eepp"
project "ecode"
set_kind()
language "C++"
files { "src/tools/ecode/*.cpp" }
files { "src/tools/ecode/**.cpp" }
includedirs { "src/thirdparty/efsw/include", "src/thirdparty" }
links { "efsw-static" }
if not os.is("windows") and not os.is("haiku") then

View File

@@ -858,7 +858,7 @@ workspace "eepp"
project "ecode"
set_kind()
language "C++"
files { "src/tools/ecode/*.cpp" }
files { "src/tools/ecode/**.cpp" }
incdirs { "src/thirdparty/efsw/include", "src/thirdparty" }
links { "efsw-static" }
build_link_configuration( "ecode", true )

View File

@@ -13,16 +13,16 @@ def getProcessesCountArg() {
}
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.ensoft.eepp"
minSdkVersion 14
targetSdkVersion 28
targetSdkVersion 30
versionCode 1
versionName "1.0"
ndk {
abiFilters 'x86', 'armeabi-v7a'
abiFilters 'arm64-v8a', 'x86_64'
}
externalNativeBuild {
ndkBuild {

View File

@@ -59,7 +59,7 @@ LOCAL_CFLAGS := $(EEPP_C_FLAGS)
LOCAL_C_INCLUDES := $(EEPP_C_INCLUDES)
CORE_SRCS := test/*.cpp
CORE_SRCS := tests/test_all/*.cpp
LOCAL_SRC_FILES := $(SDL_MAIN_PATH) $(foreach F, $(CORE_SRCS), $(addprefix $(dir $(F)),$(notdir $(wildcard $(LOCAL_PATH)/$(F)))))

View File

@@ -9,6 +9,7 @@ SDL_MAIN_PATH := $(SDL_PATH)/src/main/android/*.c
EEPP_C_INCLUDES := \
$(EEPP_THIRD_PARTY_PATH) \
$(EEPP_THIRD_PARTY_PATH)/freetype2/include \
$(EEPP_THIRD_PARTY_PATH)/libpng \
$(SDL_PATH)/include \
$(EEPP_THIRD_PARTY_PATH)/chipmunk \
$(EEPP_INC_PATH)/eepp/thirdparty \
@@ -92,7 +93,7 @@ LOCAL_C_INCLUDES := $(EEPP_C_INCLUDES)
LOCAL_SRC_FILES := $(foreach F, $(CODE_SRCS), $(addprefix $(dir $(F)),$(notdir $(wildcard $(LOCAL_PATH)/$(F)))))
LOCAL_STATIC_LIBRARIES := chipmunk freetype
LOCAL_STATIC_LIBRARIES := chipmunk freetype libpng
LOCAL_SHARED_LIBRARIES := SDL2
@@ -133,7 +134,7 @@ LOCAL_MODULE := freetype
APP_SUBDIRS := $(patsubst $(LOCAL_PATH)/%, %, $(shell find $(LOCAL_PATH)/src -type d))
LOCAL_C_INCLUDES := $(foreach D, $(APP_SUBDIRS), $(LOCAL_PATH)/$(D)) $(LOCAL_PATH)/include
LOCAL_C_INCLUDES := $(foreach D, $(APP_SUBDIRS), $(LOCAL_PATH)/$(D)) $(LOCAL_PATH)/include $(EEPP_THIRD_PARTY_PATH)/libpng
LOCAL_CFLAGS := -Os -DFT2_BUILD_LIBRARY
LOCAL_SRC_FILES += $(foreach F, $(APP_SUBDIRS), $(addprefix $(F)/,$(notdir $(wildcard $(LOCAL_PATH)/$(F)/*.c))))
@@ -141,6 +142,28 @@ LOCAL_SRC_FILES += $(foreach F, $(APP_SUBDIRS), $(addprefix $(F)/,$(notdir $(w
include $(BUILD_STATIC_LIBRARY)
#*************** FREETYPE ***************
#*************** LIBPNG ***************
include $(CLEAR_VARS)
LOCAL_PATH := $(EEPP_THIRD_PARTY_PATH)
LOCAL_MODULE := libpng
LIBPNG_SRCS := \
libpng/*.c \
libpng/arm/*.c \
libpng/intel/*.c \
libpng/mips/*.c \
libpng/powerpc/*.c
LOCAL_C_INCLUDES := $(LOCAL_PATH)/libpng/
LOCAL_CFLAGS := -Os
LOCAL_SRC_FILES := $(foreach F, $(LIBPNG_SRCS), $(addprefix $(dir $(F)),$(notdir $(wildcard $(LOCAL_PATH)/$(F)))))
include $(BUILD_STATIC_LIBRARY)
#*************** LIBPNG ***************
#**************** SDL 2 ***************
include $(CLEAR_VARS)

View File

@@ -6,10 +6,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:7.1.2'
}
}

View File

@@ -1,6 +1,6 @@
#Sun Nov 26 15:24:16 ART 2017
#Thu Mar 10 11:21:14 ART 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
zipStoreBase=GRADLE_USER_HOME

View File

@@ -1098,8 +1098,6 @@
../../src/thirdparty/efsw/src/test/efsw-test.cpp
../../src/tools/ecode/appconfig.cpp
../../src/tools/ecode/appconfig.hpp
../../src/tools/ecode/autocompletemodule.cpp
../../src/tools/ecode/autocompletemodule.hpp
../../src/tools/ecode/ecode.cpp
../../src/tools/ecode/ecode.hpp
../../src/tools/ecode/docsearchcontroller.cpp
@@ -1108,14 +1106,16 @@
../../src/tools/ecode/filelocator.hpp
../../src/tools/ecode/filesystemlistener.cpp
../../src/tools/ecode/filesystemlistener.hpp
../../src/tools/ecode/formattermodule.cpp
../../src/tools/ecode/formattermodule.hpp
../../src/tools/ecode/globalsearchcontroller.cpp
../../src/tools/ecode/globalsearchcontroller.hpp
../../src/tools/ecode/ignorematcher.cpp
../../src/tools/ecode/ignorematcher.hpp
../../src/tools/ecode/lintermodule.cpp
../../src/tools/ecode/lintermodule.hpp
../../src/tools/ecode/modules/autocomplete/autocompletemodule.cpp
../../src/tools/ecode/modules/autocomplete/autocompletemodule.hpp
../../src/tools/ecode/modules/formatter/formattermodule.cpp
../../src/tools/ecode/modules/formatter/formattermodule.hpp
../../src/tools/ecode/modules/linter/lintermodule.cpp
../../src/tools/ecode/modules/linter/lintermodule.hpp
../../src/tools/ecode/notificationcenter.cpp
../../src/tools/ecode/notificationcenter.hpp
../../src/tools/ecode/projectdirectorytree.cpp

View File

@@ -33,7 +33,7 @@ void eeREPORT_ASSERT( const char* File, int Line, const char* Exp ) {
printf( "ASSERT: %s file:%s line:%d", Exp, File, Line );
}
#if defined( EE_COMPILER_GCC ) && !defined( EE_ARM ) && EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN
#if defined( EE_COMPILER_GCC ) && !defined( EE_ARM ) && EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN && EE_PLATFORM != EE_PLATFORM_ANDROID && EE_PLATFORM != EE_PLATFORM_IOS
asm( "int3" );
#else
assert( false );

File diff suppressed because it is too large Load Diff

View File

@@ -1028,27 +1028,29 @@ Uint32 UICodeEditor::onMouseMove( const Vector2i& position, const Uint32& flags
if ( module->onMouseMove( this, position, flags ) )
return UIWidget::onMouseMove( position, flags );
bool minimapHover = false;
if ( mMinimapEnabled ) {
updateMipmapHover( position.asFloat() );
Rectf rect( getMinimapRect( getScreenStart() ) );
if ( mMinimapDragging && ( flags & EE_BUTTON_LMASK ) ) {
scrollTo( { calculateMinimapClickedLine( position ) - mMinimapScrollOffset, 0 }, false,
true );
getUISceneNode()->setCursor( Cursor::Arrow );
return 1;
}
if ( ( flags & EE_BUTTON_LMASK ) && rect.contains( position.asFloat() ) )
minimapHover = getMinimapRect( getScreenStart() ).contains( position.asFloat() );
if ( ( flags & EE_BUTTON_LMASK ) && minimapHover )
return 1;
}
if ( isTextSelectionEnabled() && !getUISceneNode()->getEventDispatcher()->isNodeDragging() &&
NULL != mFont && mMouseDown && ( flags & EE_BUTTON_LMASK ) ) {
if ( !minimapHover && isTextSelectionEnabled() &&
!getUISceneNode()->getEventDispatcher()->isNodeDragging() && NULL != mFont && mMouseDown &&
( flags & EE_BUTTON_LMASK ) ) {
TextRange selection = mDoc->getSelection();
selection.setStart( resolveScreenPosition( position.asFloat() ) );
mDoc->setSelection( selection );
}
if ( mMinimapEnabled && getMinimapRect( getScreenStart() ).contains( position.asFloat() ) ) {
if ( minimapHover ) {
getUISceneNode()->setCursor( Cursor::Arrow );
} else {
checkMouseOverColor( position );
@@ -1067,6 +1069,9 @@ Uint32 UICodeEditor::onMouseUp( const Vector2i& position, const Uint32& flags )
if ( NULL == mFont )
return UIWidget::onMouseUp( position, flags );
bool minimapHover =
mMinimapEnabled && getMinimapRect( getScreenStart() ).contains( position.asFloat() );
if ( flags & EE_BUTTON_LMASK ) {
if ( mMinimapDragging ) {
mMinimapDragging = false;
@@ -1079,7 +1084,9 @@ Uint32 UICodeEditor::onMouseUp( const Vector2i& position, const Uint32& flags )
mMouseDown = false;
getUISceneNode()->getWindow()->getInput()->captureMouse( false );
}
} else if ( flags & EE_BUTTON_WDMASK ) {
}
if ( flags & EE_BUTTON_WDMASK ) {
if ( getUISceneNode()->getWindow()->getInput()->isControlPressed() ) {
mDoc->execute( "font-size-shrink" );
} else {
@@ -1097,9 +1104,10 @@ Uint32 UICodeEditor::onMouseUp( const Vector2i& position, const Uint32& flags )
setScrollX( mScroll.x + PixelDensity::dpToPx( mMouseWheelScroll ) );
} else if ( flags & EE_BUTTON_WLMASK ) {
setScrollX( mScroll.x - PixelDensity::dpToPx( mMouseWheelScroll ) );
} else if ( ( flags & EE_BUTTON_RMASK ) ) {
} else if ( !minimapHover && ( flags & EE_BUTTON_RMASK ) ) {
onCreateContextMenu( position, flags );
}
return UIWidget::onMouseUp( position, flags );
}

View File

@@ -291,6 +291,8 @@ void InputSDL::sendEvent( const SDL_Event& SDLEvent ) {
button = EE_BUTTON_WHEELRIGHT;
} else if ( SDLEvent.wheel.x < 0 ) {
button = EE_BUTTON_WHEELLEFT;
} else {
return;
}
event.button.button = button;

View File

@@ -1,7 +1,7 @@
#include "ecode.hpp"
#include "autocompletemodule.hpp"
#include "formattermodule.hpp"
#include "lintermodule.hpp"
#include "modules/autocomplete/autocompletemodule.hpp"
#include "modules/formatter/formattermodule.hpp"
#include "modules/linter/lintermodule.hpp"
#include <algorithm>
#include <args/args.hxx>
@@ -361,18 +361,23 @@ void App::onFileDropped( String file ) {
Vector2f mousePos( mUISceneNode->getEventDispatcher()->getMousePosf() );
Node* node = mUISceneNode->overFind( mousePos );
UICodeEditor* codeEditor = mEditorSplitter->getCurEditor();
UITab* tab = nullptr;
if ( !node )
node = codeEditor;
if ( node && node->isType( UI_TYPE_CODEEDITOR ) ) {
codeEditor = node->asType<UICodeEditor>();
if ( !codeEditor->getDocument().isEmpty() && !Image::isImageExtension( file ) ) {
if ( ( codeEditor->getDocument().isLoading() || !codeEditor->getDocument().isEmpty() ) &&
!Image::isImageExtension( file ) ) {
auto d = mEditorSplitter->createCodeEditorInTabWidget(
mEditorSplitter->tabWidgetFromEditor( codeEditor ) );
codeEditor = d.second;
d.first->getTabWidget()->setTabSelected( d.first );
tab = d.first;
}
}
loadFileFromPath( file, false, codeEditor );
loadFileFromPath( file, false, codeEditor, [tab]( UICodeEditor*, const std::string& ) {
if ( tab )
tab->getTabWidget()->setTabSelected( tab );
} );
}
void App::onTextDropped( String text ) {

View File

@@ -1,6 +1,6 @@
#include "formattermodule.hpp"
#include "thirdparty/json.hpp"
#include "thirdparty/subprocess.h"
#include "../../thirdparty/json.hpp"
#include "../../thirdparty/subprocess.h"
#include <eepp/system/filesystem.hpp>
#include <eepp/system/iostreamstring.hpp>
#include <random>

View File

@@ -1,6 +1,6 @@
#include "lintermodule.hpp"
#include "thirdparty/json.hpp"
#include "thirdparty/subprocess.h"
#include "../../thirdparty/json.hpp"
#include "../../thirdparty/subprocess.h"
#include <algorithm>
#include <eepp/graphics/text.hpp>
#include <eepp/system/filesystem.hpp>