aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoakim Verona2011-07-04 20:32:20 +0200
committerJoakim Verona2011-07-04 20:32:20 +0200
commit303da42474c7a4a59b2e86dda88ec74509bcd91f (patch)
tree64cb73e98fd84ec3ddba16530c5e8d05535b4171 /src
parent57be30e7ad69cc84761c269349da9da73598080c (diff)
downloademacs-303da42474c7a4a59b2e86dda88ec74509bcd91f.tar.gz
emacs-303da42474c7a4a59b2e86dda88ec74509bcd91f.zip
work on cliptop. swithched from viewport, back to gtkfixed. pretty acceptable visuals
Diffstat (limited to 'src')
-rw-r--r--src/emacsgtkfixed.c4
-rw-r--r--src/xwidget.c30
2 files changed, 8 insertions, 26 deletions
diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c
index 61d7898ce44..0eacd2eaa2d 100644
--- a/src/emacsgtkfixed.c
+++ b/src/emacsgtkfixed.c
@@ -59,8 +59,8 @@ void aloc_callback(GtkWidget* child, GtkWidget* fixed){
59 child_allocation.width = xv->clipx; 59 child_allocation.width = xv->clipx;
60 child_allocation.height = xv->clipy - xv->cliptop; 60 child_allocation.height = xv->clipy - xv->cliptop;
61 gtk_widget_size_allocate (child, &child_allocation); 61 gtk_widget_size_allocate (child, &child_allocation);
62 //TODO find a way to remove this fooble workaround 62 //TODO find a way to remove this feeble workaround
63 gtk_adjustment_set_value (gtk_viewport_get_vadjustment(GTK_VIEWPORT(xv->widgetwindow)), 1.0*xv->cliptop); 63 //gtk_adjustment_set_value (gtk_viewport_get_vadjustment(GTK_VIEWPORT(xv->widgetwindow)), 1.0*xv->cliptop);
64 } 64 }
65 65
66} 66}
diff --git a/src/xwidget.c b/src/xwidget.c
index 00a10eefdd7..90c9f225c77 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -551,24 +551,22 @@ xwidget_init_view (
551 //xw->widgetwindow = GTK_CONTAINER (gtk_layout_new (NULL, NULL)); 551 //xw->widgetwindow = GTK_CONTAINER (gtk_layout_new (NULL, NULL));
552 //xw->widgetwindow = GTK_CONTAINER (gtk_offscreen_window_new ()); 552 //xw->widgetwindow = GTK_CONTAINER (gtk_offscreen_window_new ());
553 553
554 //xv->widgetwindow = GTK_CONTAINER (gtk_fixed_new ()); //works well for clipping on gtk2 not gtk3 554 xv->widgetwindow = GTK_CONTAINER (gtk_fixed_new ()); //works well for clipping on gtk2 not gtk3
555 //xv->widgetwindow = GTK_CONTAINER (gtk_event_box_new ()); //doesnt help clipping gtk3 555 //xv->widgetwindow = GTK_CONTAINER (gtk_event_box_new ()); //doesnt help clipping gtk3
556 //xv->widgetwindow = GTK_CONTAINER (gtk_scrolled_window_new (NULL, NULL)); //clips in gtk3 556 //xv->widgetwindow = GTK_CONTAINER (gtk_scrolled_window_new (NULL, NULL)); //clips in gtk3
557 xv->widgetwindow = GTK_CONTAINER (gtk_viewport_new (NULL, NULL)); 557 //xv->widgetwindow = GTK_CONTAINER (gtk_viewport_new (NULL, NULL));
558 558
559 559
560 /* GtkAllocation a; */ 560 /* GtkAllocation a; */
561 /* a.x=0; a.y=0; a.width=xww->width; a.height=xww->height; */ 561 /* a.x=0; a.y=0; a.width=xww->width; a.height=xww->height; */
562 /* gtk_widget_set_allocation (GTK_WIDGET (xv->widget), &a); */ 562 /* gtk_widget_set_allocation (GTK_WIDGET (xv->widget), &a); */
563 563
564 //gtk_widget_set_has_window(GTK_WIDGET ( xv->widgetwindow), TRUE); 564 gtk_widget_set_has_window(GTK_WIDGET ( xv->widgetwindow), TRUE);
565 //if gtk_fixed doesnt have a window it will surprisingly not honor 565 //on GTK2 if gtk_fixed doesnt have a window it will surprisingly not honor
566 //setsize so that children gets clipped later. the documentation is 566 //setsize so that children gets clipped later. the documentation is
567 //not consistent regarding if its legal to call this method. 567 //not consistent regarding if its legal to call this method.
568 568
569 //doesnt help on gtk3, and the docs seem clearer there that this is 569 //on GTK3 the call isnt necessary except for windowless widgets such as the drawarea used for the webkit views
570 //an internal function
571
572 570
573 571
574 //gtk_layout_set_size (GTK_LAYOUT (xw->widgetwindow), xw->width, xw->height); 572 //gtk_layout_set_size (GTK_LAYOUT (xw->widgetwindow), xw->width, xw->height);
@@ -672,24 +670,8 @@ x_draw_xwidget_glyph_string (struct glyph_string *s)
672 //an emacs window is not a gtk window, a gtk window covers the entire frame 670 //an emacs window is not a gtk window, a gtk window covers the entire frame
673 //cliping might have changed even if we havent actualy moved, we try figure out when we need to reclip for real 671 //cliping might have changed even if we havent actualy moved, we try figure out when we need to reclip for real
674 if((xv->clipx != clipx) || (xv->clipy != clipy)|| (xv->cliptop != cliptop)){ 672 if((xv->clipx != clipx) || (xv->clipy != clipy)|| (xv->cliptop != cliptop)){
675 printf("adj max:%f val:%f\n", gtk_adjustment_get_upper(gtk_viewport_get_vadjustment(GTK_VIEWPORT(xv->widgetwindow))), gtk_adjustment_get_value(gtk_viewport_get_vadjustment(GTK_VIEWPORT(xv->widgetwindow))));
676 gtk_widget_set_size_request (GTK_WIDGET (xv->widgetwindow), clipx, clipy + cliptop); 673 gtk_widget_set_size_request (GTK_WIDGET (xv->widgetwindow), clipx, clipy + cliptop);
677 printf("adj max:%f val:%f\n", gtk_adjustment_get_upper(gtk_viewport_get_vadjustment(GTK_VIEWPORT(xv->widgetwindow))), gtk_adjustment_get_value(gtk_viewport_get_vadjustment(GTK_VIEWPORT(xv->widgetwindow)))); 674 gtk_fixed_put(GTK_FIXED(xv->widgetwindow), xv->widget, 0, -cliptop);
678
679 gtk_adjustment_set_value (gtk_viewport_get_vadjustment(GTK_VIEWPORT(xv->widgetwindow)), 1.0*cliptop);
680 //gtk_adjustment_value_changed (gtk_viewport_get_vadjustment(GTK_VIEWPORT(xv->widgetwindow)));
681
682 printf("adj max:%f val:%f\n", gtk_adjustment_get_upper(gtk_viewport_get_vadjustment(GTK_VIEWPORT(xv->widgetwindow))), gtk_adjustment_get_value(gtk_viewport_get_vadjustment(GTK_VIEWPORT(xv->widgetwindow))));
683 /* gtk_adjustment_configure (gtk_viewport_get_vadjustment(GTK_VIEWPORT(xv->widgetwindow)), */
684 /* - cliptop, //val */
685 /* - xww->height, //max */
686 /* 0.0, //low */
687
688 /* 1.0, //step. unused */
689 /* 1.0, //page step. unused */
690 /* xww->height //page height */
691
692 /* ); */
693 printf("reclip %d %d -> %d %d cliptop:%d\n",xv->clipx, xv->clipy, clipx, clipy, cliptop ); 675 printf("reclip %d %d -> %d %d cliptop:%d\n",xv->clipx, xv->clipy, clipx, clipy, cliptop );
694 676
695 //allocation debugging. the correct values cant be expected to show upp immediately, but eventually they should get to be ok 677 //allocation debugging. the correct values cant be expected to show upp immediately, but eventually they should get to be ok