1. 24 Jan, 2020 2 commits
    • Alan Third's avatar
      Draw to offscreen buffer on macOS · f674c905
      Alan Third authored
      * src/nsfns.m (x_set_background_color): Clear the frame after changing
      the background color, not before.
      * src/nsterm.h (drawingBuffer): New variable.
      ([EmacsView focusOnDrawingBuffer]):
      ([EmacsView copyRect:to:]):
      ([EmacsView createDrawingBufferWithRect:]): New methods.
      * src/nsterm.m (ns_update_begin):
      (ns_unfocus): Handle drawing to offscreen buffer.
      (ns_clip_to_row): Use ns_row_rect.
      (ns_copy_bits): Remove unused function.
      (ns_shift_glyphs_for_insert): Use new scrolling method.
      (ns_dumpglyphs_image): When drawing to the offscreen buffer, flip
      images so they appear the right way up.
      (ns_dumpglyphs_stretch): Remove unnecessary code.
      (ns_draw_window_cursor): Don't disable screen updates.
      ([EmacsView updateFrameSize:]): Update the size of the offscreen
      ([EmacsView initFrameFromEmacs:]): Create offscreen buffer.
      ([EmacsView windowDidChangeBackingProperties:]):
      ([EmacsView createDrawingBufferWithRect:]):
      ([EmacsView focusOnDrawingBuffer]):
      ([EmacsView copyRect]): New methods.
      ([EmacsView viewWillDraw]): Remove method as it no longer does
      anything useful.
      ([EmacsView drawRect:]): Handle drawing from offscreen buffer.
    • Alan Third's avatar
  2. 07 Jan, 2020 1 commit
    • Alan Third's avatar
      Fix NS frame parameters (bug#39000) · 72f54f03
      Alan Third authored
      * src/frame.c (make_frame): Use new system default setting.
      * src/frame.h (enum ns_appearance_type): Add new system default
      * src/nsfns.m (Fx_create_frame): Correctly handle Qunbound and support
      system default appearance.
      (syms_of_nsfns): Add Qlight.
      * src/nsterm.h: New method definition.
      * src/nsterm.m (ns_set_appearance): Correctly handle Qlight and use new
      setAppearance method.
      ([EmacsView initFrameFromEmacs:]): Use new setAppearance method.
      ([EmacsWindow setAppearance]): New method.
      * doc/lispref/frames.texi (Management Parameters): Document 'light'.
  3. 01 Jan, 2020 1 commit
  4. 10 Dec, 2019 1 commit
    • Alan Third's avatar
      Fix XBM files on NS (bug#26133) · 9546a2a0
      Alan Third authored
      Reinstate some of the functionality removed in commit
      * src/nsimage.m (ns_image_from_XBM): Use new reverseBytes argument.
      ([EmacsImage initFromXBM:width:height:fg:bg:reverseBytes:]): Add
      ability to reverse the contents of each byte for use with XBMs, while
      still working with fringe bitmaps.
      * src/nsterm.h
      ([EmacsImage initFromXBM:width:height:fg:bg:reverseBytes:]): Modified
      function definition.
      * src/nsterm.m (ns_draw_fringe_bitmap): Use new reverseBytes argument.
  5. 24 Sep, 2019 1 commit
  6. 03 Sep, 2019 1 commit
  7. 01 Sep, 2019 1 commit
  8. 09 Jul, 2019 1 commit
    • Paul Eggert's avatar
      Use fewer locks when accessing stdio · f8ab9083
      Paul Eggert authored
      * src/alloc.c, src/bidi.c, src/emacs-module.c, src/pdumper.c:
      * src/regex-emacs.c, src/unexhp9k800.c, src/unexmacosx.c:
      * src/widget.c, src/xdisp.c, src/xselect.c, src/xterm.c:
      Include sysstdio.h instead of stdio.h, to avoid locking
      stdio streams in many cases.
      * src/alloc.c (test_setjmp):
      * src/bidi.c (bidi_dump_cached_states):
      * src/cm.c (calccost):
      * src/dispnew.c (init_display_interactive):
      * src/emacs.c (main):
      * src/image.c (convert_mono_to_color_image):
      * src/minibuf.c (read_minibuf_noninteractive):
      * src/nsfont.m (ns_descriptor_to_entity)
      * src/nsterm.h (NSTRACE_MSG_NO_DASHES):
      * src/nsterm.m (ns_mouse_position)
      (sendEvent:, keyDown:, performDragOperation:):
      * src/pdumper.c (dump_fingerprint, print_paths_to_root_1):
      * src/print.c (debug_print):
      * src/regex-emacs.c (debug_putchar, print_fastmap)
      (print_partial_compiled_pattern, print_compiled_pattern)
      (print_double_string, regex_compile):
      * src/term.c (vfatal):
      * src/unexhp9k800.c (read_header):
      * src/unexmacosx.c (unexec_error):
      * src/widget.c (EmacsFrameInitialize):
      * src/xdisp.c (message_to_stderr, vmessage, dump_glyph_row)
      (Fdump_glyph_matrix, Fdump_frame_glyph_matrix, dump_glyph_string):
      * src/xfaces.c (Fdump_colors, Fdump_face):
      * src/xselect.c (x_clipboard_manager_error_2):
      * src/xterm.c (x_initialize):
      * src/xwidget.c (WEBKIT_FN_INIT):
      Prefer unlocked calls like fputs to locked calls like fprintf.
      * src/charset.c (read_hex):
      * src/cm.c (cmputc, cmcheckmagic):
      * src/dispnew.c (update_frame, update_frame_with_menu)
      (update_frame_1, Fsend_string_to_terminal, Fding)
      * src/emacs.c (main, Fdump_emacs):
      * src/emacs-module.c (module_abort):
      * src/fileio.c (Fdo_auto_save):
      * src/image.c (slurp_file)
      (png_read_from_file, png_load_body, our_stdio_fill_input_buffer):
      * src/keyboard.c (record_char, kbd_buffer_get_event)
      * src/lread.c (readbyte_from_stdio, read1):
      * src/minibuf.c (read_minibuf_noninteractive):
      * src/print.c (printchar_to_stream, strout)
      * src/sysdep.c (reset_sys_modes, close_output_streams)
      (procfs_ttyname, procfs_get_total_memory):
      * src/term.c (tty_ring_bell, tty_send_additional_strings)
      (tty_set_terminal_modes, tty_reset_terminal_modes)
      (tty_update_end, tty_clear_end_of_line, tty_write_glyphs)
      (tty_write_glyphs_with_face, tty_insert_glyphs)
      * src/xfaces.c (Fx_load_color_file):
      Simplify by using ordinary calls like putc to explicitly-unlocked
      calls like putc_unlocked, since the ordinary calls are now
      unlocked anyway.
      * src/emacs.c (main, Fdump_emacs):
      * src/pdumper.c (Fdump_emacs_portable):
      Coalesce adjacent printfs.
      * src/nsterm.h: Include sysstdio.h as this file’s macros rely on it.
      * src/regex-emacs.c (print_compiled_pattern):
      Omit redundant fflush.
      * src/sysstdio.h: Include unlocked-io.h.
      (clearerr_unlocked, feof_unlocked, ferror_unlocked)
      (fflush_unlocked, fgets_unlocked, fputc_unlocked)
      (fputs_unlocked, fread_unlocked, fwrite_unlocked)
      (getc_unlocked, getchar_unlocked, putc_unlocked)
      (putchar_unlocked): Remove these macros; now done by unlocked-io.h.
      * src/xwidget.c: Include sysstdio.h.
  9. 05 Jun, 2019 1 commit
    • Alan Third's avatar
      Add native image rotation and cropping · 610fb73a
      Alan Third authored
      * lisp/image.el (image--get-imagemagick-and-warn): Only fallback to
      ImageMagick if native transforms aren't available.
      * src/dispextern.h (INIT_MATRIX, COPY_MATRIX, MULT_MATRICES): New
      macros for matrix manipulation.
      relevant locations.
      * src/image.c (x_set_image_rotation):
      (x_set_transform): New functions.
      (x_set_image_size): Use transform matrix for resizing under X and NS.
      (x_set_image_crop): New function.
      (lookup_image): Use the new transform functions.
      (Fimage_scaling_p, Fimage_transforms_p): Rename and update all
      * src/nsimage.m (ns_load_image): Remove rotation code.
      (ns_image_set_transform): New function.
      ([EmacsImage dealloc]): Release the saved transform.
      ([EmacsImage rotate:]): Remove unneeded method.
      ([EmacsImage setTransform:]): New method.
      * src/nsterm.h (EmacsImage): Add transform property and update method
      * src/nsterm.m (ns_dumpglyphs_image): Use the transform to draw the
      image correctly.
      * src/xterm.c (x_composite_image): Use PictOpSrc as we don't care
      about alpha values here.
      * doc/lispref/display.texi (Image Descriptors): Add :rotation.
      (ImageMagick Images): Remove :rotation.
  10. 21 May, 2019 1 commit
    • Alan Third's avatar
      Fix some deprecation notices on macOS 10.14 · 9624f609
      Alan Third authored
      * src/nsimage.m ([EmacsImage setXBMColor:]): Replace colorSpaceName
      * src/nsmenu.m ([EmacsDialogPanel initWithContentRect:styleMask:]):
      Remove reference to oneShot.
      * src/nsterm.h (ns_enable_screen_updates): Remove function prototype.
      (NSPasteboardTypeURL): Define new names and replace all callers.
      * src/nsterm.m ([EmacsColor colorUsingDefaultColorSpace]): Replace
      calls to colorUsingColorSpaceName on macOS > 10.7.
      ([EmacsView performDragOperation:]): Add FIXME about deprecation.
      (ns_enable_screen_updates): Remove functions and all callers.
      (disable_screen_updates_count): Remove variable.
      * src/macfont.m (macfont_draw): Use CGContext instead of graphicsPort
      on macOS >= 10.10
  11. 20 May, 2019 2 commits
    • Alexander Gramiak's avatar
      Introduce Emacs_Cursor typedef · 06db2a05
      Alexander Gramiak authored
      * src/dispextern.h [HAVE_X_WINDOWS]: Define Emacs_Cursor alias. Move
      the No_Cursor definition from xterm.h.
      (redisplay_interface): Use Emacs_Cursor over Cursor.
      * src/nsgui.h:
      * src/nsterm.h:
      * src/nsterm.m:
      * src/w32gui.h:
      * src/w32term.c:
      * src/xdisp.c:
      * src/xterm.c (x_define_frame_cursor): Use Emacs_Cursor over Cursor.
    • Alexander Gramiak's avatar
      Introduce Emacs_Color struct and typedef · c0e146e4
      Alexander Gramiak authored
      This avoids clashing with the XColor struct from X.
      * src/dispextern [HAVE_X_WINDOWS]: Define Emacs_Color alias.
      [!HAVE_X_WINDOWS]: Rename XColor compatibility struct to
      Emacs_Color. Remove unused fields.
      * src/gtkutil.c:
      * src/gtkutil.h:
      * src/image.c:
      * src/nsterm.h:
      * src/nsterm.m:
      * src/termhooks.h:
      * src/w32fns.c:
      * src/w32term.c:
      * src/w32term.h:
      * src/xfaces.c:
      * src/xfns.c:
      * src/xterm.h: Use Emacs_Color over XColor outside of X-specific
  12. 10 May, 2019 1 commit
    • Alexander Gramiak's avatar
      Convert Free_Pixmap macro into terminal hook · 616ce44a
      Alexander Gramiak authored
      * src/termhooks.h (terminal) [HAVE_WINDOW_SYSTEM]: New terminal hook
      * src/image.c: Replace Free_Pixmap with free_pixmap.
      * src/msdos.h (FRAME_X_DISPLAY):
      * src/nsgui.h (Display):
      * src/w32term.h (FRAME_X_DISPLAY): Remove unused X-compatibility
      macros and typedefs.
      * src/nsterm.m:
      * src/w32term.c:
      * src/xterm.c: Implement and set free_pixmap hook.
  13. 26 Apr, 2019 2 commits
    • Alexander Gramiak's avatar
      Rename x_highlight_frame property to highlight_frame · 02397678
      Alexander Gramiak authored
      * src/nsterm.h:
      * src/nsterm.m:
      * src/w32term.c:
      * src/w32term.h:
      * src/xdisp.c:
      * src/xterm.c:
      * src/xterm.h: Rename.
    • Alexander Gramiak's avatar
      Rename generic x_* identifiers · a411517f
      Alexander Gramiak authored
      * src/image.c: Rename x_* procedures to image_*.
      * src/frame.c: Rename x_* procedures to gui_*. Rename
      xrdb_get_resource to gui_display_get_resource. Rename x_get_arg to
      gui_display_get arg.
      * src/frame.h: Rename can_x_set_window_size to can_set_window_size.
      * src/xfaces.c: Rename realize_x_face to realize_gui_face. Rename
      x_supports_face_attributes_p to gui_supports_face_attributes_p.
      * src/keyboard.c:
      * src/lisp.h:
      * src/nsterm.m:
      * src/w32term.c:
      * src/xterm.c: Rename x_get_keysym_name to get_keysym_name.
      * src/nsfns.c:
      * src/nsterm.m: Rename x_* procedures to ns_*.
      * src/w32fns.c:
      * src/w32term.c: Rename x_* procedures to w32_*.
      * src/termhooks.h (query_colors, get_focus_frame, focus_frame_hook)
      (frame_visible_invisible_hook, iconify_frame_hook)
      (set_window_size_hook, set_frame_offset_hook, set_frame_alpha_hook)
      (set_new_font_hook, set_bitmap_icon_hook, implicit_set_name_hook)
      (activate_menubar_hook, change_tool_bar_height_hook)
      (set_scroll_bar_default_height_hook, get_string_resource_hook): New
      terminal hooks to replace backend-specific x_* procedures.
      * src/dispextern.h (clear_under_internal_border): New RIF procedure.
      * src/alloc.c:
      * src/frame.c:
      * src/xdisp.c: Use FRAME_OUTPUT_DATA instead of FRAME_X_OUTPUT.
      * src/frame.c:
      * src/w32term.c:
      * src/w32fns.c: Use FRAME_NATIVE_WINDOW instead of FRAME_X_WINDOW.
  14. 10 Jan, 2019 1 commit
    • Alan Third's avatar
      Add native image scaling (bug#33587) · a1b7a3f2
      Alan Third authored
      * configure.ac: Test for XRender outside of xft checks.
      * src/Makefile.in (XRENDER_LIBS): List XRender libs separately from
      xft libs.
      * lisp/image.el (image--get-imagemagick-and-warn): Allow resizing if
      native scaling is available.
      * src/dispextern.h: Add XRender and image scaling stuff.
      (struct image): Add XRender Pictures.
      * src/image.c (x_create_bitmap_mask):
      (image_create_x_image_and_pixmap): Handle XRender Picture.
      (compute_image_size): Make available when any form of scaling is
      (x_set_image_size): New function.
      (lookup_image): Set image size.
      (x_create_x_image_and_pixmap): Create XRender Picture when necessary.
      (x_put_x_image): Handle the case where desired size != actual size.
      (free_image): Free XRender Pictures.
      (Fimage_scaling_p): New function.
      (syms_of_image): Add image-scaling-p.
      * src/nsimage.m (ns_load_image): Remove NS specific resizing.
      ([EmacsImage setSizeFromSpec:]): Remove method.
      (ns_image_set_size): New function.
      * src/nsterm.m (ns_draw_fringe_bitmap): Cocoa and GNUstep both have
      the same compositing functions, so remove unnecessary difference.
      * src/xterm.c (x_composite_image): New function.
      (x_draw_image_foreground): Use new x_composite_image function.
      * doc/lispref/display.texi (Image Descriptors): Document
      image-scaling-p and add resizing descriptors.
      (ImageMagick Images): Remove resizing descriptors.
  15. 01 Jan, 2019 1 commit
  16. 15 Jun, 2018 1 commit
    • Paul Eggert's avatar
      New mint_ptr representation for C pointers · 30d393f9
      Paul Eggert authored
      * src/lisp.h (make_mint_ptr, mint_ptrp, xmint_pointer): New functions.
      * src/dbusbind.c (xd_lisp_dbus_to_dbus, Fdbus__init_bus):
      * src/emacs-module.c (module_free_global_ref, Fmodule_load)
      (module_assert_runtime, module_assert_env, value_to_lisp)
      (lisp_to_value, initialize_environment)
      (finalize_environment, finalize_runtime_unwind)
      * src/font.c (otf_open, font_put_frame_data)
      * src/macfont.m (macfont_invalidate_family_cache)
      * src/nsterm.h (XNS_SCROLL_BAR):
      * src/nsterm.m (ns_set_vertical_scroll_bar)
      * src/w32fns.c (w32_monitor_enum)
      * src/xterm.c (x_cr_destroy, x_cr_export_frames):
      * src/xwidget.c (webkit_javascript_finished_cb)
      (save_script_callback, Fxwidget_webkit_execute_script)
      Use mint pointers instead of merely save pointers.
  17. 30 Mar, 2018 1 commit
    • Alan Third's avatar
      Simplify represented filename handling (bug#30800) · 733279ab
      Alan Third authored
      * src/nsfns.m (ns_set_represented_filename): Move function from
      nsterm.m and set represented filename directly.
      * src/nsterm.h (ns_set_represented_filename): Remove definition.
      * src/nsterm.m (ns_set_represented_filename): Move function to
      (x_free_frame_resources): Remove references to represented_frame.
      (sendEvent): Don't set represented filename.
  18. 19 Mar, 2018 2 commits
    • Charles A. Roelli's avatar
      Normalize and fix some mistakes in NS-related commentary · 7ff62ed2
      Charles A. Roelli authored
      * lisp/term/ns-win.el (ns-insert-working-text): Normalize
      (x-file-dialog): Fix indentation.
      * src/nsfns.m (ns_get_window, interpret_services_menu)
      (x_set_background_color, x_set_icon_name, x_set_tool_bar_lines)
      (x_set_icon_type, x_set_mouse_color, Fx_create_frame)
      (ns_window_is_ancestor, Fns_popup_font_panel)
      (Fx_display_visual_class, Fns_font_name, Fns_do_applescript)
      (ns_screen_name, compute_tip_xy, Fns_mouse_absolute_pixel_position)
      (handlePanelKeys): Normalize commentary (also in top-level
      declarations) and remove two outdated comments (one in
      Fx_create_frame, the other in compute_tip_xy).
      * src/nsterm.h (NSApplication, NSWindow, ns_bitmap_record):
      * src/nsselect.m:
      * src/nsmenu.m (ns_update_menubar, addItemWithWidgetValue:)
      (runMenuAt:forFrame:keymaps:, ns_menu_show, free_frame_tool_bar)
      (update_frame_tool_bar, init)
      (initFromContents:isQuestion:, timeout_handler:)
      * src/nsimage.m (initFromXBM, initFromXBMWithDepth):
      * src/nsgui.h:
      * src/nsfont.m (ns_spec_to_descriptor, ns_descriptor_to_entity)
      (ns_charset_covers, ns_get_req_script, ns_findfonts)
      (nsfont_list_family, nsfont_open, nsfont_encode_char)
      (nsfont_draw, ns_uni_to_glyphs, ns_glyph_metrics)
      (syms_of_nsfont): Normalize commentary (also in top-level
      * src/nsterm.m (ns_init_locale, ns_retain_object)
      (ns_screen_margins_ignoring_hidden_dock, ns_unfocus, NSImageView)
      (x_make_frame_visible, x_iconify_frame, x_destroy_window)
      (x_set_undecorated, x_set_no_focus_on_map, x_set_z_group)
      (ns_index_color, ns_get_color, ns_lisp_to_color)
      (note_mouse_movement, scrollbar, ns_scroll_run)
      (ns_draw_fringe_bitmap, ns_draw_window_cursor)
      (ns_draw_text_decoration, ns_draw_relief)
      (ns_dumpglyphs_box_or_relief, ns_dumpglyphs_image)
      (ns_dumpglyphs_stretch, ns_draw_glyph_string, ns_send_appdefined)
      (ns_check_menu_open, ns_read_socket, ns_select, ns_run_loop_break)
      (ns_set_vertical_scroll_bar, ns_set_horizontal_scroll_bar)
      (ns_string_to_lispmod, ns_default, ns_initialize_display_info)
      (ns_delete_display, ns_term_init, sendEvent:)
      (applicationDidFinishLaunching:, applicationDidBecomeActive:)
      (fd_handler:, setWindowClosing:, keyDown:, insertText:)
      (mouseDown:, mouseMoved:, updateFrameSize:)
      (windowWillResize:toSize:, windowDidResize:, windowDidResignKey:)
      (initFrameFromEmacs:, toggleFullScreen:, toolbarClicked:)
      (writeSelectionToPasteboard:types:, setMiniwindowImage:)
      (scrollerWidth, initFrame:window:, setFrame:, repeatScroll:)
      (ns_xlfd_to_fontname, syms_of_nsterm): Normalize commentary (also in
      top-level declarations), and in ns_get_color, replace a Gmane link
      with one from lists.gnu.org, which does not require JS to view the
    • Alan Third's avatar
      Fix frame resize flicker on macOS (bug#30699) · 903e3d43
      Alan Third authored
      * src/nsterm.h (ns_enable_screen_updates): New function.
      * src/nsterm.m (ns_enable_screen_updates):
      (ns_disable_screen_updates): New functions.
      (disable_screen_updates_count): Count of number of times we've called
      (x_set_window_size): Disable screen updates when not in a live resize
      * src/xdisp.c (redisplay_internal): Reenable screen updates when
      redisplay doesn't complete due to a popup.
      (unwind_redisplay): Reenable screen updates.
  19. 11 Feb, 2018 1 commit
    • Alan Third's avatar
      Remove NS special handling of 'frame-title-format' · f7a853d8
      Alan Third authored
      * lisp/term/ns-win.el (frame-title-format, icon-title-format): Change
      default format to just the filename.
      * src/nsfns.m (ns-use-proxy-icon): New variable.
      (ns_set_name_as_filename): Remove function.
      (x_implicitly_set_name): Get rid of special handling of
      * src/nsterm.h (ns_set_represented_filename): Use new definition.
      * src/nsterm.m (ns_set_represented_filename): Move some of the logic
      from ns_set_name_as_filename into this function.
  20. 06 Jan, 2018 2 commits
    • Alan Third's avatar
      Fix child frame placement issues (bug#29953) · f92264fc
      Alan Third authored
      * src/nsterm.h (NS_PARENT_WINDOW_LEFT_POS):
      (NS_PARENT_WINDOW_TOP_POS): Get the parent frame through the frame
      struct as invisible child windows are detached from their parents in
      * src/nsterm.m (x_set_offset): Offscreen frames have `nil' screen
      value, so handle that gracefully.  Child frames with negative left and
      top should be positioned relative to the bottom right of the parent
    • Alan Third's avatar
      Allow setting tooltip colors in NS port · 15cd1899
      Alan Third authored
      * src/nsfns.m (Fx_show_tip): Get face colors and apply them to the
      * src/nsmenu.m (EmacsTooltip::setBackgroundColor):
      (EmacsTooltip::setForegroundColor): New functions.
      * src/nsterm.h (EmacsTooltip::setBackgroundColor):
      (EmacsTooltip::setForegroundColor): New function prototypes.
  21. 01 Jan, 2018 1 commit
  22. 16 Dec, 2017 1 commit
    • Alan Third's avatar
      Silence macOS 10.13 deprecation notices (Bug#29643) · 95e7195f
      Alan Third authored
      * src/nsfns.m (Fx_display_backing_store):
      (Fx_display_save_under): Don't use NSBackingStoreRetained or
      NSBackingStoreNonretained on macOS 10.13+.
      * src/nsselect.m (symbol_to_nsstring):
      (nxatoms_of_nsselect): Replace NSGeneralPboard with
      * src/nsterm.h: #define NSPasteboardNameGeneral to NSGeneralPboard on
      GNUstep and macOS < 10.13.
      * src/nsterm.m (EmacsView::resetCursorRects):
      (EmacsScroller::resetCursorRects): Don't use setOnMouseEntered on
      macOS 10.13+.
  23. 03 Dec, 2017 1 commit
    • Alan Third's avatar
      Add image resizing and rotation to NS port · e4f2061e
      Alan Third authored
      * lisp/image.el (image--get-imagemagick-and-warn): Bypass imagemagick
      check when using NS.
      * src/nsimage.m (ns_load_image): Add rotation and resizing
      functionality. Move the getMetaData call to before the resize/rotation
      so it returns correct metadata.
      (EmacsImage::setSizeFromSpec, EmacsImage::rotate): New functions.
      * src/nsterm.h (EmacsImage): Add new function prototypes.
      (NSCompositingOperationCopy): Add define to older equivalent for
      GNUstep and pre-10.12 macOS.
      * configure.ac: Don't use libjpeg on Cocoa.
  24. 13 Sep, 2017 1 commit
    • Paul Eggert's avatar
      Prefer HTTPS to FTP and HTTP in documentation · bc511a64
      Paul Eggert authored
      Most of this change is to boilerplate commentary such as license URLs.
      This change was prompted by ftp://ftp.gnu.org's going-away party,
      planned for November.  Change these FTP URLs to https://ftp.gnu.org
      instead.  Make similar changes for URLs to other organizations moving
      away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
      fsf.org when this works, as this will further help defend against
      man-in-the-middle attacks (for this part I omitted the MS-DOS and
      MS-Windows sources and the test tarballs to keep the workload down).
      HTTPS is not fully working to lists.gnu.org so I left those URLs alone
      for now.
  25. 23 Aug, 2017 1 commit
    • Alan Third's avatar
      Add ability to change macOS WM theme (bug#27973) · 7baa50ec
      Alan Third authored
      * src/frame.c (make_frame, frame_parms, syms_of_frame)
      [NS_IMPL_COCOA]: Add ns-appearance and ns-transparent-titlebar
      * src/frame.h (ns_appearance_type) [NS_IMPL_COCOA]: Add enum to
      represent NSAppearance options.
      (struct frame) [NS_IMPL_COCOA]: Add ns_appearance and
      ns_transparent_titlebar frame parameters.
      * src/nsfns.m (ns_frame_parm_handlers) [NS_IMPL_COCOA]: Add
      ns_set_appearance and ns_set_transparent_titlebar handlers.
      (Sx_create_frame): Handle ns-appearance and ns-transparent-titlebar
      frame parameters.
      (Qdark): Add new symbol for use with ns-appearance.
      * src/nsterm.h (ns_set_appearance, ns_set_transparent_titlebar)
      [NS_IMPL_COCOA]: Add prototypes.
      * src/nsterm.m (ns_set_appearance, ns_set_transparent_titlebar)
      [NS_IMPL_COCOA]: New functions.
      (initFrameFromEmacs) [NS_IMPL_COCOA]: Handle ns-appearance and
      ns-transparent-titlebar frame parameters.
      * doc/lispref/frames.texi (Window Management Parameters): Document
      ns-apperance and ns-transparent-titlebar.
  26. 16 Aug, 2017 2 commits
    • Alan Third's avatar
      Allow use of run-time OS version checks on macOS (bug#27810) · 69f2b755
      Alan Third authored
      * src/nsterm.h (NSWindowTabbingMode): Define in pre-Sierra macOS.
      NSApplicationPresentationAutoHideToolbar): Define in macOS 10.6.
      * src/nsterm.m (colorForEmacsRed, colorUsingDefaultColorSpace,
      check_native_fs, ns_read_socket, ns_select, runAlertPanel,
      initFrameFromEmacs, windowDidMiniaturize, windowDidEnterFullScreen,
      windowDidExitFullScreen, isFullscreen, updateCollectionBehavior,
      toggleFullScreen, constrainFrameRect, scrollerWidth, syms_of_nsterm):
      Allow use of run-time checks and replace version check macros.
      * src/nsfns.m (ns_screen_name): Use run-time OS version checks.
      * src/macfont.m (macfont_draw): Use run-time OS version checks.
      * src/nsmenu.m (menuWillOpen): Use run-time OS version checks.
      Co-authored-by: default avatarCharles A. Roelli <charles@aurox.ch>
    • Alan Third's avatar
      Add multiframe image support to NS port (bug#21714) · 3505b77a
      Alan Third authored
      * src/nsimage.m (ns_load_image): Handle multiple frames.
      (EmacsImage::getMetadata, EmacsImage::setFrame): New functions.
      * src/nsterm.h (EmacsImage::getMetadata, EmacsImage::setFrame): New
      function prototypes.
  27. 01 Jul, 2017 1 commit
    • Alan Third's avatar
      Fix threads on NS (bug#25265) · 0ad5fd4b
      Alan Third authored
      src/nsterm.h (ns_select): Compiler doesn't like sigmask being const.
      (ns_run_loop_break) [HAVE_PTHREAD]: New function.
      src/nsterm.m (ns_select): Call thread_select from within ns_select.
      (ns_run_loop_break) [HAVE_PTHREAD]: New function.
      (ns_send_appdefined): Don't wait for main thread when sending app
      defined event.
      src/process.c (wait_reading_process_output): Call thread_select from
      within ns_select.
      src/systhread.c (sys_cond_broadcast) [HAVE_NS]: Break ns_select out of
      its event loop using ns_run_loop_break.
  28. 25 Jun, 2017 1 commit
    • Martin Rudalics's avatar
      Provide additional support for child frames · 1886246f
      Martin Rudalics authored
      Provide mouse dragging and resizing of frames.  Allow resizing
      frames proportionally.  Provide additional functionality for
      child frames.  Minor bug fixes.
      * lisp/frame.el (frame-border-width, frame-pixel-width)
      (frame-pixel-height): Alias to `frame-internal-border-width',
      `frame-native-width' and `frame-native-height'.
      (frame-inner-width, frame-inner-height, frame-outer-width)
      (frame-outer-height): New functions.
      * lisp/minibuffer.el (completion-auto-help): Fix typo.
      * lisp/mouse.el (mouse-drag-line, mouse-drag-mode-line)
      (mouse-drag-header-line): Allow moving a frame by dragging the
      mode line of its bottommost window (on a minibuffer-less frame)
      or the header line of its topmost window.
      (mouse-drag-vertical-line): Mention argument in doc-string.
      (mouse-resize-frame, mouse-drag-frame, mouse-drag-left-edge)
      (mouse-drag-top-left-corner, mouse-drag-top-edge)
      (mouse-drag-top-right-corner, mouse-drag-right-edge)
      (mouse-drag-bottom-right-corner, mouse-drag-bottom-edge)
      (mouse-drag-bottom-left-corner): New functions for resizing a
      frame by dragging its internal border together with
      corresponding key bindings.
      * lisp/tooltip.el (tooltip-frame-parameters): Add
      'no-special-glyphs' to default parameters and update version
      * lisp/window.el (frame-auto-hide-function): Add choice to make
      frame invisible and update version tag.
      (window--delete): Handle 'auto-hide-function' frame parameter.
      (window--maybe-raise-frame): Respect 'no-focus-on-map' and
      'no-accept-focus' frame parameters.
      (display-buffer--action-function-custom-type): Add
      (display-buffer): Mention `display-buffer-in-child-frame' in
      (display-buffer-in-child-frame): New action function for
      (window--sanitize-margin): Return zero when MARGIN cannot be
      (fit-frame-to-buffer): Major rewrite to handle child frames and
      'fit-frame-to-buffer-sizes' and 'fit-frame-to-buffer-margins'
      frame parameters.
      (window-largest-empty-rectangle): New functions.
      * src/dispextern.h (WINDOW_WANTS_MODELINE_P)
      (WINDOW_WANTS_HEADER_LINE_P): Remove.  Functionality is now
      provided by corresponding functions window_wants_modeline and
      window_wants_header_line in window.c.  Adjust users.
      * src/dispnew.c (adjust_glyph_matrix)
      (buffer_posn_from_coords): Use window_wants_modeline and
      window_wants_header_line instead of WINDOW_WANTS_MODELINE_P and
      * src/frame.c (keep_ratio): New function.
      (adjust_frame_size): Call keep_ratio for each of F's child
      (make_frame): Initialize no_special_glyphs slot.
      (frame_internal_border_part): New function.
      (Fframe_pixel_width, Fframe_pixel_height, Fborder_width): Rename
      to Fframe_native_width, Fframe_native_height mand
      (frame_parm_table): Add Qno_special_glyphs entry.
      (frame_float_type): New enumeration type.
      (frame_float): New function to handle frame size and position
      (x_set_frame_parameters): Handle size and position ratios.
      (x_set_no_special_glyphs): New function
      (x_figure_window_size): Handle size and position ratios.
      (syms_of_frame): Add Qdisplay_monitor_attributes_list,
      Qno_special_glyphs, Qframe_edges, Qkeep_ratio, Qwidth_only,
      Qheight_only, Qleft_only and Qtop_only.
      * src/frame.h (internal_border_part): New enumeration type.
      (struct frame): New slot no_special_glyphs.
      (FRAME_NO_SPECIAL_GLYPHS): New macro.
      * src/gtkutil.c (xg_frame_restack): Return immediately for
      GTK versions before 2.18.0.
      * src/keyboard.c (internal_border_parts): New array constant.
      (make_lispy_position): For frames with border dragging enabled
      return internal border part.
      (syms_of_keyboard): New symbols Qdrag_internal_border,
      Qleft_edge, Qtop_left_corner, Qtop_edge, Qtop_right_corner,
      Qright_edge, Qbottom_right_corner, Qbottom_edge and
      * src/minibuf.c (read_minibuf_unwind): When exiting the
      minibuffer deal with frames that have the 'minibuffer-exit'
      parameter set.
      (syms_of_minibuf): New symbol Qminibuffer_exit.
      * src/nsfns.m (frame_parm_handler): Add entry for
      (Fx_create_frame): Handle 'no-special-glyphs' parameter.
      Intitialize new cursor types for dragging frame borders.
      * src/nsterm.h (struct ns_output): Add new cursor types for
      dragging frame borders.
      * src/w32fns.c (w32_frame_parm_handlers): Add entry for
      (Fx_create_frame): Handle 'no-special-glyphs' parameter.
      Intitialize new cursor types for dragging frame borders.
      * src/w32term.h (struct w32_output): Add new cursor types for
      dragging frame borders.
      * src/window.c (coordinates_in_window)
      (Fwindow_line_height, window_internal_height): Use
      window_wants_modeline and window_wants_header_line instead of
      (Fwindow_lines_pixel_dimensions): New function.
      (window_parameter): New function.
      (Fwindow_parameter): Call window_parameter.
      (window_wants_mode_line, window_wants_header_line): New
      functions replacing the macros WINDOW_WANTS_MODELINE_P and
      WINDOW_WANTS_HEADER_LINE_P from dispextern.h.
      (syms_of_window): New symbols Qmode_line_format and
      * src/window.h: Reorganize and re-comment macros.  Use
      window_wants_modeline and window_wants_header_line instead of
      (WINDOW_BUFFER): New macro.
      * src/xdisp.c (window_text_bottom_y, window_box_height)
      (window_box, start_display)
      (try_cursor_movement, redisplay_window)
      (try_window_reusing_current_matrix, try_window_id)
      (display_line, expose_window): Use window_wants_modeline and
      window_wants_header_line instead of WINDOW_WANTS_MODELINE_P and
      (pos_visible_p, display_mode_lines): Respect W's
      'mode-line-format' and 'header-line-format' window parameters.
      (init_iterator): Use window_wants_modeline and
      window_wants_header_line instead of WINDOW_WANTS_MODELINE_P and
      WINDOW_WANTS_HEADER_LINE_P.  For tip frames respect
      no_special_glyphs value.
      (note_mouse_highlight): Set frame border cursors when on
      internal border.
      (x_draw_right_divider, x_draw_bottom_divider): Try to improve
      drawing of window dividers.
      * src/xfns.c (mouse_cursor): Add entries for border parts.
      (mouse_cursor_types): Add entries for cursor types to drag
      frame borders.
      (INSTALL_CURSOR): Add entries for new cursor types to drag
      frame borders.
      (Fx_create_frame): Handle 'no-special-glyphs' parameter.
      (x_frame_parm_handlers): Add entry for
      (Vx_window_left_edge_shape, Vx_window_top_left_corner_shape)
      (Vx_window_top_edge_shape, Vx_window_top_right_corner_shape)
      (Vx_window_bottom_left_corner_shape): New variables.
      (x_frame_restack): Call xg_frame_restack only for GTK versions
      starting with 2.18.0.
      * src/xterm.c (x_free_frame_resources): Remove new cursors for
      dragging frame borders.
      * src/xterm.h (struct x_output): Add new cursor types for
      dragging frame borders.
      * doc/lispref/display.texi (Size of Displayed Text): Document
      * doc/lispref/elisp.texi (Top): Add entry for "Mouse Dragging
      * doc/lispref/frames.texi (Frame Size): Replace
      frame-pixel-width/-height by frame-native-width/-height.  Add
      frame-inner-width/-height and frame-outer-width/-height docs.
      (Position Parameters): Describe specifying position as ratios.
      Clarify remark about positions relative to bottom/ridge display
      (Size Parameters): Describe specifying sizes as ratios.
      Describe 'fit-frame-to-buffer-margins' and
      'fit-frame-to-buffer-sizes' parameters.
      (Layout Parameters): Describe 'no-special-glyphs' parameter.
      (Frame Interaction Parameters): Describe 'auto-hide-function',
      'minibuffer-exit' and 'keep-ratio' parameters.
      (Mouse Dragging Parameters): New section describing
      'drag-internal-border', 'drag-with-header-line',
      'drag-with-mode-line', 'snap-width', 'top-visible' and
      'bottom-visible' parameters.
      (Management Parameters): Mention that `override-redirect' has
      no effect on MS Windows.
      (Font and Color Parameters): Mention child frames for `alpha'
      (Child Frames): Rewrite section with description and cross
      references to new frame parameters added.
      * doc/lispref/modes.texi (Mode Line Basics): Mention
      'mode-line-format' and 'header-line-format' window parameters.
      * doc/lispref/windows.texi (Resizing Windows): Mention effect
      of `fit-frame-to-buffer-margins' for child frames.
      (Display Action Functions): New action function
      (Quitting Windows): Mention `make-frame-invisible' as optional
      value of `frame-auto-hide-function' and `auto-hide-function'
      frame paameter.
      (Coordinates and Windows): Describe new function
      (Window Parameters): Describe new parameters 'mode-line-format'
      and 'header-line-format'.  Index all window parameters described
      in this section.
  29. 12 Jun, 2017 1 commit
    • Alan Third's avatar
      Add no-focus-on-map to NS build (bug#25408) · 0f24ad7b
      Alan Third authored
      * src/nsfns.m (ns_frame_parm_handlers): Add x_set_no_focus_on_map.
      (x-create-frame): Check for no-focus-on-map.
      * src/nsterm.h (x_set_no_focus_on_map): New function.
      * src/nsterm.m (x_set_no_focus_on_map): New function.
      (ns_raise_frame): Add parameter for specifying whether to focus the
      (x_make_frame_visible): Handle new parameter for ns_raise_frame.
  30. 26 May, 2017 1 commit
  31. 24 May, 2017 2 commits
  32. 23 May, 2017 1 commit
    • Alan Third's avatar
      Fix GNUstep build · 4a485410
      Alan Third authored
      * src/nsterm.h [NS_IMPL_GNUSTEP]: Add typedefs for Cocoa-only types.
      (NSWindowStyleMaskUtilityWindow): #define to NSUtilityWindowMask in
      GNUstep and old versions of macOS.
      * src/nsfns.m (ns-set-mouse-absolute-pixel-position): Function only
      works in cocoa, not GNUstep.
  33. 21 May, 2017 1 commit
    • Philipp Stephani's avatar
      Nextstep: Use instancetype explicit return type · 84b28ec7
      Philipp Stephani authored
      This removes compiler warnings on macOS and improves type safety.
      * nsterm.m (initFrameFromEmacs:):
      (condemn, reprieve, setPosition:portion:whole:):
      * nsmenu.m (initWithTitle:):
      (init, initWithContentRect:styleMask:backing:defer:):
      * nsimage.m (allocInitFromFile:):
      (initForXPMWithDepth:width:height:): Use instancetype as return
      type instead of implicit id.