aboutsummaryrefslogtreecommitdiffstats
path: root/src/nsterm.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ; Move ns_init_colors from Fns_list_colors to emacs.c (bug#80377)Stéphane Marks2026-03-071-1/+1
| | | | | | | | | | | Support calls to ns_lisp_to_color or Fns_list_colors in headless environments where ns_term_init is not called, and calls before ns_term_init runs. * src/emacs.c (main): Call ns_init_colors when not in dump mode. * src/nsfns.m (ns_init_colors): Make public function. (Fns_list_colors): Remove ns_init_colors call. * src/nsterm.h: extern ns_init_colors.
* Inhibit unused variable warning in NSTRACE_WHEN (bug#80096)Stéphane Marks2026-01-131-1/+1
| | | | | * src/nsterm.h (NSTRACE_WHEN): Mark 'nstrace_saved_enabled_global' as unused.
* ; Add 2026 to copyright years.Sean Whitton2026-01-011-1/+1
|
* NS: Fix build with NSTRACE_ENABLEDGerd Möllmann2025-07-231-1/+1
| | | | | | | * src/nsterm.h (NSTRACE_MSG_NO_DASHES): Use nstrace_enabled_global. * src/nsterm.m: ([EmacsView performDragOperation:]): Don't use an NSString.
* Reduce code duplication in ns_set_appearanceStefan Kangas2025-03-221-0/+1
| | | | | | | * src/nsterm.h (ns_set_appearance_1): Declare. * src/nsterm.m (ns_set_appearance_1): Break out new function... (ns_set_appearance): ...here. * src/nsfns.m (Fx_create_frame): Use above new function.
* Delete now unused constants in nsterm.hStefan Kangas2025-03-221-7/+0
| | | | | | * src/nsterm.h (NS_DUMPGLYPH_NORMAL, NS_DUMPGLYPH_CURSOR) (NS_DUMPGLYPH_FOREGROUND, NS_DUMPGLYPH_MOUSEFACE): Delete now unused constants.
* ; Clean up comments in nsterm.hStefan Kangas2025-03-221-27/+27
|
* Support colored stipples on Cocoa NS (Bug#73384)Ben Simms2025-03-041-0/+8
| | | | | | | | | | | | On Cocoa builds of NS Emacs, stipples are now rendered using masked CGImages instead of patterned NSColors so that stipples now render with color. * src/nsimage.m ([EmacsImage stippleMask:]): Use a CGImageMask to store the stipple mask when building for Cocoa. * src/nsterm.m (ns_maybe_dumpglyphs_background): Perform a masked fill to draw stipples when building for Cocoa. (ns_draw_stretch_glyph_string): Perform a masked fill to draw stipples when building for Cocoa.
* ; Fix indentation in src/nsterm.hStefan Kangas2025-01-081-16/+16
| | | | Reduce the diff between master and scratch/igc.
* Update copyright year to 2025Paul Eggert2025-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* NS: Fix scroll-bar setting code (bug#72331)Gerd Möllmann2024-08-091-16/+0
| | | | | | | | | * src/nsterm.m (ns_set_vertical_scroll_bar): Use WINDOW_SCROLL_AREA_WIDTH instead of NS_SCROLL_BAR_WIDTH. (ns_set_horizontal_scroll_bar): Use WINDOW_SCROLL_AREA_HEIGHT instead of NS_SCROLL_BAR_HEIGHT. Clear area differently if vertical scroll bars are present. * src/nsterm.h (NS_SCROLL_BAR_WIDTH, NS_SCROLL_BAR_HEIGHT): Remove.
* MacOS: Let EmacsView implement NSTextInputClientGerd Möllmann2024-07-311-1/+1
| | | | | | * src/nsterm.h (@interface EmacsView): Implement NSTextInputClient protocol. * src/nsterm.m: Implement required NSTextInputClient methods, forwarding to existing NSTextInput methods.
* NS: Set frame position when entering/exiting fullscreen (bug#71912)Gerd Möllmann2024-07-301-0/+1
| | | | | | | * src/nsterm.h ([EmacsView adjustEmacsRectRect]): Declare. * src/nsterm.m ([EmacsView windowDidEnterFullScreen]): New method. ([EmacsView windowDidEnterFullScreen]): Call it. ([EmacsView windowDidExitFullScreen]): Call it.
* Silence some macOS build warningsMattias Engdegård2024-05-121-0/+4
| | | | | | | | | * src/image.c (native_image_type): Declare static. * src/keyboard.c (lispy_function_keys): Declare static on NS. * src/nsmenu.m (context_menu_value): * src/nsterm.m (ns_frame_parm_handlers): Move extern declarations... * src/nsterm.h: ...here. * test/src/emacs-module-resources/mod-test.c: Add extern declaration.
* Be more systematic about parens in C source codePaul Eggert2024-01-201-3/+3
| | | | | | | | | Be more systematic about putting space before paren in calls, and in avoiding unnecessary parentheses in macros. This was partly inspired by my wading through gcc -E output while debugging something else, and seeing too many parens. This patch does not change the generated .o files on my platform.
* Merge from savannah/emacs-29Po Lu2024-01-021-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dc4e6b13296 ; Update copyright years in more files 64b37776318 ; Run set-copyright from admin.el 8e1c56ae467 ; Add 2024 to copyright years # Conflicts: # doc/misc/modus-themes.org # doc/misc/texinfo.tex # etc/NEWS # etc/refcards/ru-refcard.tex # etc/themes/modus-operandi-theme.el # etc/themes/modus-themes.el # etc/themes/modus-vivendi-theme.el # lib/alloca.in.h # lib/binary-io.h # lib/c-ctype.h # lib/c-strcasecmp.c # lib/c-strncasecmp.c # lib/careadlinkat.c # lib/cloexec.c # lib/close-stream.c # lib/diffseq.h # lib/dup2.c # lib/filemode.h # lib/fpending.c # lib/fpending.h # lib/fsusage.c # lib/getgroups.c # lib/getloadavg.c # lib/gettext.h # lib/gettime.c # lib/gettimeofday.c # lib/group-member.c # lib/malloc.c # lib/md5-stream.c # lib/md5.c # lib/md5.h # lib/memmem.c # lib/memrchr.c # lib/nanosleep.c # lib/save-cwd.h # lib/sha1.c # lib/sig2str.c # lib/stdlib.in.h # lib/strtoimax.c # lib/strtol.c # lib/strtoll.c # lib/time_r.c # lib/xalloc-oversized.h # lisp/auth-source-pass.el # lisp/emacs-lisp/lisp-mnt.el # lisp/emacs-lisp/timer.el # lisp/info-look.el # lisp/jit-lock.el # lisp/loadhist.el # lisp/mail/rmail.el # lisp/net/ntlm.el # lisp/net/webjump.el # lisp/progmodes/asm-mode.el # lisp/progmodes/project.el # lisp/progmodes/sh-script.el # lisp/textmodes/flyspell.el # lisp/textmodes/reftex-toc.el # lisp/textmodes/reftex.el # lisp/textmodes/tex-mode.el # lisp/url/url-gw.el # m4/alloca.m4 # m4/clock_time.m4 # m4/d-type.m4 # m4/dirent_h.m4 # m4/dup2.m4 # m4/euidaccess.m4 # m4/fchmodat.m4 # m4/filemode.m4 # m4/fsusage.m4 # m4/getgroups.m4 # m4/getloadavg.m4 # m4/getrandom.m4 # m4/gettime.m4 # m4/gettimeofday.m4 # m4/gnulib-common.m4 # m4/group-member.m4 # m4/inttypes.m4 # m4/malloc.m4 # m4/manywarnings.m4 # m4/mempcpy.m4 # m4/memrchr.m4 # m4/mkostemp.m4 # m4/mktime.m4 # m4/nproc.m4 # m4/nstrftime.m4 # m4/pathmax.m4 # m4/pipe2.m4 # m4/pselect.m4 # m4/pthread_sigmask.m4 # m4/readlink.m4 # m4/realloc.m4 # m4/sig2str.m4 # m4/ssize_t.m4 # m4/stat-time.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/stdio_h.m4 # m4/stdlib_h.m4 # m4/stpcpy.m4 # m4/strnlen.m4 # m4/strtoimax.m4 # m4/strtoll.m4 # m4/time_h.m4 # m4/timegm.m4 # m4/timer_time.m4 # m4/timespec.m4 # m4/unistd_h.m4 # m4/warnings.m4 # nt/configure.bat # nt/preprep.c # test/lisp/register-tests.el
| * ; Add 2024 to copyright yearsPo Lu2024-01-021-1/+1
| |
* | Simplify Objective C autorelease pool handlingAlan Third2023-12-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | * src/emacs.c: Remove ns_pool. (main): Replace ns_pool stuff with call to ns_init_pool. (Fkill_emacs): The pools are drained automatically when the application exits, so it's probably not worth draining the pool here. (decode_env_path): No longer required as this is handled by `outerpool' defined in nsterm.m. * src/nsterm.h: * src/nsterm.m (ns_init_pool): New function.
* | Fix crash on child frame creation (bug#65817)Alan Third2023-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * src/nsterm.m ([EmacsView initFrameFromEmacs:]): Reorder the way the frame and layers are created. ([EmacsView makeBackingLayer]): Change to the newly renamed method below. ([EmacsLayer initWithColorSpace:doubleBuffered:]): ([EmacsLayer initWithDoubleBuffered:]): Rename the method and remove the colorspace argument as it's no longer able to be set on initial creation. * src/nsterm.h: Use new method prototype.
* | Simplify the EmacsLayer double buffering code (bug#63187)Alan Third2023-09-111-1/+12
|/
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
|
* Fix memory leak in ns_draw_reliefDaniel Martín2022-07-111-0/+6
| | | | | | | | | | * src/nsterm.h (struct ns_output): New fields to store the relief colors. * src/nsterm.m (ns_setup_relief_colors): New function to keep the relief colors as part of the ns_output structure. (ns_draw_relief): Remove static local variables. Assigning them to nil caused a memory leak of NSColor instances (bug#56462). Call ns_setup_relief_colors instead.
* Prevent GC of window referenced from EmacsScrollerGerd Moellmann2022-06-221-0/+4
| | | | | | | * src/nsterm.m (EmacsScroller.mark, mark_nsterm): New functions. * src/nsterm.h (EmacsScroller.mark, mark_nsterm): Declare. * src/alloc.c (garbage_collect) [MAVE_NS]: Call mark_nsterm. (Bug#56095)
* Implement `follow-tooltip' on NS as wellPo Lu2022-06-091-10/+17
| | | | | | | | | | | | | | | | | * lisp/term/ns-win.el (x-begin-drag): Pass `follow-tooltip'. * src/nsfns.m (Fx_show_tip): Record last dx and dy. (syms_of_nsfns): New staticpros. * src/nsmenu.m ([EmacsTooltip moveTo:]): New method. * src/nsselect.m (Fns_begin_drag): New parameter `follow-tooltip'. * src/nsterm.h (@interface EmacsWindow): (EmacsTooltip): Update prototypes. * src/nsterm.m ([EmacsWindow draggedImage:movedTo:]): Move any tooltip to the right location. ([EmacsWindow beginDrag:forPasteboard...]): New parameter `followTooltip'.
* Implement `allow-same-frame' for NS drag-and-dropPo Lu2022-06-011-1/+4
| | | | | | | | | | | | | * lisp/term/ns-win.el (x-begin-drag): Implement `allow-same-frame'. * src/nsselect.m (Fns_begin_drag): New parameter `allow-same-frame'. * src/nsterm.h (@interface EmacsWindow): Update prototypes. * src/nsterm.m ([EmacsView draggingEntered:]): ([EmacsView prepareForDragOperation:]): ([EmacsView performDragOperation:]): Respect new parameter. ([EmacsWindow beginDrag:forPasteboard:withMode:returnFrameTo:]): Likewise.
* Implement `return-frame' for DND on NSPo Lu2022-05-311-1/+13
| | | | | | | | | | | | | * src/nsselect.m (Fns_begin_drag): New argument `return-frame'. (syms_of_nsselect): New defsym. * src/nsterm.h (EmacsWindow): New fields. * src/nsterm.m (ns_read_socket): Split parts off to ns_read_socket_1. (ns_read_socket_1): New function. (ns_flush_display): Use that function instead. ([EmacsWindow beginDrag:forPasteboard:]): Update for return-frame.
* Fix GNUstep buildPo Lu2022-05-271-1/+1
| | | | * src/nsterm.h (NSPasteboardNameGeneral): Fix definition.
* Implement some drag and drop functions on NSPo Lu2022-05-271-7/+16
| | | | | | | | | | | | | | | | | | | | * lisp/term/ns-win.el (ns-selection-exists-p): (gui-backend-set-selection): (x-begin-drag): New functions and selection types. * src/nsfns.m (Fns_get_resource): (Fns_set_resource): (Fx_server_max_request_size): Fix coding style. * src/nsselect.m (ns_decode_data_to_pasteboard): (ns_lisp_to_pasteboard): (ns_dnd_action_to_operation): (ns_dnd_action_from_operation): (Fns_begin_drag): New functions. (syms_of_nsselect): New subrs. * src/nsterm.h (EmacsWindow): New fields and messages. (NSPasteboardNameGeneral): New define. * src/nsterm.m ([EmacsView mouseDown:]): Store last mouse event. ([EmacsWindow initWithEmacsFrame:fullscreen:screen:]): Clear that event. ([EmacsWindow dealloc]): Free last mouse event.
* Fix processing of dialog box items on NSPo Lu2022-05-141-16/+26
| | | | | | | | | | | | | | | | | | | | * src/nsmenu.m (pop_down_menu): Remove old hack and discard menu items. (ns_popup_dialog): ([EmacsDialogPanel initWithContentRect:styleMask:backing:defer:]): ([EmacsDialogPanel windowShouldClose:]): ([EmacsDialogPanel dealloc]): ([EmacsDialogPanel processdialog:]): ([EmacsDialogPanel addButton:value:row:]): ([EmacsDialogPanel addString:row:]): ([EmacsDialogPanel clicked:]): ([EmacsDialogPanel initFromContents:isQuestion:]): ([EmacsDialogPanel timeouthandler:]): ([EmacsDialogPanel runDialogAt:]): Use the regular menu item machinery to parse dialog items instead of the incorrect ad-hoc code used previously. * src/nsterm.h: Update prototypes.
* Implement non-system tooltips on NSPo Lu2022-05-141-0/+1
| | | | | | | | | | | | | | | | | * src/nsfns.m (unwind_create_frame): Return Lisp_Object like on X. (do_unwind_create_frame): New function. (Fx_create_frame): Adjust accordingly. (compute_tip_xy): Fix coding style. (unwind_create_tip_frame, ns_create_tip_frame): New functions. (x_hide_tip, Fx_show_tip, Fx_hide_tip): Create and hide actual tooltip frames. (syms_of_nsfns): New defvar `x-max-tooltip-size' and staticpros. * src/nsterm.m (ns_set_window_size): Clean up coding style. ([EmacsWindow initWithEmacsFrame:]): ([EmacsWindow initWithEmacsFrame:fullscreen:screen:]): Handle tooltip frames.
* Fix build on Mac OS X 10.11Po Lu2022-05-121-0/+1
| | | | * src/nsterm.h (NSButtonTypeMomentaryPushIn): New define.
* Replace NS code that implemented font panels in a different wayPo Lu2022-05-011-14/+17
| | | | | | | | | | | | | | | | | | | | | | * doc/emacs/macos.texi (Mac / GNUstep Events): Document removal of `ns-change-font' event. The font panels are now implemented normally, via `x-select-font'. * lisp/term/common-win.el (x-setup-function-keys): Likewise. * lisp/term/ns-win.el (global-map, ns-popup-font-panel): Remove. (x-select-font, mouse-set-font, ns-input-font): (ns-input-fontsize): Remove. (ns-respond-to-change-font): Delete function. * src/nsfns.m (Fns_popup_font_panel): Delete function. (Fx_select_font): New function. (syms_of_nsfns): Update subrs. * src/nsterm.h (@interface EmacsView): * src/nsterm.m (ns_select_1): New function. (ns_select): Wrap around that instead. ([EmacsView changeFont:]): Exit nested event loop ([EmacsView showFontPanel:]): New function.
* Fix nsmenu compilation under macOS 10.6Alan Third2022-04-251-0/+1
| | | | | | | | | | | | | | | | | | | * src/nsmenu.m ([EmacsMenu fillWithWidgetValue:]): Replace modern shorthand dictionary and array definitions. * src/nsterm.h (NSTextAlignmentRight): Redefine if necessary. * src/macfont.m (mac_font_create_preferred_family_for_attributes): isOperatingSystemAtLeastVersion is new in macOS 10.10, so it's probably wrong to use it to check whether we're below 10.9. (mac_font_copy_default_descriptors_for_language): (mac_font_copy_default_name_for_charset_and_languages): It seems these functions are only used on macOS 10.8 and below. * src/nsterm.m ([NSColor colorUsingDefaultColorSpace]): Use the generic colorspace. (ns_parent_window_rect): (ns_frame_scale_factor): ([EmacsWindow setParentChildRelationships]): Fix macOS version stuff. Co-authored-by: Po Lu <luangruo@yahoo.com>
* Fix scrollbars on macOS 10.13 and below (bug#54623)Alan Third2022-04-081-2/+2
| | | | | | | | | | | | | | | | Make any build on macOS 10.13 and below follow the same drawing path as the GNUstep port. macOS 10.14 and above will use EmacsLayer. * src/nsterm.h (EmacsLayer): * src/nsterm.m ([EmacsView makeBackingLayer]): ([EmacsView unlockFocus]): ([EmacsView windowDidChangeBackingProperties:]): ([EmacsView copyRect:to:]): Remove any code required for macOS 10.13 and below, and fix the #if's to enforce strict separation of the drawing paths. (ns_update_end): (ns_unfocus): Fix #ifs so that flushWindow is called on old macOS versions as well as GNUstep.
* Merge from origin/emacs-28Eli Zaretskii2022-01-011-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year. 86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year ebe8772f65 ; Minor fixes related to copyright years 23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye... 8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t. 19dcb237b5 ; Add 2022 to copyright years. # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex # lib/cdefs.h # lisp/erc/erc-dcc.el # lisp/erc/erc-imenu.el # lisp/erc/erc-replace.el # lisp/image-dired.el # lisp/progmodes/xref.el # m4/alloca.m4 # m4/byteswap.m4 # m4/errno_h.m4 # m4/getopt.m4 # m4/gnulib-common.m4 # m4/inttypes.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/sys_socket_h.m4
| * ; Add 2022 to copyright years.Eli Zaretskii2022-01-011-1/+1
| |
* | Make NS toolbar use NSString instead of C stringsAlan Third2021-12-221-2/+2
| | | | | | | | | | | | | | | | | | * src/nsfns.m ([NSString stringWithLispString:]): Ensure that the lisp object is actually a string. * src/nsmenu.m (update_frame_tool_bar): Convert to NSString instead of C strings. ([EmacsToolbar addDisplayItemWithImage:idx:tag:labelText:helpText:enabled:]): No need to convert to NSString here anymore.
* | Further cleanup of NS color codeAlan Third2021-12-221-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/dispextern.h (FACE_COLOR_TO_PIXEL): Remove define and fix all callers. * src/nsterm.h (struct nsfont_info): Remove color_table. * src/nsterm.m ([NSColor colorWithUnsignedLong:]): Always assume the input contains the correct alpha value. (ns_lookup_indexed_color): (ns_index_color): (ns_color_index_to_rgba): Remove functions and fix all callers. (ns_query_color): No longer set pixel to the lookup table index, always just set it to the ARGB integer value. (ns_defined_color): Ignore makeindex as we no longer set pixel to the lookup table index. (ns_initialize_display_info): (ns_redisplay_interface): Remove lookup table. (ns_term_init): Fix the alpha setting. thing
* | Simplify NS color handlingAlan Third2021-12-221-31/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/image.c (RGB_TO_ULONG): (ARGB_TO_ULONG): (RED_FROM_ULONG): (RED16_FROM_ULONG): (GREEN16_FROM_ULONG): (BLUE16_FROM_ULONG): Define these here for NS too. * src/nsfns.m (ns_set_foreground_color): (ns_set_background_color): Use new EmacsColor methods. * src/nsterm.h (struct ns_color_table): Replace this struct with a built-in Objective C type. (RGB_TO_ULONG): (ARGB_TO_ULONG): (ALPHA_FROM_ULONG): (RED_FROM_ULONG): (GREEN_FROM_ULONG): (BLUE_FROM_ULONG): (RED16_FROM_ULONG): (GREEN16_FROM_ULONG): (BLUE16_FROM_ULONG): These are no longer needed in the NS specific code. (struct ns_display_info): Use an NSMutableArray instead of a custom struct. * src/nsterm.m ([NSColor colorWithUnsignedLong:hasAlpha:]): ([NSColor unsignedLong]): New methods. (ns_lookup_indexed_color): (ns_index_color): Use the NSMutableArray lookup table. (ns_term_init): (ns_color_index_to_rgba): (ns_query_color): Use the new EmacsColor methods. (ns_initialize_display_info): (ns_delete_display): Initialize and release the NSMutableArray lookup table.
* | Fix build on macOSAlan Third2021-11-291-2/+0
| | | | | | | | | | | | * src/nsterm.h (NSPasteboardTypeMultipleTextSelection): (NSPasteboardTypePNG): These are already defined on macOS 10.6 and above and aren't used at all in GNUstep.
* | Fix selection for old GNUstep and GCCAlan Third2021-11-251-0/+9
| | | | | | | | | | | | | | * src/nsselect.m (ns_get_foreign_selection): Remove language features not yet supported by GCC. Be more selective with which pasteboard types we use. * src/nsterm.h: Set up some more #defines for deprecated variables.
* | General improvements to NS portPo Lu2021-11-061-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/dispextern.h: Remove some !HAVE_NS conditionals around grab related code. * src/frame.c (gui_mouse_grabbed, gui_redo_mouse_highlight): Remove !HAVE_NS conditionals around code. * src/nsmenu.m (ns_update_menubar): Prevent recursive calls and enable shallow updates on GNUstep. (menuNeedsUpdate): Prevent recursive calls. (ns_menu_show): Fix mysterious GC-related bug. (update_frame_tool_bar_1): Work around mysterious toolbar sizing bug on GNUstep. * src/nsterm.h (struct ns_output): New field for tracking toolbar visibility changes. * src/nsterm.m (frame_set_mouse_pixel_position): Implement for GNUstep. (ns_redraw_scroll_bars): Enable for GNUstep. (ns_clear_frame): Redraw scrollbars on GNUstep. (ns_update_window_end): New function. (ns_redisplay_interface): Add ns_update_window_end on GNUstep. (- keyDown): Remove debug code that doesn't work on GNUstep. (- mouseDown): Enable grab tracking on NS port. (- resizeWithOldSuperviewSize): Fix build with NSTRACE. * src/xdisp.c (note_tab_bar_highlight): Enable some code for NS port.
* | Improve font display on NS portPo Lu2021-11-061-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/nsfns.m (Fx_create_frame): Use "fixed" for the default font on GNUstep. * src/nsfont.m (LCD_SMOOTHING_MARGIN, ns_escape_name) (ns_unescape_name, ns_attribute_fvalue) (STYLE_REF): Remove unused defines and functions. (struct ns_glyph_layout, enum lgstring_direction). (enum gs_font_slant, enum gs_font_weight, enum gs_font_width) (enum gs_specified, struct gs_font_data): New enumerators and structures. (ns_font_descs_match_p) (ns_done_font_data, ns_get_font_data): New functions. (ns_glyph_metrics): Stop escaping names. (ns_spec_to_descriptor): Fix font descriptor creation for symbolic font spec entires. (ns_descriptor_to_entity): Create entries with the correct symbolic styles. (ns_fallback_entity): Fix fallback entity selection. (ns_findfonts): Use our own font matcher instead of the broken GNUstep matcher. (ns_list_family): Remove obsolete comment. (nsfont_open): Remove obsolete code, comments, and synthItal logic which doesn't work on GNUstep. (nsfont_encode_char): Use a type that can fit NSGlyph (nsfont_draw): Chose correct font, remove obsolete mouse face logic, obsolete comments, and switch to using glyph-based drawing instead of character-based drawing. (ns_font_shape, nsfont_shape): New functions. (ns_uni_to_glyphs_1): New function. (ns_uni_to_glyphs): Return glyphs instead of unicode codepoints. (ns_glyph_metrics): Use NSGlyphs instead of unicode codepoints and fix left bearing, right bearing, ascent and descent computation. (struct nsfont_driver): Add shaping capability. * src/nsterm.h (struct nsfont_info): Use unsigned int for glyph cache. * src/nsterm.c (ns_focus): Set DPS clipping on GNUstep. (ns_compute_glyph_string_overhangs): Fix overhang computation by using xterm code. (ns_draw_window_cursor): Simplify cursor drawing. (ns_maybe_dumpglyphs_background): Test for cursor HL and remove obsolete mouse face logic. (ns_dumpglyphs_image) (ns_dumpglyphs_box_or_relief): Rectify for new cursor logic. (ns_dumpglyphs_stretch): Rectify for new cursor logic and rely on ns_draw_glyph_string to set focus. (ns_draw_glyph_string_foreground): Remove mouse face logic. (ns_draw_glyph_strings): Implement overhangs, remove obsolete comment, and always focus before dumping glyphs. (ns_draw_text_decoration): Add condition for DRAW_CURSOR and simplify color selection. (ns_define_frame_cursor): Remove nonsensical code (define_frame_cursor has nothing to do with the text cursor, aka caret). * src/xdisp.c (draw_glyphs): Enable code for NS port to fix mouse face cursor display. * src/macfont.m (get_cgcolor_from_nscolor): New function. (macfont_draw): Remove obsolete mouse-face code and enable cursor display.
* Add tab bar support to the nextstep portPo Lu2021-10-171-0/+1
| | | | | | | | | | * src/nsfns.m (ns_change_tab_bar_height): New function. (ns_set_tab_bar_lines): Check tab bar height and set tab bar accordingly. * src/nsterm.m (ns_clear_under_internal_border): Clear internal border correctly when there is a tab bar. (ns_create_terminal): Add ns_change_tab_bar_height. (mouseDown): Handle tab bar mouse click events.
* ; * src/nsterm.h: Use objc-mode.Mattias Engdegård2021-09-301-0/+1
|
* Attempt to debug a graphical glitch on macOSAlan Third2021-09-271-1/+1
| | | | | | | * src/nsterm.m (ns_scroll_run): (ns_shift_glyphs_for_insert): Switch to using NSPoint for destination. ([EmacsView copyRect:to:]): Use NSPoint for the destination, always use the view's layer, and log any questionable copy requests.
* Fix NS toolbar again (bug#50534)Alan Third2021-09-271-0/+5
| | | | | | | | | | | | | | | | | * src/nsmenu.m (free_frame_tool_bar): Remove toolbar. (update_frame_tool_bar_1): New function. (update_frame_tool_bar): Move most of the functionality to update_frame_tool_bar_1. * src/nsterm.h: Definitions of functions and methods. * src/nsterm.m (ns_update_begin): ([EmacsView windowDidEnterFullScreen]): ([EmacsView windowDidExitFullScreen]): We no longer need to reset the toolbar visibility as that's done when we create the new fullscreen window. ([EmacsWindow initWithEmacsFrame:fullscreen:screen:]): Move the check for undecorated frames into createToolbar:. ([EmacsWindow createToolbar:]): Check whether a toolbar should be created, and run the toolbar update immediately.
* Set label for NSToolbarItem (bug#50159)Masahiro Nakamura2021-08-221-0/+1
| | | | | | | | | * src/nsmenu.m (update_frame_tool_bar): Get label text and pass it to ... ([EmacsToolbar addDisplayItemWithImage:idx:tag:labelText:helpText:enabled:]): ... this that sets label for NSToolbarItem. * src/nsterm.h ([EmacsToolbar addDisplayItemWithImage:idx:tag:labelText:helpText:enabled:]): Add labelText argument.
* Move parent frame setting code into EmacsWindowAlan Third2021-07-311-0/+1
| | | | | | | * src/nsterm.m (ns_make_frame_visible): (ns_set_parent_frame): ([EmacsWindow initWithEmacsFrame:fullscreen:screen:]): Use new method. ([EmacsWindow setParentChildRelationships]): New method.
* Move NS port toolbar handling to the windowAlan Third2021-07-311-4/+0
| | | | | | | | | | | | | | | | | | | * src/nsmenu.m (free_frame_tool_bar): (update_frame_tool_bar): Remove wait_for_tool_bar and get the toolbar from the window. * src/nsterm.h (EmacsView): Remove toolbar and wait_for_tool_bar. * src/nsterm.m (ns_update_begin): ([EmacsView windowDidEnterFullScreen]): ([EmacsView windowDidExitFullScreen]): Get the toolbar from the window, not the view. ([EmacsView dealloc]): Remove toolbar from view. ([EmacsView createToolbar:]): Move method to EmacsWindow. ([EmacsView initFrameFromEmacs:]): Don't create toolbar here any more. ([EmacsView toolbar]): Remove method. ([EmacsWindow initWithEmacsFrame:fullscreen:screen:]): Create toolbar here. ([EmacsWindow createToolbar:]): Moved from EmacsView. ([EmacsWindow dealloc]): Make sure we clean up the toolbar after closing the window.