From 26b79791a30bbf4702d669d60e99ce09f2cf75b0 Mon Sep 17 00:00:00 2001 From: Joakim Verona Date: Tue, 12 Jul 2011 02:34:15 +0200 Subject: [PATCH] more configure support and cleanups. the gtk2 webkit support removed because offscreen rendering is too quirky there --- configure.in | 87 +++++++++++----------- src/Makefile.in | 8 ++ src/insdel.c | 2 - src/xdisp.c | 31 +------- src/xwidget-attic.c | 87 ++++++++++++++++++++++ src/xwidget.c | 174 ++++---------------------------------------- src/xwidget.h | 1 - 7 files changed, 159 insertions(+), 231 deletions(-) diff --git a/configure.in b/configure.in index b6b11ff4946..2cf33979585 100644 --- a/configure.in +++ b/configure.in @@ -1131,48 +1131,6 @@ AC_DEFUN([PKG_CHECK_MODULES], [ fi ]) -HAVE_XWIDGETS=no -HAVE_WEBKIT=no -HAVE_GOOCANVAS=no -HAVE_CLUTTER=no -if test "${with_xwidgets}" != "no"; then - echo "xwidgets enabled, checking webkit, and others" - HAVE_XWIDGETS=yes - AC_DEFINE(HAVE_XWIDGETS, 1, [Define to 1 if you have xwidgets support.]) -#xwidgets -#TODO -# - enable only if gtk/gtk3 enabled -# - webkit, goocanvas, clutter -# - only webkit_osr is good so remove plain webkit laterish - -#webkit version for gtk3. - WEBKIT_REQUIRED=1.4.0 - WEBKIT_MODULES="webkitgtk-3.0 >= $WEBKIT_REQUIRED" - - PKG_CHECK_MODULES(WEBKIT, $WEBKIT_MODULES, HAVE_WEBKIT=yes, HAVE_WEBKIT=no) - if test $HAVE_WEBKIT = yes; then - AC_DEFINE(HAVE_WEBKIT, 1, [Define to 1 if you have webkit support.]) - AC_DEFINE(HAVE_WEBKIT_OSR, 1, [Define to 1 if you have webkit_osr support.]) - fi - - CLUTTER_REQUIRED=1.0.0 - CLUTTER_MODULES="clutter-gtk-1.0 >= $CLUTTER_REQUIRED" - - PKG_CHECK_MODULES(CLUTTER, $CLUTTER_MODULES, HAVE_CLUTTER=yes, HAVE_CLUTTER=no) - if test $HAVE_CLUTTER = yes; then - AC_DEFINE(HAVE_CLUTTER, 1, [Define to 1 if you have clutter support.]) - fi - -#TODO - GOOCANVAS_REQUIRED=1.4.0 - GOOCANVAS_MODULES="goocanvasgtk-3.0 >= $GOOCANVAS_REQUIRED" - - PKG_CHECK_MODULES(GOOCANVAS, $GOOCANVAS_MODULES, HAVE_GOOCANVAS=yes, HAVE_GOOCANVAS=no) - if test $HAVE_GOOCANVAS = yes; then - AC_DEFINE(HAVE_GOOCANVAS, 1, [Define to 1 if you have goocanvas support.]) - fi - -fi if test "${with_sound}" != "no"; then # Sound support for GNU/Linux and the free BSDs. @@ -1983,6 +1941,51 @@ if test "${HAVE_GTK}" = "yes"; then fi + +HAVE_XWIDGETS=no +HAVE_WEBKIT=no +HAVE_GOOCANVAS=no +HAVE_CLUTTER=no +if test "${with_xwidgets}" != "no"; then + echo "xwidgets enabled, checking webkit, and others" + HAVE_XWIDGETS=yes + AC_DEFINE(HAVE_XWIDGETS, 1, [Define to 1 if you have xwidgets support.]) +#xwidgets +#TODO +# - enable only if gtk/gtk3 enabled +# - webkit, goocanvas, clutter +# - only webkit_osr is good so remove plain webkit laterish + +#webkit version for gtk3. + WEBKIT_REQUIRED=1.4.0 + WEBKIT_MODULES="webkitgtk-3.0 >= $WEBKIT_REQUIRED" + + PKG_CHECK_MODULES(WEBKIT, $WEBKIT_MODULES, HAVE_WEBKIT=yes, HAVE_WEBKIT=no) + if test $HAVE_WEBKIT = yes; then +# AC_DEFINE(HAVE_WEBKIT, 1, [Define to 1 if you have webkit support.]) + AC_DEFINE(HAVE_WEBKIT_OSR, 1, [Define to 1 if you have webkit_osr support.]) + fi + + CLUTTER_REQUIRED=1.0.0 + CLUTTER_MODULES="clutter-gtk-1.0 >= $CLUTTER_REQUIRED" + + PKG_CHECK_MODULES(CLUTTER, $CLUTTER_MODULES, HAVE_CLUTTER=yes, HAVE_CLUTTER=no) + if test $HAVE_CLUTTER = yes; then + AC_DEFINE(HAVE_CLUTTER, 1, [Define to 1 if you have clutter support.]) + fi + +#TODO + GOOCANVAS_REQUIRED=1.4.0 + GOOCANVAS_MODULES="goocanvasgtk-3.0 >= $GOOCANVAS_REQUIRED" + + PKG_CHECK_MODULES(GOOCANVAS, $GOOCANVAS_MODULES, HAVE_GOOCANVAS=yes, HAVE_GOOCANVAS=no) + if test $HAVE_GOOCANVAS = yes; then + AC_DEFINE(HAVE_GOOCANVAS, 1, [Define to 1 if you have goocanvas support.]) + fi + +fi + + dnl D-Bus has been tested under GNU/Linux only. Must be adapted for dnl other platforms. Support for higher D-Bus versions than 1.0 is dnl also not configured. diff --git a/src/Makefile.in b/src/Makefile.in index 2d4724e5fe9..d1e212e92b7 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -226,6 +226,12 @@ CFLAGS_SOUND= @CFLAGS_SOUND@ RSVG_LIBS= @RSVG_LIBS@ RSVG_CFLAGS= @RSVG_CFLAGS@ +CLUTTER_LIBS= @CLUTTER_LIBS@ +CLUTTER_CFLAGS= @CLUTTER_CFLAGS@ + +WEBKIT_LIBS= @WEBKIT_LIBS@ +WEBKIT_CFLAGS= @WEBKIT_CFLAGS@ + IMAGEMAGICK_LIBS= @IMAGEMAGICK_LIBS@ IMAGEMAGICK_CFLAGS= @IMAGEMAGICK_CFLAGS@ @@ -305,6 +311,7 @@ ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(MYCPPFLAGS) -I. -I$(srcdir) \ $(C_SWITCH_MACHINE) $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) \ $(C_SWITCH_X_SYSTEM) $(CFLAGS_SOUND) $(RSVG_CFLAGS) $(IMAGEMAGICK_CFLAGS) \ $(LIBXML2_CFLAGS) $(DBUS_CFLAGS) \ + $(WEBKIT_CFLAGS) $(CLUTTER_CFLAGS) \ $(GCONF_CFLAGS) $(FREETYPE_CFLAGS) $(FONTCONFIG_CFLAGS) \ $(LIBOTF_CFLAGS) $(M17N_FLT_CFLAGS) $(DEPFLAGS) $(PROFILING_CFLAGS) \ $(LIBGNUTLS_CFLAGS) \ @@ -382,6 +389,7 @@ otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) \ ## with GCC, we might need LIB_GCC again after them. LIBES = $(LIBS) $(LIBX_BASE) $(LIBX_OTHER) $(LIBSOUND) \ $(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(DBUS_LIBS) \ + $(WEBKIT_LIBS) $(CLUTTER_LIBS) \ $(LIBXML2_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \ $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(GCONF_LIBS) $(LIBSELINUX_LIBS) \ $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \ diff --git a/src/insdel.c b/src/insdel.c index b6639f3ad8b..dad9378c86e 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -1797,8 +1797,6 @@ modify_region (struct buffer *buffer, EMACS_INT start, EMACS_INT end, int preserve_chars_modiff) { struct buffer *old_buffer = current_buffer; - // printf("modify region\n"); - xwidget_modify_region(); if (buffer != old_buffer) set_buffer_internal (buffer); diff --git a/src/xdisp.c b/src/xdisp.c index 44521ede97e..c662557845a 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -22125,11 +22125,9 @@ produce_image_glyph (struct it *it) static void produce_xwidget_glyph (struct it *it) { - // struct image *img; + struct xwidget* xw; struct face *face; int glyph_ascent, crop; - // struct glyph_slice slice; - printf("produce_xwidget_glyph:\n"); xassert (it->what == IT_XWIDGET); @@ -22138,30 +22136,11 @@ produce_xwidget_glyph (struct it *it) /* Make sure X resources of the face is loaded. */ PREPARE_FACE_FOR_DISPLAY (it->f, face); - ///////////////////////////////////////////// - - // img = IMAGE_FROM_ID (it->f, it->image_id); - //xassert (img); - /* Make sure X resources of the image is loaded. */ - //prepare_image_for_display (it->f, img); - - struct xwidget* xw=xwidget_from_id(it->xwidget_id); - //xwidget_touch(xw); - - it->ascent = it->phys_ascent = glyph_ascent = xw->height/2;//image_ascent (img, face, &slice); - it->descent = xw->height/2;//slice.height - glyph_ascent; - - //it->descent += img->vmargin; - //it->descent += img->vmargin; + xw = xwidget_from_id(it->xwidget_id); + it->ascent = it->phys_ascent = glyph_ascent = xw->height/2; + it->descent = xw->height/2; it->phys_descent = it->descent; - it->pixel_width = xw->width; - - //it->pixel_width += img->hmargin; - //it->pixel_width += img->hmargin; - - ///////////////////////////////////////// - /* It's quite possible for images to have an ascent greater than their height, so don't get confused in that case. */ if (it->descent < 0) @@ -22206,7 +22185,6 @@ produce_xwidget_glyph (struct it *it) glyph->ascent = glyph_ascent; glyph->descent = it->descent; glyph->voffset = it->voffset; - // glyph->type = IMAGE_GLYPH; glyph->type = XWIDGET_GLYPH; glyph->multibyte_p = it->multibyte_p; @@ -22218,7 +22196,6 @@ produce_xwidget_glyph (struct it *it) glyph->face_id = it->face_id; glyph->u.xwidget_id = it->xwidget_id; assert_valid_xwidget_id(glyph->u.xwidget_id,"produce_xwidget_glyph"); - // glyph->slice = slice; glyph->font_type = FONT_TYPE_UNKNOWN; ++it->glyph_row->used[area]; } diff --git a/src/xwidget-attic.c b/src/xwidget-attic.c index 84844587051..a49623124c5 100644 --- a/src/xwidget-attic.c +++ b/src/xwidget-attic.c @@ -227,3 +227,90 @@ DEFUN ("xwidget-replug", Fxwidget_replug, Sxwidget_replug, 2, 2, 0, return Qnil; } + + + +double osr_dbg_color=0; +void webkit_osr_redraw_child ( struct xwidget* xw, GtkWidget *widget) +{ + + //this stuff is different in gtk3 +#ifndef HAVE_GTK3 + cairo_t *cr; + + + GdkPixmap *src_pixmap; + src_pixmap = gtk_offscreen_window_get_pixmap(xw->widgetwindow_osr); + + //g_object_ref(src_pixmap);//TODO needs to be unrefed eventually, if we are to use his method + + + printf("webkit_osr_redraw_child xw.id:%d xw.type:%d window:%d\n", xw->id,xw->type, gtk_widget_get_window (widget)); + + cr = gdk_cairo_create (gtk_widget_get_window (widget)); + + cairo_rectangle(cr, 0,0, xw->width, xw->height); + cairo_clip(cr); + + // debugging redraw: + // - the bg colors always change, so theres no error in signal handling + // - i get this error now and then: + //(emacs:7109): GLib-GObject-WARNING **: invalid cast from `GdkOffscreenWindow' to `GdkDrawableImplX11' + // seems to happen in webkit actually. see README + + if(1){ //redraw debug hack + cairo_set_source_rgb(cr, osr_dbg_color, 1.0, 0.2); + cairo_rectangle(cr, 0,0, xw->width, xw->height); + cairo_fill(cr); + osr_dbg_color+=0.1; + if(osr_dbg_color>1.0) + osr_dbg_color=0.0; + + } + + gdk_cairo_set_source_pixmap (cr, src_pixmap, 0,0); //deprecated. use gdk_cairo_set_source_window + //gdk_cairo_set_source_window(cr, src_pixmap, 0,0); + + cairo_set_operator (cr, CAIRO_OPERATOR_OVER); + cairo_paint_with_alpha (cr, 0.7); + //cairo_paint(cr); + + + cairo_destroy (cr); +#else + cairo_t *cr; + cairo_surface_t * *src_pixmap; + src_pixmap = gtk_offscreen_window_get_surface (xw->widgetwindow_osr); + + printf("webkit_osr_redraw_child gtk3 xw.id:%d xw.type:%d window:%d\n", xw->id,xw->type, gtk_widget_get_window (widget)); + + cr = gdk_cairo_create (gtk_widget_get_window (widget)); + + cairo_rectangle(cr, 0,0, xw->width, xw->height); + cairo_clip(cr); + + // debugging redraw: + // - the bg colors always change, so theres no error in signal handling + // - i get this error now and then: + //(emacs:7109): GLib-GObject-WARNING **: invalid cast from `GdkOffscreenWindow' to `GdkDrawableImplX11' + // seems to happen in webkit actually. see README + + if(1){ //redraw debug hack + cairo_set_source_rgb(cr, osr_dbg_color, 1.0, 0.2); + cairo_rectangle(cr, 0,0, xw->width, xw->height); + cairo_fill(cr); + osr_dbg_color+=0.1; + if(osr_dbg_color>1.0) + osr_dbg_color=0.0; + + } + + cairo_set_source_surface (cr, src_pixmap, 0,0); + + + cairo_set_operator (cr, CAIRO_OPERATOR_OVER); + cairo_paint_with_alpha (cr, 0.7); + //cairo_paint(cr); + cairo_destroy (cr); +#endif +} diff --git a/src/xwidget.c b/src/xwidget.c index 6c712d1d707..ef9de279939 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -89,21 +89,12 @@ #include #endif - #include -#ifdef HAVE_WEBKIT -#include - -#endif - - #ifdef HAVE_WEBKIT_OSR #include #endif - - #include "xwidget.h" //TODO should of course not be a hardcoded array but I can't be bothered atm @@ -114,9 +105,6 @@ struct xwidget xwidgets[MAX_XWIDGETS]; struct xwidget_view xwidget_views[MAX_XWIDGETS]; - - - Lisp_Object Qxwidget; Lisp_Object Qxwidget_id; Lisp_Object Qtitle; @@ -126,7 +114,7 @@ Lisp_Object Qxwidget_info; Lisp_Object Qxwidget_resize_internal; Lisp_Object Qxwidget_send_keyboard_event; -Lisp_Object Qbutton, Qtoggle, Qslider, Qsocket, Qcairo, Qwebkit, +Lisp_Object Qbutton, Qtoggle, Qslider, Qsocket, Qcairo, Qwebkit_osr, QCplist; @@ -274,100 +262,6 @@ void xwidget_slider_changed (GtkRange *range, } -double osr_dbg_color=0; -void webkit_osr_redraw_child ( struct xwidget* xw, GtkWidget *widget) -{ - - //this stuff is different in gtk3 -#ifndef HAVE_GTK3 - cairo_t *cr; - - - GdkPixmap *src_pixmap; - src_pixmap = gtk_offscreen_window_get_pixmap(xw->widgetwindow_osr); - - //g_object_ref(src_pixmap);//TODO needs to be unrefed eventually, if we are to use his method - - - printf("webkit_osr_redraw_child xw.id:%d xw.type:%d window:%d\n", xw->id,xw->type, gtk_widget_get_window (widget)); - - cr = gdk_cairo_create (gtk_widget_get_window (widget)); - - cairo_rectangle(cr, 0,0, xw->width, xw->height); - cairo_clip(cr); - - // debugging redraw: - // - the bg colors always change, so theres no error in signal handling - // - i get this error now and then: - //(emacs:7109): GLib-GObject-WARNING **: invalid cast from `GdkOffscreenWindow' to `GdkDrawableImplX11' - // seems to happen in webkit actually. see README - - if(1){ //redraw debug hack - cairo_set_source_rgb(cr, osr_dbg_color, 1.0, 0.2); - cairo_rectangle(cr, 0,0, xw->width, xw->height); - cairo_fill(cr); - osr_dbg_color+=0.1; - if(osr_dbg_color>1.0) - osr_dbg_color=0.0; - - } - - gdk_cairo_set_source_pixmap (cr, src_pixmap, 0,0); //deprecated. use gdk_cairo_set_source_window - //gdk_cairo_set_source_window(cr, src_pixmap, 0,0); - - cairo_set_operator (cr, CAIRO_OPERATOR_OVER); - cairo_paint_with_alpha (cr, 0.7); - //cairo_paint(cr); - - - cairo_destroy (cr); -#elseif - cairo_t *cr; - cairo_surface_t * *src_pixmap; - src_pixmap = gtk_offscreen_window_get_surface (xw->widgetwindow_osr); - - printf("webkit_osr_redraw_child gtk3 xw.id:%d xw.type:%d window:%d\n", xw->id,xw->type, gtk_widget_get_window (widget)); - - cr = gdk_cairo_create (gtk_widget_get_window (widget)); - - cairo_rectangle(cr, 0,0, xw->width, xw->height); - cairo_clip(cr); - - // debugging redraw: - // - the bg colors always change, so theres no error in signal handling - // - i get this error now and then: - //(emacs:7109): GLib-GObject-WARNING **: invalid cast from `GdkOffscreenWindow' to `GdkDrawableImplX11' - // seems to happen in webkit actually. see README - - if(1){ //redraw debug hack - cairo_set_source_rgb(cr, osr_dbg_color, 1.0, 0.2); - cairo_rectangle(cr, 0,0, xw->width, xw->height); - cairo_fill(cr); - osr_dbg_color+=0.1; - if(osr_dbg_color>1.0) - osr_dbg_color=0.0; - - } - - cairo_set_source_surface (cr, src_pixmap, 0,0); - - - cairo_set_operator (cr, CAIRO_OPERATOR_OVER); - cairo_paint_with_alpha (cr, 0.7); - //cairo_paint(cr); - cairo_destroy (cr); -#endif -} - -/* when the on-screen webkit peer view gets exposed this signal is called. - it copies the bitmap from the off-screen webkit instance to the onscreen view*/ -gboolean webkit_osr_expose_event_callback (GtkWidget *widget, GdkEventExpose *event, gpointer data) -{ - //TODO optimize by cliping to damage region - struct xwidget* xw = (struct xwidget*) g_object_get_data (G_OBJECT (widget), XG_XWIDGET); - webkit_osr_redraw_child(xw, widget); - return FALSE; -} /* when the off-screen webkit master view changes this signal is called. it copies the bitmap from the off-screen webkit instance */ @@ -509,18 +403,10 @@ xwidget_init_view ( /* Show the stage: */ clutter_actor_show (stage); #endif - - } else if (EQ(xww->type, Qwebkit)) { -#ifdef HAVE_WEBKIT - xv->widget = webkit_web_view_new(); - webkit_web_view_load_uri(xv->widget, "http://www.fsf.org"); -#endif } else if (EQ(xww->type, Qwebkit_osr)) { #ifdef HAVE_WEBKIT_OSR xv->widget = gtk_drawing_area_new(); gtk_widget_set_app_paintable ( xv->widget, TRUE); //because expose event handling -#endif -#ifdef HAVE_GTK3 //and webkit_osr gtk_widget_add_events(xv->widget, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK @@ -533,9 +419,6 @@ xwidget_init_view ( G_CALLBACK (xwidget_osr_button_callback), NULL); g_signal_connect (G_OBJECT ( xv->widget), "motion-notify-event", G_CALLBACK (xwidget_osr_button_callback), NULL); -#else - g_signal_connect (G_OBJECT ( xv->widget), "expose_event", - G_CALLBACK (webkit_osr_expose_event_callback), NULL); #endif @@ -973,7 +856,6 @@ syms_of_xwidget (void) DEFSYM (Qslider, "slider"); DEFSYM (Qsocket, "socket"); DEFSYM (Qcairo, "cairo"); - DEFSYM (Qwebkit ,"webkit"); DEFSYM (Qwebkit_osr ,"webkit-osr"); DEFSYM (QCplist, ":plist"); @@ -1101,10 +983,9 @@ void gtk_window_get_position (GtkWindow *window, int lookup_xwidget (Lisp_Object spec) { - /*when a xwidget lisp spec is found initialize the C struct that is used in the C code. - this is done by redisplay so values change if the spec changes. - so, take special care of one-shot events - xwidget_init + /* When a xwidget lisp spec is found initialize the C struct that is used in the C code. + This is done by redisplay so values change if the spec changes. + So, take special care of one-shot events */ int found = 0, found1 = 0, found2 = 0; Lisp_Object value; @@ -1112,56 +993,46 @@ lookup_xwidget (Lisp_Object spec) struct xwidget *xw; value = xwidget_spec_value (spec, Qxwidget_id, &found1); - id = INTEGERP (value) ? XFASTINT (value) : 0; //id 0 by default, but id must be unique so this is dumb + id = INTEGERP (value) ? XFASTINT (value) : 0; //TODO id 0 by default, but id must be unique so this is dumb xw = &xwidgets[id]; xw->id=id; value = xwidget_spec_value (spec, QCtype, &found); xw->type = SYMBOLP (value) ? value : Qbutton; //default to button value = xwidget_spec_value (spec, Qtitle, &found2); - xw->title = STRINGP (value) ? (char *) SDATA (value) : "?"; //funky cast FIXME + xw->title = STRINGP (value) ? (char *) SDATA (value) : "?"; //funky cast FIXME TODO value = xwidget_spec_value (spec, QCheight, NULL); - xw->height = INTEGERP (value) ? XFASTINT (value) : 50; //ok + xw->height = INTEGERP (value) ? XFASTINT (value) : 50; value = xwidget_spec_value (spec, QCwidth, NULL); - xw->width = INTEGERP (value) ? XFASTINT (value) : 50; //ok + xw->width = INTEGERP (value) ? XFASTINT (value) : 50; value = xwidget_spec_value (spec, QCplist, NULL); xw->plist = value; printf ("xwidget_id:%d type:%d found:%d %d %d title:%s (%d,%d)\n", id, xw->type, found, found1, found2, xw->title, xw->height, xw->width); - assert_valid_xwidget_id (id, "lookup_xwidget"); #ifdef HAVE_WEBKIT_OSR - //diy mvc. widget is rendered offscreen(or in an onscreen separate toplevel for testing), later blitted to the views + /* DIY mvc. widget is rendered offscreen, + later bitmap copied to the views. + */ if (EQ(xw->type, Qwebkit_osr) && !xw->widgetwindow_osr){ BLOCK_INPUT; - //xw->widgetwindow_osr = GTK_CONTAINER (gtk_window_new ( GTK_WINDOW_TOPLEVEL)); - //xw->widgetwindow_osr = GTK_CONTAINER (gtk_dialog_new ()); xw->widgetwindow_osr = GTK_CONTAINER (gtk_offscreen_window_new ()); gtk_window_resize( GTK_WINDOW(xw->widgetwindow_osr), xw->width, xw->height); - //xw->widgetwindow_osr = SELECTED_FRAME()->gwfixed; xw->widget_osr = webkit_web_view_new(); - //xw->widget_osr = gtk_button_new(); - - //random debug hack - //gtk_widget_set_double_buffered (xw->widget_osr,FALSE); - //gtk_widget_set_double_buffered (xw->widgetwindow_osr,FALSE); gtk_widget_set_size_request (GTK_WIDGET (xw->widget_osr), xw->width, xw->height); gtk_container_add (xw->widgetwindow_osr, xw->widget_osr); - //gtk_fixed_put(GTK_FIXED(xw->widgetwindow_osr), xw->widget_osr, 0, 200); gtk_widget_show_all (GTK_WIDGET (xw->widgetwindow_osr)); - //store some xwidget data in the gtk widgets - g_object_set_data (G_OBJECT (xw->widget_osr), XG_XWIDGET, (gpointer) (xw)); //the xwidget - g_object_set_data (G_OBJECT (xw->widgetwindow_osr), XG_XWIDGET, (gpointer) (xw)); //the xwidget - + /* 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 (webkit_osr_damage_event_callback), NULL); - //g_signal_connect (G_OBJECT ( xw->widget_osr), "draw", G_CALLBACK (webkit_osr_damage_event_callback), NULL); webkit_web_view_load_uri(WEBKIT_WEB_VIEW(xw->widget_osr), "http://www.fsf.org"); UNBLOCK_INPUT; @@ -1171,13 +1042,6 @@ lookup_xwidget (Lisp_Object spec) return id; } - - - - -////////////////////////////////// -int region_modified = 0; - /*set up detection of touched xwidget*/ void xwidget_start_redisplay (void) @@ -1192,7 +1056,6 @@ xwidget_start_redisplay (void) void xwidget_touch (struct xwidget_view *xw) { - //printf("touch xwidget %d\n", xw->id); xw->redisplayed = 1; } @@ -1203,7 +1066,6 @@ xwidget_touched (struct xwidget_view *xw) } /* redisplay has ended, now we should hide untouched xwidgets - */ void xwidget_end_redisplay (struct glyph_matrix *matrix) @@ -1213,7 +1075,7 @@ xwidget_end_redisplay (struct glyph_matrix *matrix) struct xwidget *xw; int area; - region_modified = 0; + xwidget_start_redisplay (); //iterate desired glyph matrix of "live" window here, hide gtk widgets //not in the desired matrix. @@ -1279,10 +1141,4 @@ xwidget_end_redisplay (struct glyph_matrix *matrix) } } -/* some type of modification was made to the buffers(unused)*/ -void -xwidget_modify_region (void) -{ - region_modified = 1; -} diff --git a/src/xwidget.h b/src/xwidget.h index 732dac5e7c2..b906b71c10b 100644 --- a/src/xwidget.h +++ b/src/xwidget.h @@ -76,7 +76,6 @@ extern int xwidget_owns_kbd; void xwidget_start_redisplay(); void xwidget_end_redisplay(struct glyph_matrix* matrix); -void xwidget_modify_region(); void xwidget_touch (struct xwidget_view *xw);