diff options
| author | Joakim Verona | 2011-07-17 23:53:27 +0200 |
|---|---|---|
| committer | Joakim Verona | 2011-07-17 23:53:27 +0200 |
| commit | 32b1b66b26662eb2dd46657cbd292063691bfc79 (patch) | |
| tree | 4b4302b917d5049cdb1cf4a4e0dcb3f129744761 /src | |
| parent | b9cc0253ffe73b2c5c2cf4dddd65786a2d03d8c2 (diff) | |
| download | emacs-32b1b66b26662eb2dd46657cbd292063691bfc79.tar.gz emacs-32b1b66b26662eb2dd46657cbd292063691bfc79.zip | |
some attempts at real-world usefulness
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 15 | ||||
| -rw-r--r-- | src/xwidget.c | 30 |
2 files changed, 40 insertions, 5 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index c02de7225e1..67cbfaa76f6 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -12209,7 +12209,7 @@ redisplay_internal (void) | |||
| 12209 | frames. Zero means, only selected_window is considered. */ | 12209 | frames. Zero means, only selected_window is considered. */ |
| 12210 | int consider_all_windows_p; | 12210 | int consider_all_windows_p; |
| 12211 | 12211 | ||
| 12212 | printf(">>>>redisplay\n"); | 12212 | //printf(">>>>redisplay\n"); |
| 12213 | // xwidget_start_redisplay(); | 12213 | // xwidget_start_redisplay(); |
| 12214 | 12214 | ||
| 12215 | TRACE ((stderr, "redisplay_internal %d\n", redisplaying_p)); | 12215 | TRACE ((stderr, "redisplay_internal %d\n", redisplaying_p)); |
| @@ -12932,7 +12932,7 @@ redisplay_internal (void) | |||
| 12932 | RESUME_POLLING; | 12932 | RESUME_POLLING; |
| 12933 | //xwidget_end_redisplay(); | 12933 | //xwidget_end_redisplay(); |
| 12934 | 12934 | ||
| 12935 | printf("<<<<redisplay\n"); | 12935 | //printf("<<<<redisplay\n"); |
| 12936 | } | 12936 | } |
| 12937 | 12937 | ||
| 12938 | 12938 | ||
| @@ -15383,6 +15383,7 @@ try_window (Lisp_Object window, struct text_pos pos, int flags) | |||
| 15383 | struct glyph_row *last_text_row = NULL; | 15383 | struct glyph_row *last_text_row = NULL; |
| 15384 | struct frame *f = XFRAME (w->frame); | 15384 | struct frame *f = XFRAME (w->frame); |
| 15385 | 15385 | ||
| 15386 | |||
| 15386 | /* Make POS the new window start. */ | 15387 | /* Make POS the new window start. */ |
| 15387 | set_marker_both (w->start, Qnil, CHARPOS (pos), BYTEPOS (pos)); | 15388 | set_marker_both (w->start, Qnil, CHARPOS (pos), BYTEPOS (pos)); |
| 15388 | 15389 | ||
| @@ -15393,6 +15394,7 @@ try_window (Lisp_Object window, struct text_pos pos, int flags) | |||
| 15393 | /* Initialize iterator and info to start at POS. */ | 15394 | /* Initialize iterator and info to start at POS. */ |
| 15394 | start_display (&it, w, pos); | 15395 | start_display (&it, w, pos); |
| 15395 | 15396 | ||
| 15397 | |||
| 15396 | /* Display all lines of W. */ | 15398 | /* Display all lines of W. */ |
| 15397 | while (it.current_y < it.last_visible_y) | 15399 | while (it.current_y < it.last_visible_y) |
| 15398 | { | 15400 | { |
| @@ -15489,10 +15491,11 @@ try_window_reusing_current_matrix (struct window *w) | |||
| 15489 | struct glyph_row *start_row; | 15491 | struct glyph_row *start_row; |
| 15490 | int start_vpos, min_y, max_y; | 15492 | int start_vpos, min_y, max_y; |
| 15491 | 15493 | ||
| 15494 | #if HAVE_XWIDGETS_hhh | ||
| 15492 | return 0; | 15495 | return 0; |
| 15493 | //xwidgets doesnt like blit scrolling and stuff, try this for now | 15496 | //xwidgets doesnt like blit scrolling and stuff, try this for now |
| 15494 | //should be optimized, perhaps by just inhibiting optimizations of windows containing xwidgets. | 15497 | //should be optimized, perhaps by just inhibiting optimizations of windows containing xwidgets. |
| 15495 | 15498 | #endif | |
| 15496 | 15499 | ||
| 15497 | #if GLYPH_DEBUG | 15500 | #if GLYPH_DEBUG |
| 15498 | if (inhibit_try_window_reusing) | 15501 | if (inhibit_try_window_reusing) |
| @@ -17476,7 +17479,11 @@ static void | |||
| 17476 | compute_line_metrics (struct it *it) | 17479 | compute_line_metrics (struct it *it) |
| 17477 | { | 17480 | { |
| 17478 | struct glyph_row *row = it->glyph_row; | 17481 | struct glyph_row *row = it->glyph_row; |
| 17479 | 17482 | if(row->used[TEXT_AREA] > 1000){ | |
| 17483 | printf("compute_line_metrics %d %d %d\n", row->used[TEXT_AREA], it->f->text_cols, row->end.pos.charpos); | ||
| 17484 | printf("row->used[TEXT_AREA] seems weirdly big! therefore dont compute_line_metrics\n"); | ||
| 17485 | return; | ||
| 17486 | } | ||
| 17480 | if (FRAME_WINDOW_P (it->f)) | 17487 | if (FRAME_WINDOW_P (it->f)) |
| 17481 | { | 17488 | { |
| 17482 | int i, min_y, max_y; | 17489 | int i, min_y, max_y; |
diff --git a/src/xwidget.c b/src/xwidget.c index 2ea88a22279..44e1d327729 100644 --- a/src/xwidget.c +++ b/src/xwidget.c | |||
| @@ -783,6 +783,33 @@ DEFUN("xwidget-view-info", Fxwidget_view_info , Sxwidget_view_info, 2,2,0, doc: | |||
| 783 | return info; | 783 | return info; |
| 784 | } | 784 | } |
| 785 | 785 | ||
| 786 | |||
| 787 | DEFUN("xwidget-delete-zombies", Fxwidget_delete_zombies , Sxwidget_delete_zombies, 0,0,0, doc: /* */) | ||
| 788 | (void) | ||
| 789 | { | ||
| 790 | /* | ||
| 791 | - remove all views with window gone | ||
| 792 | |||
| 793 | TODO | ||
| 794 | - remove all xwidgets with buffer gone | ||
| 795 | - remove all views with xw gone | ||
| 796 | |||
| 797 | */ | ||
| 798 | struct xwidget_view* xv = NULL; | ||
| 799 | Lisp_Object w; | ||
| 800 | for (int i = 0; i < MAX_XWIDGETS; i++){ | ||
| 801 | xv = &xwidget_views[i]; | ||
| 802 | XSETWINDOW(w, xv->w); | ||
| 803 | if(xv->initialized && (! (WINDOW_LIVE_P(w)))){ | ||
| 804 | |||
| 805 | gtk_widget_destroy(GTK_WIDGET(xv->widgetwindow)); | ||
| 806 | xv->initialized = 0; | ||
| 807 | } | ||
| 808 | } | ||
| 809 | } | ||
| 810 | |||
| 811 | |||
| 812 | |||
| 786 | void | 813 | void |
| 787 | syms_of_xwidget (void) | 814 | syms_of_xwidget (void) |
| 788 | { | 815 | { |
| @@ -799,7 +826,7 @@ syms_of_xwidget (void) | |||
| 799 | defsubr (&Sxwidget_webkit_execute_script); | 826 | defsubr (&Sxwidget_webkit_execute_script); |
| 800 | defsubr (&Sxwidget_webkit_get_title); | 827 | defsubr (&Sxwidget_webkit_get_title); |
| 801 | defsubr (&Sxwidget_size_request ); | 828 | defsubr (&Sxwidget_size_request ); |
| 802 | 829 | defsubr (&Sxwidget_delete_zombies); | |
| 803 | DEFSYM (Qxwidget ,"xwidget"); | 830 | DEFSYM (Qxwidget ,"xwidget"); |
| 804 | 831 | ||
| 805 | DEFSYM (Qcxwidget ,":xwidget"); | 832 | DEFSYM (Qcxwidget ,":xwidget"); |
| @@ -904,6 +931,7 @@ void xwidget_view_delete_all_in_window( struct window *w ) | |||
| 904 | } | 931 | } |
| 905 | 932 | ||
| 906 | 933 | ||
| 934 | |||
| 907 | struct xwidget_view* xwidget_view_lookup(struct xwidget* xw, struct window *w){ | 935 | struct xwidget_view* xwidget_view_lookup(struct xwidget* xw, struct window *w){ |
| 908 | struct xwidget_view* xv = NULL; | 936 | struct xwidget_view* xv = NULL; |
| 909 | for (int i = 0; i < MAX_XWIDGETS; i++) | 937 | for (int i = 0; i < MAX_XWIDGETS; i++) |