CN115185581A - Icon packaging method and device, icon display method and computing equipment - Google Patents

Icon packaging method and device, icon display method and computing equipment Download PDF

Info

Publication number
CN115185581A
CN115185581A CN202211098746.1A CN202211098746A CN115185581A CN 115185581 A CN115185581 A CN 115185581A CN 202211098746 A CN202211098746 A CN 202211098746A CN 115185581 A CN115185581 A CN 115185581A
Authority
CN
China
Prior art keywords
icon
icons
packaging
searching
directory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211098746.1A
Other languages
Chinese (zh)
Other versions
CN115185581B (en
Inventor
张继德
汪飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Uniontech Software Technology Co Ltd
Original Assignee
Uniontech Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Uniontech Software Technology Co Ltd filed Critical Uniontech Software Technology Co Ltd
Priority to CN202211098746.1A priority Critical patent/CN115185581B/en
Publication of CN115185581A publication Critical patent/CN115185581A/en
Application granted granted Critical
Publication of CN115185581B publication Critical patent/CN115185581B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/148File search processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/53Querying
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Library & Information Science (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses an icon packaging method and device, an icon display method and computing equipment, relates to the technical field of icon filing management, and can solve the technical problem that the current unified and normative format of management icons does not exist. The icon packaging method comprises the following steps: searching icons matched with the icon types according to the icon types specified by the first-level catalog to form a first icon set; searching icons matched with the icon size in the first icon set according to the icon size specified by the second-level directory to form a second icon set; searching icons matched with the icon state, the subject type and the picture format in the second icon set to form a third icon set; searching icons which accord with a preset naming format in the third icon set, and placing the icons in a fourth-level directory; and packaging the preset directory to generate a packaged file. According to the technical scheme of the invention, the format of the management icon with unified specification is provided.

Description

Icon packaging method and device, icon display method and computing equipment
Technical Field
The invention relates to the technical field of icon archiving management, in particular to an icon packaging method and device, an icon display method and computing equipment.
Background
Most applications require loading of resource files, such as icons, translation files, pictures, etc., at the installation runtime. The types of the icons are various, and mainly include: 1. dividing according to the type of the subject, wherein the subject comprises a bright icon and a dark icon; 2. dividing according to function types, wherein the function types comprise plain text type icons, action icons and iconic icons; 3. and the icons are divided according to the types of the reference icons and comprise single icons and status icons.
Currently, in Qt (cross-platform graphical user interface application development framework) applications, these icon resources are packaged and located by the Qt resource system. In most cases, these icon resources are embedded into the execution files of the application, through which they are loaded into libraries and plug-ins. These icon resources may also be stored in an external resource file in rcc format. Specifically, qt uses qrc (resource configuration file in Qt) format file (XML) to list the icon resource files needed at runtime, reads the content of qrc file through resource compiling tool (rcc), generates c + + source file, and embeds the source file into the execution file, library or plug-in after construction, or generates an rcc file for external resource loading.
In the icon resource directory structure obtained after the Qt resource system is packaged, the directories are named according to the size of the icon (for example, 32 × 32), and the high DPI syntax of "@ nx" is adopted in the case of supporting the high DPI version (for example, 32 × 32@ 2). Under the list of icon size, the list is named according to the icon function (e.g. actions).
When the application runs, the built-in icon engine can automatically find the designated icon file and select the correct icon to draw when the control state or the theme changes. Specifically, qt provides a QIcon class, a certain theme is set through a function (setThemeName) under the QIcon class, and then an icon under the theme is searched through an interface (fromtheme), thereby completing a function of switching icons under different themes through setting the theme.
The above icon packaging method has disadvantages in that: according to the difference of the theme type, the icon size, the icon function type and the state type, the number of directories and files of the icon becomes huge along with the increase of the demand, and the unified and standardized format of the management icon does not exist at present. In addition, to complete the switching of different status and theme icons, the relevant switching logic needs to be added manually, which may result in an increase in the amount of repetitive code.
Disclosure of Invention
To this end, the present invention provides an icon packaging method and apparatus, an icon display method, a computing device and a readable storage medium, in an effort to solve or at least alleviate at least one of the problems identified above.
According to a first aspect of the present invention, there is provided an icon packaging method, executed in a computing device, the computing device including a preset directory, the preset directory including a fourth-level directory structure, a first-level directory specifying an icon type, a second-level directory specifying an icon size, a third-level directory specifying an icon state, a theme type, and a picture format, the fourth-level directory storing icons; the icon packaging method comprises the following steps: according to one or more icon types specified by the first-level directory, finding icons matched with the icon types to form one or more first icon sets; in each first icon set, searching icons matched with the icon size according to the icon size specified by one or more second-level catalogs to form one or more second icon sets; in each second icon set, searching icons matched with the icon states, the theme types and the picture formats according to the icon states, the theme types and the picture formats specified by one or more third-level catalogs to form one or more third icon sets; in each third icon set, searching for icons conforming to a preset naming format, and placing the icons in one or more fourth-level directories; and packaging the preset directory to generate a packaged file.
Optionally, in the icon packaging method according to the present invention, the process of forming any one of the third icon sets includes: searching icons matched with the icon state specified by any third-level directory to form a result set; searching for an icon matched with the theme type specified by any third-level catalog in the result set to obtain a further result set; and searching icons matched with the picture format specified by any third-level directory in the further result set to form any third icon set.
Optionally, in the icon packaging method according to the present invention, the preset naming format includes an icon name, a zoom factor, and a connector.
Optionally, in the icon packaging method according to the present invention, the process of forming one or more third icon sets further includes: judging whether the icons in a default state exist in all the third icon sets or not aiming at the icons with any names; if not, removing the icons in other states from each of the third icon sets, the other states being states other than the default state.
According to a second aspect of the present invention, there is provided an icon display method implemented based on a package file generated by packaging the above icon packaging method, the icon display method including: responding to the state change of the control; searching a required icon in the packaging file, wherein the required icon is consistent with the size, the name and the zoom multiple of the icon currently used by the control and is adaptive to the state of the control after the control is changed; and applying the icon searched in the packaging file to the control.
According to a third aspect of the present invention, there is provided an icon display method implemented based on a package file generated by packaging the above icon packaging method, the icon display method including: responding to theme changes of the current operating environment; searching a required icon in the packaging file, wherein the required icon is consistent with the size, the name and the zoom multiple of the icon in the current operating environment and is adaptive to the theme after the current operating environment is changed; and replacing the icon in the current operating environment by using the icon found in the packaging file.
According to a fourth aspect of the present invention, there is provided an icon packaging apparatus, located in a computing device, where the computing device includes a preset directory, the preset directory includes a four-level directory structure, a first-level directory specifies a type of an icon, a second-level directory specifies a size of the icon, a third-level directory specifies a state of the icon, a type of a subject, and a format of a picture, and the fourth-level directory stores the icon; the icon packaging device comprises: the first searching module is used for searching icons matched with the icon types according to the icon types specified by one or more first-level catalogs to form one or more first icon sets; the second searching module is used for searching icons matched with the icon sizes in each first icon set according to the icon sizes specified by one or more second-level catalogs to form one or more second icon sets; a third searching module, configured to search for an icon matching the icon state, the theme type, and the picture format in each second icon set according to one or more icon states, theme types, and picture formats specified by the third-level directory, so as to form one or more third icon sets; the fourth searching module is used for searching icons which accord with a preset naming format in each third icon set and placing the icons in one or more fourth-level directories; and the packaging module is used for packaging the preset directory to generate a packaging file.
Optionally, in an icon packaging apparatus according to the present invention, the third searching module includes: the judgment sub-module is used for judging whether the icons in the default state exist in all the third icon sets or not according to the icons with any names; and a removal submodule, configured to remove the icons in other states from each of the third icon sets if it is determined that the icon in the default state does not exist, where the other states are states other than the default state.
According to a fifth aspect of the invention, there is provided a computing device comprising: at least one processor and a memory storing program instructions; the program instructions, when read and executed by the processor, cause the computing device to perform the icon encapsulation method or the icon display method as described above.
According to a sixth aspect of the present invention, there is provided a readable storage medium storing program instructions which, when read and executed by a computing device, cause the computing device to execute the icon encapsulation method or the icon display method as described above.
According to the technical scheme of the invention, the icon files are packaged, a uniform and standard format of the management icons is provided, and the following problems in the prior art are avoided: switching of the state and theme of the user code manual adaptation icon is required. That is, according to the technical solution of the present invention, it is not necessary to load a user code to find an icon matching a changed state.
Drawings
To the accomplishment of the foregoing and related ends, certain illustrative aspects are described herein in connection with the following description and the annexed drawings, which are indicative of various ways in which the principles disclosed herein may be practiced, and all aspects and equivalents thereof are intended to be within the scope of the claimed subject matter. The above and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description read in conjunction with the accompanying drawings. Throughout this disclosure, like reference numerals generally refer to like parts or elements.
Fig. 1 shows a directory structure after a plurality of icon files are packaged into a DCI format;
FIG. 2 shows a schematic flow diagram of an icon encapsulation method according to an embodiment of the invention;
FIG. 3 shows a schematic block diagram of an icon enclosing device 300 according to an embodiment of the present invention;
FIG. 4 shows a schematic diagram of a computing device 400 according to one embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
According to the technical scheme of the invention, the filing and packaging format is provided, and the filing and packaging format specifies how to combine a plurality of icon files with different control states and theme types into one file. After merging into one file, the application may find icon files of different subjects, different states, and different sizes in the file.
The archive packaging format, which may also be referred to as an archive packaging specification, is described below. File directory structure and naming needs to meet the specification before it can be packaged into a file. The specification specifies information such as the status and type of icons to be packaged. One example of specific details of various provisions in the specification are described below to facilitate understanding of the inventive arrangements by those skilled in the art. It is understood that the following description is given by way of example only and that various changes in the form and details of the icons, naming schemes, etc. may be made by those skilled in the art as desired.
The states of icons to be archived may be specified in the specification as a default state (normal), a disabled state (disabled), a hover state (hover), a pressed state (pressed). These four states are different forms that adapt to the appearance of environmental changes. Wherein the disabled state is represented as no longer responding to input events such as a mouse, a keyboard, etc.; in the hover state, the mouse hovers over the icon.
The specification may specify the type of icon to be archived as a plain text type icon (text), an action type icon (action), and an icon type icon (icon). The three icons are classified according to different interface environments. Wherein, the color of the plain text type icon (text) is filled as the text color in the context environment in actual use and needs to change along with the foreground color of the brush; the action type icon has the color in a non-default state consistent with the text type icon; the color of the icon-type icon does not change in any state.
The specification may specify that icons to be archived are scaled by: no zooming, 2 times magnification and 3 times magnification. These three scaling factors are set to accommodate different DPIs (image resolutions). It should be understood that this list of multiples is merely an example and one skilled in the art could set different zoom classifications depending on actual image resolution or other needs.
The specification may specify that the topics of the icons to be archived are: a light icon (light) for a light color environment; dark icon (dark) for dark environment. The classification is made to accommodate different shades.
The format of the icon to be packaged can be specified in the specification as: webp and png. Among them, webp is a picture file format that provides both lossy compression and lossless compression (reversible compression). Png is a bitmap graphics format that supports lossless compression.
The specification may specify that the preset naming format of the icon file to be packaged includes icon name, zoom factor and connector, such as: { icon name } @ { zoom factor }, only icon files that meet the naming rules can be found.
The user can preset the structure of the directory for icon filing, and the naming of each level of directory of the preset directory structure is carried out according to the specification of the filing and packaging specification. When the icon is actually searched and packed, the icon is searched and packed according to the naming or specification of each level of directory of the directory structure.
Fig. 1 shows a schematic diagram of the directory structure, in which the first-level directory to the third-level directory are directory structures set in advance, and the fourth-level directory is filled after the icon is found. That is, the directory structure shown in fig. 1 is also a directory structure after a plurality of icon files are packed into an enclosure file. As shown in FIG. 1, the directory structure comprises a total of four levels of directory. The first-level directory is named according to the "icon type", such as text, action, and icon, and when the icon is actually searched, the icon is searched according to the icon type specified by the first-level directory. The second level directory is named by "icon size", such as 16, 32, 512, etc., as shown, which is in bytes. The third-level directory is named according to "icon status", "theme type", and "picture format", such as the named example in fig. 1: { icon status } { subject type } { file suffix name corresponding to picture format }, such as normal. Icon files, such as "foregoround @1", are placed in the fourth level directory. Where "forego" is just an example of naming, the file naming may also be e.g. "park @ { zoom factor }". The icon archiving and packaging method reads the directory created in advance, searches the icon according to the directory structure and places the icon into the fourth-level directory.
The file format after filing and packaging according to the directory shown in fig. 1 is DCI (DSG combined ics, wherein DSG (Desktop Specification Group) is a work Group of UOS (unified Desktop operating system) making Specification). It should be understood that if different directory structures are adopted, for example, the third-level directory only specifies the icon status, the fourth-level directory below specifies the theme type, the fifth-level directory specifies the icon format, or other adjustments are made to the directory structure, the file format after filing and packaging according to the adjusted directory may be in other formats.
The basic attributes of the DCI file are described below. The type of the DCI file is image/DCI, and is extended on the existing standard of application/octet-stream (application/octet-stream). The magic value (magic value) is DCI, the type is string (string), and the offset value may be 0. The icon name corresponding to the DCI file type is image-DCI. The DCI header uses a little endian, the metadata of the file is located at the beginning of the file, and the contents are shown in table 1 below.
Table 1
Figure 770077DEST_PATH_IMAGE001
When parsing the header information, the MAGIC value may be checked first, then the VERSION (VERSION) is read according to the address offset, that is, the SIZE of the MAGIC value (MAGIC _ SIZE (4B)), and finally the number of files (fileCount) is read according to the SIZE of the MAGIC value and the SIZE of the VERSION value (MAGIC _ SIZE (4B) + VERSION _ SIZE (1B)).
The metadata of each file (packaged icon) shown in the above table is as shown in table 2 below.
Table 2
Figure 687217DEST_PATH_IMAGE002
As shown in Table 2, in the file type column, a default value is used to indicate the file type of the icon. The default value is a value assigned according to the attribute of the icon after the icon is acquired so as to distinguish various types, and can be selected from four numerical values of 0-3, wherein: the value 0 represents a reserved value that can be used later when a new icon format is available; the value 1 represents the icon type as file, the value 2 represents the icon type as directory, and the value 3 represents the icon type as link. Wherein, the number 2 indicates that the icon is from a directory, the directory file is also a file type, and sub-directories can be nested under the directory.
In the case of parsing a metafile, the first 1B parsed by the offset address is a file type, the data following the file type is a file name of size 63B, and the data following is a file size of size 8B. If the file type is a directory, the data following the file size is another metafile, and if the file type is a file or a link, the data following the file size is file content data.
The icon packaging method according to the embodiment of the invention is described below, and the icon packaging method is executed in a computing device, and the computing device comprises the preset directory, wherein the preset directory comprises a four-level directory structure, the first-level directory specifies the icon type, the second-level directory specifies the icon size, the third-level directory specifies the icon state, the theme type and the picture format, and the fourth-level directory places the icons. Fig. 2 shows a schematic flow diagram of an example of the icon packaging method. As shown in fig. 2, the icon packaging method includes steps 210-250. The steps are described in detail below.
In step 210, one or more first icon sets are formed by finding icons matching the icon categories according to the icon categories specified by the one or more first-level directories.
In step 220, in each first set of icons, icons matching the icon size are found according to the icon size specified by one or more second-level directories to form one or more second sets of icons.
In step 230, in each second icon set, icons matching the icon status, the theme type and the picture format are found according to the icon status, the theme type and the picture format specified by one or more third-level directories to form one or more third icon sets.
Optionally, the process of forming any third icon set may include: searching icons matched with the icon state specified by any third-level directory, searching icons matched with the theme type specified by any third-level directory in the result set to obtain a further result set, and searching icons matched with the picture format specified by any third-level directory in the further result set to form any third icon set.
Alternatively, the set of icons formed in step 230 may require that a default (normal) state of a certain icon must exist, and that other states may/may not exist. This is because the default state is a necessary icon state, and other states are obtained after changing from the default state, and if the default state is lacking, icons in other states can be deleted. Thus, step 230 may optionally comprise the sub-steps of: for any icon with any name, judging whether an icon with a default state exists in all the third icon sets, for example, judging whether the icon with the default state exists in all the third icon sets for background @ {2}, wherein in one or more third icon sets formed, as long as one third icon set has the default state; if not, removing the icons in other states from the third icon sets, wherein the other states are states other than the default state, such as the icons in the disabled state of removing background @ {2}, the suspended state and the pressed state.
In step 240, in each third set of icons, icons that conform to the preset naming format are found and placed in one or more fourth level directories. The preset naming format may include, by way of example, an icon name, a zoom factor, and a connector, which may be, by way of example, { icon name } @ { zoom factor }, such as "park @2".
Icon files placed in the fourth level directory may be arranged in ascending name order, such as following the natural ordering rules in the english environment (e.g., "a2" is arranged before "a 11"). In addition, whether the file type is a file, a directory, or a link is not distinguished when arranged in ascending order.
In step 250, the preset directory is packaged to generate a package file.
The following describes the process of icon adaptation according to the theme and status change after packaging into DCI files according to the above method.
When the computing system theme changes, the method of the embodiment of the invention can judge the change of the computing system theme, such as changing from light to dark, and then search for a matched icon, such as a bright icon, in the DCI file to adapt to the dark theme.
According to an embodiment of the present invention, there is provided an icon display method implemented based on a package file generated by packaging the icon package method, the icon display method including: responding to theme changes of the current operating environment; searching a required icon in the packaging file, wherein the required icon is consistent with the size, the name and the zoom multiple of the icon in the current operating environment and is adaptive to the theme after the current operating environment is changed; and replacing the icon in the current operating environment by using the icon searched in the packaging file.
When the icon state needs to be changed, for example, a cursor is suspended on the icon, and the icon is changed into a suspended state, the method of the embodiment of the invention can automatically search the suspended state in the DCI file to match the state.
According to an embodiment of the present invention, there is provided an icon display method implemented based on a package file generated by packaging the icon package method, the icon display method including: responding to the state change of the control; searching a required icon in the packaging file, wherein the required icon is consistent with the size, the name and the zoom multiple of the icon currently used by the control and is adaptive to the state of the control after the control is changed; and applying the icon found in the packaging file to the control.
Alternatively, for example, when an icon with a size of 16 is required, icons with a size of 16 or more are preferentially searched, and when the icon cannot be found, a larger icon resource can be used, and the zoom factor can be ignored so as to use the icon resource with the smallest size that is the most matched. Ignoring the scaling factor means: if the icon zoom factor in the DCI file is 1, the icon with size 16 is adapted in size; if the icon zoom factor is 2, then an icon of size 32 is fitted. If no icon of size 16 is found, the icon of size 32 is found directly, regardless of the zoom factor.
When the icons are searched according to the zoom times, if the icons of the target zoom times do not exist, icons of higher times can be selected. If there are no more multiple icons, the more multiple icons in the lower multiple may be used. In summary, the principle of searching by the scaling factor can be summarized as follows: if the icon of the target zoom factor is not found, the icon with the higher magnification is selected from other icons.
Alternatively, when the desired icon is not found, such as an icon in a hover (hover) state is desired and not found from the DCI file, the default state may be allowed to be used instead.
Optionally, when the required icon is not found, the required icon can be drawn in a customized manner. The steps of the process include: judging whether the required icon is found in the packaging file or not; and under the condition that the needed icon is not found, calling a drawing interface, and drawing the needed icon according to the setting of the user. With regard to the drawing interface, the user can implement the DDCIIcon interface using a QIcon-like interface. User setting refers to a user setting a desired theme and state of an icon as needed. Rendering may be performed by a rendering (paint) function of the ddciicn interface.
Icons may also be found in the DCI file to enable custom control style rendering. For example, when the icon provides only the icon for the default (normal) state, the icon for the default state may be processed to obtain the other state. For example, when the system theme changes, to adapt to the change, the brightness of the text icon or the color of the text icon may be changed, and those skilled in the art may also customize other processed effects as needed. The processing is carried out as follows: firstly, a DCI icon of a control is searched in a DCI file through the following codes: DDCIIcon dciicon = DDCIIcon:: fromTheme ("slider _ point _ down"); button × pButton = new Button (dciicon, this).
Wherein, the name of the icon is written in the bracket behind the Fromtheme. After the corresponding icon is found, the processing of pixels may be performed on the icon in the default state by the icon engine to transition the icon from the default state to another state, such as a pressed state.
In addition, for the case that the icon type is a link, the reading and writing operation on the content of the link file is equivalent to reading and writing the target of the link, wherein the target of the link can be "file" or other "link" (unlinkable itself), otherwise the link target is considered to be invalid. If the link target is invalid or does not exist, the reading and writing fails, and an empty path is provided for the user at the moment. The user may also be provided with a method to allow the user to obtain the raw data of the link path, i.e. the data pointed to by the icon of the link type.
According to the technical scheme of the embodiment of the invention, icons which meet specific specifications and names, are different in types, sizes and states, topics and formats and have scaling factors can be filed together according to the defined DCI file format, so that a developer can conveniently manage and utilize the icons. Through the uniform definition of the format of the filing file, an implementer can analyze the icons in different states and themes. The user can use the icons in the DCI file format accurately and conveniently without concern for status and subject. By realizing a DCI icon interface (DDciicon), icons in the DCI file are searched, and automatic switching of the icons adapting to different states and themes can be completed. Therefore, a user of the control does not need to write codes to realize the switching of the icons adapting to different states and themes, and the increase of repeated codes is avoided.
According to an embodiment of the present invention, there is further provided an icon packaging apparatus, located in a computing device, where the computing device includes a preset directory, the preset directory includes a four-level directory structure, the first-level directory specifies a type of an icon, the second-level directory specifies a size of the icon, the third-level directory specifies a state of the icon, a type of a subject, and a format of a picture, and the fourth-level directory places the icon. Fig. 3 shows a schematic block diagram of an example of the icon packaging apparatus 300. As shown in fig. 3, the icon packaging apparatus 300 includes a first lookup module 310, a second lookup module 320, a third lookup module 330, a fourth lookup module 340, and a packing module 350. The modules are described in detail below.
The first searching module 310 is configured to search for an icon matching the icon category according to the icon categories specified by the one or more first-level directories, so as to form one or more first icon sets.
The second searching module 320 is used for searching icons matched with the icon size according to the icon size specified by one or more second-level catalogs in each first icon set to form one or more second icon sets.
The third searching module 330 is configured to find icons matching the icon status, the theme type and the picture format according to the icon status, the theme type and the picture format specified by the one or more third-level directories in each second icon set to form one or more third icon sets. Optionally, for any third icon set, the third searching module 330 may first search for an icon matching the specified icon state, then search for an icon matching the topic type in the result set, obtain a further result set, and finally search for an icon matching the picture format in the further result set, so as to form the any third icon set.
Optionally, the third searching module 330 may include: the judgment sub-module is used for judging whether the icons in the default state exist in all the third icon sets aiming at the icons with any name, such as backsound @ {2}, judging whether the icons in the default state exist in all the third icon sets; and a removal submodule, configured to remove, from each third icon set, the icon in another state if there is no icon in the default state, where the icon in the disabled state, the floating state, and the pressed state of background @ {2} may be removed in the above example.
The fourth searching module 340 is configured to search for icons that conform to the preset naming format in each third icon set, and place the icons in one or more fourth-level directories.
And a packing module 350, configured to pack the preset directory, and generate a package file.
According to an embodiment of the present invention, there is also provided an icon display apparatus including: the theme matching module is used for responding to the theme change of the current operating environment, searching a required icon in the packaging file, wherein the required icon is consistent with the size, the name and the zoom multiple of the icon in the current operating environment and is adaptive to the theme after the current operating environment is changed; and the replacing module is used for replacing the icon in the current operating environment by using the icon found in the packaging file.
According to an embodiment of the present invention, there is also provided an icon display apparatus including: the state matching module is used for responding to the state change of the control and searching a required icon in the packaging file, wherein the required icon is consistent with the size, the icon name and the zoom multiple of the current icon of the control and is adaptive to the state of the control after the change; and the application module is used for applying the icon found in the packaging file to the control.
Optionally, the icon display apparatus may further include: the icon judging module is used for judging whether the required icon is found in the packaging file; and the drawing module is used for calling the drawing interface under the condition that the required icon is not found, and drawing the required icon according to the setting of the user.
For details of the icon packaging apparatus and the icon display apparatus according to the embodiments of the present invention, please refer to the detailed description about the method embodiments above.
The method of the present invention may be performed in a computing device. The computing device may be any device with storage and computing capabilities, and may be implemented, for example, as a server, a workstation, or the like, as a personal computer such as a desktop computer or a notebook computer, or as a terminal device such as a mobile phone, a tablet computer, a smart wearable device, or an internet of things device, but is not limited thereto.
FIG. 4 shows a schematic diagram of a computing device 400 according to one embodiment of the invention. It should be noted that the computing device 400 shown in fig. 4 is only an example, and in practice, the computing device for implementing the method of the present invention may be any type of device, and the hardware configuration thereof may be the same as the computing device 400 shown in fig. 4 or different from the computing device 400 shown in fig. 4. Hardware components of a computing device for practicing the methods of the present invention may be added or deleted from the hardware components of computing device 400 shown in FIG. 4 in practice. The present invention is not limited to the specific hardware configuration of the computing device.
As shown in fig. 4, the computing device 400 may include: a processor 410, a memory 420, an input/output interface 430, a communication interface 440, and a bus 450. Wherein the processor 410, memory 420, input/output interface 430, and communication interface 440 are communicatively coupled to each other within the device via a bus 450.
The processor 410 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits, and is configured to execute related programs to implement the technical solutions provided in the embodiments of the present specification.
The Memory 420 may be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, or the like. The memory 420 may store an operating system and other application programs, and when the technical solution provided by the embodiments of the present specification is implemented by software or firmware, the relevant program codes are stored in the memory 420 and called to be executed by the processor 410.
The input/output interface 430 is used for connecting an input/output module to realize information input and output. The i/o module may be configured as a component within the device (not shown) or may be external to the device to provide corresponding functionality. The input devices may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output devices may include a display, a speaker, a vibrator, an indicator light, etc.
The communication interface 440 is used for connecting a communication module (not shown in the figure) to realize communication interaction between the device and other devices. The communication module can realize communication in a wired mode (for example, USB, network cable, etc.), and can also realize communication in a wireless mode (for example, mobile network, WIFI, bluetooth, etc.).
Bus 450 includes a path that transfers information between various components of the device, such as processor 410, memory 420, input/output interface 430, and communication interface 440.
It should be noted that although the computing device 400 is shown with only the processor 410, the memory 420, the input/output interface 430, the communication interface 440, and the bus 450, in a specific implementation, the computing device 400 may include other components necessary for proper operation. Moreover, those skilled in the art will appreciate that the computing device 400 described above may also contain only the components necessary to implement the embodiments of the present description, and need not contain all of the components shown in the figures.
Embodiments of the present invention also provide a non-transitory readable storage medium storing instructions for causing a computing device to perform a method according to embodiments of the present invention. The readable media of the present embodiments include permanent and non-permanent, removable and non-removable media, and the storage of information may be accomplished by any method or technology. The information may be computer readable instructions, data structures, modules 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 technologies, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage, and the like.
In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with examples of this invention. The required structure for constructing such a system is apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose preferred embodiments of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. It will be appreciated by those skilled in the art that the modules or units or components of the apparatus in the examples disclosed herein may be arranged in an apparatus as described in this embodiment or alternatively may be located in one or more different apparatus than that in the examples. The modules in the foregoing examples may be combined into one module or may additionally be divided into multiple sub-modules.
Those skilled in the art will appreciate that the modules in the device of an embodiment may be adaptively changed and provided in one or more devices different from the embodiment. The modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore, they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that although some embodiments described herein include some features included in other embodiments, not others, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. Furthermore, some of the embodiments are described herein as a method or combination of method elements that can be implemented by a processor of a computer system or by other means of performing the described functions. A processor with the necessary instructions for carrying out the method or the method elements thus forms a device for carrying out the method or the method elements.
As used herein, unless otherwise specified the use of the ordinal adjectives "first", "second", "third", etc., to describe a common object, merely indicate that different instances of like objects are being referred to, and are not intended to imply that the objects so described must be in a given sequence, either temporally, spatially, in ranking, or in any other manner.
While the invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of this description, will appreciate that other embodiments can be devised which do not depart from the scope of the invention as described herein. Furthermore, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter.

Claims (10)

1. An icon packaging method is executed in computing equipment, the computing equipment comprises a preset directory, the preset directory comprises a four-level directory structure, a first-level directory specifies icon types, a second-level directory specifies icon sizes, a third-level directory specifies icon states, theme types and picture formats, and the fourth-level directory places icons;
the icon packaging method comprises the following steps:
according to one or more icon types specified by the first-level directory, finding icons matched with the icon types to form one or more first icon sets;
in each first icon set, searching icons matched with the icon size according to the icon size specified by one or more second-level catalogs to form one or more second icon sets;
in each second icon set, searching icons matched with the icon states, the theme types and the picture formats according to the icon states, the theme types and the picture formats specified by one or more third-level catalogs to form one or more third icon sets;
in each third icon set, searching for icons conforming to a preset naming format, and placing the icons in one or more fourth-level directories;
and packaging the preset directory to generate a packaging file.
2. The icon packaging method of claim 1, wherein forming any of the third set of icons comprises: searching icons matched with the icon state specified by any third-level directory to form a result set; searching for an icon matched with the theme type specified by any third-level catalog in the result set to obtain a further result set; and searching icons matched with the picture format specified by any third-level directory in the further result set to form any third icon set.
3. The icon packaging method of claim 1, wherein the preset naming format comprises an icon name, a zoom factor, and a connector.
4. An icon packaging method as defined in claim 1, the process of forming one or more third sets of icons further comprising:
judging whether the icons in a default state exist in all the third icon sets or not aiming at the icons with any names;
if not, removing the icons in other states from each of the third icon sets, the other states being states other than the default state.
5. An icon display method implemented based on a package file generated by packaging the icon package method of any one of claims 1 to 4, the icon display method comprising:
responding to the state change of the control, searching for a required icon in the packaging file, wherein the required icon is consistent with the size, the name and the zoom multiple of the icon currently used by the control and is adaptive to the state of the control after the change;
and applying the icon searched in the packaging file to the control.
6. An icon display method implemented based on a package file generated by packaging the icon package method of any one of claims 1 to 4, the icon display method comprising:
in response to the theme change of the current operating environment, searching a required icon in the packaging file, wherein the required icon is consistent with the size, the name and the zoom multiple of the icon in the current operating environment and is adapted to the theme after the current operating environment is changed;
and replacing the icon in the current operating environment by using the icon searched in the packaging file.
7. An icon packaging device is positioned in a computing device, the computing device comprises a preset directory, the preset directory comprises a four-level directory structure, the first-level directory specifies icon types, the second-level directory specifies icon sizes, the third-level directory specifies icon states, theme types and picture formats, and the fourth-level directory places icons;
the icon packaging apparatus includes:
the first searching module is used for searching icons matched with the icon types according to the icon types specified by one or more first-level catalogs to form one or more first icon sets;
the second searching module is used for searching icons matched with the icon size in each first icon set according to the icon size specified by one or more second-level catalogs to form one or more second icon sets;
a third searching module, configured to search for an icon matching the icon state, the theme type, and the picture format in each second icon set according to one or more icon states, theme types, and picture formats specified by the third-level directory, so as to form one or more third icon sets;
the fourth searching module is used for searching icons which accord with a preset naming format in each third icon set and placing the icons in one or more fourth-level directories;
and the packaging module is used for packaging the preset directory to generate a packaging file.
8. The icon encapsulating apparatus of claim 7, wherein the third searching module comprises:
the judgment sub-module is used for judging whether the icons in the default state exist in all the third icon sets or not according to the icons with any names;
and a removal submodule, configured to remove the icons in other states from each of the third icon sets if it is determined that the icon in the default state does not exist, where the other states are states other than the default state.
9. A computing device, comprising:
at least one processor and a memory storing program instructions;
the program instructions, when read and executed by the processor, cause the computing device to perform the icon packaging method of any of claims 1-4, or the icon display method of claims 5 or 6.
10. A readable storage medium storing program instructions which, when read and executed by a computing device, cause the computing device to perform the icon encapsulation method of any one of claims 1-4 or the icon display method of claim 5 or 6.
CN202211098746.1A 2022-09-09 2022-09-09 Icon packaging method and device, icon display method and computing equipment Active CN115185581B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211098746.1A CN115185581B (en) 2022-09-09 2022-09-09 Icon packaging method and device, icon display method and computing equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211098746.1A CN115185581B (en) 2022-09-09 2022-09-09 Icon packaging method and device, icon display method and computing equipment

Publications (2)

Publication Number Publication Date
CN115185581A true CN115185581A (en) 2022-10-14
CN115185581B CN115185581B (en) 2022-12-02

Family

ID=83522523

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211098746.1A Active CN115185581B (en) 2022-09-09 2022-09-09 Icon packaging method and device, icon display method and computing equipment

Country Status (1)

Country Link
CN (1) CN115185581B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108196925A (en) * 2017-12-29 2018-06-22 山大地纬软件股份有限公司 A kind of multi-mode management system of more icons and implementation
CN109343926A (en) * 2018-09-29 2019-02-15 闻泰通讯股份有限公司 Application program image target display methods, device, terminal and storage medium
CN112988152A (en) * 2021-03-12 2021-06-18 中国平安财产保险股份有限公司 Project icon publishing method, device, equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108196925A (en) * 2017-12-29 2018-06-22 山大地纬软件股份有限公司 A kind of multi-mode management system of more icons and implementation
CN109343926A (en) * 2018-09-29 2019-02-15 闻泰通讯股份有限公司 Application program image target display methods, device, terminal and storage medium
CN112988152A (en) * 2021-03-12 2021-06-18 中国平安财产保险股份有限公司 Project icon publishing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN115185581B (en) 2022-12-02

Similar Documents

Publication Publication Date Title
CN110489116B (en) Page rendering method and device and computer storage medium
JP6198939B2 (en) Method for loading driver and embedded device
US7673235B2 (en) Method and apparatus for utilizing an object model to manage document parts for use in an electronic document
AU2005202722B2 (en) Common charting using shapes
CN113126990B (en) Page development method, device, equipment and storage medium
US20020120634A1 (en) Infrastructure and method for supporting generic multimedia metadata
US9037957B2 (en) Prioritizing asset loading in multimedia application
US9026900B1 (en) Invisible overlay for dynamic annotation
KR20080021081A (en) Fine-grained control of z-order elements in a xml presentation
US20130227391A1 (en) Method and apparatus for displaying webpage
CN113885935A (en) Resource packaging method and device, electronic equipment and computer readable storage medium
CN111897778B (en) Computer file merging method, device and system
US9384300B2 (en) Modeled applications multiple views generation mechanism
CA2686367A1 (en) Dynamic native editor code view facade
CN115185581B (en) Icon packaging method and device, icon display method and computing equipment
CN117055987A (en) Webpage display method and device, electronic equipment and computer readable storage medium
CN110489185B (en) Floating layer display method, computer storage medium and terminal equipment
CN115080114B (en) Application program transplanting processing method, device and medium
US20120192046A1 (en) Generation of a source complex document to facilitate content access in complex document creation
CN109426497B (en) Data embedding method, device, system and storage medium
CN108304169B (en) Implementation method, device and equipment for HTML5 application
US20070206022A1 (en) Method and apparatus for associating text with animated graphics
US11526578B2 (en) System and method for producing transferable, modular web pages
US20150277723A1 (en) Exporting a component of a currently displayed user interface to a development system
CN113110837A (en) Method and device for processing page information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant