diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/alloc.c | 2 | ||||
| -rw-r--r-- | src/font.c | 2 | ||||
| -rw-r--r-- | src/frame.c | 2 | ||||
| -rw-r--r-- | src/ftfont.c | 7 | ||||
| -rw-r--r-- | src/gtkutil.c | 100 | ||||
| -rw-r--r-- | src/keyboard.c | 8 | ||||
| -rw-r--r-- | src/term.c | 7 | ||||
| -rw-r--r-- | src/w32font.c | 3 | ||||
| -rw-r--r-- | src/xdisp.c | 7 | ||||
| -rw-r--r-- | src/xwidget.c | 4 |
10 files changed, 61 insertions, 81 deletions
diff --git a/src/alloc.c b/src/alloc.c index 1e4ec8b0573..56a535411c8 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -3724,7 +3724,6 @@ make_save_ptr_int (void *a, ptrdiff_t b) | |||
| 3724 | return val; | 3724 | return val; |
| 3725 | } | 3725 | } |
| 3726 | 3726 | ||
| 3727 | #if ! (defined USE_X_TOOLKIT || defined USE_GTK) | ||
| 3728 | Lisp_Object | 3727 | Lisp_Object |
| 3729 | make_save_ptr_ptr (void *a, void *b) | 3728 | make_save_ptr_ptr (void *a, void *b) |
| 3730 | { | 3729 | { |
| @@ -3735,7 +3734,6 @@ make_save_ptr_ptr (void *a, void *b) | |||
| 3735 | p->data[1].pointer = b; | 3734 | p->data[1].pointer = b; |
| 3736 | return val; | 3735 | return val; |
| 3737 | } | 3736 | } |
| 3738 | #endif | ||
| 3739 | 3737 | ||
| 3740 | Lisp_Object | 3738 | Lisp_Object |
| 3741 | make_save_funcptr_ptr_obj (void (*a) (void), void *b, Lisp_Object c) | 3739 | make_save_funcptr_ptr_obj (void (*a) (void), void *b, Lisp_Object c) |
diff --git a/src/font.c b/src/font.c index 5ab3b3e8399..2519599bc63 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -5317,7 +5317,7 @@ syms_of_font (void) | |||
| 5317 | DEFSYM (Qja, "ja"); | 5317 | DEFSYM (Qja, "ja"); |
| 5318 | DEFSYM (Qko, "ko"); | 5318 | DEFSYM (Qko, "ko"); |
| 5319 | 5319 | ||
| 5320 | DEFSYM (QCuser_spec, "user-spec"); | 5320 | DEFSYM (QCuser_spec, ":user-spec"); |
| 5321 | 5321 | ||
| 5322 | staticpro (&scratch_font_spec); | 5322 | staticpro (&scratch_font_spec); |
| 5323 | scratch_font_spec = Ffont_spec (0, NULL); | 5323 | scratch_font_spec = Ffont_spec (0, NULL); |
diff --git a/src/frame.c b/src/frame.c index 88102a36625..9c8926c42c7 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -4563,7 +4563,7 @@ On Nextstep, this just calls `ns-parse-geometry'. */) | |||
| 4563 | 4563 | ||
| 4564 | This function does not make the coordinates positive. */ | 4564 | This function does not make the coordinates positive. */ |
| 4565 | 4565 | ||
| 4566 | #define DEFAULT_ROWS 35 | 4566 | #define DEFAULT_ROWS 36 |
| 4567 | #define DEFAULT_COLS 80 | 4567 | #define DEFAULT_COLS 80 |
| 4568 | 4568 | ||
| 4569 | long | 4569 | long |
diff --git a/src/ftfont.c b/src/ftfont.c index a402245a067..7285aee9bd4 100644 --- a/src/ftfont.c +++ b/src/ftfont.c | |||
| @@ -2596,7 +2596,12 @@ ftfont_shape_by_flt (Lisp_Object lgstring, struct font *font, | |||
| 2596 | language information, and select a proper flt for them | 2596 | language information, and select a proper flt for them |
| 2597 | here. */ | 2597 | here. */ |
| 2598 | int c1 = LGLYPH_CHAR (LGSTRING_GLYPH (lgstring, 1)); | 2598 | int c1 = LGLYPH_CHAR (LGSTRING_GLYPH (lgstring, 1)); |
| 2599 | if (CHAR_HAS_CATEGORY (c1, '^')) | 2599 | /* For the combining characters in the range U+300..U+36F, |
| 2600 | "combining" is the sole FLT provided by the m17n-lib. In | ||
| 2601 | addition, it is the sole FLT that can handle the other | ||
| 2602 | combining characters with non-OTF fonts. */ | ||
| 2603 | if ((0x300 <= c1 && c1 <= 0x36F) | ||
| 2604 | || (! otf && CHAR_HAS_CATEGORY (c1, '^'))) | ||
| 2600 | flt = mflt_get (msymbol ("combining")); | 2605 | flt = mflt_get (msymbol ("combining")); |
| 2601 | } | 2606 | } |
| 2602 | if (! flt && ! otf) | 2607 | if (! flt && ! otf) |
diff --git a/src/gtkutil.c b/src/gtkutil.c index ba059b73a70..e791e6ac317 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -252,35 +252,6 @@ xg_create_default_cursor (Display *dpy) | |||
| 252 | return gdk_cursor_new_for_display (gdpy, GDK_LEFT_PTR); | 252 | return gdk_cursor_new_for_display (gdpy, GDK_LEFT_PTR); |
| 253 | } | 253 | } |
| 254 | 254 | ||
| 255 | static GdkPixbuf * | ||
| 256 | xg_get_pixbuf_from_pixmap (struct frame *f, Pixmap pix) | ||
| 257 | { | ||
| 258 | int iunused; | ||
| 259 | GdkPixbuf *tmp_buf; | ||
| 260 | Window wunused; | ||
| 261 | unsigned int width, height, uunused; | ||
| 262 | XImage *xim; | ||
| 263 | |||
| 264 | XGetGeometry (FRAME_X_DISPLAY (f), pix, &wunused, &iunused, &iunused, | ||
| 265 | &width, &height, &uunused, &uunused); | ||
| 266 | |||
| 267 | xim = XGetImage (FRAME_X_DISPLAY (f), pix, 0, 0, width, height, | ||
| 268 | ~0, XYPixmap); | ||
| 269 | if (!xim) return 0; | ||
| 270 | |||
| 271 | tmp_buf = gdk_pixbuf_new_from_data ((guchar *) xim->data, | ||
| 272 | GDK_COLORSPACE_RGB, | ||
| 273 | FALSE, | ||
| 274 | xim->bitmap_unit, | ||
| 275 | width, | ||
| 276 | height, | ||
| 277 | xim->bytes_per_line, | ||
| 278 | NULL, | ||
| 279 | NULL); | ||
| 280 | XDestroyImage (xim); | ||
| 281 | return tmp_buf; | ||
| 282 | } | ||
| 283 | |||
| 284 | /* Apply GMASK to GPIX and return a GdkPixbuf with an alpha channel. */ | 255 | /* Apply GMASK to GPIX and return a GdkPixbuf with an alpha channel. */ |
| 285 | 256 | ||
| 286 | static GdkPixbuf * | 257 | static GdkPixbuf * |
| @@ -288,46 +259,43 @@ xg_get_pixbuf_from_pix_and_mask (struct frame *f, | |||
| 288 | Pixmap pix, | 259 | Pixmap pix, |
| 289 | Pixmap mask) | 260 | Pixmap mask) |
| 290 | { | 261 | { |
| 291 | int width, height; | 262 | GdkPixbuf *icon_buf = 0; |
| 292 | GdkPixbuf *icon_buf, *tmp_buf; | 263 | int iunused; |
| 293 | 264 | Window wunused; | |
| 294 | tmp_buf = xg_get_pixbuf_from_pixmap (f, pix); | 265 | unsigned int width, height, depth, uunused; |
| 295 | icon_buf = gdk_pixbuf_add_alpha (tmp_buf, FALSE, 0, 0, 0); | ||
| 296 | g_object_unref (G_OBJECT (tmp_buf)); | ||
| 297 | |||
| 298 | width = gdk_pixbuf_get_width (icon_buf); | ||
| 299 | height = gdk_pixbuf_get_height (icon_buf); | ||
| 300 | 266 | ||
| 301 | if (mask) | 267 | if (FRAME_DISPLAY_INFO (f)->red_bits != 8) |
| 268 | return 0; | ||
| 269 | XGetGeometry (FRAME_X_DISPLAY (f), pix, &wunused, &iunused, &iunused, | ||
| 270 | &width, &height, &uunused, &depth); | ||
| 271 | if (depth != 24) | ||
| 272 | return 0; | ||
| 273 | XImage *xim = XGetImage (FRAME_X_DISPLAY (f), pix, 0, 0, width, height, | ||
| 274 | ~0, XYPixmap); | ||
| 275 | if (xim) | ||
| 302 | { | 276 | { |
| 303 | GdkPixbuf *mask_buf = xg_get_pixbuf_from_pixmap (f, mask); | 277 | XImage *xmm = (! mask ? 0 |
| 304 | guchar *pixels = gdk_pixbuf_get_pixels (icon_buf); | 278 | : XGetImage (FRAME_X_DISPLAY (f), mask, 0, 0, |
| 305 | guchar *mask_pixels = gdk_pixbuf_get_pixels (mask_buf); | 279 | width, height, ~0, XYPixmap)); |
| 306 | int rowstride = gdk_pixbuf_get_rowstride (icon_buf); | 280 | icon_buf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, width, height); |
| 307 | int mask_rowstride = gdk_pixbuf_get_rowstride (mask_buf); | 281 | if (icon_buf) |
| 308 | int y; | 282 | { |
| 309 | 283 | guchar *pixels = gdk_pixbuf_get_pixels (icon_buf); | |
| 310 | for (y = 0; y < height; ++y) | 284 | int rowjunkwidth = gdk_pixbuf_get_rowstride (icon_buf) - width * 4; |
| 311 | { | 285 | for (int y = 0; y < height; y++, pixels += rowjunkwidth) |
| 312 | guchar *iconptr, *maskptr; | 286 | for (int x = 0; x < width; x++) |
| 313 | int x; | 287 | { |
| 314 | 288 | unsigned long rgb = XGetPixel (xim, x, y); | |
| 315 | iconptr = pixels + y * rowstride; | 289 | *pixels++ = (rgb >> 16) & 255; |
| 316 | maskptr = mask_pixels + y * mask_rowstride; | 290 | *pixels++ = (rgb >> 8) & 255; |
| 317 | 291 | *pixels++ = rgb & 255; | |
| 318 | for (x = 0; x < width; ++x) | 292 | *pixels++ = xmm && !XGetPixel (xmm, x, y) ? 0 : 255; |
| 319 | { | 293 | } |
| 320 | /* In a bitmap, RGB is either 255/255/255 or 0/0/0. Checking | 294 | } |
| 321 | just R is sufficient. */ | ||
| 322 | if (maskptr[0] == 0) | ||
| 323 | iconptr[3] = 0; /* 0, 1, 2 is R, G, B. 3 is alpha. */ | ||
| 324 | |||
| 325 | iconptr += rowstride/width; | ||
| 326 | maskptr += mask_rowstride/width; | ||
| 327 | } | ||
| 328 | } | ||
| 329 | 295 | ||
| 330 | g_object_unref (G_OBJECT (mask_buf)); | 296 | if (xmm) |
| 297 | XDestroyImage (xmm); | ||
| 298 | XDestroyImage (xim); | ||
| 331 | } | 299 | } |
| 332 | 300 | ||
| 333 | return icon_buf; | 301 | return icon_buf; |
diff --git a/src/keyboard.c b/src/keyboard.c index 1a5dbd0f617..54643eebba4 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -2529,7 +2529,7 @@ read_char (int commandflag, Lisp_Object map, | |||
| 2529 | if (KEYMAPP (map) && INTERACTIVE | 2529 | if (KEYMAPP (map) && INTERACTIVE |
| 2530 | && !NILP (prev_event) && ! EVENT_HAS_PARAMETERS (prev_event) | 2530 | && !NILP (prev_event) && ! EVENT_HAS_PARAMETERS (prev_event) |
| 2531 | /* Don't bring up a menu if we already have another event. */ | 2531 | /* Don't bring up a menu if we already have another event. */ |
| 2532 | && NILP (Vunread_command_events) | 2532 | && !CONSP (Vunread_command_events) |
| 2533 | && !detect_input_pending_run_timers (0)) | 2533 | && !detect_input_pending_run_timers (0)) |
| 2534 | { | 2534 | { |
| 2535 | c = read_char_minibuf_menu_prompt (commandflag, map); | 2535 | c = read_char_minibuf_menu_prompt (commandflag, map); |
| @@ -2660,7 +2660,7 @@ read_char (int commandflag, Lisp_Object map, | |||
| 2660 | && !EQ (XCAR (prev_event), Qmenu_bar) | 2660 | && !EQ (XCAR (prev_event), Qmenu_bar) |
| 2661 | && !EQ (XCAR (prev_event), Qtool_bar) | 2661 | && !EQ (XCAR (prev_event), Qtool_bar) |
| 2662 | /* Don't bring up a menu if we already have another event. */ | 2662 | /* Don't bring up a menu if we already have another event. */ |
| 2663 | && NILP (Vunread_command_events)) | 2663 | && !CONSP (Vunread_command_events)) |
| 2664 | { | 2664 | { |
| 2665 | c = read_char_x_menu_prompt (map, prev_event, used_mouse_menu); | 2665 | c = read_char_x_menu_prompt (map, prev_event, used_mouse_menu); |
| 2666 | 2666 | ||
| @@ -9877,7 +9877,7 @@ clear_input_pending (void) | |||
| 9877 | bool | 9877 | bool |
| 9878 | requeued_events_pending_p (void) | 9878 | requeued_events_pending_p (void) |
| 9879 | { | 9879 | { |
| 9880 | return (!NILP (Vunread_command_events)); | 9880 | return (CONSP (Vunread_command_events)); |
| 9881 | } | 9881 | } |
| 9882 | 9882 | ||
| 9883 | DEFUN ("input-pending-p", Finput_pending_p, Sinput_pending_p, 0, 1, 0, | 9883 | DEFUN ("input-pending-p", Finput_pending_p, Sinput_pending_p, 0, 1, 0, |
| @@ -9888,7 +9888,7 @@ if there is a doubt, the value is t. | |||
| 9888 | If CHECK-TIMERS is non-nil, timers that are ready to run will do so. */) | 9888 | If CHECK-TIMERS is non-nil, timers that are ready to run will do so. */) |
| 9889 | (Lisp_Object check_timers) | 9889 | (Lisp_Object check_timers) |
| 9890 | { | 9890 | { |
| 9891 | if (!NILP (Vunread_command_events) | 9891 | if (CONSP (Vunread_command_events) |
| 9892 | || !NILP (Vunread_post_input_method_events) | 9892 | || !NILP (Vunread_post_input_method_events) |
| 9893 | || !NILP (Vunread_input_method_events)) | 9893 | || !NILP (Vunread_input_method_events)) |
| 9894 | return (Qt); | 9894 | return (Qt); |
diff --git a/src/term.c b/src/term.c index 17f36795998..a77e5729b5b 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -3402,9 +3402,11 @@ static void | |||
| 3402 | tty_pop_down_menu (Lisp_Object arg) | 3402 | tty_pop_down_menu (Lisp_Object arg) |
| 3403 | { | 3403 | { |
| 3404 | tty_menu *menu = XSAVE_POINTER (arg, 0); | 3404 | tty_menu *menu = XSAVE_POINTER (arg, 0); |
| 3405 | struct buffer *orig_buffer = XSAVE_POINTER (arg, 1); | ||
| 3405 | 3406 | ||
| 3406 | block_input (); | 3407 | block_input (); |
| 3407 | tty_menu_destroy (menu); | 3408 | tty_menu_destroy (menu); |
| 3409 | set_buffer_internal (orig_buffer); | ||
| 3408 | unblock_input (); | 3410 | unblock_input (); |
| 3409 | } | 3411 | } |
| 3410 | 3412 | ||
| @@ -3683,7 +3685,10 @@ tty_menu_show (struct frame *f, int x, int y, int menuflags, | |||
| 3683 | 3685 | ||
| 3684 | pane = selidx = 0; | 3686 | pane = selidx = 0; |
| 3685 | 3687 | ||
| 3686 | record_unwind_protect (tty_pop_down_menu, make_save_ptr (menu)); | 3688 | /* We save and restore the current buffer because tty_menu_activate |
| 3689 | triggers redisplay, which switches buffers at will. */ | ||
| 3690 | record_unwind_protect (tty_pop_down_menu, | ||
| 3691 | make_save_ptr_ptr (menu, current_buffer)); | ||
| 3687 | 3692 | ||
| 3688 | specbind (Qoverriding_terminal_local_map, | 3693 | specbind (Qoverriding_terminal_local_map, |
| 3689 | Fsymbol_value (Qtty_menu_navigation_map)); | 3694 | Fsymbol_value (Qtty_menu_navigation_map)); |
diff --git a/src/w32font.c b/src/w32font.c index a1878adb4bd..018e6572563 100644 --- a/src/w32font.c +++ b/src/w32font.c | |||
| @@ -796,7 +796,8 @@ w32font_list_internal (struct frame *f, Lisp_Object font_spec, | |||
| 796 | && !EQ (spec_charset, Qiso10646_1) | 796 | && !EQ (spec_charset, Qiso10646_1) |
| 797 | && !EQ (spec_charset, Qunicode_bmp) | 797 | && !EQ (spec_charset, Qunicode_bmp) |
| 798 | && !EQ (spec_charset, Qunicode_sip) | 798 | && !EQ (spec_charset, Qunicode_sip) |
| 799 | && !EQ (spec_charset, Qunknown)) | 799 | && !EQ (spec_charset, Qunknown) |
| 800 | && !EQ (spec_charset, Qascii_0)) | ||
| 800 | return Qnil; | 801 | return Qnil; |
| 801 | } | 802 | } |
| 802 | 803 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index bdc8af8b5bf..290f69878da 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -31386,8 +31386,11 @@ Value is a number or a cons (WIDTH-DPI . HEIGHT-DPI). */); | |||
| 31386 | Vtruncate_partial_width_windows, | 31386 | Vtruncate_partial_width_windows, |
| 31387 | doc: /* Non-nil means truncate lines in windows narrower than the frame. | 31387 | doc: /* Non-nil means truncate lines in windows narrower than the frame. |
| 31388 | For an integer value, truncate lines in each window narrower than the | 31388 | For an integer value, truncate lines in each window narrower than the |
| 31389 | full frame width, provided the window width is less than that integer; | 31389 | full frame width, provided the total window width in column units is less |
| 31390 | otherwise, respect the value of `truncate-lines'. | 31390 | than that integer; otherwise, respect the value of `truncate-lines'. |
| 31391 | The total width of the window is as returned by `window-total-width', it | ||
| 31392 | includes the fringes, the continuation and truncation glyphs, the | ||
| 31393 | display margins (if any), and the scroll bar | ||
| 31391 | 31394 | ||
| 31392 | For any other non-nil value, truncate lines in all windows that do | 31395 | For any other non-nil value, truncate lines in all windows that do |
| 31393 | not span the full frame width. | 31396 | not span the full frame width. |
diff --git a/src/xwidget.c b/src/xwidget.c index d438d879098..c24475f5312 100644 --- a/src/xwidget.c +++ b/src/xwidget.c | |||
| @@ -767,14 +767,14 @@ VALUE is the amount to scroll, either relatively or absolutely. */) | |||
| 767 | Lisp_Object value) | 767 | Lisp_Object value) |
| 768 | { | 768 | { |
| 769 | CHECK_XWIDGET (xwidget); | 769 | CHECK_XWIDGET (xwidget); |
| 770 | CHECK_NATNUM (value); | 770 | CHECK_NUMBER (value); |
| 771 | struct xwidget *xw = XXWIDGET (xwidget); | 771 | struct xwidget *xw = XXWIDGET (xwidget); |
| 772 | GtkAdjustment *adjustment | 772 | GtkAdjustment *adjustment |
| 773 | = ((EQ (Qhorizontal, axis) | 773 | = ((EQ (Qhorizontal, axis) |
| 774 | ? gtk_scrolled_window_get_hadjustment | 774 | ? gtk_scrolled_window_get_hadjustment |
| 775 | : gtk_scrolled_window_get_vadjustment) | 775 | : gtk_scrolled_window_get_vadjustment) |
| 776 | (GTK_SCROLLED_WINDOW (xw->widgetscrolledwindow_osr))); | 776 | (GTK_SCROLLED_WINDOW (xw->widgetscrolledwindow_osr))); |
| 777 | double final_value = XFASTINT (value); | 777 | double final_value = XINT (value); |
| 778 | if (EQ (Qt, relative)) | 778 | if (EQ (Qt, relative)) |
| 779 | final_value += gtk_adjustment_get_value (adjustment); | 779 | final_value += gtk_adjustment_get_value (adjustment); |
| 780 | gtk_adjustment_set_value (adjustment, final_value); | 780 | gtk_adjustment_set_value (adjustment, final_value); |