|
@@ -51,7 +51,7 @@
|
|
#include <shellscalingapi.h>
|
|
#include <shellscalingapi.h>
|
|
#endif
|
|
#endif
|
|
#ifdef LAGUI_ANDROID
|
|
#ifdef LAGUI_ANDROID
|
|
-#include <GLES3/gl3.h>
|
|
|
|
|
|
+#include <GLES3/gl32.h>
|
|
#include <android/log.h>
|
|
#include <android/log.h>
|
|
#include <android/native_activity.h>
|
|
#include <android/native_activity.h>
|
|
#include <jni.h>
|
|
#include <jni.h>
|
|
@@ -485,7 +485,7 @@ void la_HandlerSIGSEGV(int sig) {
|
|
|
|
|
|
void la_glDebugOutput(GLenum source, GLenum type, unsigned int id,
|
|
void la_glDebugOutput(GLenum source, GLenum type, unsigned int id,
|
|
GLenum severity, GLsizei length, const char* message, const void* userParam) {
|
|
GLenum severity, GLsizei length, const char* message, const void* userParam) {
|
|
-#ifndef LAGUI_ANDROID
|
|
|
|
|
|
+//#ifndef LAGUI_ANDROID
|
|
// ignore non-significant error/warning codes
|
|
// ignore non-significant error/warning codes
|
|
if (id==131169 || id==131185 || id==131218 || id==131204 || id==131076) return;
|
|
if (id==131169 || id==131185 || id==131218 || id==131204 || id==131076) return;
|
|
|
|
|
|
@@ -521,11 +521,11 @@ void la_glDebugOutput(GLenum source, GLenum type, unsigned int id,
|
|
case GL_DEBUG_SEVERITY_NOTIFICATION: strseverity = "Notification"; break;
|
|
case GL_DEBUG_SEVERITY_NOTIFICATION: strseverity = "Notification"; break;
|
|
}
|
|
}
|
|
logPrint("%s | %s | %s\n\n", strsource,strtype,strseverity);
|
|
logPrint("%s | %s | %s\n\n", strsource,strtype,strseverity);
|
|
-#endif
|
|
|
|
|
|
+//#endif
|
|
}
|
|
}
|
|
|
|
|
|
void la_SetCurrentGLContextDebug(){
|
|
void la_SetCurrentGLContextDebug(){
|
|
-#ifndef LAGUI_ANDROID
|
|
|
|
|
|
+//#ifndef LAGUI_ANDROID
|
|
int force=MAIN.InitArgs.GLDebug;
|
|
int force=MAIN.InitArgs.GLDebug;
|
|
if(MAIN.EnableGLDebug || force){ glEnable(GL_DEBUG_OUTPUT); }else{ glDisable(GL_DEBUG_OUTPUT); }
|
|
if(MAIN.EnableGLDebug || force){ glEnable(GL_DEBUG_OUTPUT); }else{ glDisable(GL_DEBUG_OUTPUT); }
|
|
if(MAIN.GLDebugSync || force){ glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS); }else{ glDisable(GL_DEBUG_OUTPUT_SYNCHRONOUS); }
|
|
if(MAIN.GLDebugSync || force){ glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS); }else{ glDisable(GL_DEBUG_OUTPUT_SYNCHRONOUS); }
|
|
@@ -541,7 +541,7 @@ void la_SetCurrentGLContextDebug(){
|
|
}
|
|
}
|
|
}
|
|
}
|
|
glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, sev, 0, 0, GL_TRUE);
|
|
glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, sev, 0, 0, GL_TRUE);
|
|
-#endif
|
|
|
|
|
|
+//#endif
|
|
}
|
|
}
|
|
void la_NotifyGLDebugChanges(){
|
|
void la_NotifyGLDebugChanges(){
|
|
MAIN.GLDebugNeedsUpdate=1; for(laWindow* w=MAIN.Windows.pFirst;w;w=w->Item.pNext){ w->GLDebugNeedsUpdate=1; }
|
|
MAIN.GLDebugNeedsUpdate=1; for(laWindow* w=MAIN.Windows.pFirst;w;w=w->Item.pNext){ w->GLDebugNeedsUpdate=1; }
|
|
@@ -1442,12 +1442,12 @@ void laShutoff(int SavePrefereces){
|
|
}
|
|
}
|
|
|
|
|
|
int laRestoreFactorySettings(){
|
|
int laRestoreFactorySettings(){
|
|
- char path[1024]; sprintf(path, "%s%s", MAIN.WorkingDirectory->Ptr, "preferences.udf");
|
|
|
|
|
|
+ char path[1024]; sprintf(path, "%s%s", SSTR(MAIN.WorkingDirectory), "preferences.udf");
|
|
if(remove(path)){ return 0; }
|
|
if(remove(path)){ return 0; }
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|
|
void laSaveUserPreferences(){
|
|
void laSaveUserPreferences(){
|
|
- char path[1024]; sprintf(path,"%s%s",MAIN.WorkingDirectory->Ptr,"preferences.udf");
|
|
|
|
|
|
+ char path[1024]; sprintf(path,"%s%s",SSTR(MAIN.WorkingDirectory),"preferences.udf");
|
|
laUDF* udf=laPrepareUDF(path);
|
|
laUDF* udf=laPrepareUDF(path);
|
|
laWriteProp(udf,"la.windows");
|
|
laWriteProp(udf,"la.windows");
|
|
laWriteProp(udf,"la.user_preferences");
|
|
laWriteProp(udf,"la.user_preferences");
|
|
@@ -1459,7 +1459,7 @@ void laSaveUserPreferences(){
|
|
laPackUDF(udf,0,0);
|
|
laPackUDF(udf,0,0);
|
|
}
|
|
}
|
|
void laEnsureUserPreferences(){
|
|
void laEnsureUserPreferences(){
|
|
- char path[1024]; sprintf(path,"%s%s",MAIN.WorkingDirectory->Ptr,"preferences.udf");
|
|
|
|
|
|
+ char path[1024]; sprintf(path,"%s%s",SSTR(MAIN.WorkingDirectory),"preferences.udf");
|
|
laUDFRegistry* r=laFindUDFRegistry(path);
|
|
laUDFRegistry* r=laFindUDFRegistry(path);
|
|
if(!r){ laSaveUserPreferences(); return; }
|
|
if(!r){ laSaveUserPreferences(); return; }
|
|
laUDF* udf=laOpenUDF(r->Path->Ptr,1,0,0); if(!udf){ logPrint("Can't read preferences. Using default settings."); return; }
|
|
laUDF* udf=laOpenUDF(r->Path->Ptr,1,0,0); if(!udf){ logPrint("Can't read preferences. Using default settings."); return; }
|
|
@@ -1832,6 +1832,7 @@ void la_MakeSpecialKeyBit(SYSWINDOW hwnd,laWindow*wnd,laEvent *e,int use_last_po
|
|
e->SpecialKeyBit = ((GetKeyState(VK_SHIFT)&0x8000)?LA_KEY_SHIFT:0)|((GetKeyState(VK_CONTROL)&0x8000)?LA_KEY_CTRL:0)|((GetKeyState(VK_MENU)&0x8000)?LA_KEY_ALT:0);
|
|
e->SpecialKeyBit = ((GetKeyState(VK_SHIFT)&0x8000)?LA_KEY_SHIFT:0)|((GetKeyState(VK_CONTROL)&0x8000)?LA_KEY_CTRL:0)|((GetKeyState(VK_MENU)&0x8000)?LA_KEY_ALT:0);
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
|
|
+void laMappingRequestEval();
|
|
void la_SaveEvent(SYSWINDOW hwnd, laEvent *e, int use_last_pos){
|
|
void la_SaveEvent(SYSWINDOW hwnd, laEvent *e, int use_last_pos){
|
|
laListHandle *wl = &MAIN.Windows;
|
|
laListHandle *wl = &MAIN.Windows;
|
|
laWindow* wnd;
|
|
laWindow* wnd;
|
|
@@ -8237,28 +8238,34 @@ static int32_t la_AndroidInputCallback(struct android_app *app, AInputEvent *eve
|
|
__android_log_print(ANDROID_LOG_DEBUG, "huh 5678", "123 input");
|
|
__android_log_print(ANDROID_LOG_DEBUG, "huh 5678", "123 input");
|
|
if(!MAIN.AppEnabled){return 0;}
|
|
if(!MAIN.AppEnabled){return 0;}
|
|
//laRedrawAllWindows();
|
|
//laRedrawAllWindows();
|
|
-
|
|
|
|
- int pcount = AMotionEvent_getPointerCount(event); int x,y;
|
|
|
|
- if(pcount){
|
|
|
|
- real rx=AMotionEvent_getX(event, 0), ry=AMotionEvent_getY(event, 0);
|
|
|
|
- x=rx; y=ry;
|
|
|
|
- }
|
|
|
|
- int32_t action = AMotionEvent_getAction(event);
|
|
|
|
- unsigned int flags = action & AMOTION_EVENT_ACTION_MASK;
|
|
|
|
- int32_t pointerIndex = (action & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT;
|
|
|
|
|
|
|
|
- if (flags == AMOTION_EVENT_ACTION_DOWN){
|
|
|
|
- la_SendMouseEvent(0,LA_MOUSEMOVE,x,y);
|
|
|
|
- la_SendMouseEvent(0,LA_L_MOUSE_DOWN,x,y);
|
|
|
|
- }
|
|
|
|
- else if (flags == AMOTION_EVENT_ACTION_UP){
|
|
|
|
- la_SendMouseEvent(0,LA_L_MOUSE_UP,x,y);
|
|
|
|
- }
|
|
|
|
- else if (flags == AMOTION_EVENT_ACTION_MOVE){
|
|
|
|
- la_SendMouseEvent(0,LA_MOUSEMOVE,x,y);
|
|
|
|
|
|
+ int type = AInputEvent_getType(event);
|
|
|
|
+ if(type == AINPUT_EVENT_TYPE_KEY){
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
- else if (flags == AMOTION_EVENT_ACTION_CANCEL){
|
|
|
|
- la_SendMouseEvent(0,LA_L_MOUSE_UP,x,y);
|
|
|
|
|
|
+ elif(type == AINPUT_EVENT_TYPE_MOTION){
|
|
|
|
+ int pcount = AMotionEvent_getPointerCount(event); int x,y;
|
|
|
|
+ if(pcount){
|
|
|
|
+ real rx=AMotionEvent_getX(event, 0), ry=AMotionEvent_getY(event, 0);
|
|
|
|
+ x=rx; y=ry;
|
|
|
|
+ }
|
|
|
|
+ int32_t action = AMotionEvent_getAction(event);
|
|
|
|
+ unsigned int flags = action & AMOTION_EVENT_ACTION_MASK;
|
|
|
|
+ int32_t pointerIndex = (action & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT;
|
|
|
|
+
|
|
|
|
+ if (flags == AMOTION_EVENT_ACTION_DOWN){
|
|
|
|
+ la_SendMouseEvent(0,LA_MOUSEMOVE,x,y);
|
|
|
|
+ la_SendMouseEvent(0,LA_L_MOUSE_DOWN,x,y);
|
|
|
|
+ }
|
|
|
|
+ else if (flags == AMOTION_EVENT_ACTION_UP){
|
|
|
|
+ la_SendMouseEvent(0,LA_L_MOUSE_UP,x,y);
|
|
|
|
+ }
|
|
|
|
+ else if (flags == AMOTION_EVENT_ACTION_MOVE){
|
|
|
|
+ la_SendMouseEvent(0,LA_MOUSEMOVE,x,y);
|
|
|
|
+ }
|
|
|
|
+ else if (flags == AMOTION_EVENT_ACTION_CANCEL){
|
|
|
|
+ la_SendMouseEvent(0,LA_L_MOUSE_UP,x,y);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
//static float r=0;
|
|
//static float r=0;
|
|
@@ -8350,7 +8357,7 @@ void la_InitAndroidPlatform(struct android_app *app){
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+int main(int, char *[]);
|
|
void android_main(struct android_app *app){
|
|
void android_main(struct android_app *app){
|
|
char arg0[] = "lagui"; // NOTE: argv[] are mutable
|
|
char arg0[] = "lagui"; // NOTE: argv[] are mutable
|
|
|
|
|