CN102129364A - Method for embedding widget toolbar in application program and rapid widget accessing method - Google Patents
Method for embedding widget toolbar in application program and rapid widget accessing method Download PDFInfo
- Publication number
- CN102129364A CN102129364A CN2010100011718A CN201010001171A CN102129364A CN 102129364 A CN102129364 A CN 102129364A CN 2010100011718 A CN2010100011718 A CN 2010100011718A CN 201010001171 A CN201010001171 A CN 201010001171A CN 102129364 A CN102129364 A CN 102129364A
- Authority
- CN
- China
- Prior art keywords
- widget
- button
- toolbar
- plug
- unit
- 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
Links
Images
Landscapes
- Stored Programmes (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The invention discloses a method for embedding a widget toolbar in an application program and a rapid widget accessing method. The method for embedding the widget toolbar comprises that: the application program loads a widget plug-in, and calls an interface function of the widget plug-in; the interface function calls a toolbar creation unit to create a toolbar object of the widget plug-in; the toolbar creation unit reads a toolbar configuration file corresponding to the widget plug-in, acquires the configuration information of a widget button and creates a corresponding button object; the widget plug-in loads an icon resource file of the widget button according to the configuration information of the widget button, and binds the icon resource file with the widget button; a widget access information object is created according to the configuration information of the widget button, and mapping relationships between the widget access information object and the widget button are written into a mapping table; and the created toolbar object of the widget plug-in is added into a toolbar container of the application program. In the methods, an application window and a widget window are not required to be switched frequently, and the needs of a user in rapid widget accessing are satisfied.
Description
Technical field
The present invention relates to field of computer technology, relate in particular to a kind of method that in application program, embeds little (widget) toolbar and fast access widget.
Background technology
In recent years, a kind of localized Web applet increased popularity in user's desktop environment that is called as widget, its interface is succinct, volume is less, response is very fast, deployment easily, can not only move in browser window, can also break away from browser and move on user's desktop.The script of widget is kept at this locality in advance, is loaded, explains and played up by a kind of special browser of the widget of being called as engine, and the widget engine also provides the ability of visit local resource and Internet resources for widget simultaneously.
Fig. 1 illustrates the structural representation of widget application architecture in the prior art.As shown in Figure 1, the widget application that meets World Wide Web Consortium (W3C, World Wide Web Consortium) standard realizes with the HTML+JavaScript script.Typical widget uses CSS pattern file, JS script file and the icon file quoted by a HTML master file and this HTML master file and constitutes.Widget uses generally plurality of display modes, as stop pattern (Docked), desktop (Desktop) and screen mode toggle (FullScreen); Under the stop pattern, the widget window rests in the sidebar; Under desktop, the widget window suspends on the table; Under screen mode toggle, widget is window maximized; Widget can switch between different explicit mode, and the explicit mode of widget adopts the DIV view of HTML to realize usually.In different display modes, the size of widget window and the detail of information of demonstration are often also inequality.Widget uses and is carried by the widget engine, the widget engine mainly is made of widget manager and Web engine, the widget manager is responsible for the life cycle management of widget, comprises installation, loading, the unloading of widget, and the web engine is responsible for the script of widget and is explained and play up.After the widget engine loads widget, HTML and script with widget is construed to DOM Document Object Model (DOM earlier, Document Object Model) tree, then dom tree is played up, obtain the widget window, the widget window belongs to window logic, does not have window handle, can't receive the windows window message.And widget uses the application belong to the height customizable, and the increase of widget or deletion are very frequent, and existing COM plug-in unit can't realize that to the mode of inserter tool hurdle hard coded the additions and deletions of widget toolbar and widget keep synchronous.
Present many widget users use to such an extent that more remain traditional application program at work; run into the situation of using widget in the process of using legacy application through regular meeting; because legacy application is usually operated under maximization even the full frame window scheme; if the user wants to use widget; just must change to desktop and could visit widget; switch the window of responding with program again after using widget; the operation that frequent window switches to the user brings very big inconvenience; if the widget that installs is more, from a large amount of widget, finds fast and visit required widget also and be not easy.
In the prior art based on COM plug-in part technology visit applications window, support the desktop application of COM plug-in unit to form by application program (host program) and various COM plug-in unit; The COM plug-in unit is loaded by host program, and operates in the identical program process with host program.COM plug-in unit and host program are by the interface communication of standard, the COM plug-in unit provides IDispatch interface to host program, behavior for host program control COM plug-in unit, host program provides Application interface to the COM plug-in unit, in host program, add toolbar for the COM plug-in unit, obtain the context data of host program.
Fig. 2 illustrates the process flow diagram of creating the inserter tool hurdle in the prior art by the COM plug-in part technology at host program.As shown in Figure 2, typical C OM application plug-in is mainly by the toolbar creating unit, and button creating unit, button response unit and plug-in resource piece constitute; The applications window of COM application plug-in call to(for) needs can also comprise the applications agency.Wherein, the toolbar creating unit is used for creating the inserter tool hurdle at host program; The button creating unit is used for creating button on toolbar, for button is bound corresponding button icon resource and button response unit; The plug-in resource piece is used for preserving the button icon resource that is loaded into internal memory; The plug-in unit response unit is responsible for responding the specific button click event, carries out corresponding action; The applications agency calls the window of applications by predetermined way.Each button in the inserter tool hurdle all will have and overlaps independently button creating unit, button icon resource and button response unit; Therefore, the inserter tool hurdle must just customize when the COM developing plug fully in the prior art, what comprise icon which button, button are arranged on the inserter tool hurdle, button puts response action of order and button or the like, all in the code of COM plug-in unit, specify in advance, be compiled in the file of COM plug-in unit, be loaded in the internal memory by host program is disposable again.
As shown in Figure 2, the flow process of creating the inserter tool hurdle by the COM plug-in part technology at host program in the prior art relates generally to step 1.1-1.6, and the flow process that triggers applications by the plug-in unit button relates generally to step 2.1-2.3.Wherein, the flow process of creating the inserter tool hurdle at host program by the COM plug-in part technology comprises: step 1.1, and host program loads the COM plug-in unit, calls the OnConnection function of COM plug-in unit IDispatch interface; Step 1.2, OnConnection function call toolbar creating unit is created the inserter tool column object; Step 1.3, toolbar creating unit are called the button creating unit of each button successively and create button on toolbars; Step 1.4, button creating unit are button binding button icon resource; Step 1.5, button creating unit are button binding button response unit (call back function); The Application interface that step 1.6, toolbar creating unit are called host program adds the toolbar object that creates in the toolbar container of host program to.The flow process that triggers applications by the plug-in unit button comprises: step 2.1, and the user clicks the plug-in unit button on inserter tool hurdle in the host program, triggers corresponding button response unit; Step 2.2, button response unit are called applications agent triggers applications; Step 2.3, applications is acted on behalf of the window that calls applications by the windows message mechanism, and the applications here is meant with the host uses the application that operates in the different processes.In the windows system, the method for calling the applications window is the message mechanism of windows, mainly comprises: 1) obtain the applications window handle at present; 2) structure window message (the self-defined message type that need carry data is generally WM_COPYDATA) and window message is submitted to the message subsystem of operating system; 3) the message subsystem finds corresponding window by window handle, calls the window treatments function of this window.Using the windows message mechanism is to get access to window handle to the prerequisite that window sends message, because the widget window is the window logic that the widget engine is described on the table, do not have window handle, therefore adopt the widows message mechanism directly to send message to the widget window.In addition, widget realizes that by JS (JavaScript) script current prior art can't accomplish that also striding course calls the JS script.
Summary of the invention
The technical matters that the present invention will solve provides a kind of method that embeds the widget toolbar in application program, can embed the widget toolbar in common application program easily, so that realize the convenient access of user to widget.
One aspect of the present invention provides a kind of method that embeds the widget toolbar in application program, and this method comprises: application program loads the widget plug-in unit, calls the interface function of widget plug-in unit; Interface function calls tool hurdle creating unit, the toolbar object of establishment widget plug-in unit; The toolbar creating unit reads the toolbar configuration file of widget plug-in unit correspondence, obtains the configuration information of widget button, and creates corresponding button object; The widget plug-in unit is according to the icon resource file of the configuration information loading widget button of widget button, with icon resource file and the binding of widget button; Create widget visit information object according to the configuration information of widget button, and the mapping relations of widget visit information object and widget button are write in the mapping table; And the toolbar object of the widget plug-in unit that creates added in the toolbar container of application program.
Among the embodiment of the method that in application program, embeds the widget toolbar provided by the invention, the mapping relations of widget visit information object and widget button are write in the mapping table further comprise: the mapping relations of widget visit information object and widget button are write in button-widget information mapping Hash table; Wherein the ID of widget button is as the key key word of button-widget information mapping Hash table, and widget visit information object is as the value numerical value of button-widget information mapping Hash table.
Among the embodiment of the method that in application program, embeds the widget toolbar provided by the invention, this method also comprises: create widget visit information object according to the configuration information of widget button, and after writing the mapping relations of widget visit information object and widget button in the mapping table, unified button creating unit is the unified button response unit of widget button binding.
Among the embodiment of the method that embeds the widget toolbar in application program provided by the invention, the toolbar configuration file of widget plug-in unit comprises towards the application of single application exclusive widget toolbar configuration file and the default widget toolbar configuration file shared for a plurality of application; Wherein the configuration information of widget toolbar configuration file comprises at least one in the display order of the icon file title of input parameter list of types, widget button of the display mode of the widget button name that will place, associated widget sign, associated widget, associated widget and widget button; Widget visit information object is the object instance of widget visit information class, and the attribute of widget visit information class comprises at least one in widget sign, widget window ID, widget window entrance function title, entrance function parameterized template and the context property tabulation.
Among the embodiment of the method that in application program, embeds the widget toolbar provided by the invention, when the toolbar creating unit reads widget toolbar configuration file, preferentially read the widget toolbar configuration file related with application program; If there is no related with application program widget toolbar configuration file then reads default widget toolbar configuration file.
Another aspect of the present invention provides the method for a kind of fast access widget, and this method comprises: embed the widget toolbar in application program; Receive the button response message of the button triggering of the target widget on the widget toolbar; Obtain widget visit information object, and widget visit information object is sent to widget engine agency; Widget engine agency generates the widget request according to widget visit information object acquisition context data according to widget visit information object and context data; And widget request sent to the widget engine; And the widget engine searches target widget according to widget request, checks target widget state, and widget is presented at the top layer of screen.
Among the embodiment of the method for fast access widget provided by the invention, the widget engine agency further comprise according to widget visit information object acquisition context data: widget engine agency obtains the context property tabulation from widget visit information object, based on context attribute obtains context data from the interface of application program; And context data is converted to corresponding character string.
Among the embodiment of the method for fast access widget provided by the invention, receive the triggered response message of the stop push-button of target widget, the show state before the widget engine reverts to widget.
Among the embodiment of the method for fast access widget provided by the invention, context data comprises: at least one in the text data of the title of application program, current document title, the current document page number, current selection, current application the window's position or the current mouse position.
Among the embodiment of the method for fast access widget provided by the invention, the widget engine checks that target widget state further comprises: if target widget does not install, then the widget engine returns miscue to widget engine agency; If target widget does not trigger, then the widget engine triggers target widget; If target widget triggers, then preserve the display status information of target widget, wherein display status information comprises: the size and the position of the display mode of target widget, widget window.
The invention provides a kind of method that in application program, embeds widget toolbar and fast access widget, can be in common application program easily and fast visit widget, need not between application window and widget window, frequently to switch, and can keep the original layout of widget constant.
Description of drawings
Fig. 1 illustrates the structural representation of widget application architecture in the prior art;
Fig. 2 illustrates the process flow diagram of creating the inserter tool hurdle in the prior art by the COM plug-in part technology at host program;
Fig. 3 illustrates the process flow diagram of an embodiment of the method that embeds the widget toolbar in application program of the present invention;
Fig. 4 illustrates the process flow diagram of an embodiment of the method for fast access widget of the present invention;
Fig. 5 illustrates among the present invention by the COM plug-in part technology and creates the inserter tool hurdle and the process flow diagram of a specific embodiment of the method for visit widget from host program at host program.
Embodiment
With reference to the accompanying drawings the present invention is described more fully, exemplary embodiment of the present invention wherein is described.
Fig. 3 illustrate of the present invention in application program the process flow diagram of an embodiment of the method for embedding widget toolbar.
As shown in Figure 3, the method flow 300 of embedding widget toolbar comprises in application program: step 302, application program loads the widget plug-in unit, calls the interface function of widget plug-in unit.For example, application program (host program) loads the widget plug-in unit, calls the interface function of this widget plug-in unit, as the OnConnection function of IDispatch interface.The COM plug-in part technology that widget among the present invention is used is done to introduce in detail further after a while.
Among the embodiment of the method that in application program, embeds the widget toolbar provided by the invention, the mapping relations of widget visit information object and widget button are write in the mapping table further comprise: the mapping relations of widget visit information object and widget button are write in button-widget information mapping Hash table; Wherein the ID of widget button is as the key key word of button-widget information mapping Hash table, and widget visit information object is as the value numerical value of button-widget information mapping Hash table.
Among the embodiment of the method that in application program, embeds the widget toolbar provided by the invention, when the toolbar creating unit reads widget toolbar configuration file, preferentially read the widget toolbar configuration file related with application program; If there is no related with application program widget toolbar configuration file then reads default widget toolbar configuration file.
The COM plug-in part technology that adopts among the present invention embeds the widget toolbar based on existing robotization COM plug-in unit (having realized the COM plug-in unit of IDispatch interface) to desktop application, visits the widget window (window logic) that is carried by the widget engine by the widget toolbar.Specifically, the button icon resource that the present invention will be hard-coded in each COM plug-in unit extracts, be placed in the unified icon catalogue, and provide (or a sharing) widget toolbar configuration file for each application, definition embeds each button information of the widget toolbar of using and the widget information that is associated, and comprising: widget sign, widget window/view identification, widget input parameter and the button DISPLAY ORDER of button name, button icon filename, association.Embed the widget application plug-in of using (also being the COM plug-in unit) and comprise toolbar creating unit, unified button creating unit, unified button response unit and widget engine agency, do not contain the button icon resource.The toolbar creating unit is responsible for creating the widget toolbar in host program; Unified button creating unit is created the widget button according to the configuration information of each widget button; Unified button response unit provides public response mechanism for each widget button; Widget engine agency is responsible for communicating by letter with the plug-in unit engine.In the present invention, a shared cover button creating unit of all widget buttons and a cover button response unit are created button and are responded according to the configuration information of button.Compared with prior art, the present invention optimizes COM plug-in unit inner structure, has solved existing COM plug-in unit and has had only recompility could revise the deficiency on inserter tool hurdle, can revise the inserter tool hurdle in time based on configuration file.Also solved simultaneously prior art can't the striding course visit based on the problem of the window logic of script.
The method that embeds the widget toolbar in application program provided by the invention can embed the widget toolbar easily in common application program, so that realize the convenient access of user to widget.
Fig. 4 illustrates the process flow diagram of an embodiment of the method that embeds the widget toolbar in application program of the present invention.
As shown in Figure 4, the method flow 400 that embeds the widget toolbar in application program comprises: step 402-412, wherein step 402-410 and 412 can carry out the same or analogous technology contents with step 302-312 shown in Figure 3 respectively, for for purpose of brevity, repeats no more its technology contents here.
As shown in Figure 4, step 410 " create widget visit information object according to the configuration information of widget button; and the mapping relations of widget visit information object and widget button are write in the mapping table " after, step 412 " is added the toolbar object of the widget plug-in unit that creates in the toolbar container of application program to " before, increase step 411, unified button creating unit is the unified button response unit of widget button binding.For example, be the unified button response unit of widget button binding by the unified button creating unit of widget plug-in unit, the response function of each button is all identical.The input parameter of button response function comprises the button object that the user clicks, the button object example that different buttons import into is different, button ID (unique identification of button) is arranged in the button object, can from button-widget information mapping table, take out related widget visit information by button ID, give widget engine agency and do subsequent treatment.
Fig. 5 illustrates the process flow diagram of an embodiment of the method for fast access widget of the present invention.
As shown in Figure 5, method flow 500 by application program fast access widget comprises: step 502, after in application program, embedding the widget toolbar, the user clicks target widget button on the widget toolbar in the application program triggering the unified button response unit of widget plug-in unit, thereby receives the button response message of the button triggering of target widget.
Step 504 is obtained widget visit information object, and widget visit information object is sent to widget engine agency.For example, the unified button response unit of widget plug-in unit obtains widget visit information object according to widget button ID from button-Widget information mapping table.And call the widget engine by unified button response unit and act on behalf of, so that widget visit information object is sent to widget engine agency.
Step 506, widget engine are acted on behalf of according to widget visit information object acquisition context data, generate the widget request according to widget visit information object and context data, and the widget request is sent to the widget engine.For example, widget engine agency takes out the context property tabulation from widget visit information object, based on context attribute obtains context data (comprising at least one in text data, current application the window's position or the current mouse position of title, current document title, the current document page number of application program, current selection) from the application interface of application program; Widget engine agency generates the widget request message according to widget visit information object and application context data, and the widget request message is sent to the widget engine by striding course communication mechanism (adopt the windows message mechanism as the striding course communication mechanism, also can adopt the striding course communication technologys such as shared drive, socket to communicate by letter) with the widget engine.
Step 508, the widget engine is searched target widget according to widget request, checks target widget state, and widget is presented at the top layer of screen.For example, the window treatments function of the implicit window of widget engine takes out the widget request message from the COPYDATA structure, the widget request message is passed to the widget call unit, request call target widget; The widget call unit obtains target widget according to the widget sign from the widget manager, carry out corresponding operation according to the status information of target widget: if target widget does not install, then the widget engine returns miscue (widget does not install as target) to widget engine agency; If target widget does not trigger, then the widget engine triggers target widget; If target widget triggers, then preserve the display status information of target widget, wherein display status information comprises the display mode of target widget, the size and the position of widget window.At last by the entrance function of widget call unit invocation target widget and widget is presented at the top layer of desktop.
Among the embodiment of the method for fast access widget provided by the invention, the widget engine agency further comprise according to widget visit information object acquisition context data: widget engine agency obtains the context property tabulation from widget visit information object, based on context attribute obtains context data from the interface of application program; And context data is converted to corresponding character string (as the character string of various coding forms, as string of binary characters etc.).
Among the embodiment of the method for fast access widget provided by the invention, this method also comprises: receive the triggered response message of the stop push-button of target widget, the show state before the widget engine reverts to widget.For example, after receiving widget button triggered response message, the widget engine can be preserved current system interface displayed information; After the user browses or uses target widget, click the stop push-button on the widget, after the widget engine receives the triggered response message (promptly reduce this widget show state) of the stop push-button of target widget, the show state before by the widget engine widget being reverted to.Specifically, can repaint widget, realize that by the window object of control widget widget repaints, the show state before widget is reverted to by the Web engine.
The invention provides the method for a kind of fast access widget, this method can be in common application program easily and fast visit widget, need not between application window and widget window, frequently to switch, and can keep the original layout of widget constant.
Fig. 5 illustrates among the present invention by the COM plug-in part technology and creates the inserter tool hurdle and the process flow diagram of a specific embodiment of the method for visit widget from host program at host program.
As shown in Figure 5, the flow process of creating the inserter tool hurdle at host program by the COM plug-in part technology relates generally to step 1.1-1.8, and the method for visit widget relates generally to step 2.1-2.8 from host program; Specifically comprise:
Step 1.1, host program loads the widget application plug-in, calls the OnConnection function of widget application plug-in IDispatch interface.
Step 1.2, OnConnection function call toolbar creating unit is created the inserter tool column object.
Step 1.3, toolbar creating unit read the toolbar configuration file corresponding with this application (the toolbar configuration filename is used ID exactly) from the toolbar config directory, obtain the configuration information of each button.Widget toolbar configuration file example is as follows:
<?xml?version=″1.0″encoding=″UTF-8″?>
<widget_toolbar>
<widget_button button_name=" checks weather "
icon=″find_weather.png″widget_id=″weather″widget_mode=″desktop″
entry=″find_wether″>
<param_template>{city:${selected_text}}</param_template>
</widget_button>
<widget_button button_name=" sends fax "
icon=″send_fax.png″widget_id=″fax″widget_mode=″desktop″
entry=″init″>
<param_template>{fax_file:${file_name}}</param_template>
</widget_button>
</widget_toolbar>
Above-mentioned configuration file has defined the widget toolbar that contains two buttons, and a button is " checking weather ", and another button is " sending fax ".<widget_button〉element definition the widget button information, the button_name attribute of this element is a button name, the icon attribute is the button icon filename, the widget_id attribute is the widget sign, be used for determining widget, the widget_window_id attribute is the widget window ID, be used for determining the widget window, the window_entry attribute is a widget window entrance function name, it is the javascript function name of far call,<widget_button〉element<param_template〉daughter element defined the parameterized template of entrance function, the entrance function parameterized template is the character string template of JSON (JavaScript ObjectNotation) form, be used to construct the JSON parameter of entrance function, in the entrance function parameterized template, template variable ${xxx} mark, the template variable is the variable part of parameterized template, is used to bind the application context data.The present invention adopts JSON encapsulation widget request message and function input parameter, but those skilled in the art know and also can adopt XML encapsulation widget request message and function input parameter.
Step 1.4, toolbar creating unit recursive call is unified the button creating unit, at every turn according to button arrangement information<widget_button〉button object of establishment.
Step 1.5, unified button creating unit loads the icon resource file according to the icon file title in the button arrangement information and binds with button object from the icon resource catalogue.
Step 1.6 is unified the button creating unit according to button arrangement information creating widget visit information object, and this mapping object is written in button-widget information mapping Hash table, and wherein key is button ID, and value is a widget visit information object.Widget visit information object is the object instance of widget visit information class (WidgetAccessInfo), the attribute of visit information class comprises: the widget sign, the widget window ID, widget window entrance function title, entrance function parameterized template and context property tabulation, wherein widget identifies, the widget window ID, widget window entrance function title and suction parameter template respectively with<widget_button the Response Property or the daughter element of element be corresponding, the context property tabulation then is all template parameter titles that extract after the suction parameter template is made an explanation, for example for suction parameter template " { city:${selected_text}} ", the context property that extracts has only a selected_text.
The C++ false code of widget visit information class definition is as follows:
Class WidgetAccessInfo{ //widget visit information class
public:
String widget_id; //widget sign
String widget_window_id; //widget window ID
String entry_function; //widget entrance function title
String paramTemplate; // entrance function parameterized template
List<string〉context_attr_names; // context property the tabulation that in parameterized template, defines }
Step 1.7, unified button creating unit are the unified button response unit (response function that is each button is all identical) of button binding.
The Application interface that step 1.8, toolbar creating unit are called host program adds the widget toolbar object that creates in the toolbar container of host program to.
Flow process by widget button visit widget window specifically comprises:
Step 2.1, the user clicks the widget button of host program, triggers unified button response unit.
Step 2.2, unified button response unit obtains widget visit information object according to widget button ID from button-Widget information mapping table.
The unified button response unit of step 2.3 calls widget engine agency, and widget visit information object is passed to widget engine agency.
Step 2.4, widget engine agency takes out the context property tabulation from widget visit information object, and based on context attribute obtains context data from the application interface that the host uses, and context data is converted to character string.For example in word, if the text data (selected_text) of context property for selecting, then obtain the literal of selection by application->GetSelection () function, if context property is current file full name (full_file_name), then obtain file full name by application->GetFullName ().Possible context property comprises at least: current application title (app_name), current file full name (full_file_name, contain the path), current file title (file_name does not contain the path), current file path (file_path), the literal of selecting (selected_text), zone (selected_region), current page (current_page), the current mouse position (current_mouse_point) selected.
Step 2.5, widget engine agency generates the widget request message according to widget visit information object and application context data, and the widget request message is sent to widget engine (for example the striding course communication mechanism adopts the windows message mechanism, also can adopt the striding course communication technologys such as shared drive, socket to communicate by letter with the widget engine) by the striding course communication mechanism.Adopting the windows message mechanism with the striding course communication mechanism is that example describes:
1) widget engine agency gets speech suction parameter template from widget visit information object, and the template variable in the parameterized template is replaced to application context data character string accessed in step 2.4, obtains entrance function parameter character string.For example for suction parameter template " { city:${selected_text}} ", if the value of context data selected_text is " Guangzhou ", so after the Can Shuo ${selected_text} replacement to the suction parameter template, obtain the parameter character string " { city: Guangzhou } " of entrance function, it is the JSON character string of standard, and the JavaScript engine that can be met the W3C standard is discerned.
2) widget engine agency concatenates into the widget request message according to widget visit information object with entrance function parameter character, and the widget request message is the JSON format messages, and structure is as follows:
{
widget_id:””,
widget_window_id:””,
entry_function:””,
param_obj:””
}
In the widget request message, widget_id, widget_window_id and entry_function source and widget visit information object, the param_obj attribute is an entrance function parameter character string.Suppose to have generated the widget toolbar based on above-mentioned configuration file in word, and the user has clicked " checking weather " button, the widget request message of Sheng Chenging is as follows so:
{
widget_id:”weather”,
widget_window_id:”weather.today”,
entry_function:”find_weather”,
Param_obj: " { city: Guangzhou } "
}
3) obtain the handle that the widget engine implies window.
4) the COPYDATA construction packages widget request message by windows, the message subsystem by windows sends WM_COPYDATA message to the implicit window of widget engine.
5) the message subsystem finds the widget engine to imply window by window handle, calls the window treatments function of implicit window.
Step 2.6, window treatments function are taken out the widget request message from the COPYDATA structure, the widget request message is passed to the widget call unit, request call target widget.
Step 2.7, the widget call unit obtains target widget according to the widget sign from the widget manager, status information according to target widget is carried out respective handling: if target widget does not install, then return " widget does not exist " message, do not do subsequent treatment to widget engine agency; If target widget does not trigger as yet, then trigger widget; If target widget triggers, then the display status information with widget writes in the widget display status register, comprises the display mode of widget, the size and the position of widget window.
Step 2.8, the entrance function of widget call unit invocation target widget also is presented at widget the top layer of desktop.
1) if specified entrance function in the widget request message, the specified javascript function of script object (attribute of document object) call entry function (entry_function) attribute by target widget then, and with entrance function parameter character string (param_obj) directly as the javascript function parameters;
2) display mode with target widget is made as by the specified display mode of widget request message, and the window object by target widget moves on to center Screen with the window of target widget then, and top set shows.In an embodiment of the present invention, the display mode of widget is by DIV figure layer control, every kind of display mode all have with respect to DIV figure layer, change the figure layer that display mode only need show corresponding display mode, and the figure layer of other display mode hidden;
3) after the user browses or uses widget, click the stop push-button on the widget, show state before the widget call unit reverts to widget, promptly from the widget display status register, read the show state (size of display mode, widget window and position) before of widget, the display mode of restore target widget, the window object of invocation target widget recovers window size and the position of target widget.
The invention provides a kind of in application program the method for fast access widget, this method is by embedding the widget toolbar in application program, can satisfy user easily and fast visit widget in common application program, thereby need not between application window and widget window, frequently to switch.In addition, this method can also keep the original layout of widget constant, and application programs and widget change little, satisfy the consistance of user's use, thereby obtain higher acceptance.
With reference to the exemplary description of aforementioned the present invention, those skilled in the art can clearly know the present invention and have the following advantages:
1, the method for widget toolbar and the method for fast access widget of in application program, embedding provided by the invention, remote access interface, widget call unit and widget Window state register in the widget engine, have been increased, can in common application program, embed the widget toolbar easily, so that realize the convenient access of user, and need not to compile the widget toolbar that just can easily revise the embedding application by widget toolbar configuration file to widget.
2, the method for widget toolbar and the method for fast access widget of in application program, embedding provided by the invention, send the widget call request by Windows window message mechanism to the widget engine, realized that striding course calls the JavaScript script, and the JSON protocol encapsulation widget call request of employing lightweight, the performance that has promoted the encapsulation of widget call request and explained.
3, the method for widget toolbar and the method for fast access widget of in application program, embedding provided by the invention, can be in common application program easily and fast visit widget, need not between application window and widget window, frequently to switch, and can keep the original layout of widget constant.
Description of the invention provides for example with for the purpose of describing, and is not exhaustively or limit the invention to disclosed form.Many modifications and variations are obvious for the ordinary skill in the art.Selecting and describing embodiment is for better explanation principle of the present invention and practical application, thereby and makes those of ordinary skill in the art can understand the various embodiment that have various modifications that the present invention's design is suitable for special-purpose.
Claims (10)
1. method that embeds the widget toolbar in application program is characterized in that described method comprises:
Described application program loads the widget plug-in unit, calls the interface function of described widget plug-in unit;
Described interface function calls tool hurdle creating unit is created the toolbar object of described widget plug-in unit;
Described toolbar creating unit reads the toolbar configuration file of described widget plug-in unit correspondence, obtains the configuration information of widget button, and creates corresponding button object;
Described widget plug-in unit loads the icon resource file of described widget button according to the configuration information of described widget button, with described icon resource file and the binding of described widget button;
Create widget visit information object according to the configuration information of described widget button, and the mapping relations of described widget visit information object and described widget button are write in the mapping table; And
The toolbar object of the widget plug-in unit that creates is added in the toolbar container of described application program.
2. method according to claim 1, it is characterized in that, the mapping relations of described widget visit information object and described widget button are write in the mapping table further comprise: the mapping relations of described widget visit information object and described widget button are write in button-widget information mapping Hash table; The ID of wherein said widget button is as the key key word of described button-widget information mapping Hash table, and described widget visit information object is as the value numerical value of described button-widget information mapping Hash table.
3. method according to claim 1, it is characterized in that, described method also comprises: create widget visit information object according to the configuration information of described widget button, and after writing the mapping relations of described widget visit information object and described widget button in the mapping table, unified button creating unit is the unified button response unit of described widget button binding.
4. method according to claim 1 is characterized in that, the toolbar configuration file of described widget plug-in unit comprises towards the application of single application exclusive widget toolbar configuration file with for the shared default widget toolbar configuration file of a plurality of application; The configuration information of wherein said widget toolbar configuration file comprises at least one in the display order of the icon file title of input parameter list of types, widget button of the display mode of the widget button name that will place, associated widget sign, associated widget, associated widget and widget button; Described widget visit information object is the object instance of widget visit information class, and the attribute of described widget visit information class comprises at least one in widget sign, widget window ID, widget window entrance function title, entrance function parameterized template and the context property tabulation.
5. method according to claim 1 is characterized in that, when described toolbar creating unit reads described widget toolbar configuration file, preferentially reads the widget toolbar configuration file related with described application program; If there is no related with described application program widget toolbar configuration file then reads default widget toolbar configuration file.
6. the method for a fast access widget is characterized in that, described method comprises:
According to any described method among the aforementioned claim 1-5, in application program, embed the widget toolbar;
Receive the button response message of the button triggering of the target widget on the described widget toolbar;
Obtain described widget visit information object, and described widget visit information object is sent to described widget engine agency;
Described widget engine agency generates the widget request according to described widget visit information object acquisition context data according to described widget visit information object and described context data; And described widget request sent to the widget engine; And
Described widget engine according to described widget request search described target widget, check described target widget state, and widget be presented at the top layer of screen.
7. method according to claim 6, it is characterized in that, described widget engine agency further comprises according to described widget visit information object acquisition context data: described widget engine agency obtains the context property tabulation from described widget visit information object, obtain described context data according to described context property from the interface of described application program; And
Described context data is converted to corresponding character string.
8. method according to claim 6 is characterized in that, receives the triggered response message of the stop push-button of described target widget, the show state before described widget engine reverts to described widget.
9. method according to claim 6, it is characterized in that described context data comprises: at least one in the text data of the title of described application program, current document title, the current document page number, current selection, current application the window's position or the current mouse position.
10. method according to claim 6 is characterized in that, described widget engine checks that described target widget state further comprises:
If described target widget does not install, then described widget engine returns miscue to described widget engine agency;
If described target widget does not trigger, then described widget engine triggers described target widget;
If described target widget triggers, then preserve the display status information of described target widget, wherein said display status information comprises: the size and the position of the display mode of described target widget, widget window.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010001171.8A CN102129364B (en) | 2010-01-14 | 2010-01-14 | Method for embedding widget toolbar in application program and rapid widget accessing method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010001171.8A CN102129364B (en) | 2010-01-14 | 2010-01-14 | Method for embedding widget toolbar in application program and rapid widget accessing method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102129364A true CN102129364A (en) | 2011-07-20 |
CN102129364B CN102129364B (en) | 2013-09-25 |
Family
ID=44267455
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201010001171.8A Active CN102129364B (en) | 2010-01-14 | 2010-01-14 | Method for embedding widget toolbar in application program and rapid widget accessing method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102129364B (en) |
Cited By (25)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102495734A (en) * | 2011-12-12 | 2012-06-13 | 方正国际软件有限公司 | Inheritable toolbar system and achieving method thereof |
CN102622176A (en) * | 2012-02-24 | 2012-08-01 | 青岛海信移动通信技术股份有限公司 | Processing method and device of application program operation interface |
CN102902580A (en) * | 2011-07-26 | 2013-01-30 | 腾讯科技(深圳)有限公司 | Program callback method and device |
CN102938039A (en) * | 2011-09-09 | 2013-02-20 | 微软公司 | Selective file access for applications |
CN103034477A (en) * | 2011-09-29 | 2013-04-10 | 北京新媒传信科技有限公司 | Component-based open architecture model implementation method |
CN103135969A (en) * | 2011-11-26 | 2013-06-05 | 华为技术有限公司 | Method and device of operating, generating and starting application program |
CN103309695A (en) * | 2012-03-15 | 2013-09-18 | 腾讯科技(深圳)有限公司 | Icon loading method and terminal |
CN103970404A (en) * | 2013-02-04 | 2014-08-06 | 联想(北京)有限公司 | Information processing method and information processing device |
CN105589682A (en) * | 2014-10-22 | 2016-05-18 | Tcl集团股份有限公司 | Firefox OS based widget information display method and apparatus |
CN105700886A (en) * | 2016-01-14 | 2016-06-22 | 腾讯科技(北京)有限公司 | Display method and terminal of plug-in interface |
CN105872708A (en) * | 2015-12-30 | 2016-08-17 | 乐视致新电子科技(天津)有限公司 | Display desktop generation method, display desktop generation system and smart television |
CN106200874A (en) * | 2016-07-08 | 2016-12-07 | 北京金山安全软件有限公司 | Information display method and device and electronic equipment |
CN106227555A (en) * | 2016-07-08 | 2016-12-14 | 北京金山安全软件有限公司 | Information display method and device and electronic equipment |
CN106648925A (en) * | 2016-11-17 | 2017-05-10 | 捷开通讯(深圳)有限公司 | Mobile terminal and acquisition method of character string information thereof |
US9679130B2 (en) | 2011-09-09 | 2017-06-13 | Microsoft Technology Licensing, Llc | Pervasive package identifiers |
WO2017136985A1 (en) * | 2016-02-14 | 2017-08-17 | 中兴通讯股份有限公司 | Information accessing method and device |
CN107113334A (en) * | 2014-12-12 | 2017-08-29 | 阿贝尔环球国际有限公司 | Build the method for interactive digital catalogue and the computer-readable medium storing and interactive digital catalogue of application this method |
US9800688B2 (en) | 2011-09-12 | 2017-10-24 | Microsoft Technology Licensing, Llc | Platform-enabled proximity service |
CN107342992A (en) * | 2017-06-27 | 2017-11-10 | 努比亚技术有限公司 | A kind of System right management method, apparatus and computer-readable recording medium |
US9858247B2 (en) | 2013-05-20 | 2018-01-02 | Microsoft Technology Licensing, Llc | Runtime resolution of content references |
CN107833614A (en) * | 2017-10-26 | 2018-03-23 | 咪咕互动娱乐有限公司 | Energy monitoring method and device and storage medium |
US10356204B2 (en) | 2012-12-13 | 2019-07-16 | Microsoft Technology Licensing, Llc | Application based hardware identifiers |
CN110187916A (en) * | 2019-05-31 | 2019-08-30 | 四川长虹电器股份有限公司 | The method for generating Word document based on data configuration |
US10540215B2 (en) | 2017-07-07 | 2020-01-21 | Microsoft Technology Licensing, Llc | Interoperability between a host application and an embedded target application |
CN111813476A (en) * | 2020-06-30 | 2020-10-23 | 中天掌金(北京)科技有限公司 | Mobile banking application method based on android minus one screen |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9118686B2 (en) | 2011-09-06 | 2015-08-25 | Microsoft Technology Licensing, Llc | Per process networking capabilities |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080033917A1 (en) * | 2006-08-04 | 2008-02-07 | Chacha Search, Inc. | Macro programming for resources |
CN101216763A (en) * | 2008-01-17 | 2008-07-09 | 金蝶软件(中国)有限公司 | Personalized interface accomplishing method and system |
US20090044144A1 (en) * | 2007-08-06 | 2009-02-12 | Morris Robert P | Methods And Apparatus For Sharing User Interface Widget Annotations |
-
2010
- 2010-01-14 CN CN201010001171.8A patent/CN102129364B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080033917A1 (en) * | 2006-08-04 | 2008-02-07 | Chacha Search, Inc. | Macro programming for resources |
US20090044144A1 (en) * | 2007-08-06 | 2009-02-12 | Morris Robert P | Methods And Apparatus For Sharing User Interface Widget Annotations |
CN101216763A (en) * | 2008-01-17 | 2008-07-09 | 金蝶软件(中国)有限公司 | Personalized interface accomplishing method and system |
Non-Patent Citations (1)
Title |
---|
冉林仓: "使用Office插件向Office应用程序添加工具栏按钮和菜单项", 《电脑编程技巧与维护》 * |
Cited By (45)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9110738B2 (en) | 2011-07-26 | 2015-08-18 | Tencent Technology (Shenzhen) Company Limited | Method and apparatus for calling back a program |
CN102902580A (en) * | 2011-07-26 | 2013-01-30 | 腾讯科技(深圳)有限公司 | Program callback method and device |
WO2013013554A1 (en) * | 2011-07-26 | 2013-01-31 | 腾讯科技(深圳)有限公司 | Program callback method and device |
CN102902580B (en) * | 2011-07-26 | 2018-05-15 | 腾讯科技(深圳)有限公司 | A kind of program callback method and device |
CN102938039A (en) * | 2011-09-09 | 2013-02-20 | 微软公司 | Selective file access for applications |
US9773102B2 (en) | 2011-09-09 | 2017-09-26 | Microsoft Technology Licensing, Llc | Selective file access for applications |
US9679130B2 (en) | 2011-09-09 | 2017-06-13 | Microsoft Technology Licensing, Llc | Pervasive package identifiers |
US10469622B2 (en) | 2011-09-12 | 2019-11-05 | Microsoft Technology Licensing, Llc | Platform-enabled proximity service |
US9800688B2 (en) | 2011-09-12 | 2017-10-24 | Microsoft Technology Licensing, Llc | Platform-enabled proximity service |
CN103034477B (en) * | 2011-09-29 | 2016-06-29 | 北京新媒传信科技有限公司 | A kind of assembly type open architecture model implementation method |
CN103034477A (en) * | 2011-09-29 | 2013-04-10 | 北京新媒传信科技有限公司 | Component-based open architecture model implementation method |
CN107577505A (en) * | 2011-11-26 | 2018-01-12 | 华为技术有限公司 | Operation, generation, the method started and its device of application program |
CN103135969A (en) * | 2011-11-26 | 2013-06-05 | 华为技术有限公司 | Method and device of operating, generating and starting application program |
CN103135969B (en) * | 2011-11-26 | 2017-09-19 | 华为技术有限公司 | Operation, generation, the method started and its device of application program |
CN102495734A (en) * | 2011-12-12 | 2012-06-13 | 方正国际软件有限公司 | Inheritable toolbar system and achieving method thereof |
CN102622176A (en) * | 2012-02-24 | 2012-08-01 | 青岛海信移动通信技术股份有限公司 | Processing method and device of application program operation interface |
CN103309695A (en) * | 2012-03-15 | 2013-09-18 | 腾讯科技(深圳)有限公司 | Icon loading method and terminal |
CN103309695B (en) * | 2012-03-15 | 2017-12-08 | 腾讯科技(深圳)有限公司 | A kind of loading figure calibration method and terminal |
US10356204B2 (en) | 2012-12-13 | 2019-07-16 | Microsoft Technology Licensing, Llc | Application based hardware identifiers |
CN103970404B (en) * | 2013-02-04 | 2017-08-25 | 联想(北京)有限公司 | Information processing method and information processor |
CN107589888B (en) * | 2013-02-04 | 2021-05-18 | 联想(北京)有限公司 | Information processing method and information processing apparatus |
CN103970404A (en) * | 2013-02-04 | 2014-08-06 | 联想(北京)有限公司 | Information processing method and information processing device |
CN107589888A (en) * | 2013-02-04 | 2018-01-16 | 联想(北京)有限公司 | Information processing method and information processor |
US9858247B2 (en) | 2013-05-20 | 2018-01-02 | Microsoft Technology Licensing, Llc | Runtime resolution of content references |
CN105589682B (en) * | 2014-10-22 | 2020-02-21 | Tcl集团股份有限公司 | Firefox OS-based widget information display method and device |
CN105589682A (en) * | 2014-10-22 | 2016-05-18 | Tcl集团股份有限公司 | Firefox OS based widget information display method and apparatus |
CN107113334B (en) * | 2014-12-12 | 2021-04-27 | 阿贝尔环球国际有限公司 | Method for constructing interactive digital directory, computer readable recording medium and interactive digital directory using the same |
CN107113334A (en) * | 2014-12-12 | 2017-08-29 | 阿贝尔环球国际有限公司 | Build the method for interactive digital catalogue and the computer-readable medium storing and interactive digital catalogue of application this method |
CN105872708A (en) * | 2015-12-30 | 2016-08-17 | 乐视致新电子科技(天津)有限公司 | Display desktop generation method, display desktop generation system and smart television |
CN105700886A (en) * | 2016-01-14 | 2016-06-22 | 腾讯科技(北京)有限公司 | Display method and terminal of plug-in interface |
CN105700886B (en) * | 2016-01-14 | 2019-02-26 | 腾讯科技(北京)有限公司 | The display methods and terminal of plug-in interface |
WO2017136985A1 (en) * | 2016-02-14 | 2017-08-17 | 中兴通讯股份有限公司 | Information accessing method and device |
CN106227555B (en) * | 2016-07-08 | 2019-12-03 | 北京金山安全软件有限公司 | Information display method and device and electronic equipment |
CN106200874A (en) * | 2016-07-08 | 2016-12-07 | 北京金山安全软件有限公司 | Information display method and device and electronic equipment |
CN106227555A (en) * | 2016-07-08 | 2016-12-14 | 北京金山安全软件有限公司 | Information display method and device and electronic equipment |
CN106200874B (en) * | 2016-07-08 | 2019-09-06 | 北京金山安全软件有限公司 | Information display method and device and electronic equipment |
CN106648925B (en) * | 2016-11-17 | 2020-07-24 | 捷开通讯(深圳)有限公司 | Mobile terminal and method for acquiring character string information thereof |
CN106648925A (en) * | 2016-11-17 | 2017-05-10 | 捷开通讯(深圳)有限公司 | Mobile terminal and acquisition method of character string information thereof |
CN107342992A (en) * | 2017-06-27 | 2017-11-10 | 努比亚技术有限公司 | A kind of System right management method, apparatus and computer-readable recording medium |
US10540215B2 (en) | 2017-07-07 | 2020-01-21 | Microsoft Technology Licensing, Llc | Interoperability between a host application and an embedded target application |
CN107833614A (en) * | 2017-10-26 | 2018-03-23 | 咪咕互动娱乐有限公司 | Energy monitoring method and device and storage medium |
CN110187916A (en) * | 2019-05-31 | 2019-08-30 | 四川长虹电器股份有限公司 | The method for generating Word document based on data configuration |
CN110187916B (en) * | 2019-05-31 | 2022-09-02 | 四川长虹电器股份有限公司 | Method for generating Word document based on data configuration |
CN111813476A (en) * | 2020-06-30 | 2020-10-23 | 中天掌金(北京)科技有限公司 | Mobile banking application method based on android minus one screen |
CN111813476B (en) * | 2020-06-30 | 2024-04-05 | 中天掌金(北京)科技有限公司 | Mobile phone banking application method based on An Zhuofu one screen |
Also Published As
Publication number | Publication date |
---|---|
CN102129364B (en) | 2013-09-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102129364B (en) | Method for embedding widget toolbar in application program and rapid widget accessing method | |
US11288042B2 (en) | Systems and methods for programming mobile devices | |
US11403364B2 (en) | Method and terminal device for extracting web page content | |
CN101221556B (en) | Method and device for XML document analysis | |
US7426734B2 (en) | Facilitating presentation functionality through a programming interface media namespace | |
CN101192216B (en) | Static state page control and WEB server interaction accomplishing method and the WEB server | |
US20040046789A1 (en) | Extensible user interface (XUI) framework and development environment | |
CN103853543A (en) | Method used for quickly constructing forms in enterprise information system development process | |
US20100269093A1 (en) | Content Management System and Method for Generating Dynamic Applications | |
CN101860734A (en) | Method for implementing incremental transmission and display of dynamic images through AJAX | |
CN1758243A (en) | Method and system for retrieving dated content from a website | |
CN102693238A (en) | Widget application method and system and multimedia terminal | |
CN102446252A (en) | Method and device for showing off-limit files | |
US20040148354A1 (en) | Method and system for an extensible client specific mail application in a portal server | |
WO2007013280A1 (en) | Plug-in module execution method, browser execution method, mailer execution method, program, terminal device, and computer-readable recording medium containing page data | |
CN115525305A (en) | Data processing method, application starting method, device, computer equipment and storage medium | |
CN105117473A (en) | Information inquiry system based on Web and information inquiry method based on Web | |
US20040148338A1 (en) | Method and system for an extensible client specific address book application in a portal server | |
CN110020337A (en) | Web page processing method and Related product | |
Ballesteros et al. | O/live: Transparent Distribution, Persistence, and Partial Replication for Ubiquitous User Interfaces | |
CN116932126A (en) | Application embedding method, device, terminal, medium and program product | |
Albert et al. | A REST Framework for Dynamic Client Environments |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |