Commit Graph

179 Commits

Author SHA1 Message Date
Matthias Clasen
5f9bcd0409 accelgroup: Expand translator comment
Add details about the use of KP.
2020-05-25 22:50:03 -04:00
Matthias Clasen
bd3f4599ed Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

Closes #2778

See merge request GNOME/gtk!1966
2020-05-26 02:41:37 +00:00
Matthias Clasen
a55d179215 accelgroup: Drop some unused code 2020-05-25 20:56:09 -04:00
Emmanuele Bassi
7de9eb005e Add a comment for translators
"KP" refers to the numeric keypad, in this context.

Fixes: #2783
2020-05-24 15:20:13 +01:00
Matthias Clasen
061f257e83 accelgroup: Use Unicode in string literals
Its 2020, non-ASCII characters are not taboo anymore.
2020-05-21 19:38:36 -04:00
Matthias Clasen
c58d9446f4 Differentiate keypad keysyms in accelerators
When displaying accelerators, differentiate keypad
symbols with a 'KP' prefix. Fixing a 17 year old bug.

Update expected output in accelerator tests.

Fixes: #227
2020-05-21 19:38:19 -04:00
Chun-wei Fan
d0a8d263ac gtk/gtkaccelgroup.c: Fix build on Visual Studio
Visual Studio does not allow one to initialize structure members with
non-constant expressions, caused by using strlen(s), so fix this by
using sizeof(s) - 1 instead.
2020-04-29 15:02:03 +08:00
Timm Bäder
e583349956 accelgroup: Restructure gtk_accelerator_name
To fix invalid reads and make the function a bit shorter while we're at
it.

Fixes #2602
2020-04-17 15:21:00 +02:00
Matthias Clasen
ad1bc75dd2 accelgroup: Fix an invalid write
This was lost by accident in d110fddbce.

Fixes: #2602
2020-04-10 08:24:03 -04:00
Matthias Clasen
70fbf8dbb6 accelgroup: Small documentation updates
Mention GtkShortcutTrigger, and remove references
to <Release>.
2020-04-06 16:32:03 -04:00
Matthias Clasen
1de7719e34 Drop gtk_accelerator_set_default_mod_mask
Our new approach to modifiers works with a fixed set,
there is really no need to customize the modifier
masks if the backends are all supposed to deliver
the same modifiers.
2020-04-06 16:32:03 -04:00
Matthias Clasen
c297d45b8a gtk: Stop using modifier intents
Reviewing the existing settings, the only backend with
some differences in the modifier intent settings is OS X,
and we would rather have that implemented by interpreting
the existing modifiers in the appropriate way.

                X11      Wayland  Win32    OS X

primary         ctrl     ctrl     ctrl     mod2
mnemonic        alt      alt      alt      alt
context menu    -        -        -        ctrl
extend sel      shift    shift    shift    shift
modify sel      ctrl     ctrl     ctrl     mod2
no text         alt|ctrl alt|ctrl alt|ctrl mod2|ctrl
shift group     varies   -        -        alt

GTK now uses the following modifiers:

primary         ctrl
mnemonic        alt
extend sel      shift
modify sel      ctrl
no text         alt|ctrl

The context menu and shift group intents were not used
in GTK at all.

Update tests to no longer expect <Primary> to roundtrip
through the accelerator parsing and formatting code.
2020-04-06 16:32:03 -04:00
Matthias Clasen
5071367794 gtk: Remove handling of virtual modifiers
These are going away. We expect to just have
named modifiers in modifier masks now, so we
longer juggle 'real' and 'virtual' modifiers.
2020-04-06 15:13:54 -04:00
Matthias Clasen
d110fddbce gtk: Stop using GDK_MODx_MASK
These are never used in practice, and we never want to
see them in the UI, so stop supporting them. This is
in preparation for cleaning up GdkModifierType.
2020-04-06 01:40:49 -04:00
Matthias Clasen
b02db72e17 Rename GDK_MOD1_MASK to GDK_ALT_MASK
We've hardcoded Mod1 = Alt for a long time, there is
no need to keep the confusing naming around anymore.
2020-04-06 01:40:49 -04:00
Matthias Clasen
4495bacfd1 gtk: Use display apis for keymap mapping
This removes the last uses of GdkKeymap from GTK.
2020-04-06 01:40:49 -04:00
Matthias Clasen
234a21905c gtk: Stop using keymap apis
Stop using most keymap apis in GTK. Only a few calls
related to virtual modifiers are left.
2020-04-06 01:40:49 -04:00
Benjamin Otte
bb4fbe3d8f accels: Remove GtkAccelGroup 2020-03-25 23:14:44 -04:00
Benjamin Otte
90a34312d4 accel: Add display arg to gtk_accelerator_parse_with_keycode()
It was using the default display unconditionally.
2020-03-25 23:14:28 -04:00
Benjamin Otte
580863b112 accelerators: Make gtk_accelerator_parse() return TRUE/FALSE
A parse function should return success or not. So do that.
2020-03-25 23:14:28 -04:00
Benjamin Otte
cdd33bbee6 accelgroup: Remove unneeded APIs
After the removal of GtkAccelMap, these things are no longer necessary.
2020-03-25 23:14:27 -04:00
Emmanuele Bassi
bca1f6b64f gtk: Remove GtkAccelMap
Now that accel paths are gone, the object managing them isn't needed
anymore either.
2020-03-25 23:14:27 -04:00
Benjamin Otte
2244eeb727 gdk: Remove GDK_RELEASE_MASK
It was only ever supported by keybindings and those are gone now.
2020-03-25 23:14:27 -04:00
Benjamin Otte
90c7f4608a accelgroup: Add gtk_accel_group_print_label() 2020-03-25 23:14:27 -04:00
Benjamin Otte
66102dacf1 accellabel: Move gtk_accelerator_get_label() code
The function lives in gtkaccelgroup.c, so there's no need to have that
call a private function in another source file. Instead, make that
other source file call gtk_accelerator_get_label() instead.
2020-03-25 23:14:27 -04:00
Benjamin Otte
c1ee2fd54a accelgroup: Actually have a default mod mask
Don't just use a value without initializing it.
2020-03-25 22:36:03 -04:00
Matthias Clasen
31db615885 Revert "Merge branch 'disable-window-test' into 'master'"
This reverts commit 3ac4c76b18, reversing
changes made to 6ec96d2e98.
2020-03-19 18:03:16 -04:00
Benjamin Otte
ff6df33b6a accels: Remove GtkAccelGroup 2020-03-18 23:00:51 -04:00
Benjamin Otte
94ef20ea36 accel: Add display arg to gtk_accelerator_parse_with_keycode()
It was using the default display unconditionally.
2020-03-18 23:00:51 -04:00
Benjamin Otte
87df17e4ce accelerators: Make gtk_accelerator_parse() return TRUE/FALSE
A parse function should return success or not. So do that.
2020-03-18 23:00:51 -04:00
Benjamin Otte
4d0bab0c24 accelgroup: Remove unneeded APIs
After the removal of GtkAccelMap, these things are no longer necessary.
2020-03-18 23:00:51 -04:00
Emmanuele Bassi
b28da74e90 gtk: Remove GtkAccelMap
Now that accel paths are gone, the object managing them isn't needed
anymore either.
2020-03-18 23:00:51 -04:00
Benjamin Otte
8c23ccd86e gdk: Remove GDK_RELEASE_MASK
It was only ever supported by keybindings and those are gone now.
2020-03-18 23:00:50 -04:00
Benjamin Otte
e050288d07 accelgroup: Add gtk_accel_group_print_label() 2020-03-18 23:00:50 -04:00
Benjamin Otte
93af53a2fc accellabel: Move gtk_accelerator_get_label() code
The function lives in gtkaccelgroup.c, so there's no need to have that
call a private function in another source file. Instead, make that
other source file call gtk_accelerator_get_label() instead.
2020-03-18 23:00:50 -04:00
Benjamin Otte
4e3ac8f52b accelgroup: Actually have a default mod mask
Don't just use a value without initializing it.
2020-03-18 23:00:50 -04:00
Matthias Clasen
2a7b5d8229 accelgroup: Fix a buffer overrun
gtk_accelerator_parse_with_keycode can
overrun its buffer for certain inputs.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/2325
2019-12-23 23:17:29 -05:00
Matthias Clasen
651a2b2e40 accel label: Make final 2019-05-26 21:01:33 -04:00
Matthias Clasen
8755d884f3 Remove a lot of Since annotations
4.0 will represent a clean epoch. We don't want to have
lots of noise in the docs about 2.x or 3.x.
2018-06-25 19:55:04 -04:00
Daniel Boles
b7291ce533 AccelGroup: Remove @See_also of deleted function
gtk_item_factory_new() is not a thing that exists.

Also, maybe the lack of space after the colon was what stopped the link
from rendering.
2018-04-09 19:45:10 +01:00
Matthias Clasen
4c150d8eb5 The big versioning cleanup
Remove all the old 2.x and 3.x version annotations.
GTK+ 4 is a new start, and from the perspective of a
GTK+ 4 developer all these APIs have been around since
the beginning.
2018-02-06 01:16:32 -05:00
Matthias Clasen
e92c0e85ec Replace gdk_keymap_get_for_display by gdk_display_get_keymap
Replace all uses of the old function by the new one.
No functional change.
2017-12-15 07:44:58 -05:00
Matthias Clasen
fd85ff0c7a Drop gdk_keymap_get_default()
It is better to use the explicit keymap getter - the
default display may not even use the current gdk backend.
2017-12-14 23:57:54 -05:00
Timm Bäder
d963ede668 Remove GtkUIManager 2016-10-18 00:34:41 +02:00
Emmanuele Bassi
1f132607f7 gtk: Use appropriate constness for variables 2016-10-17 11:44:11 +01:00
Alberto Ruiz
496f0892fc introspection: This patch fixes nullable return values fixes for the following symbols in gtk
gtk_accel_group_query
  gtk_accel_group_from_accel_closure
  gtk_accel_label_get_accel_widget
  gtk_accessible_get_widget
  gtk_actionable_get_action_name
  gtk_app_chooser_get_app_info
  gtk_app_chooser_button_get_heading
  gtk_app_chooser_dialog_get_heading
  gtk_application_get_window_by_id
  gtk_assistant_get_nth_page
  gtk_binding_set_find
  gtk_builder_get_object
  gtk_builder_lookup_callback_symbol
  gtk_builder_get_application
  gtk_button_get_image
  gtk_cell_area_get_focus_from_sibling
  gtk_cell_renderer_start_editing
  gtk_cell_view_get_model
  gtk_cell_view_get_displayed_row
  gtk_clipboard_get_owner
  gtk_container_get_focus_child
  gtk_container_get_focus_vadjustment
  gtk_container_get_focus_hadjustment
  gtk_dialog_get_widget_for_response
  gtk_drag_get_source_widget
  gtk_drag_dest_get_target_list
  gtk_drag_source_get_target_list
  gtk_entry_completion_get_model
  gtk_entry_completion_compute_prefix
  gtk_expander_get_label_widget
  gtk_file_chooser_get_filename
  gtk_file_chooser_get_current_folder
  gtk_file_chooser_get_uri
  gtk_file_chooser_get_current_folder_uri
  gtk_file_chooser_get_preview_widget
  gtk_file_chooser_get_preview_file
  gtk_file_chooser_get_preview_filename
  gtk_file_chooser_get_preview_uri
  gtk_file_chooser_get_extra_widget
  gtk_file_chooser_get_filter
  gtk_file_chooser_native_get_accept_label
  gtk_file_chooser_native_get_cancel_label
  gtk_file_filter_get_name
  gtk_font_chooser_get_font_family
  gtk_font_chooser_get_font_face
  gtk_font_chooser_get_font
  gtk_font_chooser_get_font_desc
  gtk_font_chooser_get_font_map
  gtk_frame_get_label
  gtk_gesture_get_device
  gtk_gesture_get_window
  gtk_gl_area_get_error
  gtk_header_bar_get_title
  gtk_header_bar_get_subtitle
  gtk_header_bar_get_custom_title
  gtk_icon_info_get_filename
  gtk_icon_view_get_path_at_pos
  gtk_icon_view_get_model
  gtk_image_get_pixbuf
  gtk_image_get_animation
  gtk_label_get_mnemonic_widget
  gtk_label_get_attributes
  gtk_check_version
  gtk_menu_button_get_popup
  gtk_menu_button_get_menu_model
  gtk_menu_button_get_align_widget
  gtk_menu_button_get_popover
  gtk_menu_item_get_submenu
  gtk_menu_item_get_accel_path
  gtk_native_dialog_get_title
  gtk_native_dialog_get_transient_for
  gtk_notebook_get_nth_page
  gtk_notebook_get_tab_label_text
  gtk_notebook_get_menu_label
  gtk_notebook_get_menu_label_text
  gtk_notebook_get_group_name
  gtk_notebook_get_action_widget
  gtk_offscreen_window_get_surface
  gtk_offscreen_window_get_pixbuf
  gtk_paned_get_child1
  gtk_paned_get_child2
  gtk_places_sidebar_get_location
  gtk_places_sidebar_get_nth_bookmark
  gtk_plug_get_socket_window
  gtk_popover_get_default_widget
  gtk_progress_bar_get_text
  gtk_recent_filter_get_name
  gtk_recent_manager_lookup_item
  gtk_settings_get_default
  gtk_socket_get_plug_window
  gtk_stack_sidebar_get_stack
  gtk_stack_switcher_get_stack
  gtk_style_context_get_section
  gtk_style_context_get_parent
  gtk_style_context_get_frame_clock
  gtk_test_find_widget
  gtk_text_buffer_get_mark
  gtk_text_tag_table_lookup
  gtk_text_view_get_tabs
  gtk_text_view_toggle_cursor_visible
  gtk_text_view_get_window
  gtk_toolbar_get_nth_item
  gtk_tool_button_get_label
  gtk_tool_button_get_icon_name
  gtk_tool_button_get_label_widget
  gtk_tool_button_get_icon_widget
  gtk_tool_palette_get_drop_item
  gtk_tool_palette_get_drop_group
  gtk_tree_model_filter_convert_child_path_to_path
  gtk_tree_model_filter_convert_path_to_child_path
  gtk_tree_model_sort_convert_child_path_to_path
  gtk_tree_model_sort_convert_path_to_child_path
  gtk_tree_view_get_column
  gtk_tree_view_get_bin_window
  gtk_tree_view_column_get_widget
  gtk_tree_view_column_get_tree_view
  gtk_widget_get_frame_clock
  gtk_window_group_get_current_device_grab
  GtkTextBufferSerializeFunc
2016-01-08 12:18:23 +00:00
Matthias Clasen
b371fb09fb accel group: Make gtk_accelerator_get_default_mod_mask more lenient
Make this function harmless to call without an open display connection.
This happens during gobject introspection, which instantiates GTK+
types without calling gtk_init.
2015-08-29 18:09:58 -04:00
John Ralls
c55ff6e41f Bug 736125 - The default gtk accelerator mod mask does not include all default backend modifiers 2015-08-25 15:54:58 -04:00
Sébastien Wilmet
3f4b9d8164 Replace uses of g_memmove() by memmove()
g_memmove() is deprecated, it is a simple macro that just calls
memmove() with the same parameters.

Reviewed by Paolo Borelli on IRC.
2014-08-16 15:50:17 +02:00
Matthias Clasen
7f6a964c47 Docs: Remove all entities and turn off sgml mode
With all element markup gone, it is time to turn off
sgml mode, and get rid of entities as well.
2014-02-09 17:58:07 -05:00