Skip to content

Commit 0648d5d

Browse files
committed
Removed more references to pygame
1 parent e334b75 commit 0648d5d

File tree

10 files changed

+10
-289
lines changed

10 files changed

+10
-289
lines changed

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ recursive-include pythonforandroid/recipes *.py *.patch *.c *.pyx Setup *.h
1010
recursive-include pythonforandroid/bootstraps *.properties *.xml *.java *.tmpl *.txt *.png *.aidl *.py *.sh *.c *.h *.html *.patch
1111

1212
prune .git
13-
prune pythonforandroid/bootstraps/pygame/build/libs

doc/source/apis.rst

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ Advanced Android API use
9898
As mentioned above, the ``android`` Python module provides a simple
9999
wrapper around many native Android APIS, and it can be included by
100100
adding it to your requirements, e.g. :code:`--requirements=kivy,android`.
101-
It is not automatically included by Kivy unless you use the old (Pygame)
102-
bootstrap.
101+
It is not automatically included with Kivy.
103102

104103
The available functionality of this module is not separately documented.
105104
You can read the source `on
@@ -159,9 +158,6 @@ a Java class. For instance, here is the code to vibrate your device::
159158
# application, this reference is stored automatically by
160159
# Kivy's PythonActivity bootstrap
161160

162-
# This one works with Pygame
163-
# PythonActivity = autoclass('org.renpy.android.PythonActivity')
164-
165161
# This one works with SDL2
166162
PythonActivity = autoclass('org.kivy.android.PythonActivity')
167163

@@ -176,9 +172,9 @@ Things to note here are:
176172

177173
- The class that must be wrapped depends on the bootstrap. This is
178174
because Pyjnius is using the bootstrap's java source code to get a
179-
reference to the current activity, which both the Pygame and SDL2
180-
bootstraps store in the ``mActivity`` static variable. This
181-
difference isn't always important, but it's important to know about.
175+
reference to the current activity, which the bootstraps store in the
176+
``mActivity`` static variable. This difference isn't always
177+
important, but it's important to know about.
182178
- The code closely follows the Java API - this is exactly the same set
183179
of function calls that you'd use to achieve the same thing from Java
184180
code.

doc/source/bootstraps.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Bootstraps
33
==========
44

55
This page is about creating new bootstrap backends. For build options
6-
of existing bootstraps (i.e. with SDL2, Pygame, Webview etc.), see
6+
of existing bootstraps (i.e. with SDL2, Webview, etc.), see
77
:ref:`build options <bootstrap_build_options>`.
88

99
python-for-android (p4a) supports multiple *bootstraps*. These fulfill a

doc/source/services.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,16 @@ There are two ways to have services included in your APK.
2626
Service folder
2727
~~~~~~~~~~~~~~
2828

29-
This basic method works with both the new SDL2 and old Pygame
30-
bootstraps. It is recommended to use the second method (below) where
31-
possible.
29+
This is the older method of handling services. It is
30+
recommended to use the second method (below) where possible.
3231

3332
Create a folder named ``service`` in your app directory, and add a
3433
file ``service/main.py``. This file should contain the Python code
3534
that you want the service to run.
3635

3736
To start the service, use the :code:`start_service` function from the
38-
:code:`android` module (included automatically with the Pygame
39-
bootstrap, you must add it to the requirements manually with SDL2 if
40-
you wish to use this method)::
37+
:code:`android` module (you may need to add ``android`` to your app
38+
requirements)::
4139

4240
import android
4341
android.start_service(title='service name',

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,11 @@
1515
#include <errno.h>
1616

1717
#include "bootstrap_name.h"
18+
1819
#ifndef BOOTSTRAP_USES_NO_SDL_HEADERS
1920
#include "SDL.h"
20-
#ifndef BOOTSTRAP_NAME_PYGAME
2121
#include "SDL_opengles2.h"
2222
#endif
23-
#endif
24-
#ifdef BOOTSTRAP_NAME_PYGAME
25-
#include "jniwrapperstuff.h"
26-
#endif
2723
#include "android/log.h"
2824

2925
#define ENTRYPOINT_MAXLEN 128

pythonforandroid/recipes/android/src/android/_android.pyx

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,6 @@
22

33
include "config.pxi"
44

5-
IF BOOTSTRAP == 'pygame':
6-
cdef extern int SDL_ANDROID_CheckPause()
7-
cdef extern void SDL_ANDROID_WaitForResume() nogil
8-
cdef extern void SDL_ANDROID_MapKey(int scancode, int keysym)
9-
10-
def check_pause():
11-
return SDL_ANDROID_CheckPause()
12-
13-
def wait_for_resume():
14-
android_accelerometer_enable(False)
15-
SDL_ANDROID_WaitForResume()
16-
android_accelerometer_enable(accelerometer_enabled)
17-
18-
def map_key(scancode, keysym):
19-
SDL_ANDROID_MapKey(scancode, keysym)
20-
215
# Android keycodes.
226
KEYCODE_UNKNOWN = 0
237
KEYCODE_SOFT_LEFT = 1
@@ -179,8 +163,6 @@ python_act = autoclass(JAVA_NAMESPACE + u'.PythonActivity')
179163
Rect = autoclass(u'android.graphics.Rect')
180164
mActivity = python_act.mActivity
181165
if mActivity:
182-
# PyGame backend already has the listener so adding
183-
# one here leads to a crash/too much cpu usage.
184166
# SDL2 now does not need the listener so there is
185167
# no point adding a processor intensive layout listenere here.
186168
height = 0
@@ -274,42 +256,6 @@ def get_buildinfo():
274256
binfo.VERSION_RELEASE = BUILD_VERSION_RELEASE
275257
return binfo
276258

277-
IF IS_PYGAME:
278-
# Activate input - required to receive input events.
279-
cdef extern void android_activate_input()
280-
281-
def init():
282-
android_activate_input()
283-
284-
# Action send
285-
cdef extern void android_action_send(char*, char*, char*, char*, char*)
286-
def action_send(mimetype, filename=None, subject=None, text=None,
287-
chooser_title=None):
288-
cdef char *j_mimetype = <bytes>mimetype
289-
cdef char *j_filename = NULL
290-
cdef char *j_subject = NULL
291-
cdef char *j_text = NULL
292-
cdef char *j_chooser_title = NULL
293-
if filename is not None:
294-
j_filename = <bytes>filename
295-
if subject is not None:
296-
j_subject = <bytes>subject
297-
if text is not None:
298-
j_text = <bytes>text
299-
if chooser_title is not None:
300-
j_chooser_title = <bytes>chooser_title
301-
android_action_send(j_mimetype, j_filename, j_subject, j_text,
302-
j_chooser_title)
303-
304-
cdef extern int android_checkstop()
305-
cdef extern void android_ackstop()
306-
307-
def check_stop():
308-
return android_checkstop()
309-
310-
def ack_stop():
311-
android_ackstop()
312-
313259
# -------------------------------------------------------------------
314260
# URL Opening.
315261
def open_url(url):

pythonforandroid/recipes/android/src/android/_android_jni.c

Lines changed: 0 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -201,118 +201,6 @@ void android_get_buildinfo() {
201201
}
202202
}
203203

204-
#if IS_PYGAME
205-
void android_activate_input(void) {
206-
static JNIEnv *env = NULL;
207-
static jclass *cls = NULL;
208-
static jmethodID mid = NULL;
209-
210-
if (env == NULL) {
211-
env = SDL_ANDROID_GetJNIEnv();
212-
aassert(env);
213-
cls = (*env)->FindClass(env, "org/renpy/android/SDLSurfaceView");
214-
aassert(cls);
215-
mid = (*env)->GetStaticMethodID(env, cls, "activateInput", "()V");
216-
aassert(mid);
217-
}
218-
219-
(*env)->CallStaticVoidMethod(env, cls, mid);
220-
}
221-
222-
int android_checkstop(void) {
223-
static JNIEnv *env = NULL;
224-
static jclass *cls = NULL;
225-
static jmethodID mid = NULL;
226-
227-
if (env == NULL) {
228-
env = SDL_ANDROID_GetJNIEnv();
229-
aassert(env);
230-
cls = (*env)->FindClass(env, "org/renpy/android/SDLSurfaceView");
231-
aassert(cls);
232-
mid = (*env)->GetStaticMethodID(env, cls, "checkStop", "()I");
233-
aassert(mid);
234-
}
235-
236-
return (*env)->CallStaticIntMethod(env, cls, mid);
237-
}
238-
239-
void android_ackstop(void) {
240-
static JNIEnv *env = NULL;
241-
static jclass *cls = NULL;
242-
static jmethodID mid = NULL;
243-
244-
if (env == NULL) {
245-
env = SDL_ANDROID_GetJNIEnv();
246-
aassert(env);
247-
cls = (*env)->FindClass(env, "org/renpy/android/SDLSurfaceView");
248-
aassert(cls);
249-
mid = (*env)->GetStaticMethodID(env, cls, "ackStop", "()I");
250-
aassert(mid);
251-
}
252-
253-
(*env)->CallStaticIntMethod(env, cls, mid);
254-
}
255-
256-
void android_action_send(char *mimeType, char *filename, char *subject, char *text, char *chooser_title) {
257-
static JNIEnv *env = NULL;
258-
static jclass *cls = NULL;
259-
static jmethodID mid = NULL;
260-
261-
if (env == NULL) {
262-
env = SDL_ANDROID_GetJNIEnv();
263-
aassert(env);
264-
cls = (*env)->FindClass(env, "org/renpy/android/Action");
265-
aassert(cls);
266-
mid = (*env)->GetStaticMethodID(env, cls, "send",
267-
"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
268-
aassert(mid);
269-
}
270-
271-
jstring j_mimeType = (*env)->NewStringUTF(env, mimeType);
272-
jstring j_filename = NULL;
273-
jstring j_subject = NULL;
274-
jstring j_text = NULL;
275-
jstring j_chooser_title = NULL;
276-
if ( filename != NULL )
277-
j_filename = (*env)->NewStringUTF(env, filename);
278-
if ( subject != NULL )
279-
j_subject = (*env)->NewStringUTF(env, subject);
280-
if ( text != NULL )
281-
j_text = (*env)->NewStringUTF(env, text);
282-
if ( chooser_title != NULL )
283-
j_chooser_title = (*env)->NewStringUTF(env, text);
284-
285-
(*env)->CallStaticVoidMethod(
286-
env, cls, mid,
287-
j_mimeType, j_filename, j_subject, j_text,
288-
j_chooser_title);
289-
}
290-
291-
void android_open_url(char *url) {
292-
static JNIEnv *env = NULL;
293-
static jclass *cls = NULL;
294-
static jmethodID mid = NULL;
295-
296-
if (env == NULL) {
297-
env = SDL_ANDROID_GetJNIEnv();
298-
aassert(env);
299-
cls = (*env)->FindClass(env, "org/renpy/android/SDLSurfaceView");
300-
aassert(cls);
301-
mid = (*env)->GetStaticMethodID(env, cls, "openUrl", "(Ljava/lang/String;)V");
302-
aassert(mid);
303-
}
304-
305-
PUSH_FRAME;
306-
307-
(*env)->CallStaticVoidMethod(
308-
env, cls, mid,
309-
(*env)->NewStringUTF(env, url)
310-
);
311-
312-
POP_FRAME;
313-
}
314-
#endif // IS_PYGAME
315-
316204
void android_start_service(char *title, char *description, char *arg) {
317205
static JNIEnv *env = NULL;
318206
static jclass *cls = NULL;

test_builds/test.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

test_builds/tests/test_apk.py

Lines changed: 0 additions & 69 deletions
This file was deleted.

testapps/testlauncher_setup/pygame.py

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)