Application window drawing method, computing device and storage medium
By subclassing the window creation class of the graphical interface library and calling the custom plug-in library, the problem of inconsistent window styles of different applications is solved, a unified window drawing method is implemented, the user's learning and maintenance costs are reduced, and the neatness and beauty of the operating system are ensured.
Patent Information
- Application Number
- CN202210624932.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-02
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2042-06-02
AI Technical Summary
Different applications use different graphical interface libraries to draw windows in computing devices, resulting in inconsistent window styles, increasing user learning costs and maintenance difficulties, and affecting the neatness and beauty of the operating system.
By determining the graphical interface library required by the application, subclassing the window creation class and calling the custom plug-in library, the custom type window is drawn uniformly to achieve window style consistency across libraries.
It reduces user learning and maintenance costs, ensures the consistency of operating system style, and expands the uniformity of application window functions.
Smart Images

Figure CN114895894B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of operating systems, and in particular to an application window drawing method, a computing device and a storage medium. Background Art
[0002] With the advancement of computer technology, people are increasingly relying on various applications to complete various tasks. During application development, graphical interface libraries are often used to develop application windows. A graphical interface library (GUI library) is a library required for drawing graphical user interfaces (GUIs). Using these libraries, various graphics for GUIs can be drawn.
[0003] In the prior art, each application running on a computer is developed using a different graphical interface library. Consequently, when drawing their windows, different applications call upon different graphical interface libraries to create windows with different styles. This window-drawing method increases the learning curve for users, and the window styles drawn by each application on the computer are not uniform, resulting in less than aesthetically pleasing window rendering.
[0004] To this end, a new application window drawing method is needed. Summary of the Invention
[0005] To this end, the present invention provides an application window drawing method to try to solve or at least alleviate the above problems.
[0006] According to one aspect of the present invention, a method for drawing an application window is provided, which is suitable for execution in a computing device in which one or more applications are running. The method includes the following steps: in response to a window drawing request of an application, determining a graphical interface library to be called to draw the application's window; if the graphical interface library to be called to draw the application's window is a first graphical interface library, generating a first type of window based on the first graphical interface library; subclassing a first window creation class of the first graphical interface library to obtain a second window creation class; and drawing a custom type of window of the application by calling the second window creation class through the first type of window.
[0007] Optionally, the method according to the present invention also includes the following steps: if the graphical interface library required to draw the application window is a second graphical interface library, generating a second type of window based on the second graphical interface library; calling a custom plug-in library based on the second type of window to generate a custom type of window; constructing the display settings of the second type of window; and drawing the second type of window and the custom type window according to the display settings.
[0008] Optionally, in the method according to the present invention, generating a first type window according to the first graphical interface library includes the steps of: calling a first drawing interface of the first graphical interface library to determine a file loading class in the first graphical interface library; and instantiating the file loading class to obtain the first type window.
[0009] Optionally, in the method according to the present invention, subclassing the first window creation class of the first graphical interface library to obtain the second window creation class includes the steps of: adding a custom type option in the first window creation class to obtain the second window creation class.
[0010] Optionally, in the method according to the present invention, calling the second window creation class through the first type window to draw the custom type window of the application includes the steps of: determining the custom drawing interface of the custom plug-in library according to the custom type option in the second window creation class; and calling the custom plug-in library according to the custom drawing interface to draw the custom type window.
[0011] Optionally, in the method according to the present invention, instantiating the file loading class to obtain the first type of window includes the steps of: obtaining file information required for drawing the window according to the file loading class; calling the custom plug-in library according to the custom drawing interface to draw the custom type window includes the steps of: drawing the custom type window according to the file information and the custom style in the custom plug-in library.
[0012] Optionally, in the method according to the present invention, calling a custom plug-in library according to the second type window to generate a custom type window includes the following steps: adding a style selection process and a custom type option to a first window creation method of a second graphical interface library to obtain a second window creation method; the second type window determines a custom drawing interface of the custom plug-in library according to the style selection process and the custom type option in the second window creation method; and calling the custom plug-in library according to the custom drawing interface to generate a custom type window.
[0013] Optionally, in the method according to the present invention, generating a custom type window by calling a custom plug-in library according to a custom drawing interface includes the steps of: obtaining file information required for drawing the window; and generating the custom type window according to the file information and a custom style in the custom plug-in library.
[0014] Optionally, in the method according to the present invention, the display setting of the second type window includes: setting the second type window to be displayed in a transparent manner.
[0015] Optionally, in the method according to the present invention, the window type of the custom type window includes a file selection window.
[0016] Optionally, in the method according to the present invention, the first graphical interface library includes a Qt graphical interface library, and the second graphical interface library includes a GTK graphical interface library.
[0017] According to another aspect of the present invention, a computing device is provided, comprising: one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for executing the application window drawing method according to the present invention.
[0018] According to another aspect of the present invention, a computer-readable storage medium storing one or more programs is provided. The one or more programs include instructions that, when executed by a computing device, cause the computing device to execute the application window drawing method according to the present invention.
[0019] The present invention discloses an application window drawing method suitable for execution in a computing device in which one or more applications are running. The method comprises the following steps: in response to an application's window drawing request, determining a graphical interface library to be called for drawing the application's window; if the graphical interface library to be called for drawing the application's window is a first graphical interface library, generating a first-type window based on the first graphical interface library; subclassing a first window creation class of the first graphical interface library to obtain a second window creation class, and drawing a custom-type window of the application through the first-type window calling the second window creation class. The present invention can determine the graphical interface library to be called for drawing the application's window, subclass the window creation class in the graphical interface library, and draw the custom-type window of the application based on the subclassed second window creation class, thereby achieving unification of application window types. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] To achieve the above and related purposes, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings, which indicate various ways in which the principles disclosed herein may be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. The above and other objects, features, and advantages of the present invention will become more apparent by reading the following detailed description in conjunction with the accompanying drawings. Throughout this disclosure, the same reference numerals generally refer to the same parts or elements.
[0021] Figure 1a A schematic diagram of an application window interface in the prior art is shown;
[0022] Figure 1b A schematic diagram of another application window interface in the prior art is shown;
[0023] Figure 2 A schematic diagram of a computing device 200 is shown according to an exemplary embodiment of the present invention.
[0024] Figure 3 FIG. 3 is a flow chart showing a method 300 for drawing an application window according to an exemplary embodiment of the present invention;
[0025] Figure 4 A schematic diagram of drawing a user-defined type window according to an exemplary embodiment of the present invention is shown;
[0026] Figure 5 FIG. 4 is a schematic diagram showing a method of drawing a user-defined type window according to another exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0027] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art. The same reference numerals generally refer to the same components or elements.
[0028] In the prior art, each application running on a computer is developed using a different graphical interface library. Therefore, when drawing an application window, different applications call different graphical interface libraries to draw windows of different styles.
[0029] According to one embodiment of the present invention, applications running on a Linux system are developed using a variety of different graphical interface libraries, such as the Qt and GTK libraries. Qt is a cross-platform C++ development library primarily used for developing graphical user interface (GUI) programs. GTK (GIMP Toolkit) is a cross-platform, general-purpose graphics library distributed under the LGPL license that supports the creation of GUI-based applications.
[0030] When drawing their application windows, these applications call their own different graphical interface libraries to draw the windows, resulting in different window styles. According to one embodiment of the present invention, when drawing their windows, applications developed based on the Qt graphical interface library call the Qt static function QFileDialog::getOpenFileName() in the Qt graphical interface library to draw their application windows. Figure 1a A schematic diagram of an application window interface in the prior art is shown. Figure 1a As shown, the application developed based on the Qt graphical interface library draws a file selection window for selecting application files.
[0031] According to another embodiment of the present invention, when drawing a window, an application developed based on the GTK graphical interface library calls the GtkWidget*gtk_file_selection_new(const gchar*title) function in the GTK graphical interface library to draw a window based on the style specified by the GTK graphical interface library. Figure 1b FIG. 1 shows another schematic diagram of an application window interface in the prior art. Figure 1b As shown, the application developed based on the GTK graphical interface library draws a file selection window for selecting application files.
[0032] Because different applications in computing devices are developed using a variety of different graphical interface libraries, different graphical interface libraries are called when drawing application windows, resulting in different styles and styles of windows opened by various applications in the computing device. These windows of different styles and styles are not only inconvenient for users to use, but also increase the user's learning cost for different windows. At the same time, due to the different technologies used, they also increase the maintenance difficulty for maintenance personnel. Different styles of windows are also not conducive to unifying the styles of various interfaces in the operating system, and are not neat and beautiful. To this end, the present invention proposes an application window drawing method. The application window drawing method of the present invention is suitable for execution in a computing device.
[0033] Figure 2 A schematic diagram of a computing device 200 is shown according to an exemplary embodiment of the present invention.
[0034] In a basic configuration, computing device 200 includes at least one processing unit 220 and system memory 210. According to one aspect, system memory 210 includes, but is not limited to, volatile storage (e.g., random access memory), non-volatile storage (e.g., read-only memory), flash memory, or any combination of such storage, depending on the configuration and type of computing device. According to one aspect, system memory 210 includes an operating system 211.
[0035] According to one aspect, operating system 211, for example, is suitable for controlling the operation of computing device 200. Furthermore, examples may be practiced in conjunction with graphics libraries, other operating systems, or any other application programs and are not limited to any particular application or system. Figure 2 This basic configuration is illustrated in FIG by those components within dashed line 215. According to one aspect, computing device 200 has additional features or functionality. For example, according to one aspect, computing device 200 includes additional data storage devices (removable and / or non-removable), such as magnetic disks, optical disks, or tape.
[0036] As stated above, according to one aspect, program modules 212 are stored in system memory 210. According to one aspect, program modules 212 may include one or more application programs. The present invention is not limited to the types of application programs. For example, applications may include: email and contact applications, word processing applications, spreadsheet applications, database applications, slide show applications, drawing or computer-aided applications, web browser applications, etc.
[0037] According to one aspect of the present invention, to facilitate standardization of window styles for application-drawn windows, a custom plug-in library 213 is pre-installed in system memory 210. Custom plug-in library 213 is used to specify styles for drawing application windows, which can be customized by developers or users. Custom plug-in library 213 includes various style files required for drawing application windows. Style files include images, text, and interface configuration information. The present invention does not impose any restrictions on the types or number of style files included in custom plug-in library 213.
[0038] According to one aspect, examples may be practiced on a circuit comprising discrete electronic components, a packaged or integrated electronic chip containing logic gates, a circuit utilizing a microprocessor, or a single chip containing electronic components or a microprocessor. Figure 2 In the embodiment of the present invention, each or many components shown in the embodiment of the present invention can be integrated into a system on a chip (SOC) on a single integrated circuit to practice the example. According to one aspect, such a SOC device may include one or more processing units, a graphics unit, a communication unit, a system virtualization unit, and various application functions, all of which are integrated (or "burned") onto a chip substrate as a single integrated circuit. When operated via the SOC, the functions described in this article can be operated via a dedicated logic integrated with other components of the computing device 200 on a single integrated circuit (chip). Other technologies capable of performing logical operations (such as AND, OR, and NOT) can also be used to practice embodiments of the present invention, and the other technologies include but are not limited to mechanical, optical, fluid, and quantum technologies. In addition, embodiments of the present invention can be practiced in a general-purpose computer or in any other circuit or system.
[0039] According to one aspect, the computing device 200 may also have one or more input devices 231, such as a keyboard, mouse, pen, voice input device, touch input device, etc. It may also include an output device 232, such as a display, speakers, printer, etc. The aforementioned devices are examples, and other devices may also be used. The computing device 200 may include one or more communication connections 233 that allow communication with other computing devices 200. Examples of suitable communication connections 233 include, but are not limited to: RF transmitter, receiver, and / or transceiver circuitry; Universal Serial Bus (USB), parallel, and / or serial ports.
[0040] The embodiment of the present invention also provides a non-transitory readable storage medium, which stores instructions for causing the computing device to execute a method according to an embodiment of the present invention. The readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. The information can be a computer-readable instruction, a data structure, a module of a program, or other data. Examples of readable 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, read-only compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, tape disk storage or other magnetic storage device or any other non-transitory readable storage medium.
[0041] According to one aspect, communication media is implemented by computer-readable instructions, data structures, program modules, or other data in a modulated data signal (e.g., a carrier wave or other transport mechanism), and includes any information delivery media. According to one aspect, the term "modulated data signal" describes a signal that has one or more characteristics set or changed in such a manner as to encode information in the signal. By way of example, and not limitation, communication media includes wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, radio frequency (RF), infrared, and other wireless media.
[0042] It should be noted that although the computing device shown above only includes the processing unit 220, the system memory 210, the input device 231, the output device 232, and the communication connection 233, in a specific implementation, the device may also include other components necessary for normal operation. In addition, those skilled in the art will understand that the device may only include the components necessary to implement the embodiments of this specification, and does not necessarily include all the components shown in the figure.
[0043] Figure 3 FIG. 3 is a flow chart showing a method 300 for drawing an application window according to an exemplary embodiment of the present invention. Figure 3 As shown, step S310 is first executed to determine the graphical interface library required to draw the application window in response to the application's window drawing request. When an application needs to display or obtain user input information in the form of a window, it will issue an application window drawing request. The present invention does not limit the window type of the window drawn by the application. According to one embodiment of the present invention, the window type of the window to be drawn by the application includes a file selection window.
[0044] When determining the graphical interface library that needs to be called to draw the window of an application, it can be determined based on the graphical interface library used by the application during development. If the graphical interface library used by the application during development is the first graphical interface library, then the graphical interface library that needs to be called to draw the window of the application is determined to be the first graphical interface library. If the graphical interface library used by the application during development is the second graphical interface library, then the graphical interface library that needs to be called to draw the window of the application is determined to be the second graphical interface library. The present invention does not limit the specific types of the first graphical interface library and the second graphical interface library. According to one embodiment of the present invention, the first graphical interface library includes the Qt graphical interface library, and the second graphical interface library includes the GTK graphical interface library.
[0045] Subsequently, step S320 is executed. If the graphical interface library required to draw the application window is the first graphical interface library, a first type window is generated according to the first graphical interface library. Specifically, the first drawing interface of the first graphical interface library is called to determine the file loading class in the first graphical interface library; the file loading class is instantiated to obtain the first type window.
[0046] According to one embodiment of the present invention, a first graphical interface library, which may be implemented as a Qt graphical interface library, provides a first drawing interface for calling the first graphical interface library. The Qt graphical interface library includes a file loading class for creating a window object. The file loading class specifically includes the QFileDialog class. The window object is instantiated by the QFileDialog class, and the created window object is a generated first-type window. The first-type window is a window drawn using the Qt graphical interface library.
[0047] According to one embodiment of the present invention, when a file loading class is instantiated to obtain a first-type window, file information required for drawing the window is obtained from the file loading class, so that a custom-type window is drawn based on the file information. According to one embodiment of the present invention, the custom-type window includes a file selection window. The file information includes information about each file to be loaded in the file selection window, including the file name and file type of one or more selectable files.
[0048] According to one embodiment of the present invention, generating the first type of window according to the first graphical interface library may be specifically implemented by executing the following code:
[0049] QFileDialog*filedialog=new QFileDialog(m_SelectfileSavePathEdit, QDir::homePath(), QString("pubKey.key"));
[0050] filedialog->setAcceptMode(QFileDialog::AcceptMode::AcceptSave);
[0051] filedialog->setNameFilter("KEY file(*.key)");
[0052] filedialog->setDefaultSuffix(QString("key"));
[0053] Subsequently, step S330 is executed to subclass the first window creation class of the first graphical interface library to obtain a second window creation class. The first graphical interface library originally includes a first type option in the first window creation class. The first type window can implement the style specified in the first graphical interface library by calling the first window creation class and using the first type option. In order for the first type window to draw a custom type window based on the window creation class, the first window creation class of the first graphical interface library needs to be subclassed. Specifically, the custom type option is added to the first window creation class to obtain the second window creation class.
[0054] After adding the custom type option to the first window creation class, the first window type draws the custom type window according to the custom type option in the second window creation class. When the first window type calls the second window creation class to draw the application's custom type window, step S340 is executed: calling the custom plug-in library based on the custom drawing interface to draw the application's custom type window. Specifically, the custom drawing interface of the custom plug-in library is determined based on the custom type option in the second window creation class; and the custom plug-in library is called based on the custom drawing interface to draw the application's custom type window.
[0055] The custom plug-in library provides a custom drawing interface for calling the custom plug-in library. According to one embodiment of the present invention, the custom drawing interface can be implemented as a DBus service interface. The present invention does not limit the specific implementation of the custom drawing interface. The custom type option specifies that the first type window can call the custom plug-in library through this option to implement the custom style specified by the custom plug-in library.
[0056] According to one embodiment of the present invention, the first type window selects the custom type option through the second window creation class, and calls the custom plug-in library according to the custom type option, which can be specifically implemented by executing the following code:
[0057]
[0058] The present invention obtains the second window creation class by subclassing the first window creation class; the first type window can realize the custom type window of the drawing application by selecting the custom type option through the second window creation class.
[0059] According to an embodiment of the present invention, when a custom plug-in library is called according to a custom drawing interface to draw a custom type window of an application, the custom type window is drawn according to file information and a custom style in the custom plug-in library.
[0060] When implementing a custom style from a custom plugin library, you can draw the custom style using the various style files defined in the library. The style files are pre-configured by the developer in the custom style library. After calling the custom plugin library to draw the custom style, you load the file information into the custom style to create a custom type window.
[0061] According to one embodiment of the present invention, the custom plug-in library can be called specifically through the following code:
[0062]
[0063] Specifically, a custom type window is generated through the following code:
[0064] DBusFileDialogHandle*handle=new DBusFileDialogHandle();
[0065] Q_UNUSED(new FiledialogAdaptor(handle));
[0066] const QDBusObjectPath path(" / com / deepin / filemanager / filedialog / "+key);
[0067] if(m_dialogObjectMap.contains(path)){
[0068] return path;
[0069] }
[0070] if(!QDBusConnection::sessionBus().registerObject(path.path(),handle)){
[0071] qWarning("Cannot register to the D-Bus object.\n");
[0072] handle->deleteLater();
[0073] return QDBusObjectPath();
[0074] }
[0075] m_dialogObjectMap[path]=handle;
[0076] connect(handle,&DBusFileDialogHandle::destroyed,this,&DBusFileDialogManager::onDialogDestroy);
[0077] return path;
[0078] Figure 4 FIG. 4 shows a schematic diagram of drawing a custom type window according to an exemplary embodiment of the present invention. Figure 4 As shown: If the graphics interface library required to draw the application window is a first graphics interface library implemented as the Qt graphics interface library, a first type window is generated based on the QFileDialog class of the Qt graphics interface library. When generating the first type window, file information is obtained. The first window creation class (QPlatformDialogHelper class) is then subclassed to obtain a second window creation class. The custom type option is selected based on the second window creation class, and the custom drawing interface implemented as the DBus service interface is determined based on the custom type option. Finally, the custom plug-in library is called through the custom drawing interface to implement the custom style, and the custom type window is drawn based on the file information.
[0079] According to an embodiment of the present invention, if the graphics interface library that needs to be called to draw the window of the application is the second graphics interface library, the second type of window is generated according to the second graphics interface library.
[0080] According to one embodiment of the present invention, the second graphical interface library can be specifically implemented as a GTK graphical interface library. The second graphical interface library provides a second drawing interface for calling the second graphical interface library. When generating the second type of window, the second graphical interface library is called through the second drawing interface to draw the second type of window.
[0081] According to one embodiment of the present invention, the second drawing interface calls the second graphical interface library to draw the second type of window, which can be specifically implemented by executing the following code:
[0082]
[0083] Then, the custom plug-in library is called according to the second type window to generate the custom type window of the application. Specifically: a style selection process and a custom type option are added to the first window creation method of the second graphical interface library; the second type window determines the custom drawing interface of the custom plug-in library according to the style selection process and the custom type option in the second window creation method; and the custom plug-in library is called according to the custom drawing interface to draw the custom type window of the application.
[0084] The second graphical interface library includes a first window creation method for obtaining file information and drawing a second-type window. According to one embodiment of the present invention, since the second graphical interface library is a GTK graphical interface library, when drawing a custom-type window, the second-type window must be drawn first, followed by the custom-type window. Therefore, when drawing the second-type window, the first window creation method is called to perform the drawing.
[0085] When drawing a custom window, call the second window creation method to draw it. Specifically: first, determine according to the style selection process. If it is determined that the custom style is used for drawing, call the custom plug-in library according to the custom type option to draw the custom window of the application.
[0086] In order to implement the custom type window required by the present invention, the first window creation method is modified to add a style selection process and a custom type option. The style selection process is used to determine whether to use a custom style for drawing. Specifically, the style selection process first determines whether there is a callable custom plug-in library. If so, the custom style is used for drawing. If there is no callable custom plug-in library, the custom style is not used for drawing, and only the second type window is drawn and displayed. If it is determined that the custom style is used for drawing, the custom plug-in library is called according to the custom type option to draw the custom type window of the application.
[0087] When a custom plug-in library is called according to a custom drawing interface to generate a custom type window of an application, the file information required for drawing the window is first obtained, and then the custom type window is drawn according to the file information and the custom style in the custom plug-in library.
[0088] According to one embodiment of the present invention, the first window creation method can be implemented as the gtk_file_chooser_dialog method, and the second window creation method can be implemented as the gtk_file_chooser_dialog_new method. The style selection process and custom type options added in the second window creation method can be specifically implemented as the following code:
[0089]
[0090] Next, the display settings for the second type window are constructed. The display settings for the second type window include: setting the second type window to be displayed transparently. Since the second type window and the custom type window are drawn at the same time, the second type window is hidden in a transparent manner, and only the custom type window is displayed.
[0091] Finally, the second type window and the custom type window are drawn according to the display settings. The second type window is drawn transparently, and the custom type window is drawn normally, and the custom type window is displayed above the second type window. According to one embodiment of the present invention, after the custom type window is drawn, if it is necessary to close the custom type window, the second type window is also closed at the same time.
[0092] According to one embodiment of the present invention, drawing the second type window and the custom type window may be achieved by executing the following code:
[0093]
[0094]
[0095] The custom type window can determine whether the window needs to be closed by monitoring the finish signal of the window management function (com.deepin.filemanager.filedialogmanager), thereby replacing the original second type window.
[0096] Figure 5 FIG. 4 shows a schematic diagram of drawing a user-defined type window according to another exemplary embodiment of the present invention. Figure 5As shown in the following example: If the graphics interface library required to draw the application window is a second graphics interface library implemented as the GTK graphics interface library, the first window creation method in the GTK graphics interface library is called according to the second drawing interface to generate a second type window. A style selection process and a custom type option are then added to the first window creation method to obtain a second window creation method. Then, based on the second window creation method, a custom drawing interface implemented as the DBus service interface is determined. Finally, the custom drawing interface calls the custom plug-in library to implement the custom style, and the custom type window is drawn according to the file information.
[0097] This invention enables the use of custom plug-in libraries to draw custom windows of a unified style when applications are developed using different graphical interface libraries, thereby achieving unified application window styles. This eliminates the need for users to adapt to different window types for different applications, reducing the learning and usage costs for users. This also reduces maintenance costs for maintenance personnel and ensures consistency in the operating system's design style. Furthermore, unified application windows can extend the application's own window functionality, enabling functions that are typically applicable to a single application to be implemented across all applications.
[0098] The present invention discloses an application window drawing method suitable for execution in a computing device in which one or more applications are running. The method comprises the following steps: in response to an application's window drawing request, determining a graphical interface library to be called for drawing the application's window; if the graphical interface library to be called for drawing the application's window is a first graphical interface library, generating a first-type window based on the first graphical interface library; subclassing a first window creation class of the first graphical interface library to obtain a second window creation class, and drawing a custom-type window of the application through the first-type window calling the second window creation class. The present invention can determine the graphical interface library to be called for drawing the application's window, subclass the window creation class in the graphical interface library, and draw the custom-type window of the application based on the subclassed second window creation class, thereby achieving unification of application window types.
[0099] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of this description.
[0100] Similarly, it should be understood that in order to streamline the disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together into a single embodiment, figure, or description thereof.
[0101] Those skilled in the art will appreciate that the modules, units, or components of the devices in the examples disclosed herein may be arranged in the device described in the embodiment, or alternatively may be located in one or more devices different from the devices in the examples. The modules in the foregoing examples may be combined into one module or further divided into multiple submodules.
[0102] Those skilled in the art will appreciate that the modules in the devices in the embodiments can be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and in addition they can be divided into multiple submodules or subunits or subassemblies. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification and all processes or units of any method or device disclosed in this manner can be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification can be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0103] Furthermore, those skilled in the art will appreciate that although some embodiments described herein include certain features and not other features included in other embodiments, the combination of features from different embodiments is intended to be within the scope of the invention and to form different embodiments.
[0104] In addition, some of the embodiments are described herein as methods or combinations of method elements that can be implemented by a processor of a computer system or by other devices that perform the functions described. Thus, a processor having the necessary instructions for implementing the method or method element forms a device for implementing the method or method element. Furthermore, the elements described herein of the device embodiments are examples of devices for implementing the functions performed by the elements for the purpose of implementing the invention.
[0105] The various techniques described herein may be implemented in conjunction with hardware or software, or a combination thereof. Thus, the methods and apparatus of the present invention, or certain aspects or portions of the methods and apparatus of the present invention, may take the form of program code (i.e., instructions) embedded in a tangible medium, such as a floppy disk, CD-ROM, hard drive, or any other machine-readable storage medium, wherein when the program is loaded into a machine such as a computer and executed by the machine, the machine becomes an apparatus for practicing the present invention.
[0106] When program code is executed on a programmable computer, the computing device generally includes a processor, a storage medium readable by the processor (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store the program code, and the processor is configured to execute the application window drawing method of the present invention according to the instructions in the program code stored in the memory.
[0107] By way of example and not limitation, computer-readable media include computer storage media and communication media. Computer-readable media include computer storage media and communication media. Computer storage media stores information such as computer-readable instructions, data structures, program modules, or other data. Communication media generally embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and includes any information delivery media. Combinations of any of the above are also included within the scope of computer-readable media.
[0108] As used herein, unless otherwise specified, the use of ordinal numbers "first," "second," "third," etc. to describe common objects merely indicates that different instances of similar objects are involved and are not intended to imply that the objects so described must have a given order in time, space, ranking, or in any other manner.
[0109] Although the present invention has been described with respect to a limited number of embodiments, those skilled in the art, having the benefit of the foregoing description, will appreciate that other embodiments are contemplated within the scope of the invention thus described. Furthermore, it should be noted that the language used in this specification has been selected primarily for readability and instructional purposes, rather than for the purpose of explaining or limiting the subject matter of the present invention. Consequently, numerous modifications and variations will be apparent to those skilled in the art. The disclosure of the present invention is intended to be illustrative, not restrictive, of the scope of the invention.
Claims
1. A method for drawing an application window, suitable for execution in a computing device having one or more applications running therein, the method comprising the steps of: In response to a window drawing request of the application, determining a graphical interface library to be called for drawing the window of the application; If the graphical interface library required to draw the window of the application is the first graphical interface library, generating a first type of window according to the first graphical interface library; Subclassing the first window creation class of the first graphical interface library to obtain a second window creation class, including: adding a custom type option to the first window creation class to obtain the second window creation class; Drawing the custom type window of the application by calling the second window creation class through the first type window includes: determining the custom drawing interface of the custom plug-in library according to the custom type option in the second window creation class, and calling the custom plug-in library according to the custom drawing interface to draw the custom type window.
2. The method according to claim 1, wherein The method further comprises the steps of: If the graphics interface library required to draw the window of the application is the second graphics interface library, generating a second type of window according to the second graphics interface library; Calling a custom plug-in library according to the second type window to generate the custom type window; constructing display settings for the second type of window; The second type window and the user-defined type window are drawn according to the display setting.
3. The method according to claim 1, wherein Generating the first type of window according to the first graphical interface library comprises the following steps: Calling the first drawing interface of the first graphical interface library to determine a file loading class in the first graphical interface library; The file loading class is instantiated to obtain a first type window.
4. The method according to claim 3, wherein: The instantiation of the file loading class to obtain the first type window comprises the following steps: Obtain the file information required for drawing the window according to the file loading class; The step of calling a custom plug-in library according to the custom drawing interface to draw the custom type window comprises the following steps: Draw a custom type window according to the file information and the custom style in the custom plug-in library.
5. The method according to claim 2, wherein: The step of calling a custom plug-in library according to the second type window to generate the custom type window comprises the following steps: Adding a style selection process and a custom type option to the first window creation method of the second graphical interface library to obtain a second window creation method; The second type window determines the custom drawing interface of the custom plug-in library according to the style selection process and the custom type option in the second window creation method; The custom type window is generated by calling a custom plug-in library according to the custom drawing interface.
6. The method according to claim 5, wherein: The step of calling a custom plug-in library according to the custom drawing interface to generate the custom type window comprises the following steps: Get the file information required to draw the window; Generate a custom type window according to the file information and the custom style in the custom plug-in library.
7. The method according to claim 6, wherein: The display settings of the second type window include: The second type window is set to be displayed in a transparent manner.
8. The method according to any one of claims 1 to 7, wherein The window type of the custom type window includes a file selection window.
9. The method according to any one of claims 2, 5-7, wherein The first graphical interface library includes a Qt graphical interface library, and the second graphical interface library includes a GTK graphical interface library.
10. A computing device comprising: one or more processors; Memory; as well as One or more devices comprising instructions for performing the method according to any one of claims 1-9.
11. A computer-readable storage medium storing one or more programs, the one or more programs comprising instructions that, when executed by a computing device, cause the computing device to perform the method according to any one of claims 1 to 9.