1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-26 07:11:34 -08:00
Commit graph

24 commits

Author SHA1 Message Date
Eli Zaretskii
cae528457c ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
Alan Mackenzie
fe5e789ff8 Expunge unused recompute-lucid-menubar, lucid-menu-bar-dirty-flag
This fixes bug #56502.  That function and these variables were manipulated by
the former file emacs-lisp/lmenu.el that was finally expunged from directory
obsolete/ by Stefan Kangas on 2020-05-15.  There remain references to them in
the *.c, and *.m files.

* src/keyboard.c (syms_of_keyboard): Remove declarations of the symbol and
variable.

* src/haikumenu.c (set_frame_menu_bar)
* src/keyboard.c (command_loop_1)
* src/nsmenu.m (ns_update_menubar)
* src/pgtkmenu.c (set_frame_menubar)
* src/xdisp.c (update_menu_bar)
* src/xmenu.c (set_frame_menubar): Remove calls to Qrecompute_lucid_menubar
contitional on Vlucid_menu_bar_dirty_flag.
2022-07-12 09:31:08 +00:00
Po Lu
b629cb3f54 Minor fixes to PGTK child frames
* src/gtkutil.c (xg_check_special_colors): Handle child frames
correctly.
* src/pgtkfns.c (pgtk_set_child_frame_border_width): Synchronize
code from X.  (bug#55588)
* src/pgtkmenu.c (pgtk_menu_show, pgtk_dialog_show): Allow in
child frames.  There are no problems here.
* src/pgtkterm.c (pgtk_mouse_position): Clean up coding style.
2022-05-23 13:30:33 +08:00
Po Lu
504779f744 More PGTK related cleanup
* src/pgtkfns.c (x_set_foreground_color, x_set_background_color)
(x_set_border_color, x_set_cursor_color, x_set_title)
(x_set_menu_bar_lines, x_set_tab_bar_lines, x_set_tool_bar_lines)
(x_set_child_frame_border_width, x_set_internal_border_width)
(x_set_icon_type, x_set_icon_name, x_set_cursor_type)
(x_set_mouse_color, x_set_undecorated, x_set_skip_taskbar)
(x_set_override_redirect, pgtk_frame_parm_handlers)
(Fx_create_frame): Rename most `x_' functions to `pgtk_' ones.
All callers changed.
* src/pgtkmenu.c (Fx_menu_bar_open_internal): Remove duplicate
doc string definition.
* src/pgtkterm.c (x_set_offset, pgtk_iconify_frame)
(x_set_parent_frame, x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_z_group, x_set_cursor_gc, x_set_mouse_face_gc)
(x_set_mode_line_face_gc, x_set_glyph_string_gc)
(x_set_glyph_string_clipping, x_set_glyph_string_clipping_exactly)
(x_setup_relief_color, x_setup_relief_colors)
(x_set_clip_rectangles, x_draw_relief_rect, x_draw_box_rect)
(x_draw_glyph_string_box, x_draw_image_relief)
(x_draw_image_foreground, x_draw_stretch_glyph_string)
(pgtk_draw_glyph_string, x_set_toolkit_scroll_bar_thumb)
(x_set_toolkit_horizontal_scroll_bar_thumb)
(pgtk_set_vertical_scroll_bar, pgtk_set_horizontal_scroll_bar)
(x_set_frame_alpha, frame_highlight, frame_unhighlight)
(pgtk_create_terminal, map_event): Rename most `x_' functions to
`pgtk_' ones.  All callers changed.
* src/pgtkterm.h: Update prototypes.
2022-04-15 16:44:18 +08:00
Po Lu
65fea3ff58 Fix menu bar activation on PGTK
* src/gtkutil.c (menu_bar_button_pressed_cb): Only update menu
bar if no menu is active, and the event window is not the widget
window itself.  Also make menu in use.
* src/pgtkmenu.c (popup_deactivate_callback): Make menu not in
use.
* src/xdisp.c (redisplay_internal): Return if popup_activated
also on PGTK.
2022-03-10 11:48:12 +08:00
Mattias Engdegård
a8245e1220 Replace ptrdiff_t with new specpdl_ref type for specpdl references
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.
2022-02-12 18:00:21 +01:00
Po Lu
b38c0d6a2f Clean up lots of #ifdef'd out code in PGTK files
Most of them are either relics from X or from the NS code
pgtkfns.c was copied from whole.

* src/pgtkfns.c (x_icon):
(pgtk_set_scroll_bar_foreground):
(pgtk_set_scroll_bar_background):
(Fx_create_frame):
(pgtk_window_is_ancestor):
(x_create_tip_frame):
* src/pgtkselect.c (syms_of_pgtkselect):
* src/pgtkterm.c (pgtk_iconify_frame):
(x_set_frame_alpha):
(button_event): Remove defined out code that cannot make sense.

* src/pgtkmenu.c (show_help_event): Remove ifdef'd out code and
reword comment.
2022-02-06 09:18:59 +08:00
Eli Zaretskii
823b6b8d26 ; Add 2022 to copyright years. 2022-01-01 07:07:15 -05:00
Po Lu
1f34f072be Fix copyright dates in some files belonging to the pgtk port
* src/pgtkgui.h:
* src/pgtkim.c:
* src/pgtkmenu.c:
* src/pgtkselect.c:
* src/pgtkselect.h:
* src/pgtkterm.c:
* src/pgtkterm.h: Fix copyright dates to say '2021'.
2021-12-31 21:08:23 +08:00
Po Lu
87cdc6369a Fix coding style
* src/pgtkmenu.c (popup_widget_loop):
(popup_deactivate_callback):
(show_help_event):
(menu_highlight_callback):
(menubar_selection_callback):
(popup_selection_callback):
(dialog_selection_callback):
(create_and_show_dialog): Fix coding style.
2021-12-12 11:26:04 +08:00
Po Lu
ae0f52b7b4 Prevent hangs when displaying a context menu on pgtk
* src/pgtkmenu.c (pgtk_menu_wait_for_event, popup_widget_loop):
Remove unnecessary workarounds.
2021-12-12 11:24:29 +08:00
Po Lu
72d223a544 Enable shallow menu bar updates on PGTK
* src/gtkutil.c (menu_bar_button_pressed_cb): New function.
(create_menus): Connect button press event signal.

* src/pgtkmenu.c (set_frame_menubar): Allow shallow updates.
2021-11-30 13:55:16 +08:00
Po Lu
105205c86b Get rid of pgtk_select and use xg_select instead
* src/pgtkmenu.c (pgtk_menu_wait_for_event): Get rid
of pgtk_select.
* src/pgtkterm.h (pgtk_select):
* src/pgtkterm.c (pgtk_select): Delete function.
* src/process.c (wait_reading_process_output): Stop
using pgtk_select.
2021-11-30 08:52:00 +08:00
Yuuki Harano
647e4a92bb * src/pgtkmenu.c (show_help_event): Let emacs not show menu tooltips 2021-05-08 23:46:49 +09:00
Yuuki Harano
ed2205a288 Remove unused arg as xmenu.c
* src/pgtkmenu.c (Fx_menu_bar_open_internal): Remove unused arg.
(pgtk_activate_menubar): Remove unused arg.
(set_frame_menubar): Remove unused arg.
(initialize_frame_menubar): Remove unused arg.
2021-02-06 19:19:03 +09:00
Jeff Walsh
886fcb237d Update copyright dates for PGTK files
* src/pgtkfns.c:
* src/pgtkgui.h:
* src/pgtkim.c:
* src/pgtkmenu.c:
* src/pgtkselect.c:
* src/pgtkselect.h:
* src/pgtkterm.c:
* src/pgtkterm.h: Update copyright dates - No Funtional Changes
2020-11-24 12:24:40 +11:00
Yuuki Harano
4dbea5be17 Fix Gtk warnings
* src/gtkutil.c (xg_frame_set_char_size): Call appropriate function
(xg_set_undecorated): Do nothing if child frame.
(xg_set_no_focus_on_map): Do nothing if child frame.
(xg_set_no_accept_focus): Do nothing if child frame.
(xg_set_frame_icon): Do nothing if child frame.
(xg_get_file_name): Do nothing if child frame.
(xg_get_font):
* src/pgtkterm.c (pgtk_focus_frame): Do nothing if child frames.
(x_set_frame_alpha): Select correct widget.
(x_new_focus_frame): Focus only when non-child frames.
(pgtk_set_event_handler): Don't set for child frames.
* src/pgtkfns.c (xg_set_icon): Do nothing if child frames.
(xg_set_icon_from_xpm_data): Do nothing if child frames.
(pgtk_set_sticky): Do nothing if child frames.
(Fx_show_tip): Do nothing if child frames.
(Fpgtk_set_mouse_absolute_pixel_position): Select correct widget.
(Fpgtk_mouse_absolute_pixel_position): Select correct widget.
* src/pgtkmenu.c (pgtk_menu_show):
(pgtk_dialog_show):
2020-11-24 12:24:40 +11:00
Yuuki Harano
af5b72575c * src/pgtkmenu.c: change coding style 2020-11-24 12:24:40 +11:00
Yuuki Harano
a167e23560 * src/pgtkmenu.c (set_frame_menubar): Suppress gcc warning 2020-11-24 12:24:40 +11:00
Yuuki Harano
fe2297ce7a * pgtkmenu.c (set_frame_menubar): fix empty menu. 2020-11-24 12:24:39 +11:00
Yuuki Harano
de7b0daf2b use pgtk_menu_set_in_use.
* ../src/pgtkfns.c:
	(Fx_file_dialog, clean_up_dialog):

	* src/pgtkmenu.c (pgtk_menu_wait_for_event):
2020-11-24 12:24:39 +11:00
Yuuki Harano
04bfe70138 implement popup/context menu
* ../src/pgtkterm.c (x_draw_glyph_string_background)
	(x_draw_glyph_string_foreground)
	(x_draw_composite_glyph_string_foreground)
	(x_draw_glyphless_glyph_string_foreground, x_draw_relief_rect)
	(x_draw_box_rect, x_draw_glyph_string_box, x_draw_image_relief)
	(x_draw_image_foreground, x_draw_image_glyph_string)
	(button_event):

	* src/pgtkterm.h (struct pgtk_display_info):

	* src/pgtkmenu.c (pgtk_menu_set_in_use)
	(pgtk_menu_wait_for_event, Fx_menu_bar_open_internal)
	(popup_widget_loop, pgtk_activate_menubar)
	(popup_deactivate_callback, show_help_event): new functions
	(menu_highlight_callback): remove
	(update_frame_menubar, popup_selection_callback, pop_down_menu)
	(create_and_show_popup_menu, cleanup_widget_value_tree)
	(pgtk_menu_show, dialog_selection_callback): new
	(create_and_show_dialog, pgtk_dialog_show, pgtk_popup_dialog)
	(popup_activated, Fmenu_or_popup_active_p, syms_of_pgtkmenu):
2020-11-24 12:24:39 +11:00
Jeff Walsh
c9e6b4486b Some work toward posframe on wayland
* src/pgtkterm.c (flip_cr_context, x_set_offset): update for new functionality
(pgtk_set_window_size): remove dead code
(x_set_parent_frame): cleanup trace code
(pgtk_cr_update_surface_desired_size): add comment

* src/pgtkmenu.c (Fmenu_or_popup_active_p):

* src/pgtkfns.c (pgtk_frame_parm_handlers, Fx_create_frame):

* src/gtkutil.c (xg_create_frame_widgets, x_wm_set_size_hint):

* src/gtkutil.c (xg_create_frame_widgets):

hacky GTK offsets taht will need better calculations

Get parent frame's editor widget allocation for the offset

Fix child-frame offsets for negative values

Add some function comments around the new double context handling
2020-11-24 12:24:39 +11:00
Jeff Walsh
cdc04b4509 Implement menubar for pgtk emacs
* src/xdisp.c (display_menu_bar): add pgtk case

	* ../src/pgtkterm.c (pgtk_create_terminal): update hooks
	(pgtk_menu_show): delete

	* src/pgtkterm.h: add decls

	* src/pgtkmenu.c: new file

	* ../src/pgtkfns.c (x_set_menu_bar_lines)
	(x_change_tool_bar_height, x_set_tool_bar_lines)
	(Fx_create_frame):
2020-11-22 14:46:55 +11:00