summaryrefslogtreecommitdiff
path: root/src/nsfns.m
Commit message (Collapse)AuthorAgeFilesLines
* Get rid of autorelease warnings during building on GNUstepPo Lu2022-04-251-1/+7
| | | | | | | * src/emacs.c (decode_env_path): * src/nsfns.m (ns_appkit_version_str): * src/nsterm.m (ns_term_shutdown): Setup autorelease when objects might be autoreleased during building.
* * src/nsfns.m (Fns_list_colors): Fix autoreleasing.Po Lu2022-04-251-5/+5
|
* Fix error when creating frames on NS with no main windowPo Lu2022-03-091-1/+1
| | | | | * nsfns.m (Fx_create_frame): If main window is not present, center frame window instead of cascading it.
* Implement "window cascading" on NSPo Lu2022-03-061-1/+21
| | | | | * src/nsfns.m (Fx_create_frame): Cascade new frame position if size hint flags are not USPosition or PPosition.
* Replace ptrdiff_t with new specpdl_ref type for specpdl referencesMattias Engdegård2022-02-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The specpdl_ref type is just an alias for ptrdiff_t; the compiled code remains the same. All operations on specpdl_ref (arithmetic, comparison etc) now go through inline functions. The bulk of the change is almost completely mechanical. It is done to prepare for a type-safe representation and subsequent performance improvement. * src/lisp.h (specpdl_ref, specpdl_count_to_ref, specpdl_ref_to_count) (specpdl_ref_eq, specpdl_ref_lt, specpdl_ref_valid_p) (make_invalid_specpdl_ref, specpdl_ref_add, specpdl_ref_to_ptr): New. (SPECPDL_INDEX, struct handler, USE_SAFE_ALLOCA, safe_free) (safe_free_unbind_to): * src/alloc.c (run_finalizer_function, inhibit_garbage_collection) (garbage_collect, Fgarbage_collect, which_symbols): * src/bidi.c (bidi_at_paragraph_end, bidi_find_paragraph_start): * src/buffer.c (Fkill_buffer, Fset_buffer_major_mode, Fmove_overlay) (Fdelete_overlay): * src/bytecode.c (exec_byte_code): * src/callint.c (Ffuncall_interactively, Fcall_interactively): * src/callproc.c (Fcall_process, call_process, create_temp_file) (Fcall_process_region): * src/charset.c (load_charset_map_from_file): * src/coding.c (decode_coding_gap, decode_coding_object) (encode_coding_object, Fread_coding_system): * src/comp.c (emit_static_object, helper_unbind_n, load_comp_unit): * src/composite.c (update_compositions, autocmp_chars): * src/cygw32.c (conv_filename_to_w32_unicode) (conv_filename_from_w32_unicode): * src/data.c (notify_variable_watchers): * src/decompress.c (Fzlib_decompress_region): * src/dired.c (directory_files_internal, file_name_completion) (file_attributes): * src/dispnew.c (Fredisplay): * src/doc.c (get_doc_string, Fsnarf_documentation): * src/editfns.c (Fsave_excursion, Fsave_current_buffer) (Freplace_buffer_contents, Fsubst_char_in_region, Fsave_restriction) (styled_format): * src/emacs-module.c (Fmodule_load, funcall_module): * src/emacs.c (init_cmdargs, Fdump_emacs): * src/eval.c (call_debugger, do_debug_on_call, FletX, Flet) (Ffuncall_with_delayed_message, Funwind_protect) (internal_lisp_condition_case, signal_or_quit) (load_with_autoload_queue, Feval, grow_specpdl_allocation) (record_in_backtrace, eval_sub, Ffuncall, apply_lambda) (funcall_lambda, clear_unwind_protect, set_unwind_protect) (set_unwind_protect_ptr, unbind_to, Fbacktrace_eval): * src/fileio.c (Fmake_temp_file_internal, Fcopy_file, Frename_file) (Finsert_file_contents, write_region, Fdo_auto_save): * src/fns.c (Fyes_or_no_p, Frequire, hash_table_user_defined_call): * src/fringe.c (update_window_fringes): * src/gtkutil.c (xg_dialog_run): * src/haiku_io.c (c_specpdl_idx_from_cxx): * src/haiku_support.cc (be_popup_file_dialog): * src/haiku_support.h (c_specpdl_idx_from_cxx): * src/haikufns.c (haiku_create_frame, haiku_create_tip_frame) (haiku_hide_tip, Fx_show_tip, Fhaiku_read_file_name): * src/haikumenu.c (haiku_popup_dialog, set_frame_menubar): * src/image.c (slurp_file): * src/indent.c (line_number_display_width, Fvertical_motion): * src/insdel.c (signal_before_change, signal_after_change) (Fcombine_after_change_execute): * src/intervals.c (get_local_map): * src/json.c (lisp_to_json_nonscalar_1, Fjson_serialize, Fjson_insert) (Fjson_parse_string, Fjson_parse_buffer): * src/keyboard.c (recursive_edit_1, Frecursive_edit, cmd_error) (Finternal_track_mouse, command_loop_1, read_menu_command) (safe_run_hooks, read_event_from_main_queue, read_char, timer_check_2) (menu_item_eval_property, read_key_sequence, read_key_sequence_vs) (Fsuspend_emacs): * src/keymap.c (Fcurrent_active_maps, Fdescribe_vector) (Fhelp__describe_vector): * src/lread.c (Fload, save_match_data_load, readevalloop) (Feval_buffer, Feval_region, grow_read_buffer, read_integer, read1): * src/macros.c (Fexecute_kbd_macro): * src/menu.c (x_popup_menu_1): * src/minibuf.c (read_minibuf, set_minibuffer_mode) (read_minibuf_unwind, Fread_string, Fread_buffer): * src/nsfns.m (Fx_create_frame, Fx_show_tip): * src/nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog): * src/pdumper.c (Fdump_emacs_portable): * src/pgtkfns.c (Fx_create_frame, x_create_tip_frame, x_hide_tip) (Fx_show_tip, Fpgtk_print_frames_dialog, Fx_file_dialog, Fx_select_font): * src/pgtkmenu.c (set_frame_menubar, create_and_show_popup_menu) (pgtk_menu_show, create_and_show_dialog, pgtk_dialog_show) (pgtk_popup_dialog): * src/pgtkterm.c (pgtk_cr_export_frames): * src/print.c (PRINTPREPARE, temp_output_buffer_setup) (Fprin1_to_string, print_vectorlike): * src/process.c (Fmake_process, create_process, Fmake_pipe_process) (Fmake_serial_process, connect_network_socket, Fmake_network_process) (network_interface_info, server_accept_connection) (wait_reading_process_output, read_process_output, exec_sentinel): * src/regex-emacs.c (re_match_2_internal): * src/search.c (looking_at_1, fast_looking_at, search_buffer_re): * src/sound.c (Fplay_sound_internal): * src/sysdep.c (system_process_attributes): * src/term.c (tty_menu_show): * src/textprop.c (Fnext_single_char_property_change) (Fprevious_single_char_property_change, add_text_properties_1) (set_text_properties, set_text_properties_1, Fremove_text_properties) (Fremove_list_of_text_properties): * src/thread.c (Fmutex_lock, invoke_thread_function): * src/undo.c (truncate_undo_list): * src/w32fns.c (Fx_create_frame, w32_create_tip_frame, w32_hide_tip) (Fx_show_tip, Fx_file_dialog): * src/w32font.c (Fx_select_font): * src/w32menu.c (set_frame_menubar): * src/window.c (window_list, next_window, window_list_1) (run_window_configuration_change_hook, Frun_window_scroll_functions) (run_window_change_functions, set_window_buffer) (temp_output_buffer_show, window_scroll, scroll_command) (Fscroll_other_window, Fscroll_other_window_down): * src/xdisp.c (safe__call, handle_fontified_prop, handle_face_prop) (handle_single_display_spec, Fbuffer_text_pixel_size) (message_dolog, with_echo_area_buffer, setup_echo_area_for_printing) (display_echo_area, set_message, clear_message, echo_area_display) (gui_consider_frame_title, prepare_menu_bars, update_menu_bar) (update_tab_bar, update_tool_bar, redisplay_internal) (redisplay_preserve_echo_area, run_window_scroll_functions) (redisplay_window, extend_face_to_end_of_line) (display_count_lines_logically, display_count_lines_visually) (display_mode_lines, display_mode_line, Fformat_mode_line) (decode_mode_spec): * src/xfns.c (Fx_create_frame, x_create_tip_frame, x_hide_tip) (Fx_show_tip, Fx_file_dialog, Fx_select_font, Fx_print_frames_dialog): * src/xmenu.c (set_frame_menubar, create_and_show_popup_menu) (x_menu_show, create_and_show_dialog, x_dialog_show) (xw_popup_dialog): * src/xselect.c (x_get_local_selection, x_reply_selection_request) (x_handle_selection_request, wait_for_property_change): * src/xterm.c (x_cr_export_frames, x_connection_closed): Replace ptrdiff_t with specpdl_ref for referencing specpdl and use the corresponding functions instead of direct arithmetic.
* Add background transparency support for GTK+CairoHåkon Flatval2022-01-301-0/+3
|
* 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-0/+3
| | | | | | | | | | | | | | | | | | * 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-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-14/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | Make use of Trash on macOS (bug#21340)Alan Third2021-12-041-0/+45
| | | | | | | | * src/nsfns.m (Fsystem_move_file_to_trash): New function.
* | Set initial tab bar parameter on NSPo Lu2021-11-271-0/+4
| | | | | | | | | | * src/nsfns.m (Fx_create_frame): Initialize `tab-bar-lines' frame parameter during frame creation.
* | Improve font display on NS portPo Lu2021-11-061-0/+6
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-2/+61
| | | | | | | | | | * 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.
* Fix GNUstep build failureAlan Third2021-09-271-0/+2
| | | | | * src/nsfns.m (Fns_hide_emacs): NSRunningApplication is only available in GNUstep 0.27 and above.
* Disable the NS app when no frames are left (bug#14619, bug#21357, bug#23586)Alan Third2021-08-291-0/+5
| | | | | * src/nsfns.m (Fx_create_frame): Enable the app. * src/nsterm.m (ns_delete_terminal): Disable the app.
* Tidy up NS port OS window handlingAlan Third2021-07-311-4/+0
| | | | | | | | | | | | | | | | | * src/nsterm.h (EmacsWindow): Move above EmacsView definition and add new method definitions. (EmacsView): Remove redundant bwidth variable, and change NSWindow to EmacsWindow. (EmacsFSWindow): Delete definition. * src/nsterm.m (ns_set_undecorated): Rewrite to work in GNUstep using the new OS window creating methods. ([EmacsView initFrameFromEmacs:]): Move all NSWindow related code to new init method in EmacsWindow, and use said method. ([EmacsView toggleFullScreen:]): Use EmacsWindow instead of NSWindow. ([EmacsWindow initWithEmacsFrame:]): ([EmacsWindow initWithEmacsFrame:fullscreen:screen:]): ([EmacsWindow borderWidth]): New methods. (EmacsFSWindow): Remove implementation.
* Add ability to bring only the selected frame to the front (bug#48865)Matt Beshara2021-06-121-2/+11
| | | | | | | | Causes ‘ns-hide-emacs’ to layer the selected frame in front of every other application’s windows, and give that frame keyboard focus, when called with 'activate-front. * src/nsfns.m (Fns_hide_emacs): Allow activating only selected frame.
* Fix image filename encoding issues (bug#48902)Alan Third2021-06-091-1/+2
| | | | | | | | | * src/image.c (image_find_image_fd): Don't return an encoded filename string. * src/nsfns.m: ([NSString stringWithLispString:]): Clarify usage comment. * src/nsimage.m ([EmacsImage allocInitFromFile:]): No need to encode the filename when converting to NSString.
* Handle Bug#24526 without breaking Emacs on tiling WMs (Bug#48268)Martin Rudalics2021-05-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Since tiling window managers may react allergically to resize requests immediately following MapNotify events on X, make sure that such requests are issued only when a new frame should not become visible and a size has been explicitly requested for it. * lisp/faces.el (x-create-frame-with-faces): Mark frame as 'was-invisible' if it should be initially invisible or iconified and has its size specified explicitly. * src/frame.c (make_frame): Initialize new frame's was_invisible flag. (Fframe__set_was_invisible): New internal function. * src/frame.h (struct frame): Specify size of new_size_p slot. New flag was_invisible. * src/w32fns.c (Fx_create_frame) * src/nsfns.m (Fx_create_frame) * src/xfns.c (Fx_create_frame): Set new frame's was_invisible flag. * src/xterm.c (handle_one_xevent): Call xg_frame_set_char_size after a PropertyNotify or MapNotify event only if F's was_invisible flag was set.
* Fix crash when resizing GNUstep buildsAlan Third2021-05-021-5/+1
| | | | | | | | | The toolkit can send far too many resize notifications, so be more careful when we take action after receiving one. * src/nsfns.m (ns_set_tool_bar_lines): Remove unneeded NSTRACE. * src/nsterm.m ([EmacsView viewDidResize:]): Don't report resizes to Emacs when the same change has already been reported and delayed.
* Fix NS build warningsAlan Third2021-05-011-1/+0
| | | | * src/nsfns.m (Fx_create_frame): Remove unused variables.
* Major rewrite of adjust_frame_sizeMartin Rudalics2021-04-271-22/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Have adjust_frame_size pass native frame sizes to backends instead of text sizes. Expand frame size history management. Drop PIXELWISE argument from change_frame_size and convert native to text sizes only when calling adjust_frame_size. Use convention in arguments that -1 instead of 0 means that no size change is required. When adjusting frame sizes pick up delayed size changes (Bug#46827). * lisp/frame.el (frame-notice-user-settings, make-frame): Don't set frame size history. (frame--size-history): Rewrite doc-string. Handle new formats of `frame-size-history' entries. * src/dispextern.h (delayed_size_change): Extern it. (change_frame_size): Drop last argument from extern. * src/dispnew.c (delayed_size_change): Make it global. (handle_window_change_signal): Reformat. Drop last argument from change_frame_size call. (do_pending_window_change, init_display_interactive): Drop last argument from change_frame_size call. (change_frame_size_1): NEW_WIDTH and NEW_HEIGHT now specify native sizes. Drop last argument PIXELWISE. Queue a change when it either differs from F's current pixel sizes or F's previously queued sizes. Inject frame_size_history_extra call when queuing. Adopt convention that for queued sizes -1 means that no size change is required. Convert from native to text sizes when calling adjust_frame_size. (change_frame_size): Drop last argument PIXELWISE and drop it also in change_frame_size_1 calls. * src/frame.c (frame_size_history_add): Remove. (frame_inhibit_resize): Remove call to frame_size_history_add. (set_menu_bar_lines, set_tab_bar_lines): Simplify. Drop last argument from change_frame_size call. (frame_windows_min_size): No more static. (keep_ratio): Minor rewrite using macros. (frame_size_history_adjust, frame_size_history_plain) (frame_size_history_extra): New functions. (adjust_frame_size): Major rewrite. Adopt new convention that negative values for new sizes mean no change. Pick up delayed size changes from F's new_width and new_height slots (Bug#46827). Call set_window_size_hook with native instead of text sizes. Do not sanitize window sizes any more. Call frame_size_history_adjust instead of frame_size_history_add. Always set F's resized_p slot to true. (make_frame): Initialize new_width and new_height slots to -1. Simplify setup of initial sizes and an adjust_frame_size call. (Fframe_parameters): Drop processing F's new_pixelwise slot. (check_frame_pixels): Reorder to make declarations appear first. (Fset_frame_height, Fset_frame_width, Fset_frame_size): Pass explicit width and height values to adjust_frame_size instead of -1. (gui_set_frame_parameters): Minor rewrite making sure that explicit sizes and the corresponding parameter are passed to adjust_frame_size. Remove frame_size_history_add call. (gui_figure_window_size): Drop last two arguments. Simplify assignment of initial size. Set new_height and new_width slots to -1. Use adjust_frame_size to set sizes instead of returning them to caller. (syms_of_frame): Drop symbols used by frame size history; these are now built on-the-fly. Also drop some menu bar related symbols in favor of Qmenu_bar_lines. * src/frame.h (struct frame): Remove new_pixelwise. (SET_FRAME_COLS, SET_FRAME_LINES, SET_FRAME_WIDTH) (SET_FRAME_HEIGHT): Remove macros. (frame_size_history_add): Remove externs. (frame_windows_min_size, frame_size_history_plain) (frame_size_history_extra): Add externs. (FRAME_WINDOWS_WIDTH, FRAME_WINDOWS_HEIGHT): Rename to FRAME_INNER_WIDTH and FRAME_INNER_HEIGHT. (gui_figure_window_size): Drop last two arguments from extern. * src/gtkutil.c (xg_frame_resized): Rename arguments to WIDTH and HEIGHT. Consult delayed_size_change to handle case where WIDTH and HEIGHT do not match F's new_width and new_height values. Call change_frame_size with native sizes and without PIXELWISE argument. Instead of frame_size_history_add call frame_size_history_extra. (xg_frame_set_char_size): WIDTH and HEIGHT are native sizes now; fix adjust_frame_size call accordingly. Instead of frame_size_history_add call frame_size_history_extra. (style_changed_cb): Call xg_frame_set_char_size with native instead of text sizes. (tb_size_cb): Remove frame_size_history_add call. Call adjust_frame_size with INHIBIT 5. (free_frame_tool_bar, xg_change_toolbar_position): Remove frame_size_history_add call. (update_frame_tool_bar): Call adjust_frame_size with INHIBIT 2 and let it handle frame_inhibit_implied_resize and fullheight/-width. Remove frame_size_history_add call. * src/keyboard.c (Fsuspend_emacs): Call change_frame_size with native sizes. * src/nsfns.m (ns_set_tool_bar_lines): Call adjust_frame_size with INHIBIT 2 and let it handle frame_inhibit_implied_resize and fullheight/-width. Remove frame_size_history_add call. (Fx_create_frame): Drop two last arguments in gui_figure_window_size call. Do not SET_FRAME_WIDTH and SET_FRAME_HEIGHT, the adjust_frame_size in gui_figure_window_size did that already. * src/nsterm.m (ns_set_window_size): Drop PIXELWISE argument and its processing; WIDTH and HEIGHT represent native pixel sizes now. Call change_frame_size with native sizes. Remove call to frame_size_history_add. ([EmacsView viewDidResize:]): Call change_frame_size with native sizes. * src/term.c (Fresume_tty): Call change_frame_size with native sizes. * src/termhooks.h (*set_window_size_hook): Drop last argument PIXELWISE. * src/w32fns.c (w32_change_tab_bar_height) (w32_change_tool_bar_height): Fix handling of these in the initial phase before they have been resized at least once. (Fx_create_frame, w32_create_tip_frame): Drop two last arguments in gui_figure_window_size call. Do not SET_FRAME_WIDTH and SET_FRAME_HEIGHT (or SET_FRAME_COLS and SET_FRAME_LINES), the adjust_frame_size in gui_figure_window_size did that already. * src/w32inevt.c (resize_event, maybe_generate_resize_event): Pass native sizes to change_frame_size. * src/w32term.c (w32_read_socket): When WM_WINDOWPOSCHANGED pass native sizes to change_frame_size. (w32_new_font): Recalculate FRAME_TAB_BAR_HEIGHT. Simplify code. (w32fullscreen_hook): Call change_frame_size with native sizes. (w32_set_window_size): Drop argument PIXELWISE and its processing; WIDTH and HEIGHT are native sizes now. Remove frame_size_history_add calls. Pass native sizes to change_frame_size. * src/widget.c (set_frame_size): Set width and height of widget directly. Call frame_size_history_plain instead of frame_size_history_add. (update_from_various_frame_slots): Call frame_size_history_extra. (EmacsFrameRealize): Call frame_size_history_plain. (EmacsFrameResize): Call change_frame_size with native sizes. Call frame_size_history_extra instead of frame_size_history_add. (EmacsFrameSetCharSize): Call frame_size_history_extra. Drop PIXELWISE argument in x_set_window_size call and specify pixels. (pixel_to_text_size): Remove function. * src/xdisp.c (resize_mini_window): Replace FRAME_WINDOWS_HEIGHT with FRAME_INNER_HEIGHT. (redisplay_tab_bar): Don't set tab_bar_redisplayed when we did not redisplay it. (redisplay_tool_bar): Don't call it for external tool bar. Don't set tool_bar_redisplayed when we did not redisplay it. (redisplay_window): When the tool bar is external call update_frame_tool_bar directly. * src/xfns.c (x_set_menu_bar_lines): Call adjust_frame_size only if number of menu bar lines changed and fix 6th argument. (x_change_tab_bar_height, x_change_tool_bar_height): Fix handling of these in the initial phase before they have been resized at least once. (Fx_create_frame, x_create_tip_frame): Drop two last arguments in gui_figure_window_size call. Do not SET_FRAME_WIDTH and SET_FRAME_HEIGHT (or SET_FRAME_COLS and SET_FRAME_LINES), the adjust_frame_size in gui_figure_window_size did that already. * src/xmenu.c (update_frame_menubar): Fix 6th arg of adjust_frame_size call. (free_frame_menubar): For Motif frames fix fullscreen and `frame-inhibit-implied-resize' handling. Fix 6th arg of adjust_frame_size calls. * src/xterm.c (x_net_wm_state): Remove call to frame_size_history_add. (handle_one_xevent): For PropertyNotify and UnmapNotify events add frame_size_history_plain calls. For MapNotify and ConfigureNotify events add a frame_size_history_extra call. For ConfigureNotify events also handle delayed size changes and call change_frame_size with native sizes. (x_new_font): Recalculate FRAME_TAB_BAR_HEIGHT. Simplify code. (x_handle_net_wm_state): Remove frame_size_history_add call. (x_check_fullscreen): Remove frame_size_history_add call. Call change_frame_size with native height. (x_set_window_size_1): WIDTH and HEIGHT are now native. Remove some frame_size_history_add calls and add frame_size_history_extra calls instead. If the frame is not visible call adjust_frame_size directly instead of calling change_frame_size. (x_set_window_size): Drop PIXELWISE argument. WIDTH and HEIGHT represent native sizes now. (x_make_frame_visible, x_make_frame_invisible): Call frame_size_history_plain. * src/xterm.h (x_set_window_size): Drop last argument from extern declaration.
* Permit zero value for 'child-frame-border-width' parameter (Bug#46184)Martin Rudalics2021-02-061-9/+16
| | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/frames.texi (Layout Parameters): Update entry on 'child-frame-border-width' parameter. * src/frame.c (make_frame): Init child_frame_border_width to -1. (Fframe_child_frame_border_width): Return internal border width if child frame border width parameter is nil. (gui_report_frame_params): Report nil as child frame border width parameter if the frame value is negative. * src/frame.h (FRAME_INTERNAL_BORDER_WIDTH): Return value of child frame border width only if it is not negative. * src/xfns.c (Fx_create_frame): Default child frame border to -1 when recording it in its frame slot via gui_default_parameter. * src/nsfns.m (ns_set_child_frame_border_width): Handle nil ARG. (Fx_create_frame): Default child frame border width parameter to nil. * src/w32fns.c (w32_set_child_frame_border_width): Handle nil ARG. (Fx_create_frame): Default child frame border width parameter to nil. * src/xfns.c (x_set_child_frame_border_width): Handle nil ARG. (Fx_create_frame): Default child frame border width parameter to nil.
* Merge from origin/emacs-27Glenn Morris2021-02-031-1/+1
|\ | | | | | | | | 9c75434173 Fix build failure on macOS 10.7 (bug#46036) ca44ea18ef Improve documentation of auto-resize-tool/tab-bars
| * Fix build failure on macOS 10.7 (bug#46036)Alan Third2021-01-301-1/+1
| | | | | | | | | | * src/nsfns.m (ns_set_represented_filename): Define the NSNumber in a more compatible manner.
| * Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | | | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* | Add distinct controls for child frames' borders (Bug#45620)Alexander Miller2021-01-261-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The background of the 'child-frame-border' face instead of the 'internal-border' face now controls the color of child frames' borders. The 'child-frame-border-width' frame parameter is now used for the width of child frames' borders instead of internal-border-width', though we still fall back on using the latter if the former is not set. * doc/lispref/frames.texi (Frame Layout): Mention 'child-frame-border' and 'child-frame-border-width'. (Layout Parameters): Mention 'child-frame-border-width'. * etc/NEWS: Mention new face 'child-frame-border' and frame parameter 'child-frame-border-width'. * lisp/faces.el (child-frame-border): New face. * src/dispextern.h (enum face_id): Add CHILD_FRAME_BORDER_FACE_ID. * src/frame.c (Fframe_child_frame_border_width): New function. (gui_report_frame_params): Add entry for Qchild_frame_border_width. * src/frame.h (struct frame): New slot child_frame_border_width. (FRAME_CHILD_FRAME_BORDER_WIDTH): New inlined function. * src/nsfns.m (ns_set_child_frame_border_width): New function. (Fx_create_frame): Handle Qchild_frame_border_width parameter. (ns_frame_parm_handlers): Add ns_set_child_frame_border_width. * src/nsterm.m (ns_clear_under_internal_border): Handle CHILD_FRAME_BORDER_FACE_ID. * src/w32fns.c (w32_clear_under_internal_border): Handle CHILD_FRAME_BORDER_FACE_ID. (w32_set_internal_border_width): New function. (Fx_create_frame): Handle Qchild_frame_border_width parameter. (w32_frame_parm_handlers): Add w32_set_child_frame_border_width. * src/xfaces.c (lookup_basic_face, realize_basic_faces): Handle CHILD_FRAME_BORDER_FACE_ID. * src/xfns.c (x_set_child_frame_border_width): New function. (Fx_create_frame): Handle Qchild_frame_border_width parameter. (x_frame_parm_handlers): Add x_set_child_frame_border_width. * src/xterm.c (x_clear_under_internal_border) (x_after_update_window_line): Handle CHILD_FRAME_BORDER_FACE_ID.
* | Avoid a few compilation warnings in Objective-C code.Philipp Stephani2021-01-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | * src/nsfns.m (Fns_frame_restack): Remove unused variable 'flag'. * src/nsmenu.m (ns_update_menubar): Remove unused variable 'pool'. * src/nsterm.m (focus_view, hide_bell): Define conditionally. (ns_update_end): Define variable 'view' conditionally. (ns_redraw_scroll_bars): Don't define unused function. (copyRect): Don't perform arithmetic on 'void' pointers. (nswindow_orderedIndex_sort): Make static.
* | Fix child frame restacking on NS (bug#41422)Alan Third2021-01-031-7/+7
| | | | | | | | | | | | | | | | | | | | * src/nsfns.m (Fns_frame_restack): Use new restackWindow method. * src/nsterm.m ([EmacsWindow orderFront:]): ([EmacsWindow makeKeyAndOrderFront:]): (nswindow_orderedIndex_sort): ([EmacsWindow orderBack:]): ([EmacsWindow restackWindow:above:]): Override superclass methods to handle child windows the way we want.
* | Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | | | | | Run "TZ=UTC0 admin/update-copyright".
* | ; * src/nsfns.m (all_nonzero_ascii): comment correctionMattias Engdegård2020-12-211-1/+1
| |
* | Remove unnecessary string conversionAlan Third2020-12-201-4/+2
| | | | | | | | | | * src/nsfns.m (ns_set_represented_filename): NSString can load List strings directly now.
* | Extend NSString further and use the new methodsAlan Third2020-08-221-40/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/nsfns.m (ns_set_icon_name): (ns_set_name): (ns_set_represented_filename): (ns_implicitly_set_icon_type): (ns_set_icon_type): (ns_appkit_version_str): (Fx_create_frame): (Fns_read_file_name): (Fns_get_resource): (Fns_set_resource): (Fns_list_colors): (Fns_perform_service): (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 methods.
* | Fix NS crash on invalid frame title string (bug#42904)Mattias Engdegård2020-08-201-14/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 gracefully. * 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.
* | Use 65535 as color-values scale value in the NS backendMattias Engdegård2020-06-071-2/+2
| | | | | | | | | | | | | | * src/nsfns.m (Fxw_color_values): Scale with 65535 instead of 65280, for uniformity with other backends. * lisp/faces.el (color-values): Update doc string. * doc/lispref/frames.texi (Color Names): Update examples.
* | Improve integer range checkingPaul Eggert2020-04-051-11/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/bignum.c (check_integer_range, check_uinteger_max) (check_int_nonnegative): New functions. * src/frame.c (check_frame_pixels): New function. (Fset_frame_height, Fset_frame_width, Fset_frame_size): Use it. * src/lisp.h (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): Remove these macros. Unless otherwise specified, all callers replaced by calls to check_integer_range, check_uinteger_range, check_int_nonnegative. * src/frame.c (gui_set_right_divider_width) (gui_set_bottom_divider_width): * src/nsfns.m (ns_set_internal_border_width): * src/xfns.c (x_set_internal_border_width): Using check_int_nonnegative means these functions no longer incorrectly reject negative bignums; they treat them as 0, just like negative fixnums.
* | Fix macOS/GNUstep compilation warningsAlan Third2020-03-021-74/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/nsfns.m (handlePanelKeys): Unused function. * src/nsterm.m (ns_set_appearance): ([EmacsView initFrameFromEmacs:]): Use EmacsWindow type instead of NSWindow. (ns_clip_to_row): Unused function. (ns_dumpglyphs_stretch): Remove unused variable. (ns_term_init): ([EmacsWindow setAppearance]): Only compile on macOS. (ns_mouse_position): Make sure f is initialised on GNUstep. * src/emacs.c (main): Move allocation of autorelease pool to before first use.
* | Draw to offscreen buffer on macOSAlan Third2020-01-241-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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_update_end): (ns_focus): (ns_unfocus): Handle drawing to offscreen buffer. (ns_clip_to_row): Use ns_row_rect. (ns_copy_bits): Remove unused function. (ns_scroll_run): (ns_shift_glyphs_for_insert): Use new scrolling method. (ns_draw_fringe_bitmap): (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 buffer. ([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.
* | Merge from origin/emacs-27Glenn Morris2020-01-241-24/+1
|\| | | | | | | | | | | | | | | 0bed550e21 (origin/emacs-27) Remove EmacsOpenPanel and EmacsSavePanel... a0336029db * doc/emacs/files.texi (Auto Save Files): Improve indexing... 57fb8b10c1 Fix inaccurate wording in the Emacs manual 1c487747ab Update ERC module URLs 7d1e9c943f Minor doc string clarification in use-hard-newlines
| * Remove EmacsOpenPanel and EmacsSavePanel (bug#38031)Alan Third2020-01-241-24/+1
| |
* | Merge from origin/emacs-27Glenn Morris2020-01-111-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | f0ebd919c1 (origin/emacs-27) ; * doc/lispref/anti.texi (Antinews): Fi... 6f059159ee Update Acknowledgments sections e1262d45f9 Update Antinews in ELisp manual fd8128f0c1 ; Move the description of define-inline to a different nod... 524441d6b3 Improve wording in the ELisp manual 8addfa91c8 Reset to the standard value when reverting session's custo... d6f9b09777 Fix saving multiple themes c556aabde8 Calc: fix interval entry (bug#39040) 91cd3c1372 Fix horizontal line display in Custom buffers 15c8e984ae ; * etc/NEWS: Fix a typo. ff8996a337 flymake: fix typo in variable binding (bug#38752) 16eaaa07e6 ; Minor spelling fixes 5efe795659 Update Antinews in the Emacs manual 5841240295 Use NSNumber instead of BOOL (bug#39047) beec9f64a5 Add comment on fido-mode's file-sorting semantics eb3c6ad325 Consider non-string minibuffer-default in icomplete # Conflicts: # etc/NEWS
| * Use NSNumber instead of BOOL (bug#39047)Väinö Järvelä2020-01-091-2/+2
| | | | | | | | | | | | * src/nsfns.m (ns_set_represented_filename): Use correct type. Copyright-paperwork-exempt: yes
* | Fix NS frame parameters (bug#39000)Alan Third2020-01-071-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/frame.c (make_frame): Use new system default setting. * src/frame.h (enum ns_appearance_type): Add new system default setting. * 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'.
* | Merge from origin/emacs-27Paul Eggert2020-01-011-1/+1
|\| | | | | | | | | | | | | | | | | | | | | 186152ba40 Pacify gcc -Wunused-function on Ubuntu 18.04.3 4cd143aded Fix copyright years by hand 365e01cc9f Update copyright year to 2020 cd2c156163 ; * etc/NEWS: Make the description of XDG fallback more ac... # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex
| * Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | | | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* | Remove some undefined behavior related to left shifts.Philipp Stephani2019-12-231-2/+8
|/ | | | | | | | | | | | | Found by UBSan. * src/nsfns.m (ns_set_foreground_color, ns_set_background_color): * src/nsimage.m (getPixelAtX:Y:): * src/nsterm.m (ns_color_index_to_rgba): Add explicit casts to avoid undefined behavior when left-shifting beyond the bounds of the int type. * src/macfont.m (METRICS_VALUE): Add explicit casts to avoid undefined behavior when left-shifting a negative value.
* Check if file is in iCloud drive (bug#38618)Alan Third2019-12-221-0/+11
| | | | | * src/nsfns.m (ns_set_represented_filename): Check whether the file is a `ubiquitous item', and if so don't display a proxy icon.
* Fix some quoting glitches in doc stringsPaul Eggert2019-11-081-1/+1
| | | | This also fixes a misplaced "only".