aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoakim Verona2013-08-13 17:41:40 +0200
committerJoakim Verona2013-08-13 17:41:40 +0200
commitcc446d1a2479b155892fc03f58ff433e46a680fa (patch)
tree15e987b4693fe709eb5ea562ee8c6ee0e10a324a /src
parent7cb2f8b52926d37347e5a412abd7a004707258a6 (diff)
parentf10490f024a5b06d593ae4c03f6371422e2b5a56 (diff)
downloademacs-cc446d1a2479b155892fc03f58ff433e46a680fa.tar.gz
emacs-cc446d1a2479b155892fc03f58ff433e46a680fa.zip
merge from trunk
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog18
-rw-r--r--src/nsterm.h33
-rw-r--r--src/nsterm.m13
-rw-r--r--src/w32term.c27
-rw-r--r--src/w32term.h4
-rw-r--r--src/window.h26
-rw-r--r--src/xterm.c13
-rw-r--r--src/xterm.h2
8 files changed, 71 insertions, 65 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 0c8de046034..dd6a2cc6283 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,21 @@
12013-08-13 Jan Djärv <jan.h.d@swipnet.se>
2
3 * nsterm.h: Fix CGFloat for OSX 10.4 (Bug#15086).
4
52013-08-13 Dmitry Antipov <dmantipov@yandex.ru>
6
7 * window.h (WINDOW_FRINGE_EXTENDED_P): New macro.
8 * nsterm.m (ns_set_vertical_scroll_bar): Use it. Use convenient
9 bool instead of BOOL.
10 * w32term.h (struct scroll_bar): Convert fringe_extended_p
11 from Lisp_Object to bitfield. Adjust comment.
12 * w32term.c (x_scroll_bar_create): Adjust user.
13 Use WINDOW_FRINGE_EXTENDED_P and bool for boolean.
14 * xterm.c (XTset_vertical_scroll_bar): Likewise.
15 Use bool for boolean.
16 * xterm.h (struct scroll_bar): Prefer commonly used `unsigned'
17 to `unsigned int' when defining a bitfield.
18
12013-08-13 Paul Eggert <eggert@cs.ucla.edu> 192013-08-13 Paul Eggert <eggert@cs.ucla.edu>
2 20
3 * decompress.c (Fzlib_decompress_region): Try to clarify 'avail_out'. 21 * decompress.c (Fzlib_decompress_region): Try to clarify 'avail_out'.
diff --git a/src/nsterm.h b/src/nsterm.h
index 7843f369d24..c34067991f6 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -53,9 +53,24 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
53 53
54/* CGFloat on GNUStep may be 4 or 8 byte, but functions expect float* for some 54/* CGFloat on GNUStep may be 4 or 8 byte, but functions expect float* for some
55 versions. 55 versions.
56 On Cocoa, functions expect CGFloat*. Make compatible type. */ 56 On Cocoa >= 10.5, functions expect CGFloat*. Make compatible type. */
57#if defined (NS_IMPL_COCOA) || GNUSTEP_GUI_MAJOR_VERSION > 0 || \ 57#ifdef NS_IMPL_COCOA
58 GNUSTEP_GUI_MINOR_VERSION >= 22 58
59#ifndef NS_HAVE_NSINTEGER
60#if defined (__LP64__) && __LP64__
61typedef double CGFloat;
62typedef long NSInteger;
63typedef unsigned long NSUInteger;
64#else
65typedef float CGFloat;
66typedef int NSInteger;
67typedef unsigned int NSUInteger;
68#endif /* not LP64 */
69#endif /* not NS_HAVE_NSINTEGER */
70
71typedef CGFloat EmacsCGFloat;
72
73#elif GNUSTEP_GUI_MAJOR_VERSION > 0 || GNUSTEP_GUI_MINOR_VERSION >= 22
59typedef CGFloat EmacsCGFloat; 74typedef CGFloat EmacsCGFloat;
60#else 75#else
61typedef float EmacsCGFloat; 76typedef float EmacsCGFloat;
@@ -424,18 +439,6 @@ extern EmacsMenu *mainMenu, *svcsMenu, *dockMenu;
424@end 439@end
425#endif 440#endif
426 441
427#ifndef NS_HAVE_NSINTEGER
428#if defined (__LP64__) && __LP64__
429typedef double CGFloat;
430typedef long NSInteger;
431typedef unsigned long NSUInteger;
432#else
433typedef float CGFloat;
434typedef int NSInteger;
435typedef unsigned int NSUInteger;
436#endif /* not LP64 */
437#endif /* not NS_HAVE_NSINTEGER */
438
439#endif /* __OBJC__ */ 442#endif /* __OBJC__ */
440 443
441 444
diff --git a/src/nsterm.m b/src/nsterm.m
index e519244ac99..e1a60028ffc 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -3703,7 +3703,7 @@ ns_set_vertical_scroll_bar (struct window *window,
3703 int window_y, window_height; 3703 int window_y, window_height;
3704 int top, left, height, width, sb_width, sb_left; 3704 int top, left, height, width, sb_width, sb_left;
3705 EmacsScroller *bar; 3705 EmacsScroller *bar;
3706 BOOL fringe_extended_p; 3706 bool fringe_extended_p;
3707 3707
3708 /* optimization; display engine sends WAY too many of these.. */ 3708 /* optimization; display engine sends WAY too many of these.. */
3709 if (!NILP (window->vertical_scroll_bar)) 3709 if (!NILP (window->vertical_scroll_bar))
@@ -3740,16 +3740,7 @@ ns_set_vertical_scroll_bar (struct window *window,
3740 v = [view frame]; 3740 v = [view frame];
3741 r.origin.y = (v.size.height - r.size.height - r.origin.y); 3741 r.origin.y = (v.size.height - r.size.height - r.origin.y);
3742 3742
3743 if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (window)) 3743 fringe_extended_p = WINDOW_FRINGE_EXTENDED_P (w);
3744 fringe_extended_p = (WINDOW_LEFTMOST_P (window)
3745 && WINDOW_LEFT_FRINGE_WIDTH (window)
3746 && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (window)
3747 || WINDOW_LEFT_MARGIN_COLS (window) == 0));
3748 else
3749 fringe_extended_p = (WINDOW_RIGHTMOST_P (window)
3750 && WINDOW_RIGHT_FRINGE_WIDTH (window)
3751 && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (window)
3752 || WINDOW_RIGHT_MARGIN_COLS (window) == 0));
3753 3744
3754 XSETWINDOW (win, window); 3745 XSETWINDOW (win, window);
3755 block_input (); 3746 block_input ();
diff --git a/src/w32term.c b/src/w32term.c
index 15812f93ff5..2b30673c75d 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -3770,7 +3770,7 @@ x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
3770 XSETINT (bar->start, 0); 3770 XSETINT (bar->start, 0);
3771 XSETINT (bar->end, 0); 3771 XSETINT (bar->end, 0);
3772 bar->dragging = Qnil; 3772 bar->dragging = Qnil;
3773 bar->fringe_extended_p = Qnil; 3773 bar->fringe_extended_p = 0;
3774 3774
3775 /* Requires geometry to be set before call to create the real window */ 3775 /* Requires geometry to be set before call to create the real window */
3776 3776
@@ -3834,7 +3834,7 @@ w32_set_vertical_scroll_bar (struct window *w,
3834 struct scroll_bar *bar; 3834 struct scroll_bar *bar;
3835 int top, height, left, sb_left, width, sb_width; 3835 int top, height, left, sb_left, width, sb_width;
3836 int window_y, window_height; 3836 int window_y, window_height;
3837 int fringe_extended_p; 3837 bool fringe_extended_p;
3838 3838
3839 /* Get window dimensions. */ 3839 /* Get window dimensions. */
3840 window_box (w, -1, 0, &window_y, 0, &window_height); 3840 window_box (w, -1, 0, &window_y, 0, &window_height);
@@ -3858,16 +3858,7 @@ w32_set_vertical_scroll_bar (struct window *w,
3858 else 3858 else
3859 sb_left = left + (WINDOW_LEFTMOST_P (w) ? 0 : width - sb_width); 3859 sb_left = left + (WINDOW_LEFTMOST_P (w) ? 0 : width - sb_width);
3860 3860
3861 if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w)) 3861 fringe_extended_p = WINDOW_FRINGE_EXTENDED_P (w);
3862 fringe_extended_p = (WINDOW_LEFTMOST_P (w)
3863 && WINDOW_LEFT_FRINGE_WIDTH (w)
3864 && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
3865 || WINDOW_LEFT_MARGIN_COLS (w) == 0));
3866 else
3867 fringe_extended_p = (WINDOW_RIGHTMOST_P (w)
3868 && WINDOW_RIGHT_FRINGE_WIDTH (w)
3869 && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
3870 || WINDOW_RIGHT_MARGIN_COLS (w) == 0));
3871 3862
3872 /* Does the scroll bar exist yet? */ 3863 /* Does the scroll bar exist yet? */
3873 if (NILP (w->vertical_scroll_bar)) 3864 if (NILP (w->vertical_scroll_bar))
@@ -3896,11 +3887,11 @@ w32_set_vertical_scroll_bar (struct window *w,
3896 hwnd = SCROLL_BAR_W32_WINDOW (bar); 3887 hwnd = SCROLL_BAR_W32_WINDOW (bar);
3897 3888
3898 /* If already correctly positioned, do nothing. */ 3889 /* If already correctly positioned, do nothing. */
3899 if ( XINT (bar->left) == sb_left 3890 if (XINT (bar->left) == sb_left
3900 && XINT (bar->top) == top 3891 && XINT (bar->top) == top
3901 && XINT (bar->width) == sb_width 3892 && XINT (bar->width) == sb_width
3902 && XINT (bar->height) == height 3893 && XINT (bar->height) == height
3903 && !NILP (bar->fringe_extended_p) == fringe_extended_p ) 3894 && bar->fringe_extended_p == fringe_extended_p)
3904 { 3895 {
3905 /* Redraw after clear_frame. */ 3896 /* Redraw after clear_frame. */
3906 if (!my_show_window (f, hwnd, SW_NORMAL)) 3897 if (!my_show_window (f, hwnd, SW_NORMAL))
@@ -3950,7 +3941,7 @@ w32_set_vertical_scroll_bar (struct window *w,
3950 unblock_input (); 3941 unblock_input ();
3951 } 3942 }
3952 } 3943 }
3953 bar->fringe_extended_p = fringe_extended_p ? Qt : Qnil; 3944 bar->fringe_extended_p = fringe_extended_p;
3954 3945
3955 w32_set_scroll_bar_thumb (bar, portion, position, whole); 3946 w32_set_scroll_bar_thumb (bar, portion, position, whole);
3956 XSETVECTOR (barobj, bar); 3947 XSETVECTOR (barobj, bar);
diff --git a/src/w32term.h b/src/w32term.h
index 3c9cce35221..8a1bbd11766 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -451,9 +451,9 @@ struct scroll_bar {
451 being dragged, this is Qnil. */ 451 being dragged, this is Qnil. */
452 Lisp_Object dragging; 452 Lisp_Object dragging;
453 453
454 /* t if the background of the fringe that is adjacent to a scroll 454 /* 1 if the background of the fringe that is adjacent to a scroll
455 bar is extended to the gap between the fringe and the bar. */ 455 bar is extended to the gap between the fringe and the bar. */
456 Lisp_Object fringe_extended_p; 456 unsigned fringe_extended_p : 1;
457}; 457};
458 458
459/* Turning a lisp vector value into a pointer to a struct scroll_bar. */ 459/* Turning a lisp vector value into a pointer to a struct scroll_bar. */
diff --git a/src/window.h b/src/window.h
index a9afbc7f4a3..9d41a14cd23 100644
--- a/src/window.h
+++ b/src/window.h
@@ -828,13 +828,25 @@ wset_next_buffers (struct window *w, Lisp_Object val)
828#define WINDOW_TEXT_TO_FRAME_PIXEL_X(W, X) \ 828#define WINDOW_TEXT_TO_FRAME_PIXEL_X(W, X) \
829 (window_box_left ((W), TEXT_AREA) + (X)) 829 (window_box_left ((W), TEXT_AREA) + (X))
830 830
831/* This is the window in which the terminal's cursor should 831/* Nonzero if the background of the window W's fringe that is adjacent to
832 be left when nothing is being done with it. This must 832 a scroll bar is extended to the gap between the fringe and the bar. */
833 always be a leaf window, and its buffer is selected by 833
834 the top level editing loop at the end of each command. 834#define WINDOW_FRINGE_EXTENDED_P(w) \
835 835 (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) \
836 This value is always the same as 836 ? (WINDOW_LEFTMOST_P (w) \
837 FRAME_SELECTED_WINDOW (selected_frame). */ 837 && WINDOW_LEFT_FRINGE_WIDTH (w) \
838 && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) \
839 || WINDOW_LEFT_MARGIN_COLS (w) == 0)) \
840 : (WINDOW_RIGHTMOST_P (w) \
841 && WINDOW_RIGHT_FRINGE_WIDTH (w) \
842 && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) \
843 || WINDOW_RIGHT_MARGIN_COLS (w) == 0)))
844
845/* This is the window in which the terminal's cursor should be left when
846 nothing is being done with it. This must always be a leaf window, and its
847 buffer is selected by the top level editing loop at the end of each command.
848
849 This value is always the same as FRAME_SELECTED_WINDOW (selected_frame). */
838 850
839extern Lisp_Object selected_window; 851extern Lisp_Object selected_window;
840 852
diff --git a/src/xterm.c b/src/xterm.c
index f845deabd82..7b42e858304 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -5164,7 +5164,7 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
5164 int top, height, left, sb_left, width, sb_width; 5164 int top, height, left, sb_left, width, sb_width;
5165 int window_y, window_height; 5165 int window_y, window_height;
5166#ifdef USE_TOOLKIT_SCROLL_BARS 5166#ifdef USE_TOOLKIT_SCROLL_BARS
5167 int fringe_extended_p; 5167 bool fringe_extended_p;
5168#endif 5168#endif
5169 5169
5170 /* Get window dimensions. */ 5170 /* Get window dimensions. */
@@ -5197,16 +5197,7 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
5197#endif 5197#endif
5198 5198
5199#ifdef USE_TOOLKIT_SCROLL_BARS 5199#ifdef USE_TOOLKIT_SCROLL_BARS
5200 if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w)) 5200 fringe_extended_p = WINDOW_FRINGE_EXTENDED_P (w);
5201 fringe_extended_p = (WINDOW_LEFTMOST_P (w)
5202 && WINDOW_LEFT_FRINGE_WIDTH (w)
5203 && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
5204 || WINDOW_LEFT_MARGIN_COLS (w) == 0));
5205 else
5206 fringe_extended_p = (WINDOW_RIGHTMOST_P (w)
5207 && WINDOW_RIGHT_FRINGE_WIDTH (w)
5208 && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
5209 || WINDOW_RIGHT_MARGIN_COLS (w) == 0));
5210#endif 5201#endif
5211 5202
5212 /* Does the scroll bar exist yet? */ 5203 /* Does the scroll bar exist yet? */
diff --git a/src/xterm.h b/src/xterm.h
index 5324ef628e7..fbc2f05a375 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -815,7 +815,7 @@ struct scroll_bar
815 815
816 /* 1 if the background of the fringe that is adjacent to a scroll 816 /* 1 if the background of the fringe that is adjacent to a scroll
817 bar is extended to the gap between the fringe and the bar. */ 817 bar is extended to the gap between the fringe and the bar. */
818 unsigned int fringe_extended_p : 1; 818 unsigned fringe_extended_p : 1;
819}; 819};
820 820
821/* Turning a lisp vector value into a pointer to a struct scroll_bar. */ 821/* Turning a lisp vector value into a pointer to a struct scroll_bar. */