aboutsummaryrefslogtreecommitdiffstats
path: root/src/xwidget.c
diff options
context:
space:
mode:
authorJoakim Verona2011-06-23 01:25:37 +0200
committerJoakim Verona2011-06-23 01:25:37 +0200
commit787c27e81f046cfa1c457ed405551f8ca0ddb0e8 (patch)
treee958a23e30261b1469426c2c46842dd0af55a6ed /src/xwidget.c
parentbccbbe01e0d0a9fcd86e516372d13a347481808f (diff)
downloademacs-787c27e81f046cfa1c457ed405551f8ca0ddb0e8.tar.gz
emacs-787c27e81f046cfa1c457ed405551f8ca0ddb0e8.zip
socket init demo xwidget-demo-a-socket now shows embedded browser again. phew./configure multiple socket views create multiple embeddable processes though which is wrong. the 1st process plug should just be moved between sockets.
Diffstat (limited to 'src/xwidget.c')
-rw-r--r--src/xwidget.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/xwidget.c b/src/xwidget.c
index 389e6a655ff..5ebecd63937 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -223,8 +223,8 @@ xwidget_init_view (
223 xv->widget = gtk_socket_new (); 223 xv->widget = gtk_socket_new ();
224 //gtk_widget_set_app_paintable (xw->widget, TRUE); //workaround for composited sockets 224 //gtk_widget_set_app_paintable (xw->widget, TRUE); //workaround for composited sockets
225 225
226 gdk_color_parse("blue",&color); //the blue color never seems to show up. something else draws a grey bg 226 //gdk_color_parse("blue",&color); //the blue color never seems to show up. something else draws a grey bg
227 gtk_widget_modify_bg(xv->widget, GTK_STATE_NORMAL, &color); 227 //gtk_widget_modify_bg(xv->widget, GTK_STATE_NORMAL, &color);
228 g_signal_connect_after(xv->widget, "plug-added", G_CALLBACK(xwidget_plug_added), "plug added"); 228 g_signal_connect_after(xv->widget, "plug-added", G_CALLBACK(xwidget_plug_added), "plug added");
229 break; 229 break;
230 case 4: 230 case 4:
@@ -277,7 +277,8 @@ xwidget_init_view (
277 switch (xww->type) 277 switch (xww->type)
278 { 278 {
279 case 3: 279 case 3:
280 printf ("socket id:%x %d\n", 280 printf ("xwid:%d socket id:%x %d\n",
281 xww->id,
281 gtk_socket_get_id (GTK_SOCKET (xv->widget)), 282 gtk_socket_get_id (GTK_SOCKET (xv->widget)),
282 gtk_socket_get_id (GTK_SOCKET (xv->widget))); 283 gtk_socket_get_id (GTK_SOCKET (xv->widget)));
283 send_xembed_ready_event (xww->id, 284 send_xembed_ready_event (xww->id,
@@ -732,7 +733,7 @@ struct xwidget_view* xwidget_view_lookup(struct xwidget* xw, struct window *
732int 733int
733lookup_xwidget (Lisp_Object spec) 734lookup_xwidget (Lisp_Object spec)
734{ 735{
735 736 /*when a xwidget lisp spec is found initialize the C struct*/
736 int found = 0, found1 = 0, found2 = 0; 737 int found = 0, found1 = 0, found2 = 0;
737 Lisp_Object value; 738 Lisp_Object value;
738 int id; 739 int id;
@@ -742,6 +743,7 @@ lookup_xwidget (Lisp_Object spec)
742 id = INTEGERP (value) ? XFASTINT (value) : 0; //id 0 by default, but id must be unique so this is dumb 743 id = INTEGERP (value) ? XFASTINT (value) : 0; //id 0 by default, but id must be unique so this is dumb
743 744
744 xw = &xwidgets[id]; 745 xw = &xwidgets[id];
746 xw->id=id;
745 value = xwidget_spec_value (spec, QCtype, &found); 747 value = xwidget_spec_value (spec, QCtype, &found);
746 xw->type = INTEGERP (value) ? XFASTINT (value) : 1; //default to button 748 xw->type = INTEGERP (value) ? XFASTINT (value) : 1; //default to button
747 value = xwidget_spec_value (spec, Qtitle, &found2); 749 value = xwidget_spec_value (spec, Qtitle, &found2);
@@ -802,8 +804,6 @@ xwidget_touched (struct xwidget_view *xw)
802void 804void
803xwidget_end_redisplay (struct glyph_matrix *matrix) 805xwidget_end_redisplay (struct glyph_matrix *matrix)
804{ 806{
805 //return; //until I convert this to MVC
806
807 807
808 int i; 808 int i;
809 struct xwidget *xw; 809 struct xwidget *xw;
@@ -863,8 +863,9 @@ xwidget_end_redisplay (struct glyph_matrix *matrix)
863 for (i = 0; i < MAX_XWIDGETS; i++) 863 for (i = 0; i < MAX_XWIDGETS; i++)
864 { 864 {
865 struct xwidget_view* xv = &xwidget_views[i]; 865 struct xwidget_view* xv = &xwidget_views[i];
866 866
867 if (xv->initialized && ( xv->w == (XWINDOW(FRAME_SELECTED_WINDOW (SELECTED_FRAME()))))) 867 //"touched" is only meaningful for the "live" window, so disregard other views
868 if (xv->initialized && ( xv->w == (XWINDOW(FRAME_SELECTED_WINDOW (SELECTED_FRAME())))))
868 { 869 {
869 if (xwidget_touched(xv)) 870 if (xwidget_touched(xv))
870 xwidget_show_view (xv); 871 xwidget_show_view (xv);