refactor source tree organization, switch to meson

This commit is contained in:
Mis012
2022-10-02 23:06:56 +02:00
parent 2f785e2a59
commit 449090143e
296 changed files with 171615 additions and 69 deletions

21
.gitignore vendored
View File

@@ -1,20 +1,3 @@
# populated by apps
data/files/*
data/shared_prefs/*
# manually extracted from apk
data/assets/*
data/lib/*
# manually extracted from apk and possibly converted
data/res/*
# taken from android (apps may dislike non-bionic-linked libstdc++)
!data/lib/libstdc++.so
# build artifacts # build artifacts
libnative/* build/
*.class builddir/
*.dex
/main

79
meson.build Normal file
View File

@@ -0,0 +1,79 @@
project('android_translation_layer', ['c', 'java'], default_options: ['b_lundef=false'])
incdir_dep = declare_dependency(include_directories: '.')
add_project_dependencies(incdir_dep, language: 'c')
cc = meson.get_compiler('c')
dir_base = meson.current_source_dir()
builddir_base = meson.current_build_dir()
libart_dep = [
cc.find_library('art', dirs : [join_paths(dir_base, 'dalvik/linux-x86/lib64/')]),
cc.find_library('nativebridge', dirs : [join_paths(dir_base, 'dalvik/linux-x86/lib64/')])
]
libdl_bio_dep = [
cc.find_library('dl_bio', dirs : [join_paths(dir_base, 'dalvik/linux-x86/lib64/')])
]
libtranslationlayer_so = shared_library('translation_layer_main', [
'src/api-impl-jni/egl/com_google_android_gles_jni_EGLImpl.c',
'src/api-impl-jni/android_os_SystemClock.c',
'src/api-impl-jni/android_view_Window.c',
'src/api-impl-jni/util.c',
'src/api-impl-jni/android_graphics_Canvas.c',
'src/api-impl-jni/drawables/ninepatch.c',
'src/api-impl-jni/android_content_res_AssetManager.c',
'src/api-impl-jni/audio/android_media_AudioTrack.c',
'src/api-impl-jni/widgets/android_widget_RelativeLayout.c',
'src/api-impl-jni/widgets/android_widget_ScrollView.c',
'src/api-impl-jni/widgets/android_opengl_GLSurfaceView.c',
'src/api-impl-jni/widgets/android_widget_ImageView.c',
'src/api-impl-jni/widgets/android_widget_FrameLayout.c',
'src/api-impl-jni/widgets/WrapperWidget.c',
'src/api-impl-jni/widgets/android_widget_TextView.c',
'src/api-impl-jni/widgets/android_widget_LinearLayout.c',
'src/api-impl-jni/views/android_view_View.c',
'src/api-impl-jni/views/android_view_ViewGroup.c',
'src/api-impl-jni/android_graphics_Bitmap.c' ],
dependencies: [
dependency('gtk4'), dependency('gl'), dependency('egl'), dependency('jni')
],
link_args: [
'-lasound'
])
conf_data = configuration_data()
conf_data.set('install_libdir', get_option('prefix') / get_option('libdir'))
configure_file(input : 'src/config.h.in',
output : 'config.h',
configuration : conf_data)
configure_file(input : 'launch_activity.sh.in',
output : 'launch_activity.sh',
configuration : conf_data)
executable('main', [
'src/main-executable/main.c',
'src/main-executable/r_debug.c'
],
dependencies: [
dependency('gtk4'), dependency('jni'), declare_dependency(link_with: libtranslationlayer_so), libart_dep, dependency('dl'), libdl_bio_dep
])
# libandroid
shared_library('android', [
'src/libandroid/misc.c',
'src/libandroid/asset_manager.c'
])
# hax_arsc_parser.dex (named as classes2.dex so it works inside a jar)
subdir('src/arsc_parser')
hax_arsc_parser_dex = custom_target('hax_arsc_parser.dex', build_by_default: true, input: [hax_arsc_parser_jar], output: ['classes2.dex'], command: [join_paths(dir_base, 'dalvik/linux-x86/bin/dx'),'--verbose', '--dex', '--output='+join_paths(builddir_base, 'classes2.dex'), hax_arsc_parser_jar.full_path()])
# hax.dex (named as classes.dex so it works inside a jar)
subdir('src/api-impl')
hax_dex = custom_target('hax.dex', build_by_default: true, input: [hax_jar], output: ['classes.dex'], command: [join_paths(dir_base, 'dalvik/linux-x86/bin/dx'),'--verbose', '--dex', '--output='+join_paths(builddir_base, 'classes.dex'), hax_jar.full_path()])
# api-impl.jar
custom_target('api-impl.jar', build_by_default: true, input: [hax_dex, hax_arsc_parser_dex], output: ['api-impl.jar'], command: ['zip', '-j', join_paths(builddir_base, 'api-impl.jar'), hax_dex.full_path(), hax_arsc_parser_dex.full_path()])

View File

@@ -0,0 +1,101 @@
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include "defines.h"
#include "util.h"
#include "generated_headers/android_content_res_AssetManager.h"
#define ASSET_DIR "data/assets/"
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_openAsset(JNIEnv *env, jobject this, jstring _file_name, jint mode)
{
const char *file_name = _CSTRING(_file_name);
char *path = malloc(strlen(file_name) + strlen(ASSET_DIR) + 1);
int fd;
strcpy(path, ASSET_DIR);
strcat(path, file_name);
printf("openning asset with filename: %s\n", _CSTRING(_file_name));
printf("openning asset at path: %s\n", path);
fd = open(path, O_CLOEXEC | O_RDWR);
free(path);
return fd;
}
JNIEXPORT jlong JNICALL Java_android_content_res_AssetManager_getAssetLength(JNIEnv *env, jobject this, jint fd)
{
int ret;
struct stat statbuf;
ret = fstat(fd, &statbuf);
if(ret)
printf("oopsie, fstat failed on fd: %d with errno: %d\n", fd, errno);
return statbuf.st_size;
}
JNIEXPORT jlong JNICALL Java_android_content_res_AssetManager_getAssetRemainingLength(JNIEnv *env, jobject this, jint fd)
{
jlong file_size = Java_android_content_res_AssetManager_getAssetLength(env, this, fd);
off_t offset = lseek(fd, 0, SEEK_CUR);
return file_size - offset;
}
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_readAsset(JNIEnv *env, jobject this, jint fd, jbyteArray b, jint off, jint len)
{
int ret;
int err;
jbyte *array = _GET_BYTE_ARRAY_ELEMENTS(b);
ret = read(fd, &array[off], len);
_RELEASE_BYTE_ARRAY_ELEMENTS(b, array);
if(ret < 0) {
err = errno;
printf("oopsie, read failed on fd: %d with errno: %d\n", fd, err);
exit(err);
} else if (ret == 0) { //EOF
return -1;
} else {
return ret;
}
}
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_readAssetChar(JNIEnv *env, jobject this, jint fd)
{
int ret;
int err;
unsigned char byte;
ret = read(fd, &byte, 1);
if(ret == 1)
return byte;
else if(ret == 0)
return -1;
else {
err = errno;
printf("oopsie, read failed on fd: %d with errno: %d\n", fd, err);
exit(err);
}
}
JNIEXPORT jlong JNICALL Java_android_content_res_AssetManager_seekAsset(JNIEnv *env, jobject this, jint fd, jlong off, jint whence)
{
return lseek(fd, off, (whence > 0) ? SEEK_END : (whence < 0 ? SEEK_SET : SEEK_CUR));
}
JNIEXPORT void JNICALL Java_android_content_res_AssetManager_destroyAsset(JNIEnv *env, jobject this, jint fd)
{
printf("closing asset with fd: %d\n", fd);
close(fd);
}

View File

@@ -0,0 +1,28 @@
#include <gtk/gtk.h>
#include "defines.h"
#include "util.h"
#include "generated_headers/android_graphics_Bitmap.h"
JNIEXPORT jlong JNICALL Java_android_graphics_Bitmap_native_1bitmap_1from_1path(JNIEnv *env, jobject this, jobject path)
{
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(_CSTRING(path), NULL);
printf(">>> made pixbuf from path: >%s<, >%p<\n", _CSTRING(path), pixbuf);
g_object_ref(pixbuf);
return _INTPTR(pixbuf);
}
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_getWidth(JNIEnv *env, jobject this)
{
GdkPixbuf *pixbuf = _PTR(_GET_LONG_FIELD(this, "pixbuf"));
return gdk_pixbuf_get_width(pixbuf);
}
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_getHeight(JNIEnv *env, jobject this)
{
GdkPixbuf *pixbuf = _PTR(_GET_LONG_FIELD(this, "pixbuf"));
return gdk_pixbuf_get_height(pixbuf);
}

View File

@@ -0,0 +1,68 @@
#include <gtk/gtk.h>
#include "defines.h"
#include "util.h"
#include "generated_headers/android_graphics_Canvas.h"
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1save(JNIEnv *env, jclass this, jlong cairo_context, jlong widget)
{
cairo_t *cr = (cairo_t *)_PTR(cairo_context);
cairo_save(cr);
}
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1restore(JNIEnv *env, jclass this, jlong cairo_context, jlong widget)
{
cairo_t *cr = (cairo_t *)_PTR(cairo_context);
cairo_restore(cr);
}
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1drawLine(JNIEnv *env, jclass this_class, jlong cairo_context, jlong widget, jfloat start_x, jfloat start_y, jfloat stop_x, jfloat stop_y, jint paint_color)
{
cairo_t *cr = (cairo_t *)_PTR(cairo_context);
// TODO: cairo is not stateless, so we should probably check that the state is not already what we want it to be before we tell cairo to change it
// NOTE: we should make sure that cairo doesn't do this microoptimization internally before we implement it here
char buf[10]; //#rrggbbaa\0
snprintf(buf, 10, "#%06x%02x", paint_color & 0x00FFFFFF, paint_color>>24);
GdkRGBA color;
gdk_rgba_parse(&color, buf);
gdk_cairo_set_source_rgba(cr, &color);
cairo_move_to(cr, start_x, start_y);
cairo_line_to(cr, stop_x, stop_y);
cairo_stroke(cr);
}
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1drawBitmap(JNIEnv *env , jclass this_class, jlong cairo_context, jlong widget, jlong _pixbuf, jfloat src_x, jfloat src_y , jfloat dest_x , jfloat dest_y, jobject paint)
{
cairo_t *cr = (cairo_t *)_PTR(cairo_context);
GdkPixbuf *pixbuf = (GdkPixbuf *)_PTR(_pixbuf);
cairo_translate(cr, dest_x, dest_y);
gdk_cairo_set_source_pixbuf(cr, pixbuf, src_x, src_y);
cairo_paint(cr);
cairo_translate(cr, -dest_x, -dest_y);
}
// TODO: if we switched to using the snapshot mechanic directly instead of having a DrawingArea, these two could possibly (maybe it clips or something?) be replaced with hw-accelerated Gsk functions
// NOTE: it's unclear whether using the snapshot mechanic would still give us the same cairo context each time, and getting the same cairo context each time sure is convenient
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1rotate(JNIEnv *env, jclass this, jlong cairo_context, jlong widget, jfloat angle)
{
cairo_t *cr = (cairo_t *)_PTR(cairo_context);
cairo_rotate(cr, DEG2RAD(angle));
}
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1rotate_1and_1translate(JNIEnv *env, jclass this, jlong cairo_context, jlong widget, jfloat angle, jfloat tx, jfloat ty)
{
cairo_t *cr = (cairo_t *)_PTR(cairo_context);
cairo_translate(cr, tx, ty);
cairo_rotate(cr, DEG2RAD(angle));
cairo_translate(cr, -tx, -ty);
}

View File

@@ -0,0 +1,7 @@
#include "generated_headers/android_os_SystemClock.h"
JNIEXPORT jlong JNICALL Java_android_os_SystemClock_elapsedRealtime(JNIEnv *env, jclass this)
{
printf("FIXME: Java_android_os_SystemClock_elapsedRealtime: returning 0\n");
return 0; // FIXME
}

View File

@@ -0,0 +1,11 @@
#include <gtk/gtk.h>
#include "defines.h"
#include "util.h"
#include "generated_headers/android_view_Window.h"
JNIEXPORT void JNICALL Java_android_view_Window_set_1widget_1as_1root(JNIEnv *env, jobject this, jlong window, jlong widget)
{
gtk_window_set_child(GTK_WINDOW(_PTR(window)), gtk_widget_get_parent(GTK_WIDGET(_PTR(widget))));
}

View File

@@ -0,0 +1,245 @@
#include <gtk/gtk.h>
#include <alsa/asoundlib.h>
#include <stdint.h>
#include <stdio.h>
#include "../defines.h"
#include "../util.h"
#include "../generated_headers/android_media_AudioTrack.h"
#define PCM_DEVICE "sysdefault:CARD=Generic_1"
void helper_hw_params_init(snd_pcm_t *pcm_handle, snd_pcm_hw_params_t *params, unsigned int rate, unsigned int channels, snd_pcm_format_t format)
{
int ret;
snd_pcm_hw_params_any(pcm_handle, params);
ret = snd_pcm_hw_params_set_access(pcm_handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
if (ret < 0)
printf("ERROR: Can't set interleaved mode. %s\n", snd_strerror(ret));
ret = snd_pcm_hw_params_set_format(pcm_handle, params, format);
if (ret < 0)
printf("ERROR: Can't set format. %s\n", snd_strerror(ret));
ret = snd_pcm_hw_params_set_channels(pcm_handle, params, channels);
if (ret < 0)
printf("ERROR: Can't set channels number. %s\n", snd_strerror(ret));
ret = snd_pcm_hw_params_set_rate_near(pcm_handle, params, &rate, 0);
if (ret < 0)
printf("ERROR: Can't set rate. %s\n", snd_strerror(ret));
}
JNIEXPORT void JNICALL Java_android_media_AudioTrack_native_1constructor(JNIEnv *env, jobject this, jint streamType, jint rate, jint channels, jint audioFormat, jint buffer_size, jint mode)
{
snd_pcm_t *pcm_handle;
snd_pcm_hw_params_t *params;
jint channels_out;
jint period_time;
int ret;
/* Open the PCM device in playback mode */
ret = snd_pcm_open(&pcm_handle, PCM_DEVICE, SND_PCM_STREAM_PLAYBACK, 0);
if (ret < 0)
printf("ERROR: Can't open \"%s\" PCM device. %s\n", PCM_DEVICE, snd_strerror(ret));
snd_pcm_hw_params_alloca(&params);
helper_hw_params_init(pcm_handle, params, rate, channels, SND_PCM_FORMAT_S16_LE);
/*--↓*/
snd_pcm_uframes_t buffer_size_as_uframes_t = buffer_size;
snd_pcm_hw_params_set_buffer_size_near (pcm_handle, params, &buffer_size_as_uframes_t);
/*--↑*/
/* Write parameters */
ret = snd_pcm_hw_params(pcm_handle, params);
if (ret < 0)
printf("ERROR: Can't set harware parameters. %s\n", snd_strerror(ret));
//snd_pcm_hw_params_free (hw_params);
/*--↓*/
snd_pcm_uframes_t period_size;
ret = snd_pcm_hw_params_get_period_size(params, &period_size, 0);
if (ret < 0)
printf("Error calling snd_pcm_hw_params_get_period_size: %s\n", snd_strerror(ret));
snd_pcm_sw_params_t *sw_params;
snd_pcm_sw_params_malloc (&sw_params);
snd_pcm_sw_params_current (pcm_handle, sw_params);
snd_pcm_sw_params_set_start_threshold(pcm_handle, sw_params, buffer_size - period_size);
snd_pcm_sw_params_set_avail_min(pcm_handle, sw_params, period_size);
snd_pcm_sw_params(pcm_handle, sw_params);
//snd_pcm_sw_params_free (sw_params);
/*--↑*/
/* Resume information */
printf("PCM name: '%s'\n", snd_pcm_name(pcm_handle));
printf("PCM state: %s\n", snd_pcm_state_name(snd_pcm_state(pcm_handle)));
snd_pcm_hw_params_get_channels(params, &channels_out);
printf("channels: %i ", channels_out);
if (channels_out == 1)
printf("(mono)\n");
else if (channels_out == 2)
printf("(stereo)\n");
unsigned int tmp;
snd_pcm_hw_params_get_rate(params, &tmp, 0);
printf("rate: %d bps\n", tmp);
snd_pcm_hw_params_get_period_time(params, &period_time, NULL);
_SET_LONG_FIELD(this, "pcm_handle", _INTPTR(pcm_handle));
_SET_LONG_FIELD(this, "params", _INTPTR(params));
_SET_INT_FIELD(this, "channels", channels_out);
_SET_INT_FIELD(this, "period_time", period_time);
}
JNIEXPORT jint JNICALL Java_android_media_AudioTrack_getMinBufferSize(JNIEnv *env, jclass this_class, jint sampleRateInHz, jint channelConfig, jint audioFormat)
{
snd_pcm_t *pcm_handle;
snd_pcm_hw_params_t *params;
snd_pcm_uframes_t frames;
int ret;
// TODO: clean up
unsigned int num_channels;
switch(channelConfig) {
case 2:
num_channels = 1;
break;
default:
num_channels = 1;
}
// ---
ret = snd_pcm_open(&pcm_handle, PCM_DEVICE, SND_PCM_STREAM_PLAYBACK, 0);
if (ret < 0)
printf("Error calling snd_pcm_open: %s\n", snd_strerror(ret));
snd_pcm_hw_params_alloca(&params);
helper_hw_params_init(pcm_handle, params, sampleRateInHz, num_channels, SND_PCM_FORMAT_S16_LE); // FIXME: a switch?
ret = snd_pcm_hw_params(pcm_handle, params);
if (ret < 0)
printf("Error calling snd_pcm_hw_params: %s\n", snd_strerror(ret));
ret = snd_pcm_hw_params_get_period_size(params, &frames, 0);
if (ret < 0)
printf("Error calling snd_pcm_hw_params_get_period_size: %s\n", snd_strerror(ret));
// TODO: snd_pcm_hw_params_free(params) causes segfault, is it not supposed to be called?
snd_pcm_close(pcm_handle);
_SET_STATIC_INT_FIELD(this_class, "frames", frames);
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
printf("\n\nJava_android_media_AudioTrack_getMinBufferSize is returning: %d\n\n\n", frames * num_channels * 2);
return frames * num_channels * 2; // FIXME: 2 bytes = 16 bits (s16)
}
struct jni_callback_data { JavaVM *jvm; jobject this; jclass this_class; jobject listener; jint period_time;};
void periodic_update_callback(snd_async_handler_t *pcm_callback)
{
struct jni_callback_data *d = snd_async_handler_get_callback_private(pcm_callback);
int getenv_ret;
int attach_ret = -1;
// printf("periodic_update_callback called!\n");
JNIEnv *env;
getenv_ret = (*d->jvm)->GetEnv(d->jvm, (void**)&env, JNI_VERSION_1_6);
// printf("!!!! GetEnv: %p getenv_ret: %d\n",env, getenv_ret);
if(getenv_ret == JNI_EDETACHED) {
printf("!!!! JNI_EDETACHED\n");
attach_ret = (*d->jvm)->AttachCurrentThread(d->jvm, (void**)&env, NULL);
// TODO error checking
}
(*env)->CallVoidMethod(env, d->listener, handle_cache.audio_track_periodic_listener.onPeriodicNotification, d->this);
if((*env)->ExceptionCheck(env))
(*env)->ExceptionDescribe(env);
if(attach_ret == JNI_OK) // if we (succesfully) attached a thread, we should probably detach it now
(*d->jvm)->DetachCurrentThread(d->jvm);
// microseconds to milliseconds
// g_timeout_add (d->period_time / 1000 - 2, G_SOURCE_FUNC(helper_loop), d);
// return G_SOURCE_REMOVE;
}
JNIEXPORT void JNICALL Java_android_media_AudioTrack_play(JNIEnv *env, jobject this)
{
pthread_t periodic_notification_thread;
int ret;
jint period_time = _GET_INT_FIELD(this, "period_time");
// FIXME - this callback should probably be set up elsewhere
JavaVM *jvm;
(*env)->GetJavaVM(env, &jvm);
struct jni_callback_data *callback_data = malloc(sizeof(struct jni_callback_data));
callback_data->jvm = jvm;
callback_data->this = _REF(this);
callback_data->this_class = _REF(_CLASS(this));
callback_data->listener = _REF(_GET_OBJ_FIELD(this, "periodic_update_listener", "Landroid/media/AudioTrack$OnPlaybackPositionUpdateListener;"));
callback_data->period_time = period_time;
// microseconds to milliseconds
//g_timeout_add (period_time / 1000, G_SOURCE_FUNC(helper_loop), callback_data);
/*--↓*/
snd_pcm_t *pcm_handle = _PTR(_GET_LONG_FIELD(this, "pcm_handle"));
snd_async_handler_t *pcm_callback;
snd_async_add_pcm_handler(&pcm_callback, pcm_handle, periodic_update_callback, callback_data);
snd_pcm_start(pcm_handle);
/*--↑*/
}
JNIEXPORT jint JNICALL Java_android_media_AudioTrack_write(JNIEnv *env, jobject this, jbyteArray audioData, jint offsetInBytes, jint sizeInBytes)
{
int ret;
jint channels = _GET_INT_FIELD(this, "channels");
snd_pcm_t *pcm_handle = _PTR(_GET_LONG_FIELD(this, "pcm_handle"));
snd_pcm_sframes_t frames_to_write = sizeInBytes / channels / 2; // FIXME - 2 means PCM16
snd_pcm_sframes_t frames_written;
jbyte *buffer = _GET_BYTE_ARRAY_ELEMENTS(audioData);
ret = frames_written = snd_pcm_writei(pcm_handle, buffer, frames_to_write);
if (ret < 0) {
if (ret == -EPIPE) {
printf("XRUN.\n");
snd_pcm_prepare(pcm_handle);
} else {
printf("ERROR. Can't write to PCM device. %s\n", snd_strerror(ret));
}
}
// printf("::::> tried to write %d frames, actually wrote %d frames.\n", frames_to_write, frames_written);
_RELEASE_BYTE_ARRAY_ELEMENTS(audioData, buffer);
}

View File

@@ -0,0 +1,37 @@
#ifndef _DEFINES_H_
#define _DEFINES_H_
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
#define DEG2RAD(deg) (deg * M_PI / 180)
// these macros are a bit hacky, since they deliberately assume that env exists and refers to the JNI env
#define _PTR(ptr)((void*)(intptr_t)ptr)
#define _INTPTR(ptr)((jlong)(intptr_t)ptr)
#define _REF(obj)((*env)->NewGlobalRef(env, obj))
#define _CLASS(object) ((*env)->GetObjectClass(env, object))
#define _SUPER(object) ((*env)->GetSuperclass(env, object))
#define _METHOD(class, method, attrs) ((*env)->GetMethodID(env, class, method, attrs))
#define _JSTRING(cstring) ((*env)->NewStringUTF(env, cstring))
#define _CSTRING(jstring) ((*env)->GetStringUTFChars(env, jstring, NULL))
#define _FIELD_ID(class, field, type) ((*env)->GetFieldID(env, class , field, type))
#define _STATIC_FIELD_ID(class, field, type) ((*env)->GetStaticFieldID(env, class , field, type))
#define _SET_OBJ_FIELD(object, field, type, value) ((*env)->SetObjectField(env, object, _FIELD_ID(_CLASS(object), field, type), value))
#define _GET_OBJ_FIELD(object, field, type) ((*env)->GetObjectField(env, object, _FIELD_ID(_CLASS(object), field, type)))
#define _SET_LONG_FIELD(object, field, value) ((*env)->SetLongField(env, object, _FIELD_ID(_CLASS(object), field, "J"), value))
#define _GET_LONG_FIELD(object, field) ((*env)->GetLongField(env, object, _FIELD_ID(_CLASS(object), field, "J")))
#define _SET_INT_FIELD(object, field, value) ((*env)->SetIntField(env, object, _FIELD_ID(_CLASS(object), field, "I"), value))
#define _SET_STATIC_INT_FIELD(class, field, value) ((*env)->SetStaticIntField(env, class, _STATIC_FIELD_ID(class, field, "I"), value))
#define _GET_INT_FIELD(object, field) ((*env)->GetIntField(env, object, _FIELD_ID(_CLASS(object), field, "I")))
#define _GET_BYTE_ARRAY_ELEMENTS(b_array) ((*env)->GetByteArrayElements(env, b_array, NULL))
#define _RELEASE_BYTE_ARRAY_ELEMENTS(b_array, buffer_ptr) ((*env)->ReleaseByteArrayElements(env, b_array, buffer_ptr, 0))
// this really doesn't belong here, should probably put this in Java and deal with ugly name convention of autogenerated headers
#define MOTION_EVENT_ACTION_DOWN 0
#define MOTION_EVENT_ACTION_UP 1
#define MOTION_EVENT_ACTION_MOVE 2
#endif

View File

@@ -0,0 +1,386 @@
#include <gtk/gtk.h>
#include "ninepatch.h"
// ----- following yeeted from https://github.com/tongjinlv/my_xboot/blob/3d6a255ef4118486c13953cb07a805b0baab4bc2/src/framework/display/l-ninepatch.c -----
// [ FIXME: 1) this doesn't operate on binary 9patch files, but on source ones 2) this only works for basic cases where you have at most nine patches ]
static inline int detect_black_pixel(unsigned char * p)
{
return (((p[0] == 0) && (p[1] == 0) && (p[2] == 0) && (p[3] != 0)) ? 1 : 0);
}
void ninepatch_stretch(struct ninepatch_t * ninepatch, double width, double height)
{
int lr = ninepatch->left + ninepatch->right;
int tb = ninepatch->top + ninepatch->bottom;
if(width < ninepatch->width)
width = ninepatch->width;
if(height < ninepatch->height)
height = ninepatch->height;
ninepatch->__w = width;
ninepatch->__h = height;
ninepatch->__sx = (ninepatch->__w - lr) / (ninepatch->width - lr);
ninepatch->__sy = (ninepatch->__h - tb) / (ninepatch->height - tb);
}
static bool surface_to_ninepatch(cairo_surface_t * surface, struct ninepatch_t * patch)
{
cairo_surface_t * cs;
cairo_t * cr;
unsigned char * data;
int width, height;
int stride;
int w, h;
int i;
if(!surface || !patch)
return FALSE;
width = cairo_image_surface_get_width(surface);
height = cairo_image_surface_get_height(surface);
if(width < 3 || height < 3)
return FALSE;
/* Nine patch chunk */
cs = cairo_surface_create_similar_image(surface, CAIRO_FORMAT_ARGB32, width, height);
cr = cairo_create(cs);
cairo_set_source_surface(cr, surface, 0, 0);
cairo_paint(cr);
cairo_destroy(cr);
data = cairo_image_surface_get_data(cs);
stride = cairo_image_surface_get_stride(cs);
/* Nine patch default size */
width = width - 2;
height = height - 2;
patch->width = width;
patch->height = height;
/* Stretch information */
patch->left = 0;
patch->right = 0;
patch->top = 0;
patch->right = 0;
for(i = 0; i < width; i++)
{
if(detect_black_pixel(&data[(i + 1) * 4]))
{
patch->left = i;
break;
}
}
for(i = width - 1; i >= 0; i--)
{
if(detect_black_pixel(&data[(i + 1) * 4]))
{
patch->right = width - 1 - i;
break;
}
}
for(i = 0; i < height; i++)
{
if(detect_black_pixel(&data[stride * (i + 1)]))
{
patch->top = i;
break;
}
}
for(i = height - 1; i >= 0; i--)
{
if(detect_black_pixel(&data[stride * (i + 1)]))
{
patch->bottom = height - 1 - i;
break;
}
}
cairo_surface_destroy(cs);
/* Left top */
w = patch->left;
h = patch->top;
if(w > 0 && h > 0)
{
cs = cairo_surface_create_similar(surface, cairo_surface_get_content(surface), patch->left, patch->top);
cr = cairo_create(cs);
cairo_set_source_surface(cr, surface, -1, -1);
cairo_paint(cr);
cairo_destroy(cr);
patch->lt = cs;
}
else
{
patch->lt = NULL;
}
/* Middle top */
w = width - patch->left - patch->right;
h = patch->top;
if(w > 0 && h > 0)
{
cs = cairo_surface_create_similar(surface, cairo_surface_get_content(surface), w, h);
cr = cairo_create(cs);
cairo_set_source_surface(cr, surface, -patch->left - 1, -1);
cairo_paint(cr);
cairo_destroy(cr);
patch->mt = cs;
}
else
{
patch->mt = NULL;
}
/* Right top */
w = patch->right;
h = patch->top;
if(w > 0 && h > 0)
{
cs = cairo_surface_create_similar(surface, cairo_surface_get_content(surface), w, h);
cr = cairo_create(cs);
cairo_set_source_surface(cr, surface, -(width - patch->right) - 1, -1);
cairo_paint(cr);
cairo_destroy(cr);
patch->rt = cs;
}
else
{
patch->rt = NULL;
}
/* Left Middle */
w = patch->left;
h = height - patch->top - patch->bottom;
if(w > 0 && h > 0)
{
cs = cairo_surface_create_similar(surface, cairo_surface_get_content(surface), w, h);
cr = cairo_create(cs);
cairo_set_source_surface(cr, surface, -1, -patch->top - 1);
cairo_paint(cr);
cairo_destroy(cr);
patch->lm = cs;
}
else
{
patch->lm = NULL;
}
/* Middle Middle */
w = width - patch->left - patch->right;
h = height - patch->top - patch->bottom;
if(w > 0 && h > 0)
{
cs = cairo_surface_create_similar(surface, cairo_surface_get_content(surface), w, h);
cr = cairo_create(cs);
cairo_set_source_surface(cr, surface, -patch->left - 1, -patch->top - 1);
cairo_paint(cr);
cairo_destroy(cr);
patch->mm = cs;
}
else
{
patch->mm = NULL;
}
/* Right middle */
w = patch->right;
h = height - patch->top - patch->bottom;
if(w > 0 && h > 0)
{
cs = cairo_surface_create_similar(surface, cairo_surface_get_content(surface), w, h);
cr = cairo_create(cs);
cairo_set_source_surface(cr, surface, -(width - patch->right) - 1, -patch->top - 1);
cairo_paint(cr);
cairo_destroy(cr);
patch->rm = cs;
}
else
{
patch->rm = NULL;
}
/* Left bottom */
w = patch->left;
h = patch->bottom;
if(w > 0 && h > 0)
{
cs = cairo_surface_create_similar(surface, cairo_surface_get_content(surface), w, h);
cr = cairo_create(cs);
cairo_set_source_surface(cr, surface, -1, -(height - patch->bottom) - 1);
cairo_paint(cr);
cairo_destroy(cr);
patch->lb = cs;
}
else
{
patch->lb = NULL;
}
/* Middle bottom */
w = width - patch->left - patch->right;
h = patch->bottom;
if(w > 0 && h > 0)
{
cs = cairo_surface_create_similar(surface, cairo_surface_get_content(surface), w, h);
cr = cairo_create(cs);
cairo_set_source_surface(cr, surface, -patch->left - 1, -(height - patch->bottom) - 1);
cairo_paint(cr);
cairo_destroy(cr);
patch->mb = cs;
}
else
{
patch->mb = NULL;
}
/* Right bottom */
w = patch->right;
h = patch->bottom;
if(w > 0 && h > 0)
{
cs = cairo_surface_create_similar(surface, cairo_surface_get_content(surface), w, h);
cr = cairo_create(cs);
cairo_set_source_surface(cr, surface, -(width - patch->right) - 1, -(height - patch->bottom) - 1);
cairo_paint(cr);
cairo_destroy(cr);
patch->rb = cs;
}
else
{
patch->rb = NULL;
}
ninepatch_stretch(patch, width, height);
return TRUE;
}
struct ninepatch_t * ninepatch_new(char *filename)
{
struct ninepatch_t *ninepatch = malloc(sizeof(struct ninepatch_t));
cairo_surface_t *surface = cairo_image_surface_create_from_png(filename);
if(cairo_surface_status(surface) != CAIRO_STATUS_SUCCESS)
exit(-1);
bool result = surface_to_ninepatch(surface, ninepatch);
cairo_surface_destroy(surface);
if(!result)
exit(-2);
return ninepatch;
}
// ----- end of borrowed code -----
cairo_surface_t * ninepatch_to_surface(struct ninepatch_t *ninepatch)
{
static const cairo_matrix_t identity = {1, 0,
0, 1,
0, 0};
cairo_surface_t *cs = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, (int)ninepatch->__w, (int)ninepatch->__h);
cairo_t *cr = cairo_create(cs);
cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE);
// relevant measurements
const int left_w = ninepatch->left;
const int top_h = ninepatch->top;
const int middle_h = ninepatch->height - ninepatch->top - ninepatch->bottom;
const int middle_w = ninepatch->width - ninepatch->left - ninepatch->right;
// offset for left/top is zero, and for middle it's width/height of left/top respectively
double offset_right_x = left_w + middle_w * ninepatch->__sx;
double offset_bottom_y = top_h + middle_h * ninepatch->__sy;
// --- left top ---
if(ninepatch->lt) {
cairo_set_source_surface(cr, ninepatch->lt, 0, 0);
cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
cairo_paint(cr);
}
// --- left middle ---
if(ninepatch->lm) {
cairo_translate(cr, 0, top_h);
cairo_scale(cr, 1, ninepatch->__sy);
cairo_set_source_surface(cr, ninepatch->lm, 0, 0);
cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
cairo_paint(cr);
cairo_set_matrix(cr, &identity);
}
// --- left bottom ---
if(ninepatch->lb) {
cairo_translate(cr, 0, offset_bottom_y);
cairo_set_source_surface(cr, ninepatch->lb, 0, 0);
cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
cairo_paint(cr);
cairo_set_matrix(cr, &identity);
}
// -------------------------------------------------------------------------
// --- middle top ---
if(ninepatch->mt) {
cairo_translate(cr, left_w, 0);
cairo_scale(cr, ninepatch->__sx, 1);
cairo_set_source_surface(cr, ninepatch->mt, 0, 0);
cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
cairo_paint(cr);
cairo_set_matrix(cr, &identity);
}
// --- middle middle ---
if(ninepatch->mm) {
cairo_translate(cr, left_w, top_h);
cairo_scale(cr, ninepatch->__sx, ninepatch->__sy);
cairo_set_source_surface(cr, ninepatch->mm, 0, 0);
cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
cairo_paint(cr);
cairo_set_matrix(cr, &identity);
}
// --- middle bottom ---
if(ninepatch->mb) {
cairo_translate(cr, left_w, offset_bottom_y);
cairo_scale(cr, ninepatch->__sx, 1);
cairo_set_source_surface(cr, ninepatch->mb, 0, 0);
cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
cairo_paint(cr);
cairo_set_matrix(cr, &identity);
}
// -------------------------------------------------------------------------
// --- right top ---
if(ninepatch->rt) {
cairo_translate(cr, offset_right_x, 0);
cairo_set_source_surface(cr, ninepatch->rt, 0, 0);
cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
cairo_paint(cr);
cairo_set_matrix(cr, &identity);
}
// --- right middle ---
if(ninepatch->rm) {
cairo_translate(cr, offset_right_x, top_h);
cairo_scale(cr, 1, ninepatch->__sy);
cairo_set_source_surface(cr, ninepatch->rm, 0, 0);
cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
cairo_paint(cr);
cairo_set_matrix(cr, &identity);
}
// --- right bottom ---
if(ninepatch->rb) {
cairo_translate(cr, offset_right_x, offset_bottom_y);
cairo_set_source_surface(cr, ninepatch->rb, 0, 0);
cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
cairo_paint(cr);
cairo_set_matrix(cr, &identity);
}
printf(";;;;;; %lf %lf | %d %d\n", ninepatch->__w, ninepatch->__h, cairo_image_surface_get_width(cs), cairo_image_surface_get_height(cs));
return cs;
}

View File

@@ -0,0 +1,24 @@
#ifndef NINEPATCH_H
#define NINEPATCH_H
struct ninepatch_t {
int width, height;
int left, top, right, bottom;
cairo_surface_t * lt;
cairo_surface_t * mt;
cairo_surface_t * rt;
cairo_surface_t * lm;
cairo_surface_t * mm;
cairo_surface_t * rm;
cairo_surface_t * lb;
cairo_surface_t * mb;
cairo_surface_t * rb;
double __w, __h;
double __sx, __sy;
};
void ninepatch_stretch(struct ninepatch_t * ninepatch, double width, double height);
struct ninepatch_t * ninepatch_new(char *filename);
cairo_surface_t * ninepatch_to_surface(struct ninepatch_t *ninepatch);
#endif

View File

@@ -0,0 +1,69 @@
#include <EGL/egl.h>
#include "../defines.h"
#include "../util.h"
#include "../generated_headers/com_google_android_gles_jni_EGLImpl.h"
// helpers from android source (TODO: either use GetIntArrayElements, or figure out if GetPrimitiveArrayCritical is superior and use it everywhere if so)
static jint* get_int_array_crit(JNIEnv *env, jintArray array) {
if (array != NULL) {
return (jint *)(*env)->GetPrimitiveArrayCritical(env, array, (jboolean *)0);
} else {
return(jint*) NULL; // FIXME - do apps expect us to use some default?
}
}
static void release_int_array_crit(JNIEnv *env, jintArray array, jint* base) {
if (array != NULL) {
(*env)->ReleasePrimitiveArrayCritical(env, array, base, JNI_ABORT);
}
}
// ---
static jlong* get_long_array_crit(JNIEnv *env, jlongArray array) {
if (array != NULL) {
return (jlong *)(*env)->GetPrimitiveArrayCritical(env, array, (jboolean *)0);
} else {
return(jlong*) NULL; // FIXME - do apps expect us to use some default?
}
}
static void release_long_array_crit(JNIEnv *env, jlongArray array, jlong* base) {
if (array != NULL) {
(*env)->ReleasePrimitiveArrayCritical(env, array, base, JNI_ABORT);
}
}
JNIEXPORT jlong JNICALL Java_com_google_android_gles_1jni_EGLImpl_native_1eglCreateContext(JNIEnv *env, jobject this, jlong egl_display, jlong egl_config, jobject share_context, jintArray attrib_list)
{
printf("env: %p, this: %p, egl_display: %p, egl_config: %p, share_context: %p, attrib_list: %p\n", env, this, _PTR(egl_display), _PTR(egl_config), share_context, attrib_list);
jint* attrib_base = get_int_array_crit(env, attrib_list);
EGLContext egl_context = eglCreateContext(_PTR(egl_display), _PTR(egl_config), NULL, attrib_base);
printf("egl_context: %d\n", egl_context);
release_int_array_crit(env, attrib_list, attrib_base);
return _INTPTR(egl_context);
}
JNIEXPORT jboolean JNICALL Java_com_google_android_gles_1jni_EGLImpl_native_1eglChooseConfig(JNIEnv *env, jobject this, jlong egl_display, jintArray attrib_list, jlongArray egl_configs, jint config_size, jintArray num_config)
{
int ret;
jint* attrib_base = get_int_array_crit(env, attrib_list);
jlong* configs_base = get_long_array_crit(env, egl_configs);
jint* num_config_base = get_int_array_crit(env, num_config);
ret = eglChooseConfig(_PTR(egl_display), attrib_base, egl_configs ? _PTR(configs_base) : NULL, config_size, num_config_base);
printf(".. eglChooseConfig: egl_display: %p, egl_configs: %d, _PTR(configs_base): %p, config_size: %d, num_config_base[0]: %d\n", egl_display, egl_configs, _PTR(configs_base), config_size, num_config_base[0]);
release_int_array_crit(env, attrib_list, attrib_base);
release_long_array_crit(env, egl_configs, configs_base);
release_int_array_crit(env, num_config, num_config_base);
return ret;
}

View File

@@ -0,0 +1,367 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_content_res_AssetManager */
#ifndef _Included_android_content_res_AssetManager
#define _Included_android_content_res_AssetManager
#ifdef __cplusplus
extern "C" {
#endif
#undef android_content_res_AssetManager_ACCESS_UNKNOWN
#define android_content_res_AssetManager_ACCESS_UNKNOWN 0L
#undef android_content_res_AssetManager_ACCESS_RANDOM
#define android_content_res_AssetManager_ACCESS_RANDOM 1L
#undef android_content_res_AssetManager_ACCESS_STREAMING
#define android_content_res_AssetManager_ACCESS_STREAMING 2L
#undef android_content_res_AssetManager_ACCESS_BUFFER
#define android_content_res_AssetManager_ACCESS_BUFFER 3L
#undef android_content_res_AssetManager_localLOGV
#define android_content_res_AssetManager_localLOGV 0L
#undef android_content_res_AssetManager_DEBUG_REFS
#define android_content_res_AssetManager_DEBUG_REFS 0L
#undef android_content_res_AssetManager_STYLE_NUM_ENTRIES
#define android_content_res_AssetManager_STYLE_NUM_ENTRIES 6L
#undef android_content_res_AssetManager_STYLE_TYPE
#define android_content_res_AssetManager_STYLE_TYPE 0L
#undef android_content_res_AssetManager_STYLE_DATA
#define android_content_res_AssetManager_STYLE_DATA 1L
#undef android_content_res_AssetManager_STYLE_ASSET_COOKIE
#define android_content_res_AssetManager_STYLE_ASSET_COOKIE 2L
#undef android_content_res_AssetManager_STYLE_RESOURCE_ID
#define android_content_res_AssetManager_STYLE_RESOURCE_ID 3L
#undef android_content_res_AssetManager_STYLE_CHANGING_CONFIGURATIONS
#define android_content_res_AssetManager_STYLE_CHANGING_CONFIGURATIONS 4L
#undef android_content_res_AssetManager_STYLE_DENSITY
#define android_content_res_AssetManager_STYLE_DENSITY 5L
/*
* Class: android_content_res_AssetManager
* Method: list
* Signature: (Ljava/lang/String;)[Ljava/lang/String;
*/
JNIEXPORT jobjectArray JNICALL Java_android_content_res_AssetManager_list
(JNIEnv *, jobject, jstring);
/*
* Class: android_content_res_AssetManager
* Method: addAssetPathNative
* Signature: (Ljava/lang/String;)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_addAssetPathNative
(JNIEnv *, jobject, jstring);
/*
* Class: android_content_res_AssetManager
* Method: isUpToDate
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL Java_android_content_res_AssetManager_isUpToDate
(JNIEnv *, jobject);
/*
* Class: android_content_res_AssetManager
* Method: setLocale
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_android_content_res_AssetManager_setLocale
(JNIEnv *, jobject, jstring);
/*
* Class: android_content_res_AssetManager
* Method: getLocales
* Signature: ()[Ljava/lang/String;
*/
JNIEXPORT jobjectArray JNICALL Java_android_content_res_AssetManager_getLocales
(JNIEnv *, jobject);
/*
* Class: android_content_res_AssetManager
* Method: setConfiguration
* Signature: (IILjava/lang/String;IIIIIIIIIIIIII)V
*/
JNIEXPORT void JNICALL Java_android_content_res_AssetManager_setConfiguration
(JNIEnv *, jobject, jint, jint, jstring, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint);
/*
* Class: android_content_res_AssetManager
* Method: getResourceName
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_android_content_res_AssetManager_getResourceName
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: getResourcePackageName
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_android_content_res_AssetManager_getResourcePackageName
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: getResourceTypeName
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_android_content_res_AssetManager_getResourceTypeName
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: getResourceEntryName
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_android_content_res_AssetManager_getResourceEntryName
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: openAsset
* Signature: (Ljava/lang/String;I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_openAsset
(JNIEnv *, jobject, jstring, jint);
/*
* Class: android_content_res_AssetManager
* Method: openAssetFd
* Signature: (Ljava/lang/String;[J)Landroid/os/ParcelFileDescriptor;
*/
JNIEXPORT jobject JNICALL Java_android_content_res_AssetManager_openAssetFd
(JNIEnv *, jobject, jstring, jlongArray);
/*
* Class: android_content_res_AssetManager
* Method: openNonAssetFdNative
* Signature: (ILjava/lang/String;[J)Landroid/os/ParcelFileDescriptor;
*/
JNIEXPORT jobject JNICALL Java_android_content_res_AssetManager_openNonAssetFdNative
(JNIEnv *, jobject, jint, jstring, jlongArray);
/*
* Class: android_content_res_AssetManager
* Method: destroyAsset
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_content_res_AssetManager_destroyAsset
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: readAssetChar
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_readAssetChar
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: readAsset
* Signature: (I[BII)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_readAsset
(JNIEnv *, jobject, jint, jbyteArray, jint, jint);
/*
* Class: android_content_res_AssetManager
* Method: seekAsset
* Signature: (IJI)J
*/
JNIEXPORT jlong JNICALL Java_android_content_res_AssetManager_seekAsset
(JNIEnv *, jobject, jint, jlong, jint);
/*
* Class: android_content_res_AssetManager
* Method: getAssetLength
* Signature: (I)J
*/
JNIEXPORT jlong JNICALL Java_android_content_res_AssetManager_getAssetLength
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: getAssetRemainingLength
* Signature: (I)J
*/
JNIEXPORT jlong JNICALL Java_android_content_res_AssetManager_getAssetRemainingLength
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: loadResourceValue
* Signature: (ISLandroid/util/TypedValue;Z)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_loadResourceValue
(JNIEnv *, jobject, jint, jshort, jobject, jboolean);
/*
* Class: android_content_res_AssetManager
* Method: loadResourceBagValue
* Signature: (IILandroid/util/TypedValue;Z)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_loadResourceBagValue
(JNIEnv *, jobject, jint, jint, jobject, jboolean);
/*
* Class: android_content_res_AssetManager
* Method: applyStyle
* Signature: (IIII[I[I[I)Z
*/
JNIEXPORT jboolean JNICALL Java_android_content_res_AssetManager_applyStyle
(JNIEnv *, jclass, jint, jint, jint, jint, jintArray, jintArray, jintArray);
/*
* Class: android_content_res_AssetManager
* Method: retrieveAttributes
* Signature: (I[I[I[I)Z
*/
JNIEXPORT jboolean JNICALL Java_android_content_res_AssetManager_retrieveAttributes
(JNIEnv *, jobject, jint, jintArray, jintArray, jintArray);
/*
* Class: android_content_res_AssetManager
* Method: getArraySize
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_getArraySize
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: retrieveArray
* Signature: (I[I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_retrieveArray
(JNIEnv *, jobject, jint, jintArray);
/*
* Class: android_content_res_AssetManager
* Method: getStringBlockCount
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_getStringBlockCount
(JNIEnv *, jobject);
/*
* Class: android_content_res_AssetManager
* Method: getNativeStringBlock
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_getNativeStringBlock
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: getCookieName
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_android_content_res_AssetManager_getCookieName
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: getGlobalAssetCount
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_getGlobalAssetCount
(JNIEnv *, jclass);
/*
* Class: android_content_res_AssetManager
* Method: getAssetAllocations
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_android_content_res_AssetManager_getAssetAllocations
(JNIEnv *, jclass);
/*
* Class: android_content_res_AssetManager
* Method: getGlobalAssetManagerCount
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_getGlobalAssetManagerCount
(JNIEnv *, jclass);
/*
* Class: android_content_res_AssetManager
* Method: newTheme
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_newTheme
(JNIEnv *, jobject);
/*
* Class: android_content_res_AssetManager
* Method: deleteTheme
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_content_res_AssetManager_deleteTheme
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: applyThemeStyle
* Signature: (IIZ)V
*/
JNIEXPORT void JNICALL Java_android_content_res_AssetManager_applyThemeStyle
(JNIEnv *, jclass, jint, jint, jboolean);
/*
* Class: android_content_res_AssetManager
* Method: copyTheme
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_android_content_res_AssetManager_copyTheme
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_content_res_AssetManager
* Method: loadThemeAttributeValue
* Signature: (IILandroid/util/TypedValue;Z)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_loadThemeAttributeValue
(JNIEnv *, jclass, jint, jint, jobject, jboolean);
/*
* Class: android_content_res_AssetManager
* Method: dumpTheme
* Signature: (IILjava/lang/String;Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_android_content_res_AssetManager_dumpTheme
(JNIEnv *, jclass, jint, jint, jstring, jstring);
/*
* Class: android_content_res_AssetManager
* Method: getArrayStringResource
* Signature: (I)[Ljava/lang/String;
*/
JNIEXPORT jobjectArray JNICALL Java_android_content_res_AssetManager_getArrayStringResource
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: getArrayStringInfo
* Signature: (I)[I
*/
JNIEXPORT jintArray JNICALL Java_android_content_res_AssetManager_getArrayStringInfo
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: getArrayIntResource
* Signature: (I)[I
*/
JNIEXPORT jintArray JNICALL Java_android_content_res_AssetManager_getArrayIntResource
(JNIEnv *, jobject, jint);
/*
* Class: android_content_res_AssetManager
* Method: destroy
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_android_content_res_AssetManager_destroy
(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,55 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_content_res_StringBlock */
#ifndef _Included_android_content_res_StringBlock
#define _Included_android_content_res_StringBlock
#ifdef __cplusplus
extern "C" {
#endif
#undef android_content_res_StringBlock_localLOGV
#define android_content_res_StringBlock_localLOGV 0L
/*
* Class: android_content_res_StringBlock
* Method: nativeCreate
* Signature: ([BII)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_StringBlock_nativeCreate
(JNIEnv *, jclass, jbyteArray, jint, jint);
/*
* Class: android_content_res_StringBlock
* Method: nativeGetSize
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_StringBlock_nativeGetSize
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_StringBlock
* Method: nativeGetString
* Signature: (II)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_android_content_res_StringBlock_nativeGetString
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_content_res_StringBlock
* Method: nativeGetStyle
* Signature: (II)[I
*/
JNIEXPORT jintArray JNICALL Java_android_content_res_StringBlock_nativeGetStyle
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_content_res_StringBlock
* Method: nativeDestroy
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_content_res_StringBlock_nativeDestroy
(JNIEnv *, jclass, jint);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,183 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_content_res_XmlBlock */
#ifndef _Included_android_content_res_XmlBlock
#define _Included_android_content_res_XmlBlock
#ifdef __cplusplus
extern "C" {
#endif
#undef android_content_res_XmlBlock_DEBUG
#define android_content_res_XmlBlock_DEBUG 0L
/*
* Class: android_content_res_XmlBlock
* Method: nativeCreate
* Signature: ([BII)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeCreate
(JNIEnv *, jclass, jbyteArray, jint, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetStringBlock
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetStringBlock
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeCreateParseState
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeCreateParseState
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeNext
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeNext
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetNamespace
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetNamespace
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetName
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetName
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetText
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetText
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetLineNumber
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetLineNumber
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetAttributeCount
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetAttributeCount
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetAttributeNamespace
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetAttributeNamespace
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetAttributeName
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetAttributeName
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetAttributeResource
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetAttributeResource
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetAttributeDataType
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetAttributeDataType
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetAttributeData
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetAttributeData
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetAttributeStringValue
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetAttributeStringValue
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetIdAttribute
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetIdAttribute
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetClassAttribute
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetClassAttribute
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetStyleAttribute
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetStyleAttribute
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeGetAttributeIndex
* Signature: (ILjava/lang/String;Ljava/lang/String;)I
*/
JNIEXPORT jint JNICALL Java_android_content_res_XmlBlock_nativeGetAttributeIndex
(JNIEnv *, jclass, jint, jstring, jstring);
/*
* Class: android_content_res_XmlBlock
* Method: nativeDestroyParseState
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_content_res_XmlBlock_nativeDestroyParseState
(JNIEnv *, jclass, jint);
/*
* Class: android_content_res_XmlBlock
* Method: nativeDestroy
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_content_res_XmlBlock_nativeDestroy
(JNIEnv *, jclass, jint);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,217 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_graphics_Bitmap */
#ifndef _Included_android_graphics_Bitmap
#define _Included_android_graphics_Bitmap
#ifdef __cplusplus
extern "C" {
#endif
#undef android_graphics_Bitmap_DENSITY_NONE
#define android_graphics_Bitmap_DENSITY_NONE 0L
#undef android_graphics_Bitmap_WORKING_COMPRESS_STORAGE
#define android_graphics_Bitmap_WORKING_COMPRESS_STORAGE 4096L
/*
* Class: android_graphics_Bitmap
* Method: native_bitmap_from_path
* Signature: (Ljava/lang/CharSequence;)J
*/
JNIEXPORT jlong JNICALL Java_android_graphics_Bitmap_native_1bitmap_1from_1path
(JNIEnv *, jobject, jobject);
/*
* Class: android_graphics_Bitmap
* Method: getWidth
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_getWidth
(JNIEnv *, jobject);
/*
* Class: android_graphics_Bitmap
* Method: getHeight
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_getHeight
(JNIEnv *, jobject);
/*
* Class: android_graphics_Bitmap
* Method: nativeCopy
* Signature: (IIZ)Landroid/graphics/Bitmap;
*/
JNIEXPORT jobject JNICALL Java_android_graphics_Bitmap_nativeCopy
(JNIEnv *, jclass, jint, jint, jboolean);
/*
* Class: android_graphics_Bitmap
* Method: nativeDestructor
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeDestructor
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeRecycle
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Bitmap_nativeRecycle
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeReconfigure
* Signature: (IIIII)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeReconfigure
(JNIEnv *, jclass, jint, jint, jint, jint, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeCompress
* Signature: (IIILjava/io/OutputStream;[B)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Bitmap_nativeCompress
(JNIEnv *, jclass, jint, jint, jint, jobject, jbyteArray);
/*
* Class: android_graphics_Bitmap
* Method: nativeErase
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeErase
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeRowBytes
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_nativeRowBytes
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeConfig
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_nativeConfig
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeGetPixel
* Signature: (IIIZ)I
*/
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_nativeGetPixel
(JNIEnv *, jclass, jint, jint, jint, jboolean);
/*
* Class: android_graphics_Bitmap
* Method: nativeGetPixels
* Signature: (I[IIIIIIIZ)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeGetPixels
(JNIEnv *, jclass, jint, jintArray, jint, jint, jint, jint, jint, jint, jboolean);
/*
* Class: android_graphics_Bitmap
* Method: nativeSetPixel
* Signature: (IIIIZ)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeSetPixel
(JNIEnv *, jclass, jint, jint, jint, jint, jboolean);
/*
* Class: android_graphics_Bitmap
* Method: nativeSetPixels
* Signature: (I[IIIIIIIZ)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeSetPixels
(JNIEnv *, jclass, jint, jintArray, jint, jint, jint, jint, jint, jint, jboolean);
/*
* Class: android_graphics_Bitmap
* Method: nativeCopyPixelsToBuffer
* Signature: (ILjava/nio/Buffer;)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeCopyPixelsToBuffer
(JNIEnv *, jclass, jint, jobject);
/*
* Class: android_graphics_Bitmap
* Method: nativeCopyPixelsFromBuffer
* Signature: (ILjava/nio/Buffer;)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeCopyPixelsFromBuffer
(JNIEnv *, jclass, jint, jobject);
/*
* Class: android_graphics_Bitmap
* Method: nativeGenerationId
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_nativeGenerationId
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeExtractAlpha
* Signature: (II[I)Landroid/graphics/Bitmap;
*/
JNIEXPORT jobject JNICALL Java_android_graphics_Bitmap_nativeExtractAlpha
(JNIEnv *, jclass, jint, jint, jintArray);
/*
* Class: android_graphics_Bitmap
* Method: nativePrepareToDraw
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativePrepareToDraw
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeHasAlpha
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Bitmap_nativeHasAlpha
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeSetAlphaAndPremultiplied
* Signature: (IZZ)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeSetAlphaAndPremultiplied
(JNIEnv *, jclass, jint, jboolean, jboolean);
/*
* Class: android_graphics_Bitmap
* Method: nativeHasMipMap
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Bitmap_nativeHasMipMap
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Bitmap
* Method: nativeSetHasMipMap
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Bitmap_nativeSetHasMipMap
(JNIEnv *, jclass, jint, jboolean);
/*
* Class: android_graphics_Bitmap
* Method: nativeSameAs
* Signature: (II)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Bitmap_nativeSameAs
(JNIEnv *, jclass, jint, jint);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,55 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_graphics_BitmapFactory */
#ifndef _Included_android_graphics_BitmapFactory
#define _Included_android_graphics_BitmapFactory
#ifdef __cplusplus
extern "C" {
#endif
#undef android_graphics_BitmapFactory_DECODE_BUFFER_SIZE
#define android_graphics_BitmapFactory_DECODE_BUFFER_SIZE 16384L
/*
* Class: android_graphics_BitmapFactory
* Method: nativeDecodeStream
* Signature: (Ljava/io/InputStream;[BLandroid/graphics/Rect;Landroid/graphics/BitmapFactory/Options;)Landroid/graphics/Bitmap;
*/
JNIEXPORT jobject JNICALL Java_android_graphics_BitmapFactory_nativeDecodeStream
(JNIEnv *, jclass, jobject, jbyteArray, jobject, jobject);
/*
* Class: android_graphics_BitmapFactory
* Method: nativeDecodeFileDescriptor
* Signature: (Ljava/io/FileDescriptor;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory/Options;)Landroid/graphics/Bitmap;
*/
JNIEXPORT jobject JNICALL Java_android_graphics_BitmapFactory_nativeDecodeFileDescriptor
(JNIEnv *, jclass, jobject, jobject, jobject);
/*
* Class: android_graphics_BitmapFactory
* Method: nativeDecodeAsset
* Signature: (ILandroid/graphics/Rect;Landroid/graphics/BitmapFactory/Options;)Landroid/graphics/Bitmap;
*/
JNIEXPORT jobject JNICALL Java_android_graphics_BitmapFactory_nativeDecodeAsset
(JNIEnv *, jclass, jint, jobject, jobject);
/*
* Class: android_graphics_BitmapFactory
* Method: nativeDecodeByteArray
* Signature: ([BIILandroid/graphics/BitmapFactory/Options;)Landroid/graphics/Bitmap;
*/
JNIEXPORT jobject JNICALL Java_android_graphics_BitmapFactory_nativeDecodeByteArray
(JNIEnv *, jclass, jbyteArray, jint, jint, jobject);
/*
* Class: android_graphics_BitmapFactory
* Method: nativeIsSeekable
* Signature: (Ljava/io/FileDescriptor;)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_BitmapFactory_nativeIsSeekable
(JNIEnv *, jclass, jobject);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,21 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_graphics_BitmapFactory_Options */
#ifndef _Included_android_graphics_BitmapFactory_Options
#define _Included_android_graphics_BitmapFactory_Options
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: android_graphics_BitmapFactory_Options
* Method: requestCancel
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_android_graphics_BitmapFactory_00024Options_requestCancel
(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,61 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_graphics_Canvas */
#ifndef _Included_android_graphics_Canvas
#define _Included_android_graphics_Canvas
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: android_graphics_Canvas
* Method: native_save
* Signature: (JJ)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1save
(JNIEnv *, jclass, jlong, jlong);
/*
* Class: android_graphics_Canvas
* Method: native_restore
* Signature: (JJ)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1restore
(JNIEnv *, jclass, jlong, jlong);
/*
* Class: android_graphics_Canvas
* Method: native_drawLine
* Signature: (JJFFFFI)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1drawLine
(JNIEnv *, jclass, jlong, jlong, jfloat, jfloat, jfloat, jfloat, jint);
/*
* Class: android_graphics_Canvas
* Method: native_drawBitmap
* Signature: (JJJFFFFLandroid/graphics/Paint;)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1drawBitmap
(JNIEnv *, jclass, jlong, jlong, jlong, jfloat, jfloat, jfloat, jfloat, jobject);
/*
* Class: android_graphics_Canvas
* Method: native_rotate
* Signature: (JJF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1rotate
(JNIEnv *, jclass, jlong, jlong, jfloat);
/*
* Class: android_graphics_Canvas
* Method: native_rotate_and_translate
* Signature: (JJFFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Canvas_native_1rotate_1and_1translate
(JNIEnv *, jclass, jlong, jlong, jfloat, jfloat, jfloat);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,359 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class android_graphics_Matrix */
#ifndef _Included_android_graphics_Matrix
#define _Included_android_graphics_Matrix
#ifdef __cplusplus
extern "C" {
#endif
#undef android_graphics_Matrix_MSCALE_X
#define android_graphics_Matrix_MSCALE_X 0L
#undef android_graphics_Matrix_MSKEW_X
#define android_graphics_Matrix_MSKEW_X 1L
#undef android_graphics_Matrix_MTRANS_X
#define android_graphics_Matrix_MTRANS_X 2L
#undef android_graphics_Matrix_MSKEW_Y
#define android_graphics_Matrix_MSKEW_Y 3L
#undef android_graphics_Matrix_MSCALE_Y
#define android_graphics_Matrix_MSCALE_Y 4L
#undef android_graphics_Matrix_MTRANS_Y
#define android_graphics_Matrix_MTRANS_Y 5L
#undef android_graphics_Matrix_MPERSP_0
#define android_graphics_Matrix_MPERSP_0 6L
#undef android_graphics_Matrix_MPERSP_1
#define android_graphics_Matrix_MPERSP_1 7L
#undef android_graphics_Matrix_MPERSP_2
#define android_graphics_Matrix_MPERSP_2 8L
/*
* Class: android_graphics_Matrix
* Method: native_create
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_android_graphics_Matrix_native_1create
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Matrix
* Method: native_isIdentity
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1isIdentity
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Matrix
* Method: native_rectStaysRect
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1rectStaysRect
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Matrix
* Method: native_reset
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1reset
(JNIEnv *, jclass, jint);
/*
* Class: android_graphics_Matrix
* Method: native_set
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1set
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_graphics_Matrix
* Method: native_setTranslate
* Signature: (IFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1setTranslate
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_setScale
* Signature: (IFFFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1setScale__IFFFF
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_setScale
* Signature: (IFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1setScale__IFF
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_setRotate
* Signature: (IFFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1setRotate__IFFF
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_setRotate
* Signature: (IF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1setRotate__IF
(JNIEnv *, jclass, jint, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_setSinCos
* Signature: (IFFFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1setSinCos__IFFFF
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_setSinCos
* Signature: (IFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1setSinCos__IFF
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_setSkew
* Signature: (IFFFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1setSkew__IFFFF
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_setSkew
* Signature: (IFF)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1setSkew__IFF
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_setConcat
* Signature: (III)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1setConcat
(JNIEnv *, jclass, jint, jint, jint);
/*
* Class: android_graphics_Matrix
* Method: native_preTranslate
* Signature: (IFF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1preTranslate
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_preScale
* Signature: (IFFFF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1preScale__IFFFF
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_preScale
* Signature: (IFF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1preScale__IFF
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_preRotate
* Signature: (IFFF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1preRotate__IFFF
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_preRotate
* Signature: (IF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1preRotate__IF
(JNIEnv *, jclass, jint, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_preSkew
* Signature: (IFFFF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1preSkew__IFFFF
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_preSkew
* Signature: (IFF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1preSkew__IFF
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_preConcat
* Signature: (II)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1preConcat
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_graphics_Matrix
* Method: native_postTranslate
* Signature: (IFF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1postTranslate
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_postScale
* Signature: (IFFFF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1postScale__IFFFF
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_postScale
* Signature: (IFF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1postScale__IFF
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_postRotate
* Signature: (IFFF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1postRotate__IFFF
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_postRotate
* Signature: (IF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1postRotate__IF
(JNIEnv *, jclass, jint, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_postSkew
* Signature: (IFFFF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1postSkew__IFFFF
(JNIEnv *, jclass, jint, jfloat, jfloat, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_postSkew
* Signature: (IFF)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1postSkew__IFF
(JNIEnv *, jclass, jint, jfloat, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_postConcat
* Signature: (II)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1postConcat
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_graphics_Matrix
* Method: native_setRectToRect
* Signature: (ILandroid/graphics/RectF;Landroid/graphics/RectF;I)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1setRectToRect
(JNIEnv *, jclass, jint, jobject, jobject, jint);
/*
* Class: android_graphics_Matrix
* Method: native_setPolyToPoly
* Signature: (I[FI[FII)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1setPolyToPoly
(JNIEnv *, jclass, jint, jfloatArray, jint, jfloatArray, jint, jint);
/*
* Class: android_graphics_Matrix
* Method: native_invert
* Signature: (II)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1invert
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_graphics_Matrix
* Method: native_mapPoints
* Signature: (I[FI[FIIZ)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1mapPoints
(JNIEnv *, jclass, jint, jfloatArray, jint, jfloatArray, jint, jint, jboolean);
/*
* Class: android_graphics_Matrix
* Method: native_mapRect
* Signature: (ILandroid/graphics/RectF;Landroid/graphics/RectF;)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1mapRect
(JNIEnv *, jclass, jint, jobject, jobject);
/*
* Class: android_graphics_Matrix
* Method: native_mapRadius
* Signature: (IF)F
*/
JNIEXPORT jfloat JNICALL Java_android_graphics_Matrix_native_1mapRadius
(JNIEnv *, jclass, jint, jfloat);
/*
* Class: android_graphics_Matrix
* Method: native_getValues
* Signature: (I[F)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1getValues
(JNIEnv *, jclass, jint, jfloatArray);
/*
* Class: android_graphics_Matrix
* Method: native_setValues
* Signature: (I[F)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_native_1setValues
(JNIEnv *, jclass, jint, jfloatArray);
/*
* Class: android_graphics_Matrix
* Method: native_equals
* Signature: (II)Z
*/
JNIEXPORT jboolean JNICALL Java_android_graphics_Matrix_native_1equals
(JNIEnv *, jclass, jint, jint);
/*
* Class: android_graphics_Matrix
* Method: finalizer
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_android_graphics_Matrix_finalizer
(JNIEnv *, jclass, jint);
#ifdef __cplusplus
}
#endif
#endif

Some files were not shown because too many files have changed in this diff Show More