From 6f62a45eec59ae9ee83aecf5b4cc77dae50fb0ee Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 21 Feb 2006 23:19:31 +0000 Subject: *** empty log message *** --- src/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index c016dc46e4b..6df63457d77 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2006-02-22 Kim F. Storm + + * fringe.c (draw_fringe_bitmap): Fix overlay-arrow display. + 2006-02-21 Kim F. Storm * fringe.c (syms_of_fringe) : Doc fix. -- cgit v1.2.1 From a1b24e137f75b9f5fdbd5526947a70c462c5e5bf Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 21 Feb 2006 23:19:40 +0000 Subject: (draw_fringe_bitmap): Fix overlay-arrow display. --- src/fringe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/fringe.c b/src/fringe.c index 2ce9d043718..6221d4064d7 100644 --- a/src/fringe.c +++ b/src/fringe.c @@ -868,7 +868,7 @@ draw_fringe_bitmap (w, row, left_p) if (left_p && row->overlay_arrow_bitmap != NO_FRINGE_BITMAP) draw_fringe_bitmap_1 (w, row, 1, 1, (row->overlay_arrow_bitmap < 0 - ? get_logical_cursor_bitmap (w, Qoverlay_arrow) + ? get_logical_fringe_bitmap (w, Qoverlay_arrow, 0, 0) : row->overlay_arrow_bitmap)); } -- cgit v1.2.1 From c6c45177785676155e57a45b3d478cdd003bb9c5 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Wed, 22 Feb 2006 07:59:26 +0000 Subject: (struct _XGC) [!MAC_OSX || !USE_ATSUI]: New member n_clip_rects. --- src/macgui.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/macgui.h b/src/macgui.h index cfe35e82945..a84fea1ae91 100644 --- a/src/macgui.h +++ b/src/macgui.h @@ -217,13 +217,13 @@ typedef struct _XGC RGBColor back_color; #define MAX_CLIP_RECTS 2 - /* QuickDraw clipping region. */ + /* Number of clipping rectangles. */ + int n_clip_rects; + + /* QuickDraw clipping region. Ignored if n_clip_rects == 0. */ RgnHandle clip_region; #if defined (MAC_OSX) && USE_ATSUI - /* Number of clipping rectangles used in Quartz 2D drawing. */ - int n_clip_rects; - /* Clipping rectangles used in Quartz 2D drawing. The y-coordinate is in QuickDraw's. */ CGRect clip_rects[MAX_CLIP_RECTS]; -- cgit v1.2.1 From e188aa29a937c53de32fd52c56e6c7fc8ca0c528 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Wed, 22 Feb 2006 07:59:34 +0000 Subject: (digest_single_submenu): Apply 2006-02-19 change for xmenu.c. --- src/macmenu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/macmenu.c b/src/macmenu.c index fccbbe6402c..8cce41114de 100644 --- a/src/macmenu.c +++ b/src/macmenu.c @@ -1257,8 +1257,11 @@ digest_single_submenu (start, end, top_level_items) wv->enabled = 1; wv->button_type = BUTTON_TYPE_NONE; wv->help = Qnil; + save_wv = wv; } - save_wv = wv; + else + save_wv = first_wv; + prev_wv = 0; i += MENU_ITEMS_PANE_LENGTH; } -- cgit v1.2.1 From b6e3efe044c0afb0b0a0c01c1cb846dde058adbc Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Wed, 22 Feb 2006 08:00:12 +0000 Subject: (GC_CLIP_REGION): Remove macro. (mac_begin_clip, mac_end_clip): Take arg GC instead of REGION. All uses changed. Don't do clipping if n_clip_rects is zero. (mac_set_clip_rectangles): Use xassert instead of abort. Set n_clip_rects. Don't make clip_region empty when number of clipping rectangles is zero. (mac_reset_clip_rectangles): Set n_clip_rects directly instead of calling mac_set_clip_rectangles. (x_set_toolkit_scroll_bar_thumb): Temporarily hide scroll bar to avoid multiple redraws. --- src/ChangeLog | 19 ++++++++++++++ src/macterm.c | 80 +++++++++++++++++++++++++++++------------------------------ 2 files changed, 58 insertions(+), 41 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 6df63457d77..d6a1ec83313 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,22 @@ +2006-02-22 YAMAMOTO Mitsuharu + + * macgui.h (struct _XGC) [!MAC_OSX || !USE_ATSUI]: New member + n_clip_rects. + + * macmenu.c (digest_single_submenu): Apply 2006-02-19 change for + xmenu.c. + + * macterm.c (GC_CLIP_REGION): Remove macro. + (mac_begin_clip, mac_end_clip): Take arg GC instead of REGION. + All uses changed. Don't do clipping if n_clip_rects is zero. + (mac_set_clip_rectangles): Use xassert instead of abort. Set + n_clip_rects. Don't make clip_region empty when number of + clipping rectangles is zero. + (mac_reset_clip_rectangles): Set n_clip_rects directly instead of + calling mac_set_clip_rectangles. + (x_set_toolkit_scroll_bar_thumb): Temporarily hide scroll bar to + avoid multiple redraws. + 2006-02-22 Kim F. Storm * fringe.c (draw_fringe_bitmap): Fix overlay-arrow display. diff --git a/src/macterm.c b/src/macterm.c index 40a20026bd2..5fd416be6b8 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -267,14 +267,13 @@ extern void menubar_selection_callback (FRAME_PTR, int); #define GC_FORE_COLOR(gc) (&(gc)->fore_color) #define GC_BACK_COLOR(gc) (&(gc)->back_color) #define GC_FONT(gc) ((gc)->xgcv.font) -#define GC_CLIP_REGION(gc) ((gc)->clip_region) #define FRAME_NORMAL_GC(f) ((f)->output_data.mac->normal_gc) static RgnHandle saved_port_clip_region = NULL; static void -mac_begin_clip (region) - RgnHandle region; +mac_begin_clip (gc) + GC gc; { static RgnHandle new_region = NULL; @@ -283,19 +282,19 @@ mac_begin_clip (region) if (new_region == NULL) new_region = NewRgn (); - if (region && !EmptyRgn (region)) + if (gc->n_clip_rects) { GetClip (saved_port_clip_region); - SectRgn (saved_port_clip_region, region, new_region); + SectRgn (saved_port_clip_region, gc->clip_region, new_region); SetClip (new_region); } } static void -mac_end_clip (region) - RgnHandle region; +mac_end_clip (gc) + GC gc; { - if (region && !EmptyRgn (region)) + if (gc->n_clip_rects) SetClip (saved_port_clip_region); } @@ -323,10 +322,10 @@ mac_draw_line (f, gc, x1, y1, x2, y2) RGBForeColor (GC_FORE_COLOR (gc)); - mac_begin_clip (GC_CLIP_REGION (gc)); + mac_begin_clip (gc); MoveTo (x1, y1); LineTo (x2, y2); - mac_end_clip (GC_CLIP_REGION (gc)); + mac_end_clip (gc); } void @@ -367,9 +366,9 @@ mac_erase_rectangle (f, gc, x, y, width, height) RGBBackColor (GC_BACK_COLOR (gc)); SetRect (&r, x, y, x + width, y + height); - mac_begin_clip (GC_CLIP_REGION (gc)); + mac_begin_clip (gc); EraseRect (&r); - mac_end_clip (GC_CLIP_REGION (gc)); + mac_end_clip (gc); RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); } @@ -432,7 +431,7 @@ mac_draw_bitmap (f, gc, x, y, width, height, bits, overlay_p) RGBBackColor (GC_BACK_COLOR (gc)); SetRect (&r, x, y, x + width, y + height); - mac_begin_clip (GC_CLIP_REGION (gc)); + mac_begin_clip (gc); #if TARGET_API_MAC_CARBON { CGrafPtr port; @@ -447,7 +446,7 @@ mac_draw_bitmap (f, gc, x, y, width, height, bits, overlay_p) CopyBits (&bitmap, &(FRAME_MAC_WINDOW (f)->portBits), &(bitmap.bounds), &r, overlay_p ? srcOr : srcCopy, 0); #endif /* not TARGET_API_MAC_CARBON */ - mac_end_clip (GC_CLIP_REGION (gc)); + mac_end_clip (gc); RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); } @@ -579,9 +578,9 @@ mac_fill_rectangle (f, gc, x, y, width, height) RGBForeColor (GC_FORE_COLOR (gc)); SetRect (&r, x, y, x + width, y + height); - mac_begin_clip (GC_CLIP_REGION (gc)); + mac_begin_clip (gc); PaintRect (&r); /* using foreground color of gc */ - mac_end_clip (GC_CLIP_REGION (gc)); + mac_end_clip (gc); } @@ -601,9 +600,9 @@ mac_draw_rectangle (f, gc, x, y, width, height) RGBForeColor (GC_FORE_COLOR (gc)); SetRect (&r, x, y, x + width + 1, y + height + 1); - mac_begin_clip (GC_CLIP_REGION (gc)); + mac_begin_clip (gc); FrameRect (&r); /* using foreground color of gc */ - mac_end_clip (GC_CLIP_REGION (gc)); + mac_end_clip (gc); } @@ -718,7 +717,7 @@ mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width, bytes_per_char) if (!mac_use_core_graphics) { #endif - mac_begin_clip (GC_CLIP_REGION (gc)); + mac_begin_clip (gc); RGBForeColor (GC_FORE_COLOR (gc)); if (bg_width) { @@ -734,7 +733,7 @@ mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width, bytes_per_char) ATSUDrawText (text_layout, kATSUFromTextBeginning, kATSUToTextEnd, kATSUUseGrafPortPenLoc, kATSUUseGrafPortPenLoc); - mac_end_clip (GC_CLIP_REGION (gc)); + mac_end_clip (gc); #ifdef MAC_OSX } else @@ -807,7 +806,7 @@ mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width, bytes_per_char) if (mac_use_core_graphics) savedFlags = SwapQDTextFlags (kQDUseCGTextRendering); #endif - mac_begin_clip (GC_CLIP_REGION (gc)); + mac_begin_clip (gc); RGBForeColor (GC_FORE_COLOR (gc)); #ifdef MAC_OS8 if (bg_width) @@ -843,7 +842,7 @@ mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width, bytes_per_char) DrawText (buf, 0, nchars * bytes_per_char); if (bg_width) RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); - mac_end_clip (GC_CLIP_REGION (gc)); + mac_end_clip (gc); #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 if (mac_use_core_graphics) @@ -1185,7 +1184,7 @@ mac_copy_area (src, f, gc, src_x, src_y, width, height, dest_x, dest_y) ForeColor (blackColor); BackColor (whiteColor); - mac_begin_clip (GC_CLIP_REGION (gc)); + mac_begin_clip (gc); LockPixels (GetGWorldPixMap (src)); #if TARGET_API_MAC_CARBON { @@ -1203,7 +1202,7 @@ mac_copy_area (src, f, gc, src_x, src_y, width, height, dest_x, dest_y) &src_r, &dest_r, srcCopy, 0); #endif /* not TARGET_API_MAC_CARBON */ UnlockPixels (GetGWorldPixMap (src)); - mac_end_clip (GC_CLIP_REGION (gc)); + mac_end_clip (gc); RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); } @@ -1229,7 +1228,7 @@ mac_copy_area_with_mask (src, mask, f, gc, src_x, src_y, ForeColor (blackColor); BackColor (whiteColor); - mac_begin_clip (GC_CLIP_REGION (gc)); + mac_begin_clip (gc); LockPixels (GetGWorldPixMap (src)); LockPixels (GetGWorldPixMap (mask)); #if TARGET_API_MAC_CARBON @@ -1249,7 +1248,7 @@ mac_copy_area_with_mask (src, mask, f, gc, src_x, src_y, #endif /* not TARGET_API_MAC_CARBON */ UnlockPixels (GetGWorldPixMap (mask)); UnlockPixels (GetGWorldPixMap (src)); - mac_end_clip (GC_CLIP_REGION (gc)); + mac_end_clip (gc); RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); } @@ -1287,9 +1286,9 @@ mac_scroll_area (f, gc, src_x, src_y, width, height, dest_x, dest_y) color mapping in CopyBits. Otherwise, it will be slow. */ ForeColor (blackColor); BackColor (whiteColor); - mac_begin_clip (GC_CLIP_REGION (gc)); + mac_begin_clip (gc); CopyBits (&(w->portBits), &(w->portBits), &src_r, &dest_r, srcCopy, 0); - mac_end_clip (GC_CLIP_REGION (gc)); + mac_end_clip (gc); RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); #endif /* not TARGET_API_MAC_CARBON */ @@ -1425,14 +1424,10 @@ mac_set_clip_rectangles (display, gc, rectangles, n) { int i; - if (n < 0 || n > MAX_CLIP_RECTS) - abort (); - if (n == 0) - { - if (gc->clip_region) - SetEmptyRgn (gc->clip_region); - } - else + xassert (n >= 0 && n <= MAX_CLIP_RECTS); + + gc->n_clip_rects = n; + if (n > 0) { if (gc->clip_region == NULL) gc->clip_region = NewRgn (); @@ -1450,8 +1445,6 @@ mac_set_clip_rectangles (display, gc, rectangles, n) } } #if defined (MAC_OSX) && USE_ATSUI - gc->n_clip_rects = n; - for (i = 0; i < n; i++) { Rect *rect = rectangles + i; @@ -1471,7 +1464,7 @@ mac_reset_clip_rectangles (display, gc) Display *display; GC gc; { - mac_set_clip_rectangles (display, gc, NULL, 0); + gc->n_clip_rects = 0; } @@ -4536,8 +4529,7 @@ x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole) int portion, position, whole; { ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar); - - int value, viewsize, maximum; + int value, viewsize, maximum, visible_p; if (whole == 0 || XINT (bar->track_height) == 0) value = 0, viewsize = 1, maximum = 0; @@ -4550,11 +4542,17 @@ x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole) BLOCK_INPUT; + /* Temporarily hide the scroll bar to avoid multiple redraws. */ + visible_p = IsControlVisible (ch); + SetControlVisibility (ch, false, false); + SetControl32BitMinimum (ch, 0); SetControl32BitMaximum (ch, maximum); SetControl32BitValue (ch, value); SetControlViewSize (ch, viewsize); + SetControlVisibility (ch, visible_p, true); + UNBLOCK_INPUT; } -- cgit v1.2.1 From c4336e88ccef2304f13862b794e3540e193b1e97 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Wed, 22 Feb 2006 20:29:24 +0000 Subject: *** empty log message *** --- src/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index d6a1ec83313..cb908f37e4a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2006-02-22 Kim F. Storm + + * indent.c (Fvertical_motion): Only try to move back if we can. + 2006-02-22 YAMAMOTO Mitsuharu * macgui.h (struct _XGC) [!MAC_OSX || !USE_ATSUI]: New member -- cgit v1.2.1 From 78744fc3702626b26d56ab56704d27afdd6ea585 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Wed, 22 Feb 2006 20:29:41 +0000 Subject: (Fvertical_motion): Only try to move back if we can. --- src/indent.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/indent.c b/src/indent.c index fa2acd0bc05..cc928f2171f 100644 --- a/src/indent.c +++ b/src/indent.c @@ -2107,7 +2107,8 @@ whether or not it is currently displayed in some window. */) it.vpos = 0; /* Do this even if LINES is 0, so that we move back to the beginning of the current line as we ought. */ - move_it_by_lines (&it, XINT (lines), 0); + if (XINT (lines) >= 0 || IT_CHARPOS (it) > 0) + move_it_by_lines (&it, XINT (lines), 0); SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); } -- cgit v1.2.1 From acc6289a44db81134e9680dd51597abe2dbbbd92 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 22 Feb 2006 21:01:34 +0000 Subject: (Fwindow_list): Check `window' before doing XWINDOW. The default `window' should not be "on a different frame". --- src/ChangeLog | 22 ++++++++++++++++------ src/window.c | 3 ++- 2 files changed, 18 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index cb908f37e4a..2630efe73b7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-02-22 Stefan Monnier + + * window.c (Fwindow_list): Check `window' before doing XWINDOW. + The default `window' should not be "on a different frame". + 2006-02-22 Kim F. Storm * indent.c (Fvertical_motion): Only try to move back if we can. @@ -13,8 +18,8 @@ * macterm.c (GC_CLIP_REGION): Remove macro. (mac_begin_clip, mac_end_clip): Take arg GC instead of REGION. All uses changed. Don't do clipping if n_clip_rects is zero. - (mac_set_clip_rectangles): Use xassert instead of abort. Set - n_clip_rects. Don't make clip_region empty when number of + (mac_set_clip_rectangles): Use xassert instead of abort. + Set n_clip_rects. Don't make clip_region empty when number of clipping rectangles is zero. (mac_reset_clip_rectangles): Set n_clip_rects directly instead of calling mac_set_clip_rectangles. @@ -45,8 +50,8 @@ BG_WIDTH. All uses changed. Draw background if BG_WIDTH is not zero. (mac_draw_image_string, mac_draw_image_string_16): New arg BG_WIDTH. [USE_CG_TEXT_DRAWING] (mac_draw_image_string_cg): Rename from - mac_draw_string_cg. New arg BG_WIDTH. All uses changed. Draw - background if BG_WIDTH is not zero. Use float constants as + mac_draw_string_cg. New arg BG_WIDTH. All uses changed. + Draw background if BG_WIDTH is not zero. Use float constants as divisors instead of double. Use alloca instead of xmalloc/xfree. (x_draw_glyph_string_background, x_draw_glyph_string_foreground) [!MAC_OS8 || USE_ATSUI]: Background may be drawn using @@ -57,6 +62,11 @@ (mac_set_clip_rectangles): When resetting clip region, make it empty instead of disposing of it. +2006-02-20 Stefan Monnier + + * keymap.c (store_in_keymap): Change `def' arg to not be `register'. + Seems to trigger a bug in gcc-amd64 4.0.2 20051125 (Red Hat 4.0.2-8). + 2006-02-20 Kim F. Storm * Makefile.in: Add fringe.elc to WINDOW_SUPPORT. @@ -82,10 +92,10 @@ (left_curly_arrow_bits): Rename from continuation_bits. (right_curly_arrow_bits): Rename from continued_bits. (left_triangle_bits): Rename from ov_bits. - (right_triangle_bits): Added. + (right_triangle_bits): Add. (filled_rectangle_bits): Rename from filled_box_cursor_bits. (hollow_rectangle_bits): Rename from hollow_box_cursor_bits. - (filled_square_bits): Added. + (filled_square_bits): Add. (vertical_bar_bits): Rename from bar_cursor_bits. (horizontal_bar_bits): Rename from hbar_cursor_bits. (empty_line_bits): Rename from zv_bits. diff --git a/src/window.c b/src/window.c index e7040e3c496..41eaf78bea0 100644 --- a/src/window.c +++ b/src/window.c @@ -1861,7 +1861,8 @@ MINIBUF neither nil nor t means never include the minibuffer window. */) Lisp_Object frame, minibuf, window; { if (NILP (window)) - window = selected_window; + window = FRAMEP (frame) ? XFRAME (frame)->selected_window : selected_window; + CHECK_WINDOW (window); if (NILP (frame)) frame = selected_frame; -- cgit v1.2.1