Skip to content

Commit 3407d51

Browse files
committed
WIP
1 parent 4a75474 commit 3407d51

File tree

14 files changed

+54
-57
lines changed

14 files changed

+54
-57
lines changed

pythonforandroid/bootstraps/common/build/build.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,10 @@ def make_package(args):
658658
subprocess.check_output(patch_command + ["--dry-run"])
659659
except subprocess.CalledProcessError as e:
660660
if e.returncode == 1:
661+
print(e.stderr)
662+
print(e.stdout)
663+
print(e.cmd)
664+
print(e.output)
661665
# Return code 1 means not all hunks could be applied, this usually
662666
# means the patch is already applied.
663667
print("Warning: failed to apply patch (exit code 1), "

pythonforandroid/bootstraps/common/build/jni/application/src/Android.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ SDL_PATH := ../../SDL
99
LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include
1010

1111
# Add your application source files here...
12-
LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.c \
13-
start.c
12+
LOCAL_SRC_FILES := start.c
1413

1514
LOCAL_CFLAGS += -I$(PYTHON_INCLUDE_ROOT) $(EXTRA_CFLAGS)
1615

pythonforandroid/bootstraps/common/build/jni/application/src/start.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,16 @@
1616

1717
#include "bootstrap_name.h"
1818

19-
#ifndef BOOTSTRAP_USES_NO_SDL_HEADERS
19+
#ifdef BOOTSTRAP_NAME_SDL2
2020
#include "SDL.h"
2121
#include "SDL_opengles2.h"
2222
#endif
23+
24+
#ifdef BOOTSTRAP_NAME_SDL3
25+
#include "SDL3/SDL.h"
26+
#include "SDL3/SDL_opengles2.h"
27+
#endif
28+
2329
#include "android/log.h"
2430

2531
#define ENTRYPOINT_MAXLEN 128
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11

2-
#define BOOTSTRAP_USES_NO_SDL_HEADERS
32

43
const char bootstrap_name[] = "qt";

pythonforandroid/bootstraps/sdl3/build/jni/application/src/Android_static.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ LOCAL_SRC_FILES := start.c
88

99
LOCAL_STATIC_LIBRARIES := SDL3_static
1010

11+
1112
include $(BUILD_SHARED_LIBRARY)
1213
$(call import-module,SDL)LOCAL_PATH := $(call my-dir)

pythonforandroid/bootstraps/sdl3/build/src/main/java/org/kivy/android/PythonActivity.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,10 +634,12 @@ public void requestPermissions(String[] permissions) {
634634
}
635635

636636
public static void changeKeyboard(int inputType) {
637+
/*
637638
if (SDLActivity.keyboardInputType != inputType){
638639
SDLActivity.keyboardInputType = inputType;
639640
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
640641
imm.restartInput(mTextEdit);
641642
}
643+
*/
642644
}
643645
}
Lines changed: 17 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
--- a/src/main/java/org/libsdl/app/SDLActivity.java
22
+++ b/src/main/java/org/libsdl/app/SDLActivity.java
3-
@@ -221,6 +221,8 @@
3+
@@ -259,6 +259,7 @@
4+
String[] arguments = SDLActivity.mSingleton.getArguments();
45

5-
// This is what SDL runs in. It invokes SDL_main(), eventually
6-
protected static Thread mSDLThread;
7-
+
8-
+ public static int keyboardInputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;
9-
10-
protected static SDLGenericMotionListener_API12 getMotionListener() {
11-
if (mMotionListener == null) {
12-
@@ -323,6 +325,15 @@
6+
Log.v("SDL", "Running main function " + function + " from library " + library);
7+
+ SDLActivity.mSingleton.appConfirmedActive();
8+
SDLActivity.nativeRunMain(library, function, arguments);
9+
Log.v("SDL", "Finished main function");
10+
}
11+
@@ -351,6 +352,15 @@
1312
Log.v(TAG, "Model: " + Build.MODEL);
1413
Log.v(TAG, "onCreate()");
1514
super.onCreate(savedInstanceState);
1615
+
17-
+ SDLActivity.initialize();
16+
+ SDL.initialize();
1817
+ // So we can call stuff from static callbacks
1918
+ mSingleton = this;
2019
+ }
@@ -23,18 +22,9 @@
2322
+ // and we can't run setup tasks until that thread completes.
2423
+ protected void finishLoad() {
2524

26-
try {
27-
Thread.currentThread().setName("SDLActivity");
28-
@@ -837,7 +848,7 @@
29-
Handler commandHandler = new SDLCommandHandler();
3025

31-
// Send a message from the SDLMain thread
32-
- boolean sendCommand(int command, Object data) {
33-
+ protected boolean sendCommand(int command, Object data) {
34-
Message msg = commandHandler.obtainMessage();
35-
msg.arg1 = command;
36-
msg.obj = data;
37-
@@ -1385,7 +1396,22 @@
26+
/* Control activity re-creation */
27+
@@ -1541,8 +1551,22 @@
3828
return null;
3929
}
4030
return SDLActivity.mSurface.getNativeSurface();
@@ -46,32 +36,14 @@
4636
+ public static void triggerAppConfirmedActive() {
4737
+ mSingleton.appConfirmedActive();
4838
}
49-
+
39+
5040
+ /**
51-
+ * Trick needed for loading screen, overridden by PythonActivity
52-
+ * to keep loading screen active
53-
+ */
41+
+ * Trick needed for loading screen, overridden by PythonActivity
42+
+ * to keep loading screen active
43+
+ */
5444
+ public void appConfirmedActive() {
5545
+ }
56-
+
57-
46+
+
5847
// Input
5948

60-
@@ -1881,6 +1907,7 @@
61-
62-
Log.v("SDL", "Running main function " + function + " from library " + library);
63-
64-
+ SDLActivity.mSingleton.appConfirmedActive();
65-
SDLActivity.nativeRunMain(library, function, arguments);
66-
67-
Log.v("SDL", "Finished main function");
68-
@@ -1938,8 +1965,7 @@
69-
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
70-
ic = new SDLInputConnection(this, true);
71-
72-
- outAttrs.inputType = InputType.TYPE_CLASS_TEXT |
73-
- InputType.TYPE_TEXT_FLAG_MULTI_LINE;
74-
+ outAttrs.inputType = SDLActivity.keyboardInputType;
75-
outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI |
76-
EditorInfo.IME_FLAG_NO_FULLSCREEN /* API 11 */;
77-
49+
/**
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11

22
#define BOOTSTRAP_NAME_LIBRARY
3-
#define BOOTSTRAP_USES_NO_SDL_HEADERS
43

54
const char bootstrap_name[] = "service_library";
65

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11

22
#define BOOTSTRAP_NAME_SERVICEONLY
3-
#define BOOTSTRAP_USES_NO_SDL_HEADERS
43

54
const char bootstrap_name[] = "service_only";
65

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11

22
#define BOOTSTRAP_NAME_WEBVIEW
3-
#define BOOTSTRAP_USES_NO_SDL_HEADERS
43

54
const char bootstrap_name[] = "webview";
65

0 commit comments

Comments
 (0)