CLOSED: [2011-07-19 Tue 14:26]
now we just hard code sizes. but webkit widgets for instance can
report sizes that suit the content. support that.
-** TODO BUG xwidget view ghosts
+** DONE BUG xwidget view ghosts
+ CLOSED: [2013-04-05 Fri 23:35]
+(havent seen this in quite a while)
- xwidget-webkit-browse-url somewhere
- split window.
now theres 2 webkit views
turned out to be not so hard, captured events, copied them and
forwarded them offscreen!
-** TODO investigate gdk_window_redirect_to_drawable
+** CANCELLED investigate gdk_window_redirect_to_drawable
+ CLOSED: [2013-04-05 Fri 23:37]
+(cancelled this, the current approach seems okay)
http://developer.gnome.org/gdk/stable/gdk-Windows.html#gdk-offscreen-window-set-embedder
maybe could be used in place of my own copy hacks? to work it must
support a chain of redirects, which seems unlikely. the benefit would
might be some annoying local issues with my install because it is not
reliably reproducible. (went away during merges)
-** TODO low impact xwidget based image viewer
+** CANCELLED low impact xwidget based image viewer
+ CLOSED: [2013-04-05 Fri 23:38]
+(cancelled this because it no longer seems like a good idea)
for instance to render SVG using webkit, or some other canvas.
that way it would be possible to merge to trunk in stages.
references(mostly views) the xwidget should be garbage collected.
special finalization would go into gc_sweep()
-<<<<<<< TREE
** TODO embedding evince
http://developer.gnome.org/libevview/3.2/libevview-ev-view.html
would be useful for reading PDF:s and other document types.
xwgir methods, emacs crashes.
+** TODO investigate gdk_offscreen_window_set_embedder()
+https://developer.gnome.org/gdk/unstable/gdk-Windows.html
+
+,----
+| Offscreen windows are more general than composited windows, since they
+| allow not only to modify the rendering of the child window onto its
+| parent, but also to apply coordinate transformations.
+|
+| To integrate an offscreen window into a window hierarchy, one has to
+| call gdk_offscreen_window_set_embedder() and handle a number of
+| signals. The "pick-embedded-child" signal on the embedder window is
+| used to select an offscreen child at given coordinates, and the
+| "to-embedder" and "from-embedder" signals on the offscreen window are
+| used to translate coordinates between the embedder and the offscreen
+| window.
+|
+| For rendering an offscreen window onto its embedder, the contents of
+| the offscreen window are available as a pixmap, via
+| gdk_offscreen_window_get_pixmap().
+`----
+
+okay, [2013-04-03 Wed] I finally suceeded in this approach!
+it was pretty hard to make it work and currently works like this:
+- the on screen dravwing area is the embedder
+- you must implement "pick child"
+event forwarding is done automatically!
+
+BUT its not really super, because it only works well with a single
+embedder.
+
+perhaps the strategy could be refined:
+- the window frame would be the embedder for all xwidgets. (but what
+ about several frames then?)
+- in the from-embedder signal handler, which maps container coords to
+ embedded widget coords, find out which xw-view i clicked on, and
+ compute the coords.
+
+[2013-04-04 Thu] I had a strategy working for a xwgir button but not
+a webkit. set_embedded in the motion event handler for the xv. it
+even works for 2 frames! but not webkit :(
+
+[2013-04-05 Fri] it works for xwgir osr components, but not for
+webkit. Webkit retains the previous event forwarding system.
+
+Now it works like this:
+- the offscreen widget is created as before
+- the on-screen views also as before, painting and copying as before.
+- gdk_offscreen_window_set_embedder() is now used to embedd the
+ offscreen widget in the onscreen one, upon view creation
+- only one widget can embedd one other. This means that the embedding
+ widget must be switched between the onscreen ones. This is now done
+ in the mouse motion event handler.
+
+The above approach has been tested for xwgir created buttons and seems
+to work. it doesnt work for webkit, so the old scheme is preserved
+for webkit.
xw->widget_osr = xwgir_create( SDATA(Fcar(Fcdr(Fget(xw->type, Qcxwgir_class)))),
SDATA(Fcar(Fget(xw->type, Qcxwgir_class))));
- ///debug xwgir
- /* gdk_offscreen_window_set_embedder ( gtk_widget_get_window (xw->widget_osr), */
- /* gtk_widget_get_window (GTK_WIDGET (xw->widgetwindow_osr)) */
- /* ); */
- ///
gtk_widget_set_size_request (GTK_WIDGET (xw->widget_osr), xw->width, xw->height);
gtk_container_add (xw->widgetwindow_osr, xw->widget_osr);
/* signals */
g_signal_connect (G_OBJECT ( xw->widgetwindow_osr), "damage-event", G_CALLBACK (xwidget_osr_damage_event_callback), NULL);
- //TODO these were just a test hack
- /* g_signal_connect (G_OBJECT ( xw->widget_osr), "key-press-event", G_CALLBACK (webkit_osr_key_event_callback), NULL); */
- /* g_signal_connect (G_OBJECT ( xw->widget_osr), "key-release-event", G_CALLBACK (webkit_osr_key_event_callback), NULL); */
if (EQ(xw->type, Qwebkit_osr)){
g_signal_connect (G_OBJECT ( xw->widget_osr),
}
#endif
- /* if (EQ(xw->type, Qsocket_osr)){ */
- /* printf("init socket osr\n"); */
- /* block_input(); */
- /* xw->widgetwindow_osr = GTK_CONTAINER (gtk_offscreen_window_new ()); */
- /* gtk_window_resize( GTK_WINDOW(xw->widgetwindow_osr), xw->width, xw->height); */
-
- /* //////////////////// */
- /* //xw->widget_osr = webkit_web_view_new(); */
- /* xw->widget_osr = gtk_socket_new(); */
- /* //g_signal_connect_after(xv->widget, "plug-added", G_CALLBACK(xwidget_plug_added), "plug added"); */
- /* //g_signal_connect_after(xv->widget, "plug-removed", G_CALLBACK(xwidget_plug_removed), "plug removed"); */
- /* /////////////////// */
-
- /* gtk_widget_set_size_request (GTK_WIDGET (xw->widget_osr), xw->width, xw->height); */
- /* gtk_container_add (xw->widgetwindow_osr, xw->widget_osr); */
-
- /* gtk_widget_show_all (GTK_WIDGET (xw->widgetwindow_osr)); */
-
- /* /\* store some xwidget data in the gtk widgets for convenient retrieval in the event handlers. *\/ */
- /* g_object_set_data (G_OBJECT (xw->widget_osr), XG_XWIDGET, (gpointer) (xw)); */
- /* g_object_set_data (G_OBJECT (xw->widgetwindow_osr), XG_XWIDGET, (gpointer) (xw)); */
- /* g_signal_connect (G_OBJECT ( xw->widgetwindow_osr), "damage-event", G_CALLBACK (xwidget_osr_damage_event_callback), NULL); */
-
- /* //webkit_web_view_load_uri(WEBKIT_WEB_VIEW(xw->widget_osr), "http://www.fsf.org"); */
- /* unblock_input(); */
-
- /* } */
-
-
- /* ////////////////////////////// */
- /* gtk_widget_set_size_request (GTK_WIDGET (xw->widget_osr), xw->width, xw->height); */
- /* gtk_container_add (xw->widgetwindow_osr, xw->widget_osr); */
-
- /* gtk_widget_show_all (GTK_WIDGET (xw->widgetwindow_osr)); */
-
- /* /\* store some xwidget data in the gtk widgets for convenient retrieval in the event handlers. *\/ */
- /* g_object_set_data (G_OBJECT (xw->widget_osr), XG_XWIDGET, (gpointer) (xw)); */
- /* g_object_set_data (G_OBJECT (xw->widgetwindow_osr), XG_XWIDGET, (gpointer) (xw)); */
- /* /\* signals *\/ */
- /* g_signal_connect (G_OBJECT ( xw->widgetwindow_osr), "damage-event", G_CALLBACK (xwidget_osr_damage_event_callback), NULL); */
- /* g_signal_connect (G_OBJECT ( xw->widget_osr), "button-press-event", G_CALLBACK (xwgir_event_callback), xw); */
-
-
- /* unblock_input(); */
- /* } */
-
- ////////////////////////////////////////////////////////
-
-
-
UNGCPRO;
return val;
}