1. 25 Sep, 2020 2 commits
    • Alan Third's avatar
      Tidy up NS color handling · 3a322671
      Alan Third authored
      * src/nsimage.m (COLORSPACE_NAME): New macro to find the current
      ([EmacsImage initFromXBM:width:height:fg:bg:reverseBytes:]):
      ([EmacsImage initForXPMWithDepth:width:height:]): Use the current
      * src/nsterm.h (NSAppKitVersionNumber10_7):
      (NSAppKitVersionNumber10_10): Define for macOS version checks.
      * src/nsterm.m ([NSColor colorForEmacsRed:green:blue:alpha:]): Tidy up
      the version checking.
      ([NSColor colorUsingDefaultColorSpace]): Tidy the version checking and
      use [NSColor colorUsingColorSpace:] with GNUstep.
    • Alan Third's avatar
      Remove obsolete macOS support for NS font backend · dd6876d6
      Alan Third authored
      The ns font backend is has been disabled on macOS for a long time and
      doesn't work correctly even if re-enabled.
      * src/nsfont.m:
      (EmacsGlyphStorage): Remove all Cocoa only code.
      * src/nsterm.h (EmacsGlyphStorage): Remove.
      (struct nsfont_info): Make GNUstep only.
      * src/nsterm.m (ns_compute_glyph_string_overhangs): Remove GNUstep
      only code from Cocoa builds.
  2. 22 Aug, 2020 1 commit
    • Alan Third's avatar
      Extend NSString further and use the new methods · 96e5d8ce
      Alan Third authored
      * src/nsfns.m (ns_set_icon_name):
      (ns_do_applescript): Use the new NSString methods.
      ([NSString stringWithLispString:]): Fix the surrogate algorithm.
      ([NSString lispString]): New method.
      * src/nsterm.h (NSString): Add new method.
      * src/nsterm.m ([EmacsApp openFile:]):
      ([EmacsApp requestService:userData:error:]):
      ([EmacsApp fulfillService:withArg:]):
      ([EmacsView changeFont:]):
      ([EmacsView setMarkedText:selectedRange:]):
      ([EmacsView initFrameFromEmacs:]):
      ([EmacsView performDragOperation:]):
      ([EmacsView performDragOperation:]):
      ([EmacsView performDragOperation:]):
      ([EmacsWindow accessibilityAttributeValue:]): Use the new NSString
  3. 20 Aug, 2020 1 commit
    • Mattias Engdegård's avatar
      Fix NS crash on invalid frame title string (bug#42904) · bf60338d
      Mattias Engdegård authored
      Instead of blindly assuming that all Emacs strings are valid UTF-8,
      which they are not, use a more careful conversion going via UTF-16
      which is what NSString uses internally.  Unpaired surrogates will
      still go through to the NSString objects, but the NS libs handle them
      * src/nsterm.h (EmacsString): New category.
      * src/nsfns.m (all_nonzero_ascii): New helper function.
      ([NSString stringWithLispString:]): New method.
      (ns_set_name_internal): Use new conversion method.
  4. 04 Aug, 2020 1 commit
    • Alan Third's avatar
      Don't smooth images when scaling up (bug#38394) · 519a93e0
      Alan Third authored
      * src/image.c (image_set_transform [HAVE_XRENDER]): Use different filter
      when scaling up vs scaling down.
      * src/nsimage.m (ns_image_set_smoothing):
      ([EmacsImage setSmoothing:]): New functions.
      * src/nsterm.h: Add definitions.
      * src/nsterm.m (ns_dumpglyphs_image): Disable smoothing if requested.
  5. 16 Apr, 2020 3 commits
    • Alan Third's avatar
      Use native image API for NS · e105d01c
      Alan Third authored
      * configure.ac (NATIVE_IMAGE_API): Move above NS definitions.
      (HAVE_NATIVE_IMAGE_API): Set for NS.
      (HAVE_PNG, HAVE_JPEG, HAVE_GIF, HAVE_TIFF): Enable on NS builds.
      * src/image.c (HAVE_NS): Fix a number of #if's so they no longer rely
      on HAVE_NS.
      (PIX_MASK_DRAW): Add for HAVE_NS so libpng support will compile.
      (native_image_load): Add NS support.
      (gif_load): Remove NS specific definitions.
      * src/nsimage.m (ns_can_use_native_image_api): New function.
      * src/nsterm.h: (ns_can_use_native_image_api): New function.
    • Alan Third's avatar
      Allow dynamic choice of drawing path on NS (bug#39883) · c019f03e
      Alan Third authored
      * src/nsterm.h (NS_DRAW_TO_BUFFER): Let this be enabled on versions
      older than 10.14.
      * src/nsterm.m (ns_update_begin):
      ([EmacsView viewDidResize:]):
      ([EmacsView createDrawingBuffer]):
      ([EmacsView windowDidChangeBackingProperties:]):
      ([EmacsView copyRect:to:]):
      ([EmacsView wantsUpdateLayer]): Dynamically switch between drawing to a
      buffer and drawing to the screen, depending on the version of AppKit
      in use.
      ([EmacsView dealloc]): We can't release the context unless
      NS_DRAW_TO_BUFFER is defined.
    • Alan Third's avatar
      Fix NS frame resizing issues (bug#40200, bug#28872) · 24cb6908
      Alan Third authored
      * src/nsmenu.m (update_frame_tool_bar): Remove reference to
      * src/nsterm.h: ([EmacsView updateFrameSize]):
      ([EmacsView setRows:andColumns:]): Remove unused
      method definitions.
      (NS_PARENT_WINDOW_TOP_POS): Move to nsterm.m.
      * src/nsterm.m (ns_parent_window_rect): New function.
      (NS_PARENT_WINDOW_TOP_POS): Move to nsterm.m and simplify.
      (ns_set_offset): Fix strange behaviours when using negative values.
      ([EmacsView windowDidResize:]):
      ([EmacsView windowDidExitFullScreen]):
      (ns_judge_scroll_bars): Remove references to updateFrameSize.
      ([EmacsView dealloc]): Unset resize notification and release buffer.
      ([EmacsView updateFrameSize:]): Remove function.
      ([EmacsView windowWillResize:toSize:]): Move some code to
      ([EmacsView viewDidResize]): New function.
      ([EmacsView initFrameFromEmacs:]): Set up resize notification and move
      buffer creation until after the prerequisite objects are created.
      ([EmacsView toggleFullScreen:]): Set frame to the size of the
      contentview, not the whole window, and remove reference to
      ([EmacsView setRows:andColumns:]): Remove unused method.
      ([EmacsView windowDidMove:]): Tidy up.
  6. 12 Mar, 2020 1 commit
    • Andrii Kolomoiets's avatar
      Fix NS child frame in native fullscreen (bug#36672) · bbc48b26
      Andrii Kolomoiets authored
      * lisp/frame.el (toggle-frame-fullscreen): Don't sleep on cocoa.
      Fullscreen animation waiting is moved to src/nsterm.m.
      * src/nsterm.h (EmacsView): Add in_fullscreen_transition,
      inFullScreenTransition, waitFullScreenTransition.
      (NSWindowCollectionBehaviorFullScreenAuxiliary): New define.
      * src/nsterm.m (ns_make_frame_visible): Wait for fullscreen animation.
      (ns_set_parent_frame): Set frame collection behavior; make child frames
      non-fullscreen; make non-child frames fullscreen if parent was fullscreen.
      ([EmacsView initFrameFromEmacs]): Set in_fullscreen_transition; set frame
      collection behavior according to parent frame.
      ([EmacsView windowDidMove]): Remove code by commenting with "fixme".
      ([EmacsView windowWillEnterFullScreen], [EmacsView windowDidEnterFullScreen])
      ([EmacsView windowWillExitFullScreen], [EmacsView windowDidExitFullScreen]):
      Set in_fullscreen_transition.
      ([EmacsView inFullScreenTransition], [EmacsView waitFullScreenTransition]):
      New methods.
      ([EmacsView updateCollectionBehavior]): Set collection behavior according to
      parent frame.
      ([EmacsView toggleFullScreen]): Wait for fullscreen animation.
  7. 02 Mar, 2020 1 commit
  8. 13 Feb, 2020 1 commit
    • Alan Third's avatar
      Use CGImage instead of NSBitmapImageRep (bug#32932) · 44298ea6
      Alan Third authored
      * src/nsterm.m (ns_update_end):
      (ns_clear_frame): Remove forced draws.
      (ns_dumpglyphs_image): No longer need to invert images as the context
      is already flipped.
      ([EmacsView updateFrameSize:]):
      ([EmacsView initFrameFromEmacs:]): Use new function.
      ([EmacsView createDrawingBuffer]): Replaces createDrawingBufferWithRect:.
      ([EmacsView focusOnDrawingBuffer]): Set CGImage context.
      ([EmacsView windowDidChangeBackingProperties:]): Use new function.
      ([EmacsView copyRect:to:]): Copy using CGImages.
      ([EmacsView wantsUpdateLayer]):
      ([EmacsView updateLayer]): New Functions.
      ([EmacsView drawRect:]): We no longer do anything special here for
      ([EmacsView windowDidChangeBackingProperties:]): Fix indentation and
      add NSTRACE.
  9. 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
  10. 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'.
  11. 01 Jan, 2020 1 commit
  12. 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.
  13. 24 Sep, 2019 1 commit
  14. 03 Sep, 2019 1 commit
  15. 01 Sep, 2019 1 commit
  16. 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.
  17. 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.
  18. 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
  19. 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
  20. 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.
  21. 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.
  22. 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.
  23. 01 Jan, 2019 1 commit
  24. 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.
  25. 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.
  26. 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.
  27. 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.
  28. 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.
  29. 01 Jan, 2018 1 commit
  30. 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+.
  31. 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.
  32. 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.