diff options
author | portix <portix@gmx.net> | 2011-06-23 00:44:50 +0200 |
---|---|---|
committer | portix <portix@gmx.net> | 2011-06-23 00:44:50 +0200 |
commit | a7702cab96a8828d5be9bfe59f9c990deafeb307 (patch) | |
tree | 084ca22145dadf7424ec1305306c3f5b3ac60796 /src/html.c | |
parent | 89dd8840f42bd858fac4ae3e499801efa7db748a (diff) | |
download | dwb-a7702cab96a8828d5be9bfe59f9c990deafeb307.zip |
Replace defines by enums, starting branch new_keys
--HG--
branch : new_keys
Diffstat (limited to 'src/html.c')
-rw-r--r-- | src/html.c | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -5,6 +5,7 @@ #define INFO_FILE "info.html" #define SETTINGS_FILE "settings.html" #define HEAD_FILE "head.html" +#define KEY_FILE "keys.html" typedef struct _HtmlTable HtmlTable; @@ -20,11 +21,13 @@ void dwb_html_bookmarks(WebKitWebView *, HtmlTable *); void dwb_html_history(WebKitWebView *, HtmlTable *); void dwb_html_quickmarks(WebKitWebView *, HtmlTable *); void dwb_html_settings(WebKitWebView *, HtmlTable *); +void dwb_html_keys(WebKitWebView *, HtmlTable *); static HtmlTable table[] = { { "dwb://bookmarks", "Bookmarks", INFO_FILE, 0, dwb_html_bookmarks }, { "dwb://quickmarks", "Quickmarks", INFO_FILE, 0, dwb_html_quickmarks }, { "dwb://history", "History", INFO_FILE, 0, dwb_html_history }, + { "dwb://keys", "Keys", KEY_FILE, 0, dwb_html_keys }, //{ "dwb://settings", "Settings", SETTINGS_FILE, 0, dwb_html_settings }, }; @@ -71,7 +74,24 @@ dwb_html_history(WebKitWebView *wv, HtmlTable *table) { } void dwb_html_settings(WebKitWebView *wv, HtmlTable *table) { - dwb_html_load_page(wv, table, "blub"); + //dwb_html_load_page(wv, table, "blub"); +} +void +dwb_html_keys_load_cb(WebKitWebView *wv, GParamSpec *p, HtmlTable *table) { + PRINT_DEBUG("url: %s", webkit_web_view_get_uri(wv)); + if (webkit_web_view_get_load_status(wv) == WEBKIT_LOAD_FINISHED) { + WebKitDOMDocument *doc = webkit_web_view_get_dom_document(wv); + WebKitDOMElement *panel = webkit_dom_document_get_element_by_id(doc, "panel"); + if (panel) + puts(webkit_dom_element_get_attribute(panel, "innerHTML")); + g_signal_handlers_disconnect_by_func(wv, dwb_html_keys_load_cb, table); + } + +} +void +dwb_html_keys(WebKitWebView *wv, HtmlTable *table) { + g_signal_connect(wv, "notify::load-status", G_CALLBACK(dwb_html_keys_load_cb), table); + dwb_html_load_page(wv, table, "blaljlkfds"); } void dwb_html_quickmarks(WebKitWebView *wv, HtmlTable *table) { |