diff --git a/rawdraw_sf.h b/rawdraw_sf.h index e75970e..f8c8f7d 100644 --- a/rawdraw_sf.h +++ b/rawdraw_sf.h @@ -1,5 +1,5 @@ //This file was automatically generated by Makefile at https://github.com/cntools/rawdraw -//Generated from files git hash c757555275f55ad0184231b17ff95f98cc28384a on Tue Aug 29 02:36:58 PM PDT 2023 (This is not the git hash of this file) +//Generated from files git hash 17163cdb0d326753d69741a653f84d14eb2bd73f on Fri Sep 8 20:30:23 UTC 2023 (This is not the git hash of this file) // Copyright 2010-2021 <>< CNLohr, et. al. (Several other authors, many but not all mentioned) // Licensed under the MIT/x11 or NewBSD License you choose. // @@ -134,7 +134,7 @@ int CNFGHandleInput(); void HandleKey( int keycode, int bDown ); void HandleButton( int x, int y, int button, int bDown ); void HandleMotion( int x, int y, int mask ); -void HandleDestroy(); +int HandleDestroy(); // Return nonzero if you want to cancel destroy. #ifdef ANDROID_WANT_WINDOW_TERMINATION void HandleWindowTermination(); #endif @@ -368,6 +368,10 @@ void HandleSuspend(); // For debugging: +#if defined( ANDROID ) && !defined( __cplusplus ) + +#include + static inline void PrintClassOfObject( jobject bundle ) { const struct JNINativeInterface * env = 0; @@ -522,15 +526,7 @@ static inline void DumpObjectClassProperties( jobject objToDump ) env->DeleteLocalRef( envptr, mpclass ); } - - - - - - - - - +#endif #endif @@ -3629,8 +3625,8 @@ LRESULT CALLBACK MyWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) break; #endif case WM_DESTROY: - HandleDestroy(); - CNFGTearDown(); + if( !HandleDestroy() ) + CNFGTearDown(); return 0; } return DefWindowProc(hwnd, msg, wParam, lParam); @@ -3799,6 +3795,8 @@ int CNFGSetupWinInternal( const char * name_of_window, int width, int height, in #endif #endif + ShouldClose = 0; + return 0; } @@ -4336,6 +4334,10 @@ void HandleSuspend(); // For debugging: +#if defined( ANDROID ) && !defined( __cplusplus ) + +#include + static inline void PrintClassOfObject( jobject bundle ) { const struct JNINativeInterface * env = 0; @@ -4490,15 +4492,7 @@ static inline void DumpObjectClassProperties( jobject objToDump ) env->DeleteLocalRef( envptr, mpclass ); } - - - - - - - - - +#endif #endif @@ -4940,8 +4934,8 @@ void handle_cmd(struct android_app* app, int32_t cmd) { case APP_CMD_DESTROY: //This gets called initially after back. - HandleDestroy(); - ANativeActivity_finish( gapp->activity ); + if( !HandleDestroy() ) + ANativeActivity_finish( gapp->activity ); break; case APP_CMD_INIT_WINDOW: //When returning from a back button suspension, this isn't called. @@ -5637,8 +5631,10 @@ void CNFGTearDown() if ( CNFGGC ) XFreeGC( CNFGDisplay, CNFGGC ); if ( CNFGWindowGC ) XFreeGC( CNFGDisplay, CNFGWindowGC ); if ( CNFGDisplay ) XCloseDisplay( CNFGDisplay ); +#ifdef CNFGOGL if ( CNFGGLXFBConfigs ) XFree( CNFGGLXFBConfigs ); CNFGGLXFBConfigs = NULL; +#endif CNFGDisplay = NULL; CNFGWindowGC = CNFGGC = NULL; CNFGClassHint = NULL;