mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-02 10:11:05 -08:00
more navigation signals work
This commit is contained in:
parent
b534f59a20
commit
1722eccee3
2 changed files with 42 additions and 28 deletions
|
|
@ -1144,6 +1144,8 @@ anyway, seems it'll turn out like this:
|
|||
we need the event handler at some level because we can't call lisp
|
||||
asynchronously.
|
||||
|
||||
**** TODO navigation signal
|
||||
**** TODO new window signal
|
||||
*** TODO console messages
|
||||
http://webkitgtk.org/reference/webkitgtk-webkitwebview.html#WebKitWebView-console-message
|
||||
http://getfirebug.com/wiki/index.php/Console_API#console.count.28.5Btitle.5D.29
|
||||
|
|
@ -1241,15 +1243,24 @@ I made some delegation code frrom webkit mode to image mode.
|
|||
*** TODO internal links (page.html#section) do not work
|
||||
see xwidget-webkit-show-named-element
|
||||
|
||||
*** TODO sindicat notes
|
||||
Here are some comments from user "sindikat" and my replies
|
||||
|
||||
- site.com and http://site.com should be equivalent (simple site.com
|
||||
also did some preliminary webkit signal work for this
|
||||
*** TODO url-browse improvement
|
||||
sindikat: site.com and http://site.com should be equivalent (simple site.com
|
||||
throws error)
|
||||
|
||||
Yes, but its unclear at what level in Emacs to do this
|
||||
properly. I added a url-tidy function as a start.
|
||||
|
||||
this should be further improved:
|
||||
- change the call to url-tidy so its a hook
|
||||
- provide a couple of demonstration hooks:
|
||||
- url-tidy, which just prepends http://
|
||||
- youtube which appends &html5=1 to urls looking like http://www.youtube.com/watch?v=DZdUgjEx_dQ
|
||||
- history which logs all visited urls like a traditional browser
|
||||
|
||||
*** TODO sindicat notes
|
||||
Here are some comments from user "sindikat" and my replies
|
||||
|
||||
- http://ya.ru renders inadequatly (compare with any other browser) -
|
||||
the search text-input is way below
|
||||
|
||||
|
|
|
|||
|
|
@ -453,28 +453,34 @@ gboolean webkit_osr_key_event_callback (GtkWidget *widget, GdkEventKey *event, g
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
void store_xwidget_event_string(struct xwidget* xw, char* eventname,char* eventstr){
|
||||
//refactor attempt
|
||||
struct input_event event;
|
||||
EVENT_INIT (event);
|
||||
event.kind = XWIDGET_EVENT;
|
||||
event.frame_or_window = Qnil; //frame; //how to get the frame here? //TODO i store it in the xwidget now
|
||||
|
||||
event.arg = Qnil;
|
||||
event.arg = Fcons (intern (eventstr), event.arg); //intern?
|
||||
event.arg = Fcons ((Lisp_Object)xw, event.arg); //TODO
|
||||
event.arg = Fcons (intern (eventname), event.arg);//interning should be ok
|
||||
kbd_buffer_store_event (&event);
|
||||
|
||||
}
|
||||
|
||||
//TODO deprecated, use load-status
|
||||
void webkit_osr_document_load_finished_callback (WebKitWebView *webkitwebview,
|
||||
WebKitWebFrame *arg1,
|
||||
gpointer data)
|
||||
{
|
||||
//TODO this event sending code should be refactored
|
||||
struct input_event event;
|
||||
// struct xwidget *xw = (struct xwidget *) data;
|
||||
struct xwidget* xw = (struct xwidget*) g_object_get_data (G_OBJECT (webkitwebview), XG_XWIDGET);
|
||||
printf("webkit finished loading\n");
|
||||
|
||||
EVENT_INIT (event);
|
||||
event.kind = XWIDGET_EVENT;
|
||||
event.frame_or_window = Qnil; //frame; //how to get the frame here? //TODO i store it in the xwidget now
|
||||
|
||||
event.arg = Qnil;
|
||||
event.arg = Fcons ((Lisp_Object)xw, event.arg); //TODO
|
||||
event.arg = Fcons (intern ("document-load-finished"), event.arg);
|
||||
|
||||
|
||||
kbd_buffer_store_event (&event);
|
||||
|
||||
store_xwidget_event_string(xw, "",
|
||||
"document-load-finished");
|
||||
}
|
||||
|
||||
gboolean webkit_osr_download_callback (WebKitWebView *webkitwebview,
|
||||
|
|
@ -488,18 +494,7 @@ gboolean webkit_osr_download_callback (WebKitWebView *webkitwebview,
|
|||
struct xwidget* xw = (struct xwidget*) g_object_get_data (G_OBJECT (webkitwebview), XG_XWIDGET);
|
||||
printf("webkit finished loading\n");
|
||||
|
||||
EVENT_INIT (event);
|
||||
event.kind = XWIDGET_EVENT;
|
||||
event.frame_or_window = Qnil; //frame; //how to get the frame here? //TODO i store it in the xwidget now
|
||||
|
||||
event.arg = Qnil;
|
||||
event.arg = Fcons (intern (webkit_download_get_uri (arg1)), event.arg);
|
||||
event.arg = Fcons ((Lisp_Object)xw, event.arg); //TODO
|
||||
event.arg = Fcons (intern ("download-requested"), event.arg);
|
||||
|
||||
|
||||
kbd_buffer_store_event (&event);
|
||||
|
||||
store_xwidget_event_string(xw, webkit_download_get_uri (arg1), "download-requested");
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -512,6 +507,8 @@ gboolean webkit_osr_mime_type_policy_typedecision_requested_callback(WebKitWebV
|
|||
gpointer user_data)
|
||||
{
|
||||
printf("mime policy requested\n");
|
||||
// this function makes webkit send a download signal for all unknown mime types
|
||||
// TODO defer the decision to lisp, so that its possible to make Emacs handle text mime for instance
|
||||
if(!webkit_web_view_can_show_mime_type(webView, mimetype)){
|
||||
webkit_web_policy_decision_download (policy_decision);
|
||||
return TRUE;
|
||||
|
|
@ -528,9 +525,12 @@ gboolean webkit_osr_new_window_policy_decision_requested_callback(WebKitWebView
|
|||
WebKitWebPolicyDecision *policy_decision,
|
||||
gpointer user_data)
|
||||
{
|
||||
struct xwidget* xw = (struct xwidget*) g_object_get_data (G_OBJECT (webView), XG_XWIDGET);
|
||||
printf("webkit_osr_new_window_policy_decision_requested_callback %s\n",
|
||||
webkit_web_navigation_action_get_original_uri (navigation_action));
|
||||
|
||||
store_xwidget_event_string(xw, webkit_web_navigation_action_get_original_uri (navigation_action),
|
||||
"new-window-policy-decision-requested");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -541,8 +541,11 @@ gboolean webkit_osr_navigation_policy_decision_requested_callback(WebKitWebView
|
|||
WebKitWebPolicyDecision *policy_decision,
|
||||
gpointer user_data)
|
||||
{
|
||||
struct xwidget* xw = (struct xwidget*) g_object_get_data (G_OBJECT (webView), XG_XWIDGET);
|
||||
printf("webkit_osr_navigation_policy_decision_requested_callback %s\n",
|
||||
webkit_web_navigation_action_get_original_uri (navigation_action));
|
||||
store_xwidget_event_string(xw, webkit_web_navigation_action_get_original_uri (navigation_action),
|
||||
"navigation-policy-decision-requested");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue