*/}}
Browse Source

copyright, and optimizations

YimingWu 1 year ago
parent
commit
0575d0290d

+ 18 - 6
CMakeLists.txt

@@ -11,13 +11,10 @@ find_package(Freetype REQUIRED)
 find_package(GLEW REQUIRED)
 
 file(GLOB_RECURSE SOURCE_FILES 
-	./**.c
-	./**.cpp)
-	
-# Add header files
+	./*.c ./*.cpp ./resources/*.c ./resources/*.cpp)
+
 file(GLOB_RECURSE HEADER_FILES 
-	./**.h
-	./**.hpp)
+	./*.h ./*.hpp ./resources/*.h ./resources/*.hpp)
 
 add_definitions(-w)
 
@@ -40,6 +37,21 @@ set(LAGUI_FONTS
 
 add_library(lagui ${HEADER_FILES} ${SOURCE_FILES})
 
+execute_process(
+    COMMAND git rev-parse --abbrev-ref HEAD
+    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+    OUTPUT_VARIABLE LAGUI_GIT_BRANCH
+	OUTPUT_STRIP_TRAILING_WHITESPACE)
+	
+execute_process(
+    COMMAND git rev-parse HEAD
+    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+    OUTPUT_VARIABLE LAGUI_GIT_HASH
+	OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+target_compile_definitions(lagui PRIVATE "-DLAGUI_GIT_BRANCH=\"${LAGUI_GIT_BRANCH}\"")
+target_compile_definitions(lagui PRIVATE "-DLAGUI_GIT_HASH=\"${LAGUI_GIT_HASH}\"")
+
 install(FILES ${HEADER_FILES} DESTINATION include/lagui)
 install(TARGETS lagui EXPORT lagui-targets DESTINATION lib/lagui)
 install(EXPORT lagui-targets DESTINATION lib/lagui)

+ 23 - 0
README

@@ -0,0 +1,23 @@
+# LaGUI
+
+LaGUI 是一个图形应用程序框架。
+
+版权所有 (C) 2022-2023 吴奕茗
+
+了解更多: https://ChengduLittleA.com/lagui
+
+LaGUI 采用 GNU GPL v3 许可证,Noto 字体采用 SIL Open Font 许可证
+您将在源代码文件夹找到许可证的具体信息。
+
+-----------------
+
+# LaGUI
+
+LaGUI: A graphical application framework.
+
+Copyright (C) 2022-2023 Wu Yiming
+
+Learn more about LaGUI: https://ChengduLittleA.com/lagui
+
+LaGUI is licensed with GNU GPL v3, and Noto fonts are licensed with SIL Open Font license.
+You should be able to find details about the license in the source code directory.

+ 1 - 1
la_5.h

@@ -1,6 +1,6 @@
 /*
 * LaGUI: A graphical application framework.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by

+ 1 - 1
la_controllers.c

@@ -1,6 +1,6 @@
 /*
 * LaGUI: A graphical application framework.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by

+ 2 - 1
la_data.c

@@ -1,6 +1,6 @@
 /*
 * LaGUI: A graphical application framework.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
@@ -3687,6 +3687,7 @@ void laCloseUDF(laUDF *udf){
 
 int laLoadHyperResources(char* uid_search){
     int count=0;
+    logPrintNew("Loading extra resources \"%s\"\n",uid_search);
     for(laUDFOwnHyperItem* ohi=MAIN.UDFResources.pFirst;ohi;ohi=ohi->Item.pNext){
         if(strstr(ohi->NUID.String,uid_search)){ laRequestAdditionalRegistry(ohi->Registry); count++; };
     }

+ 1 - 1
la_data.h

@@ -1,6 +1,6 @@
 /*
 * LaGUI: A graphical application framework.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by

+ 1 - 1
la_icon.h

@@ -1,6 +1,6 @@
 /*
 * LaGUI: A graphical application framework.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by

+ 2 - 1
la_interface.h

@@ -1,6 +1,6 @@
 /*
 * LaGUI: A graphical application framework.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
@@ -1769,6 +1769,7 @@ void laSetPreferenceTemplates(laUiDefineFunc PreferencePageDisplay, laUiDefineFu
 
 laWindow *laDesignWindow(int X, int Y, int W, int H);
 laLayout *laDesignLayout(laWindow *w, char *Title);
+void laDestroyLayout(laWindow *w, laLayout* l);
 void laFoldBlockTitle(laBlock* b);
 void laUnfoldBlockTitle(laBlock* b);
 void laMaximizeBlock(laBlock* b);

+ 22 - 4
la_kernel.c

@@ -1,6 +1,6 @@
 /*
 * LaGUI: A graphical application framework.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
@@ -252,7 +252,9 @@ void la_DestroyWindow(laWindow *wnd){
 }
 
 void laRenameWindow(laWindow* wnd, char* name){
+    if(!wnd) return;
     strSafeSet(&wnd->Title, name);
+    if(!wnd->win) return;
     XStoreName(MAIN.dpy, wnd->win, name);
 }
 
@@ -1888,6 +1890,13 @@ void la_AssignBlockPP(laBlock* b){
     b->PP.LastPs->UseInstance = b;
     b->PP.LastPs->Type = L'.';
 }
+void laDestroyLayout(laWindow *w, laLayout* l){
+    if((!l->Item.pPrev) && (!l->Item.pNext)) return;
+    laDestroyBlocksRecursive(l->FirstBlock);
+    strSafeDestroy(&l->ID);
+    if(w->CurrentLayout==l){ w->CurrentLayout=l->Item.pPrev?l->Item.pPrev:l->Item.pNext; }
+    lstRemoveItem(&w->Layouts,l); memFree(l);
+}
 laLayout *laDesignLayout(laWindow *w, char *Title){
     laLayout *l = memAcquireHyper(sizeof(laLayout));
 
@@ -2765,7 +2774,12 @@ void laAddPanelMessage(laPanelMessageList *pml, char *Message){
 }
 
 void laRedrawAllWindows(){ if((!MAIN.CurrentWindow) || (!MAIN.CurrentWindow->win)) return;
-    for(laWindow* w=MAIN.Windows.pFirst;w;w=w->Item.pNext) la_UpdateUiPlacement(w);
+    laWindow* cur=MAIN.CurrentWindow;
+    for(laWindow* w=MAIN.Windows.pFirst;w;w=w->Item.pNext){
+        MAIN.CurrentWindow=w;
+        la_UpdateUiPlacement(w);
+    }
+    MAIN.CurrentWindow=cur;
 }
 void laRedrawCurrentWindow(){ if((!MAIN.CurrentWindow) || (!MAIN.CurrentWindow->win)) return;
     if (MAIN.CurrentWindow) la_UpdateUiPlacement(MAIN.CurrentWindow);
@@ -6411,6 +6425,7 @@ int la_ProcessSysMessage(){
     int InputCount = 0, CharCount=0;
     KeySym InputKeysym = 0;
     Status InputStatus = 0;
+    laWindow* wnd ;
 
     int SendDelay=0,SendIdle=0;
     if(!MAIN.DelayTriggered && MAIN.TimeAccum-MAIN.DelayStart>MAIN.DelayTime) SendDelay=1;
@@ -6432,8 +6447,9 @@ int la_ProcessSysMessage(){
             la_CommandResizeWindow(e.xconfigure.window, e.xconfigure.x, e.xconfigure.y, e.xconfigure.width, e.xconfigure.height);
             break;
         case Expose:
-            //glXSwapBuffers(MAIN.dpy,e.xexpose.window);
-            //SwapBuffers(GetDC(hwnd));
+            wnd = lstFindItem(e.xexpose.window, la_IsThisSysWindow, &MAIN.Windows);
+            if(!wnd) break;
+            laRefreshWindow(wnd);
             break;
         case MotionNotify:
             la_SendMouseEvent(e.xmotion.window, LA_MOUSEMOVE, e.xmotion.x,e.xmotion.y);
@@ -6465,7 +6481,9 @@ int la_ProcessSysMessage(){
             if (InputCount){ MAIN.InputBuf[InputCount]=0; } strToUnicode(MAIN.InputBufU,MAIN.InputBuf); int UCount=strlenU(MAIN.InputBufU);
             for(int i=0;i<UCount;i++){ if(la_AllowInput(MAIN.InputBufU[i])) la_SendInputEvent(e.xkey.window, MAIN.InputBufU[i]); }
             if(InputKeysym=XkbKeycodeToKeysym(e.xkey.display, e.xkey.keycode, 0, 0)){
+#ifdef DEBUG
                 printf("pressed KEY: %d\n", (int)InputKeysym);
+#endif
                 la_SendKeyboardEvent(e.xkey.window, LA_KEY_DOWN, la_TranslateSpecialKey(InputKeysym));
             }
             break;

+ 1 - 1
la_resource.c

@@ -1,6 +1,6 @@
 /*
 * LaGUI: A graphical application framework.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by

+ 1 - 1
la_tns.h

@@ -1,6 +1,6 @@
 /*
 * LaGUI: A graphical application framework.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by

+ 1 - 1
la_tns_curve.c

@@ -1,6 +1,6 @@
 /*
 * LaGUI: A graphical application framework.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by

+ 2 - 2
la_tns_kernel.c

@@ -1,6 +1,6 @@
 /*
 * LaGUI: A graphical application framework.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
@@ -4028,7 +4028,7 @@ void tnsDrawObjectOrigins(tnsObject *from, tnsObject *active, int AllOrigins){
     }
 }
 void tnsDrawCursor(tnsObject* root){
-    if(root->Type!=TNS_OBJECT_ROOT) return;
+    if(!root || root->Type!=TNS_OBJECT_ROOT) return;
     tnsMatrix44d vp; tnsVector4d t; tnsVector4d t1={0,0,0,1};
     tnsMultiply44d(vp,tnsGetProjectionMatrix(),tnsGetViewMatrix());
     tnsApplyTransform44d(t,vp,root->GLocation); real w=t[3]*0.05;

+ 1 - 1
la_tns_mesh.c

@@ -1,6 +1,6 @@
 /*
 * LaGUI: A graphical application framework.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by

+ 9 - 5
la_util.c

@@ -1,6 +1,6 @@
 /*
 * LaGUI: A graphical application framework.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
@@ -1137,7 +1137,11 @@ void memTake(void *Data){
 void memFreeRemainingLeftNodes(){
     laListHandle* l; void* m;
     for(int i=0;i<65536;i++){
-        l=&MAIN.DBInstMemLeft->Entries[i]; while(m=lstPopPointer(l)){ memFree(m); printf("left freed %x\n",m); }
+        l=&MAIN.DBInstMemLeft->Entries[i]; while(m=lstPopPointer(l)){ memFree(m);
+#ifdef DEBUG
+            printf("left freed %x\n",m);
+#endif
+        }
     }
 }
 
@@ -1786,9 +1790,9 @@ void strMoveCursor(laStringEdit *se, int Left, int Select){
     BeforeIndex = se->CursorBefore - (Left ? 1 : -1);
 
     if(BeforeIndex<0){
-        strSetCursor(se, se->CursorLine-1, INT_MAX);
+        if(se->CursorLine>0) strSetCursor(se, se->CursorLine-1, INT_MAX);
     }elif(BeforeIndex>maxbefore && se->CursorLine<se->TotalLines-1){
-        strSetCursor(se, se->CursorLine+1, 0);
+        if(se->CursorLine>0) strSetCursor(se, se->CursorLine+1, 0);
     }else{
         se->CursorBefore = BeforeIndex>=maxbefore?maxbefore:BeforeIndex;
     }
@@ -1841,7 +1845,7 @@ void strCancelSelect(laStringEdit *se){
 }
 void strLazySelect(laStringEdit *se){
     if (!se || se->_BeginLine>=0) return;
-    se->_BeginLine = se->CursorLine;
+    se->_BeginLine = TNS_MAX2(se->CursorLine,0);
     se->_BeginBefore = se->CursorBefore;
 }
 void strEndSelect(laStringEdit *se){

+ 9 - 1
la_util.h

@@ -1,6 +1,6 @@
 /*
 * LaGUI: A graphical application framework.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
@@ -48,6 +48,14 @@ struct _##a
 #define DBL_TRIANGLE_LIM 1e-11
 #define DBL_EDGE_LIM 1e-9
 
+#ifndef LAGUI_GIT_BRANCH
+#define LAGUI_GIT_BRANCH "Release 1"
+#endif
+
+// No need to show hash when not compiled from git repo.
+//#ifndef LAGUI_GIT_HASH
+//#define LAGUI_GIT_HASH "?"
+//#endif
 
 #define LA_HYPER_CREATED_TIME(hi)\
 hi->TimeCreated.Year,hi->TimeCreated.Month,hi->TimeCreated.Day,hi->TimeCreated.Hour,hi->TimeCreated.Minute,hi->TimeCreated.Second

+ 1 - 1
resources/la_modelling.c

@@ -1,6 +1,6 @@
 /*
 * LaGUI: A graphical application framework.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by

+ 1 - 1
resources/la_nodes_basic.c

@@ -1,6 +1,6 @@
 /*
 * LaGUI: A graphical application framework.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by

+ 16 - 3
resources/la_operators.c

@@ -1,6 +1,6 @@
 /*
 * LaGUI: A graphical application framework.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
@@ -997,6 +997,15 @@ int OPINV_NewLayout(laOperator *a, laEvent *e){
     laRedrawCurrentWindow();
     return LA_FINISHED;
 }
+int OPCHK_RemoveLayout(laPropPack *This, laStringSplitor *Instructions){
+    laWindow* w=MAIN.CurrentWindow; if(w->Layouts.pFirst==w->Layouts.pLast) return 0;
+    return 1;
+}
+int OPINV_RemoveLayout(laOperator *a, laEvent *e){
+    laWindow* w=MAIN.CurrentWindow; if(w->Layouts.pFirst==w->Layouts.pLast) return LA_FINISHED;
+    laDestroyLayout(w,w->CurrentLayout); laRedrawCurrentWindow();
+    return LA_FINISHED;
+}
 int OPINV_NewPanel(laOperator *a, laEvent *e){
     laNewPanelData* np= CreateNew(laNewPanelData);
     a->CustomData = np;
@@ -1411,12 +1420,14 @@ real la_ScrollerHorizontalPan(int MousePanX, laPanel *p, laUiList *suil, laUiIte
 
 void laui_LayoutCycle(laUiList *uil, laPropPack *This, laPropPack *OperatorProps, laColumn *UNUSED, int context){
     laColumn *c;
-    laProp *p, *gp;
 
     c = laFirstColumn(uil);
     
     laShowItemFull(uil, c, 0, "la.windows.layouts", 0, 0, laui_IdentifierOnly, 0);
-    laShowItem(uil, c, 0, "LA_new_layout");
+    laUiItem* b=laBeginRow(uil,c,0,0);
+    laShowItem(uil, c, 0, "LA_new_layout")->Expand=1;
+    laShowItem(uil, c, 0, "LA_remove_layout")->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_NO_CONFIRM;
+    laEndRow(uil,b);
 }
 int OPINV_SwitchLayout(laOperator *a, laEvent *e){
     laWindow *w = MAIN.CurrentWindow; if (!w) return LA_FINISHED;
@@ -2049,6 +2060,8 @@ void la_RegisterBuiltinOperators(){
                           0, 0, 0, OPINV_Fullscreen, 0, L'🡵', LA_ACTUATOR_SYSTEM | LA_ACTUATOR_HIDDEN);
     laCreateOperatorType("LA_new_layout", "New Layout", "Create a new layout in the window",
                           0, 0, 0, OPINV_NewLayout, 0, L'🞦', LA_ACTUATOR_SYSTEM | LA_ACTUATOR_HIDDEN);
+    laCreateOperatorType("LA_remove_layout", "Remove Layout", "Remove current layout in the window",
+                          OPCHK_RemoveLayout, 0, 0, OPINV_RemoveLayout, 0, L'❌', LA_ACTUATOR_SYSTEM | LA_ACTUATOR_HIDDEN);
     laCreateOperatorType("LA_panel_operator", "Panel Operator", "Handle Events On The Panel Level",
                           0, 0, OPEXT_Panel, OPINV_Panel, OPMOD_Panel, L'🖦', LA_EXTRA_TO_PANEL | LA_ACTUATOR_SYSTEM | LA_ACTUATOR_HIDDEN);
     laCreateOperatorType("LA_modal_panel_operator", "Modal Panel Operator", "Handle Events On Modal Panels Like Yes-No Boxes",

+ 9 - 15
resources/la_properties.c

@@ -1,6 +1,6 @@
 /*
 * LaGUI: A graphical application framework.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
@@ -350,17 +350,11 @@ void laget_LayoutTitle(laLayout *l, char *result){
 }
 void laset_LayoutTitle(laLayout *l, char *content){
     strSafeSet(&l->ID, content);
-    laRenameWindow(MAIN.CurrentWindow, content);
+    laRenameWindow(MAIN.CurrentWindow, l->ID->Ptr);
 }
 //void* laget_LayoutPanelFirst(laLayout* l) {
 //	return l->Panels.pFirst;
 //}
-void laget_WindowTitle(laWindow *w, char *result){
-    strCopyFull(result, w->Title->Ptr);
-}
-void laset_WindowTitle(laWindow *w, char *content){
-    strSafeSet(&w->Title, content);
-}
 void laset_WindowActiveLayout(laWindow *w, laLayout *l, int UNUSED_State){
     la_StopAllOperators();
     w->CurrentLayout = l;
@@ -844,25 +838,25 @@ void la_RegisterGeneralProps(){
     laAddOperatorProperty(p, "restore", "Restore Default", "Restore the property to the original value", "LA_int_restore_default", L'⭯', 0);
     laAddOperatorProperty(p, "set_max", "Set Max", "Set The Property To The Max Value", "LA_int_set_max", 0,0);
     laAddOperatorProperty(p, "set_min", "Set Min", "Set The Property To The Min Value", "LA_int_set_min", 0,0);
-    laAddOperatorProperty(p, "hyper_data", "View Hyper Data", "Show Properties Of Specific Data Block", "LA_view_hyper_data", L'🛈', 0);
+    //laAddOperatorProperty(p, "hyper_data", "View Hyper Data", "Show Properties Of Specific Data Block", "LA_view_hyper_data", L'🛈', 0);
 
     p = la_SetGeneralRoot(&MAIN.GeneralIntArraySub, "__general_int_arr__", "Genral Int Array Operations", "Genral Int Array Operations");
     laAddOperatorProperty(p, "restore", "Restore Default", "Restore the property to the original value", "LA_int_array_restore_default", L'⭯', 0);
     laAddOperatorProperty(p, "set_max", "Set Max", "Set The Property To The Max Value", "LA_int_array_set_max", 0,0);
     laAddOperatorProperty(p, "set_min", "Set Min", "Set The Property To The Min Value", "LA_int_array_set_min", 0,0);
-    laAddOperatorProperty(p, "hyper_data", "View Hyper Data", "Show Properties Of Specific Data Block", "LA_view_hyper_data", L'🛈', 0);
+    //laAddOperatorProperty(p, "hyper_data", "View Hyper Data", "Show Properties Of Specific Data Block", "LA_view_hyper_data", L'🛈', 0);
 
     p = la_SetGeneralRoot(&MAIN.GeneralFloatSub, "__general_real__", "Genral Float Operations", "Genral Float Operations");
     laAddOperatorProperty(p, "restore", "Restore Default", "Restore the property to the original value", "LA_real_restore_default", L'⭯', 0);
     laAddOperatorProperty(p, "set_max", "Set Max", "Set The Property To The Max Value", "LA_real_set_max", 0,0);
     laAddOperatorProperty(p, "set_min", "Set Min", "Set The Property To The Min Value", "LA_real_set_min", 0,0);
-    laAddOperatorProperty(p, "hyper_data", "View Hyper Data", "Show Properties Of Specific Data Block", "LA_view_hyper_data", L'🛈', 0);
+    //laAddOperatorProperty(p, "hyper_data", "View Hyper Data", "Show Properties Of Specific Data Block", "LA_view_hyper_data", L'🛈', 0);
 
     p = la_SetGeneralRoot(&MAIN.GeneralFloatArraySub, "__general_real_arr__", "Genral Float Array Operations", "Genral Float Array Operations");
     laAddOperatorProperty(p, "restore", "Restore Default", "Restore the property to the original value", "LA_real_array_restore_default", L'⭯', 0);
     laAddOperatorProperty(p, "set_max", "Set Max", "Set The Property To The Max Value", "LA_real_array_set_max", 0,0);
     laAddOperatorProperty(p, "set_min", "Set Min", "Set The Property To The Min Value", "LA_real_array_set_min", 0,0);
-    laAddOperatorProperty(p, "hyper_data", "View Hyper Data", "Show Properties Of Specific Data Block", "LA_view_hyper_data", L'🛈', 0);
+    //laAddOperatorProperty(p, "hyper_data", "View Hyper Data", "Show Properties Of Specific Data Block", "LA_view_hyper_data", L'🛈', 0);
 
     p = la_SetGeneralRoot(&MAIN.GeneralEnumSub, "__general_enum__", "Genral Enum Operations", "Genral Enum Operations");
     laAddOperatorProperty(p, "restore", "Restore Default", "Restore the property to the original value", "LA_enum_restore_default", L'⭯', 0);
@@ -870,11 +864,11 @@ void la_RegisterGeneralProps(){
     laAddOperatorProperty(p, "restore", "Restore Default", "Restore the property to the original value", "LA_enum_array_restore_default", L'⭯', 0);
     
     p = la_SetGeneralRoot(&MAIN.GeneralStringSub, "__general_string__", "Genral String Operations", "Genral String Operations");
-    laAddOperatorProperty(p, "get_folder_path", "Get Folder Path", "Get a folder path", "LA_string_get_folder_path", L'📁', 0);
-    laAddOperatorProperty(p, "get_file_path", "Get File Path", "Get a file path", "LA_string_get_file_path", L'🖹', 0);
     laAddOperatorProperty(p, "copy", "Copy", "Copy to clipboard", "LA_string_copy", 0,0);
     laAddOperatorProperty(p, "paste", "Paste", "Paste from clipboard", "LA_system_paste", 0,0);
     laAddOperatorProperty(p, "restore", "Restore Default", "Restore Default Value", "LA_string_set_default", L'⭯', 0);
+    laAddOperatorProperty(p, "get_folder_path", "Get Folder Path", "Get a folder path", "LA_string_get_folder_path", L'📁', 0);
+    laAddOperatorProperty(p, "get_file_path", "Get File Path", "Get a file path", "LA_string_get_file_path", L'🖹', 0);
     p->UiDefine=laui_StringPropUiDefine;
 
     p = la_SetGeneralRoot(&MAIN.GeneralOperatorSub, "__general_operator__", "Genral Operator Operations", "Genral Operator Operations");
@@ -1198,7 +1192,7 @@ void la_RegisterInternalProps(){
         }
 
         p = laAddPropertyContainer("ui_layout", "Layout Node", "Property Container For Single Layout", 0,laui_LayoutListItem, sizeof(laLayout), 0,0,2);{
-            laAddStringProperty(p, "title", "Title", "The Title/Name Of A Panel", 0,0,0,0,1, offsetof(laLayout, ID), 0,0,0,0,LA_AS_IDENTIFIER);
+            laAddStringProperty(p, "title", "Title", "The Title/Name Of A Panel", 0,0,0,0,1, offsetof(laLayout, ID), 0,0,laset_LayoutTitle,0,LA_AS_IDENTIFIER);
             _LA_PROP_BLOCK = laAddSubGroup(p, "root_block", "Root Block", "Root Block For Panel Docking", "ui_block",0,0,0,offsetof(laLayout, FirstBlock), 0,0,0,0,0,0,0,LA_UDF_SINGLE);
             la_UDFAppendSharedTypePointer("_LA_PROP_BLOCK", _LA_PROP_BLOCK);
         }

+ 8 - 3
resources/la_templates.c

@@ -1,6 +1,6 @@
 /*
 * LaGUI: A graphical application framework.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
@@ -109,6 +109,7 @@ void laui_DefaultPropUiDefine(laUiList *uil, laPropPack *This, laPropPack *Opera
     if (OperatorProps && OperatorProps->LastPs){
         c = laFirstColumn(uil); gp = OperatorProps->LastPs->p;
         for (p = gp->SubProp->Props.pFirst; p; p = p->Item.pNext){
+            if(p->PropertyType!=LA_PROP_OPERATOR) continue;
             laShowItem(uil, c, OperatorProps, p->Identifier);
         }
     }
@@ -1389,7 +1390,11 @@ void laui_About(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laCol
             gc = laFirstColumn(gu);
             sprintf(buf, "LaGUI.%d.%d.%d", LA_VERSION_MAIN, LA_VERSION_SUB, LA_VERSION_MINOR);
             laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
-            sprintf(buf, "Program built on:[UTC+8] %s %s", __DATE__, __TIME__);
+            laShowLabel(gu, gc, LAGUI_GIT_BRANCH,0,0)->Flags|=LA_TEXT_MONO;
+#ifdef LAGUI_GIT_HASH
+            laShowLabel(gu, gc, LAGUI_GIT_HASH,0,0)->Flags|=LA_TEXT_MONO;
+#endif
+            sprintf(buf, "Built on:[UTC+8] %s %s", __DATE__, __TIME__);
             laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
             sprintf(buf, "UDF Identifier: %s",LA_UDF_IDENTIFIER);
             laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
@@ -1553,7 +1558,7 @@ void la_RegisterBuiltinTemplates(){
     laRegisterUiTemplate("LAUI_input_mapper","Input Mapper",laui_InputMapper,0,0,"Controlling",0,0,0);
     laRegisterUiTemplate("LAUI_drivers","Drivers",laui_Drivers,lauidetached_Drivers,0,0,0,0,0);
     laRegisterUiTemplate("LAUI_controllers", "Controllers", laui_GameController, lauidetached_GameController, 0,0,0,0,0);
-    laRegisterUiTemplate("LAUI_user_preferences", "User Preferences", laui_UserPreference, 0, 0, "System",0,0,0);
+    laRegisterUiTemplate("LAUI_user_preferences", "User Preferences", laui_UserPreference, 0, 0, "System",0,25,25);
     laRegisterUiTemplate("LAUI_about", "About", laui_About, 0, 0, 0, 0,15,25);
     laRegisterUiTemplate("LAUI_texture_inspector", "Texture Inspector", laui_TextureInspector, lauidetached_TextureInspector, 0, 0, 0,0,0);
     laRegisterUiTemplate("LAUI_data_manager", "Data Manager", laui_IdleDataManager, lauidetached_IdleDataManager, 0, 0, 0,25,25);

+ 1 - 1
resources/la_tns_als.c

@@ -1,6 +1,6 @@
 /*
 * LaGUI: A graphical application framework.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by

+ 1 - 1
resources/la_tns_drivers.c

@@ -1,6 +1,6 @@
 /*
 * LaGUI: A graphical application framework.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by

+ 1 - 1
resources/la_tns_shaders.cpp

@@ -1,6 +1,6 @@
 /*
 * LaGUI: A graphical application framework.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by

+ 8 - 1
resources/la_translations.c

@@ -1,6 +1,6 @@
 /*
 * LaGUI: A graphical application framework.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
@@ -19,6 +19,13 @@
 #include "la_5.h"
 
 static const char *entries[]={
+"Set Min","调成最小",
+"Set Max","调成最大",
+"Restore Default","恢复默认值",
+"Paste","粘贴",
+"Copy","复制",
+"Copy Selection","复制选择内容",
+"Get File Path","获取文件路径",
 "Show Splash","显示闪屏",
 "🡻 Minimized","🡻 隐藏的面板",
 "Length","长度",

+ 9 - 5
resources/la_widgets.c

@@ -1,6 +1,6 @@
 /*
 * LaGUI: A graphical application framework.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
@@ -1389,7 +1389,7 @@ void la_ImageDraw(laUiItem *ui, int h){
     real UseW=Full?(W):((real)LA_RH*ui->SymbolID/H*W);
     real L=(ui->R-ui->L-UseW)/2,U=0,UseH=Full?H:(ui->B-ui->U);
     if(Full){ U=(ui->B-ui->U-H)/2; }
-    if((ui->Flags&LA_TEXT_ALIGN_CENTER) || Full){ L=0; }
+    if(ui->Flags&LA_TEXT_ALIGN_CENTER){ L=0; }
     elif(ui->Flags&LA_TEXT_ALIGN_RIGHT){ L=ui->R-ui->L-UseW; }
     tnsDraw2DTextureDirectly(im->Texture,ui->L+L,ui->U+U,UseW,UseH);
     tnsFlush();
@@ -2298,6 +2298,8 @@ int OPMOD_Button(laOperator *a, laEvent *e){
 
     char *str;
 
+    int call_ret=0;
+
     if (e->Type == LA_L_MOUSE_UP && ui->State!=LA_UI_NORMAL){
         ui->State = LA_UI_NORMAL;
         if (ui->AT){
@@ -2312,7 +2314,7 @@ int OPMOD_Button(laOperator *a, laEvent *e){
             ly = e->y;
             laLocalToWindow(a, a->ToPanel, &e->x, &e->y);
             e->Localized = 0;
-            laInvokeP(0, ui->AT, e, 0, ui->ExtraInstructions ? ui->ExtraInstructions->Ptr : 0, 0);
+            call_ret=laInvokeP(0, ui->AT, e, 0, ui->ExtraInstructions ? ui->ExtraInstructions->Ptr : 0, 0);
             e->x = lx;
             e->y = ly;
             e->Localized = 1;
@@ -2333,7 +2335,7 @@ int OPMOD_Button(laOperator *a, laEvent *e){
                 ly = e->y;
                 laLocalToWindow(a, a->ToPanel, &e->x, &e->y);
                 e->Localized = 0;
-                laInvokePCreateThis(0, ap->OperatorType, e, ui->PP.RawThis, ui->PP.Go->UseInstance, ui->ExtraInstructions ? ui->ExtraInstructions->Ptr : 0, ap->Base.ExtraInstructions);
+                call_ret=laInvokePCreateThis(0, ap->OperatorType, e, ui->PP.RawThis, ui->PP.Go->UseInstance, ui->ExtraInstructions ? ui->ExtraInstructions->Ptr : 0, ap->Base.ExtraInstructions);
                 if(a->StopNow) return LA_FINISHED;
                 laRetriggerOperators();
                 e->x = lx;
@@ -2354,6 +2356,8 @@ int OPMOD_Button(laOperator *a, laEvent *e){
             }
         }
 
+        if(call_ret==LA_OPERATOR_CALLS_SHUTOFF) return LA_OPERATOR_CALLS_SHUTOFF;
+
         laRedrawCurrentPanel();
         if(ui->Flags&LA_UI_FLAGS_EXIT_WHEN_TRIGGERED) return LA_FINISHED_PASS;
         return LA_RUNNING_PASS;
@@ -2662,7 +2666,7 @@ int OPMOD_Collection(laOperator *a, laEvent *e){
         ui->PP.EndInstance = Active;
     }
 
-    if (e->Type == LA_L_MOUSE_DOWN && (!laIsPropertyReadOnly(&ui->PP))){
+    if (e->Type == LA_L_MOUSE_DOWN && (!laIsPropertyReadOnly(&ui->PP)) && ui->Type!=_LA_UI_COLLECTION_SINGLE){
         laUiList *uil;
         for (uil = ui->Subs.pFirst; uil; uil = uil->Item.pNext){
             if (a->ConfirmData) return LA_RUNNING;

+ 22 - 18
resources/la_widgets_viewers.c

@@ -1,6 +1,6 @@
 /*
 * LaGUI: A graphical application framework.
-* Copyright (C) 2022 Wu Yiming
+* Copyright (C) 2022-2023 Wu Yiming
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
@@ -147,17 +147,19 @@ void la_RootObjectDraw(laBoxedTheme *bt, tnsObject *root, laUiItem* ui){
     tnsPushMatrix();
     tnsPopMatrix(); //those are necessary when ui is the first in list;
 
-    glEnable(GL_DEPTH_TEST); glDisable(GL_BLEND);
-    tnsEnableShaderv(T->immShader);
-    tnsUnbindTexture(); tnsUniformUseTexture(T->immShader,0,0); tnsUseMultiplyColor(0);
-    glPointSize(6); glLineWidth(3);
-    tnsDrawObjectTree(root, 0, 0, e->SelectMode);
-    glPointSize(1); glLineWidth(3);
-
-    glDepthMask(GL_FALSE); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glEnable(GL_POLYGON_OFFSET_LINE); glEnable(GL_POLYGON_OFFSET_POINT); glPolygonOffset(1,1);
-    tnsDrawObjectTree(root, root->Active, 1, 0);
-    glDepthMask(GL_TRUE); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
-    glLineWidth(1);
+    if(root){
+        glEnable(GL_DEPTH_TEST); glDisable(GL_BLEND);
+        tnsEnableShaderv(T->immShader);
+        tnsUnbindTexture(); tnsUniformUseTexture(T->immShader,0,0); tnsUseMultiplyColor(0);
+        glPointSize(6); glLineWidth(3);
+        tnsDrawObjectTree(root, 0, 0, e->SelectMode);
+        glPointSize(1); glLineWidth(3);
+
+        glDepthMask(GL_FALSE); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glEnable(GL_POLYGON_OFFSET_LINE); glEnable(GL_POLYGON_OFFSET_POINT); glPolygonOffset(1,1);
+        tnsDrawObjectTree(root, root->Active, 1, 0);
+        glDepthMask(GL_TRUE); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+        glLineWidth(1);
+    }
 
     if (!e->LineDrawingMode && e->ShowFloorGrid){
         tnsUseNoTexture();
@@ -166,12 +168,14 @@ void la_RootObjectDraw(laBoxedTheme *bt, tnsObject *root, laUiItem* ui){
         tnsFlush();
     }
 
-    glDisable(GL_DEPTH_TEST);
-    tnsDrawCursor(root);
-    glPointSize(8);
-    tnsDrawObjectOrigins(root,root->Active,0); tnsFlush();
-    glPointSize(1);
-    glEnable(GL_DEPTH_TEST);
+    if(root){
+        glDisable(GL_DEPTH_TEST);
+        tnsDrawCursor(root);
+        glPointSize(8);
+        tnsDrawObjectOrigins(root,root->Active,0); tnsFlush();
+        glPointSize(1);
+        glEnable(GL_DEPTH_TEST);
+    }
 
     //laInvoke(0,"M_select",e,&ui->ExtraPP,0,0);