wiki:EFLFrameApiTutorial

Ewk_frame.h



Introduction


When using an application such as a browser to visualize some web content, firstly an User Interface is needed in order to provide the functionalities and interactions the user may have with. In this way, such application displays a main frame which purpose is to contain different elements on the window and, of course, a second frame in which web content will be showed and the user can interact directly with web elements.

So, for this case, the purpose of Ewk_Frame.h and Ewk_frame_private.h libraries is to provide functions to work with when displaying html content in a browser is needed.



Dependencies


On the figure below, the libraries needed in Ewk_frame.h and Ewk_frame_private.h are shown to give an idea about which files must be included in those dependencies.

http://archivospao.vacau.com/tutorial/figure1.png

First, it is important to know that these modules have dependencies within ewk_view.h & ewk_view.cpp since the view is the outside part of the application which will contain two frames (as it is handle in such an application for browser): the main frame including menu bars and the main html frame (the role of Ewk_frame).



Content


To start with the explanation about the use, first we have to know some of the functions can be used from these libraries in order to make an implementation of them. For this explanation, the most important functions will be handled to give an idea about this and which modules are needed as well.



How does it work?


Once we have considered this, it is possible to focus on how functions work. Each function of these libraries has one common argument: Evas_Object * o. This object represents such a frame where events, content, and information are displayed (according to the html frame for the browser).

Examples of definitions of functions:
EAPI Eina_Bool ewk_frame_stop(Evas_Object *o);
EAPI Eina_Bool ewk_frame_reload(Evas_Object *o);
EAPI Eina_Bool ewk_frame_reload_full(Evas_Object *o);
EAPI Eina_Bool ewk_frame_back(Evas_Object *o);
EAPI Eina_Bool ewk_frame_forward(Evas_Object *o);

It is important to mention that Ewk_view has two main frames: the one that is part of the application running on the OS and the second one that is for the Html content. In this case, by using functions belonging to the view library, it is easy to know how some functions are used, by just calling the function from the view and passing just one of their frames to perform some of the functions commonly used for html content on the frame.

http://archivospao.vacau.com/tutorial/figure2.png
http://archivospao.vacau.com/tutorial/figure3.png

The above image describes that according to the common functionalities to go backward or forward in the history depending on the visited web sites, we can go through this list by using the frame for the html and the functions such as back or forward.

http://archivospao.vacau.com/tutorial/figure4.png

After defining a URI, which will be the resource searched by the browser to display its content, we can see that the same functions are involved inside the View as follows:

http://archivospao.vacau.com/tutorial/figure5.png

And as it was defined above on the browserCreate(“http://www.google.com”, app->userArgs) function (Figure 1.5), this is the URI needed for the browser to start searching. An example of it can be like follows:

http://archivospao.vacau.com/tutorial/figure6.png


More Information ==

Main Frame
Begining with the functions about the frame it is important to notice that all the functions are implemented on the WebCore:: which enables to respond to events (mouse, keyboard), elements when rendering the html page (loaders, displayers) and some other elements that allows us to get functionality.

There are some basic steps to consider using this library. Most of this, is based on some examples provided by the WebKit source code and were analysed enough to understand the sequence of the browser's steps.

So, firstly, we have to create a frame that will contain both menu bars with buttons for the interaction with the user and the interface and the html frame to display content. So, a URI can be specified to reach the resource or waits until the user enters the URI(on the URI bar). Once it happened, the frame's functions such as load_content must perform its behaviour. Considering user's options to stop, reload or change uri, the external/internal frame must have communication (Ewk_view) holding this frames to show the changes. When the content is displayed, some events are implemented in order to response to some actions inside the internal frame to manipulate it.

By using an special type of data (depends on Evas library) is possible to store and retrieve information about the history or records from the visited uri's, (unless the private navigation is activated which does not allow to store information while browsing) and here is when appears those functions such as, backward, forward, navigation, etc.

There are other concepts called signals which are useful for transmission of notifications due to certain kind of behaviour to let the user know about it through the main view, and all this signals may occur, most of the times, when an error is produced when loading the page.

Last modified 4 years ago Last modified on Jan 22, 2013 5:03:03 PM