</li>
<li><a href="#show">Showing a Window and Setting the Focus</a>
</li>
- <li><a href="#pageurl">Setting the Page URL</a>
- </li>
<li><a href="#helper">Finding a Window</a>
</li>
<li><a href="#finalize">Finalizing the Application</a>
<p>Handle the key and mouse event.</p></li>
<li><a href="#show">Showing a Window and Setting the Focus</a>
<p>Show a window and set the focus.</p></li>
- <li><a href="#pageurl">Setting the Page URL</a>
- <p>Set the page URL.</p></li>
<li><a href="#helper">Finding a Window</a>
<p>Use the helper functions to find a window.</p></li>
<li><a href="#finalize">Finalizing the Application</a>
<p>The <span style="font-family: Courier New,Courier,monospace">void evas_object_show (Evas_Object *obj)</span> function makes the given <span style="font-family: Courier New,Courier,monospace">Evas</span> object visible.</p>
- <h2 id="pageurl" name="pageurl">Setting the Page URL</h2>
-
-<p>This example uses 2 helper functions for finding window structures. The first one, the <span style="font-family: Courier New,Courier,monospace">window_find_with_elm_window()</span> function, takes <span style="font-family: Courier New,Courier,monospace">elm_window</span> as an argument and returns a pointer to the <span style="font-family: Courier New,Courier,monospace">Browser_Window</span> object that the window is part of. The second one, the <span style="font-family: Courier New,Courier,monospace">window_find_with_ewk_view()</span> function, does the same with <span style="font-family: Courier New,Courier,monospace">ewk_view</span> passed as an argument. Both of them use the <span style="font-family: Courier New,Courier,monospace">EINA_LIST_FOREACH</span> macro to iterate over the windows list.</p>
-
-<pre class="prettyprint">
-char *url_from_user_input(const char *arg)
-{
- // If it is already a URL, return the argument as is
- if (has_scheme(arg) || !strcasecmp(arg, "about:blank"))
- return strdup(arg);
-
- Eina_Strbuf *buf = eina_strbuf_manage_new(eina_file_path_sanitize(arg));
-
- // Check whether the path exists
- if (ecore_file_exists(eina_strbuf_string_get(buf)))
- {
- // File exists, convert local path to a URL
- eina_strbuf_prepend(buf, "file://");
- }
- else
- {
- // The path does not exist, convert it to a URL by
- // prepending http:// scheme:
- // www.google.com -> http://www.google.com
- eina_strbuf_string_free(buf);
- eina_strbuf_append_printf(buf, "http://%s", arg);
- }
- char *url = eina_strbuf_string_steal(buf);
- eina_strbuf_free(buf);
-
- return url;
-}
-</pre>
-
-<p>The body of the <span style="font-family: Courier New,Courier,monospace">has_scheme()</span> function used in the previous code can be found here:</p>
-
-<pre class="prettyprint">
-Eina_Bool has_scheme(const char *url)
-{
- return !!strstr(url, "://");
-}
-</pre>
-
<h2 id="helper" name="helper">Finding a Window</h2>
<p>This example uses 2 helper functions for finding window structures. The first one, the <span style="font-family: Courier New,Courier,monospace">window_find_with_elm_window()</span> function, takes <span style="font-family: Courier New,Courier,monospace">elm_window</span> as an argument and returns a pointer to the <span style="font-family: Courier New,Courier,monospace">Browser_Window</span> object that the window is part of. The second one, the <span style="font-family: Courier New,Courier,monospace">window_find_with_ewk_view()</span> function, does the same for <span style="font-family: Courier New,Courier,monospace">ewk_view</span>. Both of them use the <span style="font-family: Courier New,Courier,monospace">EINA_LIST_FOREACH</span> macro to iterate over the windows list.</p>