Background technology
Along with demonstration document (such as, demonstration document among Microsoft Office, Open Office, the WPS Office) use in every field such as government's office, educational practice, enterprise's interchange is more and more wider, requirement to demonstration document itself is also more and more higher: demonstration document can not content just to text, figure, image and video, should and must possess abundant and outstanding interactive performance; Same set of demonstration document must be issued on different media very easily, except traditional paper and PC, also has handheld devices such as Web issue, PDA, mobile phone.But, be not based on the file of XML (eXtensible MarkupLanguage), so to issue or utilize a demonstration document not to be easy to again because demonstration document is binary file.Therefore, there are a lot of researchs all attempting to rebuild a better demonstration document now, roughly thinking is: the logic and the representation of data of at first expressing demonstration based on XML, utilize XSLT or other instrument that the XML demonstration document is converted to the concrete manifestation form again, they all possess the function of generation SVG (Scalable Vector Graphics saleable vector graphics) file, but they all are directly to use SVG to express demo content, original many peculiar notions in the demonstration document have been lost on the one hand, cause animation not reuse on the other hand, and then make the SVG document size excessive etc., this is unfavorable for Network Transmission under the more and more stronger environment of current internet dependence very much.In addition, express demonstration document if adopt pure XML mode, though logic can be very clear, can extra increase by XML and convert the required difficulty of SVG standard format documentation that to be understood by the SVG application program to, even may arrive the degree that the SVG application program can't realize.Therefore, occurred a kind ofly can keeping peculiar notion in the demonstration as much as possible and being easy to the SVG format file being understood and use by the SVG application program, the SVG demonstration projection method has also appearred simultaneously, referring to Fig. 1, the name of our company application is called " a kind of SVG demonstration projection device and carry out the method for demonstration projection " patent of invention and discloses a kind of SVG demonstration projection method, this method has certain weak point, it is when projection, need be with in the node of all the Slide copying datas in the whole projection tabulation in the dom tree, may cause in whole dom tree so on the one hand, element id is not unique, make some demands implement to become very complicated even can't realize, as mutual animation; On the other hand, all in same dom tree, independence each other is poor for all Slide data, is carrying out realizing utilizing the firm Slide that play to do to switch background when page or leaf switches, and can only be as switching background with black; Also have, because continually dom tree is operated, therefore the load time of data preparatory stage is long when handling larger-size document, and efficient is very low.
Embodiment
A kind of SVG demonstration projection method, this method is divided into application layer, logical layer and data Layer with system, and described application layer mainly is responsible for the reception of incident, and the incident that receives is distributed to the respective modules in the SVG demonstration projection device in the logical layer; SVG demonstration projection device in the logical layer mainly comprises animation projection module in broadcast state administration module, projection page data preparation module, page or leaf handover module and the page or leaf; Data Layer comprises DOM raw data definition, DOM screening zone, broadcast state storage unit and other data storage cell; This demonstration projection method also comprise projection page or leaf initialization procedure and with the process of user interactions, wherein, above-mentioned data Layer also comprises plays object-storage unit and data object storage unit, described DOM screening zone is only stored nearest Slide that showed and the current Slide that is showing, the former is called node one, and the latter is called node two.In the above-mentioned SVG demonstration projection method, described data object storage unit is deposited the Slide object set of having play in proper order according to the projection of Slide in the custom show tabulation in the SVG presentation file; Described broadcast object-storage unit is used to store the array of the projection page data object set that original Slide set of data objects or projection page data preparation module generate.
The change of the logic structure of data in the inventive method makes the treatment scheme of corresponding projection page data preparation module and page or leaf handover module that respective change also take place.
The treatment scheme of projection page data preparation module is: in initialization event, call the interface that projection page data preparation module provides, prepare the projection page data.Obtain this Slide raw data according to the definition of order of Slide, and according to a special identifier in this Slide raw data, judge itself and the incidence relation of corresponding Master, in internal memory with Master data and Slide raw data rule according to appointment, a synthetic complete Slide that can directly be shown by the SVG player, promptly show page data, then this Slide object is saved in the relevant position in the data object storage unit, use for other module, use same procedure to finish until all Slide conversions, (also can use same procedure only part Slide conversion to be finished, and other Slide can prepare before projection in real time, when promptly showing certain one page, just begin to prepare the data of this one page; Data Source can be independent file, also can be a plurality of files, can be local, also can be on the network.) at last, remove the node of all original Slide data correspondences in the dom tree, can also remove the node (requiring) of Maste data correspondence as subclaim.If specified the custom show name, then according to specifying the custom show name to read corresponding playlist content, otherwise according to the definition of order of Slide in the document as the playlist content.
The treatment scheme of page or leaf handover module is: in the page or leaf handoff procedure, at first will be according to current state (which page or leaf what mainly refer to current projection is) and type of action, from DOM screening zone deletion of node one, from the data object storage unit, find the object of purpose Slide correspondence again, be appended in the DOM screening zone.Like this, node two has originally become node one, and the node that newly appends into is a node two.At last, the page or leaf that triggers node two switches animation, and the page or leaf call number of node two is returned to the broadcast state administration module, by it current broadcast state is upgraded, and the result is kept in the broadcast state storage unit, finishes whole page or leaf change action.Switch to page up or down one page be with the key distinction that jumps to specific page: switch to page up or down one page need not the call number that the broadcast state management provides the Slide that will play, call number and the direction of action of current Slide only need be provided; Not only need the broadcast state administration module that the call number of current page is provided and switch to specific page, also need to provide the call number of the Slide that will play.If when carrying out the page or leaf switching, animation data is not ready to fully in projection page data preparation module, and it is complete then also to need elder generation that animation data is prepared herein, and the loading of animation data remains use " function animation " method.
Below the mode of an example introduce initialization in the SVG demonstration projection method of the present invention and with the workflow of user interaction process:
The operation of whole projection system all is that the case mechanism by DOM triggers.After the SVG demonstration data file loads, when the needs initialization data, by calling the specific response function, also promptly show the interface that the page data preparation module provides for application layer, inlet as treatment S VG document, according to specifying principle to synthesize, generation can be directly by SVG player data presented, and the data that generate are temporary to the data object storage unit with the specific markers in original Slide data and the data based Slide definition of data of Master; Then, read the playlist of specifying in the custom show name, if the projection name of appointment does not exist or do not specify the custom show name, the definition of order of then pressing Slide is as playlist.After the projection page data is ready, the generation of system wait customer incident, and be responsible for variety of event by the broadcast state administration module and provide interface for the processing entry call of variety of event.
The broadcast state administration module can be handled five types action altogether: switch to down one page, switch to page up, switch to specific page, next action and a last action.For the action of first three types, the broadcast state administration module only need directly call page handover module and for it provides key message, and carrying out specific action at the page or leaf handover module, to upgrade current projection state later on just passable.For back two kinds of actions, be the compound action of exist actually, need carry out a deep processing according to current projection state to them by the broadcast state module, convert animation fallback action in interior animation projection action of page change action or page or leaf or the page or leaf to.And then determine that calling a page handover module finishes a page change action, or call a page interior animation projection module and finish page interior animation projection action and the interior animation fallback action of page or leaf.Carry out the page or leaf change action no matter be, still carry out animation rollback operation in projection action of page or leaf animation or the page or leaf, when carrying out required movement, notice broadcast state administration module upgrades current projection state synchronously, as revises the call number of current Slide or the call number of current animation.In addition, can also finish the redirect and the change custom show scheme of page or leaf by the index page processing module.
As shown in Figure 3, before generated data, system at first carries out version and judges.All include the version information of the document in the SVG presentation file of each generation,, then can stop processing from document, directly finish projection document if the version information of version information that reads and projection system is inconsistent.If it is consistent, system then begins to prepare data, its process is: the Slide data of duplicating appointment from lantern slide page data definition are SlideCut, and regenerate the id of SlideCut, and supposing that the id of former Slide is " oldId ", the id of the Master related with it is " mastered ", the id of then newly-generated SlideCut be " oldId "+.? (? unduplicated integer word in expression the document, since 0, increase progressively successively), as " oldId.0 "; Then, use the DOM function to obtain that id value is the element of " oldId.master " among the SlideCut, the effect of the pairing element of this id is to set up related for Slide with Master, point out whether this Slide ignores the background graphics among the corresponding Master, for convenience of description, associated element is called for short in the back.If the xlink:href property value of this associated element is " masterId ", then the background graphics among the Master is not ignored in expression, is else if " masterId.background ", and then expression is ignored.When ignoring, change the id of this associated element into " oldId.master.ignoreshapes ", otherwise, change its id into " masterId.background ", and shapes all among the masterId is copied among the SlideCut.It should be noted that, in SVG, the hierarchical relationship of each Shape is by their sequencing decisions when the data definition, so for after the shapes among the Master is copied to SlideCut, do not cause the Shape among the Shape covering SlideCut among the Master, Shapes among the Master must be copied to associated element among the SlideCut after, before all Shapes definition, the insertBefore interface that this operation can utilize DOM to provide is finished.At last, with the temporary correspondence position in the data object memory block of the SlideCut object that generates.Finish the synthetic operation of a Slide static data.
According to the method described above, the definition of order of Slide becomes static data temporary to the data object memory block all original Slide data-switching in according to document.The static data of the corresponding Slide of synthetic a certain v_Slide object.
As shown in Figure 4, after the broadcast state administration module is to action by analysis, if action relates to the page or leaf switching, the broadcast state administration module then can call the internal interface that page handover module provides, notice page or leaf handover module is handled the action that takes place, and,, carry out the function of action appointment so that allow page handover module can accurately call inner corresponding submodule for the page or leaf handover module provides key message.After the internal interface of page or leaf handover module is called, the page or leaf handover module is activated, the information that it can provide the broadcast state administration module is immediately judged, if jump to specific page, judge at first that then this page or leaf is whether in current projection tabulation, if the words in the projection tabulation, directly remove the node one in the DOM screening zone, specific page object in the data object storage unit is appended in the DOM screening zone, and the activation page or leaf switches an animation, simultaneously, the broadcast state administration module upgrades current page number synchronously, finish a page redirect, if not in the projection tabulation, then only remove the node one in the DOM screening zone, specific page object in the data object storage unit is appended in the DOM screening zone, and activate page or leaf and switch an animation, and do not need the broadcast state administration module to upgrade current page number synchronously, can jump back to former Slide smoothly so that finish in the projection of page or leaf animation.If jump to down one page or page up, the method for skipping is to jump to specific page similar, but needs to remove from the DOM screening zone after the broadcast object-storage unit the content of node one is temporary before page or leaf switches again, and will consider also simultaneously whether the redirect page or leaf is hiding.For convenience of description, the call number of supposing current page is C, and this index value is composed to K.If " page up " judges at first that then the K page or leaf is a homepage, if homepage, then do not carry out any action, direct process ends, otherwise the K value is from subtracting 1, judge that again the K page or leaf is hidden page (the visibility property value is " hidden "), if hidden page judges whether it once was played, if never be played again, then directly skip the K page or leaf, use same procedure to repeat an action; If not hidden page, then directly show the K page or leaf, hide the C page or leaf, it is current page, and judge whether K page or leaf animation data has been ready to, under situation about being not ready for, also need to enable the page or leaf animation data that page animation data preparation module adds the K page or leaf, activate the page or leaf animation of K page or leaf at last, the state when showing page or leaf projection for the last time.If " following one page ", judge at first that then the K page or leaf is a last page, if last page is not then carried out any action, direct process ends, otherwise, the K value judges that again the K page or leaf is a hidden page, if hidden page from adding 1, then directly skip the K page or leaf, use same procedure to continue to judge one page down; If not hidden page, then the K page or leaf is shown, the C page or leaf is hidden, be that current page is hidden, and call a page animation data preparation module, load the page or leaf animation data of K page or leaf, loading method is if Slide itself has a page animation, then directly use the page or leaf animation of K page or leaf, if the K page or leaf does not have a page animation, the animation of mother matrix that then attempt to load K page or leaf correspondence is as the page or leaf animation of K page or leaf, if the page or leaf animation is loaded in projection page data preparation module, then only need call page an interior animation function herein is that the K page or leaf is prepared a page interior animation, loading method is at first to load the animation that has all Shape of animation in the corresponding mother matrix, reload that all have the animation of the Shape of animation in the K page or leaf, if herein in the page or leaf animation data also in projection page data preparation module, be ready to, then directly start K page or leaf page or leaf animation.No matter be to jump to page up, still one page down all must upgrade current broadcast state synchronously, i.e. C=K, and making current page number is the page number of that page of being shown all the time, and the result is saved in the broadcast state storage unit, is convenient to the broadcast state administration module and handles.
Above step is the unrestricted technical scheme of the present invention in order to explanation only.Any modification or partial replacement that does not break away from spirit and scope of the invention all should be encompassed in the middle of the claim scope of the present invention.