Graphical user interface processing method and device, electronic equipment and storage medium
By mounting the second window created by IMGUI on the first window created by RMGUI, combining two modes, the problem of insufficient graphical user interface drawing performance in RMGUI mode is solved, and a more efficient graphical user interface drawing performance is achieved.
Patent Information
- Application Number
- CN202411297250.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2025-02-28
AI Technical Summary
When creating a graphical user interface using the Retention Mode Graphical User Interface Library (RMGUI), if you need to draw a node tree interface or a blueprint interface, it will consume a lot of computer resources due to the need to continuously update the nodes and refresh the interface, resulting in insufficient performance.
By mounting the second window on the first window created by the retained mode graphical user interface library and drawing the graphical user interface through the instant mode graphical user interface library (IMGUI) on the second window, combining the retained mode and the instant mode, the performance problem caused by using a single RMGUI mode is avoided.
By mounting the second window on the first window and drawing using IMGUI on the second window, the problem of insufficient graphical user interface drawing performance in RMGUI mode is solved, and the performance of graphical user interface drawing is improved.
Smart Images

Figure CN119536876A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of graphical user interface technology, and in particular to a graphical user interface processing method, device, electronic equipment and storage medium. Background Art
[0002] A Graphical User Interface (GUI) is a computer operation user interface that uses graphics to display. There are two modes of a Graphical User Interface: retained mode GUI (RMGUI) and immediate mode (IMGUI).
[0003] In RMGUI, UI elements (such as buttons, text boxes, etc.) are retained in memory after they are created, and the states of these UI elements (such as position, size, color, etc.) are maintained in memory and redrawn to the screen when needed. Therefore, RMGUI is suitable for making static graphical interfaces. In IMGUI, the entire graphical user interface is regenerated for each frame, and the application directly issues drawing commands to draw UI elements each time a new frame is drawn. Therefore, IMGUI is suitable for making dynamic or frequently refreshed graphical user interfaces.
[0004] In the process of implementing the present invention, the inventor found that: in the related art, a GUI mode is used to make a graphical user interface. When using RMGUI to make a graphical user interface, if a node tree interface or a blueprint interface needs to be drawn, a large amount of computer resources will be consumed due to the need to constantly update the nodes and refresh the interface, resulting in insufficient performance. Summary of the invention
[0005] Based on this, an object of the present invention is to provide a graphical user interface processing method, device, electronic device and storage medium, which have the advantage of avoiding performance deficiencies in graphical user interface drawing.
[0006] According to a first aspect of an embodiment of the present application, a graphical user interface processing method is provided, comprising the following steps:
[0007] In response to a graphical user interface drawing request, a retained mode graphical user interface library is called through a first thread to create a first window; an immediate mode graphical user interface library is called through a second thread to create a second window;
[0008] Obtaining a first window handle of a first window through the first thread, and sending a graphical user interface drawing instruction and the first window handle to a second thread;
[0009] Obtaining a second window handle of the second window through the second thread; and mounting the second window on the first window according to the first window handle and the second window handle;
[0010] Through the second thread, according to the graphical user interface drawing instruction, the immediate mode graphical user interface library is called to draw the second graphical user interface on the second window; through the first thread, the retained mode graphical user interface library is called to draw the first graphical user interface on the first window.
[0011] According to a second aspect of an embodiment of the present application, a graphical user interface processing device is provided, including:
[0012] The window creation module is used to call the retained mode graphical user interface library through the first thread to create a first window in response to the graphical user interface drawing request; and to call the immediate mode graphical user interface library through the second thread to create a second window;
[0013] A window handle acquisition module, used for acquiring a first window handle of a first window through a first thread, and sending a graphical user interface drawing instruction and the first window handle to a second thread;
[0014] The window mounting module is used to obtain the second window handle of the second window through the second thread; and mount the second window on the first window according to the first window handle and the second window handle;
[0015] The graphical user interface drawing module is used to call the immediate mode graphical user interface library through the second thread according to the graphical user interface drawing instruction to draw the second graphical user interface on the second window; and call the retained mode graphical user interface library through the first thread to draw the first graphical user interface on the first window.
[0016] According to a third aspect of an embodiment of the present application, there is provided an electronic device, comprising: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing any one of the above-mentioned graphical user interface processing methods.
[0017] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for processing a graphical user interface as described above is implemented.
[0018] The embodiment of the present application responds to a graphical user interface drawing request by calling a retained mode graphical user interface library through a first thread to create a first window; calling an immediate mode graphical user interface library through a second thread to create a second window; obtaining a first window handle of the first window through the first thread, and sending a graphical user interface drawing instruction and the first window handle to the second thread; obtaining a second window handle of the second window through the second thread; mounting the second window on the first window according to the first window handle and the second window handle; calling an immediate mode graphical user interface library through the second thread according to the graphical user interface drawing instruction to draw the second graphical user interface on the second window; calling a retained mode graphical user interface library through the first thread to draw the first graphical user interface on the first window. The present application mounts the second window on the first window created by the retained mode graphical user interface library, draws the second graphical user interface on the second window through the immediate mode graphical user interface library, combines the retained mode with the immediate mode, and avoids the performance problem of using the retained mode graphical user interface library to draw the second graphical user interface.
[0019] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application.
[0020] For better understanding and implementation, the present invention is described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A flowchart of a graphical user interface processing method provided by one embodiment of the present application;
[0022] Figure 2 A structural block diagram of a graphical user interface processing device provided by one embodiment of the present application;
[0023] Figure 3 A schematic block diagram of the structure of an electronic device provided for one embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to make the objectives, technical solutions and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0025] It should be clear that the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0026] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the embodiments of the present application. The singular forms of "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0027] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims. In the description of the present application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and do not have to be used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances.
[0028] In addition, in the description of this application, unless otherwise specified, "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0029] The graphical user interface processing method provided in the embodiments of the present application can be executed by a graphical user interface processing device, which can be implemented by software and / or hardware, and can be composed of two or more physical entities, or can be composed of one physical entity. The graphical user interface processing device can be any electronic device installed with data processing software, and the electronic device can be a computer, a mobile phone, a tablet or other smart device.
[0030] The inventor discovered in the process of implementing the present invention that in the related art, a GUI mode is used to create a graphical user interface. For example, industrial software WPS (office software), Autodesk Maya (3D animation and visual effects software), VirtualBox (virtual machine software), etc. use RMGUI as a GUI development framework. Unity (game engine software) uses the self-developed IMGUI as a GUI development framework.
[0031] When using RMGUI to create a graphical user interface, if you need to draw a node tree interface or a blueprint interface, it will consume a lot of computer resources and cause performance problems due to the need to constantly update the nodes and refresh the interface.
[0032] To this end, the present application mounts a second window on a first window created by a retained mode graphical user interface library, and draws a second graphical user interface on the second window by using an immediate mode graphical user interface library, thereby combining the retained mode with the immediate mode, and avoiding the performance problem of using the retained mode graphical user interface library to draw the second graphical user interface.
[0033] See also Figure 1 , which is a flow chart of a graphical user interface processing method provided by an embodiment of the present application. The present application embodiment provides a graphical user interface processing method, comprising the following steps:
[0034] S10: In response to a graphical user interface drawing request, a retained mode graphical user interface library is called through a first thread to create a first window; and an immediate mode graphical user interface library is called through a second thread to create a second window.
[0035] The retained mode GUI library refers to a library that follows the RMGUI paradigm. The retained mode GUI library includes but is not limited to a cross-platform C++ GUI library (Qt GUI library) and a GTK GUI library.
[0036] The immediate mode GUI library refers to a library that follows the IMGUI paradigm. The immediate mode GUI library includes the Dear-imgui GUI library for C++ and the Nuklear GUI library.
[0037] In the embodiment of the present application, after receiving a graphical user interface drawing request, the first thread calls the Qt graphical user interface library to create a first window, and the second thread calls the dear-imgui graphical user interface library to create a second window.
[0038] S20: Obtain a first window handle of the first window through the first thread, and send a graphical user interface drawing instruction and the first window handle to the second thread.
[0039] The window handle is a unique identifier used to identify a window in the operating system. Each window has a unique window handle, which can be used to operate or control the window, such as changing the window size, moving the window, and closing the window.
[0040] The first window handle is used to uniquely identify the first window. Specifically, the first window handle can be a code, a number, or a letter.
[0041] The GUI drawing instruction includes the GUI drawing content, and the drawing content includes the attribute information of the graphic elements to be drawn on the GUI, wherein the graphic elements include but are not limited to buttons, text boxes, list boxes, and sliders.
[0042] In an embodiment of the present application, the first thread calls a windows API function to obtain a first window handle of the first window. The windows API function includes but is not limited to a FindWindow function and a FindWindowEx function. The first thread communicates with the second thread, and the first thread transmits a graphical user interface drawing instruction and the first window handle to the second thread.
[0043] S30: Obtaining a second window handle of the second window through the second thread; and mounting the second window on the first window according to the first window handle and the second window handle.
[0044] The second window handle is used to uniquely identify the second window. Specifically, the second window handle can be a code, a number, or a letter.
[0045] In the embodiment of the present application, the second thread calls the windows API function to obtain the second window handle of the second window. The second thread uses the first window as the parent window and the second window as the child window according to the first window handle and the second window handle, and embeds the child window into the parent window.
[0046] S40: through the second thread, according to the graphical user interface drawing instruction, calling the immediate mode graphical user interface library, and drawing the second graphical user interface on the second window; through the first thread, calling the retained mode graphical user interface library, and drawing the first graphical user interface on the first window.
[0047] The first graphical user interface is a static graphical user interface. Specifically, the first graphical user interface may be a preset background graphical user interface. The second graphical user interface is a dynamic graphical user interface or a high-frequency refresh graphical user interface. Specifically, the second graphical user interface includes one or more of a node tree interface and a blueprint interface.
[0048] In the embodiment of the present application, the second thread draws the second graphical user interface on the second window, and the first thread draws the first graphical user interface in an area of the first window except the second window.
[0049] By applying the embodiment of the present application, in response to a graphical user interface drawing request, a first window is created by calling a retained mode graphical user interface library through a first thread; a second window is created by calling an immediate mode graphical user interface library through a second thread; a first window handle of the first window is obtained through the first thread, and a graphical user interface drawing instruction and the first window handle are sent to the second thread; a second window handle of the second window is obtained through the second thread; the second window is mounted on the first window according to the first window handle and the second window handle; the immediate mode graphical user interface library is called through the second thread according to the graphical user interface drawing instruction, and the second graphical user interface is drawn on the second window; the retained mode graphical user interface library is called through the first thread, and the first graphical user interface is drawn on the first window. The present application mounts the second window on the first window created by the retained mode graphical user interface library, draws the second graphical user interface on the second window through the immediate mode graphical user interface library, combines the retained mode with the immediate mode, and avoids the performance problem of insufficient drawing of the second graphical user interface using the retained mode graphical user interface library.
[0050] In an optional embodiment, in step S10, in response to the graphical user interface drawing request, the step of creating the first window by calling the retained mode graphical user interface library through the first thread includes steps S101 to S102, which are specifically as follows:
[0051] S101: In response to a graphical user interface drawing request, a window creation class of a retained mode graphical user interface library is called by a first thread.
[0052] The window creation class includes window information required to create a window, including but not limited to the size, position and display style of the window. Specifically, the window creation class includes but is not limited to the Widget class and the Dialog class, the widget class may be the QWidget class, and the dialog class may be the QFileDialog class.
[0053] S102: Instantiating the window creation class through the first thread to obtain a first window.
[0054] In an embodiment of the present application, the first thread instantiates the window creation class, obtains the window information required to create the window, and draws the first window according to the window information.
[0055] The first window can be created automatically and quickly by calling the window creation class of the retained mode graphical user interface library.
[0056] In an optional embodiment, the step of creating a second window by calling the immediate mode graphical user interface library through the second thread in step S10 includes step S11, which is specifically as follows:
[0057] S11: creating a second thread through the first thread, and calling a window creation function of an immediate mode graphical user interface library through the second thread to create a second window.
[0058] In the embodiment of the present application, the second window is created by using the window creation functions ImGui::Begin() and ImGui::End(). Specifically, the window creation function ImGui::Begin() is used to define the beginning of the second window, and the window creation function ImGui::End() is used to define the end of the second window. For example, taking the creation of a window named "Hello, world!" as an example, the code is as follows:
[0059]
[0060] By calling the window creation function, you can automatically and quickly create a second window.
[0061] In an optional embodiment, the step of mounting the second window on the first window according to the first window handle and the second window handle in step S30 includes steps S301 to S303, which are specifically as follows:
[0062] S301: establishing an association relationship between the second window and the first window according to the first window handle and the second window handle.
[0063] In the embodiment of the present application, the second thread sets the second window as a child window of the first window according to the first window handle and the second window handle, and obtains the association relationship between the second window and the first window.
[0064] S302: Determine a display position of the second window in the first window.
[0065] The display position may be a preset position in the first window, specifically, a center position, a left-aligned position, and a right-aligned position of the first window.
[0066] In the embodiment of the present application, the second thread determines that the display position of the second window in the first window is the center position of the first window.
[0067] S303: embedding the second window into the display position of the first window according to the association relationship.
[0068] In the embodiment of the present application, the second thread uses the second window as a child window and the first window as a parent window, and embeds the child window into the center of the working area of the parent window.
[0069] The second window can be automatically and quickly embedded into the first window through the first window handle and the second window handle.
[0070] In an optional embodiment, the step of calling the immediate mode GUI library through the second thread according to the GUI drawing instruction to draw the second GUI on the second window in step S40 includes steps S401 to S402, which are specifically as follows:
[0071] S401: Determine, through a second thread, attribute information of a graphic element to be drawn on a second graphic user interface according to a graphic user interface drawing instruction.
[0072] The attribute information of the graphic element to be drawn includes the type, position, size, color and transparency of the graphic element to be drawn.
[0073] S402: Calling a second graphics drawing interface of the immediate mode graphical user interface library through a second thread, drawing the graphic element to be drawn on a second window according to the attribute information of the graphic element to be drawn, and obtaining a second graphical user interface.
[0074] The second graphics drawing interface refers to a renderer of an immediate mode graphical user interface library. Specifically, the second graphics drawing interface may be DiectX, OpenGL, and SDL.
[0075] In an embodiment of the present application, the second thread calls the OpenGL renderer of dear-imgui, draws the graphic elements to be drawn on the second window according to the attribute information of the graphic elements to be drawn, and obtains the second graphical user interface.
[0076] The second thread can draw the second graphical user interface on the second window by executing the graphical user interface drawing instruction and calling the second graphical user interface drawing interface of the immediate mode graphical user interface library, thereby avoiding the performance problem of using the retained mode graphical user interface library to draw the second graphical user interface.
[0077] In an optional embodiment, the step of calling the retained mode GUI library through the first thread in step S40 to draw the first GUI on the first window includes step S41, which is specifically as follows:
[0078] S41: Calling a first graphics drawing interface of a retained mode graphical user interface library through a first thread to obtain a preset scene model; generating corresponding drawing commands according to the properties of each interface element in the preset scene model and the relationship between each interface element; and drawing a first graphical user interface on a first window according to the corresponding drawing commands.
[0079] Among them, in RMGUI, the application will create a scene model through graphic primitives. Graphic primitives include geometric shapes and lines. The scene model includes the properties of each interface element to be drawn in the graphical user interface and the relationship between each interface element to be drawn. The application sends the scene model to the renderer, and the renderer stores the scene model in the memory. If you want to draw a graphical user interface, the renderer will convert the scene model in the memory into corresponding drawing commands, execute the drawing commands, and draw the graphical user interface. When it is necessary to modify the attributes or relationships of the interface elements in the scene model, the application will issue a command to update the scene model, for example, to add or remove lines, and the renderer will redraw the graphical user interface according to the updated scene model.
[0080] The preset scene model includes the properties of each interface element to be drawn in the first graphical user interface and the relationship between each interface element to be drawn.
[0081] The first graphics drawing interface refers to a renderer of a retained mode graphical user interface library. Specifically, the first graphics drawing interface may be WPF, HOOPS, or 3DGS.
[0082] In an embodiment of the present application, the first thread calls a retained mode graphical user interface library to draw a first graphical user interface on the first window.
[0083] By drawing the first graphical user interface on the first window and drawing the second graphical user interface on the second window, the combination of the retained mode graphical user interface and the immediate mode graphical user interface is achieved, and the graphical user interface drawing performance is improved.
[0084] In an optional embodiment, the graphical user interface processing method further includes step S50, which is as follows:
[0085] S50: According to the second window handle, the window style of the second window is set to the embedded window style.
[0086] Among them, the embedded window style is WS_CHILD style.
[0087] In the embodiment of the present application, the second thread sets the window style of the second window to the WS_CHILD style according to the second window handle, so that the second window can be a child window of the first window and change with the first window. For example, if the display position of the first window changes, the second window will move accordingly with the first window.
[0088] The following is an embodiment of the device of the present application, which can be used to execute the content of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the content of the method in the embodiment of the present application.
[0089] See also Figure 2 , which shows a schematic diagram of the structure of a graphical user interface processing device provided in an embodiment of the present application. The graphical user interface processing device 6 provided in an embodiment of the present application includes:
[0090] The window creation module 61 is used to call the retained mode graphical user interface library through the first thread to create a first window in response to the graphical user interface drawing request; and call the immediate mode graphical user interface library through the second thread to create a second window;
[0091] The window handle acquisition module 62 is used to acquire the first window handle of the first window through the first thread, and send the graphical user interface drawing instruction and the first window handle to the second thread;
[0092] The window mounting module 63 is used to obtain the second window handle of the second window through the second thread; and mount the second window on the first window according to the first window handle and the second window handle;
[0093] The GUI drawing module 64 is used to call the immediate mode GUI library through the second thread according to the GUI drawing instruction to draw the second GUI on the second window; and to call the retained mode GUI library through the first thread to draw the first GUI on the first window.
[0094] By applying the embodiment of the present application, in response to a graphical user interface drawing request, a first window is created by calling a retained mode graphical user interface library through a first thread; a second window is created by calling an immediate mode graphical user interface library through a second thread; a first window handle of the first window is obtained through the first thread, and a graphical user interface drawing instruction and the first window handle are sent to the second thread; a second window handle of the second window is obtained through the second thread; the second window is mounted on the first window according to the first window handle and the second window handle; the immediate mode graphical user interface library is called through the second thread according to the graphical user interface drawing instruction to draw the second graphical user interface on the second window; the retained mode graphical user interface library is called through the first thread to draw the first graphical user interface on the first window. The present application mounts the second window on the first window created by the retained mode graphical user interface library, and draws the second graphical user interface on the second window through the immediate mode graphical user interface library, thereby avoiding the performance problem of using the retained mode graphical user interface library to draw the second graphical user interface.
[0095] The following is an embodiment of the device of the present application, which can be used to execute the content of the method in the embodiment of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the content of the method in the embodiment of the present application.
[0096] See also Figure 3 The present application also provides an electronic device 300, which may be a computer, a mobile phone, a tablet computer, a graphical user interface processing device, etc. In an exemplary embodiment of the present application, the electronic device 300 is a graphical user interface processing device, which may include: at least one processor 301, at least one memory 302, at least one display, at least one network interface 303, a user interface 304, and at least one communication bus 305.
[0097] The user interface 304 is mainly used to provide an input interface for the user and obtain data input by the user. Optionally, the user interface may also include a standard wired interface or a wireless interface.
[0098] The network interface 303 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0099] The communication bus 305 is used to realize the connection and communication between these components.
[0100] Among them, the processor 301 may include one or more processing cores. The processor uses various interfaces and lines to connect various parts of the entire electronic device, and executes various functions of the electronic device and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory, and calling data stored in the memory. Optionally, the processor can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor can integrate one or more combinations of central processing unit (Central Processing Unit, CPU), image processor (Graphics Processing Unit, GPU) and modem. Among them, the CPU mainly processes the operating system, user interface and application program, etc.; the GPU is responsible for rendering and drawing the content to be displayed by the display layer; the modem is used to process wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor, but implemented by a single chip.
[0101] Among them, the memory 302 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory includes a non-transitory computer-readable storage medium. The memory can be used to store instructions, programs, codes, code sets or instruction sets. The memory may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory may also be optionally at least one storage device located away from the aforementioned processor. As Figure 3 As shown, the memory as a computer storage medium may include an operating system, a network communication module, a user interface module, and an operating application program.
[0102] The processor can be used to call the application of the graphical user interface processing method stored in the memory, and specifically execute the method steps of the above-mentioned embodiment. The specific execution process can refer to the specific description shown in the embodiment, which will not be repeated here.
[0103] The present application also provides a computer-readable storage medium on which a computer program is stored, and the instructions are suitable for being loaded by a processor and executing the method steps of the above-mentioned embodiment. The specific execution process can refer to the specific description shown in the embodiment, and will not be repeated here. The device where the storage medium is located can be a personal computer, a laptop computer, a smart phone, a tablet computer and other electronic devices.
[0104] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are merely schematic, wherein the components described as separate parts may or may not be physically separated, and the parts displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.
[0105] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0106] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the function selected in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 function selected in a box or multiple boxes.
[0107] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 steps for the function selected in a box or multiple boxes.
[0108] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0109] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0110] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0111] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0112] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A graphical user interface processing method, characterized in that: The steps include: In response to a graphical user interface drawing request, a retained mode graphical user interface library is called through a first thread to create a first window; an immediate mode graphical user interface library is called through a second thread to create a second window; Obtaining a first window handle of the first window through the first thread, and sending a graphical user interface drawing instruction and the first window handle to the second thread; Obtaining, through the second thread, a second window handle of the second window; and mounting the second window on the first window according to the first window handle and the second window handle; Through the second thread, according to the graphical user interface drawing instruction, the immediate mode graphical user interface library is called to draw the second graphical user interface on the second window; through the first thread, the retained mode graphical user interface library is called to draw the first graphical user interface on the first window.
2. The graphical user interface processing method according to claim 1, characterized in that: The step of calling the immediate mode graphical user interface library according to the graphical user interface drawing instruction through the second thread to draw the second graphical user interface on the second window includes: Determining, by the second thread, attribute information of a graphic element to be drawn on the second graphical user interface according to the graphical user interface drawing instruction; The second graphics drawing interface of the immediate mode graphical user interface library is called through the second thread, and the graphic element to be drawn is drawn on the second window according to the attribute information of the graphic element to be drawn, so as to obtain a second graphical user interface.
3. The graphical user interface processing method according to claim 1, characterized in that: The step of calling the retained mode graphical user interface library through the first thread to draw the first graphical user interface on the first window includes: Through the first thread, the first graphics drawing interface of the retained mode graphical user interface library is called to obtain a preset scene model; according to the properties of each interface element in the preset scene model and the relationship between each interface element, a corresponding drawing command is generated; according to the corresponding drawing command, a first graphical user interface is drawn on the first window.
4. The graphical user interface processing method according to any one of claims 1 to 3, characterized in that: The step of mounting the second window on the first window according to the first window handle and the second window handle comprises: Establishing an association relationship between the second window and the first window according to the first window handle and the second window handle; Determining a display position of the second window in the first window; According to the association relationship, the second window is embedded into the display position of the first window.
5. The graphical user interface processing method according to any one of claims 1 to 3, characterized in that: Also includes: According to the second window handle, the window style of the second window is set to an embedded window style.
6. The graphical user interface processing method according to any one of claims 1 to 3, characterized in that: The step of creating a second window by calling the immediate mode graphical user interface library through the second thread includes: A second thread is created through the first thread, and a window creation function of the immediate mode graphical user interface library is called through the second thread to create a second window.
7. The graphical user interface processing method according to any one of claims 1 to 3, characterized in that: The step of creating a first window by calling a retained mode graphical user interface library through a first thread in response to a graphical user interface drawing request includes: In response to a graphical user interface drawing request, calling a window creation class of the retained mode graphical user interface library through the first thread; The window creation class is instantiated through the first thread to obtain a first window.
8. The graphical user interface processing method according to any one of claims 1 to 3, characterized in that: The retained mode GUI library comprises a cross-platform C++ GUI library, and the immediate mode GUI library comprises a bloat-free GUI library for C++.
9. The graphical user interface processing method according to any one of claims 1 to 3, characterized in that: The graphical user interface includes one or more of a node tree interface and a blueprint interface.
10. A graphical user interface processing device, characterized in that: include: A window creation module, configured to create a first window by calling a retained mode graphical user interface library through a first thread in response to a graphical user interface drawing request; Calling the immediate mode graphical user interface library through the second thread to create a second window; A window handle acquisition module, used for acquiring a first window handle of the first window through the first thread, and sending a graphical user interface drawing instruction and the first window handle to the second thread; A window mounting module, configured to obtain a second window handle of the second window through the second thread; and mount the second window on the first window according to the first window handle and the second window handle; The graphical user interface drawing module is used to call the immediate mode graphical user interface library through the second thread according to the graphical user interface drawing instruction to draw the second graphical user interface on the second window; and call the retained mode graphical user interface library through the first thread to draw the first graphical user interface on the first window.
11. An electronic device, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the graphical user interface processing method as described in any one of claims 1 to 9.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the graphical user interface processing method according to any one of claims 1 to 9 is implemented.