Embodiment
In one embodiment of the present of invention shown in Figure 1, operating system is the Graphic Operating System with graphic presentation control and relevant therewith parts.These controls comprise: but be not limited to such as scroll bar, button and slider bar.Other control is within the scope of the invention, and it is known for a person skilled in the art.Other presentation graphics feature also is within the scope of the invention.These parts comprise but are in no way limited to: the non-client portion of form in the display for example is the window frame around application program shows on user interface, minimizes frame and close box.
Among Fig. 1, show the basic structure of using in embodiments of the present invention.If since to above-mentioned related application be familiar with cause the reader to be familiar with the operation of theme construction system, advise that then explanation that the reader advances to Fig. 4 and Fig. 5 knows and feel the embodiment of structurally associated to understand of the present invention and the theme that is used for theme construction system parts.This structure use- case subapplication 138 and 139 illustrates, it is open and operation on computing machine 110.Owing to move such as the application program of APPI138, it usually requires the control or the graphics part that will be provided or be shown on the monitor 191 of computing machine 110.
Among Fig. 1, storehouse 208,210 and 212 is connected on application program 138 and 139 by point module 214.But point module 214 makes the theme of control in the application program can ask the version of the theme of control under not needing to change the situation of application program itself.Show inventory 215 by using, point module 214 makes application program 138 and 139 can load DLL208 in working time, 210 or 212 specific versions.Point shows that inventory 215 stipulates the environment that application program wherein will be moved, and it allows a plurality of DLL versions to exist on the machine.Therefore, point shows that inventory 214 will shine upon the request to parts, but makes it provide as the thematic unit among the DLL212, but replaces the non-thematic unit from DLL208.Under the situation of the code that does not change application program, this allows the existing application program can be by topicalization.But point shows inventory 214 and also allows new theme control to be placed on among the different DLL that has DLL now that it has been simplified implementation and compatible danger is minimized.
Fig. 2 has represented the example of suitable computingasystem environment 100, and the present invention can realize thereon.Computingasystem environment 100 only is an example of suitable computingasystem environment, is not intended for use any restriction to usable range or function of the present invention.Computing environment 100 neither should be interpreted as has non-again any one or the relevant requirement of combination that is interpreted as with the parts of explanation in exemplary operation environment 100 of any dependence.
The present invention is exercisable with the computingasystem environment or the structure of many other general purposes or special-purpose purpose.Go for known computing system of the present invention, environment, and/or example of structure is including, but not limited to personal computer, server computer, hand-held or laptop devices, multicomputer system is based on microprocessor system, top setting box, the programmable user electronic installation, network PC, small-size computer, mainframe computer comprises the distributed computing environment of any said system or device etc.
The present invention can illustrate in the plain text of carrying out by computing machine such as the computer executable instructions of program module.Usually, program module comprises routine, program, and object, parts, data structure etc., they are finished specific task or realize specific abstract data type.The present invention also is useful in the distributed computing environment, and here task is finished by the teleprocessing device, and these teleprocessing devices are connected by communication network.In distributed computing environment, program module can be positioned in the local and remote computer storage media may that includes the memory stores device.
With reference to figure 2, be used to realize that example system of the present invention comprises the general purpose calculation element that is computing machine 110 forms.The parts of computing machine 110 can be including, but not limited to processing unit 120, system storage 130, and will comprise that the various system units of system storage are coupled to the system bus 121 of processing unit 120.System bus 121 can be the bus structure of any several types, and it comprises memory bus, perhaps Memory Controller, peripheral bus, and any one local bus that uses various bus structure.By example but do not limit, this structure comprises industrial standard architectures (ISA) bus, and Micro Channel Architecture (MCA) bus strengthens ISA (EISA) bus, video electronic device ANSI (VESA) local bus and be also known as the peripheral component interconnect (pci) bus of Mezzanine bus.
Computing machine 110 typically comprises various computer-readable medias.Computer-readable media can be any obtainable medium, and it can comprise volatibility and non-volatile media, removable and non-removable media by computing machine 110 visits.By example but do not limit, computer-readable media can comprise computer storage media may and communication medium.Computer storage media may comprises volatibility and non-volatile media, removable and non-removable media, they realize that by any method or the technology that is used for information stores this information comprises for example computer-readable instruction, data structure, program module or other data.Computer storage media may is including, but not limited to RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital universal disc (DVD) or other optical disc storage, tape cassete, tape, disk storage or other magnetic memory device perhaps can be used for storing the information of expectation and any other medium that can use computing machine 110 to visit.Communication medium typically comprises computer-readable instruction, data structure, and program module or such as other data in the modulated data signal of carrier wave or other transporting mechanism, and comprise that any information transmits medium.Term " modulated data signal " meaning be have one or more feature groups or change signal by this way with the information in the coded signal.By example but be not restriction, communication medium comprises the wired media that connects such as cable network or direct line, and such as sound, RF, the wireless medium of infrared ray and other wireless medium.Above-mentioned any combination also should be included in the scope of computer-readable media.
System storage 130 comprises computer storage media may, and it is such as the volatibility of ROM (read-only memory) (ROM) 131 and random-access memory (ram) 132 and/or nonvolatile memory form.Basic input/output 133 (BIOS), it comprises transmission information between the unit that for example helps in computing machine 110 when starting basic routine typically is stored among the ROM131.RAM132 generally comprises data and/or program module, and they can be by processing unit 120 zero accesses and/or 120 operations of instant processed unit.By example but be not restrictive, Fig. 2 has represented operating system 134, application program 138 and 139, other program module 136 and routine data 137.
Computing machine 110 also can comprise other removable/movably non-, volatile/non-volatile computer storage media.As just example, Fig. 2 has represented hard drive 140, and it is from movably reading or writing the non-volatile magnetic medium; Disk drive 151, it is from movably reading or writing the non-volatile magnetic disk 152; With disc drives 155, it reads or writes from the movably non-volatile CD 156 such as CD ROM or other optical media.Other removable/non-movably volatile/non-volatile computer storage media that can be used in the exemplary operation environment includes, but are not limited to tape cassete, flash memory card, and digital universal disc, the digital video band, solid-state RAM, solid-state ROM, etc.Hard drive 141 generally is connected to system bus 121 by the non-removable memory interface such as interface 140, and disk drive 151 and disc drives 155 generally are connected to system bus 121 by the removable memory interface such as interface 150.
Above driving and their relevant computer storage media may described with shown in Figure 2 provide storage computation machine instructions, data structure, program module and be used for other data of computing machine 110.For example among Fig. 2, hard drive 141 is represented as storage operating system 144, application program 145, other program module 146 and routine data 147.Notice that these parts are not and operating system 134, application program 138 and 139, other program module 136 is identical or different with routine data 137.Operating system 144, application program 145, other program module 146 provides with different numerals here with routine data 147, and they are different copies at least with explanation.The user can be with order and information by being input in the computing machine 110 such as keyboard 162 and the input media that is commonly referred to the pointing device 161 of mouse, tracking ball or touch pad.Other input media (not shown) can comprise microphone, remote-control lever, gameboard, satellite antenna, scanner etc.These input medias usually are connected to processing unit 120 by the user's input interface 160 that is coupled to system bus, but also can pass through such as parallel port, and other interfaces of game port or USB (universal serial bus) (USB) are connected with bus structure.Through the interface such as video interface 190, the display device of monitor 191 or other type also can be connected to system bus 121.Except that monitor, computing machine can also comprise other peripheral hardware output unit, for example loudspeaker 197 and printer 196, and they can be connected by output Peripheral Interface 195.
Computing machine 110 can be operated in and use logic to be connected to one or more remote computers for example in the networked environment of remote computer 180.Remote computer 180 can be a personal computer, server, router, network PC, peer entity or other common network node, and generally comprise with respect to the many of computing machine 110 or unit that all are above-mentioned, although only memory storage apparatus 181 has been illustrated among Fig. 2.The logic that Fig. 2 describes connects and comprises LAN (LAN) 171 and Wide Area Network (WAN) 173, but also can comprise other network.This networked environment is usual in office, enterprise computer network, internal network and the Internet.
In the time of in being used in the lan network environment, computing machine 110 is connected to LAN171 by network interface or adapter 170.In the time of in being used in the WAN network environment, computing machine 110 generally comprises modulator-demodular unit 172 or other is used for setting up communicating devices, for example the Internet on WAN173.Can be that inner or outside modulator-demodular unit 172 is connected to system bus 121 through user's input interface 160 or other suitable mechanism.In networked environment, computing machine 110 or the described program module of its part can be stored in the remote memory storage device relatively.As an example but be not restrictive, Fig. 2 has represented as the remote application 185 that resides on the storage arrangement 181.It is exemplary that network shown in being appreciated that connects, and can use other device that establishes a communications link between computing machine.
Although many other internal parts of computing machine 110 are not shown, it is known those skilled in the art will appreciate that these parts and interconnecting.Therefore, relate to relevant the present invention of additional detail of computing machine 110 inner structures with underground explanation.
It will be appreciated by those skilled in the art that such as operating system 134, application program 138 and 139, and the program module of data 137 is provided for computing machine 110 through a memory storage apparatus, memory storage apparatus can comprise ROM131, RAM132, hard disk drive 141, disc driver 151 or CD drive 155.Preferably, hard disk drive 141 is used for storing data 137 and program, and this program comprises operating system 134 and application program 138 and 139.
When computing machine 110 was opened or put again, the BIOS133 indication processing unit 120 that is stored among the ROM131 was encased in RAM132 with operating system from hard drive 141.In case operating system 144 is loaded among the RAM132, processing unit 120 executive operating system codes with cause that the video elementary relevant with the user interface of operating system 134 is displayed on the monitor 191.When being opened by the user such as the application program of application program 138, program code and related data are read and are stored among the RAM192 from hard disk drive 141.
Fig. 3 shows the demonstration example of the graphics part with various appearances.As shown in Figure 3, control can adopt the form of OK button 200, Cancel button 202 and Apply button 204.The present invention allows visually to change the appearance of control and other parts so that be suitable for computer user's requirement better.Except that color and font selection, the present invention allows to change the appearance of control.For example, the control configuration of components can define on request.For example, scroll bar can be endowed upper and lower arrow, and its bottom at scroll bar is close mutually, replaces arrow upwards and at the arrow up and down of bottom.And, can define the shape of control and its parts.As shown in Figure 3, for each button 200,202 and 204, show 4 different whole appearances.The setting of each different appearance be coordinate and be called as " theme ".Each theme is to be represented by a button rows among Fig. 3.Although only figure 3 illustrates 4 themes, the computer user can select to create unlimited many themes.Theme is the set or the group of relative special object or the barment tag of wishing visual environment.As following, the present invention allow that the user of computing machine specifies a plurality of predefine themes which will be applied to control and other parts that video shows.And under the situation of the software code that does not need to change control and other graphics parts, the present invention allows new video theme to be added to system.In addition, under the situation of the software code that does not change control and other graphics parts, the present invention allows additional new technology being provided or the existing technology that provides is provided.
As application program, the APP2 among Fig. 1 139 for example, bootup window usually requires to give or show control or graphics part on the monitor 191 of computing machine 110.For example, with reference to figure 3, the application program that the demonstration of OK button 200 can be monitored on the device is required.The example of button 200 is created in application program 139 requests.According to this, operating system is delivered to its control of oneself that draws of instruction with class message.This is asked chosen to the dynamic link libraries that comprises special control (DLL).As an example, the DLL in the window-operating environment is called as User32.dll or ComCtl32.dll (V5), and it is expressed as 208 and 210 respectively in Fig. 1.Storehouse 208 and 210 is present in the Graphic Operating System 134.Storehouse 208 generally is connected with application program 139 by default with 210.Storehouse 208 and 210 be connected and can be used for preferentially by making of point 214 (fusion) will be described as the back.The control of definition comprises the needed picture code of the control that is provided on the monitor in the storehouse 208 and 210.Therefore, for a change the appearance of control in the storehouse 208 and 210 for each control in storehouse 208 and 210, must change the picture code of software.
Additional storehouse DLL, 212 shown in Fig. 1 is similar to storehouse 210, is that it comprises the some predefined control and graphics parts 185 that can be used by application program 138.In a broad sense, DLL212 comprise some will be by the parts of graphic presentation.But in storehouse 212, these controls are variously defined, and make that they are " theme are known and felt ".Provide needed all software codes of many video type control except comprising, these controls are defined by having some the basic information or the value of relevant control, for example, and the place of control, parts and state.
The place is the desirable position of user on user interface.Parts are disparity items of constituent control.As an example, the scroll bar control has the rectangular rod part of lengthening, less thumb part that slides in shaft-like part and the arrow part on every end of shaft-like part.The appearance that the state description of control is current, it has reflected the functional status of that part.For example, button can activate, and is depressible, (hot) (when mouse is on control) of heat, obstruction or do not activate.
Do not select theme to provide control needed picture code if the control among the DLL212 also comprises, and know the feel path by the theme of code.DLL212 asks to provide or the service of drawing from theme manager DLL216.Theme manager 216 provides request that the service and the control that draws on the explanation place of display are provided, and has the explanation part in description status.
Theme manager 216 comprises a series of API, its allow storehouse 212 and theme manager mutual with communicate by letter.API allows the author of control to define control in DLL212, as a series of part and state, and does not need software that code is provided.These API are divided into three types usually: picture API218, information A PI220 and utilize API222.Picture API218 be used in usually provide and the help in the layout of required control part and other parts in.Information A PI220 is generally used for obtaining the information of the current definition appearance of relevant control, is finalized the design individually to allow control.Utilizing API222 is employed those API of operating system that are different from these controls, controls theme and selects.Utilize API222 to comprise to can be used in enumerate the theme of installing and load they one of function.
Picture API218 is that the set of feeling that picture is served known in theme.Each independent API in picture API218 group is used to realize different picture services.The parts peculiar and the state of near the graphics part usually, each API requires.The API that is called " DrawThemeBackground " is provided, the frame of its special-purpose theme that draws, and fill out parts peculiar and state in the place of hope.Similarly, provide the API that is called " DrawThemeText ", the color of its special-purpose theme of being used for parts peculiar and state of drawing and the special text of font.
As an example, if by application program 138 request OK buttons 200 (Fig. 3), the control among the DLL212 will by such as the function call of DrawThemeBackground or DrawThemeText with part, state and location information pass to picture API218.As what be described in more detail below, this part and status information and barment tag coupling, and theme manager 216 control that on monitor, draws.Picture API218 also comprises the API that is called as " GetThemeBackgroundContentRect ".This API makes control obtain to be defined the size of holding within the theme background.Usually, this is the zone in frame or border.By using this API, control can be determined the obtained zone in this background, has wherein placed project.When using this API, the information of parts peculiar and the relevant graphics part of state request of the control among the DLL212.This information be obtain by theme manager 216 and be returned to this control.The similar API that is called as " GetThemeBackgroundExtent " is provided, has calculated the size and the place of special-purpose theme background, it is used to be presented the parts peculiar and the state of content rectangular extent.When knowing content, this API can be used, and, the outer boundary of theme background need be identified for based on this content.Another API that is called as " GetThemePartSize " is provided, has been used for the searching motif author, it is defined as the minimum and the conventional size of control part.
Picture API218 also comprises the API that is called " GetThemeTextExtent ".When providing in theme fonts, this API is used for the size of computational rules text.Therefore this API can be used for determining the width and the height of given text string.Therefore, the author of control can stipulate to have the part and the state of relevant therewith text, and uses this API to obtain the information relevant with the size of text string from theme manager 216.Similarly, another API that is called " GetThemeTextMetrics " is obtainable, and it can be used for obtaining the size information of relevant used font.Therefore, this API can be used for obtaining the information such as the width of average font characters.In other words, this API is used for from theme manager 216 obtaining the information of the size of the relevant special-purpose theme font that this control needs.
The API that is called " GetThemeBackgroundRegion " also is provided in picture API218.In the certain operations system, the district (region) be a kind of describe non-rectangular shape method.The district can also be considered to a kind of image with transparent parts.This API is used for the district of special-purpose theme background of computation rule or partially transparent.In other words, in the window frame background of parts peculiar and state, this API can be used for determining that what is transparent, and what is opaque.Therefore, this API supports the definition of control and part non-rectangular shape.Similarly, provide the API that is called " HitTestThemeBackground ".This API is used for determining that whether the point in the background of clicked regulation part is transparent or in opaque zone.Be used for acquired information from theme manager 216 by this API of the control among the DLL212.If this click is in transparent region, can not need to activate.On the contrary, if this click is in zone of opacity, can need to activate.
Another API that is included among the picture API218 is called as " DrawThemeLine ".This API makes theme define the class type of a line.Such type can be accessed and be used for parts peculiar by calling " DrawThemeLine " API.Similarly, provide the API that is called " DrawThemeBorder ", its allow the topic boundaries that defines by special use.This topic boundaries can be depicted as the parts peculiar that utilizes this API.
The API that is called " DrawThemelcon " is provided, and it allows the theme icon that defines to be provided, and can comprise the special result of special-purpose theme.For example, when mouse was directly on icon, the theme icon can have different appearances, for example luminous appearance.
Picture API218 also comprises the API that is called " IsThemePartDefined ", and it can be used for determining whether theme has defined the parameter that is used for parts peculiar and state.If part is not definition in theme, control this part itself that can draw then.If part is defined by theme, then theme manager 216 will provide this part according to theme definition information.Another API that is called " IsThemeBackgroundPartiallyTransparent " is provided.This API is used for determining whether background is district rectangle or that have transparent parts.This API can be used for oversimplifying this control code.If in background, do not have transparently, then there is no need by using " HitTestThemeBackground " API to carry out any hit testing.
Importantly, picture API218 also comprises the API that is called " OpenThemeData ".This API is used for obtaining to be used for the handle of class list of file names.Class list of file names identification set of diagrams shape parts, and can be divided into female class name and one or more subclass name.For example, female class name can be a button.The subclass name that is used for that female class can be " start button ".Handle is the reference to inner structure, its enumeration the various information and the characteristic of object.Theme manager 216 will be retrieved each class name in tabulation, and will use first coupling subject information that is found.For example, if class name comprises start button and button, just use the start button subject information if then exist.If the start button subject information does not exist, then just be used for the subject information of button.If the value of finding will not use old code that this control is provided.If returned any non-0 value, just set up effective theme handle.This theme handle will be returned to DLL212 and be used for all themes and draw.
Similarly, another API that is provided is called as " CloseThemeData ".When control is closed when for example no longer needing button or when theme is changed, uses this API, illustrate in greater detail as the back.
Another API that is provided is called as " IsThemeActive ".When being effective, this API allows the control among the DLL212 to obtain the answer of true or false at current theme.Therefore this API can be used for determining the picture code that calls " OpenThemeData " API or only use existing control that oneself is provided.
As above-mentioned, theme manager 216 also comprises one group of information A PI220.These information A PI220 allows control to be customized individually.In other words, these API are used in some examples only and can be used for obtaining the information of relevant dedicated controls.These information A PI is used for inquiring theme manager 216, this theme manager 216 be used for related topics specialized property be defined subject information.Therefore, each API220 solicited message, it is provided by theme manager 216.
In the information A PI220 API that is called " GetThemeColor ".This API utilizes parts peculiar with specific color characteristic identifier and single user state to obtain the information of related topics color.This characteristic identifier is the color characteristics number of wishing.In other words, color API is used for requiring the color value corresponding to desired characteristic, for example background color.Another API that is called " GetThemeMetric " is provided, and its request and reception are used for the sizes values of specialized property identifier.This sizes values will be an integer.The API that is called " GetThemeString " also provides in information A PI220.This API is used for obtaining to be used for the string of specialized property identifier.This string is with the information that comprises about number of characters and this string termination in the string.
Another API provides in being called " GetThemeBool " information A PI220, and it will return one for given part, state and characteristic is not 0 to be exactly 1 integer.0 and 1 corresponding to the true or false state for that part, state and characteristic.Another API that is provided is called " GetThemeInt ".In the single user state with specialized property identifier, it will return the round values that is used for parts peculiar.Similarly, provide the API that is called " GetThemeEnum Value ", it will return the theme that is used for parts peculiar, state and characteristic identifier and enumerate.It only is the variable of supporting digital value that theme is enumerated, and it is corresponding to symbolic information.For example, enumerating of being used to calibrate can be the left, middle and right corresponding to numeral 0,1,2.
Another API that is called " GetThemePosition " is provided, and for the parts peculiar in the single user state with specialized property identifier, corresponding to x position and y position, it will return two round valuess.Another API that provides in information A PI220 is called as " GetThemeFont ".This API is used for obtaining the logical specification of the font theme of used given parts peculiar, state and characteristic distinguished symbol.
Another API that provides in information A PI220 is called as " GetThemeRect ".This API will return four integers, represent left and right, the top and bottom of parts peculiar, state and characteristic identifier.Similarly, provide the API that is called " GetThemeMargins ", it will return four integers, represent between the left space, right space, head space of given parts peculiar, state and characteristic identifier and base space.Also have an API who is called " GetThemeIntList ", it will return the value of specialized property, and its type is integer-valued tabulation.At last, provide the information A PI that is called " GetPropertyOrigin ", it returns the position that produces this characteristic at this.This API allows the author of control to obtain the information of this characteristic origin.In other words, this API allows the author of control to determine whether this characteristic is the state of being exclusively used in, part, class, the characteristic overall situation or that do not find.This needs, because the theme characteristic is stipulated in the hierarchy mode by the theme author.For example, if characteristic is not special-purpose in " state " rank, then theme manager will be this characteristic search " part " rank, " class " rank and last " overall situation " rank.Sometimes control know whether characteristic to its part/state of handling be clear definition be important.Also have an API who is called " GetThemeFilename ", it returns the string value of private file name characteristic.
Another API that provides in information A PI220 is called as " SetWindowTheme ".This API allows the author of control to change the control window, with on the same group the subject information not of use except that its class will normally be used.In other words, watching rather than being watched by the defined standard of the theme of that class for control with special use when, this API allows to use this control.This API can use additional parameter with identification particular application and class name.This allows the theme author to use dedicated classes still to change such appearance.For example, can define button, it has given button appearance.Utilize this API, this button can be modified and be different class names.For example, can stipulate " OKButton ".The theme author can use the class that is called " OKButton " then, and " OKButton " will have the appearance different with the standard button appearance.
The theme standard A PI that in being similar to the information A PI group of windows system standard, also has the son group, but it is exclusively used in theme.Be different from normally characteristic based on control, these characteristics to all controls obtainable with share." GetThemeSysColor " returns the special-purpose color value of theme of dedicated system color index." GetThemeSysColorBrush " returns one is the handle of the picture brush of dedicated system color index color." GetThemeSysSize " returns the integer size of special-purpose theme size index." GetThemeSysBool " returns the Boolean (0 or 1) that is used for special-purpose theme boolean index." GetThemeSysFont " returns the logic font structure that is used for special-purpose theme fonts index." GetThemeSysString " returns the string value of special-purpose theme string indexing.
In information A PI group 220, also have some application oriented API." IsAppThemed " returns whether this application of expression is the Boolean (0 or 1) that is formed theme by operating system." GetWindowTheme " returns nearest theme handle, and if desired, it is opened for special-purpose form." GetThemeAppProperties " returns its window part of control is the sign that can become theme in this application with type." SetThemeAppProperties " allows this application that these identical signs are set.
At last, has the information A PI220 that is used for fault processing." GetThemeLastErrorCobtext " returns the mistake relevant with final report (FR) theme mistake on current execution list text (comprising error code, error code parameter, filename and source line) up and down." FormatThemeMessage " returns and is used for the special-purpose wrong error burst of text up and down of specific language.
Theme manager 216 not only comprises picture API218 and information A PI220, and comprises that is utilized an API222.These API are used to realize various results.
Picture API218 and information A PI220 allow the founder of control among author or the DLL212 to define control as a series of part and state.Therefore, defined control is to extract from providing the process of theme manager 216, and also extracts from theme definition appearance information or characteristic, as following detailed description.Use API218 and 220, the author of control can create control, and it is that " theme is known and felt " and installation are used for and the communicating by letter of theme manager 216.This communication comprises to theme manager 216 transmits basic information or value, and it allows theme manager that the control of hope is provided, and has the part that needs in wishing state.
Theme manager 216 also comprises, and the needed device that provides of instruction of drawing is provided.For example, can use the border to fill device 221 is provided, allow different color themes is applied on the control.As another example, can use the position mapping that device 223 is provided, its definition control part is as image.Other the device example that provides comprises use vector definitional language, portable network figure (PNG) file, perhaps portable file layout file (PDF).Should be appreciated that the special technology that provides is provided in the present invention.If wish or the different devices that provides is provided, then the picture code of theme manager 216 is modified to provides device to be added to theme manager 216 this.Therefore, the control among the DLL212 be from theme manager 216 provide technical point from or extract.This allows the different devices that provides to be affixed to theme manager 216, and does not need to revise the control among the DLL212, as following detailed description.
The device that provides in the theme manager 216 provides the control of being asked, and its basis is by the selected appearance theme of computer user.For example, the appearance theme 224 and 226 shown in Fig. 1.As shown in, theme 224 can be user's theme, theme 226 can be commercial theme.But, should be appreciated that the theme that can use other, the present invention is in no way limited to specific theme.For example, other theme can comprise the cartoon theme, child's theme or golf theme.Just as shown in fig. 1, commercial theme 226 is selected by the user, shown in solid line 228.User's theme 224 is to select to obtain, shown in dotted line 230.
Each theme 224 and 226 has similar structure.As shown in Figure 6, commercial theme 226 comprises a series of image file 232.Image file 232 is the image files that used by special subject.In this case, image file 232 is the image files that used by commercial theme 226.Commercial affairs theme 226 also comprises themes.ini file 234.File 234 is texts, and can create in ANSI or UNICODE character set.Color scheme and the obtainable size of this theme that file 234 regulations obtain.Under the situation of theme 226, color scheme and commercial theme 226 obtainable sizes that file 234 regulations obtain.Therefore, file 234 has been represented the variation of the theme of all its application.
Subject document 234 constitutes by one or more sections.Section in the subject document 234 comprises document section 236, big segment 238, color scheme section 240 and file section 242.Document section 236 is optionally, can comprise any characteristic name.Big segment 238 prescribed level names, for example " default size ", " very little " or " very big ".Color scheme section 240 is used for stipulating simple color scenario name and the selection color scheme transmission relevant with this color scenario name.File section 242 is used for the unique name of regulation class data file.File section 242 will comprise filename, be used for the color scheme (from color scheme section 240) of this document name, and the size (from big segment 238) that will support of this document.
Theme 226 is included in second .ini file 244 of mark among Fig. 6.File 244 is class data files, and it comprises the subject data that is used for specific size and color scheme.File 244 can also comprise definition phase.For example, file 244 can comprise the global section of the characteristic of definition special defects control.File 244 can also comprise the section that allows acquisition and using system standard.At last, file 244 can comprise a category section.Each class section name comprises class name, selects component name and selection mode name.Be that characteristic/value is right in this section, the appearance of its definition parts peculiar or control.For example, class name can be used to slide " slider " of control.The part of stipulating for this slider is " track ".The state that defines for this track part is " normally ", " can not " and " activation ".Such section name can also comprise application program (perhaps " group ") name, and it stipulates that this section only is applied in the special application program (perhaps " group ", as SetWindowTheme API defined).
Image file 232, subject document 234 comprises that file 244 is grouped in widely together to constitute subject catalogue 246.Subject catalogue 246 is used to load commercial theme 226 with the system schema file that is positioned at theme manager 216.This system schema file be definition all characteristics of being used for being included in special subject performance mumber file and be female defined file basically, its permission theme characteristic is with a designated number corresponding to the definition appearance.
Therefore, subject catalogue 246 comprises theme .ini file 234, class data file 244 and all image files 232 that used by theme.The content of subject catalogue 246 can be packaged into dll file by theme wrapping tool 250.Theme wrapping tool 250 prevents from scheme file syntax error by analysis and this .ini file is added to handle theme .ini file on the packing that just is being established.The characteristic of being discerned from the document section is written to the packing string list.Also be written in the packing string list from the color scheme information of color scheme section 240 with from the size information of big segment 238.Also handle each class data file 244.When class data file is processed, the analyzed syntax error that prevents this scheme file of this document.This class data file also is added on the packing that just is being established.
The dll file that is produced by theme wrapping tool 250 is commercial subject document 226.File 226 comprises subject data, and this subject data separates from widget library 212.This allows to create under the situation of the control of definition in not changing storehouse 212 and to select different themes.Therefore, the author of control can create and definition and appearance or the irrelevant control of subject data.File 226 is binary formats and is passed to shared subject data file 252 when the computer user selects commercial theme 226, just as shown in fig. 1.File 252 is to share the Storage Mapping file, and it can be accessed by all processing.Therefore, when theme is selected by the computer user, theme manager 216 will read to be used for the subject document that the defines information of file 226 for example, and the information of that binary format is placed in the file 252, all addressable this binary message is handled in all operations at this.
As shown in Figure 1, provide theme transition control plate 254, it is communicated by letter with theme manager 216.Plate 254 combines with user interface, the obtained theme that explicit user can therefrom be selected.As shown in Figure 1, control plate 254 will allow the user to select commercial theme 226 or user's theme 224.Discussed as top, if selected commercial theme 226, and the user of computing machine changes and selected user's theme 224, and then theme 224 will be loaded onto in the shared memory mapped files 252 with binary data.The message of feeling that control transmission theme has changed known in each theme that theme manager 216 is returned in the dll file 212.Each theme is known and is felt control knows how to respond this message.
When theme know to feel that control has received the message that theme changed, this control will close the current theme handle that receives through OpenThemeData API.This control is opened new theme handle with attempt then, reuses OpenThemeData API.If can not open new theme handle, this control knows that this theme closes for that control, and old picture code will be used to draw oneself by this control.If opened new theme handle, then theme manager 216 will be checked this theme binary data and the new picture routine of beginning, make utilize the new theme of selecting for example user's theme 224 draw theme again all and know and feel control.Any information that is buffered about the theme of formerly selecting is invalid, and that information must be recomputated.
In the operation, as shown in Figure 7, application program 138 or 139 will be provided by the figure such as control that provides on user interface, the expression as 256.This figure request is by point 214 routes.Shown in 258, point is handled and will be determined whether the control of being asked is that the feel control known in theme.Do not know feel if the control of being asked is not a theme, then use old code and control will use control to draw oneself, shown in 260 among Fig. 7 from DLL208 or 210.Know feel if the control of being asked is a theme, then the figure request is processed in DLL212, shown in 262.Provide in the service in request, use API218,220 and 222, the control among the DLL212 will be used for the part that for example is used for this request control of figure request, and the essential information in state and place passes to theme manager 216.Therefore, under the situation of the application program of the appearance characteristic that is not found by theme manager 216, the figure request is handled in DLL212.Then, theme manager 216 will be determined or use the special-purpose appearance characteristic of the theme that is used for this given control part and state, shown in 264.These appearance data are retrieved from shared storage mapping data files 252.Use the appearance data of this retrieval, for the control part and the state of being asked, along this place, theme manager will provide this control on computing machine shows, shown in 266.
With reference to figure 4, another embodiment of the logical operation that realizes with point 214 (Fig. 1) is described.In this embodiment, in loading application program rather than routine application program such as Fig. 7, carry out the point operation during by the point request.Non-theme control by will be older is connected to older application program, and point allows older non-subject application to work in the theme environment.Older non-theme control provides with User32.dll and ComCtl32.dll version 5 (V5).User32.dll provides such as button, the user control of scroll bar and list box.ComCtl32.dll provides such as tool bar, the public control of the shell of List View and tree view.Point 214 is connected to theme control file ComCtl32.dll version 6 (V6) in theme environment on the new application program of development﹠ testing.
Operating process starts from loading operation 402 among Fig. 4, and wherein application program brings into operation in system.Starting the part of handling is the dynamic connection of widget library.Connection is to unite the process of quoting between the storehouse of program module and subroutine, has prepared the loading module that moves on computers with establishment.After loading operation 402, control is transformed into and shows inventory detecting operation 404, and wherein it is determined application program and whether has relevant therewith demonstration inventory.If do not show inventory, control transitions to attended operation 406, wherein traditional control User32.dll and ComCtl32.dll V5 are connected in the Storage Mapping of application program.As aforementioned, traditional control is not that feel known in theme.
On the other hand, if having such as the demonstration inventory that shows inventory 215, then control transitions to topic module search operation 408 in showing inventory detecting operation 404, wherein whether it is determined ComCtl32.dll V6 and is tabulated in this demonstration inventory.The ComCtl32.dll V6 if this demonstration inventory is not tabulated then controls transitions to attended operation 406, and wherein traditional control is connected in the Storage Mapping of application program.On the other hand, if ComCtl32.dll V6 is listed in this demonstration inventory, then conversion and control is to attended operation 410, and wherein the theme of ComCtl32.dll V6 is known and felt that control is connected in the Storage Mapping of application program.
Fig. 5 is a kind of operational flowchart, and it is illustrated in theme and knows the example process that in the feel application environment non-client window parts is constituted theme.Fig. 5 has described non-client window parts and how can be provided with the theme characteristic of two kinds of general case.First kind of situation wherein directly arrived the situation of window such as the non-client window message of non-client window message 502.Second kind of situation is that its requirement provides non-client window zone when application program constitutes the API Calls in the non-client window zone that can influence window.
Under first kind of situation, when producing non-client window message 502, the nonclient-area territory of target window can need to be provided.The nonclient-area territory of window generally has one or more non-client's graphics parts, for example minimizes frame, window frame, and close box.Non-client window message 502 can be any message that is sent to window, including, but not limited to measuring or giving information.For example, when the computer user redefined target window big or small, non-client window message 502 was sent to this window, asks this window to be provided again with new size.Non-client window message 502 is normally received by application program, and it uses the target window such as APP2139.Based on non-client window message 502, can activate such as the application program of APP2 139, for example regulate the appearance of its GUI.Non-then client window message 502 is intercepted by UserAPIHook 506, and it is routed to theme manager 216 with this message.UserAPIHook 506 can be a part of theme manager 216.Theme manager 216 is explained non-client window message 502.According to this non-client window message 502, theme manager 216 can be done the measurement of the size of relevant non-client window parts, and can use theme characteristic in sharing subject data 252 so that the nonclient-area territory of window to be provided.
Continue the example of Fig. 5, when doing API Calls such as the control of the application program of APP2 139 or application program, this result can influence the nonclient-area territory of window.In this case, non-client window zone can be to use the theme characteristic to be provided again.Know to feel application program for theme, for example application program 139, can constitute USER32 208 such as the API Calls of API Calls 503.API Calls 503 can be any API Calls, including, but not limited to any api function of previous discussion.For example, " MoveWindow () " API Calls can change the size of window, place and z ordering (ordering), and it requires to draw again window frame.When theme was activity, USER32 208 was routed to UserAPIHook 506 with API Calls 503 when receiving API Calls 503.UserAPIHook 506 is routed to theme manager 216 with API Calls 503 then.Theme manager 216 is explained the measurement calculating of API Calls 503 and the size of carrying out relevant window frame.Then, if necessary, theme manager 216 uses the subject data of sharing 252 to have non-client window zone to provide with the theme characteristic.
In the embodiment of Fig. 5, USER32 208 operation is used for such as the subject application of the APPI 138 of Fig. 1 with such as the non-client API and the message of the non-subject application of APP2 139, as shown in Figure 5.Message flow shown in Figure 5 is identical for non-subject application and subject application.Therefore, whether non-client's graphics part of window is that the theme knowledge is felt irrelevant and constituted theme with this application program.
Importantly be, UserAPIHook operation 506 is revised to provide and is asked theme manager 216, and it can use shares subject data 252 so that the nonclient-area territory of window to be provided with the theme characteristic.As previously discussed, for window member, the theme performance data can be by being added to characteristic on " .msstyles " file by affix at an easy rate.This allows a large amount of themes that need not change control software that is used for non-client window parts.
Logic of machine circuit or circuit module that the logical operation of various embodiment of the present invention is embodied as (1) a series of computer realization activity or interconnects in computing system in the program module of moving on the computing system and/or (2).This realization is the problem of selecting, and it depends on the performance requirement of realizing computing system of the present invention.Therefore, the logical operation of the formation embodiment of the invention that will illustrate here is called operation with changing, constructional device, activity or module.One skilled in the art will recognize that these operations, constructional device, movable and module can be with software, hardware, special-purpose purpose Digital Logic and its any combination realize, and do not break away from the spirit and scope of the present invention in the claims qualification.
According to the summary that comprises the description of drawings book, alternative embodiment of the present invention to one skilled in the art will become clear.Therefore, scope of the present invention is that explanation by claims rather than front limits.
Although the present invention is with the language that is exclusively used in computer structural features, method effect and be illustrated by computer-readable media, should be appreciated that the present invention who limits in claims is not necessarily limited to illustrated application specific architecture, effect or medium.As an example, other determining method can be included in control provides during point that module combines handles.Therefore, the application specific architecture feature, effect and medium are as the exemplary embodiment of the present invention that realizes institute's prescription.
Above-mentioned various embodiment illustrate conveniently and provide that it should not be interpreted as limiting the present invention.Those skilled in the art will recognize easily and constitute various improvement of the present invention and variation, and need not be according to exemplary embodiments and application illustrated at this and that describe, and not break away from true spirit of the present invention and the scope that proposes in the following claim.