unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#22602: Patch to enable webgl and javascript debug on xwidget-webkit
@ 2016-02-08 20:57 anderson.marco
  2020-08-12 12:09 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: anderson.marco @ 2016-02-08 20:57 UTC (permalink / raw)
  To: 22602


[-- Attachment #1.1: Type: text/plain, Size: 212 bytes --]

Webkit in emacs 25.0.90 haven't supports  webgl and javascript debug. I
makes a  patch short to correct this problem.  This patch is annexed in
this email.
Forgive my english. I just know write a little english.

[-- Attachment #1.2: Type: text/html, Size: 261 bytes --]

[-- Attachment #2: inspectHtmlJavascripAndSuportToWebgl.patch --]
[-- Type: text/x-patch, Size: 3917 bytes --]

diff -rupN emacsOld/emacs-emacs-25.0.90/src/xwidget.c emacs-emacs-25.0.90/src/xwidget.c
--- emacsOld/emacs-emacs-25.0.90/src/xwidget.c	2016-01-30 13:00:54.000000000 -0200
+++ emacs-emacs-25.0.90/src/xwidget.c	2016-02-08 18:05:11.258102623 -0200
@@ -215,6 +215,12 @@ Returns the newly constructed xwidget, o
 	     GTK_POLICY_ALWAYS, GTK_POLICY_ALWAYS);
 
           xw->widget_osr = webkit_web_view_new ();
+          WebKitWebSettings *settings =webkit_web_view_get_settings (WEBKIT_WEB_VIEW(xw->widget_osr));
+
+          g_object_set (G_OBJECT(settings), "enable-webgl", TRUE, NULL);
+          g_object_set (G_OBJECT(settings), "enable-developer-extras",TRUE,NULL);         
+          WebKitWebInspector *webKitWebInspector = webkit_web_view_get_inspector (WEBKIT_WEB_VIEW(xw->widget_osr));
+          g_signal_connect (G_OBJECT (webKitWebInspector), "inspect-web-view", G_CALLBACK(inspect_web_view), NULL);        
           gtk_container_add (GTK_CONTAINER (xw->widgetscrolledwindow_osr),
                              GTK_WIDGET (WEBKIT_WEB_VIEW (xw->widget_osr)));
         }
@@ -362,6 +368,32 @@ store_xwidget_event_string (struct xwidg
   kbd_buffer_store_event (&event);
 }
 
+
+WebKitWebView* inspect_web_view(WebKitWebInspector *web_inspector, 
+                                WebKitWebView      *web_view, gpointer user_data)
+
+{
+  GtkWidget *gtk_window_inspect= gtk_window_new (GTK_WINDOW_TOPLEVEL);
+  GtkWidget *gtk_scrolled_window_inspect= gtk_scrolled_window_new (NULL, NULL);
+
+  gtk_window_set_resizable (GTK_WINDOW(gtk_window_inspect),TRUE);
+  //gtk_window_set_modal (GTK_WINDOW(gtk_window_inspect),TRUE);
+  gtk_window_set_default_size (GTK_WINDOW(gtk_window_inspect),750,320);
+  gtk_window_set_decorated (GTK_WINDOW(gtk_window_inspect),TRUE);
+  gtk_window_set_keep_above (GTK_WINDOW(gtk_window_inspect),TRUE);
+  gtk_window_set_skip_taskbar_hint (GTK_WINDOW(gtk_window_inspect),FALSE);
+  gtk_window_set_destroy_with_parent (GTK_WINDOW(gtk_window_inspect),TRUE);
+  g_object_set (G_OBJECT(gtk_window_inspect), "javascript-profiling-enabled",TRUE,NULL);
+  g_object_set (G_OBJECT(gtk_window_inspect), "timeline-profiling-enabled",TRUE,NULL);            
+  GtkWidget * web_view_inspect= webkit_web_view_new ();
+  gtk_widget_show(web_view_inspect);
+  gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW (gtk_scrolled_window_inspect),web_view_inspect);
+  gtk_widget_show(gtk_scrolled_window_inspect);
+  gtk_container_add (GTK_CONTAINER (gtk_window_inspect),  gtk_scrolled_window_inspect);
+  gtk_widget_show(gtk_window_inspect);
+  return WEBKIT_WEB_VIEW(web_view_inspect);
+}
+
 /* TODO deprecated, use load-status.  */
 void
 webkit_document_load_finished_cb (WebKitWebView *webkitwebview,
diff -rupN emacsOld/emacs-emacs-25.0.90/src/xwidget.h emacs-emacs-25.0.90/src/xwidget.h
--- emacsOld/emacs-emacs-25.0.90/src/xwidget.h	2016-01-30 13:00:54.000000000 -0200
+++ emacs-emacs-25.0.90/src/xwidget.h	2016-02-08 17:25:41.853960914 -0200
@@ -30,7 +30,8 @@ struct window;
 
 #ifdef HAVE_XWIDGETS
 # include <gtk/gtk.h>
-
+#include <webkit/webkitwebview.h>
+#include <webkit/webkitwebinspector.h>
 struct xwidget
 {
   struct vectorlike_header header;
@@ -57,7 +58,7 @@ struct xwidget
   GtkWidget *widgetwindow_osr;
 
   /* Used if the widget (webkit) is to be wrapped in a scrolled window.  */
-  GtkWidget *widgetscrolledwindow_osr;
+  GtkWidget *widgetscrolledwindow_osr; 
 
   /* Kill silently if Emacs is exited.  */
   bool_bf kill_without_query : 1;
@@ -118,6 +119,7 @@ void x_draw_xwidget_glyph_string (struct
 struct xwidget *lookup_xwidget (Lisp_Object spec);
 void xwidget_end_redisplay (struct window *, struct glyph_matrix *);
 void kill_buffer_xwidgets (Lisp_Object);
+WebKitWebView* inspect_web_view(WebKitWebInspector *web_inspector, WebKitWebView      *web_view, gpointer user_data); //kite0101
 #else
 INLINE_HEADER_BEGIN
 INLINE void syms_of_xwidget (void) {}

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#22602: Patch to enable webgl and javascript debug on xwidget-webkit
  2016-02-08 20:57 bug#22602: Patch to enable webgl and javascript debug on xwidget-webkit anderson.marco
@ 2020-08-12 12:09 ` Lars Ingebrigtsen
  2020-09-14 15:05   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-12 12:09 UTC (permalink / raw)
  To: anderson.marco; +Cc: 22602

(I'm going through old bug reports that unfortunately got no response at
the time.)

"anderson.marco" <anderson.marco@gmail.com> writes:

> Webkit in emacs 25.0.90 haven't supports  webgl and javascript debug. I makes a 
> patch short to correct this problem.  This patch is annexed in this email. 
> Forgive my english. I just know write a little english. 

This was more than four years ago, and there's been a large number of
changes to the xwidget code in Emacs, so the patch no longer applies.

> +          WebKitWebSettings *settings =webkit_web_view_get_settings (WEBKIT_WEB_VIEW(xw->widget_osr));
> +
> +          g_object_set (G_OBJECT(settings), "enable-webgl", TRUE, NULL);
> +          g_object_set (G_OBJECT(settings), "enable-developer-extras",TRUE,NULL);         

So I wonder whether this is still something that's necessary?  It's
surprising to me that webkit doesn't enable webgl by default, for instance.

> +WebKitWebView* inspect_web_view(WebKitWebInspector *web_inspector, 
> +                                WebKitWebView      *web_view, gpointer user_data)

Also -- how is this inspect_web_view function supposed to be used?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#22602: Patch to enable webgl and javascript debug on xwidget-webkit
  2020-08-12 12:09 ` Lars Ingebrigtsen
@ 2020-09-14 15:05   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2020-09-14 15:05 UTC (permalink / raw)
  To: anderson.marco; +Cc: 22602

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> +WebKitWebView* inspect_web_view(WebKitWebInspector *web_inspector, 
>> + WebKitWebView *web_view, gpointer user_data)
>
> Also -- how is this inspect_web_view function supposed to be used?

This was five weeks ago, and there was no response, so I'm closing this
bug report.  If progress can be made, please respond to the debbugs
mail address, and we'll reopen the bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-14 15:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-08 20:57 bug#22602: Patch to enable webgl and javascript debug on xwidget-webkit anderson.marco
2020-08-12 12:09 ` Lars Ingebrigtsen
2020-09-14 15:05   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).