8000
We read every piece of feedback, and take your input very seriously.
2 parents 495acf9 + ca369d7 commit 21663d9Copy full SHA for 21663d9
docs/source/usage.rst
@@ -140,8 +140,8 @@ component.
140
141
* - Token
142
- Description
143
- * - `surface.transluent`
144
- - If set to 1, the created surface will be transluent (can be used
+ * - `surface.transparent`
+ - If set to 1, the created surface will be transparent (can be used
145
to add background Android widget in the background, or use accelerated
146
widgets)
147
* - `surface.depth`
@@ -150,3 +150,7 @@ component.
150
support the depth you want.
151
* - `surface.stencil`
152
- Size of the stencil component, default to 8.
153
+ * - `android.background_color`
154
+ - Color (32bits RGBA color), used for the background window. Usually, the
155
+ background is covered by the OpenGL Background, unless
156
+ `surface.transparent` is set.
recipes/android/src/android/_android.pyx
@@ -167,11 +167,56 @@ def get_dpi():
167
168
169
# Soft keyboard.
170
-cdef extern void android_show_keyboard()
+cdef extern void android_show_keyboard(int)
171
cdef extern void android_hide_keyboard()
172
173
-def show_keyboard():
174
- android_show_keyboard()
+# Flags for input_type, for requesting a particular type of keyboard
+#android FLAGS
175
+TYPE_CLASS_DATETIME = 4
176
+TYPE_CLASS_NUMBER = 2
177
+TYPE_NUMBER_VARIATION_NORMAL = 0
178
+TYPE_NUMBER_VARIATION_PASSWORD = 16
179
+TYPE_CLASS_TEXT = 1
180
+TYPE_TEXT_FLAG_AUTO_COMPLETE = 65536
181
+TYPE_TEXT_FLAG_AUTO_CORRECT = 32768
182
+TYPE_TEXT_FLAG_NO_SUGGESTIONS = 524288
183
+TYPE_TEXT_VARIATION_EMAIL_ADDRESS = 32
184
+TYPE_TEXT_VARIATION_NORMAL = 0
185
+TYPE_TEXT_VARIATION_PASSWORD = 128
186
+TYPE_TEXT_VARIATION_POSTAL_ADDRESS = 112
187
+TYPE_TEXT_VARIATION_URI = 16
188
+TYPE_CLASS_PHONE = 3
189
+
190
+def show_keyboard(target, input_type):
191
+ if input_type == 'text':
192
+ _input_type = TYPE_CLASS_TEXT
193
+ elif input_type == 'number':
194
+ _input_type = TYPE_CLASS_NUMBER
195
+ elif input_type == 'url':
196
+ _input_type = \
197
+ TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_URI
198
+ elif input_type == 'mail':
199
200
+ TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_EMAIL_ADDRESS
201
+ elif input_type == 'datetime':
202
+ _input_type = TYPE_CLASS_DATETIME
203
+ elif input_type == 'tel':
204
+ _input_type = TYPE_CLASS_PHONE
205
+ elif input_type == 'address':
206
+ _input_type = TYPE_TEXT_VARIATION_POSTAL_ADDRESS
207
208
+ if target.password:
209
+ if _input_type == TYPE_CLASS_TEXT:
210
+ _input_type |= TYPE_TEXT_VARIATION_PASSWORD
211
+ elif _input_type == TYPE_CLASS_NUMBER:
212
+ _input_type |= TYPE_NUMBER_VARIATION_PASSWORD
213
214
+ if not target.keyboard_suggestions:
215
216
+ _input_type = TYPE_CLASS_TEXT | \
217
+ TYPE_TEXT_FLAG_NO_SUGGESTIONS
218
219
+ android_show_keyboard(_input_type)
220
221
def hide_keyboard():
222
android_hide_keyboard()
recipes/android/src/android/_android_jni.c
@@ -129,7 +129,7 @@ int android_get_dpi(void) {
129
return (*env)->CallStaticIntMethod(env, cls, mid);
130
}
131
132
-void android_show_keyboard(void) {
+void android_show_keyboard(int input_type) {
133
static JNIEnv *env = NULL;
134
static jclass *cls = NULL;
135
static jmethodID mid = NULL;
@@ -139,11 +139,11 @@ void android_show_keyboard(void) {
139
aassert(env);
cls = (*env)->FindClass(env, "org/renpy/android/Hardware");
aassert(cls);
- mid = (*env)->GetStaticMethodID(env, cls, "showKeyboard", "()V");
+ mid = (*env)->GetStaticMethodID(env, cls, "showKeyboard", "(I)V");
aassert(mid);
- (*env)->CallStaticVoidMethod(env, cls, mid);
+ (*env)->CallStaticVoidMethod(env, cls, mid, (jint) input_type);
148
149
void android_hide_keyboard(void) {
recipes/c_igraph/Makefile.am.patch
@@ -0,0 +1,6 @@
1
+68,72d67
2
+< f2c/arith.h: f2c/arithchk.c
3
+< $(CC) $(CFLAGS) -DNO_FPINIT f2c/arithchk.c -lm -o f2c/arith || \
4
+< $(CC) -DNO_LONG_LONG $(CFLAGS) -DNO_FPINIT f2c/arithchk.c \
5
+< $(WARNING_CFLAGS) -lm -o f2c/arith
6
+< f2c/arith > f2c/arith.h
recipes/c_igraph/arith.h
+#define IEEE_8087
+#define Arith_Kind_ASL 1
+#define Double_Align
+#define NANCHECK
+#define QNaN0 0x0
+#define QNaN1 0x7ff80000
recipes/c_igraph/config.h.patch
@@ -0,0 +1,11 @@
+--- build/c_igraph/igraph-0.6.5/config.h 2013-11-05 14:10:26.285433616 -0500
++++ config.h 2013-11-05 14:12:36.431283045 -0500
+@@ -53,7 +53,7 @@
+ /* #undef HAVE_LOG2 */
+ /* Define to 1 if you have the `logbl' function. */
7
+-/* #undef HAVE_LOGBL */
8
++#define HAVE_LOGBL 1
9
10
+ /* Define to 1 if you have the <memory.h> header file. */
11
+ #define HAVE_MEMORY_H 1
recipes/c_igraph/recipe.sh
@@ -0,0 +1,53 @@
+#!/bin/bash
+# Recipe for igraph, a high performance graph library in C: http://igraph.org
+#
+# Written by Zachary Spector: https://github.com/LogicalDash/
+VERSION_c_igraph=${VERSION_c_igraph:0.6.5}
+DEPS_c_igraph=()
12
13
+URL_c_igraph=http://downloads.sourceforge.net/project/igraph/C%20library/0.6.5/igraph-0.6.5.tar.gz
14
15
+MD5_c_igraph=5f9562263ba78b31c564d6897ff5a110
16
17
+BUILD_c_igraph=$BUILD_PATH/c_igraph/$(get_directory $URL_c_igraph)
18
19
+RECIPE_c_igraph=$RECIPES_PATH/c_igraph
20
21
+function prebuild_c_igraph() {
22
+ true
23
+}
24
25
+function shouldbuild_c_igraph() {
26
+ if [ -e $BUILD_c_igraph/.built ]; then
27
+ export DO_BUILD=0;
28
+ fi
29
30
31
+function build_c_igraph() {
32
+ cd $BUILD_c_igraph
33
34
+ push_arm
35
+ try patch $BUILD_c_igraph/src/Makefile.am $RECIPE_c_igraph/Makefile.am.patch
36
+ export OLD_CPPFLAGS="$CPPFLAGS"
37
+ export CPPFLAGS="$CPPFLAGS -I$ANDROIDNDK/sources/cxx-stl/gnu-libstdc++/4.4.3/include -I$ANDROIDNDK/sources/cxx-stl/gnu-libstdc++/4.4.3/libs/armeabi/include -L$ANDROIDNDK/platforms/android-$ANDROIDAPI/arch-arm/usr/lib"
38
+ try ./configure --prefix="$BUILD_PATH/python-install" --build=i686-pc-linux-gnu --host=arm-linux-eabi
39
+ export CPPFLAGS="$OLD_CPPFLAGS"
40
+ try cp -f $RECIPE_c_igraph/arith.h $BUILD_c_igraph/src/f2c/arith.h
41
+ try patch $BUILD_c_igraph/src/f2c/sysdep1.h $RECIPE_c_igraph/sysdep1.h.patch
42
+ try patch $BUILD_c_igraph/src/f2c/uninit.c $RECIPE_c_igraph/uninit.c.patch
43
+ try patch $BUILD_c_igraph/config.h $RECIPE_c_igraph/config.h.patch
44
+ try $MAKE
45
+ try $MAKE install
46
47
+ pop_arm
48
+ touch .built
49
50
51
+function postbuild_c_igraph() {
52
53
recipes/c_igraph/sysdep1.h.patch
@@ -0,0 +1,7 @@
+16a17
+> /*android doesn't like these
+18c19,20
+< #define OFF_T __off64_t
+---
+> #define OFF_T __off64_t*/
+> #define OFF_T long
recipes/c_igraph/uninit.c.patch
@@ -0,0 +1,23 @@
+276c276,277
+< #include <fpu_control.h>
+> //doesn't exist on Android
+> //#include <fpu_control.h>
+334a336
+> /*
+336c338
+< #define RQD_FPU_MASK (_FPU_MASK_OM+_FPU_MASK_IM+_FPU_MASK_ZM)
+> #define RQD_FPU_MASK (_FPU_MASK_OM+_FPU_MASK_IM+_FPU_MASK_ZM)*/
+343a346
+345c348
+350a354
+352c356
+< #define RQD_FPU_MASK (_FPU_MASK_O+_FPU_MASK_V+_FPU_MASK_Z)
+> #define RQD_FPU_MASK (_FPU_MASK_O+_FPU_MASK_V+_FPU_MASK_Z)*/
recipes/igraph/Makefile.am.patch
@@ -0,0 +1,47 @@
+170c170,180
+< scg_headers.h igraph_hacks_internal.h
+> scg_headers.h igraph_hacks_internal.h \
+> arpackobject.h \
+> pyattributes.h bfsiter.h \
+> common.h convert.h \
+> edgeobject.h edgeseqobject.h \
+> error.h filehandle.h \
+> graphobject.h igraphmodule_api.h \
+> indexing.h platform.h \
+> py2compat.h pyhelpers.h \
+> pyrandom.h vertexobject.h \
+> vertexseqobject.h
+260c270,287
+< qsort.c qsort_r.c types.c hacks.c
+> qsort.c qsort_r.c types.c hacks.c \
+> arpackobject.c \
+> pyattributes.c \
+> bfsiter.c \
+> common.c \
+> convert.c \
+> edgeobject.c \
+> edgeseqobject.c \
+> error.c \
+> filehandle.c \
+> graphobject.c \
+> igraphmodule.c \
+> indexing.c \
+> py2compat.c \
+> pyhelpers.c \
+> pyrandom.c \
+> vertexobject.c \
+> vertexseqobject.c
+263,265c290,292
+< libigraph_la_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(WARNING_CFLAGS)
+< libigraph_la_CXXFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(WARNING_CFLAGS)
+< libigraph_la_LDFLAGS = -no-undefined
+> libigraph_la_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(WARNING_CFLAGS) -IBUILD_PATH/python-install/include/python2.7
+> libigraph_la_CXXFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(WARNING_CFLAGS) -IBUILD_PATH/python-install/include/python2.7
+> libigraph_la_LDFLAGS = -no-undefined -LBUILD_PATH/python-install/lib -IBUILD_PATH/python-install/include/python2.7
+267c294
+< $(LAPACK_LIB) $(ARPACK_LIB) $(GLPK_LIB) $(PLFIT_LIB)
+> $(LAPACK_LIB) $(ARPACK_LIB) $(GLPK_LIB) $(PLFIT_LIB) -lpython2.7