Commit 0476ebd3a0f895d2e2f1020c9883299d346f2296
1 parent
64a58357
Exists in
master
and in
5 other branches
Android - Work in progress
Showing
5 changed files
with
63 additions
and
9 deletions
Show diff stats
src/android/jni/Android.mk
@@ -32,7 +32,8 @@ include ../lib3270/sources.mak | @@ -32,7 +32,8 @@ include ../lib3270/sources.mak | ||
32 | LOCAL_CFLAGS=-I../include | 32 | LOCAL_CFLAGS=-I../include |
33 | LOCAL_DEFAULT_CPP_EXTENSION := cpp | 33 | LOCAL_DEFAULT_CPP_EXTENSION := cpp |
34 | LOCAL_MODULE := lib3270 | 34 | LOCAL_MODULE := lib3270 |
35 | -LOCAL_SRC_FILES := $(foreach SRC, $(TERMINAL_SOURCES), ../../lib3270/$(SRC)) misc.cpp | 35 | +LOCAL_SRC_FILES := $(foreach SRC, $(TERMINAL_SOURCES), ../../lib3270/$(SRC)) \ |
36 | + misc.cpp init.cpp | ||
36 | 37 | ||
37 | include $(BUILD_SHARED_LIBRARY) | 38 | include $(BUILD_SHARED_LIBRARY) |
38 | 39 |
@@ -0,0 +1,40 @@ | @@ -0,0 +1,40 @@ | ||
1 | +/* | ||
2 | + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | ||
3 | + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | ||
4 | + * aplicativos mainframe. Registro no INPI sob o nome G3270. Registro no INPI sob o nome G3270. | ||
5 | + * | ||
6 | + * Copyright (C) <2008> <Banco do Brasil S.A.> | ||
7 | + * | ||
8 | + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | ||
9 | + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | ||
10 | + * Free Software Foundation. | ||
11 | + * | ||
12 | + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | ||
13 | + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | ||
14 | + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | ||
15 | + * obter mais detalhes. | ||
16 | + * | ||
17 | + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | ||
18 | + * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple | ||
19 | + * Place, Suite 330, Boston, MA, 02111-1307, USA | ||
20 | + * | ||
21 | + * Este programa está nomeado como init.cpp e possui - linhas de código. | ||
22 | + * | ||
23 | + * Contatos: | ||
24 | + * | ||
25 | + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | ||
26 | + * | ||
27 | + */ | ||
28 | + | ||
29 | + #include "lib3270jni.h" | ||
30 | + #include <lib3270.h> | ||
31 | + | ||
32 | +/*--[ Implement ]------------------------------------------------------------------------------------*/ | ||
33 | + | ||
34 | +JNIEXPORT jint JNICALL Java_br_com_bb_pw3270_lib3270_init(JNIEnv *env, jobject obj) | ||
35 | +{ | ||
36 | + H3270 *session = lib3270_session_new(""); | ||
37 | + | ||
38 | + | ||
39 | +} | ||
40 | + |
src/android/jni/misc.cpp
@@ -18,7 +18,7 @@ | @@ -18,7 +18,7 @@ | ||
18 | * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple | 18 | * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple |
19 | * Place, Suite 330, Boston, MA, 02111-1307, USA | 19 | * Place, Suite 330, Boston, MA, 02111-1307, USA |
20 | * | 20 | * |
21 | - * Este programa está nomeado como paste.c e possui - linhas de código. | 21 | + * Este programa está nomeado como misc.cpp e possui - linhas de código. |
22 | * | 22 | * |
23 | * Contatos: | 23 | * Contatos: |
24 | * | 24 | * |
@@ -35,3 +35,8 @@ JNIEXPORT jstring JNICALL Java_br_com_bb_pw3270_lib3270_getVersion(JNIEnv *env, | @@ -35,3 +35,8 @@ JNIEXPORT jstring JNICALL Java_br_com_bb_pw3270_lib3270_getVersion(JNIEnv *env, | ||
35 | { | 35 | { |
36 | return env->NewStringUTF(lib3270_get_version()); | 36 | return env->NewStringUTF(lib3270_get_version()); |
37 | } | 37 | } |
38 | + | ||
39 | +JNIEXPORT jstring JNICALL Java_br_com_bb_pw3270_lib3270_getRevision(JNIEnv *env, jobject obj) | ||
40 | +{ | ||
41 | + return env->NewStringUTF(lib3270_get_revision()); | ||
42 | +} |
src/android/lib3270NDK.cbp
@@ -34,7 +34,9 @@ | @@ -34,7 +34,9 @@ | ||
34 | </Compiler> | 34 | </Compiler> |
35 | <Unit filename="Makefile" /> | 35 | <Unit filename="Makefile" /> |
36 | <Unit filename="jni/Android.mk" /> | 36 | <Unit filename="jni/Android.mk" /> |
37 | + <Unit filename="jni/init.cpp" /> | ||
37 | <Unit filename="jni/misc.cpp" /> | 38 | <Unit filename="jni/misc.cpp" /> |
39 | + <Unit filename="src/br/com/bb/pw3270/lib3270.java" /> | ||
38 | <Extensions> | 40 | <Extensions> |
39 | <code_completion /> | 41 | <code_completion /> |
40 | <debugger /> | 42 | <debugger /> |
src/android/src/br/com/bb/pw3270/lib3270.java
@@ -2,20 +2,26 @@ package br.com.bb.pw3270; | @@ -2,20 +2,26 @@ package br.com.bb.pw3270; | ||
2 | 2 | ||
3 | public class lib3270 { | 3 | public class lib3270 { |
4 | 4 | ||
5 | - static | ||
6 | - { | ||
7 | - System.loadLibrary("3270"); | ||
8 | - } | 5 | + static |
6 | + { | ||
7 | + System.loadLibrary("3270"); | ||
8 | + init(); | ||
9 | + } | ||
9 | 10 | ||
10 | /** | 11 | /** |
11 | * @param args | 12 | * @param args |
12 | */ | 13 | */ |
13 | - public static void main(String[] args) | 14 | + public static void main(String[] args) |
14 | { | 15 | { |
15 | // TODO Auto-generated method stub | 16 | // TODO Auto-generated method stub |
16 | 17 | ||
17 | } | 18 | } |
18 | - | ||
19 | - public native String getVersion(); | 19 | + |
20 | + // Misc calls | ||
21 | + static private native int init(); | ||
22 | + public native String getVersion(); | ||
23 | + public native String getRevision(); | ||
24 | + | ||
25 | + | ||
20 | 26 | ||
21 | } | 27 | } |