Introduction
Introduction Statistics Contact Development Disclaimer Help
tremoved unneeded event listeners and reworked file opener. - surf - customized…
git clone git://src.adamsgaard.dk/surf
Log
Files
Refs
README
LICENSE
---
commit bc5d280efefa23ebe0425a5f3de781194c2f94fc
parent da509312df9de31a0de5e90387884cbfc4ef42e7
Author: Enno Boland (Gottox) <[email protected]>
Date: Fri, 5 Jun 2009 18:00:45 +0200
removed unneeded event listeners and reworked file opener.
Diffstat:
M surf.c | 33 ++++++++++++-----------------…
1 file changed, 13 insertions(+), 20 deletions(-)
---
diff --git a/surf.c b/surf.c
t@@ -87,20 +87,24 @@ loadfile(gchar *f) {
GIOChannel *c = NULL;
GError *e = NULL;
GString *code = g_string_new("");
+ GString *uri = g_string_new(f);
gchar *line;
/* cannot use fileno in c99 - workaround*/
- if(strcmp(f, "-") == 0)
+ if(strcmp(f, "-") == 0) {
c = g_io_channel_unix_new(STDIN_FILENO);
- else
- c = g_io_channel_new_file(f, "r", NULL);
- if (c) {
- while(g_io_channel_read_line(c, &line, NULL, NULL, &e) == G_IO…
- g_string_append(code, line);
- g_free(line);
+ if (c) {
+ while(g_io_channel_read_line(c, &line, NULL, NULL, &e)…
+ g_string_append(code, line);
+ g_free(line);
+ }
+ webkit_web_view_load_html_string(view, code->str, NULL…
+ g_io_channel_shutdown(c, FALSE, NULL);
}
- webkit_web_view_load_html_string(view, code->str, NULL);
- g_io_channel_shutdown(c, FALSE, NULL);
+ }
+ else {
+ g_string_prepend(uri, "file://");
+ loaduri(uri->str);
}
}
t@@ -132,10 +136,6 @@ linkhover(WebKitWebView* page, const gchar* t, const gcha…
}
void
-loadstart(WebKitWebView *view, WebKitWebFrame *f, gpointer d) {
-}
-
-void
loadcommit(WebKitWebView *view, WebKitWebFrame *f, gpointer d) {
gchar *uri;
t@@ -148,11 +148,6 @@ loadcommit(WebKitWebView *view, WebKitWebFrame *f, gpoint…
}
void
-loadfinish(WebKitWebView *view, WebKitWebFrame *f, gpointer d) {
- /* ??? TODO */
-}
-
-void
progresschange(WebKitWebView* view, gint p, gpointer d) {
progress = p;
updatetitle();
t@@ -208,8 +203,6 @@ void setup(void) {
g_signal_connect(G_OBJECT(view), "title-changed", G_CALLBACK(titlechan…
g_signal_connect(G_OBJECT(view), "load-progress-changed", G_CALLBACK(p…
g_signal_connect(G_OBJECT(view), "load-committed", G_CALLBACK(loadcomm…
- g_signal_connect(G_OBJECT(view), "load-started", G_CALLBACK(loadstart)…
- g_signal_connect(G_OBJECT(view), "load-finished", G_CALLBACK(loadfinis…
g_signal_connect(G_OBJECT(view), "hovering-over-link", G_CALLBACK(link…
g_signal_connect(G_OBJECT(view), "new-window-policy-decision-requested…
g_signal_connect(G_OBJECT(view), "download-requested", G_CALLBACK(down…
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.