-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- some wrong things in imager viewer setup - Test suite works! - Multithreading issues, race condition. Need to overhaul and remove all Java synchronized stuff, and rely only on camlib recursive mutex.
- Loading branch information
Showing
20 changed files
with
162 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
x = ui.NewWindow("Hello", 100, 100, false) | ||
x:SetChild(ui.NewLabel("Hello from Lua")) | ||
x:Show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule camlib
updated
28 files
+34 −13 | .github/workflows/doc.yml | |
+1 −0 | .gitignore | |
+4 −0 | Doxyfile | |
+10 −5 | Makefile | |
+16 −19 | README.md | |
+1 −0 | examples/Makefile | |
+3 −1 | examples/eos.c | |
+1 −0 | examples/evtest.c | |
+4 −2 | examples/ml.c | |
+1 −1 | examples/optest.c | |
+18 −10 | examples/usb.c | |
+25 −2 | examples/wifi.c | |
+1 −1 | lua/lua.c | |
+0 −15 | mkdocs.yml | |
+10 −2 | src/bind.c | |
+80 −74 | src/camlib.h | |
+30 −30 | src/canon_adv.c | |
+31 −44 | src/cl_data.h | |
+29 −22 | src/cl_ops.h | |
+19 −20 | src/data.c | |
+15 −16 | src/lib.c | |
+29 −4 | src/libusb.c | |
+60 −30 | src/libwpd.c | |
+3 −1 | src/ml.c | |
+15 −4 | src/operations.c | |
+0 −28 | src/packet.c | |
+68 −18 | test/test.c | |
+2 −0 | test/test.d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,70 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <stddef.h> | ||
#include <string.h> | ||
#include <jni.h> | ||
#include <android/log.h> | ||
|
||
#error "no" | ||
#define LIBU(ret, name) JNIEXPORT ret JNICALL Java_libui_LibU_##name | ||
|
||
int libu_write_file(JNIEnv *env, char *path, void *data, size_t length) { | ||
jclass class = (*env)->FindClass(env, "libui/LibU"); | ||
jclass class = (*env)->FindClass(env, "libui/LibU"); | ||
|
||
jmethodID method = (*env)->GetStaticMethodID(env, class, "writeFile", "(Ljava/lang/String;[B)V"); | ||
jmethodID method = (*env)->GetStaticMethodID(env, class, "writeFile", "(Ljava/lang/String;[B)V"); | ||
|
||
jbyteArray jdata = (*env)->NewByteArray(env, length); | ||
(*env)->SetByteArrayRegion( | ||
env, jdata, | ||
0, length, (const jbyte *)(data) | ||
); | ||
(*env)->SetByteArrayRegion( | ||
env, jdata, | ||
0, length, (const jbyte *)(data) | ||
); | ||
|
||
jstring jpath = (*env)->NewStringUTF(env, path); | ||
jstring jpath = (*env)->NewStringUTF(env, path); | ||
|
||
(*env)->CallStaticVoidMethod(env, class, method, | ||
jpath, jdata | ||
); | ||
jpath, jdata | ||
); | ||
|
||
(*env)->DeleteLocalRef(env, jdata); | ||
(*env)->DeleteLocalRef(env, jpath); | ||
|
||
return 0; | ||
} | ||
|
||
void *libu_get_assets_file(JNIEnv *env, jobject ctx, char *filename, int *length) { | ||
jclass class = (*env)->FindClass(env, "libui/LibU"); | ||
|
||
jmethodID method = (*env)->GetStaticMethodID(env, class, "readFileFromAssets", "(Landroid/content/Context;Ljava/lang/String;)[B"); | ||
|
||
jstring jfile = (*env)->NewStringUTF(env, filename); | ||
|
||
(*env)->DeleteLocalRef(env, jdata); | ||
(*env)->DeleteLocalRef(env, jpath); | ||
jbyteArray array = (*env)->CallStaticObjectMethod(env, class, method, | ||
ctx, jfile | ||
); | ||
|
||
jbyte *bytes = (*env)->GetByteArrayElements(env, array, 0); | ||
|
||
(*length) = (*env)->GetArrayLength(env, array); | ||
|
||
void *new = malloc(*length); | ||
memcpy(new, bytes, *length); | ||
|
||
(*env)->DeleteLocalRef(env, jfile); | ||
(*env)->ReleaseByteArrayElements(env, array, bytes, 0); | ||
|
||
return new; | ||
} | ||
|
||
return 0; | ||
void *libu_get_txt_file(JNIEnv *env, jobject ctx, char *filename) { | ||
int length = 0; | ||
char *bytes = libu_get_assets_file(env, ctx, filename, &length); | ||
length += 1; | ||
bytes = realloc(bytes, length); | ||
bytes[length] = '\0'; | ||
return bytes; | ||
} | ||
|
||
// Added in POSIX 2008, not C standard | ||
char *stpcpy(char *dst, const char *src) { | ||
const size_t len = strlen(src); | ||
return (char *)memcpy (dst, src, len + 1) + len; | ||
const size_t len = strlen(src); | ||
return (char *)memcpy (dst, src, len + 1) + len; | ||
} |
Submodule libuifw
updated
from ff0229 to a3e975
Oops, something went wrong.