diff options
| author | Joakim Verona | 2011-07-26 09:44:48 +0200 |
|---|---|---|
| committer | Joakim Verona | 2011-07-26 09:44:48 +0200 |
| commit | 716c24d8844d8ef23c93185ad7fd362c78668b6a (patch) | |
| tree | b3f6880575aa2ff7518bf90c9c2d9432239fdab4 /src | |
| parent | 37d6e227b2e4460b36363e42a3de45c082233c74 (diff) | |
| download | emacs-716c24d8844d8ef23c93185ad7fd362c78668b6a.tar.gz emacs-716c24d8844d8ef23c93185ad7fd362c78668b6a.zip | |
socket osr trial experiment that doesnt work
Diffstat (limited to 'src')
| -rw-r--r-- | src/xwidget.c | 40 |
1 files changed, 34 insertions, 6 deletions
diff --git a/src/xwidget.c b/src/xwidget.c index 2186d429a32..f1c4e0e35cb 100644 --- a/src/xwidget.c +++ b/src/xwidget.c | |||
| @@ -132,7 +132,7 @@ Lisp_Object Qxwidget_info; | |||
| 132 | Lisp_Object Qxwidget_resize; | 132 | Lisp_Object Qxwidget_resize; |
| 133 | Lisp_Object Qxwidget_send_keyboard_event; | 133 | Lisp_Object Qxwidget_send_keyboard_event; |
| 134 | 134 | ||
| 135 | Lisp_Object Qbutton, Qtoggle, Qslider, Qsocket, Qcairo, | 135 | Lisp_Object Qbutton, Qtoggle, Qslider, Qsocket, Qsocket_osr, Qcairo, |
| 136 | Qwebkit_osr, QCplist; | 136 | Qwebkit_osr, QCplist; |
| 137 | 137 | ||
| 138 | 138 | ||
| @@ -198,7 +198,33 @@ DEFUN ("make-xwidget", Fmake_xwidget, Smake_xwidget, 7, 7, 0, | |||
| 198 | 198 | ||
| 199 | } | 199 | } |
| 200 | #endif | 200 | #endif |
| 201 | if (EQ(xw->type, Qsocket_osr)){ | ||
| 202 | printf("init socket osr\n"); | ||
| 203 | BLOCK_INPUT; | ||
| 204 | xw->widgetwindow_osr = GTK_CONTAINER (gtk_offscreen_window_new ()); | ||
| 205 | gtk_window_resize( GTK_WINDOW(xw->widgetwindow_osr), xw->width, xw->height); | ||
| 201 | 206 | ||
| 207 | //////////////////// | ||
| 208 | //xw->widget_osr = webkit_web_view_new(); | ||
| 209 | xw->widget_osr = gtk_socket_new(); | ||
| 210 | //g_signal_connect_after(xv->widget, "plug-added", G_CALLBACK(xwidget_plug_added), "plug added"); | ||
| 211 | //g_signal_connect_after(xv->widget, "plug-removed", G_CALLBACK(xwidget_plug_removed), "plug removed"); | ||
| 212 | /////////////////// | ||
| 213 | |||
| 214 | gtk_widget_set_size_request (GTK_WIDGET (xw->widget_osr), xw->width, xw->height); | ||
| 215 | gtk_container_add (xw->widgetwindow_osr, xw->widget_osr); | ||
| 216 | |||
| 217 | gtk_widget_show_all (GTK_WIDGET (xw->widgetwindow_osr)); | ||
| 218 | |||
| 219 | /* store some xwidget data in the gtk widgets for convenient retrieval in the event handlers. */ | ||
| 220 | g_object_set_data (G_OBJECT (xw->widget_osr), XG_XWIDGET, (gpointer) (xw)); | ||
| 221 | g_object_set_data (G_OBJECT (xw->widgetwindow_osr), XG_XWIDGET, (gpointer) (xw)); | ||
| 222 | g_signal_connect (G_OBJECT ( xw->widgetwindow_osr), "damage-event", G_CALLBACK (webkit_osr_damage_event_callback), NULL); | ||
| 223 | |||
| 224 | //webkit_web_view_load_uri(WEBKIT_WEB_VIEW(xw->widget_osr), "http://www.fsf.org"); | ||
| 225 | UNBLOCK_INPUT; | ||
| 226 | |||
| 227 | } | ||
| 202 | 228 | ||
| 203 | UNGCPRO; | 229 | UNGCPRO; |
| 204 | return val; | 230 | return val; |
| @@ -478,7 +504,7 @@ xwidget_init_view ( | |||
| 478 | /* Show the stage: */ | 504 | /* Show the stage: */ |
| 479 | clutter_actor_show (stage); | 505 | clutter_actor_show (stage); |
| 480 | #endif | 506 | #endif |
| 481 | } else if (EQ(xww->type, Qwebkit_osr)) { | 507 | } else if (EQ(xww->type, Qwebkit_osr)||EQ(xww->type, Qsocket_osr)) { |
| 482 | #ifdef HAVE_WEBKIT_OSR | 508 | #ifdef HAVE_WEBKIT_OSR |
| 483 | xv->widget = gtk_drawing_area_new(); | 509 | xv->widget = gtk_drawing_area_new(); |
| 484 | gtk_widget_set_app_paintable ( xv->widget, TRUE); //because expose event handling | 510 | gtk_widget_set_app_paintable ( xv->widget, TRUE); //because expose event handling |
| @@ -830,6 +856,7 @@ syms_of_xwidget (void) | |||
| 830 | DEFSYM (Qtoggle, "toggle"); | 856 | DEFSYM (Qtoggle, "toggle"); |
| 831 | DEFSYM (Qslider, "slider"); | 857 | DEFSYM (Qslider, "slider"); |
| 832 | DEFSYM (Qsocket, "socket"); | 858 | DEFSYM (Qsocket, "socket"); |
| 859 | DEFSYM (Qsocket_osr, "socket-osr"); | ||
| 833 | DEFSYM (Qcairo, "cairo"); | 860 | DEFSYM (Qcairo, "cairo"); |
| 834 | DEFSYM (Qwebkit_osr ,"webkit-osr"); | 861 | DEFSYM (Qwebkit_osr ,"webkit-osr"); |
| 835 | DEFSYM (QCplist, ":plist"); | 862 | DEFSYM (QCplist, ":plist"); |
| @@ -1018,11 +1045,12 @@ xwidget_end_redisplay (struct window *w, struct glyph_matrix *matrix) | |||
| 1018 | 1045 | ||
| 1019 | 1046 | ||
| 1020 | xwidget_start_redisplay (); | 1047 | xwidget_start_redisplay (); |
| 1021 | //iterate desired glyph matrix of "live" window here, hide gtk widgets | 1048 | //iterate desired glyph matrix of window here, hide gtk widgets |
| 1022 | //not in the desired matrix. | 1049 | //not in the desired matrix. |
| 1023 | 1050 | ||
| 1024 | //the current scheme will fail on the case of several buffers showing xwidgets | 1051 | //this only takes care of xwidgets in active windows. |
| 1025 | 1052 | //if a window goes away from screen xwidget views wust be deleted | |
| 1053 | |||
| 1026 | // dump_glyph_matrix(matrix, 2); | 1054 | // dump_glyph_matrix(matrix, 2); |
| 1027 | for (i = 0; i < matrix->nrows; ++i) | 1055 | for (i = 0; i < matrix->nrows; ++i) |
| 1028 | { | 1056 | { |
| @@ -1055,7 +1083,7 @@ xwidget_end_redisplay (struct window *w, struct glyph_matrix *matrix) | |||
| 1055 | { | 1083 | { |
| 1056 | struct xwidget_view* xv = &xwidget_views[i]; | 1084 | struct xwidget_view* xv = &xwidget_views[i]; |
| 1057 | 1085 | ||
| 1058 | //"touched" is only meaningful for the "live" window, so disregard other views | 1086 | //"touched" is only meaningful for the current window, so disregard other views |
| 1059 | if (xv->initialized && ( xv->w == w)) | 1087 | if (xv->initialized && ( xv->w == w)) |
| 1060 | { | 1088 | { |
| 1061 | if (xwidget_touched(xv)) | 1089 | if (xwidget_touched(xv)) |